新增规则节点
parent
10f8364946
commit
b186934535
|
@ -24,9 +24,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import ClickOutside from 'vue-click-outside'
|
||||
import Home from '../Home.vue'
|
||||
import {listDbTableAll, selDbNameAll, selectDbTableColumnsByName} from "@/api/tool/gen";
|
||||
import ClickOutside from 'vue-click-outside';
|
||||
import {listDisposition} from "@/api/quest/disposition";
|
||||
import DispFind from "./node/dispFind.vue";
|
||||
|
||||
|
@ -80,29 +78,29 @@ export default {
|
|||
},
|
||||
// 右击菜单
|
||||
onContextmenu() {
|
||||
this.$contextmenu({
|
||||
items: [
|
||||
{
|
||||
label: '修改名称',
|
||||
disabled: false,
|
||||
icon: "",
|
||||
onClick: () => {
|
||||
this.toUpdName();
|
||||
}
|
||||
},{
|
||||
label: '删除节点',
|
||||
disabled: false,
|
||||
icon: "",
|
||||
onClick: () => {
|
||||
this.deleteNode()
|
||||
}
|
||||
}
|
||||
],
|
||||
event,
|
||||
customClass: 'custom-class',
|
||||
zIndex: 9999,
|
||||
minWidth: 180
|
||||
})
|
||||
this.deleteNode()
|
||||
// this.$contextmenu({
|
||||
// items: [
|
||||
// {
|
||||
// label: '修改名称',
|
||||
// disabled: false,
|
||||
// icon: "",
|
||||
// onClick: () => {
|
||||
// this.toUpdName();
|
||||
// }
|
||||
// },{
|
||||
// label: '删除节点',
|
||||
// disabled: false,
|
||||
// icon: "",
|
||||
// onClick: () => {
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// ],
|
||||
// customClass: 'custom-class',
|
||||
// zIndex: 9999,
|
||||
// minWidth: 180
|
||||
// })
|
||||
},
|
||||
setActive() {
|
||||
if (window.event.ctrlKey) {
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
<span v-else-if="node.type === 'unite'">
|
||||
<UniteFind :disp="disp" :data="data" :node="node" />
|
||||
</span>
|
||||
<span v-else-if="node.type === 'rule'">
|
||||
<RuleFind :disp="disp" :data="data" :node="node" />
|
||||
</span>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
@ -24,12 +27,13 @@
|
|||
import TableFind from './type/tableFind.vue'
|
||||
import ExporFind from "./type/exporFind.vue";
|
||||
import UniteFind from "./type/uniteFind.vue";
|
||||
import RuleFind from "./type/ruleFind.vue";
|
||||
|
||||
|
||||
export default {
|
||||
// import引入的组件需要注入到对象中才能使用"
|
||||
name: 'type-table',
|
||||
components: {ExporFind, TableFind, UniteFind},
|
||||
components: {ExporFind, TableFind, UniteFind,RuleFind},
|
||||
props: {
|
||||
data: {},
|
||||
node: {},
|
||||
|
|
|
@ -0,0 +1,224 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-form label-position="right" label-width="120px" :model="checkRule" :inline="true">
|
||||
<el-form-item label="规则级别" style="width: 30%;">
|
||||
<el-input v-model="checkRule.rule.ruleName" placeholder="未配置" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="规则版本" style="width: 30%;">
|
||||
<el-input v-model="checkRule.version.ruleVersionName" placeholder="未配置" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="规则优先级" style="width: 30%;">
|
||||
<el-input v-model="checkRule.priority" placeholder="未配置" disabled />
|
||||
</el-form-item>
|
||||
<el-descriptions class="margin-top" :column="2" border style="font-size: 16px;margin: 20px">
|
||||
<el-descriptions-item span="2">
|
||||
<template slot="label">
|
||||
<i class="el-icon-user"></i>
|
||||
版本类
|
||||
</template>
|
||||
{{ checkRule.version.ruleVersionClass }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-mobile-phone"></i>
|
||||
版本名称
|
||||
</template>
|
||||
{{ checkRule.version.ruleVersionName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-location-outline"></i>
|
||||
版本CODE
|
||||
</template>
|
||||
{{ checkRule.version.ruleVersionCode }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item span="2">
|
||||
<template slot="label">
|
||||
<i class="el-icon-office-building"></i>
|
||||
规则描述
|
||||
</template>
|
||||
<span v-html="checkRule.version.ruleVersionDescribed"></span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div align="center">
|
||||
<el-button @click="disp.findFlag = false">确认</el-button>
|
||||
<el-button type="primary" @click="toRuleUpdFlag">修改配置</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-dialog title="修改配置" :visible.sync="updRuleFlag" width="70%" :modal="false">
|
||||
<div>
|
||||
<el-form label-position="right" label-width="120px" :model="checkRule" :inline="true">
|
||||
<el-form-item label="规则级别" style="width: 30%;">
|
||||
<el-select v-model="checkRule.rule.ruleCode" placeholder="请选择规则级别" @change="checkRuleCode">
|
||||
<el-option v-for="item in ruleList" :label="item.ruleName" :value="item.ruleCode"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="规则版本" style="width: 30%;">
|
||||
<el-select :value="checkRule.version.ruleVersionClass" placeholder="请选择规则版本" @change="checkRuleVersionCode">
|
||||
<el-option v-for="item in checkRule.rule.ruleVersionList" :label="item.ruleVersionName" :value="item.ruleVersionClass"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="规则优先级" style="width: 30%;">
|
||||
<el-input v-model="checkRule.priority" placeholder="请选择规则优先级" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-descriptions class="margin-top" :column="2" border style="font-size: 16px;margin: 20px">
|
||||
<el-descriptions-item span="2">
|
||||
<template slot="label">
|
||||
<i class="el-icon-user"></i>
|
||||
版本类
|
||||
</template>
|
||||
{{ checkRule.version.ruleVersionClass }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-mobile-phone"></i>
|
||||
版本名称
|
||||
</template>
|
||||
{{ checkRule.version.ruleVersionName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-location-outline"></i>
|
||||
版本CODE
|
||||
</template>
|
||||
{{ checkRule.version.ruleVersionCode }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item span="2">
|
||||
<template slot="label">
|
||||
<i class="el-icon-office-building"></i>
|
||||
规则描述
|
||||
</template>
|
||||
<span v-html="checkRule.version.ruleVersionDescribed"></span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div align="center">
|
||||
<el-button @click="updRuleFlag = false">取消</el-button>
|
||||
<el-button type="primary" @click="save">保存修改</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||
//例如:import 《组件名称》 from '《组件路径》,
|
||||
import {listRuleInfo} from "../../../../../../api/engine/ruleInfo";
|
||||
import {batchAddUpd, listDisposition} from "../../../../../../api/quest/disposition";
|
||||
|
||||
export default {
|
||||
//import引入的组件需要注入到对象中才能使用"
|
||||
components: {},
|
||||
props: {
|
||||
data: {},
|
||||
node: {},
|
||||
disp: {
|
||||
nodeCode: undefined,
|
||||
nodeType: undefined,
|
||||
findFlag: false,
|
||||
updFlag: false,
|
||||
formData: {
|
||||
db: {},
|
||||
fields: []
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
//这里存放数据"
|
||||
return {
|
||||
// 规则列表
|
||||
ruleList: [],
|
||||
// 选择的规则
|
||||
checkRule: {
|
||||
// 选择的规则类型
|
||||
rule: {},
|
||||
// 选择的规则版本
|
||||
version: {},
|
||||
priority: ''
|
||||
},
|
||||
// 是否展示修改规则窗口
|
||||
updRuleFlag: false,
|
||||
};
|
||||
},
|
||||
//计算属性 类似于data概念",
|
||||
computed: {},
|
||||
//监控data中的数据变化",
|
||||
watch: {},
|
||||
//方法集合",
|
||||
methods: {
|
||||
// 初始化
|
||||
init() {
|
||||
listRuleInfo({pageNum: 1, pageSize: 100}).then(response => {
|
||||
this.ruleList = response.data.rows;
|
||||
// 获取自身配置信息
|
||||
listDisposition({nodeCode: this.node.id}).then(res => {
|
||||
var row = res.data.rows[0];
|
||||
console.log(row)
|
||||
this.checkRule.priority = row.dispDesc
|
||||
this.checkRuleCode(row.dispLabel)
|
||||
this.checkRuleVersionCode(row.dispValue)
|
||||
console.log(this.checkRule)
|
||||
})
|
||||
});
|
||||
},
|
||||
// 修改规则按钮
|
||||
toRuleUpdFlag() {
|
||||
this.updRuleFlag = true
|
||||
},
|
||||
// 选择规则类型
|
||||
checkRuleCode(value) {
|
||||
this.checkRule.rule = this.ruleList.filter(item => item.ruleCode === value)[0]
|
||||
},
|
||||
// 选择规则版本
|
||||
checkRuleVersionCode(value) {
|
||||
this.checkRule.version = this.checkRule.rule.ruleVersionList.filter(item => item.ruleVersionClass === value)[0]
|
||||
},
|
||||
// 保存修改按钮
|
||||
save() {
|
||||
console.log(this.checkRule)
|
||||
const checkRule = this.checkRule.version
|
||||
let ruleCode = this.checkRule.rule.ruleCode
|
||||
let priority = this.checkRule.priority
|
||||
const dispList = []
|
||||
dispList.push({
|
||||
nodeCode: this.node.id,
|
||||
dispKey: 'rule',
|
||||
dispLabel: ruleCode,
|
||||
dispValue: checkRule.ruleVersionClass,
|
||||
dispType: 'string',
|
||||
dispDesc: priority,
|
||||
ruleId: checkRule.ruleVersionScope
|
||||
})
|
||||
batchAddUpd(dispList, this.node.id).then(res => {
|
||||
this.$message.success(res.msg)
|
||||
this.updRuleFlag = false
|
||||
})
|
||||
}
|
||||
},
|
||||
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||
created() {
|
||||
this.init()
|
||||
},
|
||||
//生命周期 - 挂载完成(可以访问DOM元素)",
|
||||
mounted() {
|
||||
},
|
||||
beforeCreate() {
|
||||
}, //生命周期 - 创建之前",
|
||||
beforeMount() {
|
||||
}, //生命周期 - 挂载之前",
|
||||
beforeUpdate() {
|
||||
}, //生命周期 - 更新之前",
|
||||
updated() {
|
||||
}, //生命周期 - 更新之后",
|
||||
beforeDestroy() {
|
||||
}, //生命周期 - 销毁之前",
|
||||
destroyed() {
|
||||
}, //生命周期 - 销毁完成",
|
||||
activated() {
|
||||
} //如果页面有keep-alive缓存功能,这个函数会触发",
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -30,6 +30,14 @@ const nodeTypeList = [
|
|||
logImg: require('@/assets/svg/侧边栏测试任务.svg'),
|
||||
log_bg_color: 'rgba(0, 128, 0, 0.2)'
|
||||
},
|
||||
{
|
||||
type: 'rule',
|
||||
typeName: '规则清洗',
|
||||
nodeName: '规则清洗',
|
||||
partition: 'operation',
|
||||
logImg: require('@/assets/svg/侧边栏测试任务.svg'),
|
||||
log_bg_color: 'rgba(0, 128, 0, 0.2)'
|
||||
},
|
||||
{
|
||||
type: 'exportation',
|
||||
typeName: '数据输出',
|
||||
|
|
Loading…
Reference in New Issue