2021-04-14 18:35:42 +08:00
|
|
|
|
<template>
|
2021-08-29 21:35:04 +08:00
|
|
|
|
<div class="bottom-data-list">
|
2021-04-14 18:35:42 +08:00
|
|
|
|
<div class="top-tools top-tools--sub">
|
|
|
|
|
|
<div class="top-tool-left">
|
2021-10-11 14:05:07 +08:00
|
|
|
|
<div class="sub-list-title" v-if="showTitle">{{bottomHeaderTitle}}:<slot name="title"></slot></div>
|
2021-04-14 18:35:42 +08:00
|
|
|
|
<div class="sub-list-tabs">
|
2021-11-23 15:18:39 +08:00
|
|
|
|
<div v-for="tab in tabs" :key="tab.prop" :class="{'sub-list-tab--active': tab.active || tab.prop == targetTab }" :title='tab.prop' class="sub-list-tab" @click="changeTab(tab.prop)">{{tab.name}}</div>
|
2021-04-14 18:35:42 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2021-04-20 19:27:49 +08:00
|
|
|
|
<div class="top-tool-right" v-if="!customTool">
|
2021-04-14 18:35:42 +08:00
|
|
|
|
<div v-if="layout.indexOf('searchInput') > -1" class="top-tool-search margin-r-20">
|
2021-11-22 16:05:34 +08:00
|
|
|
|
<search-input v-if="searchInputShow" :searchMsg="searchMsg" :position="'bottom' + targetTab + obj.id" @search="search" :targetTab="targetTab"></search-input>
|
2021-04-14 18:35:42 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<slot name="top-tool-right"></slot>
|
|
|
|
|
|
<button v-if="layout.indexOf('elementSet') > -1" id="account-column-setting" class="top-tool-btn margin-r-20"
|
|
|
|
|
|
type="button" @click="tools.showCustomTableTitle = true">
|
|
|
|
|
|
<i class="nz-icon-gear nz-icon"></i>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
2021-06-07 17:31:17 +08:00
|
|
|
|
<div v-else class="top-tool-right">
|
2021-04-20 19:27:49 +08:00
|
|
|
|
<slot name="top-tool-right"></slot>
|
|
|
|
|
|
</div>
|
2021-04-14 18:35:42 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<!-- 自定义table列 -->
|
2021-04-29 22:24:38 +08:00
|
|
|
|
<transition name="el-zoom-in-top">
|
2021-04-14 18:35:42 +08:00
|
|
|
|
<element-set
|
2021-04-29 22:24:38 +08:00
|
|
|
|
v-if="tools.showCustomTableTitle && layout.indexOf('elementSet') > -1"
|
2021-04-14 18:35:42 +08:00
|
|
|
|
ref="customTableTitle"
|
|
|
|
|
|
:custom-table-title="customTableTitle"
|
|
|
|
|
|
:original-table-title="tableTitle"
|
|
|
|
|
|
:tableId="tableId"
|
|
|
|
|
|
@close="tools.showCustomTableTitle = false"
|
|
|
|
|
|
@update="updateCustomTableTitle"
|
2021-09-26 14:50:22 +08:00
|
|
|
|
:table-class="true"
|
2021-04-14 18:35:42 +08:00
|
|
|
|
></element-set>
|
|
|
|
|
|
</transition>
|
|
|
|
|
|
<div class="sub-container">
|
2021-08-05 22:25:55 +08:00
|
|
|
|
<div :class="subContentClass">
|
2021-04-14 18:35:42 +08:00
|
|
|
|
<slot></slot>
|
|
|
|
|
|
</div>
|
2021-04-27 19:24:26 +08:00
|
|
|
|
<div class="pagination-bottom" v-if="showPagination">
|
2021-04-14 18:35:42 +08:00
|
|
|
|
<slot name="pagination"></slot>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2021-05-17 19:31:36 +08:00
|
|
|
|
import { fromRoute } from '@/components/common/js/constants'
|
2021-04-14 18:35:42 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
name: 'nzBottomDataList',
|
|
|
|
|
|
props: {
|
|
|
|
|
|
from: {
|
|
|
|
|
|
type: String,
|
|
|
|
|
|
default: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
tableTitle: {
|
|
|
|
|
|
type: Array
|
|
|
|
|
|
},
|
|
|
|
|
|
customTableTitle: {
|
|
|
|
|
|
type: Array
|
|
|
|
|
|
},
|
|
|
|
|
|
layout: {
|
|
|
|
|
|
type: Array,
|
|
|
|
|
|
default () { return [] }
|
|
|
|
|
|
},
|
|
|
|
|
|
searchMsg: {
|
|
|
|
|
|
type: Object
|
|
|
|
|
|
},
|
|
|
|
|
|
tableId: {
|
|
|
|
|
|
type: String,
|
|
|
|
|
|
default: ''
|
|
|
|
|
|
},
|
2021-11-17 13:51:28 +08:00
|
|
|
|
obj: { },
|
2021-04-14 18:35:42 +08:00
|
|
|
|
tabs: {
|
|
|
|
|
|
type: Array
|
2021-04-20 15:31:57 +08:00
|
|
|
|
},
|
2021-04-20 19:27:49 +08:00
|
|
|
|
targetTab: String,
|
|
|
|
|
|
customTool: {
|
|
|
|
|
|
type: Boolean,
|
|
|
|
|
|
default: false
|
2021-04-27 19:24:26 +08:00
|
|
|
|
},
|
|
|
|
|
|
showPagination: {
|
|
|
|
|
|
type: Boolean,
|
|
|
|
|
|
default: true
|
2021-05-12 19:36:51 +08:00
|
|
|
|
},
|
2021-10-11 14:05:07 +08:00
|
|
|
|
showTitle: {
|
|
|
|
|
|
type: Boolean,
|
|
|
|
|
|
default: true
|
|
|
|
|
|
},
|
2021-05-12 19:36:51 +08:00
|
|
|
|
title: {
|
2021-05-14 17:50:06 +08:00
|
|
|
|
type: String
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
bottomHeaderTitle () {
|
|
|
|
|
|
return this.title || this.$t('overall.name')
|
2021-08-05 22:25:55 +08:00
|
|
|
|
},
|
|
|
|
|
|
subContentClass () {
|
|
|
|
|
|
const className = []
|
|
|
|
|
|
switch (this.targetTab) {
|
2022-05-26 10:25:32 +08:00
|
|
|
|
case 'panelTab':
|
2022-06-09 13:18:09 +08:00
|
|
|
|
className.push('nz-table-list bottom-panel')
|
2021-08-05 22:25:55 +08:00
|
|
|
|
break
|
|
|
|
|
|
case 'log': {
|
|
|
|
|
|
className.push('bottom-log')
|
|
|
|
|
|
break
|
|
|
|
|
|
}
|
|
|
|
|
|
default: {
|
2022-06-09 13:18:09 +08:00
|
|
|
|
className.push('nz-table-list')
|
2021-08-05 22:25:55 +08:00
|
|
|
|
break
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
this.from === fromRoute.chartTemp && className.push('chart-temp')
|
|
|
|
|
|
return className.join(' ')
|
2021-04-20 19:27:49 +08:00
|
|
|
|
}
|
2021-04-14 18:35:42 +08:00
|
|
|
|
},
|
|
|
|
|
|
data () {
|
|
|
|
|
|
return {
|
2021-05-17 19:31:36 +08:00
|
|
|
|
fromRoute: fromRoute,
|
2021-11-22 16:05:34 +08:00
|
|
|
|
searchInputShow: true,
|
2021-04-14 18:35:42 +08:00
|
|
|
|
tools: {
|
|
|
|
|
|
toTopBtnTop: this.$tableHeight.toTopBtnTop, // to-top按钮的top属性
|
|
|
|
|
|
tableHover: false, // 控制滚动条和top按钮同时出现
|
|
|
|
|
|
showCustomTableTitle: false // 自定义列弹框是否显示
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2021-11-22 16:05:34 +08:00
|
|
|
|
watch: {
|
|
|
|
|
|
obj (n) {
|
|
|
|
|
|
this.searchInputShow = false
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
this.searchInputShow = true
|
|
|
|
|
|
}, 100)
|
2021-11-25 14:39:45 +08:00
|
|
|
|
},
|
|
|
|
|
|
targetTab (n) {
|
|
|
|
|
|
this.searchInputShow = false
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
this.searchInputShow = true
|
|
|
|
|
|
}, 100)
|
2021-11-22 16:05:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2021-04-14 18:35:42 +08:00
|
|
|
|
methods: {
|
|
|
|
|
|
updateCustomTableTitle (custom) {
|
|
|
|
|
|
this.$emit('update:customTableTitle', custom)
|
|
|
|
|
|
},
|
|
|
|
|
|
search (searchObj) {
|
|
|
|
|
|
this.$emit('search', searchObj)
|
|
|
|
|
|
},
|
|
|
|
|
|
// 切换tab
|
|
|
|
|
|
changeTab (tab) {
|
|
|
|
|
|
this.$emit('changeTab', tab)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|