diff --git a/data-room-ui/example/customDatasetComponents/jsDataSet/index.vue b/data-room-ui/example/customDatasetComponents/jsDataSet/index.vue index c85e971e..553445ff 100644 --- a/data-room-ui/example/customDatasetComponents/jsDataSet/index.vue +++ b/data-room-ui/example/customDatasetComponents/jsDataSet/index.vue @@ -152,7 +152,7 @@ :span="8" > <div class="right-setting"> - <div class="paramConfig"> + <!-- <div class="paramConfig"> <div class="title-style bs-title-style"> 方法参数 <el-button @@ -186,7 +186,7 @@ </el-button> </div> </div> - </div> + </div> --> <div class="structure"> <div class="title-style bs-title-style"> 输出字段 @@ -603,7 +603,8 @@ export default { const javascript = this.dataForm.config.script let scriptMethod = null try { - scriptMethod = eval(`(${javascript})`) + // eslint-disable-next-line no-new-func + scriptMethod = new Function(javascript) } catch (error) { this.passTest = false this.$message.error('脚本执行错误,请检查脚本') @@ -625,12 +626,15 @@ export default { } }) }) - this.outputFieldList = keys.map(item => { - return { - fieldName: item, - fieldDesc: '' - } - }) + if (this.outputFieldList.length === 0) { + this.outputFieldList = keys.map(item => { + return { + fieldName: item, + fieldDesc: '' + } + }) + } + if (this.outputFieldList.length && this.fieldDesc) { this.buildFieldDesc() }