From b4c7c6a738f44afadbc388bb774ac044e7fafe38 Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期四, 12 十月 2023 11:24:21 +0800 Subject: [PATCH] 修改列显隐 --- Source/UBCS-WEB/src/views/modeling/status.vue | 99 ++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 76 insertions(+), 23 deletions(-) diff --git a/Source/UBCS-WEB/src/views/modeling/status.vue b/Source/UBCS-WEB/src/views/modeling/status.vue index 4fb492e..07682c7 100644 --- a/Source/UBCS-WEB/src/views/modeling/status.vue +++ b/Source/UBCS-WEB/src/views/modeling/status.vue @@ -11,36 +11,41 @@ @row-del="rowDel" @refresh-change="refreshChange" @search-reset="searchChange" - @search-change="searchChange"> + @search-change="searchChange" + @row-click="rowClick"> <template slot="menuLeft"> - <el-tooltip class="item" effect="dark" content="鏌ユ壘鐘舵�佹睜浣跨敤鑼冨洿" placement="top"> + <el-tooltip class="item" effect="dark" content="鏌ユ壘鐘舵�佷娇鐢ㄨ寖鍥�" placement="top"> <el-button size="small" plain type="primary" icon="el-icon-zoom-in" - @click="handleSearch">鏌ョ湅浣跨敤鑼冨洿 + @click="applyRangeSearch">鏌ョ湅浣跨敤鑼冨洿 </el-button> </el-tooltip> - </template>> + </template> + <template slot="radio" + slot-scope="{row}"> + <el-radio v-model="selectRow" + :label="row.$index"> + </el-radio> + </template> </avue-crud> - <el-dialog title="鏌ョ湅浣跨敤鑼冨洿" - append-to-body - :visible.sync="packageSearchBox" - width="1200px"> - <versionpackage></versionpackage> - </el-dialog> + <versionpackage :rangeData="applyRangeData" ref="applyRange"></versionpackage> </basic-container> - + </template> - + <script> - import { getPage,add,update,remove } from '../../api/omd/status'; + import { getPage,add,update,remove,getApplyRange } from '../../api/omd/status'; export default { name: "status", data(){ return { //鏌ョ湅浣跨敤鑼冨洿 packageSearchBox:false, + // 鐐瑰嚮鏁版嵁 + selectRow: '', + selectRowData: {}, //鍒嗛〉鏁版嵁 page: { pageSize: 10, @@ -51,21 +56,42 @@ ], form:{}, option:{ + height:'auto', + calcHeight:20, headerAlign:'center', align: 'center', + columnBtn:false, border: true, index: true, searchMenuSpan:5, + highlightCurrentRow: true, + stripe:true, column:[ + { + label: '閫夋嫨', + prop: 'radio', + width: 120, + display: false + }, { label:'鑻辨枃鍚嶇О', prop: 'id', - search: true + search: true, + rules: [{ + required: true, + message: '鑻辨枃鍚嶇О涓嶈兘涓虹┖', + trigger: 'blur' + }] }, { label:'涓枃鍚嶇О', prop:'name', search:true, + rules: [{ + required: true, + message: '涓枃鍚嶇О涓嶈兘涓虹┖', + trigger: 'blur' + }] }, { label: '鎻忚堪', @@ -73,12 +99,28 @@ type:'textarea' } ] - } + }, + applyRangeData: [] } }, methods:{ - handleSearch(){ - // this.packageSearchBox=true + rowClick(row){ + this.selectRow = row.$index; + this.selectRowData = row; + }, + applyRangeSearch(){ + if (!this.selectRow && this.selectRow != 0){ + console.log(this.selectRow); + this.$message({ + type:"warning", + message: "璇峰厛閫夋嫨灞炴��" + }) + } + getApplyRange(this.selectRowData.id).then(res => { + this.applyRangeData = res.data.data; + this.$refs.applyRange.rangeData = this.applyRangeData; + this.$refs.applyRange.showDialog = true; + }) }, getList() { this.loading = true; @@ -121,10 +163,22 @@ }) }, searchChange(params, done) { - if (done) done(); - this.params = params; + this.loading = true; this.page.currentPage = 1; - this.getList(); + const p = {}; + if(params.id){ + p["id_like"] = params.id; + } + if(params.name){ + p["name_like"] = params.name + } + getPage(this.page.currentPage,this.page.pageSize,p).then(res => { + const data = res.data.data + this.loading = false; + this.page.total = data.total; + this.data = data.records; + done(); + }) this.$message.success('鎼滅储鎴愬姛') }, refreshChange() { @@ -134,8 +188,7 @@ } } </script> - + <style scoped> - + </style> - \ No newline at end of file -- Gitblit v1.9.3