askbot-dragon 0.9.8 → 0.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -99,12 +99,12 @@
|
|
|
99
99
|
>
|
|
100
100
|
</el-date-picker>
|
|
101
101
|
<div v-else-if="item.formField.type==='RADIO' &&item.formField.extInfo.options">
|
|
102
|
-
<el-radio-group v-model=item.value style="text-align:left">
|
|
102
|
+
<el-radio-group v-model=item.value style="text-align:left" @change="changeSelect(item)">
|
|
103
103
|
<el-radio v-for="(items,index) in item.formField.extInfo.options" :label=items.value :key="index">{{items.label}}</el-radio>
|
|
104
104
|
</el-radio-group>
|
|
105
105
|
</div>
|
|
106
106
|
<div v-else-if="item.formField.type==='RADIO' &&item.formField.extInfo.option">
|
|
107
|
-
<el-radio-group v-model=item.value style="text-align:left">
|
|
107
|
+
<el-radio-group v-model=item.value style="text-align:left" @change="changeSelect(item)">
|
|
108
108
|
<el-radio v-for="(items,index) in item.formField.extInfo.option" :label=items.value :key="index">{{items.label}}</el-radio>
|
|
109
109
|
</el-radio-group>
|
|
110
110
|
</div>
|
|
@@ -147,6 +147,7 @@
|
|
|
147
147
|
style="width: 100%"
|
|
148
148
|
filterable
|
|
149
149
|
v-else
|
|
150
|
+
@change="changeSelect(item)"
|
|
150
151
|
:multiple="item.formField.extInfo && item.formField.extInfo.selectType == '多选'"
|
|
151
152
|
>
|
|
152
153
|
<el-option
|
|
@@ -460,7 +461,7 @@
|
|
|
460
461
|
</span>
|
|
461
462
|
</template>
|
|
462
463
|
<template #input style="display: flex;align-items: center">
|
|
463
|
-
<van-radio-group v-model=item.value direction="horizontal" :disabled="disableds">
|
|
464
|
+
<van-radio-group v-model=item.value direction="horizontal" :disabled="disableds" @change="changeSelect(item)">
|
|
464
465
|
<van-radio v-for="(items,index) in item.formField.extInfo.option" :name=items.value :key="index">{{items.label}}</van-radio>
|
|
465
466
|
</van-radio-group>
|
|
466
467
|
</template>
|
|
@@ -474,7 +475,7 @@
|
|
|
474
475
|
</span>
|
|
475
476
|
</template>
|
|
476
477
|
<template #input style="display: flex;align-items: center" >
|
|
477
|
-
<van-radio-group v-model=item.value direction="horizontal" :disabled="disableds">
|
|
478
|
+
<van-radio-group v-model=item.value direction="horizontal" :disabled="disableds" @change="changeSelect(item)">
|
|
478
479
|
<van-radio v-for="(items,index) in item.formField.extInfo.options" :name=items.value :key="index">{{items.label}}</van-radio>
|
|
479
480
|
</van-radio-group>
|
|
480
481
|
</template>
|
|
@@ -868,7 +869,8 @@ export default {
|
|
|
868
869
|
optionsList:{},
|
|
869
870
|
currentEditor:null,
|
|
870
871
|
workOrderDes:"",
|
|
871
|
-
workOrderDestail:null
|
|
872
|
+
workOrderDestail:null,
|
|
873
|
+
associatedControlsCopy:[]
|
|
872
874
|
}
|
|
873
875
|
},
|
|
874
876
|
props: {
|
|
@@ -960,6 +962,35 @@ export default {
|
|
|
960
962
|
this.workOrderDes = item.value;
|
|
961
963
|
this.workOrderDestail = item
|
|
962
964
|
}
|
|
965
|
+
if(this.fieldValue[item.fieldId] && !this.associatedControlsCopy.includes(item.fieldId) && (item.formField.extInfo.selectType == '单选' || item.formField.type == 'RADIO')) {
|
|
966
|
+
let option = null
|
|
967
|
+
if(item.formField.extInfo.options) {
|
|
968
|
+
option = item.formField.extInfo.options.find(ele => { return ele.value == this.fieldValue[item.fieldId]})
|
|
969
|
+
} else if (item.formField.extInfo.cascadeDown) {
|
|
970
|
+
|
|
971
|
+
item.formField.extInfo.cascadeDown.options.forEach(ele => {
|
|
972
|
+
if(this.fieldValue[item.fieldId] && this.fieldValue[item.fieldId].length != 0 && ele.value == this.fieldValue[item.fieldId][this.fieldValue[item.fieldId].length - 1]) {
|
|
973
|
+
option = ele
|
|
974
|
+
}
|
|
975
|
+
ele.children && ele.children.forEach(element =>{
|
|
976
|
+
if(this.fieldValue[item.fieldId] && this.fieldValue[item.fieldId].length != 0 && element.value == this.fieldValue[item.fieldId][this.fieldValue[item.fieldId].length - 1]) {
|
|
977
|
+
option = element
|
|
978
|
+
}
|
|
979
|
+
element.children && element.children.forEach(elements=>{
|
|
980
|
+
if(this.fieldValue[item.fieldId] && this.fieldValue[item.fieldId].length != 0 && elements.value == this.fieldValue[item.fieldId][this.fieldValue[item.fieldId].length - 1]) {
|
|
981
|
+
option = elements
|
|
982
|
+
}
|
|
983
|
+
})
|
|
984
|
+
})
|
|
985
|
+
})
|
|
986
|
+
} else {
|
|
987
|
+
option = this.extInfoFieldValue[item.fieldId] && this.extInfoFieldValue[item.fieldId][0]
|
|
988
|
+
}
|
|
989
|
+
console.debug('option',option)
|
|
990
|
+
if(option && option.setDefaultFieldId) {
|
|
991
|
+
this.setFileDefault(option,item.formField)
|
|
992
|
+
}
|
|
993
|
+
}
|
|
963
994
|
})
|
|
964
995
|
let newArr = arr.filter(item=>item.relationDisplay)
|
|
965
996
|
console.debug('arr',arr,newArr)
|
|
@@ -1016,6 +1047,40 @@ export default {
|
|
|
1016
1047
|
that.defaultClick()
|
|
1017
1048
|
},
|
|
1018
1049
|
methods: {
|
|
1050
|
+
setFileDefault(option){
|
|
1051
|
+
if (this.formShow.form.formFieldRelation){
|
|
1052
|
+
this.formShow.form.formFieldRelation.forEach(item=>{
|
|
1053
|
+
for (const key in option.setDefaultFieldId) {
|
|
1054
|
+
if (item.fieldId === key && item.relationDisplay){
|
|
1055
|
+
if((this.fieldValue[key]!==null || this.fieldValue[key]!==undefined) && option.setDefaultFieldId[key].fieldValue) {
|
|
1056
|
+
let val = option.setDefaultFieldId[key].fieldValue ? option.setDefaultFieldId[key].fieldValue : ""
|
|
1057
|
+
this.$set(item,'value',val)
|
|
1058
|
+
this.$set(this.fieldValue,key,val)
|
|
1059
|
+
if(option.setDefaultFieldId[key].extInfoFieldValue) {
|
|
1060
|
+
this.$set(this.extInfoFieldValue,key,option.setDefaultFieldId[key].extInfoFieldValue)
|
|
1061
|
+
}
|
|
1062
|
+
/* else if (!option.setDefaultFieldId[key].extInfoFieldValue){
|
|
1063
|
+
this.$set(this.extInfoFieldValue,key,val)
|
|
1064
|
+
}*/
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
if (item.fieldId === key && !item.relationDisplay){
|
|
1068
|
+
this.$set(this.fieldValue,key,"")
|
|
1069
|
+
this.$set(this.extInfoFieldValue,key,"")
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
})
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
},
|
|
1076
|
+
changeSelect(field){
|
|
1077
|
+
if ( field.formField.extInfo.selectType == '多选'){
|
|
1078
|
+
return
|
|
1079
|
+
}
|
|
1080
|
+
let arr = field.formField.extInfo.relationControlsId ? JSON.parse(JSON.stringify(field.formField.extInfo.relationControlsId)) : []
|
|
1081
|
+
this.associatedControlsCopy = [...this.associatedControlsCopy, ...arr];
|
|
1082
|
+
console.debug('associatedControlsCopy',this.associatedControlsCopy,field)
|
|
1083
|
+
},
|
|
1019
1084
|
selectOptions(field){
|
|
1020
1085
|
let options = []
|
|
1021
1086
|
if (!field.extInfo){
|
|
@@ -1617,6 +1682,7 @@ export default {
|
|
|
1617
1682
|
break
|
|
1618
1683
|
}
|
|
1619
1684
|
}
|
|
1685
|
+
this.changeSelect(item);
|
|
1620
1686
|
},
|
|
1621
1687
|
//提交按钮事件
|
|
1622
1688
|
submitClick() {
|
|
@@ -2313,7 +2379,8 @@ export default {
|
|
|
2313
2379
|
this.$set(this.detailField,'value',checkList);
|
|
2314
2380
|
this.extInfoFieldValue[this.detailField.fieldId] = checkDatas;
|
|
2315
2381
|
this.$set(this.detailField.formField.extInfo,'extInfoFieldValue',checkDatas);
|
|
2316
|
-
console.debug('checkDatas',this.detailField.formField.extInfo,checkList)
|
|
2382
|
+
console.debug('checkDatas',this.detailField.formField.extInfo,checkList);
|
|
2383
|
+
this.changeSelect(this.detailField);
|
|
2317
2384
|
this.$forceUpdate();
|
|
2318
2385
|
this.showArea = false;
|
|
2319
2386
|
this.drawer = false;
|