From 344ada5bc3e41c5fb42ae0e8ac590b64b7cb04ca Mon Sep 17 00:00:00 2001 From: ludc Date: 星期六, 24 二月 2024 20:30:16 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue | 130 ++++++++++++++++++++++++------------------- 1 files changed, 73 insertions(+), 57 deletions(-) diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue index dd00bd6..9b9671d 100644 --- a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue +++ b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue @@ -164,31 +164,19 @@ @click="TemRefresh">鍒锋柊</el-button> <el-button v-if="permissionList.CloneBtnStuatus" plain size="small" type="primary" @click="CloneBtn">浠庡叾瀹冩ā鏉垮厠闅�</el-button> <!-- 鏌ヨ瀵硅瘽妗�--> - <el-dialog :visible.sync="FindFormVisible" append-to-body title="楂樼骇鏌ヨ"> - <div> - <el-button size="small" type="primary" @click="AdvQueries">鏌ヨ</el-button> - <el-button size="small" type="primary">閲嶇疆</el-button> - </div> - <div style="padding-left: 80px;margin-top: 15px;"> - <template v-for="(value, key) in FindSelect"> - <div style="display: flex; justify-content: space-around; width: 85%; margin-bottom: 15px"> - <el-select v-model="FindSelect[key]" placeholder="璇烽�夋嫨" style="width: 28%" - @change="handleSelectChange(key)"> - <el-option label="妯℃澘缂栧彿" value="0"></el-option> - <el-option label="妯℃澘鍚嶇О" value="1"></el-option> - <el-option label="妯℃澘鎻忚堪" value="2"></el-option> - <el-option label="鐗堟湰鍙�" value="3"></el-option> - <el-option label="鐘舵��" value="4"></el-option> - </el-select> - <el-select v-model="condition[0]" placeholder="璇烽�夋嫨" style="width: 15%"> - <el-option label="鍖呭惈" value="0"></el-option> - <el-option label="绛変簬" value="1"></el-option> - </el-select> - <el-input v-model="QueryArray[key]" style="width: 49%"></el-input> - <span> <i class="el-icon-delete" style="font-size: 22px;margin-top:8px;margin-left: 10px"/></span> + <el-dialog :visible.sync="FindFormVisible" append-to-body title="楂樼骇鏌ヨ" width="30%" @close="searchReset"> + <div style="text-align: center; margin-top: 5px;"> + <el-select v-model="searchSelect" style="width: 35%"> + <el-option v-for="item in crudFindTreeArray" :key="item.field" :label="item.title" + :value="item.queryField"></el-option> + </el-select> + <el-input v-model="SearchValue" + placeholder="璇疯緭鍏ュ叧閿瓧杩涜鏌ヨ" style="width: 45%; margin-left: 5px;"></el-input> </div> - </template> - </div> + <span slot="footer" class="dialog-footer"> + <el-button type="primary" @click="advQueries">鏌ヨ</el-button> + <el-button type="danger" @click="searchReset">閲嶇疆</el-button> + </span> </el-dialog> <!-- 妯℃澘鍏嬮殕 --> <el-dialog :before-close="cloneClose" :visible.sync="CloneVisible" append-to-body title="鍏嬮殕妯℃澘"> @@ -378,6 +366,40 @@ name: "classifyTrees.vue", data() { return { + crudFindTreeArray: [ + { + title: '妯℃澘缂栧彿', + field: 'id', + fieldType: 'text', + queryField: 'id' + }, + { + title: '妯℃澘鍚嶇О', + field: 'name', + fieldType: 'text', + queryField: 'name' + }, + { + title: '妯℃澘鎻忚堪', + field: 'description', + fieldType: 'text', + queryField: 'description' + }, + { + title: '鐗堟湰鍙�', + field: 'revisionSeq', + fieldType: 'text', + queryField: 'revisionSeq' + }, + { + title: '鐘舵��', + field: 'lcStatusText', + fieldType: 'text', + queryField: 'lcStatusText' + }, + ], + searchSelect: 'id', + SearchValue: '', allButtons: Boolean, btnAuthList: [], activeName: 'first', @@ -512,7 +534,7 @@ Treedata: [], CloneTreedata: [], Treeoption: { - height:'auto', + height: 'auto', addBtn: false, editBtn: false, delBtn: false, @@ -669,11 +691,12 @@ showEditBtn: false, //浼犻�掔粰鍒嗙被鎺堟潈瀛愮粍浠跺璇濇鐨勫綋鍓嶉�変腑鐨勫垎绫昏妭鐐逛俊鎭� classifyData: "", + } }, watch: {}, mounted() { - this.type = this.tabOption.column[0]; + this.type = this.tabOption.column[0] || {label: '鍩烘湰淇℃伅', prop: 'tab1'}; this.getAttr(); const treeEle = this.$refs.tree.$el treeEle.addEventListener('click', (e) => { @@ -768,7 +791,7 @@ codeClassifyOid: '' } } - } + }, }, created() { }, @@ -1107,7 +1130,6 @@ this.loading = false; } }, - async Deactivate() { if (Object.keys(this.nodeClickList).length < 1) { this.$message.warning('璇峰厛浠庢爲涓婇�夋嫨涓�鏉℃暟鎹�'); @@ -1152,7 +1174,7 @@ }, //鏍戠偣鍑讳簨浠� async nodeClick(data) { - const response = this.findTheTopLevelNode(data,this.Treedata) + const response = this.findTheTopLevelNode(data, this.Treedata) this.classifyData = response; // console.log(response) // console.log('response',response.attributes.id) @@ -1199,10 +1221,9 @@ this.$message.error(error); } }, - // 閫掑綊鏌ユ壘椤跺眰鑺傜偣Id - findTheTopLevelNode(data,TreeData){ - if(data.parentId === ""){ + findTheTopLevelNode(data, TreeData) { + if (data.parentId === "") { return data; } const parentNode = this.findParentNode(data.parentId, TreeData); @@ -1211,7 +1232,7 @@ } }, // 閫掑綊鏌ユ壘鍑烘潵澶氬眰鑺傜偣鐨勭埗鑺傜偣 - findParentNode(parentId, TreeData){ + findParentNode(parentId, TreeData) { for (const node of TreeData) { if (node.oid === parentId) { return node; @@ -1276,34 +1297,28 @@ handleChange(column) { this.type = column; }, - AdvQueries() { - this.FindFormVisible = false - //濡傛灉鍏ㄩ儴涓虹┖ allEmpty涓簍rue - const allEmpty = Object.values(this.QueryArray).every(value => !value); - //濡傛灉鍏ㄩ儴涓虹┖锛岀偣鍑绘煡璇㈠嚭鐜版墍鏈夋暟鎹� - if (allEmpty) { - gridCodeClassifyTemplate().then(res => { - this.Formlist = res.data.data - }) + advQueries() { + if (this.SearchValue === "") { + this.$message.warning('璇疯緭鍏ヨ鏌ヨ鐨勫唴瀹癸紒'); } else { - //榛樿鏄瓑浜� - gridCodeClassifyFindTemplate({'conditionMap[id]': this.QueryArray.id}, - {'conditionMap[name]': this.QueryArray.name}, - {'conditionMap[description]': this.QueryArray.description}, - {'conditionMap[revisionValue]': this.QueryArray.revisionValue}, - {'conditionMap[lcStatus]': this.QueryArray.lcStatus} - ).then(res => { - this.Formlist = res.data.data - }) + const condition = { + 'conditionMap[codeclassifyoid]': this.nodeClickList.oid, + [`conditionMap[${this.searchSelect}]`]: this.SearchValue + }; + gridCodeClassifyFindTemplate(condition).then(res => { + if (res.data.data.length > 0) { + this.Formlist = res.data.data; + } else { + this.$message.error('鏆傛湭鏌ヨ鍒扮浉鍏虫ā鏉匡紒') + } + this.FindFormVisible = false; + }); } }, - //妯℃澘绠$悊娓叉煋 - CrudRend() { - gridCodeClassifyTemplate({'conditionMap[codeclassifyoid]': this.nodeClickList.oid}).then(res => { - this.Formlist = res.data.data - }) + searchReset() { + this.SearchValue = ""; + this.searchSelect = 'id' }, - //妯℃澘绠$悊琛ㄦ牸娣诲姞 CrudRowSave(row, done) { if (this.nodeClickList.length <= 0) { @@ -1548,6 +1563,7 @@ .headerCon > .el-button:nth-child(9) { margin-left: 0; } + ///deep/.el-scrollbar__bar.is-vertical{ // width: 8px; //} -- Gitblit v1.9.3