|
@@ -75,7 +75,12 @@
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<div v-if="dataModel && dataModel.length > 0">
|
|
|
- {{ dataModel }}
|
|
|
+ <template v-if="widget.type == 'organ' || widget.type == 'school'">
|
|
|
+ {{ dataModelStr }}
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ {{ dataModel }}
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</template>
|
|
|
</template>
|
|
@@ -363,7 +368,7 @@ export default {
|
|
|
FileUpload
|
|
|
},
|
|
|
/* eslint-disable */
|
|
|
- props: ['widget', 'models', 'propValue', 'remote', 'data', 'disabled', 'preview', 'isLabel', 'subformIndex', 'subformModel', 'organList'],
|
|
|
+ props: ['widget', 'models', 'propValue', 'remote', 'data', 'disabled', 'preview', 'isLabel', 'subformIndex', 'subformModel', 'organList', 'cooperationList'],
|
|
|
data() {
|
|
|
return {
|
|
|
showStatus: true,
|
|
@@ -371,6 +376,7 @@ export default {
|
|
|
dataModel: this.subformIndex===undefined?
|
|
|
this.models[this.widget.model]:
|
|
|
this.models[this.subformModel][this.subformIndex][this.widget.model],
|
|
|
+ dataModelStr: null,
|
|
|
tableData: []
|
|
|
}
|
|
|
},
|
|
@@ -410,21 +416,44 @@ export default {
|
|
|
delete this.models.status
|
|
|
this.handleDisplayVerifiy()
|
|
|
}
|
|
|
+ },
|
|
|
+ cooperationList: {
|
|
|
+ deep: true,
|
|
|
+ handler(val) {
|
|
|
+ if(this.widget.type == 'school' && this.preview) {
|
|
|
+ let tempStr = null
|
|
|
+ val.forEach(item => {
|
|
|
+ if(item.id == this.dataModel) {
|
|
|
+ tempStr = item.name
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.dataModelStr = tempStr
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- // console.log(this.widget, this.models,this.propValue)
|
|
|
// 判断当前元素是否是分部表单()
|
|
|
if(this.widget.type == 'organ' && this.preview) {
|
|
|
- console.log(this.dataModel, this.organList)
|
|
|
+ this.$emit('input-change', this.dataModel)
|
|
|
let tempStr = null
|
|
|
this.organList.forEach(item => {
|
|
|
if(item.id == this.dataModel) {
|
|
|
tempStr = item.name
|
|
|
}
|
|
|
});
|
|
|
- this.dataModel = tempStr
|
|
|
+ this.dataModelStr = tempStr
|
|
|
}
|
|
|
+ // if(this.widget.type == 'school' && this.preview) {
|
|
|
+ // let tempStr = null
|
|
|
+ // this.cooperationList.forEach(item => {
|
|
|
+ // if(item.id == this.dataModel) {
|
|
|
+ // tempStr = item.name
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // console.log(tempStr, this.dataModel)
|
|
|
+ // // this.dataModel = tempStr
|
|
|
+ // }
|
|
|
if (this.widget.options.remote && this.remote[this.widget.options.remoteFunc]) {
|
|
|
this.remote[this.widget.options.remoteFunc]((data) => {
|
|
|
this.widget.options.remoteOptions = data.map(item => {
|