From aaa3488cfd2b219dcd5c29e5570a607660f8f4a7 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Tue, 3 Dec 2024 18:07:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 4 +- env/.env.dev | 3 +- src/layout/header.vue | 32 +- src/views/cart/index.vue | 41 +- src/views/equip/list.vue | 38 +- src/views/order/index.vue | 9 +- src/views/user/orderManagement/detail.vue | 1 + src/views/user/orderManagement/index.vue | 578 ++++++++++++-------- src/views/user/orderManagementCz/detail.vue | 3 +- src/views/user/orderManagementCz/index.vue | 130 ++--- 10 files changed, 518 insertions(+), 321 deletions(-) diff --git a/components.d.ts b/components.d.ts index 587d2ec..f759a60 100644 --- a/components.d.ts +++ b/components.d.ts @@ -18,12 +18,12 @@ 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'] + ElHeader: typeof import('element-plus/es')['ElHeader'] ElIcon: typeof import('element-plus/es')['ElIcon'] ElImage: typeof import('element-plus/es')['ElImage'] ElInput: typeof import('element-plus/es')['ElInput'] @@ -38,6 +38,8 @@ declare module 'vue' { ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRow: typeof import('element-plus/es')['ElRow'] ElSelect: typeof import('element-plus/es')['ElSelect'] + ElStep: typeof import('element-plus/es')['ElStep'] + ElSteps: typeof import('element-plus/es')['ElSteps'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTag: typeof import('element-plus/es')['ElTag'] diff --git a/env/.env.dev b/env/.env.dev index 3fe5b11..ff089c7 100644 --- a/env/.env.dev +++ b/env/.env.dev @@ -7,7 +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.2.246:28080' # 马帅 +VITE_proxyTarget = 'http://192.168.2.123:28080' # 梁超 # VITE_proxyTarget = 'http://192.168.0.244:28580' # 马帅 # VITE_proxyTarget = 'http://192.168.2.129:18080' # 马帅 diff --git a/src/layout/header.vue b/src/layout/header.vue index 65eccde..40f695f 100644 --- a/src/layout/header.vue +++ b/src/layout/header.vue @@ -10,15 +10,17 @@ const store: any = mainStore() const userStore = useStore() const cart = cartStore() const isType = localStorage.getItem('rolesType') - userStore.editMenuList(1) - const route = useRoute() const router = useRouter() const isRolesSelect = ref(false) const rolesName = ref('1') - rolesName.value = localStorage.getItem('rolesType') +const isAdmin = ref(false) +const roles = store.userInfo.roles +if (roles.length > 0) { + isAdmin.value = roles.some((e: any) => e.roleKey == 'admin') +} // 是否显示退出登录 const isShowLogout = computed(() => { @@ -109,6 +111,7 @@ $bus.on('callBackText', (val) => { // 角色切换按钮 const onRolesCheck = () => { + if (isAdmin.value) return isRolesSelect.value = true } // 选择角色 @@ -148,6 +151,18 @@ const onCarts = () => { name: 'cart', }) } + +const onJumpUser = () => { + const roles = store.userInfo.roles + if (roles.length > 0) { + const isAdmin = roles.some((e: any) => e.roleKey == 'admin') + if (isAdmin) { + window.location.replace(`http://192.168.0.244:17788?token=${store.token}`) + } else { + router.push({ name: 'my-user' }) + } + } +}