From 1772fc5e211f9e9e0ab4cdc6c29b436aac178c2a Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期五, 23 二月 2024 12:19:55 +0800
Subject: [PATCH] 修改
---
web/packages/components/zt-dict/src/zt-dict.vue | 29 +++++++++++++++++++++++++----
1 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/web/packages/components/zt-dict/src/zt-dict.vue b/web/packages/components/zt-dict/src/zt-dict.vue
index 4fc8f12..e943ef1 100644
--- a/web/packages/components/zt-dict/src/zt-dict.vue
+++ b/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'">
+ <el-radio-group :value="dictValue" @input="$emit('input', $event)" :disabled="disabled">
+ <el-radio :label="data.dictValue" v-for="data in dicts" :key="data.dictValue">{{data.dictLabel}}</el-radio>
+ <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"/>
</div>
</template>
@@ -15,6 +18,8 @@
export default {
name: 'ZtDict',
props: {
+ inputName:{},
+ origin:{}, // 瀛楀吀瀛楁
value: [Number, String, Boolean],
dict: { // 瀛楀吀绫诲瀷
type: String,
@@ -42,7 +47,8 @@
},
data() {
return {
- dictValue: typeof this.value === 'undefined' ? '' : (this.value + '')
+ dictValue: typeof this.value === 'undefined' ? '' : (this.value + ''),
+ isName:false,
}
},
computed: {
@@ -58,6 +64,10 @@
this.wrapTreeId(datas)
return datas
},
+ isOtherOptionSelected() {
+ const selectedOption = this.dicts.find(data => data.dictValue === this.dictValue);
+ return selectedOption && selectedOption.dictLabel.includes('鍏朵粬');
+ },
dicts: function () {
let dicts = this.$store.getters.getDict(this.dict)
if (this.excluded.length > 0) {
@@ -72,6 +82,9 @@
watch: {
value(val, oldval) {
this.dictValue = typeof val === 'undefined' ? '' : (val + '')
+ },
+ inputName(){
+ this.$emit('getChangeInputData',this.inputName,this.origin)
}
},
methods: {
@@ -117,5 +130,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>
--
Gitblit v1.9.1