| | |
| | | :queryCondition="queryCondition" |
| | | :queryTree="queryTree" |
| | | :levelFlag.sync="form.levelFlag" |
| | | @queryHandler="queryHandler" |
| | | ></form-query-dialog> |
| | | </fieldset> |
| | | </el-main> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {linkSave,getBizTypeQTDs} from "@/api/queryTemplate/businessTypeQuery"; |
| | | import {btmSave,getBizTypeQTDs,getCriteriaBtm} from "@/api/queryTemplate/businessTypeQuery"; |
| | | import basicOption from "@/util/basic-option"; |
| | | import {queryTemplateListByAttr} from "@/api/queryTemplate/queryDefine"; |
| | | import formQueryDialog from "./formQueryDialog.vue"; |
| | | import formQueryDialog from "@/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue"; |
| | | export default { |
| | | name: "formDialog", |
| | | components:{formQueryDialog}, |
| | |
| | | allowDrop: () => { |
| | | return false; |
| | | }, |
| | | allowDrag: () => { |
| | | return true; |
| | | allowDrag: (dropNode) => { |
| | | if (dropNode.data.attrs && dropNode.data.attrs.length>0) { |
| | | return false; |
| | | } else { |
| | | return true; |
| | | } |
| | | }, |
| | | props:{ |
| | | label:'name', |
| | | value:'name', |
| | | children:'attrs' |
| | | } |
| | | }, |
| | | businessQueryDefineForm:'',//业务类型查询模板定义选中值 |
| | | businessQueryDefineDic:[],//业务类型查询模板定义下拉数据 |
| | |
| | | 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.dialog.showDialog = true; |
| | | this.treeOption.defaultExpandedKeys=[data.treeData.label] |
| | | this.getTemp(data.treeData.label) |
| | | this.getAllAttr(); |
| | | }, |
| | |
| | | if (valid) { |
| | | const formData=this.initFormData(); |
| | | console.log(formData) |
| | | linkSave(formData).then(res => { |
| | | btmSave(formData).then(res => { |
| | | if (res.data.success) { |
| | | this.$message.success("保存成功"); |
| | | this.cancelDialog(); |
| | |
| | | qtName: this.form.qtName, |
| | | levelFlag: this.form.levelFlag, |
| | | queryTemplate: { |
| | | clauseList: ['*'], |
| | | direction: this.form.direction, |
| | | id: this.form.qtName, |
| | | linkType: this.form.btmName, |
| | | orderInfoList: this.orderInfoList, |
| | | recReturnMode: 1,//递归返回数据模式:1:RECRETURNMODE_FLAT, 2:RECRETURNMODE_FILTER |
| | | rightFlag: true, |
| | | secretFlag: true, |
| | | type: 'link', |
| | | version: this.form.version |
| | | } |
| | | } |
| | | if (formData.levelFlag == 1) { |
| | |
| | | }, |
| | | // 行删除 |
| | | rowDeleteHandler(data) { |
| | | debugger; |
| | | this.orderInfoList.splice(data.index,1); |
| | | this.orderFieldList.unshift({ |
| | | id: data.row.orderField |
| | |
| | | //获取查询模板定义下拉 |
| | | getTemp(btmName) { |
| | | if (btmName) { |
| | | queryTemplateListByAttr({btmName: btmName}).then(res => { |
| | | queryTemplateListByAttr({btmName: btmName,linkFlag:false}).then(res => { |
| | | const data = res.data.data.map(item => { |
| | | item.label = item.name + '-' + (item.linkTypeName || item.btmName); |
| | | item.label = item.name + '-' + item.btmName; |
| | | item.value = item.name; |
| | | return item; |
| | | }); |
| | | this.businessQueryDefineDic=data; |
| | | data.length>0 && (this.businessQueryDefineForm= data[0].value); |
| | | |
| | | }) |
| | | } |
| | | }, |
| | | businessQueryDefineChange(data) { |
| | | if (data.value) { |
| | | const childData = data.item.attrs.map(item => { |
| | | return { |
| | | label: item.name, |
| | | value: item.name, |
| | | atttributes:item |
| | | }; |
| | | }); |
| | | this.businessTreeData = [{ |
| | | label: data.value, |
| | | value: data.value, |
| | | children: childData |
| | | name: data.value, |
| | | attrs: data.item.attrs |
| | | }] |
| | | } |
| | | }, |
| | |
| | | if(this.form.levelFlag==1) { |
| | | this.$refs.formQuery.$refs.tree.$emit('tree-node-drag-end', ev); |
| | | } |
| | | } |
| | | }, |
| | | //查询 |
| | | queryHandler(){ |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | this.$refs.formQuery.queryResultDialog.loading=true; |
| | | const formData=this.initFormData(); |
| | | getCriteriaBtm(formData).then(res => { |
| | | if (res.data.success) { |
| | | this.resultData=res.data.data; |
| | | this.$refs.formQuery.queryResultDialog.showDialog=true; |
| | | this.$refs.formQuery.queryResultDialog.loading=false; |
| | | } |
| | | }); |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | }, |
| | | } |
| | | </script> |