fix: 修复自定义JS数据集修改字段描述无效的情况

main
wu.jian2 2 years ago
parent b41a2c1e99
commit 8e2eee3453

@ -11,7 +11,7 @@
>
<div class="bs-table-box">
<el-table
:data="outputFieldList"
:data="insideFieldList"
:border="true"
align="center"
class="bs-el-table"
@ -72,11 +72,14 @@ export default {
data () {
return {
dialogVisible: false,
structurePreviewListCopy: []
structurePreviewListCopy: [],
//
insideFieldList: []
}
},
methods: {
open () {
this.insideFieldList = cloneDeep(this.outputFieldList)
this.dialogVisible = true
},
close () {
@ -89,11 +92,12 @@ export default {
this.dialogVisible = false
},
setField () {
if (this.outputFieldList.length) {
if (this.insideFieldList.length) {
this.fieldDesc = {}
this.outputFieldList.forEach(key => {
this.insideFieldList.forEach(key => {
this.fieldDesc[key.fieldName] = key.fieldDesc
})
this.$emit('setFieldList', this.insideFieldList)
} else {
this.fieldDesc = null
}

@ -338,6 +338,7 @@
<OutputFieldDialog
ref="outputFieldDialog"
:output-field-list="outputFieldList"
@setFieldList="(list) => { outputFieldList = list }"
/>
</el-scrollbar>
<FieldFillDialog
@ -448,9 +449,11 @@ export default {
}
},
watch: {
'dataForm.config.script' () {
'dataForm.config.script' (val) {
if (!val) {
this.passTest = false
}
}
},
mounted () {
this.init()
@ -599,6 +602,7 @@ export default {
},
//
scriptExecute (isInit = false) {
console.log(isInit)
if (this.dataForm.config.script) {
const javascript = this.dataForm.config.script
let scriptMethod = null
@ -635,7 +639,7 @@ export default {
})
}
if (this.outputFieldList.length && this.fieldDesc) {
if (this.outputFieldList.length && this.fieldDesc && !isInit) {
this.buildFieldDesc()
}
//
@ -845,6 +849,7 @@ export default {
height: 100% !important;
margin-bottom: 0 !important;
}
.tree-box {
padding: 0;
}

Loading…
Cancel
Save