mirror of
https://github.com/kerwincui/FastBee.git
synced 2025-10-14 04:13:55 +08:00
规则引擎前端错误修改
This commit is contained in:
@@ -38,10 +38,7 @@ import "codemirror/addon/lint/lint.js";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
value: '',
|
||||
height: {
|
||||
type: String,
|
||||
required: true,
|
||||
@@ -60,7 +57,11 @@ export default {
|
||||
value(value) {
|
||||
const editorValue = this.editor.getValue();
|
||||
if (value !== editorValue) {
|
||||
this.editor.setValue(this.value);
|
||||
if (typeof this.value !== "undefined") {
|
||||
this.editor.setValue(this.value);
|
||||
} else {
|
||||
this.editor.setValue("");
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
@@ -74,7 +75,7 @@ export default {
|
||||
gutters: [
|
||||
"CodeMirror-linenumbers",
|
||||
"CodeMirror-foldgutter",
|
||||
"CodeMirror-lint-markers", // CodeMirror-lint-markers是实现语法报错功能
|
||||
"CodeMirror-lint-markers", // CodeMirror-lint-markers是实现语法报错功能
|
||||
],
|
||||
lint: true,
|
||||
//lineWrapping: true, // 自动换行
|
||||
@@ -82,14 +83,19 @@ export default {
|
||||
autoCloseBrackets: true, // 输入和退格时成对
|
||||
readOnly: false, // 只读
|
||||
foldGutter: true,
|
||||
autoRefresh: true
|
||||
autoRefresh: true,
|
||||
});
|
||||
//代码自动提示功能,记住使用cursorActivity事件不要使用change事件,这是一个坑,那样页面直接会卡死
|
||||
this.editor.on("inputRead", () => {
|
||||
this.editor.showHint();
|
||||
});
|
||||
debugger;
|
||||
this.editor.setSize("auto", this.height);
|
||||
this.editor.setValue(this.value);
|
||||
if (typeof this.value !== "undefined") {
|
||||
this.editor.setValue(this.value);
|
||||
} else {
|
||||
this.editor.setValue("");
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getValue() {
|
||||
|
@@ -48,7 +48,7 @@
|
||||
</el-card>
|
||||
|
||||
<!-- 规则引擎详细 -->
|
||||
<el-dialog title="规则引擎详细" :visible.sync="openView" width="1200px" append-to-body>
|
||||
<el-dialog title="规则引擎详细" :visible.sync="openView" width="50%" append-to-body>
|
||||
<el-form ref="form" :model="form" label-width="120px" size="mini">
|
||||
<el-card style="padding-bottom: 10px">
|
||||
<div slot="header" class="clearfix">
|
||||
@@ -155,7 +155,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item prop="test_columns.payload" v-if="form.test_columns">
|
||||
<span slot="label"> payload: </span>
|
||||
<CodeMirrorEditor :value="form.test_columns.payload !==''?form.test_columns.payload: ''" myMode="application/json" height="150" />
|
||||
<CodeMirrorEditor :value="form.test_columns.payload" myMode="application/json" height="150" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.test_columns">
|
||||
<el-button @click="testConnect" type="success" size="mini">测 试</el-button>
|
||||
|
Reference in New Issue
Block a user