feat:规则版本(测试初)
parent
91ab6e2a18
commit
ae1a51753c
|
@ -9,6 +9,13 @@ export function listSource(query) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getList() {
|
||||||
|
return request({
|
||||||
|
url: '/dataSource/source/getList',
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export function statisticsInfo(){
|
export function statisticsInfo(){
|
||||||
return request({
|
return request({
|
||||||
url: '/dataSource/source/Statistics',
|
url: '/dataSource/source/Statistics',
|
||||||
|
|
|
@ -9,3 +9,11 @@ export function insertVersion(query) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function updateVersion(query) {
|
||||||
|
return request({
|
||||||
|
url: '/ruleEngine/version/UpdateVersion',
|
||||||
|
method: 'post',
|
||||||
|
data: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { codemirror } from 'vue-codemirror'
|
import { codemirror } from 'vue-codemirror'
|
||||||
import 'codemirror/mode/clike/clike';
|
import 'codemirror/mode/clike/clike';
|
||||||
|
@ -37,6 +38,13 @@ export default {
|
||||||
this.code = val
|
this.code = val
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
'code':{
|
||||||
|
handler(val) {
|
||||||
|
if (val != null){
|
||||||
|
console.log(this.$emit('input',val))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
'modification':{
|
'modification':{
|
||||||
handler(val) {
|
handler(val) {
|
||||||
if (val != null){
|
if (val != null){
|
||||||
|
@ -65,7 +73,12 @@ export default {
|
||||||
readOnly: {
|
readOnly: {
|
||||||
default: false,
|
default: false,
|
||||||
type: Boolean
|
type: Boolean
|
||||||
}
|
},
|
||||||
|
// code: {
|
||||||
|
// default: "",
|
||||||
|
// type: String
|
||||||
|
// }
|
||||||
|
|
||||||
},
|
},
|
||||||
name: "Encoding",
|
name: "Encoding",
|
||||||
data() {
|
data() {
|
||||||
|
@ -73,7 +86,7 @@ export default {
|
||||||
codemirror: null,
|
codemirror: null,
|
||||||
code: this.value,
|
code: this.value,
|
||||||
cmOptions: {
|
cmOptions: {
|
||||||
autoRefresh: true, // 重点是这句,为true
|
autoRefresh: true, // 重点是这句,为
|
||||||
value: '', // 初始内容
|
value: '', // 初始内容
|
||||||
mode: 'text/x-java', //实现Java代码高亮
|
mode: 'text/x-java', //实现Java代码高亮
|
||||||
tabSize: 4, // tab的空格宽度
|
tabSize: 4, // tab的空格宽度
|
||||||
|
|
|
@ -6,20 +6,24 @@
|
||||||
更多操作
|
更多操作
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item command="add">版本添加</el-dropdown-item>
|
<el-dropdown-item command="add">版本添加</el-dropdown-item>
|
||||||
<el-dropdown-item command="activate">{{(ruleEngineInfo.isActivate === 'no-activate' ? "激活": "禁用")+'引擎'}}</el-dropdown-item>
|
<el-dropdown-item command="activate">
|
||||||
<el-dropdown-item command="status">{{(ruleEngineInfo.status === '0' ? "关闭": "开启")+'引擎'}}</el-dropdown-item>
|
{{ (ruleEngineInfo.isActivate === 'no-activate' ? "激活" : "禁用") + '引擎' }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="status">{{ (ruleEngineInfo.status === '0' ? "关闭" : "开启") + '引擎' }}
|
||||||
|
</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<el-descriptions-item label="规则名称"> {{ruleEngineInfo.name}} </el-descriptions-item>
|
<el-descriptions-item label="规则名称"> {{ ruleEngineInfo.name }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="规则类型">
|
<el-descriptions-item label="规则类型">
|
||||||
<dict-tag :options="dict.type.rule_engine_type" :value="ruleEngineInfo.type"/>
|
<dict-tag :options="dict.type.rule_engine_type" :value="ruleEngineInfo.type"/>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="规则作用域">
|
<el-descriptions-item label="规则作用域">
|
||||||
<dict-tag :options="dict.type.rule_engine_level" :value="ruleEngineInfo.level"/>
|
<dict-tag :options="dict.type.rule_engine_level" :value="ruleEngineInfo.level"/>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="引擎编码"> {{ruleEngineInfo.code + " ("+ruleEngineInfo.engineCode+")"}} </el-descriptions-item>
|
<el-descriptions-item label="引擎编码"> {{ ruleEngineInfo.code + " (" + ruleEngineInfo.engineCode + ")" }}
|
||||||
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="是否激活">
|
<el-descriptions-item label="是否激活">
|
||||||
<dict-tag :options="dict.type.rule_engine_activate_status" :value="ruleEngineInfo.isActivate"/>
|
<dict-tag :options="dict.type.rule_engine_activate_status" :value="ruleEngineInfo.isActivate"/>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
|
@ -36,30 +40,45 @@
|
||||||
<el-col :span="12" v-for="ruleEngineVersion in ruleEngineInfo.ruleEngineVersionList">
|
<el-col :span="12" v-for="ruleEngineVersion in ruleEngineInfo.ruleEngineVersionList">
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>{{ruleEngineVersion.name + "-" + ruleEngineVersion.code}}</span>
|
<span>{{ ruleEngineVersion.name + "-" + ruleEngineVersion.code }}</span>
|
||||||
<el-dropdown style="float: right; padding: 3px 0">
|
<el-dropdown style="float: right; padding: 3px 0" @command="checkRuleEngineVersion">
|
||||||
<span class="el-dropdown-link">
|
<span class="el-dropdown-link">
|
||||||
更多操作<i class="el-icon-arrow-down el-icon--right"></i>
|
更多操作<i class="el-icon-arrow-down el-icon--right"></i>
|
||||||
</span>
|
</span>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item command="info">规则详情</el-dropdown-item>
|
<el-dropdown-item :command="{event: 'info', ruleEngineVersion: ruleEngineVersion}">规则详情
|
||||||
<el-dropdown-item command="test">测试规则</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item command="status">禁用规则</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-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
<el-descriptions class="margin-top" :column="2" border>
|
<el-descriptions class="margin-top" :column="2" border>
|
||||||
<el-descriptions-item label="版本类" :span="2"> {{ruleEngineVersion.versionCode}} </el-descriptions-item>
|
<el-descriptions-item label="版本类" :span="2"> {{ ruleEngineVersion.versionCode }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="版本名称"> {{ruleEngineVersion.name}} </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="版本CODE"> {{ ruleEngineVersion.code }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="是否激活">
|
<el-descriptions-item label="是否激活">
|
||||||
<dict-tag :options="dict.type.rule_engine_activate_status" :value="ruleEngineVersion.isActivate"/>
|
<dict-tag :options="dict.type.rule_engine_activate_status" :value="ruleEngineVersion.isActivate"/>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="版本状态">
|
<el-descriptions-item label="版本状态">
|
||||||
<dict-tag :options="dict.type.rule_engine_version_status" :value="ruleEngineVersion.status"/>
|
<dict-tag :options="dict.type.rule_engine_version_status" :value="ruleEngineVersion.status"/>
|
||||||
</el-descriptions-item>
|
</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-descriptions>
|
||||||
<editor style="margin-top: 10px" :read-only="true" v-model="ruleEngineInfo.description"></editor>
|
<editor style="margin-top: 10px" :read-only="true" v-model="ruleEngineVersion.description"></editor>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -70,13 +89,15 @@
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>基本信息</span>
|
<span>基本信息</span>
|
||||||
<el-button style="float: right; padding: 3px 0" type="text" @click="genEngineVersion">生成引擎版本类</el-button>
|
<el-button style="float: right; padding: 3px 0" type="text" @click="genEngineVersion">生成引擎版本类
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-form :data="engineVersionForm" label-width="80px" :model="engineVersionForm">
|
<el-form :data="engineVersionForm" label-width="80px" :model="engineVersionForm">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="版本类">
|
<el-form-item label="版本类">
|
||||||
<el-input v-model="engineVersionForm.versionCode" disabled placeholder="点击类生成自动生成类名称"></el-input>
|
<el-input v-model="engineVersionForm.versionCode" disabled
|
||||||
|
placeholder="点击类生成自动生成类名称"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -96,7 +117,6 @@
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="状态">
|
<el-form-item label="状态">
|
||||||
<dict-tag :options="dict.type.rule_engine_version_status" :value="engineVersionForm.status"/>
|
<dict-tag :options="dict.type.rule_engine_version_status" :value="engineVersionForm.status"/>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
@ -120,18 +140,136 @@
|
||||||
<el-button type="primary" @click="addVersionSubmission">确 定</el-button>
|
<el-button type="primary" @click="addVersionSubmission">确 定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<el-drawer
|
||||||
|
title="规则版本详情" size="80%" :before-close="ruleEngineVersionInfoStatusClose"
|
||||||
|
:visible.sync="ruleEngineVersionInfoStatus"
|
||||||
|
:direction="'rtl'">
|
||||||
|
<div class="app-container">
|
||||||
|
{{ ruleEngineVersionInfoAndTest.codeIng }}
|
||||||
|
<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%;" @change="assetStructureChange(assetStructure)">
|
||||||
|
<el-option v-for="assetStructure in assetStructureList"
|
||||||
|
:key="assetStructure.dataSourceName"
|
||||||
|
:value="assetStructure"
|
||||||
|
:label="assetStructure.dataSourceName+'('+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%;" @change="assetsChange(assets)">
|
||||||
|
<el-option v-for="assets in assetsList"
|
||||||
|
:key="assets.tableName"
|
||||||
|
:value="assets"
|
||||||
|
:label="assets.tableName+'('+assets.tableComment+')'"
|
||||||
|
></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 Encoding from "@/components/Encoding/index.vue";
|
import Encoding from "@/components/Encoding/index.vue";
|
||||||
import {getMaintenance, listMaintenance, updateMaintenance} from "@/api/ruleEngine/maintenance";
|
import {getMaintenance, listMaintenance, updateMaintenance} from "@/api/ruleEngine/maintenance";
|
||||||
import {insertVersion} from "@/api/ruleEngine/version";
|
import {insertVersion, updateVersion} from "@/api/ruleEngine/version";
|
||||||
|
import {dataAssetList, getList} from "@/api/dataSource/source";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
|
|
||||||
name: "EngineVersion",
|
name: "EngineVersion",
|
||||||
components: {Encoding},
|
components: {Encoding},
|
||||||
dicts: ['rule_engine_activate_status', 'rule_engine_type', 'sys_normal_disable', 'rule_engine_level', 'rule_engine_version_status'],
|
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,
|
ruleEngineId: this.$route.params && this.$route.params.ruleEngineId,
|
||||||
|
@ -144,26 +282,182 @@ export default {
|
||||||
"isActivate": "no-activate",
|
"isActivate": "no-activate",
|
||||||
"description": "",
|
"description": "",
|
||||||
"codeIng": null
|
"codeIng": null
|
||||||
}
|
},
|
||||||
|
// 详情抽屉状态
|
||||||
|
ruleEngineVersionInfoStatus: false,
|
||||||
|
// 测试抽屉状态
|
||||||
|
ruleEngineVersionTestStatus: false,
|
||||||
|
|
||||||
|
// 弹框抽屉
|
||||||
|
ruleEngineVersionInfoAndTest: {},
|
||||||
|
// 数据接入集合
|
||||||
|
assetStructureList: [],
|
||||||
|
// 数据接入集合选择
|
||||||
|
assetStructure: null,
|
||||||
|
// 数据资产
|
||||||
|
assetsList: [],
|
||||||
|
// 数据资产选择
|
||||||
|
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.ruleEngineInfoList();
|
this.ruleEngineInfoList();
|
||||||
|
this.assetStructureLists();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
assetStructureChange(assetStructure){
|
||||||
|
dataAssetList(assetStructure).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
this.assetsList = res.data;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
assetsChange(asset){
|
||||||
|
|
||||||
ruleEngineInfoList(){
|
},
|
||||||
getMaintenance(this.ruleEngineId).then(res=>{
|
assetStructureLists() {
|
||||||
|
getList().then(res => {
|
||||||
|
console.log(res)
|
||||||
|
this.assetStructureList = res;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
saveCoding() {
|
||||||
|
updateVersion(this.ruleEngineVersionInfoAndTest).then(res => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$message.success("修改成功")
|
||||||
|
this.ruleEngineVersionInfoStatus = false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
ruleEngineVersionInfoStatusClose(done) {
|
||||||
|
this.$confirm('确认关闭?')
|
||||||
|
.then(_ => {
|
||||||
|
this.ruleEngineVersionInfoAndTest = {};
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
.catch(_ => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
ruleEngineVersionTestStatusClose(done) {
|
||||||
|
this.$confirm('确认关闭?')
|
||||||
|
.then(_ => {
|
||||||
|
this.ruleEngineVersionInfoAndTest = {};
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
.catch(_ => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
ruleEngineInfoList() {
|
||||||
|
getMaintenance(this.ruleEngineId).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.ruleEngineInfo = res.data
|
this.ruleEngineInfo = res.data
|
||||||
console.log(this.ruleEngineInfo)
|
console.log(this.ruleEngineInfo)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 点击规则事件
|
||||||
|
checkRuleEngineVersion(command) {
|
||||||
|
switch (command.event) {
|
||||||
|
case "info"://详情
|
||||||
|
this.ruleEngineVersionInfoStatus = true;
|
||||||
|
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(){
|
genEngineVersion() {
|
||||||
if (this.engineVersionForm.name == null || this.engineVersionForm.name === "") {
|
if (this.engineVersionForm.name == null || this.engineVersionForm.name === "") {
|
||||||
this.$message.error('规则名称不可为空');
|
this.$message.error('规则名称不可为空');
|
||||||
return false;
|
return false;
|
||||||
|
@ -172,100 +466,70 @@ export default {
|
||||||
this.$message.error('规则CODE不可为空');
|
this.$message.error('规则CODE不可为空');
|
||||||
return false;
|
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.versionCode = this.ruleEngineInfo.engineCode + "_" + this.engineVersionForm.code
|
||||||
this.engineVersionForm.codeIng = this.getCodeIng()
|
this.engineVersionForm.codeIng = this.getCodeIng()
|
||||||
},
|
},
|
||||||
// 确定新增
|
// 确定新增
|
||||||
addVersionSubmission(){
|
addVersionSubmission() {
|
||||||
insertVersion(this.engineVersionForm).then(res=>{
|
insertVersion(this.engineVersionForm).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.$modal.msgSuccess("新增版本成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
}else {
|
} else {
|
||||||
this.$modal.msgError("新增版本失败");
|
this.$modal.msgError("新增失败");
|
||||||
}
|
}
|
||||||
this.addVersionStatus = false;
|
|
||||||
})
|
})
|
||||||
|
this.addVersionStatus = false;
|
||||||
|
this.ruleEngineInfoList()
|
||||||
},
|
},
|
||||||
// 取消新增
|
// 取消新增
|
||||||
addVersionCancel(){
|
addVersionCancel() {
|
||||||
|
this.engineVersionForm = {
|
||||||
|
"name": "", "code": "", "status": "0", "isTest": "0",
|
||||||
|
"versionCode": "",
|
||||||
|
"isActivate": "no-activate",
|
||||||
|
"description": "",
|
||||||
|
"codeIng": null, "ruleEngineVersionList": []
|
||||||
|
};
|
||||||
|
this.addVersionStatus = false;
|
||||||
},
|
},
|
||||||
handleClick(clickType){
|
handleClick(clickType) {
|
||||||
if (clickType === "add"){
|
if (clickType === "add") {
|
||||||
this.addVersionStatus = true;
|
this.addVersionStatus = true;
|
||||||
this.engineVersionForm.engineMaintenanceId=this.ruleEngineInfo.id
|
this.engineVersionForm.engineMaintenanceId = this.ruleEngineInfo.id
|
||||||
console.log(this.engineVersionForm)
|
console.log(this.engineVersionForm)
|
||||||
}else if(clickType === "activate"){
|
} else if (clickType === "activate") {
|
||||||
this.ruleEngineInfo.isActivate = 'no-activate' === this.ruleEngineInfo.isActivate ? 'activated' : 'no-activate'
|
this.ruleEngineInfo.isActivate = 'no-activate' === this.ruleEngineInfo.isActivate ? 'activated' : 'no-activate'
|
||||||
updateMaintenance(this.ruleEngineInfo).then(res=>{
|
updateMaintenance(this.ruleEngineInfo).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.ruleEngineInfoList()
|
this.ruleEngineInfoList()
|
||||||
this.$modal.msgSuccess("引擎激活状态修改成功");
|
this.$modal.msgSuccess("引擎激活状态修改成功");
|
||||||
}else {
|
} else {
|
||||||
this.$modal.msgError("引擎激活状态修改失败");
|
this.$modal.msgError("引擎激活状态修改失败");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.ruleEngineInfoList()
|
this.ruleEngineInfoList()
|
||||||
}else if(clickType === "status"){
|
} else if (clickType === "status") {
|
||||||
this.ruleEngineInfo.status = '0' === this.ruleEngineInfo.status ? '1' : '0'
|
this.ruleEngineInfo.status = '0' === this.ruleEngineInfo.status ? '1' : '0'
|
||||||
updateMaintenance(this.ruleEngineInfo).then(res=>{
|
updateMaintenance(this.ruleEngineInfo).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.$modal.msgSuccess("引擎状态操作成功");
|
this.$modal.msgSuccess("引擎状态操作成功");
|
||||||
}else {
|
} else {
|
||||||
this.$modal.msgError("引擎状态操作失败");
|
this.$modal.msgError("引擎状态操作失败");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.ruleEngineInfoList()
|
this.ruleEngineInfoList()
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
},
|
|
||||||
initRuleEngine(){
|
|
||||||
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",
|
|
||||||
"description": "<p>根据邮箱规则进行数据校验,内包含所有邮箱校验规则</p>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "筛选不合规邮箱", "code": "JISID8S", "status": "2",
|
|
||||||
"versionCode": "engine_custom_email_JISID8S", "isActivate": "activated",
|
|
||||||
"description": "<p>根据邮箱规则进行数据校验,内包含所有邮箱校验规则</p>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "剔除自定义邮箱", "code": "DJ8S9EA", "status": "2",
|
|
||||||
"versionCode": "engine_custom_email_DJ8S9EA", "isActivate": "no-activate",
|
|
||||||
"description": "<p>根据邮箱规则进行数据校验,内包含所有邮箱校验规则</p>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "邮箱默认值操作", "code": "XJS9E0S", "status": "1",
|
|
||||||
"versionCode": "engine_custom_email_XJS9E0S", "isActivate": "no-activate",
|
|
||||||
"description": "<p>根据邮箱规则进行数据校验,内包含所有邮箱校验规则</p>"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.ruleEngineInfo = response.data
|
|
||||||
},
|
|
||||||
// 获取代码模板
|
// 获取代码模板
|
||||||
getCodeIng(){
|
getCodeIng() {
|
||||||
|
|
||||||
let packageName = "com.muyu.rule.engine";
|
let packageName = "com.muyu.rule.engine";
|
||||||
let customName = "custom";
|
let customName = "custom";
|
||||||
let templateName = "template";
|
|
||||||
let parentClass = "DataModelEngine";
|
let parentClass = "DataModelEngine";
|
||||||
let codeIng = `package ${packageName}.${customName};
|
let codeIng = `package ${packageName}.${customName};
|
||||||
|
|
||||||
|
@ -296,14 +560,20 @@ public class ${this.engineVersionForm.versionCode} extends ${parentClass} {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.box-card{
|
.box-card {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-dropdown-link {
|
.el-dropdown-link {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: #409EFF;
|
color: #409EFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-icon-arrow-down {
|
.el-icon-arrow-down {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.CodeMirror {
|
||||||
|
height: 600%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue