From bc75700332f697dc6d0574f07a558ec2e5425408 Mon Sep 17 00:00:00 2001 From: "wu.jian2" Date: Wed, 21 Jun 2023 14:35:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89JS=E6=95=B0=E6=8D=AE=E9=9B=86=EF=BC=8C=E5=A4=9A?= =?UTF-8?q?=E6=AC=A1=E6=89=A7=E8=A1=8C=E5=90=8E=E5=AF=BC=E8=87=B4=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E5=AD=97=E6=AE=B5=E6=B6=88=E5=A4=B1=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsDataSet/index.vue | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) 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" >
-
+
输出字段 @@ -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() }