From 8c107924ebc49105fa81f13f972f1710b42c1503 Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期五, 01 十一月 2024 17:30:20 +0800 Subject: [PATCH] 首页样式修改 --- Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue | 202 +++++++++++++++++++++++++++----------------------- 1 files changed, 110 insertions(+), 92 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 f30d66c..1f4d2ec 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 @@ -1,23 +1,23 @@ <template> <el-dialog v-dialogDrag + :append-to-body="true" + :close-on-click-modal="false" + :destroy-on-close="true" :title="dialog.title" :visible.sync="dialog.showDialog" - width="1620px" - :append-to-body="true" class="avue-dialog" - :destroy-on-close="true" - :close-on-click-modal="false" + width="1620px" @close="cancelDialog"> <div style="min-height: 665px;max-height: 85vh;padding-bottom: 50px;"> - <basic-form key="linkQueryForm" style="margin-bottom: 0" - ref="form" - :span="4" - :formItems="formItems" + <basic-form key="linkQueryForm" ref="form" :formData="form" + :formItems="formItems" + :span="4" + style="margin-bottom: 0" @getFormData="getFormData"> </basic-form> - <avue-crud ref="crud" title="璁剧疆鎺掑簭" - :data="orderInfoList" :option="crudOption"> + <avue-crud ref="crud" :data="orderInfoList" + :option="crudOption" title="璁剧疆鎺掑簭"> <template slot="menuLeft" slot-scope="scope"> <el-button icon="el-icon-plus" size="small" type="primary" @click="addRow">鍒涘缓</el-button> </template> @@ -27,17 +27,17 @@ </template> </avue-crud> <el-dialog v-dialogDrag - title="鍒涘缓" - :visible.sync="crudDialog.showDialog" - width="500px" :append-to-body="true" - class="avue-dialog" - :destroy-on-close="true" :close-on-click-modal="false" + :destroy-on-close="true" + :visible.sync="crudDialog.showDialog" + class="avue-dialog" + title="鍒涘缓" + width="500px" @close="crudDialog.showDialog=false"> - <avue-form ref="tableForm" :option="tableFormOption" v-model="tableForm"></avue-form> + <avue-form ref="tableForm" v-model="tableForm" :option="tableFormOption"></avue-form> <div class="dialog-footer avue-dialog__footer"> - <el-button type="primary" plain size="small" @click="rowSave" >淇� 瀛�</el-button> + <el-button plain size="small" type="primary" @click="rowSave">淇� 瀛�</el-button> </div> </el-dialog> <el-container style="margin-top: 10px;"> @@ -46,8 +46,11 @@ <legend> 鍊欓�夋潯浠� </legend> <div> 鏌ヨ妯℃澘瀹氫箟 - <avue-select @change="businessQueryDefineChange" class="el-input--small" v-model="businessQueryDefineForm" placeholder="璇烽�夋嫨鍐呭" type="tree" :dic="businessQueryDefineDic" style="width: 240px;"></avue-select> - <avue-tree style="height: 265px" :data="businessTreeData" :option="treeOption" @node-drag-start="handleDragStart" @node-drag-end="handleDragEnd"> + <avue-select v-model="businessQueryDefineForm" :dic="businessQueryDefineDic" class="el-input--small" + placeholder="璇烽�夋嫨鍐呭" style="width: 240px;" type="tree" + @change="businessQueryDefineChange"></avue-select> + <avue-tree :data="businessTreeData" :option="treeOption" style="height: 265px" + @node-drag-start="handleDragStart" @node-drag-end="handleDragEnd"> </avue-tree> </div> </fieldset> @@ -56,10 +59,10 @@ <fieldset style="margin: 0 10px"> <legend> 鏌ヨ鏉′欢 </legend> <form-query-dialog ref="formQuery" - style="height: 300px;" + :levelFlag.sync="form.levelFlag" :queryCondition="queryCondition" :queryTree="queryTree" - :levelFlag.sync="form.levelFlag" + style="height: 300px;" @queryHandler="queryHandler" ></form-query-dialog> </fieldset> @@ -67,21 +70,22 @@ </el-container> </div> <div class="dialog-footer avue-dialog__footer"> - <el-button type="primary" plain size="small" @click="submitDialog" >淇� 瀛�</el-button> + <el-button plain size="small" type="primary" @click="submitDialog">淇� 瀛�</el-button> <el-button size="small" @click="cancelDialog">鍙� 娑�</el-button> </div> </el-dialog> </template> <script> -import {btmSave,getBizTypeQTDs,getCriteriaBtm} 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 "@/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue"; + export default { name: "formDialog", - components:{formQueryDialog}, - data(){ + components: {formQueryDialog}, + data() { return { dialog: { showDialog: false, @@ -96,22 +100,22 @@ submitTxt: "淇濆瓨", submitIcon: "el-icon-check", }, - formItems:[{ + formItems: [{ label: '鏌ヨ妯℃澘鍚嶇О', prop: 'qtName', type: 'input', - span:5, + span: 5, rules: [{ required: true, message: "璇疯緭鍏ユ煡璇㈡ā鏉垮悕绉�", trigger: "blur" }] }], - form:{ - btmName:'', + form: { + btmName: '', qtName: '', - levelFlag:0,//0:鏅�氭煡璇㈡ā鏉�; 1:楂樼骇鏌ヨ妯℃澘" - queryTemplate:{} + levelFlag: 0,//0:鏅�氭煡璇㈡ā鏉�; 1:楂樼骇鏌ヨ妯℃澘" + queryTemplate: {} }, //宸叉湁鎺掑簭鍒楄〃閰嶇疆 crudOption: { @@ -128,10 +132,10 @@ }, { label: '鎺掑簭鏂瑰紡', prop: 'orderMode', - formatter:function (row, value) { + formatter: function (row, value) { if (row.orderMode == 'ASC') { return '鍗囧簭' - }else{ + } else { return '闄嶅簭' } } @@ -141,25 +145,25 @@ }] }, //宸叉湁鎺掑簭 - orderInfoList:[], + orderInfoList: [], //璁剧疆鎺掑簭寮圭獥琛ㄥ崟鏁版嵁 - tableForm:{ - orderField:'', - orderMode:'ASC', - level:'' + tableForm: { + orderField: '', + orderMode: 'ASC', + level: '' }, //璁剧疆鎺掑簭寮圭獥鎵�鏈夊彲鎺掑簭瀛楁 - orderFieldList:[], + orderFieldList: [], //璁剧疆鎺掑簭寮圭獥琛ㄥ崟閰嶇疆 tableFormOption: { menuBtn: false, submitBtn: false, emptyBtn: false, - span:24, + span: 24, column: [{ label: '鎺掑簭瀛楁', prop: 'orderField', - type:'select', + type: 'select', props: { label: 'id', value: 'id' @@ -185,7 +189,7 @@ label: '浼樺厛绾�', prop: 'level', type: 'number', - min:1, + min: 1, rules: [{ required: true, message: "璇疯緭鍏ヤ紭鍏堢骇", @@ -193,40 +197,39 @@ }] }] }, - treeOption:{ - defaultExpandAll:true, + treeOption: { + defaultExpandAll: true, menu: false, addBtn: false, - filter:false, + filter: false, draggable: true, allowDrop: () => { return false; }, allowDrag: (dropNode) => { - if (dropNode.data.attrs && dropNode.data.attrs.length>0) { + if (dropNode.data.attrs && dropNode.data.attrs.length > 0) { return false; } else { return true; } }, - props:{ - label:'name', - value:'name', - children:'attrs' + props: { + label: 'name', + value: 'name', + children: 'attrs' } }, - businessQueryDefineForm:'',//涓氬姟绫诲瀷鏌ヨ妯℃澘瀹氫箟閫変腑鍊� - businessQueryDefineDic:[],//涓氬姟绫诲瀷鏌ヨ妯℃澘瀹氫箟涓嬫媺鏁版嵁 + businessQueryDefineForm: '',//涓氬姟绫诲瀷鏌ヨ妯℃澘瀹氫箟閫変腑鍊� + businessQueryDefineDic: [],//涓氬姟绫诲瀷鏌ヨ妯℃澘瀹氫箟涓嬫媺鏁版嵁 //涓氬姟绫诲瀷鏌ヨ妯℃澘瀹氫箟閫変腑椤瑰睘鎬� businessTreeData: [], //楂樼骇鏌ヨ鏉′欢 - queryTree:{}, + queryTree: {}, //鏅�氭煡璇㈡潯浠� - queryCondition:[], + queryCondition: [], }; }, - watch: { - }, + watch: {}, methods: { openDialog(btmName, title, mode, data) { this.dialog.title = title; @@ -240,20 +243,20 @@ if (data.selectData.queryTemplate.orderInfoList && data.selectData.queryTemplate.orderInfoList.length > 0) { this.orderInfoList = JSON.parse(JSON.stringify(data.selectData.queryTemplate.orderInfoList));//宸叉湁鎺掑簭 } - this.queryCondition=this.selectData.queryTemplate.condition; - this.queryTree=this.selectData.tree; - this.form.levelFlag=this.selectData.levelFlag; + this.queryCondition = this.selectData.queryTemplate.condition; + this.queryTree = this.selectData.tree; + this.form.levelFlag = this.selectData.levelFlag; } else { this.selectData = {}; this.orderInfoList = []; - this.queryCondition=[]; - this.queryTree={ - connector:'骞朵笖', - child:[] + this.queryCondition = []; + this.queryTree = { + connector: '骞朵笖', + child: [] }; } this.dialog.showDialog = true; - this.treeOption.defaultExpandedKeys=[data.treeData.label] + this.treeOption.defaultExpandedKeys = [data.treeData.label] this.getTemp(data.treeData.label) this.getAllAttr(); }, @@ -264,26 +267,26 @@ this.form = { btmName: '', qtName: '', - levelFlag:0, + levelFlag: 0, queryTemplate: {} }; - this.orderInfoList =[]; - this.businessQueryDefineForm=''; - this.linkQueryDefineForm=''; + this.orderInfoList = []; + this.businessQueryDefineForm = ''; + this.linkQueryDefineForm = ''; this.$refs.form.clearValidate(); }); }, submitDialog() { this.$refs.form.validate((valid) => { if (valid) { - const formData=this.initFormData(); + const formData = this.initFormData(); console.log(formData) btmSave(formData).then(res => { if (res.data.success) { this.$message.success("淇濆瓨鎴愬姛"); this.cancelDialog(); this.$emit("refresh"); - }else { + } else { this.$refs.form.clearValidate(); } }); @@ -304,6 +307,7 @@ if (formData.levelFlag == 1) { //楂樼骇 let that = this; + function initValue(nodeChild) { let children = []; if (nodeChild) { @@ -342,11 +346,11 @@ }, // 琛屽垹闄� rowDeleteHandler(data) { - this.orderInfoList.splice(data.index,1); + this.orderInfoList.splice(data.index, 1); this.orderFieldList.unshift({ id: data.row.orderField }); - this.tableFormOption.column[0].dicData= this.orderFieldList + this.tableFormOption.column[0].dicData = this.orderFieldList }, //鑾峰彇鎺掑簭璁剧疆涓墍鏈夋帓搴忓瓧娈� getAllAttr() { @@ -360,16 +364,16 @@ dicData.push(item); } }) - this.tableFormOption.column[0].dicData=dicData; - this.orderFieldList=dicData; + this.tableFormOption.column[0].dicData = dicData; + this.orderFieldList = dicData; }) }, //鎺掑簭璁剧疆淇濆瓨 rowSave() { this.$refs.tableForm.validate((valid) => { - if(valid){ + if (valid) { this.orderInfoList.push(JSON.parse(JSON.stringify(this.tableForm))); - this.crudDialog.showDialog=false; + this.crudDialog.showDialog = false; const orderInfoStr = JSON.stringify(this.orderInfoList); const dicData = []; this.orderFieldList.forEach(item => { @@ -377,9 +381,9 @@ dicData.push(item); } }) - this.tableFormOption.column[0].dicData=dicData; - this.orderFieldList=dicData; - this.tableForm= { + this.tableFormOption.column[0].dicData = dicData; + this.orderFieldList = dicData; + this.tableForm = { orderField: '', orderMode: 'ASC', level: '' @@ -390,14 +394,14 @@ //鑾峰彇鏌ヨ妯℃澘瀹氫箟涓嬫媺 getTemp(btmName) { if (btmName) { - queryTemplateListByAttr({btmName: btmName,linkFlag:false}).then(res => { + queryTemplateListByAttr({btmName: btmName, linkFlag: false}).then(res => { const data = res.data.data.map(item => { item.label = item.name + '-' + item.btmName; item.value = item.name; return item; }); - this.businessQueryDefineDic=data; - data.length>0 && (this.businessQueryDefineForm= data[0].value); + this.businessQueryDefineDic = data; + data.length > 0 && (this.businessQueryDefineForm = data[0].value); }) } }, @@ -413,26 +417,40 @@ handleDragStart(node, ev) { // 浣跨敤 setData 鏂规硶璁剧疆鏁版嵁 ev.dataTransfer.setData('item', JSON.stringify(node.data)); - if(this.form.levelFlag==1){ - this.$refs.formQuery.$refs.tree.$emit('tree-node-drag-start', ev,{node:this.$refs.formQuery.initItem(node)}); + if (this.form.levelFlag == 1) { + this.$refs.formQuery.$refs.tree.$emit('tree-node-drag-start', ev, {node: this.$refs.formQuery.initItem(node)}); } }, - handleDragEnd(draggingNode,endNode,position,ev){ - if(this.form.levelFlag==1) { + handleDragEnd(draggingNode, endNode, position, ev) { + if (this.form.levelFlag == 1) { this.$refs.formQuery.$refs.tree.$emit('tree-node-drag-end', ev); } }, //鏌ヨ - queryHandler(){ + queryHandler() { this.$refs.form.validate((valid) => { if (valid) { - this.$refs.formQuery.queryResultDialog.loading=true; - const formData=this.initFormData(); + 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; + const data = res.data.data; + const result = data.map(item => { + const filteredAttrs = item.hisAttrValList.filter(attr => + attr.attrName === "OID" || attr.attrName === "REVISIONOID" || attr.attrName === "BTMNAME" || attr.attrName === "NAMEOID" + ); + + const newObj = filteredAttrs.reduce((acc, attr) => { + acc[attr.attrName] = attr.attrVal; + return acc; + }, {}); + + return newObj; + }); + + this.$refs.formQuery.resultData = result; + this.$refs.formQuery.queryResultDialog.showDialog = true; + this.$refs.formQuery.queryResultDialog.loading = false; } }); } else { -- Gitblit v1.9.3