Skip to content

Commit 312f00d

Browse files
committed
Fixed non-SQL script type could not be closed
1 parent 09ae5c4 commit 312f00d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/js/module/workbench/script/editor.vue

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
import module from '../index';
8181
import setting from './setting.vue';
8282
import api from '@/js/service/api';
83+
import storage from '@/js/helper/storage';
8384
import _ from 'lodash';
8485
export default {
8586
components: {
@@ -139,6 +140,17 @@ export default {
139140
this.$refs.editor.insertValueIntoEditor(args.value);
140141
}
141142
},
143+
'Workbench:setParseAction'(id) {
144+
if (id === this.script.id) {
145+
const editor = this.$refs.editor;
146+
if (editor) {
147+
const isParserClose = !!storage.get('isParserClose', 'local');
148+
editor.isParserClose = isParserClose;
149+
editor.closeParser && editor.closeParser.set(!isParserClose);
150+
editor.openParser && editor.openParser.set(isParserClose);
151+
}
152+
}
153+
},
142154
undo() {
143155
this.$refs.editor.undo();
144156
},
@@ -165,7 +177,7 @@ export default {
165177
if (status === 'start') {
166178
this.loading = false;
167179
// 执行开始时,脚本的按钮设置为running状态
168-
this.script.running = true;
180+
// this.script.running = true;
169181
}
170182
// 当抛出的为错误或者execute接口报错时,loading状态改为false,否则无法再次点击执行
171183
if (status === 'execute' || status === 'error') {
@@ -220,4 +232,4 @@ export default {
220232
},
221233
},
222234
};
223-
</script>
235+
</script>

0 commit comments

Comments
 (0)