Commit 48302ce470d3a2305afe33c75b5257790d0d5b74
1 parent
e48147f8
feat: 新增首页只有管理员和总监可以查看&审核内部订单搜索修改
Showing
8 changed files
with
18 additions
and
16 deletions
src/enums/roleEnum.ts
src/router/guard/permissionGuard.ts
... | ... | @@ -25,7 +25,7 @@ export function createPermissionGuard(router: Router) { |
25 | 25 | userStore.getUserInfo.homePath && |
26 | 26 | userStore.getUserInfo.homePath !== PageEnum.BASE_HOME |
27 | 27 | ) { |
28 | - next('/home'); | |
28 | + next('/order'); | |
29 | 29 | return; |
30 | 30 | } |
31 | 31 | |
... | ... | @@ -38,7 +38,7 @@ export function createPermissionGuard(router: Router) { |
38 | 38 | try { |
39 | 39 | await userStore.afterLoginAction(); |
40 | 40 | if (!isSessionTimeout) { |
41 | - next((to.query?.redirect as string) || '/'); | |
41 | + next((to.query?.redirect as string) || '/order'); | |
42 | 42 | return; |
43 | 43 | } |
44 | 44 | } catch { | ... | ... |
src/router/routes/modules/project/dashboard.ts
... | ... | @@ -2,6 +2,7 @@ import type { AppRouteModule } from '/@/router/types'; |
2 | 2 | |
3 | 3 | import { LAYOUT } from '/@/router/constant'; |
4 | 4 | import { t } from '/@/hooks/web/useI18n'; |
5 | +import { RoleEnum } from '/@/enums/roleEnum'; | |
5 | 6 | |
6 | 7 | const dashboard: AppRouteModule = { |
7 | 8 | path: '/home', |
... | ... | @@ -9,10 +10,12 @@ const dashboard: AppRouteModule = { |
9 | 10 | component: LAYOUT, |
10 | 11 | redirect: '/home', |
11 | 12 | meta: { |
13 | + roles: [RoleEnum.ADMIN, RoleEnum.DATA_REPORT_USER], | |
14 | + | |
12 | 15 | hideChildrenInMenu: true, |
13 | 16 | orderNo: 1, |
14 | 17 | icon: 'ion:grid-outline', |
15 | - title: t('routes.dashboard.home'), | |
18 | + title: '报表分析', | |
16 | 19 | }, |
17 | 20 | children: [ |
18 | 21 | { | ... | ... |
src/store/modules/permission.ts
... | ... | @@ -133,7 +133,7 @@ export const usePermissionStore = defineStore({ |
133 | 133 | if (!roles) return true; |
134 | 134 | // 进行角色权限判断 |
135 | 135 | const user = userStore.getUserInfo; |
136 | - return user?.roleSmallVO.code === 'admin'; | |
136 | + return roles.includes(user?.roleSmallVO.code); | |
137 | 137 | // return roleList.some((role) => roles.includes(role)); |
138 | 138 | }; |
139 | 139 | ... | ... |
src/store/modules/user.ts
... | ... | @@ -92,7 +92,6 @@ export const useUserStore = defineStore({ |
92 | 92 | const { mode, ...loginParams } = params; |
93 | 93 | const data = await loginApi(loginParams, mode); |
94 | 94 | const { token, user } = data; |
95 | - console.log('%c [ user ]-95', 'font-size:13px; background:pink; color:#bf2c9f;', user); | |
96 | 95 | |
97 | 96 | this.setToken(token); |
98 | 97 | this.setUserInfo(user); |
... | ... | @@ -124,7 +123,7 @@ export const useUserStore = defineStore({ |
124 | 123 | router.addRoute(PAGE_NOT_FOUND_ROUTE as unknown as RouteRecordRaw); |
125 | 124 | permissionStore.setDynamicAddedRoute(true); |
126 | 125 | } |
127 | - await router.replace('home'); | |
126 | + await router.replace('order'); | |
128 | 127 | } |
129 | 128 | return userInfo; |
130 | 129 | }, | ... | ... |
src/views/project/approve/ReportPanel.vue
... | ... | @@ -3,8 +3,8 @@ |
3 | 3 | <template #bodyCell="{ column, record }"> |
4 | 4 | <template v-if="column.key === 'picUrl'"> |
5 | 5 | <img |
6 | - :width="100" | |
7 | - :height="100" | |
6 | + :width="50" | |
7 | + :height="50" | |
8 | 8 | :src="record?.orderBaseInfo?.smallPicUrl" |
9 | 9 | @click="handlePreview(record?.orderBaseInfo?.picUrl)" |
10 | 10 | /> | ... | ... |
src/views/project/approve/data.ts
1 | -import { useOrderInfo } from '/@/hooks/component/order'; | |
2 | -import { useOrderStoreWithOut } from '/@/store/modules/order'; | |
1 | +import { ref } from 'vue'; | |
2 | +import { queryNoOptions } from '../../../api/project/order'; | |
3 | 3 | |
4 | 4 | export function getFormConfig() { |
5 | - const orderStore = useOrderStoreWithOut(); | |
6 | - | |
7 | - const { innerNo } = useOrderInfo(orderStore); | |
8 | - | |
5 | + const innerNoOptions = ref([]); | |
9 | 6 | return { |
10 | 7 | labelWidth: 100, |
11 | 8 | schemas: [ |
... | ... | @@ -18,9 +15,12 @@ export function getFormConfig() { |
18 | 15 | }, |
19 | 16 | labelWidth: 70, |
20 | 17 | componentProps: { |
21 | - options: innerNo, | |
18 | + options: innerNoOptions, | |
22 | 19 | showSearch: true, |
23 | 20 | mode: 'multiple', |
21 | + onSearch: async (value: any) => { | |
22 | + innerNoOptions.value = await queryNoOptions('innerNo', value); | |
23 | + }, | |
24 | 24 | }, |
25 | 25 | }, |
26 | 26 | ], | ... | ... |
src/views/sys/login/LoginForm.vue
... | ... | @@ -148,7 +148,6 @@ |
148 | 148 | |
149 | 149 | const getImgCaptcha = async () => { |
150 | 150 | const data = await userStore.getImageCaptcha(); |
151 | - console.log('%c [ data ]-151', 'font-size:13px; background:pink; color:#bf2c9f;', data); | |
152 | 151 | imgCaptcha.value = data?.img; |
153 | 152 | imgCaptchaUuid.value = data?.uuid; |
154 | 153 | }; | ... | ... |