wupengfei
2025-11-13 78ee1301e4d77ee666ab603eef5c46abc5cda930
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.toString(),
      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 {