From e1a2b770a3b9bf440ddccf4518c436e55bdaecda Mon Sep 17 00:00:00 2001 From: ludc Date: 星期二, 06 六月 2023 17:02:37 +0800 Subject: [PATCH] 高级查询相关内容提交 --- Source/UBCS-WEB/src/views/code/code.vue | 178 +++++++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 125 insertions(+), 53 deletions(-) diff --git a/Source/UBCS-WEB/src/views/code/code.vue b/Source/UBCS-WEB/src/views/code/code.vue index 5e3a4ec..aaeef02 100644 --- a/Source/UBCS-WEB/src/views/code/code.vue +++ b/Source/UBCS-WEB/src/views/code/code.vue @@ -63,40 +63,46 @@ @click="handleDelete"> 鍒� 闄� </el-button> - <el-button size="small" + <el-button type="primary" + size="small" + icon="el-icon-search" + plain + @click="openAdvancedQuery('codeRule')"> + 楂樼骇鏌ヨ + </el-button> + <el-button + size="small" icon="icon-kelong" plain @click="openCodeRuleDialog"> 鍏� 闅� </el-button> - <el-button size="small" + <el-button + size="small" icon="icon-lianjiekelong" style="font-size: 12px;" plain @click="openOtherCodeRuleDialog"> 浠庡叾浠栬鍒欎腑鍏嬮殕鐮佹 </el-button> - <el-button size="small" + <el-button + size="small" icon="el-icon-s-help" plain @click="handleRange"> 浣跨敤鑼冨洿 </el-button> - <el-button size="small" + <el-button + size="small" icon="icon-qingkong" plain @click="clearAllCodeSec"> 娓呯┖鐮佸�� </el-button> - <el-button size="small" - icon="el-icon-search" - plain - @click="openAdvancedQuery"> - 楂樼骇鏌ヨ - </el-button> </template> </avue-crud> </basic-container> + <!-- 楂樼骇鏌ヨ瀵硅瘽妗� --> <advanced-query :ref="advancedQueryParam.ref" @@ -104,6 +110,7 @@ :visible.sync="advancedQueryParam.advancedQuerySettingBox" @echoContion="echoSeniorContionMap"> </advanced-query> + <!-- 缂栫爜瑙勫垯鐩稿叧瀵硅瘽妗� --> <el-dialog title="缂栫爜瑙勫垯浣跨敤鑼冨洿" append-to-body @@ -117,6 +124,7 @@ @refresh-change="refreshUseRangeChange"> </avue-crud> </el-dialog> + <!-- 缂栫爜瑙勫垯,鍏嬮殕瀵硅瘽妗� --> <el-dialog title="鍏嬮殕缂栫爜瑙勫垯" append-to-body @@ -170,6 +178,7 @@ <el-button @click="cloneSettingBox = false">鍙� 娑�</el-button> </div> </el-dialog> + <!-- 缂栫爜瑙勫垯,浠庡叾浠栬鍒欏厠闅嗗璇濇 --> <el-dialog title="鍏嬮殕缂栫爜瑙勫垯鐨勫熀纭�淇℃伅" append-to-body @@ -286,6 +295,13 @@ plain @click="deleteBasicCode(scope.row)"> 鍒� 闄� + </el-button> + <el-button type="primary" + size="small" + icon="el-icon-search" + plain + @click="openAdvancedQuery('codeBasicSec')"> + 楂樼骇鏌ヨ </el-button> </template> @@ -1052,7 +1068,7 @@ advancedQueryParam: { ref: 'advancedQuery', advancedQuerySettingBox: false, - options: {}, + options: [], //conditionMapParams: {}, }, @@ -1069,47 +1085,16 @@ }; }, }, - created() { - MasterTable({ - codeClassifyOid: "D9CF223F-317D-71EB-BD11-433A94CAD9F3", - functionId: 5, - }).then(res=>{ - console.log(res.data.tableDefineVO.seniorQueryColumns); - this.advancedQueryParam.options = res.data.tableDefineVO.seniorQueryColumns; - }) - // this.advancedQueryParam.options = [ - // { - // data: [], - // title: '缂栧彿', - // fieldType: 'text', - // queryField: 'id', - // },{ - // data: [], - // title: '鍚嶇О', - // fieldType: 'text', - // queryField: 'name', - // },{ - // data: [], - // title: '鎻忚堪', - // fieldType: 'text', - // queryField: 'description', - // }, { - // data: [], - // title: '鐘舵��', - // fieldType: 'text', - // queryField: 'description', - // } - // ] - }, watch:{ }, methods: { - /** 楂樼骇鏌ヨ瀵硅瘽妗嗙粍浠�,缁勪欢杩斿洖鐨勫�兼槸condtionMap[field]褰㈠紡鐨勬煡璇㈡潯浠讹紝淇濈暀鍜屼箣鍓嶄竴鏍� */ + /** 楂樼骇鏌ヨ瀵硅瘽妗嗙粍浠�,缁勪欢杩斿洖鐨勫�兼槸condtionMap[field]褰㈠紡鐨勬煡璇㈡潯浠讹紝淇濈暀浜嗗拰涔嬪墠涓�鏍风殑鏂瑰紡 */ echoSeniorContionMap(conditionMaps){ - console.log(conditionMaps); - + // console.log(conditionMaps); + this.query = conditionMaps; + this.onLoad(this.page); }, /* 鍏紡缂栬緫妗嗗唴瀹规敼鍙�,瀛愮粍浠剁紪杈戝畬鍏紡涔嬪悗鍐呭鍥炴樉鏃惰皟鐢� */ @@ -2005,8 +1990,78 @@ /** 缂栫爜瑙勫垯鐩稿叧鏂规硶 */ // 鎵撳紑楂樼骇鏌ヨ绐楀彛 - openAdvancedQuery(){ - this.advancedQueryParam.advancedQuerySettingBox = !this.advancedQueryParam.advancedQuerySettingBox; + openAdvancedQuery(condition){ + // MasterTable({ + // codeClassifyOid: "D9CF223F-317D-71EB-BD11-433A94CAD9F3", + // functionId: 5, + // }).then(res=>{ + // console.log(res.data.tableDefineVO.seniorQueryColumns); + // }) + if(condition=='codeRule'){ + this.advancedQueryParam.options = [ + { + data: [], + title: '缂栧彿', + fieldType: 'text', + queryField: 'id', + },{ + data: [], + title: '鍚嶇О', + fieldType: 'text', + queryField: 'name', + },{ + data: [], + title: '鎻忚堪', + fieldType: 'text', + queryField: 'description', + },{ + data: [ + // { + // key: '缂栬緫涓�', + // value: 'Editing', + // }, + // { + // key: '宸插彂甯�', + // value: 'Released', + // }, + // { + // key: '鍋滅敤', + // value: 'Disabled', + // }, + ], + title: '鐘舵��', + fieldType: 'combox', + queryField: 'lcStatus', + comboxKey: 'Eummaterialtype', + } + ] + }else { + this.advancedQueryParam.options = [ + { + data: [], + title: '鐮佹缂栧彿', + fieldType: 'text', + queryField: 'id', + },{ + data: [], + title: '鐮佹鍚嶇О', + fieldType: 'text', + queryField: 'name', + },{ + data: [], + title: '鎻忚堪', + fieldType: 'text', + queryField: 'description', + },{ + data: [], + title: '鐮佹绫诲瀷', + fieldType: 'combox', + queryField: 'secType', + comboxKey: 'codeSecType', + } + ] + } + this.advancedQueryParam.advancedQuerySettingBox = true; }, // 鏌ヨ浣跨敤鑼冨洿 handleRange(){ @@ -2275,16 +2330,22 @@ this.onLoad(this.page); }, searchChange(params, done) { - this.query = params; this.page.currentPage = 1; - this.onLoad(this.page, params); + // 澶氫釜conditionMap杩欐牱浼犲弬锛屽揩閫熸煡璇㈤粯璁ら噰鐢ㄦā绯婃煡璇� + if(params){ + Object.keys(params).forEach(key=>{ + this.query['conditionMap['+key+'_like]'] = params[key]; + }); + } + console.log(this.query); + this.onLoad(this.page); done(); }, // 缂栫爜瑙勫垯褰撳墠閫変腑琛屽彉鍖栫殑鏃跺�欒Е鍙� selectionChange(list) { this.selectionList = list; this.$refs.crud.setCurrentRow(this.selectionList[list.length-1]); - //褰撳墠閫変腑琛屼负绌虹殑鏃跺�欏氨灏嗙爜娈电鐞嗚〃鏍兼暟鎹疆绌� + //褰撳墠閫変腑琛屼负绌虹殑鏃跺�欏氨灏嗙爜娈电鐞嗚〃鏍兼暟鎹疆绌�,骞剁鐢ㄧ浉鍏冲姛鑳� if(list == ''){ this.basicData = []; this.hideBasicTable(false); @@ -2308,14 +2369,25 @@ refreshChange() { this.onLoad(this.page, this.query); }, - onLoad(page, params = {}) { + onLoad(page,params={}) { this.loading = true; - gridCodeRule(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { + gridCodeRule( + page.currentPage, + page.pageSize, + this.query + ).then(res => { //console.log(res.data); const data = res.data.data; this.page.total = data.total; this.data = data.records; this.loading = false; + // 鏌ヨ鐨勫�间负绌烘椂锛岃灏嗙爜娈电鐞嗙浉鍏崇殑鍐呭绂佺敤 + if(data.records.length <= 0) { + this.hideBasicTable(false); + this.selectionList = []; + this.basicData = []; + return; + } this.loadBasic(this.data[0]) this.$nextTick(() => { this.$refs.crud.toggleRowSelection(this.data[0]); -- Gitblit v1.9.3