From 0538fbd82ea053ae9bededd8334d013fac7b489c Mon Sep 17 00:00:00 2001 From: songshankun <songshankun@foxmail.com> Date: 星期四, 28 九月 2023 10:00:58 +0800 Subject: [PATCH] feat: 跟进记录页列表配置列显隐控制 --- src/components/makepager/TableCommonView.vue | 134 +++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 125 insertions(+), 9 deletions(-) diff --git a/src/components/makepager/TableCommonView.vue b/src/components/makepager/TableCommonView.vue index 08762f7..93a80ef 100644 --- a/src/components/makepager/TableCommonView.vue +++ b/src/components/makepager/TableCommonView.vue @@ -5,13 +5,15 @@ border :data="tableList.tableInfomation" tooltip-effect="dark" + :height="'calc(100% - 0px)'" style="width: 100%" :lazy="tableList.lazy" :show-summary="showSummary.show" :summary-method="getSummaries" :span-method="arraySpanMethod" @selection-change="handleSelectionChange" - :header-cell-style="{ background: '#ECF4FF', color: '#666' }" + :header-cell-style="{ background: '#f1f3f8', color: '#000009' , 'font-size': '12px','font-family':'PingFangSC'}" + size="mini" > <el-table-column v-if="selectBox" type="selection" width="40"> </el-table-column> <el-table-column @@ -23,6 +25,7 @@ :min-width="item.min" show-overflow-tooltip :sortable="item.sortable" + v-if="item.isShowColumn" > <template slot-scope="scope"> <span v-if="item.price">{{ "锟�" + number_format(scope.row[item.prop], 2, ".", ",") }}</span> @@ -120,6 +123,21 @@ <el-empty description="鏆傛棤鏁版嵁"></el-empty> </div> </el-table> + + <div class="overSpread1" v-show="iscolopen" @click="onMaskClick"></div> + <div class="styleBtn"> + <i @click="checkCol()" class="label">...</i> + <el-checkbox-group + v-model="showcol" + v-show="iscolopen" + class="checkbox-group" + @change="selectCheckBoxList" + > + <el-checkbox v-for="item in tableList.allcol" :label="item" :key="item" + >{{ item }} + </el-checkbox> + </el-checkbox-group> + </div> </div> </template> @@ -137,6 +155,8 @@ return { selectBox: true, tableInfomation: [], // 鎺ュ彛杩斿洖鏁版嵁 + showcol: [], + allcol: [], tableColumn: [ // table琛ㄥ崟 { label: "", prop: "", min: 200, tooltip: true } @@ -156,10 +176,30 @@ } }, data() { - return {} + return { + iscolopen: false, + showcol:[] + } }, computed: {}, + watch: { + 'tableList.showcol':{ + handler(newVal){ + this.showcol=newVal + }, + immediate:true + } + }, methods: { + onMaskClick() { + this.iscolopen = false; + }, + checkCol() { + this.iscolopen = !this.iscolopen; + }, + selectCheckBoxList(val) { + this.$emit("selTableCol", val); + }, handleReserve(row) { return row._id ? row._id : row.id }, @@ -325,9 +365,8 @@ <!-- Add "scoped" attribute to limit CSS to this component only --> <style lang="scss" scoped> .table-view { - // margin-top: 20px; - margin-right: 10px; - // margin-bottom: 40px; + position: relative; + height: 100%; .blue { width: 70px; text-align: center; @@ -351,7 +390,7 @@ border-bottom: 1px solid #ebeef5; } .no-bottom { - border-bottom: 0px; + border-bottom: 0; } } .no-product { @@ -361,9 +400,86 @@ } } ::v-deep { - .el-table__footer-wrapper tbody td.el-table__cell { - background-color: #fff; - text-align: right; + .el-table__footer-wrapper { + tbody td.el-table__cell { + background-color: #fff; + font-weight: bold; + } + } +} + +::v-deep .el-table .cell { + font-size: 12px; + line-height: 17px; + font-family: PingFangSC; + color: rgba(0, 0, 0, 0.9); + .el-button--text { + width: auto; + height: auto; + font-family: PingFangSC-Medium, sans-serif; + } +} +::v-deep .el-table .el-table__cell { + padding: 6px 0 !important; + height: 35px; + text-align: center; +} + +::v-deep{ + .el-table .cell .el-button--text.el-button--small{ + padding: 4px 0; + } +} + +::v-deep .el-table .el-table__cell { + padding: 6px 0 !important; + height: 35px; + text-align: center; +} + +.overSpread1 { + width: 100%; + height: 100%; + position: fixed; + top: 0; + left: 0; + background: rgba(0, 0, 0, 0); + z-index: 10; +} + +.styleBtn { + position: absolute; + width: 30px; + height: 36px; + // line-height: 26px; + // background: #06c062; + top: 0; + right: -6px; + z-index: 9999; + .label { + position: absolute; + top: 6px; + font-size: 20px; + // line-height: 5px; + cursor: pointer; + color: #000; + transform: rotate(-90deg); + } + .checkbox-group { + width: 160px; + height: 330px; + overflow: auto; + display: flex; + flex-direction: column; + line-height: 25px; + background: #ffffff; + border-radius: 16px; + padding: 12px; + position: absolute; + right: 0; + top: 30px; + z-index: 99; + box-shadow: 0 0 2px 2px #f8f8f8; } } </style> -- Gitblit v1.8.0