feat: 规则版本
parent
d63fe4f144
commit
cfa3aa6ccb
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"name": "muyu",
|
"name": "muyu",
|
||||||
"version": "3.6.3",
|
"version": "3.6.3",
|
||||||
"description": "若依管理系统",
|
"description": "数据处理系统",
|
||||||
"author": "若依",
|
"author": "MuYu",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vue-cli-service serve",
|
"dev": "vue-cli-service serve",
|
||||||
|
@ -37,8 +37,11 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@riophae/vue-treeselect": "0.4.0",
|
"@riophae/vue-treeselect": "0.4.0",
|
||||||
|
"@vue/compiler-core": "^3.4.26",
|
||||||
|
"@vue/compiler-ssr": "^3.4.26",
|
||||||
"axios": "0.24.0",
|
"axios": "0.24.0",
|
||||||
"clipboard": "2.0.8",
|
"clipboard": "2.0.8",
|
||||||
|
"codemirror": "^5.65.16",
|
||||||
"core-js": "3.25.3",
|
"core-js": "3.25.3",
|
||||||
"echarts": "5.4.0",
|
"echarts": "5.4.0",
|
||||||
"element-ui": "2.15.13",
|
"element-ui": "2.15.13",
|
||||||
|
@ -53,9 +56,11 @@
|
||||||
"screenfull": "5.0.2",
|
"screenfull": "5.0.2",
|
||||||
"sortablejs": "1.10.2",
|
"sortablejs": "1.10.2",
|
||||||
"vue": "2.6.12",
|
"vue": "2.6.12",
|
||||||
|
"vue-codemirror": "^4.0.6",
|
||||||
"vue-count-to": "1.0.13",
|
"vue-count-to": "1.0.13",
|
||||||
"vue-cropper": "0.5.5",
|
"vue-cropper": "0.5.5",
|
||||||
"vue-meta": "2.4.0",
|
"vue-meta": "2.4.0",
|
||||||
|
"vue-monaco-editor": "0.0.19",
|
||||||
"vue-router": "3.4.9",
|
"vue-router": "3.4.9",
|
||||||
"vuedraggable": "2.24.3",
|
"vuedraggable": "2.24.3",
|
||||||
"vuex": "3.6.0"
|
"vuex": "3.6.0"
|
||||||
|
|
|
@ -194,3 +194,22 @@ export function selectDataDisplayName(name) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//权限添加
|
||||||
|
export function permissionsUserAdd(data) {
|
||||||
|
return request({
|
||||||
|
url: '/kvt/kvt/permissionsUserAdd',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//权限删除
|
||||||
|
export function permissionsUserDel(data) {
|
||||||
|
return request({
|
||||||
|
url: '/kvt/kvt/permissionsUserDel',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,14 @@ export function getEngine(id) {
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 新增授权
|
||||||
|
export function permissionsUserAdd(data) {
|
||||||
|
return request({
|
||||||
|
url: '/rule_engine/permissionsUserAdd/' ,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 新增规则引擎
|
// 新增规则引擎
|
||||||
export function addEngine(data) {
|
export function addEngine(data) {
|
||||||
|
@ -42,3 +50,55 @@ export function delEngine(id) {
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 加载
|
||||||
|
export function loading(data) {
|
||||||
|
return request({
|
||||||
|
url: '/rule_engine/engine/loading/' ,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 加载
|
||||||
|
export function writeCodeAdd(data) {
|
||||||
|
return request({
|
||||||
|
url: '/rule_engine/engine/writeCodeAdd/' ,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获取规则引擎版本列表
|
||||||
|
export function selectRuleEngineVersion(id) {
|
||||||
|
return request({
|
||||||
|
url: '/rule_engine/engine/selectRuleEngineVersion?id='+id ,
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获取规则引擎是否激活
|
||||||
|
export function updateRuleEngineVersionIsActivate(data) {
|
||||||
|
return request({
|
||||||
|
url: '/rule_engine/engine/updateRuleEngineVersionIsActivate' ,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}// 获取规则引擎状态
|
||||||
|
export function updateRuleEngineVersionStates(data) {
|
||||||
|
return request({
|
||||||
|
url: '/rule_engine/engine/updateRuleEngineVersionStates' ,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 添加规则引擎
|
||||||
|
export function ruleEngineVersionAdd(data) {
|
||||||
|
return request({
|
||||||
|
url: '/rule_engine/engine/RuleEngineVersionAdd' ,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div style="height: 800px">
|
<div>
|
||||||
<codemirror ref="codeMirror" :value="code" :options="cmOptions" style="height: 800px"/>
|
<codemirror ref="codeMirror" :value="code" :options="cmOptions"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ export default {
|
||||||
|
|
||||||
.CodeMirror {
|
.CodeMirror {
|
||||||
font-family: 'JetBrainsMono-Medium', monospace;
|
font-family: 'JetBrainsMono-Medium', monospace;
|
||||||
height: 800px;
|
height: 600px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-lines {
|
.CodeMirror-lines {
|
||||||
|
|
|
@ -71,6 +71,13 @@ export const constantRoutes = [
|
||||||
name: 'Index',
|
name: 'Index',
|
||||||
meta: {title: '首页', icon: 'dashboard', affix: true}
|
meta: {title: '首页', icon: 'dashboard', affix: true}
|
||||||
}
|
}
|
||||||
|
,
|
||||||
|
{
|
||||||
|
path: '/engine/engineMaintenance/:id', // :id 是动态参数
|
||||||
|
name: 'EngineVersion', // 给路由起一个名字
|
||||||
|
component: () => import('@/views/ruleEngine/engineVersion'), // 加载对应的路径
|
||||||
|
meta: {title: '规则维护' ,affix: true}
|
||||||
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -87,6 +94,7 @@ export const constantRoutes = [
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
// 动态路由,基于用户权限动态去加载
|
// 动态路由,基于用户权限动态去加载
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div>
|
<div>
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>111资产模型基本信息</span>
|
<span>{{title}}资产模型基本信息</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -184,7 +184,8 @@ export default {
|
||||||
'selectData',
|
'selectData',
|
||||||
'childrenMess',
|
'childrenMess',
|
||||||
'selectAll',
|
'selectAll',
|
||||||
'dictName'
|
'dictName',
|
||||||
|
'title'
|
||||||
],
|
],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -146,7 +146,8 @@ export default {
|
||||||
'selectAll',
|
'selectAll',
|
||||||
'dictName',
|
'dictName',
|
||||||
'bb',
|
'bb',
|
||||||
'shu'
|
'shu',
|
||||||
|
'title'
|
||||||
],
|
],
|
||||||
// watch:{
|
// watch:{
|
||||||
// activeTab(newVal,oldVal){
|
// activeTab(newVal,oldVal){
|
||||||
|
|
|
@ -110,18 +110,16 @@ export default {
|
||||||
if (node.level === 0) return resolve(this.assetStructureList);
|
if (node.level === 0) return resolve(this.assetStructureList);
|
||||||
const {data} = node;
|
const {data} = node;
|
||||||
this.showAssets = data.type;
|
this.showAssets = data.type;
|
||||||
|
|
||||||
selectChildAll().then(res=>{
|
selectChildAll().then(res=>{
|
||||||
console.log(res)
|
console.log("wwwwwwww",res)
|
||||||
this.chir = res.data
|
this.chir = res.data
|
||||||
})
|
})
|
||||||
console.log(node)
|
|
||||||
selectDepartmen(node.data.databaseName).then(res=>{
|
selectDepartmen(node.data.databaseName).then(res=>{
|
||||||
this.childrenList = res.data
|
this.childrenList = res.data
|
||||||
})
|
})
|
||||||
if (node.level==1){
|
if (node.level==1){
|
||||||
overallDataStructure().then(res =>{
|
overallDataStructure().then(res =>{
|
||||||
console.log(res)
|
console.log("rrrr",res)
|
||||||
this.DataStructure = res.data
|
this.DataStructure = res.data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -129,8 +127,7 @@ export default {
|
||||||
this.aa=data.id
|
this.aa=data.id
|
||||||
console.log("55555555555555555",data)
|
console.log("55555555555555555",data)
|
||||||
selectDictionaryy(data.id).then(res => {
|
selectDictionaryy(data.id).then(res => {
|
||||||
|
console.log("selectDictionaryy",res.data)
|
||||||
console.log("res",res)
|
|
||||||
this.dictAddName = res.data
|
this.dictAddName = res.data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -141,13 +138,12 @@ export default {
|
||||||
resolve(this.childrenList)
|
resolve(this.childrenList)
|
||||||
}, 500);
|
}, 500);
|
||||||
},
|
},
|
||||||
|
|
||||||
showAssetsFun(data){
|
showAssetsFun(data){
|
||||||
this.title = data.name + '('+data.databaseName + '-' + data.systemName+')'
|
this.title = data.name + '('+data.databaseName + '-' + data.systemName+')'
|
||||||
this.showAssets = data.type;
|
this.showAssets = data.type;
|
||||||
this.dataname= data.name,
|
this.dataname= data.name,
|
||||||
this.databaseNam= data.databaseName
|
this.databaseNam= data.databaseName
|
||||||
|
|
||||||
console.log("dataname",data.name)
|
|
||||||
selectChild(data.name).then(res =>{
|
selectChild(data.name).then(res =>{
|
||||||
this.childr=res.data
|
this.childr=res.data
|
||||||
})
|
})
|
||||||
|
|
|
@ -49,10 +49,10 @@
|
||||||
active-color="#13ce66"
|
active-color="#13ce66"
|
||||||
inactive-color="#ff4949"
|
inactive-color="#ff4949"
|
||||||
active-text="已授权"
|
active-text="已授权"
|
||||||
inactive-text="未授权" >
|
inactive-text="未授权"
|
||||||
<!-- :active-value="1"-->
|
:active-value="1"
|
||||||
<!-- :inactive-value="0"-->
|
:inactive-value="0"
|
||||||
|
>
|
||||||
</el-switch>
|
</el-switch>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -61,6 +61,7 @@
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|
||||||
<el-tab-pane label="用户授权" name="user">
|
<el-tab-pane label="用户授权" name="user">
|
||||||
|
{{userList}}
|
||||||
<el-table ref="table" v-loading="loading" :data="userList">
|
<el-table ref="table" v-loading="loading" :data="userList">
|
||||||
<el-table-column align="center" label="用户名称" prop="userName"/>
|
<el-table-column align="center" label="用户名称" prop="userName"/>
|
||||||
<el-table-column align="center" label="用户昵称" prop="nickName"/>
|
<el-table-column align="center" label="用户昵称" prop="nickName"/>
|
||||||
|
@ -76,10 +77,10 @@
|
||||||
active-color="#13ce66"
|
active-color="#13ce66"
|
||||||
inactive-color="#ff4949"
|
inactive-color="#ff4949"
|
||||||
active-text="已授权"
|
active-text="已授权"
|
||||||
inactive-text="未授权">
|
inactive-text="未授权"
|
||||||
<!-- :active-value="1"-->
|
:active-value="1"
|
||||||
<!-- :inactive-value="0"-->
|
:inactive-value="0"
|
||||||
|
@change="permissionsAdd(scope.row)">
|
||||||
</el-switch>
|
</el-switch>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -93,7 +94,7 @@
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { parseTime } from '@/utils/muyu'
|
import { parseTime } from '@/utils/muyu'
|
||||||
import { listDept } from '@/api/system/dept'
|
import { permissionsUserAdd } from '@/api/kvt/kvt'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AuthDataSource",
|
name: "AuthDataSource",
|
||||||
|
@ -113,7 +114,6 @@ export default {
|
||||||
pageSize: 1,
|
pageSize: 1,
|
||||||
// 基本信息
|
// 基本信息
|
||||||
baseInfo: {},
|
baseInfo: {},
|
||||||
|
|
||||||
// 部门列表
|
// 部门列表
|
||||||
deptList: [],
|
deptList: [],
|
||||||
// // 用户列表
|
// // 用户列表
|
||||||
|
@ -125,6 +125,7 @@ export default {
|
||||||
setTimeout(() => this.loading = false, 200)
|
setTimeout(() => this.loading = false, 200)
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
||||||
'activeName.status'(newVal) {
|
'activeName.status'(newVal) {
|
||||||
if (newVal === 0) {
|
if (newVal === 0) {
|
||||||
alert("闭关")
|
alert("闭关")
|
||||||
|
@ -147,8 +148,26 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
permissionsAdd(row) {
|
||||||
|
console.log("rrrow", row)
|
||||||
|
const userId =row.userId
|
||||||
|
const deptId =row.dept.deptId
|
||||||
|
console.log("Tht",this.DataSource)
|
||||||
|
let data = {
|
||||||
|
tbaleName:this.DataSource.databaseName,
|
||||||
|
kvtId:this.DataSource.id,
|
||||||
|
userId: userId,
|
||||||
|
deptId :deptId
|
||||||
|
}
|
||||||
|
console.log("dataaaa",data)
|
||||||
|
permissionsUserAdd(data).then(res => {
|
||||||
|
this.$message.success(res.data)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
click(row){
|
||||||
|
console.log("rrrrrrrrrrr",row)
|
||||||
|
},
|
||||||
parseTime,
|
parseTime,
|
||||||
|
|
||||||
/** 转换部门数据结构 */
|
/** 转换部门数据结构 */
|
||||||
normalizer(node) {
|
normalizer(node) {
|
||||||
if (node.children && !node.children.length) {
|
if (node.children && !node.children.length) {
|
||||||
|
|
|
@ -93,9 +93,9 @@
|
||||||
active-text="已授权"
|
active-text="已授权"
|
||||||
inactive-text="未授权"
|
inactive-text="未授权"
|
||||||
:active-value="1"
|
:active-value="1"
|
||||||
:inactive-value="0">
|
:inactive-value="0"
|
||||||
<!-- @change="updateUserPermissions(row)"-->
|
@change="updateUserPermissions(scope.row)"
|
||||||
|
>
|
||||||
</el-switch>
|
</el-switch>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -110,13 +110,14 @@
|
||||||
|
|
||||||
import { parseTime } from '@/utils/muyu'
|
import { parseTime } from '@/utils/muyu'
|
||||||
import { listDept } from '@/api/system/dept'
|
import { listDept } from '@/api/system/dept'
|
||||||
|
import { permissionsUserAdd, permissionsUserDel } from '@/api/kvt/kvt'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AuthTable",
|
name: "AuthTable",
|
||||||
props: [
|
props: [
|
||||||
"DataSource",
|
"DataSource",
|
||||||
"deptlists",
|
"deptlists",
|
||||||
"userList"
|
"userList",
|
||||||
],
|
],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -154,7 +155,6 @@ export default {
|
||||||
console.log("rowwwwwww",row)
|
console.log("rowwwwwww",row)
|
||||||
// 开关为激活状态,执行相关逻辑
|
// 开关为激活状态,执行相关逻辑
|
||||||
} else if (newVal === 1) {
|
} else if (newVal === 1) {
|
||||||
|
|
||||||
alert("打开")
|
alert("打开")
|
||||||
// 开关为未激活状态,执行相关逻辑
|
// 开关为未激活状态,执行相关逻辑
|
||||||
}
|
}
|
||||||
|
@ -170,6 +170,22 @@ export default {
|
||||||
// this.selectDept()
|
// this.selectDept()
|
||||||
// },
|
// },
|
||||||
methods: {
|
methods: {
|
||||||
|
updateUserPermissions(row){
|
||||||
|
console.log("rrrow", row)
|
||||||
|
const userId =row.userId
|
||||||
|
const deptId =row.dept.deptId
|
||||||
|
console.log("Tht",this.DataSource)
|
||||||
|
let data = {
|
||||||
|
tbaleName:this.DataSource.tableName,
|
||||||
|
kvtId:this.DataSource.id,
|
||||||
|
userId: userId,
|
||||||
|
deptId :deptId
|
||||||
|
}
|
||||||
|
|
||||||
|
permissionsUserAdd(data).then(res => {
|
||||||
|
this.$message.success(res.data)
|
||||||
|
})
|
||||||
|
},
|
||||||
parseTime,
|
parseTime,
|
||||||
/** 转换部门数据结构 */
|
/** 转换部门数据结构 */
|
||||||
normalizer(node) {
|
normalizer(node) {
|
||||||
|
|
|
@ -104,16 +104,17 @@ export default {
|
||||||
selectData(node){
|
selectData(node){
|
||||||
console.log("nodenodddd",node)
|
console.log("nodenodddd",node)
|
||||||
let authTable ={}
|
let authTable ={}
|
||||||
|
const id = node.data.id
|
||||||
const name = node.data.name
|
const name = node.data.name
|
||||||
const systemName =node.data.systemName
|
const systemName =node.data.systemName
|
||||||
const databaseName =node.data.databaseName
|
const databaseName =node.data.databaseName
|
||||||
authTable = {
|
authTable = {
|
||||||
|
id,
|
||||||
name,
|
name,
|
||||||
systemName,
|
systemName,
|
||||||
databaseName
|
databaseName
|
||||||
}
|
}
|
||||||
this.authTable =authTable
|
this.authTable =authTable
|
||||||
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listDept(this.queryParams).then(response => {
|
listDept(this.queryParams).then(response => {
|
||||||
this.deptList = this.handleTree(response.data, "deptId");
|
this.deptList = this.handleTree(response.data, "deptId");
|
||||||
|
@ -129,7 +130,9 @@ export default {
|
||||||
},
|
},
|
||||||
//查询表中的数据条数
|
//查询表中的数据条数
|
||||||
selectTable(node){
|
selectTable(node){
|
||||||
|
console.log("dddddddddddd",node)
|
||||||
let authTable ={}
|
let authTable ={}
|
||||||
|
const id =node.parent.data.id
|
||||||
const name = node.parent.data.name
|
const name = node.parent.data.name
|
||||||
const systemName =node.parent.data.systemName
|
const systemName =node.parent.data.systemName
|
||||||
const databaseName =node.parent.data.databaseName
|
const databaseName =node.parent.data.databaseName
|
||||||
|
@ -137,6 +140,7 @@ export default {
|
||||||
const tableAsName =node.data.as
|
const tableAsName =node.data.as
|
||||||
const total =node.data.dataTotal
|
const total =node.data.dataTotal
|
||||||
authTable ={
|
authTable ={
|
||||||
|
id,
|
||||||
name,
|
name,
|
||||||
systemName,
|
systemName,
|
||||||
databaseName,
|
databaseName,
|
||||||
|
|
|
@ -85,16 +85,15 @@ export default {
|
||||||
this.selectDataSource()
|
this.selectDataSource()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
selectDataDisplay(){
|
selectDataDisplay(){
|
||||||
selectDataDisplay().then(res =>{
|
selectDataDisplay().then(res =>{
|
||||||
this.assetShowList = res.data
|
this.assetShowList = res.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
selectDataStur(node) {
|
selectDataStur(node) {
|
||||||
console.log("nodedddd",node)
|
|
||||||
this.dataStructure = node.data
|
|
||||||
|
|
||||||
|
this.dataStructure = node.data
|
||||||
|
console.log("nodedddd", this.dataStructure)
|
||||||
if (node.level ===2)
|
if (node.level ===2)
|
||||||
selectDataDisplayName(node.data.name).then(res =>{
|
selectDataDisplayName(node.data.name).then(res =>{
|
||||||
this.assetShowList = res.data
|
this.assetShowList = res.data
|
||||||
|
|
|
@ -169,6 +169,11 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="最大等待次数" align="center" prop="maxWaitSize" />
|
<el-table-column label="最大等待次数" align="center" prop="maxWaitSize" />
|
||||||
|
<el-table-column label="是否初始化" align="center" prop="isInit" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isInit"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
@ -332,6 +337,15 @@
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>其他信息</span>
|
<span>其他信息</span>
|
||||||
</div>
|
</div>
|
||||||
|
<el-form-item label="是否初始化" prop="isInit">
|
||||||
|
<el-radio-group v-model="form.isInit">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in dict.type.sys_yes_no"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.value"
|
||||||
|
>{{dict.label}}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -359,6 +373,7 @@ import {
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Kvt",
|
name: "Kvt",
|
||||||
|
dicts: ["sys_yes_no"],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
|
@ -439,7 +454,11 @@ export default {
|
||||||
],
|
],
|
||||||
password: [
|
password: [
|
||||||
{required: true, message: "密码不能为空", trigger: "blur"}
|
{required: true, message: "密码不能为空", trigger: "blur"}
|
||||||
|
],
|
||||||
|
isInit: [
|
||||||
|
{required: true, message: "是否初始化不可为空", trigger: "blur"}
|
||||||
]
|
]
|
||||||
|
|
||||||
},
|
},
|
||||||
// 条件参数内容
|
// 条件参数内容
|
||||||
dataSourceParamList: [
|
dataSourceParamList: [
|
||||||
|
|
|
@ -6,13 +6,46 @@
|
||||||
</div>
|
</div>
|
||||||
<el-form ref="form" :model="ruleEngineCommonConfig" label-width="120px">
|
<el-form ref="form" :model="ruleEngineCommonConfig" label-width="120px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="24">
|
||||||
<el-form-item label="规则基础目录">
|
<el-form-item label="规则基础目录">
|
||||||
<el-input v-model="ruleEngineCommonConfig.packageName" disabled></el-input>
|
<el-input v-model="ruleEngineCommonConfig.packageName" disabled></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
<el-form-item label="自定义基础目录">
|
||||||
|
<el-input v-model="ruleEngineCommonConfig.customName" disabled></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="模板基础目录">
|
||||||
|
<el-input v-model="ruleEngineCommonConfig.templateName" disabled></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="win源码目录">
|
||||||
|
<el-input v-model="ruleEngineCommonConfig.sourceWin" disabled></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="win编译目录">
|
||||||
|
<el-input v-model="ruleEngineCommonConfig.targetWin" disabled></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="liunx源码目录">
|
||||||
|
<el-input v-model="ruleEngineCommonConfig.sourceLiunx" disabled></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="liunx编译目录">
|
||||||
|
<el-input v-model="ruleEngineCommonConfig.targetLiunx" disabled></el-input>
|
||||||
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
@ -24,7 +57,7 @@
|
||||||
</div>
|
</div>
|
||||||
<el-tabs type="border-card" v-model="codeCardStatus">
|
<el-tabs type="border-card" v-model="codeCardStatus">
|
||||||
<el-tab-pane v-for="scope in scopeList" :label="scope.type" :name="scope.value">
|
<el-tab-pane v-for="scope in scopeList" :label="scope.type" :name="scope.value">
|
||||||
<encoding v-if="codeCardStatus === scope.value" style="height: 800px" v-model="scope.code" :read-only="true"></encoding>
|
<encoding v-if="codeCardStatus === scope.value" style="height: 600px" v-model="scope.code" :read-only="true"></encoding>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
@ -44,6 +77,12 @@ export default {
|
||||||
codeCardStatus: "taskContext",
|
codeCardStatus: "taskContext",
|
||||||
ruleEngineCommonConfig: {
|
ruleEngineCommonConfig: {
|
||||||
packageName: "com.muyu.rule.engine",
|
packageName: "com.muyu.rule.engine",
|
||||||
|
customName: "custom",
|
||||||
|
templateName: "template",
|
||||||
|
sourceWin: "D:\\config\\engine\\source",
|
||||||
|
targetWin: "D:\\config\\engine\\target",
|
||||||
|
sourceLiunx: "/home/config/source",
|
||||||
|
targetLiunx: "/home/config/target",
|
||||||
},
|
},
|
||||||
scopeList: [
|
scopeList: [
|
||||||
{ type: "任务", value: "taskContext", "code":
|
{ type: "任务", value: "taskContext", "code":
|
||||||
|
|
|
@ -104,8 +104,15 @@
|
||||||
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
|
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="文件名称" align="center" prop="writeCode" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-takeaway-box"
|
||||||
|
@click="writeCode(scope.row)"
|
||||||
|
>编写代码</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
|
@ -203,6 +210,11 @@
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="文件名称" prop="status">
|
||||||
|
<el-input v-model="form.writeCode" placeholder="请输入文件名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
|
@ -222,11 +234,30 @@
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
title="代码编辑器"
|
||||||
|
:visible.sync="centerDialogVisible"
|
||||||
|
width="50%"
|
||||||
|
>
|
||||||
|
<div ref="editor" style="height: 300px; border: 1px solid #ccc; padding: 10px;"></div>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="tosend">确 定</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
import { addEngine, delEngine, listEngine, loading, updateEngine, writeCodeAdd } from '@/api/rule_engine/engine'
|
||||||
|
import 'codemirror/lib/codemirror.css';
|
||||||
|
import 'codemirror/mode/javascript/javascript.js';
|
||||||
|
import CodeMirror from 'codemirror';
|
||||||
export default {
|
export default {
|
||||||
name: "EngineMaintenance",
|
name: "EngineMaintenance",
|
||||||
dicts: ['rule_engine_activate_status', 'rule_engine_type', 'sys_normal_disable', 'rule_engine_level'],
|
dicts: ['rule_engine_activate_status', 'rule_engine_type', 'sys_normal_disable', 'rule_engine_level'],
|
||||||
|
@ -262,6 +293,7 @@ export default {
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
|
centerDialogVisible: false,
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
name: [
|
name: [
|
||||||
|
@ -282,70 +314,129 @@ export default {
|
||||||
status: [
|
status: [
|
||||||
{ required: true, message: "规则状态不能为空", trigger: "change" }
|
{ required: true, message: "规则状态不能为空", trigger: "change" }
|
||||||
],
|
],
|
||||||
|
writeCode: [
|
||||||
|
{ required: true, message: "编写文件名不能为空", trigger: "change" }
|
||||||
|
],
|
||||||
createBy: [
|
createBy: [
|
||||||
{ required: true, message: "创建者不能为空", trigger: "blur" }
|
{ required: true, message: "创建者不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
createTime: [
|
createTime: [
|
||||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
}
|
},
|
||||||
|
cc:{}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
//查询规则类型
|
||||||
|
this.getDicts("sys_normal_disable").then(response => {
|
||||||
|
this.statusOptions = response.data;
|
||||||
|
});
|
||||||
|
//查询作用域
|
||||||
|
this.getDicts("rule_engine_type").then(response => {
|
||||||
|
this.typeOptions = response.data;
|
||||||
|
});
|
||||||
|
//查询激活状态
|
||||||
|
this.getDicts("rule_engine_activate_status").then(response => {
|
||||||
|
this.activateStatusOptions = response.data;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//添加编写编码
|
||||||
|
tosend(){
|
||||||
|
console.log("www",this.editor.getValue())
|
||||||
|
console.log("ccc",this.cc)
|
||||||
|
let name=this.cc.name
|
||||||
|
let type=this.cc.type
|
||||||
|
let code=this.cc.code
|
||||||
|
let level=this.cc.level
|
||||||
|
let isActivate=this.cc.isActivate
|
||||||
|
let status=this.cc.status
|
||||||
|
let writeCode = this.cc.writeCode
|
||||||
|
let sql =this.editor.getValue()
|
||||||
|
|
||||||
|
const data={
|
||||||
|
name, type, code, isActivate, status, sql,writeCode,level
|
||||||
|
}
|
||||||
|
writeCodeAdd(data).then(res => {
|
||||||
|
this.$message.success(res.data)
|
||||||
|
})
|
||||||
|
this.centerDialogVisible=false
|
||||||
|
},
|
||||||
|
//编写代码
|
||||||
|
writeCode(row){
|
||||||
|
this.cc = row
|
||||||
|
this.centerDialogVisible=true
|
||||||
|
loading(row).then(res => {
|
||||||
|
this.editor.setValue(res.data)
|
||||||
|
})
|
||||||
|
if (!this.editor) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.editor = CodeMirror(this.$refs.editor, {
|
||||||
|
value: "",
|
||||||
|
mode: "javascript",
|
||||||
|
lineNumbers: true,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
toEngineVersion(row){
|
toEngineVersion(row){
|
||||||
this.$router.push({ path: `/rule-engine/engine-version/${row.id}`});
|
console.log(row.id)
|
||||||
|
this.$router.push({ path: `/engine/engineMaintenance/${row.id}`});
|
||||||
},
|
},
|
||||||
/** 查询规则引擎列表 */
|
/** 查询规则引擎列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
let response = {
|
// let response = {
|
||||||
"code": 200,
|
// "code": 200,
|
||||||
"msg": "查询成功",
|
// "msg": "查询成功",
|
||||||
"data": {
|
// "data": {
|
||||||
"total": 1,
|
// "total": 1,
|
||||||
"rows": [
|
// "rows": [
|
||||||
{
|
// {
|
||||||
"id": 1,
|
// "id": 1,
|
||||||
"name": "邮箱规则",
|
// "name": "邮箱规则",
|
||||||
"type": "rule-custom",
|
// "type": "rule-custom",
|
||||||
"isActivate": "no-activate",
|
// "isActivate": "no-activate",
|
||||||
"status": "0",
|
// "status": "0",
|
||||||
"description": "<p>根据邮箱规则进行数据校验,内包含所有邮箱校验规则</p>",
|
// "description": "<p>根据邮箱规则进行数据校验,内包含所有邮箱校验规则</p>",
|
||||||
"remark": "-",
|
// "remark": "-",
|
||||||
"code": "email",
|
// "code": "email",
|
||||||
"level": "data-field"
|
// "level": "data-field"
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
"id": 2,
|
// "id": 2,
|
||||||
"name": "唯一性校验",
|
// "name": "唯一性校验",
|
||||||
"type": "rule-custom",
|
// "type": "rule-custom",
|
||||||
"isActivate": "no-activate",
|
// "isActivate": "no-activate",
|
||||||
"status": "0",
|
// "status": "0",
|
||||||
"description": "<p>根据字段组合匹配等,进行不同数据集合的校验</p>",
|
// "description": "<p>根据字段组合匹配等,进行不同数据集合的校验</p>",
|
||||||
"remark": "-",
|
// "remark": "-",
|
||||||
"code": "only",
|
// "code": "only",
|
||||||
"level": "data-field"
|
// "level": "data-field"
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
"id": 3,
|
// "id": 3,
|
||||||
"name": "远程接口校验",
|
// "name": "远程接口校验",
|
||||||
"type": "rule-custom",
|
// "type": "rule-custom",
|
||||||
"isActivate": "no-activate",
|
// "isActivate": "no-activate",
|
||||||
"status": "0",
|
// "status": "0",
|
||||||
"description": "<p>根据接口不同进行,远程API调用匹配是否数据完整</p>",
|
// "description": "<p>根据接口不同进行,远程API调用匹配是否数据完整</p>",
|
||||||
"remark": "-",
|
// "remark": "-",
|
||||||
"code": "remote",
|
// "code": "remote",
|
||||||
"level": "data-field"
|
// "level": "data-field"
|
||||||
},
|
// },
|
||||||
]
|
// ]
|
||||||
}
|
// }
|
||||||
};
|
// };
|
||||||
this.engineList = response.data.rows;
|
listEngine().then(res =>{
|
||||||
this.total = response.data.total;
|
this.engineList = res.data.rows;
|
||||||
|
this.total = res.data.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
|
@ -400,11 +491,19 @@ export default {
|
||||||
console.log(JSON.stringify(this.form))
|
console.log(JSON.stringify(this.form))
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
|
updateEngine(this.form).then(res =>{
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
})
|
||||||
this.open = false;
|
this.open = false;
|
||||||
|
this.getList()
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
addEngine(this.form).then(res =>{
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
|
||||||
|
})
|
||||||
this.open = false;
|
this.open = false;
|
||||||
|
this.getList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -413,7 +512,10 @@ export default {
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ids = row.id || this.ids;
|
const ids = row.id || this.ids;
|
||||||
this.$modal.confirm('是否确认删除规则引擎编号为"' + ids + '"的数据项?').then(() => {
|
this.$modal.confirm('是否确认删除规则引擎编号为"' + ids + '"的数据项?').then(() => {
|
||||||
|
delEngine(ids).then(res =>{
|
||||||
|
this.getList()
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
|
|
|
@ -1,23 +1,631 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="app-container">
|
||||||
{{ruleEngineId}}
|
<el-descriptions class="margin-top" :title="ruleEngineInfo.name" :column="3" border>
|
||||||
|
<template slot="extra">
|
||||||
|
<el-dropdown split-button type="primary" @command="handleClick">
|
||||||
|
更多操作
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item command="add" >版本添加</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="activate" >{{(ruleEngineInfo.isActivate === 'no-activate' ? "激活": "禁用")+'引擎'}}</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="status">{{(ruleEngineInfo.status === '0' ? "关闭": "开启")+'引擎'}}</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown> {{ruleEngineInfo}}
|
||||||
|
</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.ruleEngineVersionList">
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>{{ruleEngineVersion.name + "-" + ruleEngineVersion.code}}</span>
|
||||||
|
<el-dropdown style="float: right; padding: 3px 0" @command="checkRuleEngineVersion">
|
||||||
|
<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="{event: 'info', ruleEngineVersion: ruleEngineVersion}">规则详情</el-dropdown-item>
|
||||||
|
<el-dropdown-item :command="{event: 'test', ruleEngineVersion: ruleEngineVersion}"
|
||||||
|
:disabled="ruleEngineVersion.status === '0'"
|
||||||
|
>测试规则</el-dropdown-item>
|
||||||
|
<el-dropdown-item :command="{event: 'status', ruleEngineVersion: ruleEngineVersion}" :disabled="ruleEngineVersion.status !== '2'">
|
||||||
|
{{ruleEngineVersion.isActivate !== 'no-activate' ? "禁用" : "激活"}}规则
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item
|
||||||
|
:command="{event: 'publish', ruleEngineVersion: ruleEngineVersion}"
|
||||||
|
v-if="ruleEngineVersion.status === '1' && ruleEngineVersion.isTest === '1'">
|
||||||
|
发布规则
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
</div>
|
||||||
|
<el-descriptions class="margin-top" :column="2" border>
|
||||||
|
<el-descriptions-item label="版本类" :span="2"> {{ruleEngineVersion.versionCode}} </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.rule_engine_version_status" :value="ruleEngineVersion.status"/>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="是否测试">
|
||||||
|
<dict-tag :options="dict.type.rule_engine_activate_is_test" :value="ruleEngineVersion.isTest"/>
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</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 :data="engineVersionForm" label-width="80px" :model="engineVersionForm">
|
||||||
|
<el-row>
|
||||||
|
{{engineVersionForm}}
|
||||||
|
<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.rule_engine_version_status" :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>
|
||||||
|
<el-drawer
|
||||||
|
title="规则版本详情" size="80%" :before-close="ruleEngineVersionInfoStatusClose"
|
||||||
|
:visible.sync="ruleEngineVersionInfoStatus"
|
||||||
|
:direction="'rtl'">
|
||||||
|
<div class="app-container">
|
||||||
|
<el-descriptions v-if="ruleEngineVersionInfoAndTest != null" class="margin-top" :column="2" border>
|
||||||
|
<el-descriptions-item label="版本类" :span="2"> {{ruleEngineVersionInfoAndTest.versionCode}} </el-descriptions-item>
|
||||||
|
<el-descriptions-item label="版本名称"> {{ruleEngineVersionInfoAndTest.name}} </el-descriptions-item>
|
||||||
|
<el-descriptions-item label="版本CODE"> {{ruleEngineVersionInfoAndTest.code}} </el-descriptions-item>
|
||||||
|
<el-descriptions-item label="是否激活">
|
||||||
|
<dict-tag :options="dict.type.rule_engine_activate_status" :value="ruleEngineVersionInfoAndTest.isActivate"/>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="版本状态">
|
||||||
|
<dict-tag :options="dict.type.rule_engine_version_status" :value="ruleEngineVersionInfoAndTest.status"/>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="是否测试">
|
||||||
|
<dict-tag :options="dict.type.rule_engine_activate_is_test" :value="ruleEngineVersionInfoAndTest.isTest"/>
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
<editor style="margin-top: 10px" :read-only="true" :min-height="100" v-model="ruleEngineVersionInfoAndTest.description"></editor>
|
||||||
|
<el-row style="margin-top: 10px">
|
||||||
|
<el-button @click="saveCoding">保存代码</el-button>
|
||||||
|
</el-row>
|
||||||
|
<encoding style="height: 800px; margin-top: 20px" v-model="ruleEngineVersionInfoAndTest.codeIng"></encoding>
|
||||||
|
</div>
|
||||||
|
</el-drawer>
|
||||||
|
|
||||||
|
<el-drawer
|
||||||
|
title="规则版本测试" size="80%" :before-close="ruleEngineVersionTestStatusClose"
|
||||||
|
:visible.sync="ruleEngineVersionTestStatus"
|
||||||
|
:direction="'rtl'">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-descriptions v-if="ruleEngineVersionInfoAndTest != null" class="margin-top" :column="2" border>
|
||||||
|
<el-descriptions-item label="版本类" :span="2"> {{ruleEngineVersionInfoAndTest.versionCode}} </el-descriptions-item>
|
||||||
|
<el-descriptions-item label="版本名称"> {{ruleEngineVersionInfoAndTest.name}} </el-descriptions-item>
|
||||||
|
<el-descriptions-item label="版本CODE"> {{ruleEngineVersionInfoAndTest.code}} </el-descriptions-item>
|
||||||
|
<el-descriptions-item label="是否激活">
|
||||||
|
<dict-tag :options="dict.type.rule_engine_activate_status" :value="ruleEngineVersionInfoAndTest.isActivate"/>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="版本状态">
|
||||||
|
<dict-tag :options="dict.type.rule_engine_version_status" :value="ruleEngineVersionInfoAndTest.status"/>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="是否测试">
|
||||||
|
<dict-tag :options="dict.type.rule_engine_activate_is_test" :value="ruleEngineVersionInfoAndTest.isTest"/>
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<editor style="margin-top: 10px" :read-only="true" :min-height="105" v-model="ruleEngineVersionInfoAndTest.description"></editor>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<encoding style="margin-top: 20px" v-model="ruleEngineVersionInfoAndTest.codeIng" :read-only="true"></encoding>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-col :span="assetStructure == null ? 24 : 12">
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>选择数据接入</span>
|
||||||
|
</div>
|
||||||
|
<el-select v-model="assetStructure" style="width: 100%;">
|
||||||
|
<el-option v-for="_assetStructure in assetStructureList"
|
||||||
|
:key="_assetStructure.name"
|
||||||
|
:value="_assetStructure.name"
|
||||||
|
:label="_assetStructure.name+'('+_assetStructure.systemName+')'"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12" v-if="assetStructure != null">
|
||||||
|
<el-card class="box-card" >
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>选择资产结构</span>
|
||||||
|
</div>
|
||||||
|
<el-select v-model="assets" style="width: 100%;">
|
||||||
|
<el-option v-for="_assets in assetsList"
|
||||||
|
:key="_assets.name"
|
||||||
|
:value="_assets.name"
|
||||||
|
:label="_assets.name+'('+_assets.as+')'"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-card class="box-card" v-if="assets != null">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>选择资产模型</span>
|
||||||
|
</div>
|
||||||
|
<el-descriptions direction="vertical" :column="3" border>
|
||||||
|
<el-descriptions-item v-for="_dataModel in dataModelList"
|
||||||
|
:label='_dataModel.name + "("+_dataModel.comment+")"'>
|
||||||
|
<el-radio v-model="dataMode" :label="_dataModel.name" :value="_dataModel.id">{{dataModeMap[_dataModel.name]}}</el-radio>
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" style="margin-top: 10px" v-if="dataMode != null">
|
||||||
|
<el-button>测试</el-button>
|
||||||
|
<el-input style="margin-top: 10px" v-model="testResult" type="textarea" placeholder="请点击测试" />
|
||||||
|
</el-col>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-drawer>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {
|
||||||
|
ruleEngineVersionAdd,
|
||||||
|
selectRuleEngineVersion,
|
||||||
|
updateRuleEngineVersionIsActivate,
|
||||||
|
updateRuleEngineVersionStates
|
||||||
|
} from '@/api/rule_engine/engine'
|
||||||
|
import Encoding from "@/components/Encoding/index.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "EngineVersion",
|
name: "EngineVersion",
|
||||||
|
components: {Encoding},
|
||||||
|
dicts: ['rule_engine_activate_status', 'rule_engine_type', 'sys_normal_disable',
|
||||||
|
'rule_engine_level', 'rule_engine_version_status', 'rule_engine_activate_is_test'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
ruleEngineId: this.$route.params && this.$route.params.ruleEngineId,
|
ruleEngine: this.$route.params && this.$route.params.id,
|
||||||
|
ruleEngineInfo: {},
|
||||||
|
// "id": 1,
|
||||||
|
// "name": "邮箱规则",
|
||||||
|
// "type": "rule-custom",
|
||||||
|
// "isActivate": "no-activate",
|
||||||
|
// "status": "0",
|
||||||
|
// "description": "<p>根据邮箱规则进行数据校验,内包含所有邮箱校验规则</p>",
|
||||||
|
// "remark": "-",
|
||||||
|
// "code": "email",
|
||||||
|
// "engineCode": "engine_custom_email",
|
||||||
|
// "level": "data-field",
|
||||||
|
// 新增版本
|
||||||
|
addVersionStatus: false,
|
||||||
|
engineVersionForm: {
|
||||||
|
"name": "", "code": "", "status": "0", "isTest": "0",
|
||||||
|
"versionCode": "",
|
||||||
|
"isActivate": "no-activate",
|
||||||
|
"description": "",
|
||||||
|
"codeIng": null
|
||||||
|
} , // 详情抽屉状态
|
||||||
|
ruleEngineVersionInfoStatus: false,
|
||||||
|
// 测试抽屉状态
|
||||||
|
ruleEngineVersionTestStatus: false,
|
||||||
|
// 弹框抽屉
|
||||||
|
ruleEngineVersionInfoAndTest: {},
|
||||||
|
// 数据接入集合
|
||||||
|
assetStructureList: [
|
||||||
|
{
|
||||||
|
name: "测试1",
|
||||||
|
systemName: "云计算系统",
|
||||||
|
databaseName: "yunjisuan",
|
||||||
|
type: "dataSource"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "测试2",
|
||||||
|
systemName: "网站系统",
|
||||||
|
databaseName: "wangzhan",
|
||||||
|
type: "dataSource"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "测试3",
|
||||||
|
systemName: "物联网系统",
|
||||||
|
databaseName: "wulianwang",
|
||||||
|
type: "dataSource"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "测试4",
|
||||||
|
systemName: "传媒系统",
|
||||||
|
databaseName: "chuanmei",
|
||||||
|
type: "dataSource"
|
||||||
|
},
|
||||||
|
],
|
||||||
|
// 数据接入集合选择
|
||||||
|
assetStructure: null,
|
||||||
|
// 数据资产
|
||||||
|
assetsList: [
|
||||||
|
{
|
||||||
|
name: "sys_user",
|
||||||
|
as: "用户表",
|
||||||
|
dataTotal: 635847,
|
||||||
|
type: "dataTable",
|
||||||
|
childrenList: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "sys_dept",
|
||||||
|
as: "部门表",
|
||||||
|
dataTotal: 362548,
|
||||||
|
type: "dataTable",
|
||||||
|
childrenList: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "sys_notice",
|
||||||
|
as: "通知公告",
|
||||||
|
dataTotal: 6347,
|
||||||
|
type: "dataTable",
|
||||||
|
childrenList: []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// 数据资产选择
|
||||||
|
assets: null,
|
||||||
|
// 数据模型
|
||||||
|
dataModelList: [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
name: "id",
|
||||||
|
comment: "主键",
|
||||||
|
isPrimaryKey: "Y",
|
||||||
|
type: "bigint",
|
||||||
|
mappingType: "Long",
|
||||||
|
length: "-",
|
||||||
|
decimalPlaces: "-",
|
||||||
|
isNull: "N",
|
||||||
|
defaultValue: "-",
|
||||||
|
isDict: "N",
|
||||||
|
dictKey: "-",
|
||||||
|
}, {
|
||||||
|
id: 2,
|
||||||
|
name: "name",
|
||||||
|
comment: "姓名",
|
||||||
|
isPrimaryKey: "N",
|
||||||
|
type: "varchar",
|
||||||
|
mappingType: "String",
|
||||||
|
length: "64",
|
||||||
|
decimalPlaces: "-",
|
||||||
|
isNull: "N",
|
||||||
|
defaultValue: "-",
|
||||||
|
isDict: "N",
|
||||||
|
dictKey: "-",
|
||||||
|
}, {
|
||||||
|
id: 3,
|
||||||
|
name: "sex",
|
||||||
|
comment: "性别",
|
||||||
|
isPrimaryKey: "N",
|
||||||
|
type: "char",
|
||||||
|
mappingType: "String",
|
||||||
|
length: "1",
|
||||||
|
decimalPlaces: "-",
|
||||||
|
isNull: "N",
|
||||||
|
defaultValue: "-",
|
||||||
|
isDict: "Y",
|
||||||
|
dictKey: "system_sex",
|
||||||
|
}, {
|
||||||
|
id: 4,
|
||||||
|
name: "price",
|
||||||
|
comment: "金额",
|
||||||
|
isPrimaryKey: "N",
|
||||||
|
type: "double",
|
||||||
|
mappingType: "BigDecimal",
|
||||||
|
length: "10",
|
||||||
|
decimalPlaces: "2",
|
||||||
|
isNull: "N",
|
||||||
|
defaultValue: "0.00",
|
||||||
|
isDict: "N",
|
||||||
|
dictKey: "-",
|
||||||
|
}, {
|
||||||
|
id: 5,
|
||||||
|
name: "create_time",
|
||||||
|
comment: "创建时间",
|
||||||
|
isPrimaryKey: "N",
|
||||||
|
type: "datetime",
|
||||||
|
mappingType: "Date",
|
||||||
|
length: "-",
|
||||||
|
decimalPlaces: "-",
|
||||||
|
isNull: "Y",
|
||||||
|
defaultValue: "-",
|
||||||
|
isDict: "N",
|
||||||
|
dictKey: "-",
|
||||||
|
}, ],
|
||||||
|
// 数据模型选择
|
||||||
|
dataMode: null,
|
||||||
|
// 数据示例
|
||||||
|
dataModeMap: {
|
||||||
|
id: 1,
|
||||||
|
name: "张三",
|
||||||
|
sex: 1,
|
||||||
|
price: "653.69",
|
||||||
|
create_time: "2024-5-7 16:37:16",
|
||||||
|
},
|
||||||
|
testResult: ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.initRuleEngine(this.ruleEngine);
|
||||||
|
//查询规则类型
|
||||||
|
this.getDicts("sys_normal_disable").then(response => {
|
||||||
|
this.sys_normal_disable = response.data;
|
||||||
|
});
|
||||||
|
//查询作用域
|
||||||
|
this.getDicts("rule_engine_type").then(response => {
|
||||||
|
this.rule_engine_type = response.data;
|
||||||
|
});
|
||||||
|
//查询激活状态
|
||||||
|
this.getDicts("rule_engine_activate_status").then(response => {
|
||||||
|
this.rule_engine_activate_status = response.data;
|
||||||
|
}); //状态
|
||||||
|
this.getDicts("rule_engine_version_status").then(response => {
|
||||||
|
this.rule_engine_version_status = response.data;
|
||||||
|
});//状态
|
||||||
|
this.getDicts("rule_engine_activate_is_test").then(response => {
|
||||||
|
this.rule_engine_activate_is_test = response.data;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
methods: {}
|
methods: {
|
||||||
|
saveCoding(){
|
||||||
|
console.log("sqw",this.ruleEngineVersionInfoAndTest)
|
||||||
|
this.$message.success('编码保存成功');
|
||||||
|
},
|
||||||
|
ruleEngineVersionInfoStatusClose(done) {
|
||||||
|
this.$confirm('确认关闭?')
|
||||||
|
.then(_ => {
|
||||||
|
this.ruleEngineVersionInfoAndTest = {};
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
.catch(_ => {});
|
||||||
|
},
|
||||||
|
ruleEngineVersionTestStatusClose(done) {
|
||||||
|
this.$confirm('确认关闭?')
|
||||||
|
.then(_ => {
|
||||||
|
this.ruleEngineVersionInfoAndTest = {};
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
.catch(_ => {});
|
||||||
|
},
|
||||||
|
// 点击规则事件
|
||||||
|
// 点击规则事件
|
||||||
|
checkRuleEngineVersion(command) {
|
||||||
|
switch (command.event) {
|
||||||
|
case "info"://详情
|
||||||
|
this.ruleEngineVersionInfoStatus = true;
|
||||||
|
console.log("sss",command)
|
||||||
|
this.ruleEngineVersionInfoAndTest = command.ruleEngineVersion;
|
||||||
|
break;
|
||||||
|
case "test"://测试
|
||||||
|
this.ruleEngineVersionTestStatus = true;
|
||||||
|
this.ruleEngineVersionInfoAndTest = command.ruleEngineVersion;
|
||||||
|
break;
|
||||||
|
case "status"://激活状态
|
||||||
|
command.ruleEngineVersion.isActivate = 'no-activate' === command.ruleEngineVersion.isActivate ? 'activated' : 'no-activate'
|
||||||
|
break;
|
||||||
|
case "publish"://发布
|
||||||
|
command.ruleEngineVersion.status = '2'
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
console.log(command.event);
|
||||||
|
console.log(command.ruleEngineVersion);
|
||||||
|
},
|
||||||
|
// 生成规则版本
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
if (this.engineVersionForm.description == null || this.engineVersionForm.description === "") {
|
||||||
|
this.$message.error('规则版本使用描述不可为空');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.engineVersionForm.versionCode = this.ruleEngineInfo.engineCode + "_" + this.engineVersionForm.code
|
||||||
|
this.engineVersionForm.codeIng = this.getCodeIng()
|
||||||
|
|
||||||
|
},
|
||||||
|
// 确定新增
|
||||||
|
addVersionSubmission(){
|
||||||
|
// this.ruleEngineInfo.ruleEngineVersionList.push({... this.engineVersionForm})
|
||||||
|
this.engineVersionForm.ruleEngineId = this.ruleEngineInfo.id
|
||||||
|
this.engineVersionForm.writeCode =this.ruleEngineInfo.writeCode
|
||||||
|
ruleEngineVersionAdd(this.engineVersionForm).then(res =>{
|
||||||
|
this.$message.success(res.data)
|
||||||
|
})
|
||||||
|
this.addVersionStatus = false;
|
||||||
|
this.initRuleEngine(this.ruleEngineInfo.id);
|
||||||
|
},
|
||||||
|
// 取消新增
|
||||||
|
addVersionCancel(){
|
||||||
|
this.engineVersionForm = {
|
||||||
|
"name": "", "code": "", "status": "0",
|
||||||
|
"versionCode": "",
|
||||||
|
"isActivate": "no-activate",
|
||||||
|
"description": "",
|
||||||
|
"codeIng": null, "ruleEngineVersionList": []
|
||||||
|
};
|
||||||
|
this.addVersionStatus = false;
|
||||||
|
},
|
||||||
|
//版本添加
|
||||||
|
handleClick(clickType){
|
||||||
|
|
||||||
|
if (clickType === "add"){
|
||||||
|
this.addVersionStatus = true;
|
||||||
|
|
||||||
|
}else
|
||||||
|
if(clickType === "activate"){
|
||||||
|
updateRuleEngineVersionIsActivate(this.ruleEngineInfo).then(res =>{
|
||||||
|
this.$message.success(res.data);
|
||||||
|
this.initRuleEngine(this.ruleEngineInfo.id);
|
||||||
|
})
|
||||||
|
}else if(clickType === "status"){
|
||||||
|
updateRuleEngineVersionStates(this.ruleEngineInfo).then(res =>{
|
||||||
|
this.$message.success(res.data);
|
||||||
|
this.initRuleEngine(this.ruleEngineInfo.id);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
initRuleEngine(ruleEngine){
|
||||||
|
// let response = {
|
||||||
|
// "code": 200,
|
||||||
|
// "msg": "查询成功",
|
||||||
|
// "data": {
|
||||||
|
// "id": 1,
|
||||||
|
// "name": "邮箱规则",
|
||||||
|
// "type": "rule-custom",
|
||||||
|
// "isActivate": "no-activate",
|
||||||
|
// "status": "0",
|
||||||
|
// "description": "<p>根据邮箱规则进行数据校验,内包含所有邮箱校验规则</p>",
|
||||||
|
// "remark": "-",
|
||||||
|
// "code": "email",
|
||||||
|
// "engineCode": "engine_custom_email",
|
||||||
|
// "level": "data-field",
|
||||||
|
// "ruleEngineVersionList": [
|
||||||
|
// {
|
||||||
|
// "name": "163剔除", "code": "IAW3S02", "status": "0",
|
||||||
|
// "versionCode": "engine_custom_email_IAW3S02", "isActivate": "no-activate",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "name": "筛选不合规邮箱", "code": "JISID8S", "status": "2",
|
||||||
|
// "versionCode": "engine_custom_email_JISID8S", "isActivate": "activated",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "name": "剔除自定义邮箱", "code": "DJ8S9EA", "status": "2",
|
||||||
|
// "versionCode": "engine_custom_email_DJ8S9EA", "isActivate": "no-activate",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "name": "邮箱默认值操作", "code": "XJS9E0S", "status": "1",
|
||||||
|
// "versionCode": "engine_custom_email_XJS9E0S", "isActivate": "no-activate",
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
selectRuleEngineVersion(ruleEngine).then(res => {
|
||||||
|
console.log("ressss",res)
|
||||||
|
this.ruleEngineInfo = res.data;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获取代码模板
|
||||||
|
getCodeIng(){
|
||||||
|
let packageName = "com.muyu.rule.engine";
|
||||||
|
let customName = "custom";
|
||||||
|
let templateName = "template";
|
||||||
|
let parentClass = this.ruleEngineInfo.level;
|
||||||
|
let codeIng = `package ${packageName}.${customName};
|
||||||
|
|
||||||
|
import com.muyu.engine.action.ActionDiscard;
|
||||||
|
import com.muyu.engine.scope.${parentClass};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: DongZeLiang
|
||||||
|
* @date: 2024/5/6
|
||||||
|
* @Description: ${this.engineVersionForm.name}-${this.engineVersionForm.code}
|
||||||
|
* @Version: 1.0
|
||||||
|
*/
|
||||||
|
public class ${this.engineVersionForm.versionCode} extends ${parentClass} {
|
||||||
|
@Override
|
||||||
|
public void execution () {
|
||||||
|
Object value = getValue();
|
||||||
|
|
||||||
|
if (value == null || "".equals(value) || "null".equals(value)) {
|
||||||
|
throw new ActionDiscard();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}`;
|
||||||
|
return codeIng;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.box-card{
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
.el-dropdown-link {
|
||||||
|
cursor: pointer;
|
||||||
|
color: #409EFF;
|
||||||
|
}
|
||||||
|
.el-icon-arrow-down {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
.CodeMirror {
|
||||||
|
height: 600px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue