2021-10-09 16:47:38 +08:00
|
|
|
|
<template>
|
2021-11-01 17:23:01 +08:00
|
|
|
|
<div :class="from" class="list-page detail-view">
|
2021-10-09 16:47:38 +08:00
|
|
|
|
<!-- 主页面 -->
|
|
|
|
|
|
<div class="main-list">
|
|
|
|
|
|
<!-- 顶部工具栏 -->
|
|
|
|
|
|
<div class="main-modal"></div>
|
|
|
|
|
|
<div class="main-container">
|
|
|
|
|
|
<div class="top-tools">
|
|
|
|
|
|
<div class="top-tool-left" style="min-width: 300px">
|
|
|
|
|
|
<slot name="top-tool-left"></slot>
|
2021-10-12 12:25:20 +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-12-20 17:28:52 +08:00
|
|
|
|
<search-input ref="searchInput" :from="from" :position="from" :inTransform="bottomBox.inTransform" :searchMsg="searchMsg" @search="search"></search-input>
|
2021-10-12 12:25:20 +08:00
|
|
|
|
</div>
|
2021-10-09 16:47:38 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div :class="{'top-tool-main-right-to-left': bottomBox.showSubList}" class="top-tool-right">
|
|
|
|
|
|
<slot name="top-tool-right"></slot>
|
|
|
|
|
|
<el-dropdown
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
v-if="showLayout.indexOf('detailViewSet') > -1"
|
2021-10-25 17:59:17 +08:00
|
|
|
|
trigger="click"
|
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"
|
2022-07-01 09:39:20 +08:00
|
|
|
|
type="button" :title="$t('overall.switchView')">
|
2021-10-15 16:41:14 +08:00
|
|
|
|
<i class="nz-icon nz-icon-detail-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-box-select-top right-public-box-dropdown-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>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<!-- 顶部分页组件,当打开底部上滑框时出现 -->
|
|
|
|
|
|
<!-- <div v-if="showLayout.indexOf('pagination') > -1" class="pagination-top pagination-top-hide display-none"></div>-->
|
|
|
|
|
|
</div>
|
2021-10-25 16:28:56 +08:00
|
|
|
|
<div :style="{ height: nzTableHeight }" class="nz-detail-view" :class="dataLength?'':'nz-detail-view-no-data'">
|
2022-03-01 15:19:43 +08:00
|
|
|
|
<div class="nz-detail-view-left" v-show="dataLength">
|
2021-10-09 16:47:38 +08:00
|
|
|
|
<slot name="nz-detail-view-list"></slot>
|
|
|
|
|
|
<div v-if="showLayout.indexOf('pagination') > -1" class="nz-detail-view-pagination">
|
|
|
|
|
|
<slot name="pagination"></slot>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2022-03-01 15:19:43 +08:00
|
|
|
|
<div v-if="!dataLength" class="no-data">
|
2021-10-25 16:28:56 +08:00
|
|
|
|
<svg class="icon" aria-hidden="true">
|
|
|
|
|
|
<use xlink:href="#nz-icon-no-data-list"></use>
|
|
|
|
|
|
</svg>
|
2021-10-28 17:53:27 +08:00
|
|
|
|
<div class="table-no-data__title">No results found</div>
|
2021-10-19 09:47:35 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="nz-detail-view-right" v-if="detailViewRightObj">
|
2021-10-14 14:45:06 +08:00
|
|
|
|
<detailViewRight
|
|
|
|
|
|
@getTableData = 'getTableData'
|
|
|
|
|
|
ref="detailViewRight"
|
|
|
|
|
|
v-if="detailViewRightObj"
|
|
|
|
|
|
:from="from"
|
|
|
|
|
|
:obj="detailViewRightObj"
|
2023-03-15 15:39:06 +08:00
|
|
|
|
:target-tab="'dashboardTab'"
|
2021-10-14 14:45:06 +08:00
|
|
|
|
/>
|
2021-10-11 14:05:07 +08:00
|
|
|
|
</div>
|
2021-10-09 16:47:38 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2022-06-22 14:37:48 +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"
|
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
|
:from="from"
|
|
|
|
|
|
:time-range="timeRange"
|
|
|
|
|
|
:is-fullscreen="true"
|
|
|
|
|
|
@showFullscreen="showFullscreen"
|
|
|
|
|
|
></panel-chart>
|
|
|
|
|
|
</el-dialog>
|
2023-04-20 17:35:17 +08:00
|
|
|
|
<delete-button
|
|
|
|
|
|
ref="deleteButton"
|
2023-08-01 17:39:30 +08:00
|
|
|
|
:from="triggerFrom"
|
2023-04-20 17:35:17 +08:00
|
|
|
|
:forceDeleteShow="forceDeleteShow"
|
|
|
|
|
|
:deleteTitle="deleteTitle"
|
|
|
|
|
|
type=''
|
|
|
|
|
|
:title="$t('overall.delete')"
|
|
|
|
|
|
:api="api"
|
|
|
|
|
|
:single="single"
|
|
|
|
|
|
:delete-objs="singleDelete"
|
|
|
|
|
|
@before="delFlag=true"
|
|
|
|
|
|
></delete-button>
|
|
|
|
|
|
<diagnosis-tab
|
|
|
|
|
|
ref="diagnosisTab"
|
|
|
|
|
|
:diagnosisTabData ="diagnosisTabData"
|
|
|
|
|
|
></diagnosis-tab>
|
2023-08-02 09:52:13 +08:00
|
|
|
|
<config-sync ref="configSync" type="single" :from="triggerFrom" :batch-objs="syncObj"></config-sync>
|
2021-10-09 16:47:38 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import { fromRoute } from '@/components/common/js/constants'
|
|
|
|
|
|
import { bottomBoxWindow } from '@/components/common/js/tools'
|
2021-10-11 14:05:07 +08:00
|
|
|
|
import detailViewRight from '@/components/common/detailView/view/detailViewRight'
|
2022-10-31 14:06:42 +08:00
|
|
|
|
import panelChart from '@/components/chart/panelChart'
|
2023-04-20 17:35:17 +08:00
|
|
|
|
import deleteButton from '@/components/common/deleteButton'
|
|
|
|
|
|
import diagnosisTab from '@/components/common/diagnosisTab'
|
2023-08-02 09:52:13 +08:00
|
|
|
|
import configSync from '@/components/common/configSync'
|
2021-10-09 16:47:38 +08:00
|
|
|
|
export default {
|
2023-08-22 15:50:18 +08:00
|
|
|
|
name: 'nzDetailView',
|
2021-10-09 16:47:38 +08:00
|
|
|
|
components: {
|
2022-06-22 14:37:48 +08:00
|
|
|
|
detailViewRight,
|
2023-04-20 17:35:17 +08:00
|
|
|
|
panelChart,
|
|
|
|
|
|
deleteButton,
|
2023-08-02 09:52:13 +08:00
|
|
|
|
diagnosisTab,
|
|
|
|
|
|
configSync
|
2021-10-09 16:47:38 +08:00
|
|
|
|
},
|
|
|
|
|
|
props: {
|
|
|
|
|
|
from: {
|
|
|
|
|
|
type: String,
|
|
|
|
|
|
default: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
tableTitle: {
|
|
|
|
|
|
type: Array
|
|
|
|
|
|
},
|
|
|
|
|
|
detailType: {
|
|
|
|
|
|
type: String,
|
|
|
|
|
|
default: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
customTableTitle: {
|
|
|
|
|
|
type: Array
|
|
|
|
|
|
},
|
2021-10-19 09:47:35 +08:00
|
|
|
|
dataLength: {
|
|
|
|
|
|
type: Number,
|
|
|
|
|
|
default: 1
|
|
|
|
|
|
},
|
2021-10-09 16:47:38 +08:00
|
|
|
|
layout: {
|
|
|
|
|
|
type: Array,
|
|
|
|
|
|
default () { return [] }
|
|
|
|
|
|
},
|
|
|
|
|
|
searchMsg: {
|
|
|
|
|
|
type: Object
|
|
|
|
|
|
},
|
|
|
|
|
|
nzTableHeightOffset: Number,
|
|
|
|
|
|
searchRight: Boolean,
|
2021-10-11 14:05:07 +08:00
|
|
|
|
operationRecord: Boolean,
|
|
|
|
|
|
detailViewRightObj: {}
|
2021-10-09 16:47:38 +08:00
|
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
nzTableHeight () {
|
|
|
|
|
|
if (this.nzTableHeightOffset) {
|
|
|
|
|
|
if (this.layout.indexOf('clickSearch') > -1) {
|
|
|
|
|
|
return `calc(100% - ${this.nzTableHeightOffset}px`
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return ''
|
2022-06-22 14:37:48 +08:00
|
|
|
|
},
|
|
|
|
|
|
topologyShow () {
|
|
|
|
|
|
return this.$store.getters.getTopologyShow
|
|
|
|
|
|
},
|
|
|
|
|
|
topologyChartInfo () {
|
|
|
|
|
|
return this.$store.getters.getTopologyChartInfo
|
2023-04-20 17:35:17 +08:00
|
|
|
|
},
|
|
|
|
|
|
showDeleteTableRel () {
|
|
|
|
|
|
return this.$store.getters.getShowDeleteTableRel
|
|
|
|
|
|
},
|
|
|
|
|
|
deleteTableRel () {
|
|
|
|
|
|
return this.$store.getters.getDeleteTableRel
|
|
|
|
|
|
},
|
|
|
|
|
|
diagnosisTab () {
|
|
|
|
|
|
return this.$store.getters.getDiagnosisTab
|
2023-08-02 09:52:13 +08:00
|
|
|
|
},
|
|
|
|
|
|
showConfigSync () {
|
|
|
|
|
|
return this.$store.getters.getShowConfigSync
|
|
|
|
|
|
},
|
|
|
|
|
|
configSync () {
|
|
|
|
|
|
return this.$store.getters.getConfigSync
|
2021-10-09 16:47:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
data () {
|
|
|
|
|
|
return {
|
|
|
|
|
|
fromRoute: fromRoute,
|
|
|
|
|
|
/* 二级页面相关 */
|
2023-08-22 15:50:18 +08:00
|
|
|
|
api: '',
|
2021-10-09 16:47:38 +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 // 自定义列弹框是否显示
|
|
|
|
|
|
},
|
2022-06-22 14:37:48 +08:00
|
|
|
|
showLayout: [],
|
2023-04-20 17:35:17 +08:00
|
|
|
|
timeRange: [new Date(), new Date()],
|
|
|
|
|
|
single: true,
|
|
|
|
|
|
deleteTitle: '',
|
|
|
|
|
|
forceDeleteShow: false,
|
|
|
|
|
|
singleDelete: [],
|
2023-08-01 17:39:30 +08:00
|
|
|
|
diagnosisTabData: {},
|
2023-08-02 09:52:13 +08:00
|
|
|
|
// 配置同步数据
|
|
|
|
|
|
syncObj: [],
|
2023-08-01 17:39:30 +08:00
|
|
|
|
triggerFrom: ''
|
2021-10-09 16:47:38 +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) {
|
|
|
|
|
|
this.bottomBox.targetTab = targetTab
|
|
|
|
|
|
this.bottomBox.object = JSON.parse(JSON.stringify(row))
|
|
|
|
|
|
this.bottomBox.showSubList = true
|
|
|
|
|
|
},
|
|
|
|
|
|
search (searchObj) {
|
|
|
|
|
|
this.$emit('search', searchObj)
|
|
|
|
|
|
},
|
2021-10-13 11:12:26 +08:00
|
|
|
|
getTableData () {
|
|
|
|
|
|
this.$emit('getTableData')
|
2021-10-09 16:47:38 +08:00
|
|
|
|
},
|
|
|
|
|
|
changeDetailType (item) {
|
|
|
|
|
|
this.$emit('changeDetailType', item)
|
2022-06-22 14:37:48 +08:00
|
|
|
|
},
|
|
|
|
|
|
showFullscreen (flag) {
|
|
|
|
|
|
this.$store.commit('setTopologyShow', flag)
|
2023-04-20 17:35:17 +08:00
|
|
|
|
},
|
2023-08-02 09:52:13 +08:00
|
|
|
|
configSyncRow (row, from) {
|
|
|
|
|
|
this.triggerFrom = from || this.from
|
|
|
|
|
|
this.syncObj = [row]
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
this.$refs.configSync.showDialog()
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2023-08-01 17:39:30 +08:00
|
|
|
|
delTableRelRow (url, row, forceDeleteShow = false, single = false, deleteTitle = '', from) {
|
|
|
|
|
|
this.triggerFrom = from || this.from
|
2023-04-20 17:35:17 +08:00
|
|
|
|
this.api = url
|
|
|
|
|
|
this.singleDelete = [row]
|
|
|
|
|
|
this.forceDeleteShow = forceDeleteShow
|
|
|
|
|
|
this.single = single
|
|
|
|
|
|
this.deleteTitle = deleteTitle
|
|
|
|
|
|
this.$refs.deleteButton.batchDelete()
|
|
|
|
|
|
},
|
|
|
|
|
|
delTableRow (ids) { // 接收一个 删除的id数组 判断当前底部弹窗id 是否包含 包含则关闭当前弹窗
|
|
|
|
|
|
if (ids.indexOf(this.bottomBox.object.id) !== -1) {
|
|
|
|
|
|
this.bottomBox = {
|
|
|
|
|
|
object: {},
|
|
|
|
|
|
mainResizeShow: true, // dom高度改变时是否展示|隐藏
|
|
|
|
|
|
subResizeShow: true,
|
|
|
|
|
|
isFullScreen: false, // 全屏状态
|
|
|
|
|
|
showSubList: false, // 是否显示二级列表
|
|
|
|
|
|
targetTab: '', // 显示二级列表中的哪个页签
|
|
|
|
|
|
inTransform: false // 搜索框相关,搜索条件下拉框是否在transform里
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-10-09 16:47:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
|
|
|
'bottomBox.showSubList': function (n) {
|
|
|
|
|
|
const vm = this
|
|
|
|
|
|
bottomBoxWindow.showSubListWatch(vm, n)
|
|
|
|
|
|
},
|
|
|
|
|
|
layout: {
|
|
|
|
|
|
immediate: true,
|
|
|
|
|
|
deep: true,
|
|
|
|
|
|
handler (n) {
|
|
|
|
|
|
this.showLayout = [...n]
|
|
|
|
|
|
}
|
2023-04-20 17:35:17 +08:00
|
|
|
|
},
|
|
|
|
|
|
showDeleteTableRel (n) {
|
|
|
|
|
|
if (n) {
|
2023-08-01 17:39:30 +08:00
|
|
|
|
this.delTableRelRow(this.deleteTableRel.url, this.deleteTableRel.row, this.deleteTableRel.forceDeleteShow, this.deleteTableRel.single, this.deleteTableRel.deleteTitle, this.deleteTableRel.from)
|
2023-04-20 17:35:17 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
diagnosisTab (n) {
|
|
|
|
|
|
this.diagnosisTabData = n
|
2023-08-02 09:52:13 +08:00
|
|
|
|
},
|
|
|
|
|
|
showConfigSync (n) {
|
|
|
|
|
|
if (n) {
|
|
|
|
|
|
this.configSyncRow(this.configSync.row, this.configSync.from)
|
|
|
|
|
|
}
|
2021-10-09 16:47:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|