VUE条件树查询 自定义条件节点

之前实现过的简单的条件树功能如下图:

 经过最新客户需求确认,上述条件树还需要再次改造,以满足正常需要!

最新暴改后的功能如下红框所示:

 

页面功能

主页面逻辑代码:

<template><div class="flex-col"><div id="container" class="c-view"></div><el-button type="primary" plain style="width: 120px;" @click="doQuery">开始搜索</el-button></div>
</template>
<script>
import { Graph } from '@antv/x6'
import Hierarchy from '@antv/hierarchy'
import '@antv/x6-vue-shape'
import querytrees from './queryCondition.vue' //这是我的vue组件,作为子节点展示在思维导图上
import queryrelative from './queryRelative.vue'import { findItem, lastChild, setData, addChildNode, removeNode, randomId } from './fun'export default {data() {return {graphData: {'id': '1','type': 'original—add','width': 80,'height': 30,"children": [// {//     "id": 0.28207584597793156,//     "type": "queryrelative", //关系节点//     "width": 44,//     "height": 44,//     "data": {//         "relative": "and" //and并且 or或者//     },//     "children": [//         {//             "id": 0.32858917851150116,//             "type": "condition-text", //条件节点//             "width": 90,//             "height": 44,//             "level": 1, //判断它是第几级的条件节点//             "edgeText": "",//             "data": {//                 "complete": true,//                 "form": {} //你的业务数据//             }//         },//         {//             "id": 0.30546487070416783,//             "type": "vue-shape", //自定义组件 业务节点//             "width": 744,//             "height": 44,//             "level": 1,//             "edgeText": "",//             "data": {//                 "complete": false,//                 "form": {} //你的业务数据//             }//         }//     ]// }]} //默认只有一个根节点}},mounted() {this.init()},methods: {//初始化⽅法doQuery() {let vft = (obj) => {let empty = obj.children.length == 0if (obj.type == 'relative') {empty = false}else {if (obj.data) {empty = !obj.data.complete}else {for (let i = 0; i < obj.children.length; i++) {empty = vft(obj.children[i])if (empty) {break}}}}return empty}if (vft(this.graphData)) {this.$modal.msgError("请先确认查询条件")}else {//组装查询语句// let cft = (obj) => {//     let stms = null//     if (obj.type == 'relative') {//         obj.children.forEach(e => {//             if (e.children && e.children.length > 0) {//                 e.children.forEach(p => {//                     let at = cft(p)//                     if (!stms) {//                         stms = at//                     }//                     else {//                         stms = stms + ' ' + e.data.relative + ' ' + at//                     }//                 })//             }//             else {//                 if (!stms) {//                     stms = e.data.form.topForm.value + e.data.form.conditionForm.value + e.data.form.valueForm.value//                 }//                 else {//                     let t = e.data.form.topForm.value + e.data.form.conditionForm.value + e.data.form.valueForm.value//                     stms = stms + ' ' + obj.data.relative + ' ' + t//                 }//             }//         })//     }//     else {//         obj.children.forEach(p => {//             debugger//             let at = cft(p)//             if (!stms) {//                 stms = at//             }//             else {//                 stms = stms + p.data.relative + at//             }//         })//     }//     return stms// }this.$emit('input', { sql: "", tree: this.graphData.children })}},init() {let self = thisGraph.registerNode('original—add',{inherit: 'rect',width: 80,height: 30,label: '+纳入条件',attrs: { //样式代码body: {rx: 4,ry: 4,stroke: '#037AFB',fill: '#037AFB',strokeWidth: 1,event: 'add:original' //根节点点击事件},label: {fontSize: 14,fill: 'white',event: 'add:original'//根节点点击事件}}},true,)//自定义vue 业务节点Graph.registerVueComponent('queryrelative',{template: `<queryrelative/>`,components: {queryrelative}},true)//自定义vue 业务节点Graph.registerVueComponent('querytrees',{template: `<querytrees/>`,components: {querytrees}},true)// 弯的边Graph.registerEdge('mindmap-edge',{inherit: 'edge',router: {name: 'manhattan',args: {startDirections: ['right'],endDirections: ['left']}},connector: {name: 'rounded'},attrs: {line: {targetMarker: '',stroke: '#A2B1C3',strokeWidth: 2}}, //样式代码zIndex: 0},true,)// 直的边Graph.registerEdge('straight-edge',{inherit: 'edge',attrs: {}, //样式代码zIndex: 0},true,)//新增限定条件Graph.registerNodeTool('add-condition',{inherit: 'button', // 基类名称,使用已经注册的工具名称。markup: [{tagName: 'rect',selector: 'button',attrs: {fill: '#296FFF',cursor: 'pointer',width: 32,height: 28}},{tagName: 'image',selector: 'icon',attrs: {'xlink:href': 'https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*SYCuQ6HHs5cAAAAAAAAAAAAAARQnAQ',cursor: 'pointer',width: 16,height: 16,x: 8,y: 6}}],x: '100%',y: '100%',offset: { x: -32, y: -72 },onClick({ cell }) {const { id } = cellconst dataItem = findItem(this.graphData, id).nodeconst lastNode = lastChild(dataItem)//找到当前node的最后一级,添加if (addChildNode(lastNode.id, '并且', graphData)) {render(graph, this.graphData)}}}, true)//关系节点 点击增加条件事件Graph.registerNodeTool('relative:add-condition', {inherit: 'button', // 基类名称,使用已经注册的工具名称。markup: [{tagName: 'rect',selector: 'button',attrs: {fill: '#296FFF',cursor: 'pointer',width: 32,height: 28}},{tagName: 'image',selector: 'icon',attrs: {'xlink:href': 'https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*SYCuQ6HHs5cAAAAAAAAAAAAAARQnAQ',cursor: 'pointer',width: 16,height: 16,x: 8,y: 6}}],x: '100%',y: '100%',offset: { x: -32, y: -72 },onClick({ cell }) {const { id } = cellif (addChildNode(id, '', this.graphData)) render(graph, this.graphData)}}, true)//边增加条件Graph.registerEdgeTool('edge:add-condition', {inherit: 'button', // 基类名称,使用已经注册的工具名称。markup: [{tagName: 'rect',selector: 'button',attrs: {fill: '#296FFF',cursor: 'pointer',fontSize: 16,width: 20,height: 20,rx: 2,ry: 2,stroke: '#296FFF',strokeWidth: 1}},{tagName: 'text',selector: 'label',textContent: '+',attrs: {x: 5,y: 15,fontSize: 16,cursor: 'pointer',fill: '#ffff'}}],distance: '100%',offset: { y: -10, x: -10 },onClick({ cell }) {debuggerconst { node, parent } = findItem(self.graphData, cell.target.cell)const newId = randomId()const childP = {children: [node],id: newId,type: 'vue-shape',width: 80,height: 40,level: 2,component: 'queryrelative',data: { relative: 'and', type: 'document', options: [{ label: '同病人', value: '1' }, { label: '同病历', value: '2' }, { label: '同报告', value: '3' }], defaultValue: '1' }}const currentIndex = parent.children.findIndex(item => item.id === node.id)parent.children[currentIndex] = childPlet anode = addChildNode(newId, '', self.graphData)anode.width = 550anode.component = 'querytrees'if (anode) {render(graph, self.graphData)}}}, true)let graph = new Graph({background: { color: '#fff' },container: document.getElementById('container'),panning: { enabled: true },selecting: { enabled: true },keyboard: { enabled: true },grid: true,mousewheel: {enabled: true,modifiers: ['ctrl', 'meta']},interacting: { nodeMovable: false }})const render = (graph, graphData) => {const result = Hierarchy.mindmap(graphData, {direction: 'H',getHeight(d) {return d.height},getWidth(d) {return d.width},getHGap() {return 40},getVGap() {return 20},getSide: () => {return 'right'}})const cells = []const traverse = (hierarchyItem, parentId) => {if (hierarchyItem) {const { data, children } = hierarchyItemconst node = graph.createNode({...data,shape: data.type,x: hierarchyItem.x,y: hierarchyItem.y,component: data.component})if (parentId) {//有父级则插入父级const parent = graph.getCellById(parentId)parent && parent.addChild(node)}cells.push(node)//子节点边if (children) {children.forEach((item) => {const { id, data: itemData } = itemcells.push(graph.createEdge({shape: itemData.edgeText ? 'straight-edge' : 'mindmap-edge',source: {cell: hierarchyItem.id,anchor: {name: itemData.type === 'topic-child' ? 'right' : 'center',args: {dx: itemData.type === 'topic-child' ? -16 : '25%'}}},target: { cell: id, anchor: { name: 'left' } },labels: [{ attrs: { text: { text: itemData.edgeText || '' } } }]}),)traverse(item, node.id)})}}}traverse(result)graph.resetCells(cells)// graph.scaleContentToFit({ maxScale: 1 })graph.centerContent()}//根结点添加graph.on('add:original', ({ node }) => {debuggerif (this.graphData.children.length == 0) {const { id } = nodelet anode = addChildNode(id, '', this.graphData)anode.id = randomId()anode.type = "vue-shape" //自定义组件 业务节点anode.width = 550anode.height = 44anode.level = 1anode.edgeText = ""anode.data = {complete: false,form: {formType: 1,topForm: {label: '',value: ''},conditionForm: {},valueForm: {label: '',value: ''},extra: {}} //你的业务数据}anode.component = 'querytrees'anode.children = []if (anode) {render(graph, this.graphData)}}else if (this.graphData.children.lastObject().type != 'relative') {const { id } = nodelet tlist = this.graphData.childrenthis.graphData.children = []let anode = addChildNode(id, '', this.graphData)anode.type = "vue-shape"anode.width = 80;anode.height = 40;anode.level = 1;anode.component = 'queryrelative';anode.data = {"relative": "and" //and并且 or或者, options: [{ label: '同病人', value: '1' }, { label: '同病历', value: '2' }, { label: '同报告', value: '3' }], defaultValue: '1'}let xlist = []tlist.forEach(element => {element.id = randomId(),xlist.push(element)});xlist.push({id: randomId(),type: "vue-shape", //自定义组件 业务节点width: 550,height: 44,level: 1,edgeText: "",component: 'querytrees',data: {complete: false,form: {formType: 1,topForm: {label: '',value: ''},conditionForm: {},valueForm: {label: '',value: ''},extra: {}} //你的业务数据}})anode.children = xlistif (anode) {render(graph, this.graphData)}}else {const { id } = nodelet tlist = this.graphData.childrenthis.graphData.children = []let anode = addChildNode(id, '', this.graphData)anode.type = "vue-shape"anode.component = 'queryrelative'anode.width = 80;anode.height = 40;anode.level = 1;anode.data = {"relative": "and" //and并且 or或者}let xlist = []tlist.forEach(x => {xlist.push(x)})xlist.push({id: randomId(),type: "vue-shape", //自定义组件 业务节点width: 550,height: 44,level: 1,edgeText: "",component: 'querytrees',data: {complete: false,form: {formType: 1,topForm: {label: '',value: ''},conditionForm: {},valueForm: {label: '',value: ''},extra: {}} //你的业务数据}})anode.children = xlist// tlist.push(anode)this.graphData.children = [anode]if (anode) {render(graph, this.graphData)}}})//节点数据变化graph.on('node:change:data', ({ cell, node }) => {debuggersetData(self.graphData, node.id, node.data)const dataItem = node.getData()cell.setData({ ...dataItem, complete: dataItem.complete, isEdit: true })})graph.on('node:removed', ({ cell, node }) => {removeNode(node.id, self.graphData)render(graph, self.graphData)})//节点聚焦 增加工具栏目graph.on('node:mouseenter', ({ node }) => {// if (['condition-text', 'relative'].includes(node.shape)) {//     if (!this.isExistUnComplete()) { //判断当前是否有未填写完成的vue组件节点//         if (node.shape === 'condition-text') {//             node.setAttrs({ body: { fill: '#E9F0FF', stroke: '#296FFF' } })//         }//         this.addTool(node)//     }// }})//节点失焦 移除工具栏graph.on('node:mouseleave', ({ node }) => {// if (['condition-text', 'relative'].includes(node.shape)) {//     if (node.shape === 'condition-text') {//         node.setAttrs({ body: { stroke: '#CCC', fill: '#fff' } })//     }//     this.removeTool(node)// }})//边 悬浮事件graph.on('edge:mouseenter', ({ edge }) => {//不是 根结点下第一个关系节点 并且 没有未完成的节点 可添加const targetNode = graph.getCellById(edge.target.cell)const targetNodeData = findItem(this.graphData, edge.target.cell).nodeconst isChild = targetNodeData.level ? targetNodeData.level === 1 : true //不是限定节点 可添加if (!(edge.source.cell === '1' && targetNode.shape === 'relative') && isChild && !this.isExistUnComplete()) {edge.addTools(['edge:add-condition'])}})//边 失焦graph.on('edge:mouseleave', ({ edge }) => {if (!this.isExistUnComplete()) {//判断当前是否有未填写完成的vue组件节点edge.removeTools(['edge:add-condition'])}})render(graph, this.graphData)},isExistUnComplete() {return false}}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.flex-col {width: 100%;height: 310px;display: flex;flex-direction: column;justify-content: center;align-items: center;
}.c-view {height: 260px;width: 100%;
}.topic-image {visibility: hidden;cursor: pointer;
}.x6-node:hover .topic-image {visibility: visible;
}.x6-node-selected rect {stroke-width: 2px;
}
</style>

涉及到的组件一 

queryCondition.vue

<template><div class="condition" :class="[complete ? 'ny-view' : 'dy-view']" :style="{ width: lineTextWidth + 'px' }"><el-form v-if="!complete" ref="form" :model="form" label-width="0" inline><el-row :gutter="10"><el-col :span="(form.formType != 2) ? 9 : 6"><el-form-item class="w-100 flex-row"><el-select class="search-options" v-model="form.topForm.value" filterable clearableplaceholder="请选择" :loading="remoteLoading" remote :remote-method="searchKeysAction"><el-option v-for="item in topFormOptions" :key="item.formItemId" :label="item.label":value="item.formItemId"></el-option></el-select><el-button class="search-icon" icon="el-icon-plus" @click="showCheck = true"></el-button></el-form-item></el-col><el-col :span=5><el-form-item class="w-100"><el-select v-model="form.conditionForm.value" placeholder="关系" @change="conditionFormChanged"><el-option v-for="item in optionsList()" :key="item.label" :label="item.label":value="item.value"></el-option></el-select></el-form-item></el-col><el-col :span="(form.formType != 2) ? 5 : 8"><el-form-item class="w-100"><el-select v-if="form.formType == 3" v-model="form.valueForm.value" placeholder="请选择"><el-option v-for="item in valuesOptions" :key="item.value" :label="item.label":value="item.value"></el-option></el-select><div v-else-if="form.formType == 2" :key="renderKey"><el-date-picker class="w-100"v-if="(form.conditionForm.value != '9' && form.conditionForm.value != '10')"v-model="form.valueForm.value" format="yyyy.MM.dd" type="date"placeholder="选择日期"></el-date-picker><el-date-picker class="w-100" v-else v-model="form.valueForm.value" format="yy.MM.dd"type="daterange" range-separator="-" start-placeholder="开始时间" end-placeholder="结束时间"></el-date-picker></div><el-input class="w-100" v-else v-model="form.valueForm.value" placeholder="对比值"></el-input></el-form-item></el-col><el-col :span=5><el-form-item class="w-100"><div class="flex-row w-100"><el-button type="danger" @click="onDelAction">删除</el-button><el-button type="primary" @click="onSubmit">确定</el-button></div></el-form-item></el-col></el-row></el-form><div v-else :style="{ width: lineTextWidth + 'px' }" @click="reEditAction"><span class="top-view">{{ topText }}</span><span class="con-view">{{ conditionText }}</span><span class="val-view">{{ valueText }}</span></div><check-crf v-if="showCheck" @input="itemSelected" :inTreeQuery="true" :workSingle="true" /></div>
</template><script>// import { elForm, elFormItem, elInput, elSelect, elOption } from 'element-ui'//在这需要再次按需引入对应组件
import { getTextWidth, setData, removeNode, randomId } from "./fun"
import CheckCrf from '../crf/components/check-crf.vue'
import project from '../../api/project/project'export default {name: 'queryCondition',inject: ["getGraph", "getNode"],components: { CheckCrf },data() {return {showCheck: false,complete: false,form: {//1数值型条件 conditionForm为等于、不等于、大于、大于等于、小于、小于等于、为空、不为空//2日期条件 conditionForm为晚于、不晚于、早于、不早于、时间段内、时间段外、为空、不为空//3复选框 conditionForm为是、否//4其他类型 conditionForm为包含、不包含、等于、不等于、为空、不为空formType: 1,topForm: {label: '',value: ''},conditionForm: {label: '',value: ''},valueForm: {label: '',value: '',},//原始组件所有属性extra: {}},topFormOptions: [],lineTextWidth: 550,topText: '用户姓名',conditionText: '包含',valueText: 'dudu',renderKey: randomId(),valuesOptions: [],remoteLoading: false}},mounted() {const self = this;let node = this.getNode()const data = node.getData();if (data) {this.complete = data.completethis.form = data.formthis.topText = this.form.topForm.labelthis.conditionText = this.form.conditionForm.labelif (this.form.formType == 3) {this.valueText = this.form.valueForm.label}else {this.valueText = this.form.valueForm.value}}// 监听数据改变事件// node.on("change:data", ({ current }) => {//     debugger// });this.renderUI()},methods: {conditionFormChanged(e) {if (this.form.formType == 2) {//必须强制刷新一下对应的DOM,否则会出现日期选择框弹出位置错误或者无法弹出的问题this.renderKey = randomId()this.form.valueForm.value = ""}},searchKeysAction(query) {if (query !== '') {this.remoteLoading = true;project.getCrfKeys(query).then(res => {res.forEach(element => {element.formItemId = element.code});this.remoteLoading = falsethis.topFormOptions = res})} else {this.options = [];}},itemSelected(raw) {let e = raw.firstObject()let cp = e.componentlet label = cp.config.labellet fid = e.codethis.form.topForm.label = labelthis.form.topForm.value = fidthis.form.extra = eif (!this.topFormOptions.containsObject(fid)) {let p = { ...e, label: label, formItemId: fid }this.topFormOptions.addObject(p)}if (cp.typeId === 'INPUT') {this.form.formType = 1}else if (cp.typeId === 'DATE') {this.form.formType = 2}else if (cp.typeId === 'SELECT' || cp.typeId === 'CHECKBOX' || cp.typeId === 'RADIO') {this.form.formType = 3this.valuesOptions = cp.config.options}else {this.form.formType = 4}this.showCheck = false},renderUI() {let width = getTextWidth(this.topText + this.conditionText + this.valueText, 14, "Arial, Helvetica, sans-serif")this.lineTextWidth = width;this.lineTextWidth += 10;this.lineTextWidth += 20;},optionsList() {if (this.form.formType == 1) {let opList = [{ label: '包含', value: '11' },{ label: '等于', value: '7' },{ label: '不等于', value: '8' },{ label: '大于', value: '3' },{ label: '大于等于', value: '4' },{ label: '小于', value: '5' },{ label: '小于等于', value: '6' },{ label: '为空', value: '2' },{ label: '不为空', value: '1' }]return opList}else if (this.form.formType == 2) {let opList = [{ label: '等于', value: '7' },{ label: '不等于', value: '8' },{ label: '晚于', value: '5' },{ label: '不晚于', value: '4' },{ label: '早于', value: '3' },{ label: '不早于', value: '6' },{ label: '时间段内', value: '9' },{ label: '时间段外', value: '10' },{ label: '为空', value: '2' },{ label: '不为空', value: '1' }]return opList}else if (this.form.formType == 3) {let opList = [{ label: '等于', value: '7' },{ label: '不等于', value: '8' },]return opList}else {let opList = [{ label: '包含', value: '11' },{ label: '不包含', value: '12' },{ label: '等于', value: '7' },{ label: '不等于', value: '8' },{ label: '为空', value: '2' },{ label: '不为空', value: '1' }]return opList}},onSubmit() {let flabel = this.optionsList().filter(p => p.value == this.form.conditionForm.value).firstObject()?.labellet ext = this.topFormOptions.filter(p => p.formItemId == this.form.topForm.value)let topText = ext.firstObject()?.labellet vtext = this.form.valueForm.valuelet tipText = nullif (!topText || topText.length == 0) {tipText = '未选择条件字段'}else if (!flabel || flabel.length == 0) {tipText = '未选择条件关系'}else if (!vtext || vtext.length == 0) {tipText = '未选择条件对比值'}if (tipText) {this.$modal.msgError(tipText)}else {this.form.conditionForm.label = flabelthis.topText = topTextthis.conditionText = flabelif (this.form.formType == 3) {vtext = this.valuesOptions.filter(p => p.value == this.form.valueForm.value)[0].labelthis.form.valueForm.label = vtext}this.valueText = vtextthis.form.extra = ext.firstObject()this.complete = truelet node = this.getNode()const dataItem = {complete: this.complete,form: {...this.form}}let graphData = node.parentsetData(graphData, node.id, dataItem)this.renderUI()let data = {mapDbName: this.form.extra.mapDbName,mapTblName: this.form.extra.mapTblName,dataDbName: this.form.extra.dataDbName,dataTblName: this.form.extra.dataTblName,dataColName: this.form.extra.dataColName,fieldType: this.form.extra.fieldType,fieldSource: this.form.extra.fieldSource,code: this.form.topForm.value,operator: this.form.conditionForm.value,value: this.form.valueForm.value}let cv = parseInt(this.form.conditionForm.value)if (this.form.formType == 2 && ((cv == 9 || cv == 10))){data.start = this.form.valueForm.value[0].date2text("yyyy-MM-dd") + " 00:00:00"data.end = this.form.valueForm.value[1].date2text("yyyy-MM-dd") + " 23:59:59"}project.queryTreeAction(data).then(res => {})}},onDelAction() {let graph = this.getGraph()let node = this.getNode()this.$confirm('确定删除此条件?', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then((cmd) => {if (cmd == 'confirm') {graph.removeNode(node.id)}})},reEditAction() {this.complete = false},checkBtnGroupClose() {this.showCheck = false}}
}
</script><style lang="scss" scoped>
.condition {padding: 0px 10px;height: 100%;background: white;border-radius: 6px;border: 1px solid #EFF4FF;display: flex;flex-direction: row;justify-content: center;align-items: center;
}.dy-view {min-width: 550px;background: #EFF4FF;border: 1px solid #5F95FF;
}.ny-view {width: auto;
}.flex-row {display: flex;flex-direction: row;justify-content: center;align-items: center;
}.top-view {white-space: nowrap;color: black;font-size: 14px;font-family: Arial, Helvetica, sans-serif;
}.con-view {color: gray;font-size: 14px;padding: 0px 5px;font-family: Arial, Helvetica, sans-serif;
}.val-view {color: black;font-size: 14px;font-family: Arial, Helvetica, sans-serif;
}.search-options {width: calc(100% - 34px);
}.search-icon {position: absolute;border-left: none;width: 32px;height: 32px;margin-left: -4px;background-color: #F5F7FA;
}::v-deep {.el-form-item--small {margin: 0px;vertical-align: middle !important;}.el-button--small {padding-left: 10px;padding-right: 10px;}.el-input-group__append {padding-right: 15px;}.el-range__close-icon {display: none;}.el-checkbox--small {height: auto !important;}
}
</style>

涉及到组件二

queryRelative.vue

<template><div class="condition dy-view flex-row"><div class="flex-row l-flex l-hover" style="position: relative;" :class="{ 'nl-flex': relative == 'or' }"><el-popover placement="bottom" ref="refPop" width="80" trigger="hover" class="h-100 flex-row"popper-class="pop-grid-view"><el-radio-group v-model="radio" @input="radioChanged"><el-radio :label="item.value" v-for="item in optionsList">{{ item.label }}</el-radio></el-radio-group><el-image slot="reference" style="width: 20px; height: 20px":src="require('@/assets/images/sameR.png')"></el-image></el-popover><el-image class="m-view" :src="require('@/assets/images/downArrow.png')"></el-image></div><div class="flex-row r-flex label-text" :class="{ 'nr-flex': relative == 'or' }" @click="relativeChanged">{{ relative == 'or' ? '或者' : '并且' }}</div></div>
</template><script>// import { elForm, elFormItem, elInput, elSelect, elOption } from 'element-ui'//在这需要再次按需引入对应组件
import { getTextWidth, setData, removeNode, randomId } from "./fun"export default {name: 'queryRelative',inject: ["getGraph", "getNode"],components: {},data() {return {radio: '1',relative: 'and',optionsList: [],}},mounted() {let node = this.getNode()const data = node.getData();this.relative = data.relativethis.optionsList = data.optionsthis.radio = data.defaultValue},methods: {radioChanged() {this.$refs['refPop'][0].doClose()},relativeChanged() {this.relative = this.relative == 'and' ? 'or' : 'and'let node = this.getNode()const dataItem = {relative:this.relative,defaultValue:this.radio}let graphData = node.parentsetData(graphData, node.id, dataItem)}}
}
</script><style lang="scss" scoped>
.condition {padding: 0px;height: 100%;border-radius: 5px;width: 80px;height: 40px;background-color: white;overflow: hidden;display: flex;flex-direction: row;justify-content: center;align-items: center;
}.flex-row {display: flex;flex-direction: row;justify-content: center;align-items: center;
}.l-flex {width: 35px;height: 100%;background-color: rgb(109, 162, 243);&:hover {background-color: rgb(129, 182, 255);}
}.r-flex {width: 45px;height: 100%;background-color: rgb(154, 188, 247);&:hover {background-color: rgb(129, 182, 255);}
}.nl-flex {background-color: rgb(41, 195, 193);&:hover {background-color: rgb(61, 215, 213);}
}.nr-flex {background-color: rgb(102, 213, 233);&:hover {background-color: rgb(61, 215, 213);}
}.label-text {color: white;font-size: 13px;
}.m-view {position: absolute;right: 3px;bottom: 3px;width: 6px;height: 6px;
}::v-deep {.el-form-item--small {margin: 0px;vertical-align: middle !important;}.el-button--small {padding-left: 10px;padding-right: 10px;}.el-input-group__append {padding-right: 15px;}.el-range__close-icon {display: none;}.el-checkbox--small {height: auto !important;}.el-radio {line-height: 1.5;}.el-radio__label {padding-left: 5px;}
}
</style><style lang="scss">
.pop-grid-view.el-popper {min-width: 90px;
}
</style>

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/bicheng/66493.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

保险丝驱动电路·保险丝有什么用应该如何选型详解文章!!!

目录 保险丝基础知识 保险丝常见类型 保险丝功能讲解 保险丝驱动电路 ​​​​​​​ ​​​​​​​ 编写不易&#xff0c;仅供学习&#xff0c;请勿搬运&#xff0c;感谢理解 常见元器件驱动电路文章专栏连接 LM7805系列降压芯片驱动电路降压芯片驱动电…

李宏毅机器学习课程笔记02 | 机器学习任务攻略General Guide

第一步&#xff1a;分析loss on training data 先检查在训练数据上模型是否很好的学习 情况1&#xff1a;如果在训练集上&#xff0c;loss很大&#xff0c;说明在训练资料上没有训练好 可能性1&#xff1a;设置的模型太简单了&#xff0c;模型存在model bias模型偏差&#x…

Gitlab-runner 修改默认的builds_dir并使用custom_build_dir配置

gitlab-runner 修改默认的builds_dir并使用custom_build_dir配置 1. 说明2. 实操&#xff08;以docker执行器为例&#xff09;2.1 修改默认的builds_dir2.1.1 调整gitlab-runner的配置文件2.1.2 CI文件 2.2 启用custom_build_dir2.2.1 调整gitlab-runner的配置文件2.2.2 CI文件…

概率基本概念 --- 离散型随机变量实例

条件概率&独立事件 随机变量 - 离散型随机变量 - 非离散型随机变量 连续型随机变量奇异性型随机变量 概率表示 概率分布函数概率密度函数概率质量函数全概率公式贝叶斯公式 概率计算 数学期望方差协方差 计算实例 假设有两个离散型随机变量X和Y&#xff0c;它们代…

QT RC_FILE 应用程序图标设置

1.先做一个app.ico 文件&#xff0c;并将文件放入资源文件夹中 2.打开QT项目的.pro文件在最下面增加 RC_FILE $$PWD/res/app.rc 3.在资源文件夹中创建一个app.rc文件。在QT开发工具中编辑并输入下在内容 IDI_ICON1 ICON "app.ico" 4.测试效果

SQLark:高效数据库连接管理的新篇章

在我们日常工作中&#xff0c;不同的项目使用的数据库不同&#xff0c;比如我这边涉及的数据库就有达梦、Oracle、Mysql&#xff0c;每种数据库都有自己的数据库连接工具&#xff0c;我们不得不在电脑上针对每个数据库都装一个客户端&#xff0c;使用时还得在不同数据库连接工具…

Minio-Linux-安装

文章目录 1.Linux安装1.下载源码包2.上传到/usr/local/minio1.进入目录2.上传 3.开放执行权限4.创建minio文件存储目录及日志目录5.编写启动的shell脚本1.脚本编写2.赋予执行权限 6.启动&#xff01;1.执行run脚本2.查看日志3.开放9001和9000端口1.服务器2.安全组3.访问&#x…

基于Springboot + vue实现的小型养老院管理系统

&#x1f942;(❁◡❁)您的点赞&#x1f44d;➕评论&#x1f4dd;➕收藏⭐是作者创作的最大动力&#x1f91e; &#x1f496;&#x1f4d5;&#x1f389;&#x1f525; 支持我&#xff1a;点赞&#x1f44d;收藏⭐️留言&#x1f4dd;欢迎留言讨论 &#x1f525;&#x1f525;&…

大模型思维链推理的进展、前沿和未来分析

大模型思维链推理的综述&#xff1a;进展、前沿和未来 "Chain of Thought Reasoning: A State-of-the-Art Analysis, Exploring New Horizons and Predicting Future Directions." 思维链推理的综述&#xff1a;进展、前沿和未来 摘要&#xff1a;思维链推理&#…

下载ffmpeg执行文件

打开网址&#xff1a;Download FFmpeg 按下面步骤操作 解压文件就可以看到ffmpeg的执行文件了&#xff0c;需要通过命令行进行使用&#xff1a; ffmpeg命令行使用参考&#xff1a; ffmpeg 常用命令-CSDN博客

Ardupilot开源无人机之Geek SDK进展2024

Ardupilot开源无人机之Geek SDK进展202501 1. 源由2. 状态3. TODO3.1 跟踪目标框3.2 onnxruntime版本3.3 CUDA 11.8版本3.4 pytorch v2.5.1版本3.5 Inference性能3.6 特定目标集Training 4. 参考资料 1. 源由 前期搭建《Ardupilot开源无人机之Geek SDK》&#xff0c;主要目的是…

【跨域问题】

跨域问题 官方概念&#xff1a; 当一个请求url的协议、域名、端口三者之间任意一个与当前页面url不同即为跨域本质来说&#xff0c;是前端请求给到后端时候&#xff0c;请求头里面&#xff0c;有一个 Origin &#xff0c;会带上 协议域名端口号等&#xff1b;后端接受到请求&…

STLG_01_19_程序设计C语言 - 总结

为了让刚上大一的大千金在IT征途中打下坚实的基础&#xff0c;闲暇之余重新梳理一遍C语言的知识结构&#xff0c;整理了一下学习C语言的纲要笔记。 IT学习首先要了解其过往、现状、未来发展趋势&#xff1b;其次要建立前、后端、应用的技术知识体系&#xff1b;还要学会具体应用…

2024网络安全运营方案概述(附实践资料合集)

以下是网络安全运营方案的详细内容&#xff1a; 一、目标与原则 目标&#xff1a;建立一套安全高效、灵活性强的网络安全运营体系&#xff0c;实现对网络安全的全面监控、防护和应急响应。原则&#xff1a; 全员参与&#xff1a;网络安全是全员共同的责任&#xff0c;所有员工…

“转移”的理解

“转移”的理解 一般情况下指令是顺序执行的&#xff0c;而在实际工程中&#xff0c;需要改变程序的执行流程。 操作符offset 用操作符offset取得标号的偏移地址

Windows搭建RTMP服务器

目录 一、Nginx-RTMP服务器搭建1、下载Nginx2、下载Nginx的RTMP扩展包3、修改配置文件4、启动服务器5、查看服务器状态6、其它ngnix命令 二、OBS推流1 、推流设置2、查看服务器状态 三、VLC拉流四、补充 本文转载自&#xff1a;Windows搭建RTMP服务器OBS推流VLC拉流_浏览器查看…

win32汇编环境,怎么进行加法运算的

;运行效果 ;win32汇编环境,怎么进行加法运算的 ;基础知识&#xff0c;重新复习一下。 ;首先需明白字节的概念。1个字节是8位&#xff0c;al和ah都是8位的&#xff0c;8位之中每位要么是0&#xff0c;要么是1&#xff0c;假如8位都是1&#xff0c;就是16进制的FF&#xff0c;也就…

跨年烟花C++代码

嘿&#xff0c;朋友们&#xff01;今天来给大家讲讲一段挺有意思的C代码呀&#xff0c;这段代码主要是用来实现一个烟花效果展示的程序哦&#xff0c;下面咱们一点点来看哈。 效果 1. 开头包含的那些头文件 #include <graphics.h> #include <conio.h> #include &…

Element-plus表单总结

表单包含输入框&#xff0c;单选框&#xff0c;下拉选择&#xff0c;多选框等用户输入的组件。输入表单&#xff0c;您可以收集、验证和提交数据。 经典表单 最基础的表单包括各种输入表单项&#xff0c;比如input、select、radio、checkbox等。 在每一个form组件中&#xff0…

[Qt] 多元素控件 | 容器类控件 | 布局管理器layout

目录 一.多元素控件 1、List Widget 【使用 ListWidget】 2、Table Widget 【使用 QTableWidget】 3、Tree Widget 【使用 QTreeWidget】 二、容器类控件 1、Group Box 【给麦当劳案例加上分组框】 2、Tab Widget 【使用标签页管理多组控件】 三、布局管理器 1、…