diff --git a/src/views/flow/edit.vue b/src/views/flow/edit.vue
index dca6b0e..3d14ca2 100644
--- a/src/views/flow/edit.vue
+++ b/src/views/flow/edit.vue
@@ -45,6 +45,11 @@
+
+ 执行编辑js
+ 执行查看js
+
+
@@ -69,6 +74,7 @@
:writeable="writeableFields"
:rules="{}"
:sub-rules="{}"
+ :script-content="scriptContent"
:logs="config.logs"
>
@@ -250,9 +256,17 @@ export default {
subRules: {},
flows: [],
csrf_token: '',
+ scriptContent: '',
};
},
methods: {
+ execScript(mode='write') {
+ if (mode === 'write') {
+ this.scriptContent = this.writeScriptContent
+ } else if (mode === 'read') {
+ this.scriptContent = this.readScriptContent
+ }
+ },
// 处理url中default_json
handleDefaultJSON() {
try {
@@ -650,12 +664,11 @@ export default {
node() {
return this.config?.currentNode || {};
},
- scriptContent() {
- if (this.config?.customModel?.view_js && this.$route.query.flow_id && /\/detail/.test(this.$route.path)) {
- return this.config?.customModel?.view_js;
- } else if (this.config?.customModel?.js && !/\/detail/.test(this.$route.path)) {
- return this.config?.customModel?.js;
- }
+ writeScriptContent() {
+ return this.config?.customModel?.js;
+ },
+ readScriptContent() {
+ return this.config?.customModel?.view_js;
},
diffTime() {
return function (end, start) {