| | |
| | | import request from '@/router/axios'; |
| | | //ä¸å¡ç±»åæ¥è¯¢æ¨¡æ¿ |
| | | // å建 |
| | | export function linkSave(params) { |
| | | export function btmSave(params) { |
| | | return request({ |
| | | url: "/api/templateController/linkSave", |
| | | url: "/api/templateController/btmSave", |
| | | method: "post", |
| | | data:params |
| | | }); |
| | |
| | | }); |
| | | } |
| | | // æ¥è¯¢æ¡ä»¶çæ¥è¯¢æ¥å£ï¼æ¥å£æ¹å¼POSTï¼åæ°ä¸ä¿åæ¥å£ä¼ åä¸è´ |
| | | export function getCriteria(params) { |
| | | export function getCriteriaBtm(params) { |
| | | return request({ |
| | | url: "/api/templateController/getCriteria", |
| | | url: "/api/templateController/getCriteriaBtm", |
| | | method: "post", |
| | | data:params |
| | | }); |
| | |
| | | :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> |
| | |
| | | :queryCondition="queryCondition" |
| | | :queryTree="queryTree" |
| | | :levelFlag.sync="form.levelFlag" |
| | | @queryHandler="queryHandler" |
| | | ></form-query-dialog> |
| | | </fieldset> |
| | | </el-main> |
| | |
| | | |
| | | <script> |
| | | import {getAllOrderbyAttributeByLink} from "@/api/modeling/linkType/api"; |
| | | import {linkSave} from "@/api/queryTemplate/linkTypeQuery"; |
| | | import {linkSave,getCriteria} from "@/api/queryTemplate/linkTypeQuery"; |
| | | import basicOption from "@/util/basic-option"; |
| | | import {queryTemplateListByAttr} from "@/api/queryTemplate/queryDefine"; |
| | | import formQueryDialog from "./formQueryDialog.vue"; |
| | |
| | | addBtn: false, |
| | | filter:false, |
| | | draggable: true, |
| | | allowDrop: () => { |
| | | allowDrop: (node) => { |
| | | 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' |
| | | } |
| | | }, |
| | | linkQueryDefineForm:'',//龿¥ç±»åæ¥è¯¢æ¨¡æ¿å®ä¹éä¸å¼ |
| | | linkQueryDefineDic:[],//龿¥ç±»åæ¥è¯¢æ¨¡æ¿å®ä¹ä¸ææ°æ® |
| | |
| | | }; |
| | | } |
| | | this.dialog.showDialog = true; |
| | | this.treeOption.defaultExpandedKeys=[data.treeData.label] |
| | | this.getTemp(data.treeData.label, true) |
| | | |
| | | }, |
| | | cancelDialog() { |
| | | this.dialog.loading = false; |
| | |
| | | }, |
| | | 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 |
| | | name: data.value, |
| | | attrs: data.item.attrs |
| | | }] |
| | | } |
| | | }, |
| | | 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(); |
| | | getCriteria(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> |
| | |
| | | <el-button size="small" @click="cancleQueryDialog">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <!--æ¥è¯¢--> |
| | | <el-dialog v-dialogDrag |
| | | :title="queryResultDialog.title" |
| | | :visible.sync="queryResultDialog.showDialog" |
| | |
| | | class="avue-dialog" |
| | | :destroy-on-close="true" |
| | | :close-on-click-modal="false" |
| | | @close="queryResultDialog.showDialog='false'"> |
| | | @close="queryResultDialog.showDialog=false"> |
| | | <div class="el-input--small"> |
| | | <avue-crud ref="crud" :data="resultData" :option="resultOption" |
| | | :table-loading="queryResultDialog.loading"> |
| | |
| | | const data = JSON.parse(event.dataTransfer.getData('item')); |
| | | if (this.radioForm == 0) { |
| | | const params = { |
| | | clause: data.value, |
| | | clause: data.name, |
| | | operator: '=', |
| | | ordinaryValue: '' |
| | | } |
| | | if (data.atttributes.vtDataType == 'VTInteger' || data.atttributes.vtDataType == 'VTDouble' || data.atttributes.vtDataType == 'VTLong') { |
| | | if (data.vtDataType == 'VTInteger' || data.vtDataType == 'VTDouble' || data.vtDataType == 'VTLong') { |
| | | params.operatorDic =JSON.parse(JSON.stringify(this.operatorIntDic)) ; |
| | | } else if (data.atttributes.vtDataType == 'VTDateTime' || data.atttributes.vtDataType == 'VTDate' || data.atttributes.vtDataType == 'VTTime') { |
| | | } else if (data.vtDataType == 'VTDateTime' || data.vtDataType == 'VTDate' || data.vtDataType == 'VTTime') { |
| | | params.operatorDic = JSON.parse(JSON.stringify(this.operatorDateDic)) |
| | | } else { |
| | | params.operatorDic = JSON.parse(JSON.stringify(this.operatorDic)) |
| | | } |
| | | params.type=data.atttributes.vtDataType; |
| | | params.type=data.vtDataType; |
| | | this.conditionList.push(params) |
| | | }else { |
| | | if (this.clickNode.label != 'å¹¶ä¸' && this.clickNode.label != 'æè
') { |
| | |
| | | initItem(data){ |
| | | this.treeIndex++; |
| | | let item={ |
| | | label: data.value, |
| | | value: data.value + this.treeIndex, |
| | | label: data.name, |
| | | value: data.name + this.treeIndex, |
| | | valueIndex: 'v' + this.treeIndex, |
| | | type:data.vtDataType, |
| | | children: [], |
| | | inputValue:data.value, |
| | | inputValue:'', |
| | | operator:'=', |
| | | showLabel:data.value |
| | | showLabel:data.name |
| | | }; |
| | | let showLabel=''; |
| | | if(data.value.indexOf('.')!=-1){ |
| | | const labels=data.value.split('.') |
| | | if(data.name.indexOf('.')!=-1){ |
| | | const labels=data.name.split('.') |
| | | showLabel=labels[labels.length-1]; |
| | | }else { |
| | | showLabel=data.value; |
| | | showLabel=data.name; |
| | | } |
| | | item.showLabel=showLabel; |
| | | return item |
| | |
| | | }, |
| | | //æ¥è¯¢ |
| | | queryHandler(){ |
| | | this.$parent.$parent.$parent.$parent.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | this.queryResultDialog.loading=true; |
| | | const formData=this.$parent.$parent.$parent.$parent.initFormData(); |
| | | getCriteria(formData).then(res => { |
| | | if (res.data.success) { |
| | | this.resultData=res.data.data; |
| | | this.queryResultDialog.showDialog=true; |
| | | this.queryResultDialog.loading=false; |
| | | } |
| | | }); |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | this.$emit('queryHandler'); |
| | | }, |
| | | //éæ©æ¥è¯¢æ¨¡æ¿ |
| | | checkTemp(index) { |