From ea5d8e1e4c6b81b514352ada1786f5f035e21ff7 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期二, 11 十一月 2025 16:38:42 +0800
Subject: [PATCH] fix: bug
---
src/views/System/ModuleManage.vue | 41 ++++++++++++++++++++++++++++-------------
1 files changed, 28 insertions(+), 13 deletions(-)
diff --git a/src/views/System/ModuleManage.vue b/src/views/System/ModuleManage.vue
index 217df8b..145fbf4 100644
--- a/src/views/System/ModuleManage.vue
+++ b/src/views/System/ModuleManage.vue
@@ -19,6 +19,14 @@
@change="getAllModule()"
/>
</QueryFilterItem>
+ <QueryFilterItem v-if="state.userType === EnumUserType.Enterprise">
+ <FieldRadio
+ v-model="state.enterpriseType"
+ :value-enum="EnumEnterpriseTypeText"
+ buttonStyle
+ @change="getAllModule()"
+ />
+ </QueryFilterItem>
<div class="query-filter-list-item">
<SearchInput
v-model="state.searchValue"
@@ -124,6 +132,8 @@
EnumMenuType,
EnumClientTypeText,
EnumUserTypeText,
+ EnumEnterpriseTypeText,
+ EnumUserType,
} from '@/constants';
import SubModuleEditDrawer from './components/SubModuleEditDrawer.vue';
import AddOrEditModuleDialog from './components/AddOrEditModuleDialog.vue';
@@ -205,6 +215,7 @@
group: 'default',
userType: EnumUserType.Operation,
clientType: EnumClientType.PcWeb,
+ enterpriseType: EnumEnterpriseType.Supplier,
};
const state = reactive({ ...BaseState });
const moduleTreeStore = ref<TreeStore<TreeModuleDtoGroupDto>>();
@@ -248,15 +259,16 @@
});
async function getAllModule() {
try {
- let res = await menuServices.getMenus(
- {
- userType: state.userType,
- clientType: state.clientType,
- },
- {
- showLoading: false,
- }
- );
+ let params: API.APIgetMenusParams = {
+ userType: state.userType,
+ clientType: state.clientType,
+ };
+ if (state.userType === EnumUserType.Enterprise) {
+ params.enterpriseType = state.enterpriseType;
+ }
+ let res = await menuServices.getMenus(params, {
+ showLoading: false,
+ });
const treeStore = ModuleUtils.convertToModuleGroup(flattenTree(res));
moduleTreeStore.value = treeStore;
originModuleTree.value = [...treeStore.data];
@@ -397,6 +409,7 @@
let params: API.SaveMenuCommand = {
userType: state.userType,
clientType: state.clientType,
+ enterpriseType: state.enterpriseType,
code: editForm.enCode,
name: editForm.name,
type: editForm.isMenu ? EnumMenuType.Menu : EnumMenuType.Page,
@@ -529,7 +542,7 @@
name: subModule.name,
group: state.group,
// location: 'string',
- width: subModule.width,
+ width: !!subModule.width ? subModule.width.toString() : undefined,
sort: subModule.sortCode,
};
if (subModule.id) {
@@ -549,7 +562,9 @@
getBaseModuleGetAllSubModule(currentDrawerModule.value, drawerState.type);
Message.successMessage('淇濆瓨鎴愬姛');
}
- } catch (error) {}
+ } catch (error) {
+ console.log('error: ', error);
+ }
}
async function handelBatchSaveColumn() {
try {
@@ -564,7 +579,7 @@
group.fields = columnModuleList.map((c) => ({
code: c.enCode,
name: c.name,
- width: c.width,
+ width: c.width.toString(),
sort: c.sortCode,
}));
}
@@ -576,7 +591,7 @@
fields: columnModuleList.map((c) => ({
code: c.enCode,
name: c.name,
- width: c.width,
+ width: c.width.toString(),
sort: c.sortCode,
})),
};
--
Gitblit v1.9.1