| | |
| | | <el-main> |
| | | <fieldset style="margin: 0 10px"> |
| | | <legend> 查询条件 </legend> |
| | | <div style="height: 300px;"> |
| | | |
| | | </div> |
| | | <form-query-dialog style="height: 300px;"></form-query-dialog> |
| | | </fieldset> |
| | | </el-main> |
| | | <el-aside style="width:350px"> |
| | |
| | | import {linkSave} from "@/api/queryTemplate/linkTypeQuery"; |
| | | import basicOption from "@/util/basic-option"; |
| | | import {gridTemplate} from "@/api/queryTemplate/queryDefine"; |
| | | import {deleteAttributes} from "@/api/modeling/attributePool/api"; |
| | | import formQueryDialog from "./formQueryDialog.vue"; |
| | | export default { |
| | | name: "formDialog", |
| | | components:{formQueryDialog}, |
| | | data(){ |
| | | return { |
| | | dialog: { |
| | |
| | | form:{ |
| | | btmName:'', |
| | | qtName: '', |
| | | queryTemplate:{ |
| | | |
| | | } |
| | | }, |
| | | formTemplate:{ |
| | | btmName:'', |
| | | qtName: '', |
| | | queryTemplate:{ |
| | | |
| | | } |
| | | queryTemplate:{} |
| | | }, |
| | | //已有排序列表配置 |
| | | crudOption: { |
| | |
| | | }, |
| | | immediate: true, |
| | | }, |
| | | 'dialog.type': { |
| | | handler(val) { |
| | | if(val=='edit'){ |
| | | } |
| | | }, |
| | | immediate: true, |
| | | }, |
| | | }, |
| | | methods: { |
| | | openDialog(btmName, title, mode, data) { |
| | | this.dialog.title = title; |
| | | this.dialog.showDialog = true; |
| | | this.dialog.type = mode; |
| | | this.form.btmName = btmName; |
| | | this.treeData = data.treeData; |
| | | |
| | | if (data.selectData) { |
| | | this.selectData = data.selectData; |
| | | this.orderInfoList = JSON.parse(JSON.stringify(data.selectData.queryTemplate.orderInfoList));//已有排序 |
| | | this.formItems[0].disabled = true |
| | | this.form.qtName = this.selectData.qtName; |
| | | this.form.direction = this.selectData.queryTemplate.direction; |
| | | this.form.btmType = this.selectData.queryTemplate.btmType; |
| | | this.form.version = this.selectData.queryTemplate.version; |
| | | this.form.queryISLeaf = this.selectData.queryTemplate.queryISLeaf; |
| | | 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));//已有排序 |
| | | } |
| | | } else { |
| | | this.selectData = {}; |
| | | this.orderInfoList =[]; |
| | | this.orderInfoList = []; |
| | | this.formItems[0].disabled = false; |
| | | } |
| | | this.getTemp(data.treeData.label,true) |
| | | this.getTemp(data.treeData.label, true) |
| | | this.$nextTick(()=>{ |
| | | this.dialog.showDialog = true; |
| | | }); |
| | | |
| | | }, |
| | | cancelDialog() { |
| | | this.dialog.loading = false; |
| | | this.dialog.showDialog = false; |
| | | this.$nextTick(() => { |
| | | this.form = this.formTemplate; |
| | | this.form = { |
| | | btmName: '', |
| | | qtName: '', |
| | | queryTemplate: {} |
| | | }; |
| | | this.orderInfoList =[]; |
| | | this.dialog.loading = false; |
| | | this.dialog.showDialog = false; |
| | | this.$refs.form.resetFields(); |
| | | this.$refs.form.clearValidate(); |
| | | this.businessQueryDefineForm=''; |
| | | this.linkQueryDefineForm=''; |
| | | }); |
| | |
| | | submitDialog() { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | linkSave(this.form).then(res => { |
| | | if (res.success) { |
| | | let formData={ |
| | | btmName:this.form.btmName, |
| | | qtName:this.form.qtName, |
| | | 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, |
| | | queryISLeaf:this.form.queryISLeaf, |
| | | recReturnMode:1,//递归返回数据模式:1:RECRETURNMODE_FLAT, 2:RECRETURNMODE_FILTER |
| | | rightFlag:true, |
| | | secretFlag:true, |
| | | type:'link', |
| | | version:this.form.version |
| | | } |
| | | } |
| | | formData.condition=[] |
| | | linkSave(formData).then(res => { |
| | | if (res.data.success) { |
| | | this.$message.success("保存成功"); |
| | | this.cancelDialog(); |
| | | this.$emit("refresh"); |