From 16eb67ab6b103663d30cad9ba74360f982e131cb Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期二, 03 九月 2024 10:34:59 +0800 Subject: [PATCH] 自定义列显隐控制 --- src/views/system/data-manage/data-detail/list.js | 45 ++++++++++++++++++++------------------------- src/views/system/data-manage/data-detail/index.vue | 2 +- src/components/RightToolbar/index.vue | 4 ++-- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/components/RightToolbar/index.vue b/src/components/RightToolbar/index.vue index 35563f4..cdf4983 100644 --- a/src/components/RightToolbar/index.vue +++ b/src/components/RightToolbar/index.vue @@ -7,7 +7,7 @@ <el-tooltip class="item" effect="dark" content="鍒锋柊" placement="top"> <el-button size="mini" circle icon="el-icon-refresh" @click="refresh()" /> </el-tooltip> - <el-tooltip class="item" effect="dark" content="鑷畾涔夊垪" placement="top"> + <el-tooltip v-show="$route.path.includes('equipment')" class="item" effect="dark" content="鑷畾涔夊垪" placement="top"> <el-button size="mini" circle icon="el-icon-collection-tag" @click="addDynamicColumn()" /> </el-tooltip> <el-tooltip class="item" effect="dark" content="鏄鹃殣鍒�" placement="top" v-if="columns"> @@ -115,7 +115,7 @@ } }, created() { - if (this.$route.path.concat("equipment")) { + if (this.$route.path.includes("equipment")) { this.getDyColumn() } if (this.showColumnsType == 'transfer') { diff --git a/src/views/system/data-manage/data-detail/index.vue b/src/views/system/data-manage/data-detail/index.vue index 33cf76e..0f60c0a 100644 --- a/src/views/system/data-manage/data-detail/index.vue +++ b/src/views/system/data-manage/data-detail/index.vue @@ -84,7 +84,7 @@ <div v-if="tableData.list && tableData.list.length >0"> <el-table v-loading="loading" :data="tableData.list"> - <el-table-column :prop="item.prop" :label="item.label" v-for="(item, index) in tableHead" :key="index" v-if="item"/> + <el-table-column :prop="item.prop" :label="item.label" :width="item.width" v-for="(item, index) in tableHead" :key="index" v-if="item"/> </el-table> </div> <el-empty v-else description="鏆傛棤鏁版嵁"></el-empty> diff --git a/src/views/system/data-manage/data-detail/list.js b/src/views/system/data-manage/data-detail/list.js index 0b62bda..08a0b61 100644 --- a/src/views/system/data-manage/data-detail/list.js +++ b/src/views/system/data-manage/data-detail/list.js @@ -650,17 +650,8 @@ { "label": "琛屾斂鍖哄垝缂栫爜", "align": "center", - "prop": "arealayerPath" - }, - { - "label": "琛屾斂鍖哄垝缂栫爜", - "align": "center", - "prop": "arealayerno" - }, - { - "label": "琛屾斂鍖哄垝鍚嶇О", - "align": "center", - "prop": "arealayerName" + "prop": "arealayerPath", + "width": 250 }, { "label": "瑙g爜鐘舵�佺爜", @@ -670,12 +661,14 @@ { "label": "璁惧id", "align": "center", - "prop": "deviceId" + "prop": "deviceId", + "width": 250 }, { "label": "璁惧鍚嶇О", "align": "center", - "prop": "deviceName" + "prop": "deviceName", + "width": 250 }, { "label": "icmp寤惰繜", @@ -691,7 +684,8 @@ "label": "鏈�杩慽cmp鏃堕棿", "align": "center", "prop": "icmpTime", - "format": "yyyy-MM-dd HH:mm:ss" + "format": "yyyy-MM-dd HH:mm:ss", + "width": 200 }, { "label": "鍏抽敭甯ф椂寤�", @@ -701,7 +695,8 @@ { "label": "ip鍦板潃", "align": "center", - "prop": "ipAddr" + "prop": "ipAddr", + "width": 150 }, { "label": "鏈�杩戞寔缁绾挎晠闅滄鏁�", @@ -712,7 +707,8 @@ "label": "鏈�杩戞寔缁绾挎晠闅滄椂闂�", "align": "center", "prop": "olErrEverduringFirstTime", - "format": "yyyy-MM-dd HH:mm:ss" + "format": "yyyy-MM-dd HH:mm:ss", + "width": 200 }, { "label": "绱绂荤嚎鏁呴殰娆℃暟", @@ -722,7 +718,8 @@ { "label": "绱绂荤嚎鏁呴殰鐜�", "align": "center", - "prop": "olErrTotalRate" + "prop": "olErrTotalRate", + "width": 80 }, { "label": "宸℃娆℃暟", @@ -747,17 +744,14 @@ { "label": "鐪佸巺鏍囩", "align": "center", - "prop": "tagStr" + "prop": "tagStr", + "width": 200 }, { "label": "鐪佸巺鏍囩鍒楄〃", "align": "center", - "prop": "tags" - }, - { - "label": "绉熸埛id", - "align": "center", - "prop": "tenantId" + "prop": "tags", + "width": 200 }, { "label": "瑙嗛娴佹椂寤�", @@ -768,7 +762,8 @@ "label": "瑙嗛璐ㄩ噺妫�娴嬫椂闂�", "align": "center", "prop": "vqdTime", - "format": "yyyy-MM-dd HH:mm:ss" + "format": "yyyy-MM-dd HH:mm:ss", + "width": 200 } ], card: [ -- Gitblit v1.8.0