From 83af3dd309889489f541fc8e21894c9f79e5788c Mon Sep 17 00:00:00 2001 From: zhangwei <1504152376@qq.com> Date: 星期五, 22 八月 2025 16:09:58 +0800 Subject: [PATCH] 用户管理 --- src/views/mine/index.vue | 42 +++++++++++++++++++++++++++++++++--------- src/utils/auth.ts | 2 +- src/router/modules/item.ts | 2 +- src/store/types.ts | 1 + 4 files changed, 36 insertions(+), 11 deletions(-) diff --git a/src/router/modules/item.ts b/src/router/modules/item.ts index 2c2d0ee..e79575d 100644 --- a/src/router/modules/item.ts +++ b/src/router/modules/item.ts @@ -24,7 +24,7 @@ path: "/user", meta: { title: "鐢ㄦ埛绠$悊", - icon: "mdi:chart-timeline" + icon: "streamline-logos:my-space-logo" }, children: [ { diff --git a/src/store/types.ts b/src/store/types.ts index 93124e4..365f5d0 100644 --- a/src/store/types.ts +++ b/src/store/types.ts @@ -40,6 +40,7 @@ code?: string; name?: string; hasFlsh?: boolean; + id?: string; }; export type userType = { diff --git a/src/utils/auth.ts b/src/utils/auth.ts index b52149c..2049238 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -139,7 +139,7 @@ /** * 浜ゆ槗涓讳綋 浠g爜 鍚岃鑹蹭唬鐮� */ - transactionCode: string; + transactionCode?: string; /** * 浜ゆ槗涓讳綋鍚嶇О */ diff --git a/src/views/mine/index.vue b/src/views/mine/index.vue index f6ffedb..0bb79f7 100644 --- a/src/views/mine/index.vue +++ b/src/views/mine/index.vue @@ -13,14 +13,28 @@ import { enterpriseTypes } from "@/api/register/index"; import { initRouter, getTopMenu, handleAliveRoute } from "@/router/utils"; const isManager = useUserStoreHook().isManager; - +import { type CusExtendDto } from "@/utils/auth"; const ruleFormRef = ref<FormInstance>(); const isLoading = ref(false); const showDialog = ref(false); const nowRole = computed(() => { - return useUserStoreHook()?.nowRole; + if (!state?.ruleForm?.exRoles) { + return {}; + } + let nowRoleLiet; + let obj = {}; + let nowRole = useUserStoreHook()?.nowRole; + if (state?.ruleForm?.exRoles.length > 1) { + nowRoleLiet = state.ruleForm.exRoles.find(item => { + return item.exRoleId == nowRole.id; + }); + obj = Object.assign(nowRole, nowRoleLiet); + } else { + obj = Object.assign(nowRole, state.ruleForm.exRoles[0]); + } + return obj; }); -const userInfo = computed(() => { +const userInfo = computed<CusExtendDto>(() => { let obj = useUserStoreHook().enterpriseInfo; return obj; }); @@ -80,7 +94,8 @@ bankName: null, // string锛屽彲绌� // 浼佷笟閾惰璐﹀彿 bankAccount: null, // string锛屽彲绌� - bankAccountIMG: null + bankAccountIMG: null, + exRoles: null }, enterpriseList: [], type: "", @@ -197,10 +212,19 @@ // nowRole.value = useUserStoreHook()?.nowRole; if (nowRole.value) { state.ruleForm.transactionCode = nowRole.value.code; + // let nowRoleLiet; + // if (state.ruleForm.exRoles.length > 1) { + // nowRoleLiet = state.ruleForm.exRoles.find(item => { + // return item.exRoleId == nowRole.value.id; + // }); + // nowRole.value = Object.assign(nowRole.value, nowRoleLiet); + // } else { + // nowRole.value = Object.assign(nowRole.value, state.ruleForm.exRoles[0]); + // } // state.userInfo.transactionName = nowRole.value.name; } else { - state.ruleForm.transactionCode = route.query.code; - state.userInfo.enterpriseTypeName = route.query.name; + state.ruleForm.transactionCode = route.query.code as string; + // state.userInfo.enterpriseTypeName = route.query.name; } let restypes = await enterpriseTypes(); state.enterpriseList = restypes?.result; @@ -366,7 +390,7 @@ <el-descriptions v-if="state.userInfo.enterpriseName" class="margin-top" - title="浼佷笟璧勬枡" + title="" :column="3" border > @@ -378,8 +402,8 @@ <div class="cell-item">浜ゆ槗涓讳綋</div> </template> {{ nowRole?.name }} - <el-tag v-if="userInfo.steps == 2" type="success">瀹℃牳宸查�氳繃 </el-tag> - <el-tag v-else-if="userInfo.steps == 3" type="danger" + <el-tag v-if="nowRole.steps == 2" type="success">瀹℃牳宸查�氳繃 </el-tag> + <el-tag v-else-if="nowRole.steps == 3" type="danger" >璧勬枡鏈�氳繃 </el-tag> <el-tag v-else type="warning">璧勬枡瀹℃牳涓� </el-tag> -- Gitblit v1.9.1