| | |
| | | <template> |
| | | <LoadingLayout :loading="state.loading"> |
| | | <AppContainer> |
| | | <ProTableQueryFilterBar @on-reset="reset"> |
| | | <ProTableQueryFilterBar @on-reset="handleReset"> |
| | | <template #query> |
| | | <QueryFilterItem> |
| | | <FieldSelect |
| | |
| | | :before-change="() => setCategoryVis(row)" |
| | | /> |
| | | </template> |
| | | <template #category="{ row }"> |
| | | {{ row.category?.name }} |
| | | </template> |
| | | </ProTableV2> |
| | | </AppContainer> |
| | | <AddOrEditDictionaryDialog v-bind="dialogProps" /> |
| | |
| | | operationBtnMap, |
| | | }); |
| | | |
| | | const { dictionaryCategoryList, ensureQueryData, getDictionaryCategoryNameByCode } = |
| | | useGetDictionaryCategorySelect(); |
| | | const { dictionaryCategoryList, ensureQueryData } = useGetDictionaryCategorySelect(); |
| | | |
| | | const { getDictionaryDataNameByCode } = useDictionaryDataSelect({ |
| | | const { getDictionaryDataNameByCode, updateDictionaryDataSelect } = useDictionaryDataSelect({ |
| | | categoryCode: CategoryCode.IndustryCategory, |
| | | }); |
| | | |
| | |
| | | isDisabled: false, |
| | | field1: '', |
| | | field2: [] as UploadUserFile[], |
| | | title: '新增字典', |
| | | }, |
| | | editTitle: '编辑字典', |
| | | }); |
| | | |
| | | async function handleAddOrEdit() { |
| | |
| | | let res = await dictionaryServices.saveDictionaryData(params); |
| | | if (res) { |
| | | Message.successMessage('操作成功'); |
| | | updateDictionaryDataSelect(editForm.categoryId); |
| | | getList(paginationState.pageIndex); |
| | | dialogState.dialogVisible = false; |
| | | } |
| | |
| | | isDisabled: !row.isDisabled, |
| | | }; |
| | | let res = await dictionaryServices.setDictionaryDataIsDisabled(params); |
| | | updateDictionaryDataSelect(row.categoryId); |
| | | getList(paginationState.pageIndex); |
| | | return !!res; |
| | | } catch (error) {} |
| | | } |
| | | |
| | | async function handleReset() { |
| | | try { |
| | | const dictionaryCategoryList = await ensureQueryData(); |
| | | reset({ categoryId: dictionaryCategoryList[0].value }); |
| | | } catch (error) {} |
| | | } |
| | | </script> |