From bf47eaf837af3c6bbe00265972dcd55cec9032d7 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期二, 22 十月 2024 10:27:41 +0800
Subject: [PATCH] 整合代码
---
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue | 93 +++++++++++++++++++++++++++-------------------
1 files changed, 54 insertions(+), 39 deletions(-)
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue
index 696107f..f30d66c 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue
@@ -60,6 +60,7 @@
:queryCondition="queryCondition"
:queryTree="queryTree"
:levelFlag.sync="form.levelFlag"
+ @queryHandler="queryHandler"
></form-query-dialog>
</fieldset>
</el-main>
@@ -73,11 +74,10 @@
</template>
<script>
-import {getAllOrderbyAttributeByLink} from "@/api/modeling/linkType/api";
-import {linkSave} from "@/api/queryTemplate/linkTypeQuery";
+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},
@@ -127,7 +127,14 @@
prop: 'orderField'
}, {
label: '鎺掑簭鏂瑰紡',
- prop: 'orderMode'
+ prop: 'orderMode',
+ formatter:function (row, value) {
+ if (row.orderMode == 'ASC') {
+ return '鍗囧簭'
+ }else{
+ return '闄嶅簭'
+ }
+ }
}, {
label: '浼樺厛绾�',
prop: 'level'
@@ -195,9 +202,18 @@
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:[],//涓氬姟绫诲瀷鏌ヨ妯℃澘瀹氫箟涓嬫媺鏁版嵁
@@ -221,7 +237,6 @@
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));//宸叉湁鎺掑簭
}
@@ -238,7 +253,9 @@
};
}
this.dialog.showDialog = true;
- this.getTemp(data.treeData.label, true)
+ this.treeOption.defaultExpandedKeys=[data.treeData.label]
+ this.getTemp(data.treeData.label)
+ this.getAllAttr();
},
cancelDialog() {
this.dialog.loading = false;
@@ -261,7 +278,7 @@
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();
@@ -281,16 +298,7 @@
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锛歊ECRETURNMODE_FLAT, 2锛歊ECRETURNMODE_FILTER
- rightFlag: true,
- secretFlag: true,
- type: 'link',
- version: this.form.version
}
}
if (formData.levelFlag == 1) {
@@ -342,16 +350,14 @@
},
//鑾峰彇鎺掑簭璁剧疆涓墍鏈夋帓搴忓瓧娈�
getAllAttr() {
- getAllOrderbyAttributeByLink({
- name: this.treeData.label,
- btmType: this.form.btmType,
- direction: this.form.direction
+ getBizTypeQTDs({
+ btmName: this.treeData.label
}).then(res => {
const orderInfoStr = JSON.stringify(this.orderInfoList);
const dicData = [];
res.data.data.forEach(item => {
- if (orderInfoStr.indexOf('"orderField":"' + item + '"') == -1) {
- dicData.push({id: item});
+ if (orderInfoStr.indexOf('"orderField":"' + item.id + '"') == -1) {
+ dicData.push(item);
}
})
this.tableFormOption.column[0].dicData=dicData;
@@ -382,33 +388,24 @@
})
},
//鑾峰彇鏌ヨ妯℃澘瀹氫箟涓嬫媺
- getTemp(btmName,linkFlag) {
+ 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
}]
}
},
@@ -424,7 +421,25 @@
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>
--
Gitblit v1.9.3