| | |
| | | <template> |
| | | <el-tag :color="tagColor" v-if="$store.getters.getDictLabel(dict, value)!=null" :type="tagType" :size="size" :effect="effect" :hit="hit">{{$store.getters.getDictLabel(dict, value)}} |
| | | <el-tag :color="tagColor" :type="tagType" :size="size" :effect="effect" :hit="hit">{{dictLabel}} |
| | | </el-tag> |
| | | </template> |
| | | <script> |
| | |
| | | dict: { // 字典类型 |
| | | type: String, |
| | | required: true |
| | | }, |
| | | additional: {// 添加的 |
| | | type: Array, |
| | | default: function () { |
| | | return [] |
| | | } |
| | | }, |
| | | value: [String, Number, Boolean], |
| | | typeS: String, |
| | |
| | | mounted() { |
| | | this.init() |
| | | }, |
| | | computed: { |
| | | dictLabel() { |
| | | let result = this.$store.getters.getDictLabel(this.dict, this.value) |
| | | if ("" + result == "" + this.value) { |
| | | for (let item of this.additional) { |
| | | if (item.dictValue == "" + this.value) { |
| | | result = item.dictLabel |
| | | } |
| | | } |
| | | } |
| | | return result |
| | | } |
| | | }, |
| | | methods: { |
| | | async init() { |
| | | let value = this.value + '' |