From da4310936f073b70e64b87b842af43790d7d04e4 Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期五, 30 八月 2024 15:59:28 +0800 Subject: [PATCH] 链接类型查询模板 --- Source/plt-web/plt-web-ui/src/App.vue | 3 Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue | 3 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue | 82 +++++++++++---- Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue | 124 ++++++++++++++++++++++++ Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue | 39 ++++++- 5 files changed, 219 insertions(+), 32 deletions(-) diff --git a/Source/plt-web/plt-web-ui/src/App.vue b/Source/plt-web/plt-web-ui/src/App.vue index a19b123..0664619 100644 --- a/Source/plt-web/plt-web-ui/src/App.vue +++ b/Source/plt-web/plt-web-ui/src/App.vue @@ -48,6 +48,9 @@ .avue-dialog .el-dialog__body .avue-form{ margin: 0px auto 40px; // 鍗曠嫭缁欏璇濇閲岀殑avue琛ㄥ崟鍔犱笂涓嬭竟璺� } +.dialog-footer{ + background-color: #ffffff; +} .avue-crud .avue-form { margin: 0px auto !important; // 琛ㄦ牸鍐呯殑琛ㄥ崟锛堟瘮濡�:鎼滅储鏍忥級 鍙栨秷涓嬭竟璺� } diff --git a/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue b/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue index 8591918..33db589 100644 --- a/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue +++ b/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue @@ -191,7 +191,7 @@ showProp:item.showField, type: type, labelWidth: this.labelWidth || (item.text.length >= 6 ? 115 : 90), - disabled: !this.isEdit || item.readOnly || this.disabled, + disabled: item.readOnly || this.disabled, span: item.span ? item.span : item.type === "textarea" @@ -226,6 +226,7 @@ }; if(!this.isEdit){ col.placeholder=col.label; + col.disabled=true; } if(col.type === 'richText'){ this.subitemName = col.field; 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 6ed5d5c..9d55699 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 @@ -55,9 +55,7 @@ <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"> @@ -85,9 +83,10 @@ 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: { @@ -175,16 +174,7 @@ form:{ btmName:'', qtName: '', - queryTemplate:{ - - } - }, - formTemplate:{ - btmName:'', - qtName: '', - queryTemplate:{ - - } + queryTemplate:{} }, //宸叉湁鎺掑簭鍒楄〃閰嶇疆 crudOption: { @@ -322,31 +312,55 @@ }, 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=''; }); @@ -354,8 +368,28 @@ 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锛歊ECRETURNMODE_FLAT, 2锛歊ECRETURNMODE_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"); 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 new file mode 100644 index 0000000..b1bb218 --- /dev/null +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue @@ -0,0 +1,124 @@ +<template> + <div style="padding: 0 10px"> + <div style="text-align: center;margin-bottom: 10px"> + <avue-radio v-model="radioForm" :dic="radioDic" style="margin: 0 20px 0 0;display: inline-block"></avue-radio> + <el-button plain size="mini" type="primary" @click="clearValue">娓呯┖鍊�</el-button> + <el-button plain size="mini" type="primary" @click="delAll">鍒犻櫎鍏ㄩ儴鏉′欢</el-button> + </div> + <div v-if="radioForm==0" style="height: 220px;text-align: center;"> + <div v-for="condition in conditionList" class="el-input--small"> + <span>condition.clause</span> + <avue-select v-model="condition.operator" type="tree" :dic="operatorDic" style="width: 80px;margin: 0 5px"></avue-select> + <avue-input v-model="condition.ordinaryValue" placeholder="" style="width: 400px"></avue-input> + </div> + </div> + <div v-else style="height: 220px;text-align: left"> + <avue-tree style="height: 220px" :data="treeData" :option="treeOption"></avue-tree> + </div> + <div style="text-align: right;margin-top: 10px;"> + <el-button v-if="radioForm==1" plain size="mini" type="primary" @click="addHandler">澧炲姞閫昏緫</el-button> + <el-button v-if="radioForm==1" plain size="mini" type="primary" @click="del">淇敼鏉′欢</el-button> + <el-button v-if="radioForm==1" plain size="mini" type="primary" @click="del">鍒犻櫎</el-button> + <el-button plain size="mini" type="primary" @click="del">鏌ヨ</el-button> + <el-button plain size="mini" type="primary" @click="del">鍙栨秷</el-button> + </div> + </div> +</template> + +<script> +export default { +name: "formQueryDialog", + data() { + return { + radioForm: 0, + radioDic: [{ + label: '鏅��', + value: 0 + }, { + label: '楂樼骇', + value: 1 + }], + conditionList:[{ + clause:'OID' + }], + treeOption:{ + defaultExpandAll:true, + menu: false, + addBtn: false, + filter:false, + }, + treeData:{}, + //VTInteger銆乂TDouble銆乂TLong + operatorIntDic:[{ + label:'=', + value:'=' + },{ + label:'!=', + value:'!=' + },{ + label:'鍖呭惈', + value:'鍖呭惈' + },{ + label:'in', + value:'in' + },{ + label:'not in', + value:'not in' + },{ + label:'>=', + value:'>=' + },{ + label:'>', + value:'>' + },{ + label:'<=', + value:'<=' + },{ + label:'<', + value:'<' + }], + //VTDateTime銆乂TDate銆乂TTime + operatorTimeDic:[{ + label:'=', + value:'=' + },{ + label:'!=', + value:'!=' + },{ + label:'in', + value:'in' + },{ + label:'not in', + value:'not in' + },{ + label:'>=', + value:'>=' + },{ + label:'<=', + value:'<=' + }], + //鍏跺畠 + operatorDic:[{ + label:'=', + value:'=' + },{ + label:'!=', + value:'!=' + },{ + label:'鍖呭惈', + value:'鍖呭惈' + },{ + label:'in', + value:'in' + },{ + label:'not in', + value:'not in' + }] + } + } +} +</script> + +<style scoped> + +</style> diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue index 3fbb71a..c6d411c 100644 --- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue @@ -2,9 +2,9 @@ <el-container> <el-aside> <basic-container> - <div ref="TreeBox" style="height: calc(100vh - 154px);!important;"> + <div ref="TreeBox" style="height: calc(100vh - 164px);!important;"> <!-- 宸︿晶鏍� --> - <div style="height: calc(100vh - 190px);"> + <div style="height: calc(100vh - 200px);"> <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick"> <span slot-scope="{ node, data }" class="el-tree-node__label"> <span style="font-size: 15px"> @@ -35,16 +35,12 @@ <form-dialog ref="formRef" @refresh="getTemp"></form-dialog> </basic-container> </el-main> - <div style="width: 300px;">111</div> </el-container> </template> <script> import {gridLink} from "@/api/modeling/linkType/api"; -import { gridTemplate, saveTemplate, updateTemplate} from "@/api/queryTemplate/queryDefine"; import {getObjTypeQTs,deleteLinkTemplate} from "@/api/queryTemplate/linkTypeQuery"; -import func from "@/util/func"; -import {dateFormat} from "@/util/date"; import basicOption from "@/util/basic-option"; import FormDialog from "./formDialog.vue" @@ -120,6 +116,34 @@ formatter:function (row, value) { return row.queryTemplate.btmType; } + }, { + label: '鐗堟湰鐗堟', + prop: 'version', + formatter:function (row, value) { + if(row.queryTemplate.version==1){ + return '褰撳墠鐗堟湰褰撳墠鐗堟' + }else if(row.queryTemplate.version==2){ + return '褰撳墠鐗堟湰鏈�鏂扮増娆�' + }else if(row.queryTemplate.version==3){ + return '鏈�鏂扮増鏈渶鏂扮増娆�' + }else if(row.queryTemplate.version==7){ + return '宸插彂甯冪殑鏈�鏂扮増鏈�' + }else { + return '' + } + } + }, { + label: '鏌ヨ鏄惁鏈変笅绾�', + prop: 'queryISLeaf', + formatter:function (row, value) { + return row.queryTemplate.queryISLeaf + } + }, { + label: '瀛愯妭鐐瑰眰娆℃暟', + prop: 'level', + formatter:function (row, value) { + return row.queryTemplate.level; + } }] }, selectionRow: [], @@ -194,9 +218,10 @@ let names=this.selectionRow.map(item=>{ return item.qtName }) - deleteLinkTemplate(names).then(res => { + deleteLinkTemplate({names:names.join(',')}).then(res => { if (res.data.code === 200) { this.$message.success(res.data.obj); + this.getTemp(); } }) }).catch(() => { -- Gitblit v1.9.3