2021-04-22 12:25:23 +08:00
|
|
|
|
<template>
|
2022-03-09 19:32:04 +08:00
|
|
|
|
<div style="height: 100%">
|
|
|
|
|
|
<el-table
|
|
|
|
|
|
id="roleTable"
|
|
|
|
|
|
ref="dataTable"
|
|
|
|
|
|
class="asset-table2"
|
|
|
|
|
|
:data="tableData"
|
|
|
|
|
|
:height="height"
|
|
|
|
|
|
:default-sort="orderBy"
|
|
|
|
|
|
border
|
2022-10-19 13:57:17 +08:00
|
|
|
|
@cell-mouse-enter="cellMouseEnter"
|
2022-03-09 19:32:04 +08:00
|
|
|
|
@header-dragend="dragend"
|
|
|
|
|
|
@sort-change="tableDataSort"
|
|
|
|
|
|
@selection-change="selectionChange"
|
2023-10-30 11:27:02 +08:00
|
|
|
|
@row-dblclick="(row)=>{showBottomBox('dashboardTab', row)}"
|
2021-04-22 12:25:23 +08:00
|
|
|
|
>
|
2022-03-09 19:32:04 +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"
|
2023-05-17 16:43:27 +08:00
|
|
|
|
:key="`col-${index}-${item.prop}`"
|
2022-03-09 19:32:04 +08:00
|
|
|
|
:fixed="item.fixed"
|
|
|
|
|
|
:label="item.label"
|
|
|
|
|
|
:min-width="`${item.minWidth}`"
|
|
|
|
|
|
:prop="item.prop"
|
|
|
|
|
|
:resizable="true"
|
|
|
|
|
|
:sort-orders="['ascending', 'descending']"
|
|
|
|
|
|
:sortable="item.sortable"
|
|
|
|
|
|
:width="`${item.width}`"
|
|
|
|
|
|
class="data-column"
|
|
|
|
|
|
>
|
|
|
|
|
|
<template slot="header">
|
|
|
|
|
|
<span class="data-column__span">{{item.label}} <i class="nz-icon nz-icon-label" v-if="item.type==='label'" style="color: #fa901c"/></span>
|
|
|
|
|
|
<div class="col-resize-area"></div>
|
2021-04-22 12:25:23 +08:00
|
|
|
|
</template>
|
2022-03-09 19:32:04 +08:00
|
|
|
|
<template slot-scope="scope" :column="item">
|
2022-06-21 13:59:36 +08:00
|
|
|
|
<template v-if="item.prop === 'name'">
|
2022-08-17 10:30:11 +08:00
|
|
|
|
<!-- <div class="document-copy-block">
|
2022-06-23 13:40:20 +08:00
|
|
|
|
<span class="document-copy-text">{{scope.row.name ? scope.row.name : '-'}}</span>
|
2022-07-22 10:46:49 +08:00
|
|
|
|
<i v-if="scope.row.name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(scope.row.name)" :title="$t('overall.copyText')"></i>
|
2022-08-17 10:30:11 +08:00
|
|
|
|
</div> -->
|
2022-10-20 16:38:11 +08:00
|
|
|
|
<copy :copyData='scope.row.name' :showInfo='scope.row.name'>
|
2022-08-17 10:30:11 +08:00
|
|
|
|
<template slot="copy-text">
|
|
|
|
|
|
{{scope.row.name ? scope.row.name : '-'}}
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</copy>
|
2022-06-21 13:59:36 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="item.prop === 'manageIp'">
|
2022-10-20 16:38:11 +08:00
|
|
|
|
<copy :copyData='scope.row.manageIp' :showInfo='scope.row.manageIp'>
|
2022-08-17 10:30:11 +08:00
|
|
|
|
<template slot="copy-text">
|
|
|
|
|
|
{{scope.row.manageIp ? scope.row.manageIp : '-'}}
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</copy>
|
2022-06-21 13:59:36 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="item.prop === 'type'">{{scope.row.type ? scope.row.type.name : '-'}}</template>
|
2022-03-09 19:32:04 +08:00
|
|
|
|
<template v-else-if="item.prop === 'state'">{{scope.row.state ? scope.row.state.name : '-'}}</template>
|
|
|
|
|
|
<template v-else-if="item.prop === 'endpointNum'">
|
2023-10-30 11:27:02 +08:00
|
|
|
|
<span class="num-cursor" @click.stop="showBottomBox('endpointTab', scope.row)" @dblclick.stop="">
|
2023-06-06 17:46:16 +08:00
|
|
|
|
<i class="nz-icon nz-icon-overview-endpoint monitorColor"></i>
|
|
|
|
|
|
<span>{{scope.row.endpointNum ? scope.row.endpointNum : 0}}</span>
|
|
|
|
|
|
</span>
|
2022-03-09 19:32:04 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="item.prop === 'alertNum'">
|
2023-06-06 17:46:16 +08:00
|
|
|
|
<!-- v-my-loading:ldsFacebook="scope.row.trendLoading" -->
|
2023-10-30 11:27:02 +08:00
|
|
|
|
<span class="num-cursor" @click.stop="showBottomBox('alertMessageTab', scope.row)" @dblclick.stop="">
|
2023-06-06 17:46:16 +08:00
|
|
|
|
<i :class="scope.row.alertNum ? 'red' : 'green'" class="nz-icon nz-icon-overview-alert vertical-align-top;" @mouseenter="tooltipHover(scope.row,true, $event)" @mouseleave="tooltipHover(scope.row,false, $event)"></i>
|
|
|
|
|
|
<div v-if="scope.row.alertNumtooltipShow" class="alert-days-info-tooltip" :style="{left: scope.row.left + 'px',top:scope.row.top + 'px'}">
|
|
|
|
|
|
<div class="tooltip-title">{{$t('project.topology.alert')}}({{$t('overall.active')}})</div>
|
|
|
|
|
|
<div class="severity-info" style='justify-content: space-between'>
|
|
|
|
|
|
<div class="severity-name">{{$t('overall.result.total')}}</div>
|
|
|
|
|
|
<div class="severity-value">{{scope.row.alertNum}}</div>
|
|
|
|
|
|
</div>
|
2022-02-25 10:53:43 +08:00
|
|
|
|
</div>
|
2023-06-06 17:46:16 +08:00
|
|
|
|
<alertDaysInfo
|
|
|
|
|
|
v-show="!scope.row.trendLoading"
|
|
|
|
|
|
:alertDaysData="scope.row.alertDaysData"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</span>
|
2022-03-09 19:32:04 +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>
|
|
|
|
|
|
<span v-else >-</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="item.prop === 'pingInfo'">
|
|
|
|
|
|
<div class="ping-info" v-if="scope.row.pingInfo">
|
|
|
|
|
|
<div :class="{'active-icon green-bg':scope.row.pingInfo.status == 1,'active-icon red-bg':scope.row.pingInfo.status == 0}" style="position: relative">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<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':''}}
|
2021-07-28 14:12:58 +08:00
|
|
|
|
</div>
|
2022-03-09 19:32:04 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="item.prop === 'model'">{{scope.row.model ? scope.row.model.name : '-'}}</template>
|
|
|
|
|
|
<template v-else-if="item.prop === 'parent'">
|
2021-07-16 09:56:18 +08:00
|
|
|
|
<span
|
|
|
|
|
|
v-if="scope.row.parent"
|
2022-03-09 19:32:04 +08:00
|
|
|
|
@mouseenter="labelHover(scope.row, 'asset', true, false, $event)"
|
|
|
|
|
|
@mouseleave="labelHover(scope.row, 'asset', false, false)">
|
2021-07-16 09:56:18 +08:00
|
|
|
|
{{scope.row.parent.name}}
|
|
|
|
|
|
</span>
|
2022-03-09 19:32:04 +08:00
|
|
|
|
<span v-else> - </span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="item.prop === 'children'">
|
2023-10-30 11:27:02 +08:00
|
|
|
|
<div @click.stop="showBottomBox('assetSubTab', scope.row)" v-if="scope.row.childrenNum" style="cursor: pointer" @dblclick.stop="">
|
2022-03-09 19:32:04 +08:00
|
|
|
|
<i class="nz-icon nz-icon-overview-project monitorColor color23BF9A"></i>
|
|
|
|
|
|
{{scope.row.childrenNum}}</div>
|
|
|
|
|
|
<!-- <span v-else-if="scope.row.pid == -1"> <i class="nz-icon nz-icon-overview-project monitorColor color23BF9A"></i> 0 </span>-->
|
|
|
|
|
|
<span v-else> - </span>
|
|
|
|
|
|
</template>
|
2022-06-21 13:59:36 +08:00
|
|
|
|
<template v-else-if="item.prop === 'sn'">
|
2022-10-20 17:08:16 +08:00
|
|
|
|
<copy :copyData='scope.row[item.prop]' :showInfo='scope.row[item.prop]'>
|
|
|
|
|
|
<template slot="copy-text">
|
|
|
|
|
|
{{scope.row[item.prop]?scope.row[item.prop]:'-'}}
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</copy>
|
2022-06-21 13:59:36 +08:00
|
|
|
|
</template>
|
2022-03-18 15:37:43 +08:00
|
|
|
|
<template v-else-if="item.prop === 'talon'">
|
|
|
|
|
|
<div v-if="scope.row['clientState']===1">
|
2022-03-09 19:32:04 +08:00
|
|
|
|
<div class="active-icon green-bg inline-block"></div>
|
|
|
|
|
|
OK
|
|
|
|
|
|
</div>
|
2022-03-18 15:37:43 +08:00
|
|
|
|
<div v-else-if="scope.row['clientState']===0">
|
2022-06-21 14:17:46 +08:00
|
|
|
|
<div class="active-icon gray-bg inline-block"></div> {{ $t('profile.close') }}
|
2022-03-09 19:32:04 +08:00
|
|
|
|
</div>
|
2022-03-18 15:37:43 +08:00
|
|
|
|
<div v-else-if="scope.row['clientState']===2">
|
2022-03-09 19:32:04 +08:00
|
|
|
|
<div class="active-icon red-bg inline-block"></div> {{ $t('asset.connectionTimedOut') }}
|
|
|
|
|
|
</div>
|
2022-03-18 15:37:43 +08:00
|
|
|
|
<div v-else-if="scope.row['clientState']===3">
|
2022-03-09 19:32:04 +08:00
|
|
|
|
<div class="active-icon red-bg inline-block"></div> {{ $t('overall.AuthenticationFailed') }}
|
|
|
|
|
|
</div>
|
2022-03-18 15:37:43 +08:00
|
|
|
|
<div v-else-if="scope.row['clientState']===4">
|
2022-03-09 19:32:04 +08:00
|
|
|
|
<div class="active-icon red-bg inline-block"></div> {{ $t('config.terminallog.statusItem.unknownError') }}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<template v-else>-</template>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="item.prop === 'brand'">{{scope.row.brand ? scope.row.brand.name : '-'}}</template>
|
|
|
|
|
|
<template v-else-if="item.prop === 'purchaseDate'">{{scope.row.purchaseDate ? scope.row.purchaseDate : '-'}}</template>
|
2023-12-05 16:39:02 +08:00
|
|
|
|
<!-- license -->
|
|
|
|
|
|
<template v-else-if="item.prop === 'license'">
|
|
|
|
|
|
<el-popover
|
2023-12-07 13:59:25 +08:00
|
|
|
|
placement="left-start"
|
2023-12-05 16:39:02 +08:00
|
|
|
|
trigger="hover"
|
|
|
|
|
|
:open-delay="300"
|
|
|
|
|
|
popper-class="licenseStatus nz-tooltip-bac"
|
|
|
|
|
|
:disabled="!(scope.row.license&&scope.row.license.status==1)"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<!-- dateIssued -->
|
|
|
|
|
|
<div class="licenseStatus-title" style="margin-bottom:5px;">{{$t('licenseMange.dateIssue')}}</div>
|
|
|
|
|
|
<div class="licenseStatus-date">
|
|
|
|
|
|
<i class="nz-icon nz-icon-date margin-r-5"/>
|
|
|
|
|
|
<span>{{ scope.row.license&&scope.row.license.dateIssued ? momentTz(scope.row.license.dateIssued ) : '-'}}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<!-- dateExpires -->
|
|
|
|
|
|
<div class="licenseStatus-title" style="margin-top:10px;margin-bottom:5px;">{{$t('licenseMange.dateExpire')}}</div>
|
|
|
|
|
|
<div class="licenseStatus-date">
|
|
|
|
|
|
<i class="nz-icon nz-icon-date margin-r-5"/>
|
|
|
|
|
|
<span v-if="scope.row.license && scope.row.license.dateExpires == -1">{{$t('license.permanent')}}</span>
|
|
|
|
|
|
<span v-else>{{ scope.row.license && scope.row.license.dateExpires ? momentTz(scope.row.license.dateExpires ) : '-'}}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<!-- status -->
|
|
|
|
|
|
<div slot="reference">
|
2023-12-07 13:59:25 +08:00
|
|
|
|
<div v-if="scope.row.license && scope.row.license.status == 0">
|
|
|
|
|
|
<i class="nz-icon nz-icon-stop" style="color:#bebebe;"></i>
|
|
|
|
|
|
<span>{{$t('licenseMange.notLicensed')}}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-else-if="scope.row.license && scope.row.license.status == 1">
|
2023-12-05 16:39:02 +08:00
|
|
|
|
<i class="nz-icon nz-icon-import-success1" style="color:#8dcb4b;"></i>
|
|
|
|
|
|
<span>{{$t('licenseMange.licensed')}}</span>
|
|
|
|
|
|
</div>
|
2023-12-07 13:59:25 +08:00
|
|
|
|
<div v-else-if="scope.row.license && scope.row.license.status == 2">
|
|
|
|
|
|
<i class="nz-icon nz-icon-stop" style="color:#ec7f66;"></i>
|
|
|
|
|
|
<span>{{$t('overall.error')}}({{$t('config.terminallog.statusItem.unknownError')}})</span>
|
2023-12-05 16:39:02 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div v-else>-</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-popover>
|
|
|
|
|
|
</template>
|
2022-03-09 19:32:04 +08:00
|
|
|
|
<span v-else-if="item.prop === 'id'" :id="'globalSearch' + scope.row.id">{{scope.row[item.prop]}}</span>
|
|
|
|
|
|
<template v-else>
|
2023-12-05 16:39:02 +08:00
|
|
|
|
<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>
|
2022-03-09 19:32:04 +08:00
|
|
|
|
</template>
|
2021-06-02 16:55:17 +08:00
|
|
|
|
</template>
|
2022-03-09 19:32:04 +08:00
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
v-if="showOption"
|
|
|
|
|
|
:width="operationWidth"
|
|
|
|
|
|
fixed="right">
|
|
|
|
|
|
<div slot="header" class="table-operation-title">{{$t('overall.option')}}</div>
|
|
|
|
|
|
<div slot-scope="scope" class="table-operation-items">
|
2023-10-30 11:27:02 +08:00
|
|
|
|
<button v-if="assetTab" class="table-operation-item" v-has="'asset_edit'" @click="$emit('edit', scope.row)" :title="$t('overall.edit')"><i class="nz-icon nz-icon-edit"></i></button>
|
|
|
|
|
|
<button v-has="'asset_view'" v-else class="table-operation-item" @click="showBottomBox('dashboardTab', scope.row)" :title="$t('overall.view')"><i class="nz-icon nz-icon-view1"></i></button>
|
2022-03-09 19:32:04 +08:00
|
|
|
|
<el-dropdown size="medium" v-has="['asset_edit','asset_connect','asset_add','asset_delete', 'alertSilence_add']" trigger="click" @command="tableOperation">
|
2022-07-01 09:39:20 +08:00
|
|
|
|
<div class="table-operation-item table-operation-item--more" :title="$t('overall.moreOperations')">
|
2022-03-09 19:32:04 +08:00
|
|
|
|
<i class="nz-icon nz-icon-more3"></i>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<el-dropdown-menu slot="dropdown" class="right-box-select-top right-public-box-dropdown-top">
|
|
|
|
|
|
<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>
|
2022-12-27 15:43:38 +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('overall.duplicate')}}</span></el-dropdown-item>
|
2023-08-01 17:39:30 +08:00
|
|
|
|
<el-dropdown-item v-has="'asset_delete'" :command="['delete-rel', scope.row, {forceDeleteShow:true, single:true,from:'asset'}]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
|
2023-08-22 09:57:56 +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('config.system.terminal.terminal')}}</span></el-dropdown-item>
|
2022-03-09 19:32:04 +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>
|
2022-03-18 18:21:43 +08:00
|
|
|
|
<el-dropdown-item v-has="'asset_add'" :command="['topology', scope.row, 'asset']"><i class="nz-icon nz-icon-Topology"></i><span class="operation-dropdown-text">{{$t('overall.topology')}}</span></el-dropdown-item>
|
2023-02-17 09:24:38 +08:00
|
|
|
|
<el-dropdown-item v-has="'asset_add'" :command="['diagnosis', scope.row,{from:'asset'}]"><i class="nz-icon nz-icon-diagnosis"></i><span class="operation-dropdown-text">{{$t('overall.diagnosis')}}</span></el-dropdown-item>
|
2023-08-02 09:52:13 +08:00
|
|
|
|
<el-dropdown-item v-has="'asset_edit'" :command="['configSync', scope.row,{from:'asset'}]"><i class="nz-icon nz-icon-sync"></i><span class="operation-dropdown-text">{{$t('overall.synchronize')}}</span></el-dropdown-item>
|
2022-03-09 19:32:04 +08:00
|
|
|
|
</el-dropdown-menu>
|
|
|
|
|
|
</el-dropdown>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<template slot="empty">
|
|
|
|
|
|
<div v-if="!loading" class="table-no-data">
|
|
|
|
|
|
<svg class="icon" aria-hidden="true">
|
|
|
|
|
|
<use xlink:href="#nz-icon-no-data-list"></use>
|
|
|
|
|
|
</svg>
|
|
|
|
|
|
<div class="table-no-data__title">No results found</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-else> </div>
|
2021-04-22 12:25:23 +08:00
|
|
|
|
</template>
|
2022-03-09 19:32:04 +08:00
|
|
|
|
</el-table>
|
|
|
|
|
|
<alertLabel
|
|
|
|
|
|
v-if="alertLabelShow"
|
|
|
|
|
|
:id="alertLabelId"
|
|
|
|
|
|
:that="alertLabelObj"
|
|
|
|
|
|
:type="alertLabelType"
|
2022-07-15 10:42:09 +08:00
|
|
|
|
@tipHover='tipHover'
|
2022-03-09 19:32:04 +08:00
|
|
|
|
></alertLabel>
|
|
|
|
|
|
</div>
|
2021-04-22 12:25:23 +08:00
|
|
|
|
</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'
|
2022-08-17 10:30:11 +08:00
|
|
|
|
import copy from '@/components/common/copy'
|
2021-07-16 09:56:18 +08:00
|
|
|
|
import alertLabel from '@/components/common/alert/alertLabel'
|
2022-02-24 13:43:20 +08:00
|
|
|
|
import alertDaysInfo from '@/components/common/alert/alertDaysInfo'
|
2022-03-09 19:32:04 +08:00
|
|
|
|
import alertLabelMixin from '@/components/common/mixin/alertLabelMixin'
|
2021-04-22 12:25:23 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
name: 'assetTable',
|
2022-06-23 13:40:20 +08:00
|
|
|
|
mixins: [table, alertLabelMixin],
|
2021-07-16 09:56:18 +08:00
|
|
|
|
components: {
|
2022-02-24 13:43:20 +08:00
|
|
|
|
alertLabel: alertLabel,
|
2022-08-17 10:30:11 +08:00
|
|
|
|
alertDaysInfo,
|
2023-01-04 11:10:03 +08:00
|
|
|
|
copy
|
2021-07-16 09:56:18 +08:00
|
|
|
|
},
|
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 {
|
2023-10-30 11:27:02 +08:00
|
|
|
|
viewPermission: 'asset_view',
|
2022-02-24 17:43:34 +08:00
|
|
|
|
needAlertDaysData: true,
|
|
|
|
|
|
trendKey: 'assetId',
|
2021-04-22 12:25:23 +08:00
|
|
|
|
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
|
|
|
|
}, {
|
2022-06-16 15:58:17 +08:00
|
|
|
|
label: this.$t('asset.parent'),
|
2021-04-22 12:25:23 +08:00
|
|
|
|
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
|
|
|
|
}, {
|
2022-06-16 15:58:17 +08:00
|
|
|
|
label: this.$t('overall.assetSubTab'),
|
2021-07-16 14:43:20 +08:00
|
|
|
|
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
|
|
|
|
}, {
|
2022-06-16 15:58:17 +08:00
|
|
|
|
label: this.$t('overall.state'),
|
2021-04-22 12:25:23 +08:00
|
|
|
|
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
|
|
|
|
}, {
|
2022-06-16 15:58:17 +08:00
|
|
|
|
label: this.$t('overall.alert'),
|
2021-04-26 21:42:15 +08:00
|
|
|
|
prop: 'alertNum',
|
2021-04-22 12:25:23 +08:00
|
|
|
|
show: true,
|
2022-03-28 12:30:51 +08:00
|
|
|
|
width: 120,
|
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
|
|
|
|
}, {
|
2022-03-24 15:59:05 +08:00
|
|
|
|
label: this.$t('asset.sn'),
|
2021-04-26 21:42:15 +08:00
|
|
|
|
prop: 'sn',
|
|
|
|
|
|
show: true,
|
2022-06-21 16:08:18 +08:00
|
|
|
|
minWidth: 120
|
2021-07-28 14:12:58 +08:00
|
|
|
|
}, {
|
2022-03-24 15:59:05 +08:00
|
|
|
|
label: this.$t('asset.talon'),
|
2022-03-18 15:37:43 +08:00
|
|
|
|
// prop: 'clientState',
|
|
|
|
|
|
prop: 'talon',
|
2021-07-28 14:12:58 +08:00
|
|
|
|
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
|
2023-12-05 16:39:02 +08:00
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t('licenseMange.licenseStatus'),
|
|
|
|
|
|
prop: 'license',
|
2023-12-07 13:59:25 +08:00
|
|
|
|
minWidth: 200,
|
2023-12-05 16:39:02 +08:00
|
|
|
|
show: true
|
2021-04-22 12:25:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
showTableTooltip,
|
|
|
|
|
|
hideTableTooltip,
|
2021-07-07 16:57:26 +08:00
|
|
|
|
tableDataSort (item) {
|
|
|
|
|
|
let orderBy = ''
|
2022-04-11 17:24:10 +08:00
|
|
|
|
const str = item.prop
|
2021-07-07 16:57:26 +08:00
|
|
|
|
if (str === 'dc') {
|
|
|
|
|
|
orderBy = str
|
|
|
|
|
|
}
|
2022-03-18 15:37:43 +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
|
|
|
|
|
|
},
|
|
|
|
|
|
returnCabinet (start, end) { // 返回机柜u位信息
|
|
|
|
|
|
if (!start || !end) {
|
|
|
|
|
|
return ''
|
|
|
|
|
|
}
|
|
|
|
|
|
return `[${start}-${end}]`
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|