|
|
|
@ -140,7 +140,7 @@
|
|
|
|
|
<div style="text-align: center; padding: 16px 0;">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="toExecute"
|
|
|
|
|
@click="scriptExecute()"
|
|
|
|
|
>
|
|
|
|
|
执行
|
|
|
|
|
</el-button>
|
|
|
|
@ -152,9 +152,9 @@
|
|
|
|
|
:span="8"
|
|
|
|
|
>
|
|
|
|
|
<div class="right-setting">
|
|
|
|
|
<!-- <div class="paramConfig">
|
|
|
|
|
<div class="paramConfig">
|
|
|
|
|
<div class="title-style bs-title-style">
|
|
|
|
|
方法参数
|
|
|
|
|
动态参数
|
|
|
|
|
<el-button
|
|
|
|
|
type="text"
|
|
|
|
|
style="float: right;border: none;margin-top: -4px;"
|
|
|
|
@ -186,7 +186,7 @@
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div> -->
|
|
|
|
|
</div>
|
|
|
|
|
<div class="structure">
|
|
|
|
|
<div class="title-style bs-title-style">
|
|
|
|
|
输出字段
|
|
|
|
@ -606,8 +606,11 @@ export default {
|
|
|
|
|
const javascript = this.dataForm.config.script
|
|
|
|
|
let scriptMethod = null
|
|
|
|
|
try {
|
|
|
|
|
const scriptAfterReplacement = javascript.replace(/\${(.*?)}/g, (match, p) => {
|
|
|
|
|
return `'${this.dataForm.config.paramsList.find(param => param.name === p).value}'`
|
|
|
|
|
})
|
|
|
|
|
// eslint-disable-next-line no-new-func
|
|
|
|
|
scriptMethod = new Function(javascript)
|
|
|
|
|
scriptMethod = new Function(scriptAfterReplacement)
|
|
|
|
|
} catch (error) {
|
|
|
|
|
this.passTest = false
|
|
|
|
|
this.$message.error('脚本执行错误,请检查脚本')
|
|
|
|
@ -671,15 +674,15 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 执行事件
|
|
|
|
|
toExecute () {
|
|
|
|
|
// if (this.dataForm.config.paramsList.length) {
|
|
|
|
|
// this.isSet = false
|
|
|
|
|
// this.paramsVisible = true
|
|
|
|
|
// } else {
|
|
|
|
|
// 无参数,直接执行脚本
|
|
|
|
|
this.scriptExecute()
|
|
|
|
|
// }
|
|
|
|
|
},
|
|
|
|
|
// toExecute () {
|
|
|
|
|
// if (this.dataForm.config.paramsList.length) {
|
|
|
|
|
// this.isSet = false
|
|
|
|
|
// this.paramsVisible = true
|
|
|
|
|
// } else {
|
|
|
|
|
// 无参数,直接执行脚本
|
|
|
|
|
// this.scriptExecute()
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// 清空分类
|
|
|
|
|
clearType () {
|
|
|
|
|
this.typeName = ''
|
|
|
|
|