2021-04-07 09:58:34 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div :class="from" class="list-page">
|
|
|
|
|
|
<!-- 主页面 -->
|
|
|
|
|
|
<div :class="{'main-list-with-sub': bottomBox.showSubList}" class="main-list">
|
|
|
|
|
|
<!-- 顶部工具栏 -->
|
|
|
|
|
|
<div class="main-modal"></div>
|
2021-04-14 18:35:42 +08:00
|
|
|
|
<div class="main-container">
|
2021-08-26 10:43:08 +08:00
|
|
|
|
<div v-show="bottomBox.mainResizeShow" class="top-tools">
|
2021-04-25 20:17:14 +08:00
|
|
|
|
<div class="top-tool-left" style="min-width: 300px">
|
2021-04-14 18:35:42 +08:00
|
|
|
|
<slot name="top-tool-left"></slot>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div :class="{'top-tool-main-right-to-left': bottomBox.showSubList}" class="top-tool-right">
|
2021-09-08 16:22:49 +08:00
|
|
|
|
<div v-if="showLayout.indexOf('searchInput') > -1" class="top-tool-search margin-r-20" :class="{'project-search alert-table asset-table endpoint-table': searchRight}">
|
2021-11-18 17:18:16 +08:00
|
|
|
|
<search-input ref="searchInput" :from="from" :position='from' :inTransform="bottomBox.inTransform" :searchMsg="searchMsg" @search="search"></search-input>
|
2021-04-14 18:35:42 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<slot name="top-tool-right"></slot>
|
2021-04-29 22:24:38 +08:00
|
|
|
|
<button v-if="showLayout.indexOf('elementSet') > -1" class="top-tool-btn table-column-setting"
|
2021-04-14 18:35:42 +08:00
|
|
|
|
type="button" @click="tools.showCustomTableTitle = true">
|
|
|
|
|
|
<i class="nz-icon-gear nz-icon"></i>
|
|
|
|
|
|
</button>
|
2021-10-09 16:47:38 +08:00
|
|
|
|
<el-dropdown
|
|
|
|
|
|
type="primary"
|
2021-10-25 17:16:40 +08:00
|
|
|
|
trigger="click"
|
2021-10-09 16:47:38 +08:00
|
|
|
|
v-if="showLayout.indexOf('detailViewSet') > -1"
|
2021-10-11 14:05:07 +08:00
|
|
|
|
class="margin-l-5"
|
2021-10-09 16:47:38 +08:00
|
|
|
|
@command="changeDetailType">
|
2021-10-11 14:05:07 +08:00
|
|
|
|
<button class="top-tool-btn table-column-setting"
|
|
|
|
|
|
type="button">
|
2021-10-15 16:41:14 +08:00
|
|
|
|
<i class="nz-icon nz-icon-list-view" />
|
2021-10-11 14:05:07 +08:00
|
|
|
|
</button>
|
2021-10-29 12:02:34 +08:00
|
|
|
|
<el-dropdown-menu slot="dropdown" class="right-public-box-dropdown-top right-box-select-top">
|
2021-10-14 14:45:06 +08:00
|
|
|
|
<el-dropdown-item :command="'list'" :class="detailType === 'list' ? 'active' : ''">{{$t('asset.detail.list')}}</el-dropdown-item>
|
|
|
|
|
|
<el-dropdown-item :command="'view'" :class="detailType === 'view' ? 'active' : ''">{{$t('asset.detail.detail')}}</el-dropdown-item>
|
2021-10-09 16:47:38 +08:00
|
|
|
|
</el-dropdown-menu>
|
|
|
|
|
|
</el-dropdown>
|
2021-04-07 09:58:34 +08:00
|
|
|
|
</div>
|
2021-04-14 18:35:42 +08:00
|
|
|
|
<!-- 顶部分页组件,当打开底部上滑框时出现 -->
|
2021-04-29 22:24:38 +08:00
|
|
|
|
<!-- <div v-if="showLayout.indexOf('pagination') > -1" class="pagination-top pagination-top-hide display-none"></div>-->
|
2021-04-14 18:35:42 +08:00
|
|
|
|
</div>
|
2021-04-29 22:24:38 +08:00
|
|
|
|
<div v-if="showLayout.indexOf('clickSearch') > -1" class="search-box">
|
2021-04-21 11:39:16 +08:00
|
|
|
|
<slot name="search"></slot>
|
|
|
|
|
|
</div>
|
2021-08-29 21:35:04 +08:00
|
|
|
|
<div v-show="bottomBox.mainResizeShow" :style="{ height: nzTableHeight }" class="nz-table2">
|
2021-04-14 18:35:42 +08:00
|
|
|
|
<slot v-bind:mainResizeShow="bottomBox.mainResizeShow"></slot>
|
|
|
|
|
|
</div>
|
2021-08-26 10:43:08 +08:00
|
|
|
|
<div v-show="bottomBox.mainResizeShow" v-if="showLayout.indexOf('pagination') > -1" class="pagination-bottom">
|
2021-04-14 18:35:42 +08:00
|
|
|
|
<slot name="pagination"></slot>
|
2021-04-07 09:58:34 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<!-- 自定义table列 -->
|
|
|
|
|
|
<transition name="el-zoom-in-top">
|
|
|
|
|
|
<element-set
|
|
|
|
|
|
v-if="tools.showCustomTableTitle"
|
2021-04-28 17:48:50 +08:00
|
|
|
|
:tableId="$parent.tableId"
|
2021-04-07 09:58:34 +08:00
|
|
|
|
ref="customTableTitle"
|
|
|
|
|
|
:custom-table-title="customTableTitle"
|
|
|
|
|
|
:original-table-title="tableTitle"
|
2021-09-27 15:39:23 +08:00
|
|
|
|
:operation-true="operationRecord"
|
2021-04-07 09:58:34 +08:00
|
|
|
|
@close="tools.showCustomTableTitle = false"
|
|
|
|
|
|
@update="updateCustomTableTitle"
|
|
|
|
|
|
></element-set>
|
|
|
|
|
|
</transition>
|
2021-08-26 10:43:08 +08:00
|
|
|
|
|
2021-04-07 09:58:34 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<transition name="el-zoom-in-bottom">
|
|
|
|
|
|
<bottom-box v-if="bottomBox.showSubList"
|
2021-07-29 16:23:15 +08:00
|
|
|
|
@getTableData = 'getTableData'
|
2021-04-07 09:58:34 +08:00
|
|
|
|
ref="bottomBox"
|
|
|
|
|
|
:from="from"
|
2022-04-13 17:09:59 +08:00
|
|
|
|
:sign ="sign"
|
2021-04-07 09:58:34 +08:00
|
|
|
|
:is-full-screen="bottomBox.isFullScreen"
|
|
|
|
|
|
:obj="bottomBox.object"
|
|
|
|
|
|
:sub-resize-show="bottomBox.subResizeShow"
|
|
|
|
|
|
:target-tab.sync="bottomBox.targetTab"
|
2021-04-08 20:28:54 +08:00
|
|
|
|
@closeSubList="bottomBox.showSubList = false"
|
|
|
|
|
|
@exitFullScreen="exitFullScreen"
|
|
|
|
|
|
@fullScreen="fullScreen"
|
|
|
|
|
|
@listResize="listResize" ></bottom-box>
|
2021-04-07 09:58:34 +08:00
|
|
|
|
</transition>
|
2022-03-17 16:42:56 +08:00
|
|
|
|
<!-- 全屏查看 -->
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
|
v-if="topologyShow"
|
|
|
|
|
|
:visible.sync="topologyShow"
|
|
|
|
|
|
:show-close="false"
|
|
|
|
|
|
class="nz-dialog chart-fullscreen"
|
|
|
|
|
|
destroy-on-close
|
|
|
|
|
|
fullscreen
|
|
|
|
|
|
:modal-append-to-body="false"
|
|
|
|
|
|
>
|
|
|
|
|
|
<panel-chart
|
|
|
|
|
|
:ref="'chart-fullscreen' + topologyChartInfo.id"
|
|
|
|
|
|
:chart-info="topologyChartInfo"
|
|
|
|
|
|
:from="from"
|
|
|
|
|
|
:time-range="timeRange"
|
|
|
|
|
|
:is-fullscreen="true"
|
|
|
|
|
|
@showFullscreen="showFullscreen"
|
|
|
|
|
|
></panel-chart>
|
|
|
|
|
|
</el-dialog>
|
2021-04-07 09:58:34 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2021-04-30 17:11:34 +08:00
|
|
|
|
import { fromRoute } from '@/components/common/js/constants'
|
2021-04-08 20:28:54 +08:00
|
|
|
|
import bottomBox from '@/components/common/bottomBox/bottomBox'
|
2021-04-07 09:58:34 +08:00
|
|
|
|
import { bottomBoxWindow } from '@/components/common/js/tools'
|
2022-03-17 16:42:56 +08:00
|
|
|
|
import panelChart from '@/components/chart/panelChart'
|
2021-04-07 09:58:34 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
name: 'nzDataList',
|
2021-04-08 20:28:54 +08:00
|
|
|
|
components: {
|
2022-03-17 16:42:56 +08:00
|
|
|
|
bottomBox,
|
|
|
|
|
|
panelChart
|
2021-04-08 20:28:54 +08:00
|
|
|
|
},
|
2021-04-07 09:58:34 +08:00
|
|
|
|
props: {
|
|
|
|
|
|
from: {
|
|
|
|
|
|
type: String,
|
|
|
|
|
|
default: ''
|
|
|
|
|
|
},
|
2021-10-09 16:47:38 +08:00
|
|
|
|
detailType: {
|
|
|
|
|
|
type: String,
|
|
|
|
|
|
default: ''
|
|
|
|
|
|
},
|
2021-04-07 09:58:34 +08:00
|
|
|
|
tableTitle: {
|
|
|
|
|
|
type: Array
|
|
|
|
|
|
},
|
|
|
|
|
|
customTableTitle: {
|
|
|
|
|
|
type: Array
|
|
|
|
|
|
},
|
2021-04-12 13:00:59 +08:00
|
|
|
|
layout: {
|
2021-04-07 09:58:34 +08:00
|
|
|
|
type: Array,
|
|
|
|
|
|
default () { return [] }
|
|
|
|
|
|
},
|
|
|
|
|
|
searchMsg: {
|
|
|
|
|
|
type: Object
|
2021-08-26 15:05:26 +08:00
|
|
|
|
},
|
2021-09-08 16:22:49 +08:00
|
|
|
|
nzTableHeightOffset: Number,
|
2021-09-27 15:39:23 +08:00
|
|
|
|
searchRight: Boolean,
|
|
|
|
|
|
operationRecord: Boolean
|
2021-08-29 21:35:04 +08:00
|
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
nzTableHeight () {
|
|
|
|
|
|
if (this.nzTableHeightOffset) {
|
|
|
|
|
|
if (this.layout.indexOf('clickSearch') > -1) {
|
|
|
|
|
|
return `calc(100% - ${this.nzTableHeightOffset}px`
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return ''
|
2022-03-17 16:42:56 +08:00
|
|
|
|
},
|
|
|
|
|
|
topologyShow () {
|
|
|
|
|
|
return this.$store.getters.getTopologyShow
|
|
|
|
|
|
},
|
|
|
|
|
|
topologyChartInfo () {
|
|
|
|
|
|
return this.$store.getters.getTopologyChartInfo
|
2021-08-29 21:35:04 +08:00
|
|
|
|
}
|
2021-04-07 09:58:34 +08:00
|
|
|
|
},
|
|
|
|
|
|
data () {
|
|
|
|
|
|
return {
|
2022-04-13 17:09:59 +08:00
|
|
|
|
sign:'',
|
2021-04-30 17:11:34 +08:00
|
|
|
|
fromRoute: fromRoute,
|
2021-04-07 09:58:34 +08:00
|
|
|
|
/* 二级页面相关 */
|
|
|
|
|
|
bottomBox: {
|
|
|
|
|
|
object: {},
|
|
|
|
|
|
mainResizeShow: true, // dom高度改变时是否展示|隐藏
|
|
|
|
|
|
subResizeShow: true,
|
|
|
|
|
|
isFullScreen: false, // 全屏状态
|
|
|
|
|
|
showSubList: false, // 是否显示二级列表
|
|
|
|
|
|
targetTab: '', // 显示二级列表中的哪个页签
|
|
|
|
|
|
inTransform: false // 搜索框相关,搜索条件下拉框是否在transform里
|
|
|
|
|
|
},
|
|
|
|
|
|
tools: {
|
|
|
|
|
|
toTopBtnTop: this.$tableHeight.toTopBtnTop, // to-top按钮的top属性
|
|
|
|
|
|
tableHover: false, // 控制滚动条和top按钮同时出现
|
|
|
|
|
|
showCustomTableTitle: false // 自定义列弹框是否显示
|
2021-04-29 22:24:38 +08:00
|
|
|
|
},
|
2022-03-17 16:42:56 +08:00
|
|
|
|
showLayout: [],
|
|
|
|
|
|
timeRange: [new Date(), new Date()]
|
2021-04-07 09:58:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
updateCustomTableTitle (custom) {
|
|
|
|
|
|
this.$emit('update:customTableTitle', custom)
|
|
|
|
|
|
},
|
|
|
|
|
|
// 全屏
|
|
|
|
|
|
fullScreen () {
|
|
|
|
|
|
const vm = this
|
|
|
|
|
|
bottomBoxWindow.fullScreen(vm)
|
|
|
|
|
|
},
|
|
|
|
|
|
// 退出全屏
|
|
|
|
|
|
exitFullScreen () {
|
|
|
|
|
|
const vm = this
|
|
|
|
|
|
bottomBoxWindow.exitFullScreen(vm)
|
|
|
|
|
|
},
|
|
|
|
|
|
// 鼠标拖动二级列表
|
|
|
|
|
|
listResize (e) {
|
|
|
|
|
|
const vm = this
|
|
|
|
|
|
bottomBoxWindow.listResize(vm, e)
|
|
|
|
|
|
},
|
|
|
|
|
|
showBottomBox (targetTab, row) {
|
2022-04-13 17:09:59 +08:00
|
|
|
|
this.sign = row.id
|
2021-04-07 09:58:34 +08:00
|
|
|
|
this.bottomBox.targetTab = targetTab
|
|
|
|
|
|
this.bottomBox.object = JSON.parse(JSON.stringify(row))
|
|
|
|
|
|
this.bottomBox.showSubList = true
|
|
|
|
|
|
},
|
|
|
|
|
|
search (searchObj) {
|
|
|
|
|
|
this.$emit('search', searchObj)
|
2021-07-29 16:23:15 +08:00
|
|
|
|
},
|
|
|
|
|
|
getTableData () {
|
|
|
|
|
|
this.$emit('getTableData')
|
2021-10-09 16:47:38 +08:00
|
|
|
|
},
|
|
|
|
|
|
changeDetailType (item) {
|
|
|
|
|
|
this.$emit('changeDetailType', item)
|
2022-03-17 16:42:56 +08:00
|
|
|
|
},
|
|
|
|
|
|
showFullscreen (flag) {
|
|
|
|
|
|
this.$store.commit('setTopologyShow', flag)
|
2021-04-07 09:58:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
|
|
|
'bottomBox.showSubList': function (n) {
|
|
|
|
|
|
const vm = this
|
|
|
|
|
|
bottomBoxWindow.showSubListWatch(vm, n)
|
2021-04-29 22:24:38 +08:00
|
|
|
|
},
|
|
|
|
|
|
layout: {
|
|
|
|
|
|
immediate: true,
|
|
|
|
|
|
deep: true,
|
|
|
|
|
|
handler (n) {
|
|
|
|
|
|
this.showLayout = [...n]
|
|
|
|
|
|
}
|
2021-04-07 09:58:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|