2021-04-22 12:25:23 +08:00
|
|
|
<template>
|
|
|
|
|
<el-table
|
|
|
|
|
id="roleTable"
|
|
|
|
|
ref="dataTable"
|
|
|
|
|
:data="tableData"
|
|
|
|
|
:height="height"
|
2021-10-13 18:24:09 +08:00
|
|
|
:default-sort="orderBy"
|
2021-04-22 12:25:23 +08:00
|
|
|
border
|
|
|
|
|
@header-dragend="dragend"
|
|
|
|
|
@sort-change="tableDataSort"
|
|
|
|
|
@selection-change="selectionChange"
|
2021-05-25 15:37:33 +08:00
|
|
|
@row-dblclick="(row)=>{$emit('showBottomBox', 'panelTab', row)}"
|
2021-04-22 12:25:23 +08:00
|
|
|
>
|
|
|
|
|
<el-table-column
|
|
|
|
|
:resizable="false"
|
|
|
|
|
align="center"
|
|
|
|
|
type="selection"
|
|
|
|
|
width="55">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
v-for="(item, index) in customTableTitle"
|
|
|
|
|
v-if="item.show"
|
|
|
|
|
:key="`col-${index}`"
|
|
|
|
|
:fixed="item.fixed"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:min-width="`${item.minWidth}`"
|
|
|
|
|
:prop="item.prop"
|
|
|
|
|
:resizable="true"
|
|
|
|
|
:sort-orders="['ascending', 'descending']"
|
2021-05-07 19:10:28 +08:00
|
|
|
:sortable="item.sortable"
|
2021-04-22 12:25:23 +08:00
|
|
|
:width="`${item.width}`"
|
|
|
|
|
class="data-column"
|
|
|
|
|
>
|
|
|
|
|
<template slot="header">
|
2021-10-15 16:57:17 +08:00
|
|
|
<span class="data-column__span">{{item.label}} <i class="nz-icon nz-icon-label" v-if="item.type==='label'" style="color: #fa901c"/></span>
|
2021-04-22 12:25:23 +08:00
|
|
|
<div class="col-resize-area"></div>
|
|
|
|
|
</template>
|
|
|
|
|
<template slot-scope="scope" :column="item">
|
|
|
|
|
<template v-if="item.prop === 'type'">{{scope.row.type ? scope.row.type.name : '-'}}</template>
|
|
|
|
|
<template v-else-if="item.prop === 'state'">{{scope.row.state ? scope.row.state.name : '-'}}</template>
|
|
|
|
|
<template v-else-if="item.prop === 'endpointNum'">
|
2021-04-29 22:24:38 +08:00
|
|
|
<span style="cursor: pointer" @click="$emit('showBottomBox', 'endpointTab', scope.row)"><i class="nz-icon nz-icon-overview-endpoint monitorColor"></i> <span>{{scope.row.endpointNum ? scope.row.endpointNum : 0}}</span></span>
|
2021-04-26 21:42:15 +08:00
|
|
|
<!-- <div :class="messageStyle(item, scope.row)" @mouseenter="showTableTooltip(`${$t('asset.down')} / ${$t('asset.suspended')} / ${$t('asset.total')}`, true, $event)" @mouseleave="hideTableTooltip">
|
2021-04-22 12:25:23 +08:00
|
|
|
<span class="link" style="padding: 2px 8px" @click="showEndpoint(scope.row)">{{scope.row.endpointDownNum}}/{{scope.row.endpointSuspendedNum}}/{{scope.row.endpointNum}}</span>
|
2021-04-26 21:42:15 +08:00
|
|
|
</div>-->
|
2021-04-22 12:25:23 +08:00
|
|
|
</template>
|
|
|
|
|
<template v-else-if="item.prop === 'alertNum'">
|
2021-04-29 22:24:38 +08:00
|
|
|
<span style="cursor: pointer" @click="$emit('showBottomBox', 'alertMessageTab', scope.row)"><i :class="scope.row.alertNum ? 'red' : 'green'" class="nz-icon nz-icon-overview-alert"></i> <span>{{scope.row.alertNum ? scope.row.alertNum : 0}}</span></span>
|
2021-04-22 12:25:23 +08:00
|
|
|
</template>
|
|
|
|
|
<template v-else-if="item.prop === 'dc'">{{scope.row.dc ? scope.row.dc.name : '-'}}</template>
|
|
|
|
|
<template v-else-if="item.prop === 'cabinet'">
|
|
|
|
|
<span v-if="scope.row.cabinet && scope.row.cabinet !== '--'">{{scope.row.cabinet.name}} {{returnCabinet( scope.row.cabinetStart, scope.row.cabinetEnd)}}</span>
|
2021-07-09 15:35:58 +08:00
|
|
|
<span v-else >-</span>
|
2021-04-22 12:25:23 +08:00
|
|
|
</template>
|
2021-07-28 14:12:58 +08:00
|
|
|
<template v-else-if="item.prop === 'pingInfo'">
|
2021-10-13 11:12:26 +08:00
|
|
|
<div class="ping-info" v-if="scope.row.pingInfo">
|
2021-10-11 16:12:09 +08:00
|
|
|
<div :class="{'active-icon green-bg':scope.row.pingInfo.status == 1,'active-icon red-bg':scope.row.pingInfo.status == 0}" style="position: relative">
|
2021-07-28 14:12:58 +08:00
|
|
|
</div>
|
2021-10-11 16:12:09 +08:00
|
|
|
<div class="active-icon-content">{{$t('asset.assetStatPre')+(scope.row.pingInfo.lastUpdate?utcTimeToTimezoneStr(scope.row.pingInfo.lastUpdate):$t('asset.assetStatDown'))}}</div>
|
|
|
|
|
{{scope.row.pingInfo.rtt?scope.row.pingInfo.rtt+'ms':''}}
|
|
|
|
|
</div>
|
2021-05-13 11:40:22 +08:00
|
|
|
</template>
|
2021-04-22 12:25:23 +08:00
|
|
|
<template v-else-if="item.prop === 'model'">{{scope.row.model ? scope.row.model.name : '-'}}</template>
|
2021-07-16 09:56:18 +08:00
|
|
|
<template v-else-if="item.prop === 'parent'">
|
|
|
|
|
<span
|
|
|
|
|
v-if="scope.row.parent"
|
2021-07-16 14:43:20 +08:00
|
|
|
style="cursor: pointer"
|
2021-07-16 09:56:18 +08:00
|
|
|
@mouseenter="labelHover(scope.row, 'asset', true, $event)"
|
|
|
|
|
@mouseleave="labelHover(scope.row, 'asset', false)">
|
|
|
|
|
{{scope.row.parent.name}}
|
|
|
|
|
<alertLabel
|
|
|
|
|
v-if="scope.row.loading"
|
|
|
|
|
:id="scope.row.pid"
|
|
|
|
|
:that="scope.row"
|
|
|
|
|
:type="'asset'"
|
|
|
|
|
></alertLabel>
|
|
|
|
|
</span>
|
|
|
|
|
<span v-else> - </span>
|
|
|
|
|
</template>
|
2021-07-15 14:38:55 +08:00
|
|
|
<template v-else-if="item.prop === 'children'">
|
2021-07-16 09:56:18 +08:00
|
|
|
<div @click="$emit('showBottomBox', 'assetSubTab', scope.row)" v-if="scope.row.childrenNum" style="cursor: pointer">
|
2021-07-15 15:30:23 +08:00
|
|
|
<i class="nz-icon nz-icon-overview-project monitorColor color23BF9A"></i>
|
|
|
|
|
{{scope.row.childrenNum}}</div>
|
2021-07-16 09:56:18 +08:00
|
|
|
<!-- <span v-else-if="scope.row.pid == -1"> <i class="nz-icon nz-icon-overview-project monitorColor color23BF9A"></i> 0 </span>-->
|
2021-07-15 14:38:55 +08:00
|
|
|
<span v-else> - </span>
|
|
|
|
|
</template>
|
2021-07-28 14:12:58 +08:00
|
|
|
<template v-else-if="item.prop === 'clientState'">
|
|
|
|
|
<div v-if="scope.row[item.prop]===1">
|
2021-09-06 18:58:35 +08:00
|
|
|
<div class="active-icon green-bg inline-block"></div>
|
|
|
|
|
{{ $t('overall.normal') }}
|
2021-07-28 14:12:58 +08:00
|
|
|
</div>
|
|
|
|
|
<div v-else-if="scope.row[item.prop]===0">
|
2021-09-06 18:58:35 +08:00
|
|
|
<div class="active-icon red-bg inline-block"></div> {{ $t('overall.unusual') }}
|
2021-07-28 14:12:58 +08:00
|
|
|
</div>
|
|
|
|
|
<div v-else-if="scope.row[item.prop]===-1">
|
2021-09-06 18:58:35 +08:00
|
|
|
<div class="active-icon red-bg inline-block"></div> {{ $t('overall.AuthenticationFailed') }}
|
2021-07-28 14:12:58 +08:00
|
|
|
</div>
|
|
|
|
|
<template v-else>-</template>
|
|
|
|
|
</template>
|
2021-04-22 12:25:23 +08:00
|
|
|
<template v-else-if="item.prop === 'brand'">{{scope.row.brand ? scope.row.brand.name : '-'}}</template>
|
2021-08-12 14:28:23 +08:00
|
|
|
<template v-else-if="item.prop === 'purchaseDate'">{{scope.row.purchaseDate ? scope.row.purchaseDate : '-'}}</template>
|
2021-06-02 16:55:17 +08:00
|
|
|
<template v-else>
|
|
|
|
|
<span v-if="scope.row.fields&&scope.row.fields.find(field => field.name === item.prop)">
|
|
|
|
|
{{scope.row.fields.find(field => field.name === item.prop).value.join(',')}}
|
|
|
|
|
</span>
|
|
|
|
|
<span v-else>
|
|
|
|
|
{{scope.row[item.prop]}}
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
2021-04-22 12:25:23 +08:00
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
:resizable="false"
|
2021-05-27 17:58:29 +08:00
|
|
|
v-if="showOption"
|
2021-04-22 12:25:23 +08:00
|
|
|
:width="operationWidth"
|
|
|
|
|
fixed="right">
|
|
|
|
|
<div slot="header" class="table-operation-title">{{$t('overall.option')}}</div>
|
|
|
|
|
<div slot-scope="scope" class="table-operation-items">
|
2021-06-28 09:57:57 +08:00
|
|
|
<button v-if="assetTab" class="table-operation-item" v-has="'model_edit'" @click="$emit('edit', scope.row)"><i class="nz-icon nz-icon-edit"></i></button>
|
|
|
|
|
<button v-else class="table-operation-item" @click="$emit('showBottomBox', 'panelTab', scope.row)"><i class="nz-icon nz-icon-view1"></i></button>
|
2021-10-25 17:16:40 +08:00
|
|
|
<el-dropdown size="medium" v-has="['asset_edit','asset_connect','asset_add','asset_delete']" trigger="click" @command="tableOperation">
|
2021-04-22 12:25:23 +08:00
|
|
|
<div class="table-operation-item table-operation-item--more">
|
2021-05-27 13:53:42 +08:00
|
|
|
<i class="nz-icon nz-icon-more3"></i>
|
2021-04-22 12:25:23 +08:00
|
|
|
</div>
|
2021-09-26 18:14:47 +08:00
|
|
|
<el-dropdown-menu slot="dropdown" class="right-public-box-select-top right-public-box-dropdown-top">
|
2021-06-28 09:57:57 +08:00
|
|
|
<el-dropdown-item v-if="!assetTab" v-has="'asset_edit'" :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>
|
2021-05-24 10:12:01 +08:00
|
|
|
<el-dropdown-item v-has="'asset_connect'" :command="['cli', scope.row]" :disabled="!scope.row.authUsername"><i class="nz-icon nz-icon-cli"></i><span class="operation-dropdown-text">{{$t('dashboard.connect')}}</span></el-dropdown-item>
|
2021-05-19 14:04:16 +08:00
|
|
|
<el-dropdown-item v-has="'asset_add'" :command="['duplicate', scope.row]"><i class="nz-icon nz-icon-override"></i><span class="operation-dropdown-text">{{$t('dashboard.duplicate')}}</span></el-dropdown-item>
|
|
|
|
|
<el-dropdown-item v-has="'asset_delete'" :command="['delete', scope.row]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
|
2021-06-01 14:26:09 +08:00
|
|
|
<el-dropdown-item v-has="'alertSilence_add'" :command="['fastSilence', scope.row, 'asset']"><i class="nz-icon nz-icon-fast-silence"></i><span class="operation-dropdown-text">{{$t('overall.silenceAlert')}}</span></el-dropdown-item>
|
2021-04-22 12:25:23 +08:00
|
|
|
</el-dropdown-menu>
|
|
|
|
|
</el-dropdown>
|
|
|
|
|
</div>
|
|
|
|
|
</el-table-column>
|
2021-10-22 19:39:49 +08:00
|
|
|
<template slot="empty">
|
2021-10-25 14:45:28 +08:00
|
|
|
<div v-if="!loading" class="table-no-data">
|
2021-10-22 17:47:42 +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-22 17:47:42 +08:00
|
|
|
</div>
|
2021-10-22 19:39:49 +08:00
|
|
|
<div v-else> </div>
|
2021-10-22 17:47:42 +08:00
|
|
|
</template>
|
2021-04-22 12:25:23 +08:00
|
|
|
</el-table>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import table from '@/components/common/mixin/table'
|
|
|
|
|
import { showTableTooltip, hideTableTooltip } from '@/components/common/js/tools'
|
2021-07-28 14:12:58 +08:00
|
|
|
// import bus from '@/libs/bus'
|
2021-07-16 09:56:18 +08:00
|
|
|
import alertLabel from '@/components/common/alert/alertLabel'
|
2021-04-22 12:25:23 +08:00
|
|
|
export default {
|
|
|
|
|
name: 'assetTable',
|
|
|
|
|
mixins: [table],
|
2021-07-16 09:56:18 +08:00
|
|
|
components: {
|
|
|
|
|
alertLabel: alertLabel
|
|
|
|
|
},
|
2021-05-27 17:58:29 +08:00
|
|
|
props: {
|
|
|
|
|
showOption: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: true
|
2021-06-28 09:57:57 +08:00
|
|
|
},
|
2021-10-22 17:47:42 +08:00
|
|
|
assetTab: Boolean,
|
|
|
|
|
loading: Boolean
|
2021-05-27 17:58:29 +08:00
|
|
|
},
|
2021-04-22 12:25:23 +08:00
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
tableTitle: [
|
|
|
|
|
{
|
2021-04-26 21:42:15 +08:00
|
|
|
label: 'ID',
|
2021-04-22 12:25:23 +08:00
|
|
|
prop: 'id',
|
2021-04-26 21:42:15 +08:00
|
|
|
show: true,
|
2021-05-07 19:10:28 +08:00
|
|
|
width: 110,
|
2021-05-13 10:06:03 +08:00
|
|
|
sortable: 'custom'
|
2021-04-22 12:25:23 +08:00
|
|
|
}, {
|
|
|
|
|
label: this.$t('overall.name'),
|
|
|
|
|
prop: 'name',
|
2021-05-07 19:10:28 +08:00
|
|
|
show: true,
|
2021-05-24 17:46:21 +08:00
|
|
|
minWidth: 150,
|
2021-05-13 10:06:03 +08:00
|
|
|
sortable: 'custom'
|
2021-04-26 21:42:15 +08:00
|
|
|
}, {
|
|
|
|
|
label: this.$t('asset.manageIp'),
|
|
|
|
|
prop: 'manageIp',
|
|
|
|
|
show: true,
|
2021-07-28 14:12:58 +08:00
|
|
|
minWidth: 140,
|
2021-05-13 10:06:03 +08:00
|
|
|
sortable: 'custom'
|
2021-04-22 12:25:23 +08:00
|
|
|
}, {
|
|
|
|
|
label: this.$t('overall.parent'),
|
|
|
|
|
prop: 'parent',
|
2021-04-26 21:42:15 +08:00
|
|
|
show: false,
|
2021-07-28 14:12:58 +08:00
|
|
|
minWidth: 110
|
2021-07-16 14:43:20 +08:00
|
|
|
}, {
|
|
|
|
|
label: this.$t('overall.children'),
|
|
|
|
|
prop: 'children',
|
|
|
|
|
show: false,
|
2021-07-28 14:12:58 +08:00
|
|
|
minWidth: 120
|
2021-04-22 12:25:23 +08:00
|
|
|
}, {
|
|
|
|
|
label: this.$t('overall.type'),
|
|
|
|
|
prop: 'type',
|
|
|
|
|
show: true,
|
2021-07-28 14:12:58 +08:00
|
|
|
minWidth: 140,
|
2021-05-13 10:06:03 +08:00
|
|
|
sortable: 'custom'
|
2021-04-22 12:25:23 +08:00
|
|
|
}, {
|
|
|
|
|
label: this.$t('asset.state'),
|
|
|
|
|
prop: 'state',
|
|
|
|
|
show: true,
|
2021-07-28 14:12:58 +08:00
|
|
|
minWidth: 110,
|
2021-05-13 10:06:03 +08:00
|
|
|
sortable: 'custom'
|
2021-05-13 11:40:22 +08:00
|
|
|
}, {
|
|
|
|
|
label: this.$t('asset.pingInfo'),
|
|
|
|
|
prop: 'pingInfo',
|
|
|
|
|
show: true,
|
2021-07-28 14:12:58 +08:00
|
|
|
minWidth: 110
|
2021-04-22 12:25:23 +08:00
|
|
|
}, {
|
|
|
|
|
label: this.$t('overall.dc'),
|
|
|
|
|
prop: 'dc',
|
|
|
|
|
show: true,
|
2021-07-28 14:12:58 +08:00
|
|
|
minWidth: 140,
|
2021-05-13 10:06:03 +08:00
|
|
|
sortable: 'custom'
|
2021-04-22 12:25:23 +08:00
|
|
|
}, {
|
|
|
|
|
label: this.$t('asset.cabinet'),
|
|
|
|
|
prop: 'cabinet',
|
|
|
|
|
show: true,
|
2021-07-28 14:12:58 +08:00
|
|
|
minWidth: 110,
|
2021-05-13 10:06:03 +08:00
|
|
|
sortable: 'custom'
|
2021-04-22 12:25:23 +08:00
|
|
|
}, {
|
|
|
|
|
label: this.$t('asset.alertNum'),
|
2021-04-26 21:42:15 +08:00
|
|
|
prop: 'alertNum',
|
2021-04-22 12:25:23 +08:00
|
|
|
show: true,
|
2021-07-28 14:12:58 +08:00
|
|
|
minWidth: 140,
|
2021-05-13 10:06:03 +08:00
|
|
|
sortable: 'custom'
|
2021-04-22 12:25:23 +08:00
|
|
|
}, {
|
|
|
|
|
label: this.$t('asset.endpointNum2'),
|
|
|
|
|
prop: 'endpointNum',
|
|
|
|
|
show: true,
|
2021-07-28 14:12:58 +08:00
|
|
|
minWidth: 160,
|
2021-05-13 10:06:03 +08:00
|
|
|
sortable: 'custom'
|
2021-04-26 21:42:15 +08:00
|
|
|
}, {
|
|
|
|
|
label: this.$t('asset.brand'),
|
|
|
|
|
prop: 'brand',
|
|
|
|
|
show: true,
|
2021-07-28 14:12:58 +08:00
|
|
|
minWidth: 120,
|
2021-05-13 10:06:03 +08:00
|
|
|
sortable: 'custom'
|
2021-04-26 21:42:15 +08:00
|
|
|
}, {
|
|
|
|
|
label: this.$t('asset.model'),
|
|
|
|
|
prop: 'model',
|
|
|
|
|
show: true,
|
2021-07-28 14:12:58 +08:00
|
|
|
minWidth: 110,
|
2021-05-13 10:06:03 +08:00
|
|
|
sortable: 'custom'
|
2021-04-26 21:42:15 +08:00
|
|
|
}, {
|
|
|
|
|
label: 'SN',
|
|
|
|
|
prop: 'sn',
|
|
|
|
|
show: true,
|
2021-07-28 14:12:58 +08:00
|
|
|
minWidth: 110
|
|
|
|
|
}, {
|
2021-07-28 14:19:08 +08:00
|
|
|
label: 'Talon',
|
2021-07-28 14:12:58 +08:00
|
|
|
prop: 'clientState',
|
|
|
|
|
show: true,
|
|
|
|
|
sortable: 'custom',
|
|
|
|
|
minWidth: 150
|
2021-04-22 12:25:23 +08:00
|
|
|
}, {
|
|
|
|
|
label: this.$t('asset.purchaseDate'),
|
|
|
|
|
prop: 'purchaseDate',
|
|
|
|
|
show: false,
|
2021-07-28 14:12:58 +08:00
|
|
|
minWidth: 120
|
2021-04-22 12:25:23 +08:00
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
showTableTooltip,
|
|
|
|
|
hideTableTooltip,
|
2021-07-07 16:57:26 +08:00
|
|
|
tableDataSort (item) {
|
|
|
|
|
let orderBy = ''
|
2021-07-28 14:12:58 +08:00
|
|
|
let str = item.prop
|
2021-07-07 16:57:26 +08:00
|
|
|
if (str === 'dc') {
|
|
|
|
|
orderBy = str
|
|
|
|
|
}
|
2021-07-28 14:12:58 +08:00
|
|
|
if (str === 'clientState') {
|
|
|
|
|
str = 'talon_status'
|
|
|
|
|
orderBy = str
|
|
|
|
|
}
|
2021-07-07 16:57:26 +08:00
|
|
|
if (item.order === 'ascending') {
|
|
|
|
|
orderBy = str
|
|
|
|
|
}
|
|
|
|
|
if (item.order === 'descending') {
|
|
|
|
|
orderBy = '-' + str
|
|
|
|
|
}
|
|
|
|
|
this.$emit('orderBy', orderBy)
|
|
|
|
|
},
|
2021-04-22 12:25:23 +08:00
|
|
|
messageStyle (title, row) {
|
|
|
|
|
if (title.prop === 'alertNum') {
|
|
|
|
|
if (row.alertNum > 0) {
|
|
|
|
|
return 'danger'
|
|
|
|
|
} else {
|
|
|
|
|
return 'success'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (title.label === 'endpointNum') {
|
|
|
|
|
if (row.state === 3) {
|
|
|
|
|
return 'suspended'
|
|
|
|
|
} else {
|
|
|
|
|
if (row.endpointDownNum > 0) {
|
|
|
|
|
return 'danger'
|
|
|
|
|
} else {
|
|
|
|
|
return 'success'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return ''
|
|
|
|
|
},
|
|
|
|
|
showEndpoint (asset) {
|
|
|
|
|
this.bottomBox.asset = Object.assign({}, asset)
|
|
|
|
|
this.bottomBox.targetTab = 'endpoint'
|
|
|
|
|
this.bottomBox.showSubList = true
|
|
|
|
|
},
|
2021-07-16 09:56:18 +08:00
|
|
|
// label 鼠标划入
|
|
|
|
|
labelHover (item, type, loading, e) {
|
|
|
|
|
if (e) {
|
|
|
|
|
const dom = e.currentTarget
|
|
|
|
|
const position = dom.getBoundingClientRect()
|
|
|
|
|
this.$set(item, 'position', position)
|
|
|
|
|
}
|
|
|
|
|
this.$set(item, 'loading', loading)
|
|
|
|
|
// this.$set(this.tableData,index,item);// 调用父组件
|
|
|
|
|
},
|
2021-04-22 12:25:23 +08:00
|
|
|
returnCabinet (start, end) { // 返回机柜u位信息
|
|
|
|
|
if (!start || !end) {
|
|
|
|
|
return ''
|
|
|
|
|
}
|
|
|
|
|
return `[${start}-${end}]`
|
|
|
|
|
}
|
2021-07-28 14:12:58 +08:00
|
|
|
// formatPingTime (str) {
|
|
|
|
|
// if (!str || str == '') {
|
|
|
|
|
// return this.$t('asset.assetStatPre') + this.$t('asset.assetStatDown')
|
|
|
|
|
// }
|
|
|
|
|
// const ds = '-'
|
|
|
|
|
// const ts = ':'
|
|
|
|
|
// const time = new Date(bus.UTCTimeToConfigTimezone(str))
|
|
|
|
|
// const year = time.getFullYear()
|
|
|
|
|
// const month = time.getMonth() + 1 > 9 ? time.getMonth() + 1 : ('0' + (time.getMonth() + 1))
|
|
|
|
|
// const day = time.getDate() > 9 ? time.getDate() : ('0' + time.getDate())
|
|
|
|
|
// const hours = time.getHours() > 9 ? time.getHours() : ('0' + time.getHours())
|
|
|
|
|
// const minutes = time.getMinutes() > 9 ? time.getMinutes() : ('0' + time.getMinutes())
|
|
|
|
|
// const seconds = time.getSeconds() > 9 ? time.getSeconds() : ('0' + time.getSeconds())
|
|
|
|
|
// return this.$t('asset.assetStatPre') + year + ds + month + ds + day + ' ' + hours + ts + minutes + ts + seconds
|
|
|
|
|
// }
|
2021-04-22 12:25:23 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
2021-10-11 16:12:09 +08:00
|
|
|
<style scoped lang="scss">
|
|
|
|
|
/deep/ .el-table__row{
|
|
|
|
|
td{
|
|
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.active-icon-content {
|
|
|
|
|
display: none;
|
|
|
|
|
position: absolute;
|
|
|
|
|
background: #FFF;
|
|
|
|
|
min-width: 150px;
|
|
|
|
|
border: 1px solid #EBEEF5;
|
|
|
|
|
padding: 12px;
|
|
|
|
|
z-index: 2000;
|
|
|
|
|
color: #606266;
|
|
|
|
|
line-height: 1.4;
|
|
|
|
|
text-align: justify;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
box-shadow: 0 2px 12px 0 rgba(0,0,0,0.1);
|
|
|
|
|
left: 100%;
|
|
|
|
|
top: -60%;
|
|
|
|
|
width: auto;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
transform: translateY(50%);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.ping-info:hover {
|
|
|
|
|
.active-icon-content{
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|