Merge remote-tracking branch 'origin/codeCheck' into codeCheck

# Conflicts:
#	nezha-fronted/src/components/page/asset/asset.vue
This commit is contained in:
chenjinsong
2020-07-15 11:09:53 +08:00

View File

@@ -80,85 +80,89 @@
<div class="pagination-top pagination-top-hide display-none"></div> <div class="pagination-top pagination-top-hide display-none"></div>
</div> </div>
<el-table <el-table
class="nz-table" class="nz-table"
:height="mainTableHeight" :height="mainTableHeight"
style="width: 100%;" style="width: 100%;"
:data="tableData" :data="tableData"
v-scrollBar:el-table="'large'" v-scrollBar:el-table="'large'"
v-show="mainResizeShow" v-show="mainResizeShow"
border border
v-loading="loading" v-loading="loading"
tooltip-effect="light" tooltip-effect="light"
ref="assetTable" ref="assetTable"
:cell-class-name="messageStyle" :cell-class-name="messageStyle"
> >
<el-table-column <el-table-column
:resizable="false" :resizable="false"
v-for="(item, index) in tablelable" v-for="(item, index) in tablelable"
v-if="item.show" v-if="item.show"
:width="item.width" :width="item.width"
:key="`col_${index}`" :key="`col_${index}`"
:label="item.label" :label="item.label"
:fixed="item.fixed" :fixed="item.fixed"
:show-overflow-tooltip="item.prop != 'Alert' || item.prop != 'Module'" :show-overflow-tooltip="item.prop != 'Alert' || item.prop != 'Module'"
min-width="110px" min-width="110px"
:class-name="item.prop == 'option' ? 'content-right-options' : ''" :class-name="item.prop == 'option' ? 'content-right-options' : ''"
> >
<template slot-scope="scope" :column="item"> <template slot-scope="scope" :column="item">
<div v-if="item.prop=='ID'"> <div v-if="item.prop=='ID'">
<span>{{scope.row.id}}</span> <span>{{scope.row.id}}</span>
</div>
<div v-if="item.prop=='assetType'">
<span>{{scope.row.model.type.value}}</span>
</div>
<template v-if="item.prop=='SN'">{{scope.row.sn}}</template>
<div v-if="item.prop=='HOST'">
<span>{{scope.row.host}}</span>
</div>
<div v-if="item.prop=='state'">
<span>{{scope.row.state==1 ? $t('asset.createAssetTab.inStock') : $t('asset.createAssetTab.notInStock')}}</span>
</div>
<div v-if="item.prop == 'pingStatus'">
<el-popover
placement="right"
width="200"
trigger="hover"
:content="formatPingTime(scope.row.pingLastUpdate)">
<div slot="reference" style="width: 20px">
<div :class="{'active-icon green':scope.row.pingState == 1,'active-icon red':scope.row.pingState == 0}"></div><span>{{scope.row.pingRtt?scope.row.pingRtt+'ms':''}}</span>
</div> </div>
</el-popover> <div v-if="item.prop=='assetType'">
</div> <span>{{scope.row.model.type.value}}</span>
<template v-if="item.prop=='Module'"> </div>
<span class="link" @click="showEndpoint(scope.row)">{{scope.row.endpointNum}}</span> <template v-if="item.prop=='SN'">{{scope.row.sn}}</template>
</template> <div v-if="item.prop=='HOST'">
<template v-if="item.prop=='Alert'"> <span>{{scope.row.host}}</span>
<span :id="'asset-alerts-'+scope.row.id" @click="jumpToAlertMsg(scope.row)" class="link">{{scope.row.alertNum + ' ' + $t('overall.active')}}</span> </div>
</template> <div v-if="item.prop=='state'">
<div v-if="item.prop=='dataCenter'"> <span>{{scope.row.state==1 ? $t('asset.createAssetTab.inStock') : $t('asset.createAssetTab.notInStock')}}</span>
<span >{{scope.row.idc.name}}</span> </div>
</div> <div v-if="item.prop == 'pingStatus'">
<template v-if="item.prop=='cabinet'"> <el-popover
<span v-if="scope.row.cabinet&&scope.row.cabinet!='--'">{{returnData(scope.row.cabinet).name}}</span> placement="right"
<span v-else >{{returnData(scope.row.cabinet)}}</span> width="200"
</template> trigger="hover"
<div v-if="item.prop=='model'"> :content="formatPingTime(scope.row.pingLastUpdate)">
<span>{{scope.row.model.name}}</span> <div slot="reference" style="width: 20px">
</div> <div :class="{'active-icon green':scope.row.pingState == 1,'active-icon red':scope.row.pingState == 0}"></div><span>{{scope.row.pingRtt?scope.row.pingRtt+'ms':''}}</span>
<div v-if="item.prop=='vendor'"> </div>
<span>{{scope.row.model.vendor.value}}</span> </el-popover>
</div> </div>
<div v-if="item.prop=='purchaseDate'"> <template v-if="item.prop=='Module'">
<span>{{returnData(scope.row.purchaseDate)}}</span> <span class="link" @click="showEndpoint(scope.row)">{{scope.row.endpointNum}}</span>
</div> </template>
<div v-if="item.prop=='principal'"> <template v-if="item.prop=='Alert'">
<span>{{getPrincipalName(scope.row.idc.principal)}}</span> <span :id="'asset-alerts-'+scope.row.id" @click="jumpToAlertMsg(scope.row)" class="link">
</div> {{(scope.row.alertNum < 99 ? scope.row.alertNum : 99)}}
<div v-if="item.prop=='tel'"> <sup class="linkSup" v-if="scope.row.alertNum > 99">+</sup>
<span>{{scope.row.idc.tel}}</span> {{' ' + $t('overall.active')}}
</div> </span>
<template v-if="item.prop == 'option'"> </template>
<div v-if="item.prop=='dataCenter'">
<span >{{scope.row.idc.name}}</span>
</div>
<template v-if="item.prop=='cabinet'">
<span v-if="scope.row.cabinet&&scope.row.cabinet!='--'">{{returnData(scope.row.cabinet).name}}</span>
<span v-else >{{returnData(scope.row.cabinet)}}</span>
</template>
<div v-if="item.prop=='model'">
<span>{{scope.row.model.name}}</span>
</div>
<div v-if="item.prop=='vendor'">
<span>{{scope.row.model.vendor.value}}</span>
</div>
<div v-if="item.prop=='purchaseDate'">
<span>{{returnData(scope.row.purchaseDate)}}</span>
</div>
<div v-if="item.prop=='principal'">
<span>{{getPrincipalName(scope.row.idc.principal)}}</span>
</div>
<div v-if="item.prop=='tel'">
<span>{{scope.row.idc.tel}}</span>
</div>
<template v-if="item.prop == 'option'">
<span :title="$t('overall.view')" @click.stop="tagShow('showView',scope.row)" class="content-right-option" :id="'asset-detail-'+scope.row.id"><i <span :title="$t('overall.view')" @click.stop="tagShow('showView',scope.row)" class="content-right-option" :id="'asset-detail-'+scope.row.id"><i
class="el-icon-view"></i> class="el-icon-view"></i>
</span> </span>
@@ -1028,4 +1032,15 @@
.tab-input-square-high { .tab-input-square-high {
border: 1px solid #1166bb; border: 1px solid #1166bb;
} }
/deep/ .el-table .cell.el-tooltip{
min-width: 88px;
}
.linkSup{
position: absolute;
top: -15px;
left: 17px;
}
.link{
position: relative;
}
</style> </style>