diff --git a/components.d.ts b/components.d.ts index eeb74da..84af7ee 100644 --- a/components.d.ts +++ b/components.d.ts @@ -8,8 +8,6 @@ export {} declare module 'vue' { export interface GlobalComponents { Breadcrumb: typeof import('./src/components/Breadcrumb/index.vue')['default'] - ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] - ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElButton: typeof import('element-plus/es')['ElButton'] ElCarousel: typeof import('element-plus/es')['ElCarousel'] ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem'] @@ -17,10 +15,8 @@ declare module 'vue' { ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] ElCol: typeof import('element-plus/es')['ElCol'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] - ElCountdown: typeof import('element-plus/es')['ElCountdown'] ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] ElDialog: typeof import('element-plus/es')['ElDialog'] - ElEmpty: typeof import('element-plus/es')['ElEmpty'] ElForm: typeof import('element-plus/es')['ElForm'] ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElIcon: typeof import('element-plus/es')['ElIcon'] @@ -30,19 +26,14 @@ declare module 'vue' { ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElOption: typeof import('element-plus/es')['ElOption'] - ElPageHeader: typeof import('element-plus/es')['ElPageHeader'] ElPagination: typeof import('element-plus/es')['ElPagination'] ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm'] ElProgress: typeof import('element-plus/es')['ElProgress'] - ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] - ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRow: typeof import('element-plus/es')['ElRow'] ElSelect: typeof import('element-plus/es')['ElSelect'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTag: typeof import('element-plus/es')['ElTag'] - ElTimeline: typeof import('element-plus/es')['ElTimeline'] - ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem'] ElUpload: typeof import('element-plus/es')['ElUpload'] EquipCard: typeof import('./src/components/equipCard.vue')['default'] EquipCardHall: typeof import('./src/components/equipCardHall/index.vue')['default'] diff --git a/env/.env.dev b/env/.env.dev index b7fd2d0..1fd9f19 100644 --- a/env/.env.dev +++ b/env/.env.dev @@ -7,8 +7,8 @@ VITE_API_URL = '/proxyApi' # 开发环境接口地址 # VITE_proxyTarget = 'http://10.40.92.74:8080' #盛旭 -VITE_proxyTarget = 'http://192.168.2.246:28080' # 马帅 -# VITE_proxyTarget = 'http://192.168.0.244:28580' # 马帅 +# VITE_proxyTarget = 'http://192.168.2.246:28080' # 马帅 +VITE_proxyTarget = 'http://192.168.0.244:28580' # 马帅 # VITE_proxyTarget = 'http://192.168.2.129:18080' # 马帅 # VITE_proxyTarget = 'http://10.40.92.185:9206' # 赵福海 ( 设备类型) diff --git a/src/components/header/index.vue b/src/components/header/index.vue index c606b2c..9881b0e 100644 --- a/src/components/header/index.vue +++ b/src/components/header/index.vue @@ -94,15 +94,17 @@ const onRolesCheck = () => { // 选择角色 const onSelectRoles = (type: number) => { if (type === 1) { - rolesName.value = '出租方' + rolesName.value = '1' userStore.editMenuList(1) userStore.editUserMenuList(1) localStorage.setItem('rolesType', '1') + router.replace({ name: 'my-lease' }) } else { - rolesName.value = '承租方' + rolesName.value = '2' userStore.editMenuList(2) userStore.editUserMenuList(2) localStorage.setItem('rolesType', '2') + router.replace({ name: 'my-lessee' }) } isRolesSelect.value = false } @@ -161,7 +163,16 @@ const onCarts = () => {
- 个人中心 + 个人中心
diff --git a/src/layout/header.vue b/src/layout/header.vue index a9cdf12..8b62a1a 100644 --- a/src/layout/header.vue +++ b/src/layout/header.vue @@ -14,7 +14,7 @@ const router = useRouter() const isRolesSelect = ref(false) const rolesName = ref('1') -rolesName.value = localStorage.getItem('rolesType') || 1 +rolesName.value = localStorage.getItem('rolesType') // 是否显示退出登录 const isShowLogout = computed(() => { @@ -106,12 +106,12 @@ const onRolesCheck = () => { // 选择角色 const onSelectRoles = (type: number) => { if (type === 1) { - rolesName.value = '出租方' + rolesName.value = '1' userStore.editMenuList(1) userStore.editUserMenuList(1) localStorage.setItem('rolesType', '1') } else { - rolesName.value = '承租方' + rolesName.value = '2' userStore.editMenuList(2) userStore.editUserMenuList(2) localStorage.setItem('rolesType', '2') @@ -173,7 +173,16 @@ const onCarts = () => {
- 个人中心 + 个人中心
diff --git a/src/router/index.ts b/src/router/index.ts index 5cca330..6b0728c 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -445,9 +445,102 @@ const routes: Array = [ keepAlive: false, AuthFlag: false }, + }, + + // 个人中心改造路由 + /** + * 1. 出租方 + */ + { + path: '/my-lease', // 主路由地址 + name: 'my-lease', + component: () => import('views/user/index.vue'), // 组件加载 + meta: { + title: '个人中心', + keepAlive: false, + AuthFlag: false + }, + redirect: '/my-lease/orderManagementCz', + children: [ + { + path: 'orderManagementCz', + name: 'orderManagementCz', + component: () => import('views/user/orderManagementCz/index.vue'), + meta: { + title: '订单管理(出租方)', + keepAlive: true, + AuthFlag: false, + isLogin: true + }, + }, + { + path: 'goodsManagement', + name: 'goodsManagement', + component: () => import('views/user/goodsManagement/index.vue'), + meta: { + title: '装备管理', + keepAlive: true, + AuthFlag: false, + isLogin: true + }, + }, + { + path: 'goodsUpdown', + name: 'goodsUpdown', + component: () => import('views/user/goodsUpdown/index.vue'), + meta: { + title: '基础信息', + keepAlive: true, + AuthFlag: false, + isLogin: true + }, + }, + + + + ] + }, + /** + * 2. 承租方 + */ + { + path: '/my-lessee', // 主路由地址 + name: 'my-lessee', + component: () => import('views/user/index.vue'), // 组件加载 + meta: { + title: '个人中心', + keepAlive: false, + AuthFlag: false + }, + redirect: '/my-lessee/sourcingNeed', + children: [ + { + path: 'sourcingNeed', + name: 'sourcingNeed', + component: () => import('views/user/sourcingNeed/index.vue'), + meta: { + title: '需求管理', + keepAlive: true, + AuthFlag: false, + isLogin: true + }, + }, + { + path: 'orderManagement', + name: 'orderManagement', + component: () => import('views/user/orderManagement/index.vue'), + meta: { + title: '订单管理', + keepAlive: true, + AuthFlag: false, + isLogin: true + }, + }, + ] } + ] @@ -459,6 +552,7 @@ const router = createRouter({ // 使页面跳转后滚动条恢复至顶部 router.beforeEach((to, from, next) => { + const store = mainStore() if (to.meta.isLogin && !to.meta.AuthFlag) { if (store.token) { diff --git a/src/store/user.ts b/src/store/user.ts index e8e1c8b..7db0157 100644 --- a/src/store/user.ts +++ b/src/store/user.ts @@ -28,9 +28,9 @@ export const useStore = defineStore('myUser', { { title: '订单管理', name: 'orderManagementCz' }, { title: '商品管理', name: 'goodsManagement' }, { title: '商品上下架', name: 'goodsUpdown' }, - { title: '机手管理', name: 'operatorManagement' }, - { title: '寻源竞价', name: 'sourcingBidding' }, - { title: '专区管理', name: 'zoneManag' }, + // { title: '机手管理', name: 'operatorManagement' }, + // { title: '寻源竞价', name: 'sourcingBidding' }, + // { title: '专区管理', name: 'zoneManag' }, ], isType: 1, leaseUserList: [ @@ -146,9 +146,9 @@ export const useStore = defineStore('myUser', { { title: '订单管理', name: 'orderManagementCz' }, { title: '商品管理', name: 'goodsManagement' }, { title: '商品上下架', name: 'goodsUpdown' }, - { title: '机手管理', name: 'operatorManagement' }, - { title: '寻源竞价', name: 'sourcingBidding' }, - { title: '专区管理', name: 'zoneManag' }, + // { title: '机手管理', name: 'operatorManagement' }, + // { title: '寻源竞价', name: 'sourcingBidding' }, + // { title: '专区管理', name: 'zoneManag' }, ] const lesseeList: any = [ { title: '寻源需求', name: 'sourcingNeed' },