|
@@ -244,6 +244,21 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ templates(newValue) {
|
|
|
+ this.__init()
|
|
|
+ },
|
|
|
+ 'model.contract'(newValue) {
|
|
|
+ // 反显数据
|
|
|
+ let contract = this.model.contract
|
|
|
+ contract = contract ? JSON.parse(contract) : null
|
|
|
+ console.log(contract)
|
|
|
+ if (contract) {
|
|
|
+ this.contract = contract
|
|
|
+ this.$forceUpdate()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
async mounted() {
|
|
|
await this.__init()
|
|
|
},
|
|
@@ -257,20 +272,14 @@ export default {
|
|
|
Promise.all(templateList).then(values => {
|
|
|
this.formatTemplateData(values)
|
|
|
// 反显数据
|
|
|
- let conditionExpression = this.model.conditionExpression
|
|
|
- conditionExpression = conditionExpression ? JSON.parse(conditionExpression) : null
|
|
|
- if (conditionExpression) {
|
|
|
- this.conditionList = conditionExpression
|
|
|
- this.onFormatField()
|
|
|
+ let contract = this.model.contract
|
|
|
+ contract = contract ? JSON.parse(contract) : null
|
|
|
+ if (contract) {
|
|
|
+ this.contract = contract
|
|
|
this.$forceUpdate()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- onFormatField() {
|
|
|
- this.conditionList.forEach((con, index) => {
|
|
|
- this.fieldType[index] = this.onFormatType(con.key)
|
|
|
- })
|
|
|
- },
|
|
|
async getFieldList(id) {
|
|
|
return new Promise(async(resolve, reject) => {
|
|
|
await templateDetails({ template_id: id }).then(res => {
|