| | |
| | | <el-container style="margin-top: 10px;"> |
| | | <el-aside style="width:350px"> |
| | | <fieldset> |
| | | <legend> 链接类型候选条件 </legend> |
| | | <legend> 候选条件 </legend> |
| | | <div> |
| | | 查询模板定义 |
| | | <avue-select @change="linkQueryDefineChange" class="el-input--small" v-model="linkQueryDefineForm" placeholder="请选择内容" type="tree" :dic="linkQueryDefineDic" style="width:240px"></avue-select> |
| | | <avue-tree style="height: 265px" :data="linkTreeData" :option="treeOption" @node-drag-start="handleDragStart"> |
| | | <avue-select @change="businessQueryDefineChange" class="el-input--small" v-model="businessQueryDefineForm" placeholder="请选择内容" type="tree" :dic="businessQueryDefineDic" style="width: 240px;"></avue-select> |
| | | <avue-tree style="height: 265px" :data="businessTreeData" :option="treeOption" @node-drag-start="handleDragStart" @node-drag-end="handleDragEnd"> |
| | | </avue-tree> |
| | | </div> |
| | | </fieldset> |
| | |
| | | ></form-query-dialog> |
| | | </fieldset> |
| | | </el-main> |
| | | <el-aside style="width:350px"> |
| | | <fieldset> |
| | | <legend> 业务类型候选条件 </legend> |
| | | <div> |
| | | 查询模板定义 |
| | | <avue-select @change="businessQueryDefineChange" class="el-input--small" v-model="businessQueryDefineForm" placeholder="请选择内容" type="tree" :dic="businessQueryDefineDic" style="width: 240px;"></avue-select> |
| | | <avue-tree style="height: 265px" :data="businessTreeData" :option="treeOption" @node-drag-start="handleDragStart"> |
| | | </avue-tree> |
| | | </div> |
| | | </fieldset> |
| | | </el-aside> |
| | | </el-container> |
| | | </div> |
| | | <div class="dialog-footer avue-dialog__footer"> |
| | |
| | | return true; |
| | | }, |
| | | }, |
| | | linkQueryDefineForm:'',//链接类型查询模板定义选中值 |
| | | linkQueryDefineDic:[],//链接类型查询模板定义下拉数据 |
| | | //链接类型查询模板定义选中项属性 |
| | | linkTreeData: [], |
| | | businessQueryDefineForm:'',//业务类型查询模板定义选中值 |
| | | businessQueryDefineDic:[],//业务类型查询模板定义下拉数据 |
| | | //业务类型查询模板定义选中项属性 |
| | |
| | | queryTree:{}, |
| | | //普通查询条件 |
| | | queryCondition:[], |
| | | |
| | | }; |
| | | }, |
| | | watch: { |
| | | //方向 |
| | | 'form.direction': { |
| | | handler(val) { |
| | | if(val=='positive'){ |
| | | //正向 |
| | | const dicData=this.treeData.btmItemsTo.map(item=>{ |
| | | return { |
| | | label: item, |
| | | value: item |
| | | } |
| | | }) |
| | | dicData.push({ |
| | | label: '所有类型', |
| | | value: '*' |
| | | }) |
| | | this.$refs.form.updateDic('btmType', dicData); |
| | | this.form.btmType=dicData[0].value |
| | | this.getAllAttr(); |
| | | }else if(val=='opposite'){ |
| | | //反向 |
| | | const dicData=this.treeData.btmItemsFrom.map(item=>{ |
| | | return { |
| | | label: item, |
| | | value: item |
| | | } |
| | | }) |
| | | dicData.push({ |
| | | label: '所有类型', |
| | | value: '*' |
| | | }) |
| | | this.$refs.form.updateDic('btmType', dicData); |
| | | this.form.btmType=dicData[0].value |
| | | this.getAllAttr(); |
| | | } |
| | | }, |
| | | immediate: true, |
| | | }, |
| | | //业务类型 |
| | | 'form.btmType': { |
| | | handler(val) { |
| | | if(val && val!='*'){ |
| | | this.getTemp(val,false); |
| | | } |
| | | }, |
| | | immediate: true, |
| | | } |
| | | }, |
| | | methods: { |
| | | openDialog(btmName, title, mode, data) { |
| | |
| | | if (data.selectData) { |
| | | this.selectData = data.selectData; |
| | | this.form.qtName = this.selectData.qtName; |
| | | this.form.level = this.selectData.queryTemplate.level; |
| | | if (data.selectData.queryTemplate.orderInfoList && data.selectData.queryTemplate.orderInfoList.length > 0) { |
| | | this.orderInfoList = JSON.parse(JSON.stringify(data.selectData.queryTemplate.orderInfoList));//已有排序 |
| | | } |
| | |
| | | this.$message.success("保存成功"); |
| | | this.cancelDialog(); |
| | | this.$emit("refresh"); |
| | | }else { |
| | | this.$refs.form.clearValidate(); |
| | | } |
| | | }); |
| | | } else { |
| | |
| | | qtName: this.form.qtName, |
| | | levelFlag: this.form.levelFlag, |
| | | queryTemplate: { |
| | | btmType: this.form.btmType, |
| | | clauseList: ['*'], |
| | | direction: this.form.direction, |
| | | id: this.form.qtName, |
| | | level: this.form.level, |
| | | linkType: this.form.btmName, |
| | | orderInfoList: this.orderInfoList, |
| | | recReturnMode: 1,//递归返回数据模式:1:RECRETURNMODE_FLAT, 2:RECRETURNMODE_FILTER |
| | |
| | | //获取查询模板定义下拉 |
| | | getTemp(btmName,linkFlag) { |
| | | if (btmName) { |
| | | queryTemplateListByAttr({btmName: btmName, linkFlag: linkFlag,direction:this.form.direction}).then(res => { |
| | | queryTemplateListByAttr({btmName: btmName}).then(res => { |
| | | const data = res.data.data.map(item => { |
| | | item.label = item.name + '-' + (item.linkTypeName || item.btmName); |
| | | item.value = item.name; |
| | | return item; |
| | | }); |
| | | if(linkFlag){ |
| | | this.linkQueryDefineDic=data |
| | | data.length>0 && (this.linkQueryDefineForm=data[0].value); |
| | | }else { |
| | | this.businessQueryDefineDic=data; |
| | | data.length>0 && (this.businessQueryDefineForm= data[0].value); |
| | | } |
| | | |
| | | }) |
| | | } |
| | | }, |
| | | linkQueryDefineChange(data) { |
| | | if (data.value) { |
| | | const childData = data.item.attrs.map(item => { |
| | | return { |
| | | label: item.name, |
| | | value: item.name, |
| | | atttributes:item |
| | | }; |
| | | }); |
| | | this.linkTreeData = [{ |
| | | label: data.value, |
| | | value: data.value, |
| | | children: childData |
| | | }] |
| | | } |
| | | }, |
| | | businessQueryDefineChange(data) { |
| | |
| | | handleDragStart(node, ev) { |
| | | // 使用 setData 方法设置数据 |
| | | ev.dataTransfer.setData('item', JSON.stringify(node.data)); |
| | | if(this.form.levelFlag==1){ |
| | | this.$refs.formQuery.$refs.tree.$emit('tree-node-drag-start', ev,{node:this.$refs.formQuery.initItem(node)}); |
| | | } |
| | | }, |
| | | handleDragEnd(draggingNode,endNode,position,ev){ |
| | | if(this.form.levelFlag==1) { |
| | | this.$refs.formQuery.$refs.tree.$emit('tree-node-drag-end', ev); |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | </script> |