| | |
| | | FastBtn, |
| | | ModuleColumns, |
| | | EnumMenuType, |
| | | EnumClientTypeText, |
| | | EnumUserTypeText, |
| | | } from '@/constants'; |
| | | import SubModuleEditDrawer from './components/SubModuleEditDrawer.vue'; |
| | | import AddOrEditModuleDialog from './components/AddOrEditModuleDialog.vue'; |
| | |
| | | loading: true, |
| | | searchValue: '', |
| | | group: 'default', |
| | | userType: EnumUserType.Operation, |
| | | clientType: EnumClientType.PcWeb, |
| | | }; |
| | | const state = reactive({ ...BaseState }); |
| | | const moduleTreeStore = ref<TreeStore<TreeModuleDtoGroupDto>>(); |
| | |
| | | try { |
| | | let res = await menuServices.getMenus( |
| | | { |
| | | userType: EnumUserType.Operation, |
| | | clientType: EnumClientType.PcWeb, |
| | | userType: state.userType, |
| | | clientType: state.clientType, |
| | | }, |
| | | { |
| | | showLoading: false, |
| | |
| | | async function handleAddOrEditModule() { |
| | | try { |
| | | let params: API.SaveMenuCommand = { |
| | | userType: EnumUserType.Operation, |
| | | clientType: EnumClientType.PcWeb, |
| | | userType: state.userType, |
| | | clientType: state.clientType, |
| | | code: editForm.enCode, |
| | | name: editForm.name, |
| | | type: editForm.isMenu ? EnumMenuType.Menu : EnumMenuType.Page, |
| | |
| | | async function saveMenu(params: API.SaveMenuCommand) { |
| | | try { |
| | | const res = await menuServices.saveMenu(params); |
| | | if (res) { |
| | | Message.successMessage('保存成功'); |
| | | getAllModule(); |
| | | editDialogFormVisible.value = false; |
| | | return res; |
| | | } |
| | | return res; |
| | | } catch (error) {} |
| | | } |
| | | |
| | |
| | | params.id = subModule.id; |
| | | } |
| | | if (drawerState.type === SubModuleType.Column) { |
| | | // const _subModule = subModule; |
| | | // params = { |
| | | // ...params, |
| | | // //@ts-ignore |
| | | // width: _subModule.width, |
| | | // // apiName: _subModule.apiName, |
| | | // // realColumn: _subModule.realColumn, |
| | | // // isShow: _subModule.isShow, |
| | | // }; |
| | | } else { |
| | | params.location = SubModuleKey[drawerState.type]; |
| | | } |
| | |
| | | if (columnModuleList.length > 0) { |
| | | const groups = currentDrawerModule.value.groups.map((group) => { |
| | | if (group.group === state.group) { |
| | | group.fields == |
| | | columnModuleList.map((c) => ({ |
| | | code: c.enCode, |
| | | name: c.name, |
| | | width: c.width, |
| | | sort: c.sortCode, |
| | | })); |
| | | group.fields = columnModuleList.map((c) => ({ |
| | | code: c.enCode, |
| | | name: c.name, |
| | | width: c.width, |
| | | sort: c.sortCode, |
| | | })); |
| | | } |
| | | return group; |
| | | }); |
| | |
| | | ...currentDrawerModule.value, |
| | | groups: groups, |
| | | }; |
| | | const res = await menuServices.saveMenu(params); |
| | | const res = await saveMenu(params); |
| | | if (res) { |
| | | getBaseModuleGetAllSubModule(currentDrawerModule.value, drawerState.type); |
| | | Message.successMessage('保存成功'); |