From b39bf36c1c380285582b7daffb5dd656aa1e1389 Mon Sep 17 00:00:00 2001 From: zuozhengqing <a13193816592@163.com> Date: 星期一, 06 十一月 2023 17:20:04 +0800 Subject: [PATCH] 退出动态跳转登录页 --- src/components/makepager/TableCommonView.vue | 122 +++++++++++++++++++++++++++++++++++----- 1 files changed, 105 insertions(+), 17 deletions(-) diff --git a/src/components/makepager/TableCommonView.vue b/src/components/makepager/TableCommonView.vue index 54c5b14..7335401 100644 --- a/src/components/makepager/TableCommonView.vue +++ b/src/components/makepager/TableCommonView.vue @@ -1,3 +1,4 @@ +<!-- eslint-disable vue/no-use-v-if-with-v-for --> <template> <div class="table-view"> <el-table @@ -12,9 +13,10 @@ :summary-method="getSummaries" :span-method="arraySpanMethod" @selection-change="handleSelectionChange" - :header-cell-style="{ background: '#f1f3f8', color: '#000009' , 'font-size': '12px','font-family':'PingFangSC'}" + :header-cell-style="{ background: '#f1f3f8', color: '#000009', 'font-size': '12px', 'font-family': 'PingFangSC' }" size="mini" > + <el-table-column v-if="tableList.selectIndex" type="index" label="搴忓彿" width="50"></el-table-column> <el-table-column v-if="selectBox" type="selection" width="40"> </el-table-column> <el-table-column v-for="(item, i) in tableList.tableColumn" @@ -25,6 +27,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> @@ -77,7 +80,7 @@ <div v-else-if="item.isProductName" class="product-view"> <ul v-if="scope.row.products && scope.row.products.length > 0"> <li v-for="(item, index) in scope.row.products" :key="index"> - <div :class="scope.row.products.length === 1 ? 'name-view no-bottom' : 'name-view'"> + <div class="name-view"> {{ item.name }} </div> </li> @@ -87,7 +90,7 @@ <div v-else-if="item.isProductAmount" class="product-view"> <ul v-if="scope.row.products && scope.row.products.length > 0"> <li v-for="(item, index) in scope.row.products" :key="index"> - <div :class="scope.row.products.length === 1 ? 'name-view no-bottom' : 'name-view'"> + <div class="name-view"> {{ item.amount }} </div> </li> @@ -97,7 +100,7 @@ <div v-else-if="item.isProductPrice" class="product-view"> <ul v-if="scope.row.products && scope.row.products.length > 0"> <li v-for="(item, index) in scope.row.products" :key="index"> - <div :class="scope.row.products.length === 1 ? 'name-view no-bottom' : 'name-view'"> + <div class="name-view"> {{ item.price }} </div> </li> @@ -107,7 +110,7 @@ <div v-else-if="item.isProductTotal" class="product-view"> <ul v-if="scope.row.products && scope.row.products.length > 0"> <li v-for="(item, index) in scope.row.products" :key="index"> - <div :class="scope.row.products.length === 1 ? 'name-view no-bottom' : 'name-view'"> + <div class="name-view"> {{ item.total }} </div> </li> @@ -122,6 +125,14 @@ <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> @@ -131,14 +142,16 @@ props: { selectBox: { type: Boolean, - default: true + default: false }, tableList: { type: Object, default: () => { return { - selectBox: true, + selectIndex: true, tableInfomation: [], // 鎺ュ彛杩斿洖鏁版嵁 + showcol: [], + allcol: [], tableColumn: [ // table琛ㄥ崟 { label: "", prop: "", min: 200, tooltip: true } @@ -158,10 +171,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 }, @@ -178,10 +211,16 @@ .querySelector(".el-table__footer") var cell = current.rows[0].cells for (let i = 0; i < this.showSummary.mergeNumber; i++) { - cell[i].style.display = "none" + cell[i] && cell[i].style && (cell[i].style.display = "none") } - cell[this.showSummary.mergeNumber].classList.remove("is-left") - cell[this.showSummary.mergeNumber].colSpan = this.showSummary.mergeNumber.toString() + if (cell[this.showSummary.mergeNumber]) { + if (cell[this.showSummary.mergeNumber].classList) { + cell[this.showSummary.mergeNumber].classList.remove("is-left") + } + if (cell[this.showSummary.mergeNumber].colSpan) { + cell[this.showSummary.mergeNumber].colSpan = this.showSummary.mergeNumber.toString() + } + } } }) } @@ -345,8 +384,8 @@ margin-left: -10px; margin-right: -11px; li { - height: 57px; - line-height: 57px; + height: 22px; + line-height: 22px; .name-view { padding-left: 10px; border-bottom: 1px solid #ebeef5; @@ -355,9 +394,12 @@ border-bottom: 0; } } + li:last-child .name-view { + border-bottom: none; + } .no-product { - height: 57px; - line-height: 57px; + height: 22px; + line-height: 22px; } } } @@ -387,8 +429,8 @@ text-align: center; } -::v-deep{ - .el-table .cell .el-button--text.el-button--small{ +::v-deep { + .el-table .cell .el-button--text.el-button--small { padding: 4px 0; } } @@ -398,4 +440,50 @@ 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: 11; + .label { + position: absolute; + top: 6px; + font-size: 20px; + // line-height: 5px; + cursor: pointer; + color: #000; + transform: rotate(-90deg); + } + .checkbox-group { + width: 160px; + height: 300px; + 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