| | |
| | | }); |
| | | } |
| | | |
| | | function updateDictionaryCategorySelect() { |
| | | queryClient.invalidateQueries({ |
| | | queryKey: ['dictionaryServices/getDictionaryCategorySelect'], |
| | | }); |
| | | } |
| | | |
| | | function getDictionaryCategoryById(id: string) { |
| | | return dictionaryCategoryList.value.find((x) => x.value === id); |
| | | } |
| | |
| | | getDictionaryCategoryById, |
| | | getDictionaryCategoryNameByCode, |
| | | getDictionaryCategoryByCode, |
| | | updateDictionaryCategorySelect, |
| | | }; |
| | | } |
| | | |
| | |
| | | }); |
| | | } |
| | | |
| | | function updateDictionaryDataSelect() { |
| | | queryClient.invalidateQueries({ |
| | | queryKey: ['dictionaryServices/getDictionaryDataSelect'], |
| | | }); |
| | | } |
| | | |
| | | return { |
| | | dictionaryDataList, |
| | | ensureQueryData, |
| | |
| | | getDictionaryDataNameById, |
| | | getDictionaryDataNameByCode, |
| | | getDictionaryDataByCode, |
| | | updateDictionaryDataSelect, |
| | | }; |
| | | } |
| | |
| | | operationBtnMap, |
| | | }); |
| | | |
| | | const { dictionaryCategoryList, ensureQueryData, getDictionaryCategoryNameByCode } = |
| | | useGetDictionaryCategorySelect(); |
| | | const { dictionaryCategoryList, ensureQueryData } = useGetDictionaryCategorySelect(); |
| | | |
| | | const { getDictionaryDataNameByCode } = useDictionaryDataSelect({ |
| | | const { getDictionaryDataNameByCode, updateDictionaryDataSelect } = useDictionaryDataSelect({ |
| | | categoryCode: CategoryCode.IndustryCategory, |
| | | }); |
| | | |
| | |
| | | let res = await dictionaryServices.saveDictionaryData(params); |
| | | if (res) { |
| | | Message.successMessage('操作成功'); |
| | | updateDictionaryDataSelect(); |
| | | getList(paginationState.pageIndex); |
| | | dialogState.dialogVisible = false; |
| | | } |
| | |
| | | operationBtnMap, |
| | | }); |
| | | |
| | | const { updateDictionaryCategorySelect } = useGetDictionaryCategorySelect(); |
| | | const BaseState = { |
| | | loading: true, |
| | | }; |
| | |
| | | } |
| | | } |
| | | |
| | | const { dialogProps, handleAdd, handleEdit, editForm } = useFormDialog({ |
| | | const { dialogProps, handleAdd, handleEdit, editForm, dialogState } = useFormDialog({ |
| | | onConfirm: handleAddOrEdit, |
| | | defaultFormParams: { |
| | | id: '', |
| | |
| | | let res = await dictionaryServices.saveDictionaryCategory(params); |
| | | if (res) { |
| | | Message.successMessage('操作成功'); |
| | | updateDictionaryCategorySelect(); |
| | | getList(paginationState.pageIndex); |
| | | dialogState.dialogVisible = false; |
| | | } |
| | | } catch (error) {} |
| | | } |
| | |
| | | <ProFormItemV2 |
| | | label="行业类型:" |
| | | prop="field1" |
| | | v-if="category?.data?.code === '30'" |
| | | v-if="category?.data?.code === CategoryCode.Position" |
| | | :check-rules="[{ message: '请选择行业类型' }]" |
| | | > |
| | | <ProFormSelect |
| | |
| | | <ProFormItemV2 label="编号:" prop="code"> |
| | | <ProFormText v-model.trim="form.code"></ProFormText> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 label="图片:" prop="src" v-if="category?.data?.code === '50'"> |
| | | <ProFormItemV2 label="图片:" prop="src" v-if="category?.data?.code === CategoryCode.Welfare"> |
| | | <ProFormImageUpload v-model:file-url="form.field2" :limitFileCount="1"></ProFormImageUpload> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 label="状态:" prop="status"> |