| | |
| | | <script setup name="Dict" lang="ts"> |
| | | import useDictStore from '@/store/modules/dict' |
| | | import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type"; |
| | | import { ComponentInternalInstance } from "vue"; |
| | | import { DictTypeForm, DictTypeQuery, DictTypeVO } from "@/api/system/dict/type/types"; |
| | | import { DateModelType } from 'element-plus'; |
| | | |
| | | const { proxy } = getCurrentInstance() as ComponentInternalInstance; |
| | | const { sys_normal_disable } = toRefs<any>(proxy?.useDict("sys_normal_disable")) |
| | |
| | | const total = ref(0); |
| | | const dateRange = ref<[DateModelType, DateModelType]>(['', '']); |
| | | |
| | | const dictFormRef = ref(ElForm); |
| | | const queryFormRef = ref(ElForm); |
| | | const dictFormRef = ref<ElFormInstance>(); |
| | | const queryFormRef = ref<ElFormInstance>(); |
| | | |
| | | |
| | | const dialog = reactive<DialogOption>({ |
| | |
| | | /** 表单重置 */ |
| | | const reset = () => { |
| | | form.value = {...initFormData}; |
| | | dictFormRef.value.resetFields(); |
| | | dictFormRef.value?.resetFields(); |
| | | } |
| | | /** 搜索按钮操作 */ |
| | | const handleQuery = () => { |
| | |
| | | /** 重置按钮操作 */ |
| | | const resetQuery = () => { |
| | | dateRange.value = ['', '']; |
| | | queryFormRef.value.resetFields(); |
| | | queryFormRef.value?.resetFields(); |
| | | handleQuery(); |
| | | } |
| | | /** 新增按钮操作 */ |
| | |
| | | } |
| | | /** 提交按钮 */ |
| | | const submitForm = () => { |
| | | dictFormRef.value.validate(async (valid: boolean) => { |
| | | dictFormRef.value?.validate(async (valid: boolean) => { |
| | | if (valid) { |
| | | form.value.dictId ? await updateType(form.value) : await addType(form.value); |
| | | proxy?.$modal.msgSuccess("操作成功"); |