From e937d0111a52e2c13c50bbc3386d20a12d125899 Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期五, 06 九月 2024 10:54:54 +0800
Subject: [PATCH] 链接类型查询模板
---
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue | 5 ++
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue | 56 ++++++++++++++++-----------
2 files changed, 37 insertions(+), 24 deletions(-)
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue
index 35ac7b2..27fbae3 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue
@@ -47,7 +47,7 @@
<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-tree style="height: 265px" :data="linkTreeData" :option="treeOption" @node-drag-start="handleDragStart" @node-drag-end="handleDragEnd">
</avue-tree>
</div>
</fieldset>
@@ -562,6 +562,9 @@
// 浣跨敤 setData 鏂规硶璁剧疆鏁版嵁
ev.dataTransfer.setData('item', JSON.stringify(node.data));
},
+ handleDragEnd(draggingNode,endNode,position,ev){
+
+ }
},
}
</script>
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue
index 677e8bd..b997c17 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue
@@ -24,7 +24,7 @@
<el-button size="mini" type="danger" icon="el-icon-delete" @click="delCondition(index)" style="padding: 7px 8px"></el-button>
</div>
</div>
- <div v-else style="height: 220px;text-align: left">
+ <div v-else @drop="drop" @dragover.prevent style="height: 220px;text-align: left">
<avue-tree ref="tree" @node-drop="handleDrop" style="height: 220px" :data="treeData" :option="treeOption" @node-click="nodeClick" node-key="value"></avue-tree>
</div>
<div style="text-align: right;margin-top: 10px;">
@@ -35,6 +35,7 @@
<el-button plain size="mini" type="primary" @click="">鍙栨秷</el-button>
</div>
+ <!--淇敼鏉′欢-->
<el-dialog v-dialogDrag
:title="dialog.title"
:visible.sync="dialog.showDialog"
@@ -114,7 +115,7 @@
import basicOption from "@/util/basic-option";
import {getAllQTs} from "@/api/queryTemplate/queryDefine";
import {getCriteria} from "@/api/queryTemplate/linkTypeQuery";
-
+import {dateFormat} from "@/util/date"
export default {
name: "formQueryDialog",
props: {
@@ -374,11 +375,30 @@
nodeChild.forEach((item,index)=>{
that.treeIndex++;
if(item.column !=null && item.column != undefined){
+ const values= item.column.split(' ');
+ let inputValue='';
+ let operator='';
+ let showLabel=''
+ if(values.length>1){
+ operator=values[1];
+ if(values.length>2){
+ inputValue=values[2];
+ }
+ }
+ if(values[0].indexOf('.')!=-1){
+ const labels=values[0].split('.')
+ showLabel=labels[labels.length-1];
+ }else {
+ showLabel=values[0];
+ }
children.push({
label:item.column,
value:item.column+that.treeIndex,
type:item.type,
- valueIndex:'v'+that.treeIndex
+ valueIndex:'v'+that.treeIndex,
+ inputValue:inputValue,
+ operator:operator,
+ showLabel:showLabel
})
}else {
children.push({
@@ -437,7 +457,7 @@
}
params.type=data.atttributes.vtDataType;
this.conditionList.push(params)
- }else {debugger;
+ }else {
if (this.clickNode.label != '骞朵笖' && this.clickNode.label != '鎴栬��') {
this.$message.error('璇烽�変腑閫昏緫鏉′欢娣诲姞鏌ヨ椤�');
return;
@@ -535,24 +555,6 @@
} else if (this.clickNode.label == '鎴栬��') {
this.clickNode.label = '骞朵笖'
} else {
- const values= this.clickNode.label.split(' ');
- this.clickNode.inputValue='';
- if(values.length>1){
- this.clickNode.operator=values[1];
- if(values.length>2){
- if(['VTDateTime','VTDate','VTTime'].includes(this.clickNode.type)){
- this.clickNode.inputValue=new Date(values[2]);
- }else {
- this.clickNode.inputValue=values[2];
- }
- }
- }
- if(values[0].indexOf('.')!=-1){
- const labels=values[0].split('.')
- this.clickNode.showLabel=labels[labels.length-1];
- }else {
- this.clickNode.showLabel=values[0];
- }
this.dialog.showDialog = true;
}
} else {
@@ -608,7 +610,15 @@
//鏌ヨ鏉′欢淇濆瓨
submitDialog() {
const values= this.clickNode.label.split(' ');
- this.clickNode.label = values[0]+' '+this.clickNode.operator+' '+this.clickNode.inputValue;
+ if(['VTDateTime'].includes(this.clickNode.type)){
+ this.clickNode.label = values[0]+' '+this.clickNode.operator+' '+dateFormat(this.clickNode.inputValue);
+ }else if(['VTDate'].includes(this.clickNode.type)){
+ this.clickNode.label = values[0]+' '+this.clickNode.operator+' '+dateFormat(this.clickNode.inputValue ,'yyyy-MM-dd');
+ }else if(['VTTime'].includes(this.clickNode.type)){
+ this.clickNode.label = values[0]+' '+this.clickNode.operator+' '+dateFormat(this.clickNode.inputValue ,'hh:mm:ss');
+ }else {
+ this.clickNode.label = values[0]+' '+this.clickNode.operator+' '+this.clickNode.inputValue;
+ }
this.dialog.showDialog = false;
},
//鑾峰彇鏌ヨ妯℃澘鍒楄〃
--
Gitblit v1.9.3