生成引擎类
parent
00167769d7
commit
8bfb40147c
|
@ -117,3 +117,17 @@ export function sel(id){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//根据版本id查询版本信息
|
||||||
|
export function generate(data){
|
||||||
|
return request({
|
||||||
|
url: "/engine/version/generate",
|
||||||
|
method: "post",
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -49,12 +49,13 @@
|
||||||
<el-input v-model="versions.description" autocomplete="off"></el-input>
|
<el-input v-model="versions.description" autocomplete="off"></el-input>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- ref="mycode" :value="curCode" class="code"-->
|
<!-- ref="mycode" " class="code"-->
|
||||||
<codemirror :options="cmOptions" v-show="opens">
|
<div v-show="opens">
|
||||||
|
<codemirror :value="this.javaClass" :options="cmOptions" >
|
||||||
|
</codemirror>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</codemirror>
|
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
|
@ -63,7 +64,7 @@
|
||||||
|
|
||||||
<el-button type="primary" @click=handleInsert()>确 定</el-button>
|
<el-button type="primary" @click=handleInsert()>确 定</el-button>
|
||||||
|
|
||||||
<el-button type="primary" @click=showCode()>生成引擎类</el-button>
|
<el-button type="primary" @click=showCode(versions)>生成引擎类</el-button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -219,7 +220,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import {add, dels, findById, forbiddenEngine, onEngine, sel, selectEngineById} from "@/api/engine/engine";
|
import {add, dels, findById, forbiddenEngine, generate, onEngine, sel, selectEngineById} from "@/api/engine/engine";
|
||||||
|
|
||||||
import Java from "@/components/JavaIDE.vue/java.vue";
|
import Java from "@/components/JavaIDE.vue/java.vue";
|
||||||
|
|
||||||
|
@ -259,28 +260,48 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
opens: false,
|
opens: false,
|
||||||
|
//
|
||||||
javaClass: "package com.muyu.rule.engine.custom;\n" +
|
// javaClass: "package com.muyu.rule.engine.custom;\n" +
|
||||||
"\n" +
|
//
|
||||||
"import com.muyu.engine.action.ActionDiscard;\n" +
|
// "\n" +
|
||||||
"import com.muyu.engine.scope.DataModelEngine;\n" +
|
//
|
||||||
"\n" +
|
// "import com.muyu.engine.action.ActionDiscard;\n" +
|
||||||
"/**\n" +
|
//
|
||||||
" * @Author: DongZeLiang\n" +
|
// "import com.muyu.engine.scope.DataModelEngine;\n" +
|
||||||
" * @date: 2024/5/6\n" +
|
//
|
||||||
" * @Description: 231-231\n" +
|
// "\n" +
|
||||||
" * @Version: 1.0\n" +
|
//
|
||||||
" */\n" +
|
// "/**\n" +
|
||||||
"public class undefined_231 extends DataModelEngine {\n" +
|
//
|
||||||
" @Override\n" +
|
// " * @Author: qdm\n" +
|
||||||
" public void execution () {\n" +
|
//
|
||||||
" Object value = getValue();\n" +
|
// new Date+
|
||||||
"\n" +
|
//
|
||||||
" if (value == null || \"\".equals(value) || \"null\".equals(value)) {\n" +
|
// "\n * @Description: 没有描述\n" +
|
||||||
" throw new ActionDiscard();\n" +
|
//
|
||||||
" }\n" +
|
// " * @Version: 2.2\n" +
|
||||||
" }\n" +
|
//
|
||||||
"}",
|
// " */\n" +
|
||||||
|
//
|
||||||
|
// "public class engine_80 extends DataModelEngine {\n" +
|
||||||
|
//
|
||||||
|
// " @Override\n" +
|
||||||
|
//
|
||||||
|
// " public void execution () {\n" +
|
||||||
|
//
|
||||||
|
// " Object value = getValue();\n" +
|
||||||
|
//
|
||||||
|
// "\n" +
|
||||||
|
//
|
||||||
|
// " if (value == null || \"\".equals(value) || \"null\".equals(value)) {\n" +
|
||||||
|
//
|
||||||
|
// " throw new ActionDiscard();\n" +
|
||||||
|
//
|
||||||
|
// " }\n" +
|
||||||
|
//
|
||||||
|
// " }\n" +
|
||||||
|
//
|
||||||
|
// "}",
|
||||||
|
|
||||||
title: "",
|
title: "",
|
||||||
|
|
||||||
|
@ -353,9 +374,11 @@ export default {
|
||||||
|
|
||||||
showCode() {
|
showCode() {
|
||||||
|
|
||||||
this.opens = true
|
generate(this.versions).then(res =>{
|
||||||
|
|
||||||
this.javaClass;
|
this.$message.success(res.msg || "成功");
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue