From 64b249e743cd9615805cf997e4acf8471c9d92ed Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 8 Mar 2023 22:51:07 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E5=A4=8D=20DictTag=20=E5=AF=B9?= =?UTF-8?q?=20boolean=20=E7=9A=84=20false=20=E5=A4=84=E7=90=86=E4=B8=8D?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=202.=20vue=20=E9=87=8D=E6=9E=84=EF=BC=9A?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=85=8D=E7=BD=AE=E7=AE=A1=E7=90=86=E7=9A=84?= =?UTF-8?q?=20form=20=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DictTag/src/DictTag.vue | 2 +- src/utils/dict.ts | 2 +- src/views/infra/config/form.vue | 122 +++++++++++++++++++ src/views/infra/config/index.vue | 32 +++-- src/views/infra/config/index2.vue | 162 ------------------------- 5 files changed, 147 insertions(+), 173 deletions(-) create mode 100644 src/views/infra/config/form.vue delete mode 100644 src/views/infra/config/index2.vue diff --git a/src/components/DictTag/src/DictTag.vue b/src/components/DictTag/src/DictTag.vue index 15b5f12a..ecbfedb4 100644 --- a/src/components/DictTag/src/DictTag.vue +++ b/src/components/DictTag/src/DictTag.vue @@ -34,7 +34,7 @@ export default defineComponent({ return null } // 解决自定义字典标签值为零时标签不渲染的问题 - if (!props.value && props.value !== 0) { + if (props.value === undefined) { return null } getDictObj(props.type, props.value.toString()) diff --git a/src/utils/dict.ts b/src/utils/dict.ts index b9dfa160..15e57ff2 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -55,7 +55,7 @@ export const getBoolDictOptions = (dictType: string) => { dictOptions.forEach((dict: DictDataType) => { dictOption.push({ ...dict, - value: dict.value + '' === 'true' ? true : false + value: dict.value + '' === 'true' }) }) return dictOption diff --git a/src/views/infra/config/form.vue b/src/views/infra/config/form.vue new file mode 100644 index 00000000..ad924825 --- /dev/null +++ b/src/views/infra/config/form.vue @@ -0,0 +1,122 @@ + + diff --git a/src/views/infra/config/index.vue b/src/views/infra/config/index.vue index f96da368..3cde9385 100644 --- a/src/views/infra/config/index.vue +++ b/src/views/infra/config/index.vue @@ -26,12 +26,16 @@ @keyup.enter="handleQuery" /> - - - - - - + + + + + @@ -116,7 +119,7 @@ link type="primary" icon="el-icon-edit" - @click="handleUpdate(scope.row)" + @click="openModal('update', scope.row.id)" v-hasPermi="['infra:config:update']" > 修改 @@ -134,10 +137,15 @@ + + + +