From d4d6f667aa26f16de3d6039984da8e5dc6446206 Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Thu, 17 Nov 2022 11:24:51 +0800 Subject: [PATCH] fix: dictType edit --- .../src/views/system/dict/index.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/yudao-ui-admin-vue3/src/views/system/dict/index.vue b/yudao-ui-admin-vue3/src/views/system/dict/index.vue index 361cb100a..998ca581e 100644 --- a/yudao-ui-admin-vue3/src/views/system/dict/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/dict/index.vue @@ -119,7 +119,14 @@ :schema="DictTypeSchemas.allSchemas.formSchema" :rules="DictTypeSchemas.dictTypeRules" ref="typeFormRef" - /> + > + +
{ + dictTypeValue.value = '' setDialogTile('typeCreate') } const handleTypeUpdate = async (row: DictTypeVO) => { setDialogTile('typeUpdate') // 设置数据 const res = await DictTypeApi.getDictTypeApi(row.id) + dictTypeValue.value = res.type unref(typeFormRef)?.setValues(res) } @@ -229,6 +239,7 @@ const actionLoading = ref(false) // 遮罩层 const typeFormRef = ref() // 分类表单 Ref const dataFormRef = ref() // 数据表单 Ref const actionType = ref('') // 操作按钮的类型 + // 设置标题 const setDialogTile = (type: string) => { dialogTitle.value = t('action.' + type) @@ -246,6 +257,7 @@ const submitTypeForm = async () => { try { const data = unref(typeFormRef)?.formModel as DictTypeVO if (actionType.value === 'typeCreate') { + data.type = dictTypeValue.value await DictTypeApi.createDictTypeApi(data) ElMessage.success(t('common.createSuccess')) } else if (actionType.value === 'typeUpdate') {