fix():修复规则引擎
parent
f3f2fcb15f
commit
addca4f971
|
@ -0,0 +1,65 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询【请填写功能名称】列表
|
||||||
|
export function listMaintenance(query) {
|
||||||
|
return request({
|
||||||
|
url: '/engine/maintenance/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询【请填写功能名称】详细
|
||||||
|
export function getMaintenance(id) {
|
||||||
|
return request({
|
||||||
|
url: '/engine/maintenance/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增【请填写功能名称】
|
||||||
|
export function addMaintenance(data) {
|
||||||
|
return request({
|
||||||
|
url: '/engine/maintenance',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化
|
||||||
|
export function initializeRuleEngine(data) {
|
||||||
|
return request({
|
||||||
|
url: '/engine/maintenance/InitializeRuleEngine',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//测试方法
|
||||||
|
export function testMethod(code) {
|
||||||
|
return request({
|
||||||
|
url: '/engine/maintenance/TestMethod?code='+code,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改【请填写功能名称】
|
||||||
|
export function updateMaintenance(data) {
|
||||||
|
return request({
|
||||||
|
url: '/engine/maintenance',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function updIsActivate(isActivate) {
|
||||||
|
return request({
|
||||||
|
url: '/engine/updIsActivate?isActivate='+isActivate,
|
||||||
|
method: 'put'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 删除【请填写功能名称】
|
||||||
|
export function delMaintenance(id) {
|
||||||
|
return request({
|
||||||
|
url: '/engine/maintenance/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
|
@ -1,61 +1,236 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
|
<el-dialog :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
|
||||||
|
<span>这是一段信息</span>
|
||||||
<el-card style="height: 90%">
|
<el-card style="height: 90%">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>{{ruleEngineInfo.name}}</span>
|
<span>{{ruleEngineInfo.name}}</span>
|
||||||
<el-button @click="dialogVisible = true" style="float: right;" type="primary">保 存</el-button>
|
<el-button @click="updEngine" style="float: right" type="primary">保存</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="text item">
|
<div class="text item">
|
||||||
<encoding ref="encoding" style="height: 800px" :modification="modification" :value="ruleEngineInfo.codeText"></encoding>
|
<encoding ref="encoding" :modification="modification" :value="ruleEngineInfo.codeText"></encoding>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-dialog
|
|
||||||
title="提示"
|
|
||||||
:visible.sync="dialogVisible"
|
|
||||||
width="20%">
|
|
||||||
<span style="font-size: 16px;align-content: center">确认保存吗?</span>
|
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
<el-button type="primary" @click="updRuleEngine">确 定</el-button>
|
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-descriptions class="margin-top" :title="ruleEngineInfo.name" :column="3" border>
|
||||||
|
<template slot="extra">
|
||||||
|
<el-button @click="dialogVisible= true">编辑代码</el-button>
|
||||||
|
<el-dropdown split-button type="primary" @command="handleClick">
|
||||||
|
更多操作
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item command="add" @click="addVersionStatus = true">版本添加</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="activate">{{(ruleEngineInfo.isActivate === '2' ? "激活": "禁用")+'引擎'}}</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="status">{{(ruleEngineInfo.status === '0' ? "关闭": "开启")+'引擎'}}</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
</template>
|
||||||
|
<el-descriptions-item label="规则名称"> {{ruleEngineInfo.name}} </el-descriptions-item>
|
||||||
|
<el-descriptions-item label="规则类型">
|
||||||
|
<dict-tag :options="dict.type.rule_engine_type" :value="ruleEngineInfo.type"/>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="规则作用域">
|
||||||
|
<dict-tag :options="dict.type.rule_engine_level" :value="ruleEngineInfo.level"/>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="引擎编码"> {{ruleEngineInfo.code + " ("+ruleEngineInfo.engineCode+")"}} </el-descriptions-item>
|
||||||
|
<el-descriptions-item label="是否激活">
|
||||||
|
<dict-tag :options="dict.type.rule_engine_activate_status" :value="ruleEngineInfo.isActivate"/>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="规则状态">
|
||||||
|
<dict-tag :options="dict.type.sys_normal_disable" :value="ruleEngineInfo.status"/>
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
<editor style="margin-top: 20px" :read-only="true" v-model="ruleEngineInfo.description"></editor>
|
||||||
|
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>规则引擎版本</span>
|
||||||
|
</div>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12" v-for="ruleEngineVersion in ruleEngineInfo.versionList">
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>{{ruleEngineVersion.name + "-" + ruleEngineVersion.code}}</span>
|
||||||
|
<el-dropdown style="float: right; padding: 3px 0">
|
||||||
|
<span class="el-dropdown-link">
|
||||||
|
更多操作<i class="el-icon-arrow-down el-icon--right"></i>
|
||||||
|
</span>
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item command="info">规则详情</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="test" >测试规则</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="status">禁用规则</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
</div>
|
||||||
|
<el-descriptions class="margin-top" :column="2" border>
|
||||||
|
<el-descriptions-item label="版本类" :span="2"> {{ruleEngineInfo.engineCode+"_"+ruleEngineVersion.code}} </el-descriptions-item>
|
||||||
|
<el-descriptions-item label="版本名称"> {{ruleEngineVersion.name}} </el-descriptions-item>
|
||||||
|
<el-descriptions-item label="版本CODE"> {{ruleEngineVersion.code}} </el-descriptions-item>
|
||||||
|
<el-descriptions-item label="是否激活">
|
||||||
|
<dict-tag :options="dict.type.rule_engine_activate_status" :value="ruleEngineVersion.isActivate"/>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="版本状态">
|
||||||
|
<dict-tag :options="dict.type.sys_normal_disable" :value="ruleEngineVersion.status"/>
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
<editor style="margin-top: 10px" :read-only="true" v-model="ruleEngineInfo.description"></editor>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
<el-dialog
|
||||||
|
title="新增版本" :visible.sync="addVersionStatus"
|
||||||
|
width="75%">
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>基本信息</span>
|
||||||
|
<el-button style="float: right; padding: 3px 0" type="text" @click="genEngineVersion">生成引擎版本类</el-button>
|
||||||
|
</div>
|
||||||
|
<el-form :label-position="engineVersionForm" label-width="80px" :model="engineVersionForm">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="版本类">
|
||||||
|
<el-input v-model="engineVersionForm.versionCode" disabled placeholder="点击类生成自动生成类名称"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="名称">
|
||||||
|
<el-input v-model="engineVersionForm.name"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="编码">
|
||||||
|
<el-input v-model="engineVersionForm.code"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="状态">
|
||||||
|
<dict-tag :options="dict.type.sys_normal_disable" :value="engineVersionForm.status"/>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="是否激活">
|
||||||
|
<dict-tag :options="dict.type.rule_engine_activate_status" :value="engineVersionForm.isActivate"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<editor v-model="engineVersionForm.description" :min-height="150"/>
|
||||||
|
</el-card>
|
||||||
|
<el-card class="box-card" v-if="engineVersionForm.codeIng != null">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>引擎编码</span>
|
||||||
|
</div>
|
||||||
|
<encoding style="height: 800px" v-model="engineVersionForm.codeIng"></encoding>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="addVersionCancel">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="addVersionSubmission">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getMaintenance, updateMaintenance} from "@/api/ruleEngine/maintenance";
|
|
||||||
import Encoding from "@/components/Encoding/index.vue";
|
import Encoding from "@/components/Encoding/index.vue";
|
||||||
|
import {getMaintenance} from "@/api/engine/maintenance";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "EngineVersion",
|
name: "EngineVersion",
|
||||||
|
dicts: ['rule_engine_activate_status', 'rule_engine_type', 'sys_normal_disable', 'rule_engine_level'],
|
||||||
components: {Encoding},
|
components: {Encoding},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogVisible: false,
|
addVersionStatus:false,
|
||||||
|
engineVersionForm: {
|
||||||
|
"name": "", "code": "", "status": "0",
|
||||||
|
"versionCode": "",
|
||||||
|
"isActivate": "no-activate",
|
||||||
|
"description": "",
|
||||||
|
"codeIng": null
|
||||||
|
},
|
||||||
|
dialogVisible :false,
|
||||||
|
ruleEngineInfo: {
|
||||||
|
versionList:[]
|
||||||
|
|
||||||
|
},
|
||||||
|
ruleEngineInfoList:{
|
||||||
|
|
||||||
|
},
|
||||||
|
modification:null,
|
||||||
ruleEngineId: this.$route.params.ruleEngineId,
|
ruleEngineId: this.$route.params.ruleEngineId,
|
||||||
ruleEngineInfo:{},
|
|
||||||
modification: null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getInfo()
|
this.getInfo()
|
||||||
|
// this.initRuleEngine()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
updRuleEngine(){
|
// 确定新增
|
||||||
|
addVersionSubmission(){
|
||||||
|
this.addVersionStatus =false
|
||||||
|
},
|
||||||
|
// 取消新增
|
||||||
|
addVersionCancel(){
|
||||||
|
this.addVersionStatus= false
|
||||||
|
},
|
||||||
|
genEngineVersion(){
|
||||||
|
if (this.engineVersionForm.name == null || this.engineVersionForm.name === "") {
|
||||||
|
this.$message.error('规则名称不可为空');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (this.engineVersionForm.code == null || this.engineVersionForm.code === "") {
|
||||||
|
this.$message.error('规则CODE不可为空');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.engineVersionForm.versionCode = this.ruleEngineInfo.engineCode + "_" + this.engineVersionForm.code
|
||||||
|
this.engineVersionForm.codeIng = this.getCodeIng()
|
||||||
|
},
|
||||||
|
handleClose(done) {
|
||||||
|
this.$confirm('确认关闭?')
|
||||||
|
.then(_ => {
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
.catch(_ => {});
|
||||||
|
},
|
||||||
|
|
||||||
|
handleClick(clickType){
|
||||||
|
if (clickType === "add"){
|
||||||
|
this.addVersionStatus = true;
|
||||||
|
}else if(clickType === "activate"){
|
||||||
|
this.ruleEngineInfo.isActivate = '2' === this.ruleEngineInfo.isActivate ? '1' : '2'
|
||||||
|
this.$modal.msgSuccess("引擎激活状态修改成功");
|
||||||
|
}else if(clickType === "status"){
|
||||||
|
this.ruleEngineInfo.status = '0' === this.ruleEngineInfo.status ? '1' : '0'
|
||||||
|
this.$modal.msgSuccess("引擎状态操作成功");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
updEngine(){
|
||||||
this.modification = parseInt(this.ruleEngineId)
|
this.modification = parseInt(this.ruleEngineId)
|
||||||
|
setTimeout(()=>{
|
||||||
setTimeout(() => {
|
this.modification =null
|
||||||
this.modification = null
|
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
},50)
|
},50)
|
||||||
},
|
},
|
||||||
getInfo(){
|
getInfo(){
|
||||||
getMaintenance(this.$route.params.ruleEngineId).then(res => {
|
getMaintenance(this.$route.params.ruleEngineId).then(res=>{
|
||||||
|
console.log("res",res)
|
||||||
this.ruleEngineInfo = res.data
|
this.ruleEngineInfo = res.data
|
||||||
console.log(this.ruleEngineInfo)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue