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