feat():整理分页展示数据
parent
767f254664
commit
ffaae7cf10
|
@ -0,0 +1,75 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ruleEngineId获取所有规则版本
|
||||||
|
* @param ruleEngineId
|
||||||
|
* @returns {AxiosPromise}
|
||||||
|
*/
|
||||||
|
export function getVersionList(ruleEngineId) {
|
||||||
|
return request({
|
||||||
|
url: '/rule/version/getVersionList?ruleEngineId='+ruleEngineId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入规则版本
|
||||||
|
* @param ruleVersion
|
||||||
|
* @returns {AxiosPromise}
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function insertRuleVersion(ruleVersion) {
|
||||||
|
return request({
|
||||||
|
url: '/rule/version/insertRuleVersion',
|
||||||
|
method: 'post',
|
||||||
|
data: ruleVersion
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成详细规则版本
|
||||||
|
* @param generateVersionClazzReq
|
||||||
|
* @returns {AxiosPromise}
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function generateClazz(generateVersionClazzReq) {
|
||||||
|
return request({
|
||||||
|
url: '/rule/version/generateClazz',
|
||||||
|
method: 'post',
|
||||||
|
data: generateVersionClazzReq
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 激活/未激活 规则
|
||||||
|
*/
|
||||||
|
export function updateActivate(ruleEngineId,isActivate) {
|
||||||
|
return request({
|
||||||
|
url: '/rule/version/updateActivate?ruleEngineId='+ruleEngineId+"&isActivate="+isActivate,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 正常/停用状态
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function updateVersionStatus(ruleEngineId,versionStatus) {
|
||||||
|
return request({
|
||||||
|
url: '/rule/version/updateVersionStatus?ruleEngineId='+ruleEngineId+"&versionStatus="+versionStatus,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改编译规则代码
|
||||||
|
* @param ruleVersion
|
||||||
|
* @returns {AxiosPromise}
|
||||||
|
*/
|
||||||
|
export function compiledCode(ruleVersion) {
|
||||||
|
return request({
|
||||||
|
url: '/rule/version/compiledCode',
|
||||||
|
method: 'post',
|
||||||
|
data: ruleVersion
|
||||||
|
})
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div style="height: 800px">
|
<div style="height: 800px">
|
||||||
<el-button type="danger" @click="test">编译执行</el-button>
|
<!-- <el-button type="danger" @click="test">编译执行</el-button>-->
|
||||||
<codemirror ref="codeMirror" :value="code" :options="cmOptions" @input="handleCodeMirrorInput" style="height: 200px"/>
|
<codemirror ref="codeMirror" :value="code" :options="cmOptions" @input="handleCodeMirrorInput" style="height: 200px"/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -47,8 +47,7 @@ export default {
|
||||||
watch: {
|
watch: {
|
||||||
ruleInfo: {
|
ruleInfo: {
|
||||||
handler(newVal,oldValue){
|
handler(newVal,oldValue){
|
||||||
console.log("新值",newVal)
|
|
||||||
console.log("旧址",oldValue)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -92,6 +91,8 @@ export default {
|
||||||
// 当 CodeMirror 组件的内容变化时,这个函数会被调用
|
// 当 CodeMirror 组件的内容变化时,这个函数会被调用
|
||||||
// newValue 参数将包含新的代码内容
|
// newValue 参数将包含新的代码内容
|
||||||
this.ruleInfo = newValue // 如果你需要更新父组件的 data 属性来反映新值
|
this.ruleInfo = newValue // 如果你需要更新父组件的 data 属性来反映新值
|
||||||
|
this.$emit('transmit', this.ruleInfo)
|
||||||
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,9 +33,9 @@
|
||||||
<span>模型数据</span>
|
<span>模型数据</span>
|
||||||
</div>
|
</div>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="6" v-for="dataKvt in dataKvtModelList" style="margin-top: 20px">
|
<el-col :span="6" v-for="dataKvt in dataKvtModelList" style="margin-top: 20px; height: 300px;">
|
||||||
<el-descriptions :title="dataKvt.fieldsName" direction="vertical" border :column="1">
|
<el-descriptions :title="dataKvt.fieldsName" direction="vertical" border :column="1" style="max-height: 200px; overflow-y: auto;">
|
||||||
<el-descriptions-item label="Type">
|
<el-descriptions-item label="Type" style="max-height: 180px; overflow-y: auto;">
|
||||||
<el-tag size="small">{{dataKvt.javaType}}</el-tag>
|
<el-tag size="small">{{dataKvt.javaType}}</el-tag>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="Value">{{dataKvt.dataValue}}</el-descriptions-item>
|
<el-descriptions-item label="Value">{{dataKvt.dataValue}}</el-descriptions-item>
|
||||||
|
|
|
@ -12,54 +12,66 @@
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<el-descriptions-item label="规则名称"> {{ruleEngineInfo.name}} </el-descriptions-item>
|
<el-descriptions-item label="规则名称"> {{ruleEngineInfo.ruleName}} </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.ruleTypeId"/>
|
||||||
</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_level" :value="ruleEngineInfo.ruleLevelId"/>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="引擎编码"> {{ruleEngineInfo.code + " ("+ruleEngineInfo.engineCode+")"}} </el-descriptions-item>
|
<el-descriptions-item label="引擎编码"> {{ruleEngineInfo.ruleCode}} </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>
|
||||||
<el-descriptions-item label="规则状态">
|
<el-descriptions-item label="规则状态">
|
||||||
<dict-tag :options="dict.type.sys_normal_disable" :value="ruleEngineInfo.status"/>
|
<dict-tag :options="dict.type.my_normal_disable" :value="ruleEngineInfo.ruleStatus"/>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
<editor style="margin-top: 20px" :read-only="true" v-model="ruleEngineInfo.description"></editor>
|
<editor style="margin-top: 20px" :read-only="true" v-model="ruleEngineInfo.ruleDesc"></editor>
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>规则引擎版本</span>
|
<span>规则引擎版本</span>
|
||||||
</div>
|
</div>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12" v-for="ruleEngineVersion in ruleEngineInfo.ruleEngineVersionList">
|
<el-col :span="12" v-for="ruleEngineVersion in ruleVersionList">
|
||||||
<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.ruleVersionClass}}</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>
|
||||||
<el-dropdown-item command="test">测试规则</el-dropdown-item>
|
<el-dropdown-item :command="{event: 'test', ruleEngineVersion: ruleEngineVersion}"
|
||||||
<el-dropdown-item command="status">禁用规则</el-dropdown-item>
|
:disabled="ruleEngineVersion.ruleVersionStatus === '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.ruleVersionClass}} </el-descriptions-item>
|
||||||
<el-descriptions-item label="版本名称"> {{ruleEngineVersion.name}} </el-descriptions-item>
|
<el-descriptions-item label="版本名称"> {{ruleEngineVersion.ruleVersionName}} </el-descriptions-item>
|
||||||
<el-descriptions-item label="版本CODE"> {{ruleEngineVersion.code}} </el-descriptions-item>
|
<el-descriptions-item label="版本CODE"> {{ruleEngineVersion.ruleVersionCode}} </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.ruleVersionStatus"/>
|
||||||
|
</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-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.ruleVersionDesc"></editor>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -76,27 +88,26 @@
|
||||||
<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.ruleVersionClass" disabled placeholder="点击类生成自动生成类名称"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="名称">
|
<el-form-item label="名称">
|
||||||
<el-input v-model="engineVersionForm.name"></el-input>
|
<el-input v-model="engineVersionForm.ruleVersionName"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="编码">
|
<el-form-item label="编码">
|
||||||
<el-input v-model="engineVersionForm.code"></el-input>
|
<el-input v-model="engineVersionForm.ruleVersionCode"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<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.ruleVersionStatus"/>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
@ -106,7 +117,13 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<editor v-model="engineVersionForm.description" :min-height="150"/>
|
<editor v-model="engineVersionForm.ruleVersionDesc" :min-height="150"/>
|
||||||
|
</el-card>
|
||||||
|
<el-card class="box-card" v-if="engineVersionForm.javaCode != null">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>引擎编码</span>
|
||||||
|
</div>
|
||||||
|
<encoding style="height: 800px" :rule-info="engineVersionForm.javaCode"></encoding>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
|
@ -114,62 +131,530 @@
|
||||||
<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">
|
||||||
|
<el-descriptions v-if="ruleEngineVersionInfoAndTest != null" class="margin-top" :column="2" border>
|
||||||
|
<el-descriptions-item label="版本类" :span="2"> {{ruleEngineVersionInfoAndTest.ruleVersionClass}} </el-descriptions-item>
|
||||||
|
<el-descriptions-item label="版本名称"> {{ruleEngineVersionInfoAndTest.ruleVersionName}} </el-descriptions-item>
|
||||||
|
<el-descriptions-item label="版本CODE"> {{ruleEngineVersionInfoAndTest.ruleVersionCode}} </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.ruleVersionStatus"/>
|
||||||
|
</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.ruleVersionDesc"></editor>
|
||||||
|
<el-row style="margin-top: 10px">
|
||||||
|
<el-button @click="saveCoding">保存代码</el-button>
|
||||||
|
</el-row>
|
||||||
|
<encoding style="height: 800px; margin-top: 20px" @transmit="getMessage" :rule-info="ruleEngineVersionInfoAndTest.javaCode"></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.ruleVersionClass}} </el-descriptions-item>
|
||||||
|
<el-descriptions-item label="版本名称"> {{ruleEngineVersionInfoAndTest.ruleVersionName}} </el-descriptions-item>
|
||||||
|
<el-descriptions-item label="版本CODE"> {{ruleEngineVersionInfoAndTest.ruleVersionCode}} </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.ruleVersionStatus"/>
|
||||||
|
</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.ruleVersionDesc"></editor>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<encoding style="margin-top: 20px" :rule-info="ruleEngineVersionInfoAndTest.javaCode" :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="changeTableList">
|
||||||
|
<el-option v-for="dataSource in dataSourceList"
|
||||||
|
:key="dataSource.dataSourceDatabaseName"
|
||||||
|
:value="dataSource.dataSourceDatabaseName"
|
||||||
|
:label="dataSource.dataSourceDatabaseName+'('+dataSource.fromSystem+')'"
|
||||||
|
></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="getFields">
|
||||||
|
<el-option v-for="table in tableList"
|
||||||
|
:key="table.dataTable.tableName"
|
||||||
|
:value="table.dataTable.id"
|
||||||
|
:label="table.dataTable.tableName+'('+table.dataTable.tableAnnotation+')'"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" v-if="assets != null">
|
||||||
|
<el-card class="box-card" v-if="this.ruleEngineInfo.ruleLevelId === 2">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>选择资产模型</span>
|
||||||
|
<el-button style="float: right; padding: 3px 0" type="text" @click="dataModelRandom">随机数据</el-button>
|
||||||
|
</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">{{dataModeMapList[dataModeMapIndex][_dataModel.name]}}</el-radio>
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-card>
|
||||||
|
<el-card class="box-card" v-if="this.ruleEngineInfo.ruleLevelId === 1">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>{{this.ruleEngineInfo.ruleLevelId === 1 ? "选择资产集" : "选择资产记录"}}</span>
|
||||||
|
</div>
|
||||||
|
<el-table :data="dataModeMapList" max-height="200px"
|
||||||
|
@selection-change="changeDataRow">
|
||||||
|
<el-table-column type="selection" width="55" v-if="this.ruleEngineInfo.ruleLevelId === 1 "/>
|
||||||
|
<el-table-column v-for="dataModel in dataModelList" :label="dataModel.comment" :prop="dataModel.name"/>
|
||||||
|
<el-table-column label="操作" v-if="this.ruleEngineInfo.ruleLevelId === 1 ">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="text" @click="dataRecordSelect(scope.row)">选择</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-descriptions title="选择行数据" direction="vertical" :column="3" border style="margin-top: 20px" v-if="dataRecordSelectData != null">
|
||||||
|
<el-descriptions-item v-for="(val, key) in dataRecordSelectData"
|
||||||
|
:label='key'>
|
||||||
|
<el-checkbox v-model="dataRecordSelectKeyList" :label="key" :value="key">{{val}}</el-checkbox>
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
<el-descriptions title="选择模型" :column="3" border style="margin-top: 20px" v-if="changeDataList.length !== 0">
|
||||||
|
<el-descriptions-item v-for="_dataModel in dataModelList"
|
||||||
|
:label='_dataModel.comment'>
|
||||||
|
<el-checkbox v-model="dataRecordSelectKeyList" :label="_dataModel.name" :value="_dataModel.id"></el-checkbox>
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" style="margin-top: 10px" v-if="dataMode == null || dataRecordSelectKeyList.length > 0">
|
||||||
|
<el-button @click="dataTest">测试</el-button>
|
||||||
|
<el-input style="margin-top: 10px" v-model="testResult" type="textarea" placeholder="请点击测试" disabled/>
|
||||||
|
</el-col>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-drawer>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import Encoding from "@/components/Encoding/index.vue";
|
||||||
|
import {compiledCode, generateClazz, getVersionList, insertRuleVersion} from "@/api/dataSource/ruleVersion";
|
||||||
|
import {queryBigStructure} from "@/api/dataSource/data";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "EngineVersion",
|
name: "EngineVersion",
|
||||||
dicts: ['rule_engine_activate_status', 'rule_engine_type', 'sys_normal_disable', 'rule_engine_level', 'rule_engine_version_status'],
|
components: {Encoding},
|
||||||
|
dicts: ['rule_engine_activate_status', 'rule_engine_type', 'my_normal_disable',
|
||||||
|
'rule_level', 'rule_engine_version_status', 'rule_engine_activate_is_test'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
bigModel: [],
|
||||||
|
tableList: [],
|
||||||
ruleEngineId: this.$route.params && this.$route.params.ruleEngineId,
|
ruleEngineId: this.$route.params && this.$route.params.ruleEngineId,
|
||||||
ruleEngineInfo: {
|
ruleVersionList: [],
|
||||||
"id": 1,
|
ruleEngineInfo: {},
|
||||||
"name": "邮箱规则",
|
|
||||||
"type": "rule-custom",
|
|
||||||
"isActivate": "no-activate",
|
|
||||||
"status": "0",
|
|
||||||
"description": "<p>根据邮箱规则进行数据校验,内包含所有邮箱校验规则</p>",
|
|
||||||
"remark": "-",
|
|
||||||
"code": "email",
|
|
||||||
"engineCode": "engine_custom_email",
|
|
||||||
"level": "data-field",
|
|
||||||
},
|
|
||||||
// 新增版本
|
// 新增版本
|
||||||
addVersionStatus: false,
|
addVersionStatus: false,
|
||||||
engineVersionForm: {
|
engineVersionForm: {
|
||||||
"name": "", "code": "", "status": "0",
|
id: null,
|
||||||
"versionCode": "",
|
isActivate: 'N',
|
||||||
"isActivate": "no-activate",
|
ruleVersionCode: null,
|
||||||
"description": "",
|
ruleEngineId: null,
|
||||||
"codeIng": ""
|
ruleVersionClass: null,
|
||||||
}
|
javaCode: null,
|
||||||
|
isTest: 0,
|
||||||
|
ruleVersionName: null,
|
||||||
|
ruleVersionDesc: null,
|
||||||
|
ruleVersionStatus: 0
|
||||||
|
},
|
||||||
|
// 详情抽屉状态
|
||||||
|
ruleEngineVersionInfoStatus: false,
|
||||||
|
// 测试抽屉状态
|
||||||
|
ruleEngineVersionTestStatus: false,
|
||||||
|
// 弹框抽屉
|
||||||
|
ruleEngineVersionInfoAndTest: {},
|
||||||
|
// 数据接入集合
|
||||||
|
dataSourceList: [],
|
||||||
|
// 数据接入集合选择
|
||||||
|
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,
|
||||||
|
// 数据实例集合
|
||||||
|
dataModeMapList : [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
name: "张三",
|
||||||
|
sex: 1,
|
||||||
|
price: "264.69",
|
||||||
|
create_time: "2024-5-7 16:37:16",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
name: "李四",
|
||||||
|
sex: 2,
|
||||||
|
price: "362.69",
|
||||||
|
create_time: "2023-1-7 41:22:08",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
name: "王五",
|
||||||
|
sex: 0,
|
||||||
|
price: "485.69",
|
||||||
|
create_time: "1996-4-7 02:14:36",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 4,
|
||||||
|
name: "赵六",
|
||||||
|
sex: 0,
|
||||||
|
price: "485.69",
|
||||||
|
create_time: "2004-4-7 02:14:36",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 5,
|
||||||
|
name: "猪八戒",
|
||||||
|
sex: 0,
|
||||||
|
price: "485.69",
|
||||||
|
create_time: "1969-4-7 02:14:36",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 6,
|
||||||
|
name: "孙悟空",
|
||||||
|
sex: 1,
|
||||||
|
price: "485.44",
|
||||||
|
create_time: "2015-4-7 02:14:36",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 7,
|
||||||
|
name: "唐三",
|
||||||
|
sex: 0,
|
||||||
|
price: "635.69",
|
||||||
|
create_time: "2003-5-7 16:37:16",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
dataModeMapIndex: 0,
|
||||||
|
dataRecordSelectData: null,
|
||||||
|
// 条记录选中key集合
|
||||||
|
dataRecordSelectKeyList: [],
|
||||||
|
// 选择行记录List
|
||||||
|
changeDataList: [],
|
||||||
|
testResult: ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.initRuleEngine();
|
this.initRuleEngine();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 测试
|
||||||
|
dataTest(){
|
||||||
|
let number = Math.floor(Math.random()*3);
|
||||||
|
if (number === 0){
|
||||||
|
this.testResult = "测试正常,无异常数据返回";
|
||||||
|
}else if (number === 1){
|
||||||
|
this.testResult = "测试失败:触发*****异常条例,数据发生动作【移除/忽略/记录】";
|
||||||
|
}else if (number === 2){
|
||||||
|
this.testResult = "程序异常:*******异常";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 选择数据行
|
||||||
|
changeDataRow(val){
|
||||||
|
this.changeDataList = val;
|
||||||
|
},
|
||||||
|
// 记录选中
|
||||||
|
dataRecordSelect(row){
|
||||||
|
this.dataRecordSelectKeyList = [];
|
||||||
|
this.dataRecordSelectData = row;
|
||||||
|
},
|
||||||
|
// 单条随机数据
|
||||||
|
dataModelRandom(){
|
||||||
|
this.dataModeMapIndex = Math.floor(Math.random()*this.dataModeMapList.length);
|
||||||
|
},
|
||||||
|
changeTableList() {
|
||||||
|
this.bigModel.forEach(model => {
|
||||||
|
if (this.assetStructure === model.dataSource.dataSourceDatabaseName){
|
||||||
|
this.tableList = model.dataTableList
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getFields() {
|
||||||
|
console.log("tableId",this.assets)
|
||||||
|
|
||||||
|
},
|
||||||
|
saveCoding(){
|
||||||
|
console.log(this.ruleEngineVersionInfoAndTest)
|
||||||
|
// 获取 Java 代码
|
||||||
|
const javaCode = this.ruleEngineVersionInfoAndTest.javaCode;
|
||||||
|
|
||||||
|
// 找到第一个 class 关键字的位置
|
||||||
|
const classIndex = javaCode.indexOf('class');
|
||||||
|
|
||||||
|
if (classIndex !== -1) {
|
||||||
|
// 找到第一个 class 关键字后的空格位置
|
||||||
|
const spaceIndexAfterClass = javaCode.indexOf(' ', classIndex + 5); // 'class' 的长度为 5
|
||||||
|
|
||||||
|
if (spaceIndexAfterClass !== -1) {
|
||||||
|
// 找到下一个空格位置
|
||||||
|
const nextSpaceIndex = javaCode.indexOf(' ', spaceIndexAfterClass + 1);
|
||||||
|
|
||||||
|
if (nextSpaceIndex !== -1) {
|
||||||
|
// 提取类名
|
||||||
|
const className = javaCode.substring(spaceIndexAfterClass + 1, nextSpaceIndex);
|
||||||
|
console.log('类名:', className);
|
||||||
|
this.ruleEngineVersionInfoAndTest.ruleVersionClass = className
|
||||||
|
} else {
|
||||||
|
console.log('无法找到下一个空格');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('无法找到 class 后的空格');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('未找到 class 关键字');
|
||||||
|
}
|
||||||
|
compiledCode(this.ruleEngineVersionInfoAndTest).then(
|
||||||
|
res => {
|
||||||
|
this.$message.success('编码保存成功');
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
getMessage(data) {
|
||||||
|
this.ruleEngineVersionInfoAndTest.javaCode = data; //data即为子组件发送的数据
|
||||||
|
},
|
||||||
|
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;
|
||||||
|
this.ruleEngineVersionInfoAndTest = command.ruleEngineVersion;
|
||||||
|
this.$set(this.ruleEngineVersionInfoAndTest,"javaCode",this.ruleEngineVersionInfoAndTest.javaCode)
|
||||||
|
break;
|
||||||
|
case "test"://测试
|
||||||
|
this.ruleEngineVersionTestStatus = true;
|
||||||
|
this.ruleEngineVersionInfoAndTest = command.ruleEngineVersion;
|
||||||
|
this.$set(this.ruleEngineVersionInfoAndTest,"javaCode",this.ruleEngineVersionInfoAndTest.javaCode)
|
||||||
|
|
||||||
|
queryBigStructure().then(
|
||||||
|
res => {
|
||||||
|
console.log("获取到的大对象是:",res.data)
|
||||||
|
this.bigModel = res.data.dataSourceDecorationList
|
||||||
|
this.dataSourceList = res.data.dataSourceDecorationList.map(dataModel => {
|
||||||
|
return dataModel.dataSource;
|
||||||
|
console.log("model",dataModel.dataSource)
|
||||||
|
})
|
||||||
|
console.log("数据源集合:",this.dataSourceList)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
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.ruleVersionName == null || this.engineVersionForm.ruleVersionName === "") {
|
||||||
this.$message.error('规则名称不可为空');
|
this.$message.error('规则名称不可为空');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.engineVersionForm.code == null || this.engineVersionForm.code === "") {
|
if (this.engineVersionForm.ruleVersionCode == null || this.engineVersionForm.ruleVersionCode === "") {
|
||||||
this.$message.error('规则CODE不可为空');
|
this.$message.error('规则CODE不可为空');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.engineVersionForm.versionCode = this.ruleEngineInfo.engineCode + "_" + this.engineVersionForm.code
|
if (this.engineVersionForm.ruleVersionDesc == null || this.engineVersionForm.ruleVersionDesc === "") {
|
||||||
|
this.$message.error('规则版本使用描述不可为空');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.engineVersionForm.ruleEngineId = this.ruleEngineId
|
||||||
|
generateClazz(this.engineVersionForm).then(
|
||||||
|
res => {
|
||||||
|
console.log("响应的笨笨类对象",res.data)
|
||||||
|
this.engineVersionForm = res.data
|
||||||
|
this.$set(this.engineVersionForm,"javaCode",res.data.javaCode)
|
||||||
|
console.log("成功得到了吗:",this.engineVersionForm)
|
||||||
|
}
|
||||||
|
)
|
||||||
},
|
},
|
||||||
// 确定新增
|
// 确定新增
|
||||||
addVersionSubmission(){
|
addVersionSubmission(){
|
||||||
|
this.engineVersionForm.ruleEngineId = this.ruleEngineId
|
||||||
|
insertRuleVersion(this.engineVersionForm).then(
|
||||||
|
res => {
|
||||||
|
this.$message.success("添加成功")
|
||||||
|
this.reset()
|
||||||
|
this.addVersionStatus = false
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
},
|
},
|
||||||
|
reset() {
|
||||||
|
this.engineVersionForm = {
|
||||||
|
id: null,
|
||||||
|
isActivate: 'N',
|
||||||
|
ruleVersionCode: null,
|
||||||
|
ruleEngineId: this.ruleEngineId,
|
||||||
|
ruleVersionClass: null,
|
||||||
|
javaCode: null,
|
||||||
|
isTest: 'N',
|
||||||
|
ruleVersionName: null,
|
||||||
|
ruleVersionDesc: null,
|
||||||
|
ruleVersionStatus: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
// 取消新增
|
// 取消新增
|
||||||
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"){
|
||||||
|
@ -183,45 +668,44 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
initRuleEngine(){
|
initRuleEngine(){
|
||||||
let response = {
|
getVersionList(this.ruleEngineId).then(
|
||||||
"code": 200,
|
res => {
|
||||||
"msg": "查询成功",
|
console.log("哈哈哈",res.data)
|
||||||
"data": {
|
this.ruleEngineInfo = res.data.ruleEngine
|
||||||
"id": 1,
|
this.ruleVersionList = res.data.ruleVersionList
|
||||||
"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
|
this.ruleEngineInfo = this.ruleEngineInfoList.findLast(ruleInfo => ruleInfo.id == this.ruleEngineId)
|
||||||
|
this.ruleEngineInfo.ruleEngineVersionList =null
|
||||||
|
},
|
||||||
|
// 获取代码模板
|
||||||
|
getCodeIng(){
|
||||||
|
let packageName = "com.muyu.rule.engine";
|
||||||
|
let customName = "custom";
|
||||||
|
let templateName = "template";
|
||||||
|
let parentClass = "DataModelEngine";
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -239,4 +723,7 @@ export default {
|
||||||
.el-icon-arrow-down {
|
.el-icon-arrow-down {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
.CodeMirror {
|
||||||
|
height: 600px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue