refactor: route
This commit is contained in:
parent
8885db8207
commit
80ab12d77d
4 changed files with 20 additions and 15 deletions
|
|
@ -88,7 +88,7 @@ async function triggerTaskOrder(opts: {
|
|||
id?: string;
|
||||
}) {
|
||||
const url = new URL(
|
||||
`/task-order/order/${opts.statusDialog === 'create' ? 'add' : opts.id}`,
|
||||
`/task-order/${opts.statusDialog === 'create' ? 'add' : opts.id}`,
|
||||
window.location.origin,
|
||||
);
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ async function triggerTaskReceive(opts: {
|
|||
statusDialog: 'info' | 'edit';
|
||||
id?: string;
|
||||
}) {
|
||||
const url = new URL(`/task-order/receive/${opts.id}`, window.location.origin);
|
||||
const url = new URL(`/task-order/${opts.id}`, window.location.origin);
|
||||
|
||||
window.open(url.toString(), '_blank');
|
||||
}
|
||||
|
|
|
|||
11
src/pages/09_task-order/PageView.vue
Normal file
11
src/pages/09_task-order/PageView.vue
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<script setup lang="ts">
|
||||
import OrderView from './order_view/MainPage.vue';
|
||||
import ReceiveView from './receive_view/MainPage.vue';
|
||||
|
||||
import { isRoleInclude } from 'src/stores/utils';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<OrderView v-if="!isRoleInclude(['messenger'])" />
|
||||
<ReceiveView v-if="isRoleInclude(['messenger'])" />
|
||||
</template>
|
||||
|
|
@ -587,7 +587,7 @@ watch([currentFormData.value.taskStatus], () => {
|
|||
});
|
||||
|
||||
function viewDocument(id: string) {
|
||||
window.open(`/task-order/doc/${id}`, '_blank');
|
||||
window.open(`/task-order/${id}/doc`, '_blank');
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
|
|
|
|||
|
|
@ -134,21 +134,15 @@ const routes: RouteRecordRaw[] = [
|
|||
component: () => import('pages/09_task-order/order_view/MainPage.vue'),
|
||||
},
|
||||
{
|
||||
path: '/task-order/doc/:id',
|
||||
path: '/task-order/:id',
|
||||
name: 'TaskReceiveView',
|
||||
component: () => import('pages/09_task-order/PageView.vue'),
|
||||
},
|
||||
{
|
||||
path: '/task-order/:id/doc',
|
||||
name: 'TaskOrderAdd',
|
||||
component: () => import('pages/09_task-order/document_view/MainPage.vue'),
|
||||
},
|
||||
{
|
||||
path: '/task-order/order/:id',
|
||||
name: 'TaskOrderView',
|
||||
component: () => import('pages/09_task-order/order_view/MainPage.vue'),
|
||||
},
|
||||
|
||||
{
|
||||
path: '/task-order/receive/:id',
|
||||
name: 'TaskReceiveView',
|
||||
component: () => import('pages/09_task-order/receive_view/MainPage.vue'),
|
||||
},
|
||||
|
||||
// Always leave this as last one,
|
||||
// but you can also remove it
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue