js 脚本不显示

qianlishi 3 years ago
parent 610a6ab7f7
commit 912f72d287

@ -66,6 +66,7 @@ export default {
}, },
selectChange(val) { selectChange(val) {
this.$emit("input", val); this.$emit("input", val);
this.$emit("change", val);
} }
} }
}; };

@ -219,6 +219,7 @@
v-model="item.transformType" v-model="item.transformType"
:updata-dict="item.transformType" :updata-dict="item.transformType"
:dict-key="'TRANSFORM_TYPE'" :dict-key="'TRANSFORM_TYPE'"
@change="changeForm"
/> />
<el-button <el-button
type="text" type="text"
@ -252,10 +253,16 @@
min-height="400px" min-height="400px"
append-to-body append-to-body
> >
<div v-if="isItemFilterType.transformType == 'js' || isItemFilterType.transformType == 'javaBean'"> <div
v-if="
isItemFilterType.transformType == 'js' ||
isItemFilterType.transformType == 'javaBean'
"
>
<div class="codemirror"> <div class="codemirror">
<!-- // --> <!-- // -->
<monaco-editor <monaco-editor
v-if="jsScriptVisible"
v-model.trim="transformScript" v-model.trim="transformScript"
language="javascript" language="javascript"
style="height: 500px" style="height: 500px"
@ -483,6 +490,7 @@ export default {
dialogFormVisibleTitle: "", dialogFormVisibleTitle: "",
dialogPermissionVisible: false, dialogPermissionVisible: false,
dialogSwitchVisible: false, dialogSwitchVisible: false,
jsScriptVisible: false,
permissionTextarea: "", permissionTextarea: "",
isItemFilterType: "", // id isItemFilterType: "", // id
itemFilterList: [ itemFilterList: [
@ -663,6 +671,12 @@ export default {
this.isShowPagination = false; this.isShowPagination = false;
} }
}, },
changeForm(val) {
if (!val) {
this.dialogSwitchVisible = false;
this.jsScriptVisible = false
}
},
// //
closeDialog() { closeDialog() {
this.$emit("handleClose"); this.$emit("handleClose");
@ -744,6 +758,7 @@ export default {
console.log(item); console.log(item);
this.isItemFilterType = item; this.isItemFilterType = item;
this.dialogSwitchVisible = true; this.dialogSwitchVisible = true;
this.jsScriptVisible = true
if (item.transformType == "js") { if (item.transformType == "js") {
this.itemFilterScriptId = item.itemFilterSort; this.itemFilterScriptId = item.itemFilterSort;
const fnCont = `function dataTransform(data){\n\t//自定义脚本内容\n\treturn data;\n}`; const fnCont = `function dataTransform(data){\n\t//自定义脚本内容\n\treturn data;\n}`;
@ -751,8 +766,7 @@ export default {
? item.transformScript ? item.transformScript
: fnCont; : fnCont;
} else if (item.transformType == "dict") { } else if (item.transformType == "dict") {
} else if (item.transformType == "javaBean") {
}else if (item.transformType == "javaBean") {
this.itemFilterScriptId = item.itemFilterSort; this.itemFilterScriptId = item.itemFilterSort;
const fnCont = `package com; const fnCont = `package com;

Loading…
Cancel
Save