FIX: 避免新增字典视图不刷新的问题

This commit is contained in:
冷冷 2024-07-19 18:03:01 +08:00 committed by GitHub
parent fabcc53fd2
commit ac6fb7d8b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,6 @@
<template>
<div class="system-dic-dialog-container">
<el-dialog v-model="visible" destroy-on-close :title="dataForm.id ? $t('common.editBtn') : $t('common.addBtn')" width="600">
<el-dialog v-model="visible" :title="dataForm.id ? $t('common.editBtn') : $t('common.addBtn')" width="600">
<el-form ref="dicDialogFormRef" :model="dataForm" label-width="90px" :rules="dataRules" v-loading="loading">
<el-form-item :label="$t('dictItem.dictType')" prop="dictType">
<el-input v-model="dataForm.dictType" clearable disabled
@ -85,15 +85,15 @@ const openDialog = (row: any, dictForm: any) => {
nextTick(() => {
dicDialogFormRef.value?.resetFields();
if (dictForm) {
dataForm.dictId = dictForm.dictId;
dataForm.dictType = dictForm.dictType;
}
});
if (row?.id) {
getItemObj(row.id).then((res) => {
Object.assign(dataForm, res.data);
});
} else if (dictForm) {
dataForm.dictId = dictForm.dictId;
dataForm.dictType = dictForm.dictType;
}
};