From 8c834663344b1cc9c2ca569e6911900edd407f73 Mon Sep 17 00:00:00 2001 From: jinlin <jinlin> Date: 星期四, 06 六月 2024 16:44:14 +0800 Subject: [PATCH] 修改 --- web/packages/components/zt-dict/src/zt-dict.vue | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/web/packages/components/zt-dict/src/zt-dict.vue b/web/packages/components/zt-dict/src/zt-dict.vue index e943ef1..a9946bb 100644 --- a/web/packages/components/zt-dict/src/zt-dict.vue +++ b/web/packages/components/zt-dict/src/zt-dict.vue @@ -1,6 +1,6 @@ <template> <div> - <el-select :value="dictValue" @change="changeProjectMajor" @input="$emit('input', $event)" :placeholder="placeholder" clearable style="width: 100%;" v-if="showType === 'select'" :disabled="disabled"> + <el-select v-if="showType === 'select'" :value="dictValue" @change="changeProjectMajor" @input="$emit('input', $event)" :placeholder="placeholder" clearable style="width: 100%;" :disabled="disabled"> <el-option :label="data.dictLabel" v-for="data in dicts" :key="data.dictValue" :value ="data.dictValue">{{data.dictLabel}}</el-option> </el-select> <div v-if="showType === 'radio'"> @@ -9,7 +9,7 @@ <el-input class="radio-input" v-if="isOtherOptionSelected" v-model="inputName"></el-input> </el-radio-group> </div> - <zt-combo-tree v-model="dictValue" :datas="dictTrees" :disabled-filter="disabledFilter" @input="$emit('input', $event)" v-if="showType === 'tree'" :placeholder="placeholder"/> + <zt-combo-tree v-if="showType === 'tree'" v-model="dictValue" :datas="dictTrees" :disabled-filter="disabledFilter" @input="$emit('input', $event)" :placeholder="placeholder"/> </div> </template> <script> @@ -26,6 +26,12 @@ required: true }, excluded: {// 鎺掗櫎鐨� + type: Array, + default: function () { + return [] + } + }, + additional: {// 娣诲姞鐨� type: Array, default: function () { return [] @@ -73,10 +79,9 @@ if (this.excluded.length > 0) { let excludedArray = [] this.excluded.forEach(value => excludedArray.push(value + '')) - return dicts.filter(option => excludedArray.indexOf(option.dictValue + '') < 0) - } else { - return dicts + dicts = dicts.filter(option => excludedArray.indexOf(option.dictValue + '') < 0) } + return dicts.concat(this.additional); } }, watch: { -- Gitblit v1.9.1