jinlin
2024-06-06 8c834663344b1cc9c2ca569e6911900edd407f73
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: {