wente
2023-11-22 c679af2a31ba7c006c5b9a6cb5d7a79050f0703f
web/packages/components/zt-dict/src/zt-dict.vue
@@ -3,9 +3,12 @@
      <el-select :value="dictValue" @change="changeProjectMajor" @input="$emit('input', $event)" :placeholder="placeholder" clearable style="width: 100%;" v-if="showType === 'select'" :disabled="disabled">
          <el-option :label="data.dictLabel" v-for="data in dicts" :key="data.dictValue" :value ="data.dictValue">{{data.dictLabel}}</el-option>
      </el-select>
      <el-radio-group :value="dictValue" @input="$emit('input', $event)" v-if="showType === 'radio'" :disabled="disabled">
        <el-radio :label="data.dictValue" v-for="data in dicts" :key="data.dictValue">{{data.dictLabel}}</el-radio>
      </el-radio-group>
      <div v-if="showType === 'radio'" :disabled="disabled">
        <el-radio-group :value="dictValue" @input="$emit('input', $event)" >
          <el-radio :label="data.dictValue" @change="changeDictValue(data.dictValue,data.dictLabel)" v-for="data in dicts" :key="data.dictValue">{{data.dictLabel}}</el-radio>
          <el-input class="radio-input" v-if="isName" 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"/>
    </div>
</template>
@@ -15,6 +18,7 @@
  export default {
    name: 'ZtDict',
    props: {
      inputName:{},
      value: [Number, String, Boolean],
      dict: { // 字典类型
        type: String,
@@ -42,7 +46,9 @@
    },
    data() {
      return {
        dictValue: typeof this.value === 'undefined' ? '' : (this.value + '')
        dictValue: typeof this.value === 'undefined' ? '' : (this.value + ''),
        isName:false,
        eventIndex:'',
      }
    },
    computed: {
@@ -75,6 +81,16 @@
      }
    },
    methods: {
      changeDictValue(value,name){
        if(name.indexOf("其他")!=-1){
          console.log(this.inputName,'inputName')
          console.log(name,'字典名字q34567')
          this.eventIndex = value
          this.isName = true
        }else {
          this.isName = false
        }
      },
      wrapTreeId(dictTypes) {
        dictTypes.forEach(item => {
          if ((item.dictType || '').length > 0) { // 字典类型
@@ -117,5 +133,13 @@
    background-color: #00a06e !important;
    border-color: #1890ff !important;
  }
  .radio-input.el-input{
    position: absolute;
    bottom: 5px;
    left: 68px;
  }
  .radio-input.el-input>.el-input__inner{
    height: 25px;
  }
</style>