feat: asset功能、panel样式修复

This commit is contained in:
chenjinsong
2021-04-26 21:42:15 +08:00
parent 79192a889d
commit 2b3047b413
43 changed files with 1091 additions and 827 deletions

View File

@@ -36,18 +36,13 @@
<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'">
<div :class="messageStyle(item, scope.row)" @mouseenter="showTableTooltip(`${$t('asset.down')} / ${$t('asset.suspended')} / ${$t('asset.total')}`, true, $event)" @mouseleave="hideTableTooltip">
<span style="cursor: pointer" @click="$emit('showBottomBox', 'endpointTab', scope.row)"><i class="nz-icon nz-icon-endpoint" style="color: #969dea; padding-right: 8px;"></i><span>{{scope.row.endpointNum ? scope.row.endpointNum : 0}}</span></span>
<!-- <div :class="messageStyle(item, scope.row)" @mouseenter="showTableTooltip(`${$t('asset.down')} / ${$t('asset.suspended')} / ${$t('asset.total')}`, true, $event)" @mouseleave="hideTableTooltip">
<span class="link" style="padding: 2px 8px" @click="showEndpoint(scope.row)">{{scope.row.endpointDownNum}}/{{scope.row.endpointSuspendedNum}}/{{scope.row.endpointNum}}</span>
</div>
</div>-->
</template>
<template v-else-if="item.prop === 'alertNum'">
<div :class="messageStyle(item, scope.row)" @mouseenter="showTableTooltip(scope.row.alertNum+' '+$t('overall.active'), scope.row.alertNum >= 99, $event)" @mouseleave="hideTableTooltip">
<span :id="'asset-alerts-'+scope.row.id" class="link" @click="jumpToAlertMsg(scope.row)">
{{(scope.row.alertNum < 99 ? scope.row.alertNum : 99)}}
<sup v-if="scope.row.alertNum > 99" class="linkSup">+</sup>
{{' ' + $t('overall.active')}}
</span>
</div>
<span style="cursor: pointer" @click="$emit('showBottomBox', 'alertMessageTab', scope.row)"><i :class="scope.row.alertNum ? 'red' : 'green'" class="nz-icon nz-icon-overview-alert" style="padding-right: 8px;"></i><span>{{scope.row.alertNum ? scope.row.alertNum : 0}}</span></span>
</template>
<template v-else-if="item.prop === 'dc'">{{scope.row.dc ? scope.row.dc.name : '-'}}</template>
<template v-else-if="item.prop === 'cabinet'">
@@ -67,15 +62,15 @@
fixed="right">
<div slot="header" class="table-operation-title">{{$t('overall.option')}}</div>
<div slot-scope="scope" class="table-operation-items">
<button class="table-operation-item" @click="tableOperation(['detail', scope.row])"><i class="nz-icon nz-icon-view1"></i></button>
<button class="table-operation-item" @click="$emit('showBottomBox', 'panelTab', scope.row)"><i class="nz-icon nz-icon-view1"></i></button>
<el-dropdown size="medium" trigger="hover" @command="tableOperation">
<div class="table-operation-item table-operation-item--more">
<span></span><i class="nz-icon nz-icon-arrow-down"></i>
</div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="['copy', scope.row]"><i class="nz-icon nz-icon-override"></i><span class="operation-dropdown-text">Copy</span></el-dropdown-item>
<el-dropdown-item :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>
<el-dropdown-item :command="['cli', scope.row]" :disabled="!scope.row.authUsername"><i class="nz-icon nz-icon-cli"></i><span class="operation-dropdown-text">Connect</span></el-dropdown-item>
<el-dropdown-item :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 :command="['delete', scope.row]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
@@ -94,44 +89,34 @@ export default {
return {
tableTitle: [
{
label: this.$t('overall.id'),
label: 'ID',
prop: 'id',
show: false,
show: true,
width: 110
}, {
label: this.$t('overall.name'),
prop: 'name',
show: true,
width: 110
}, {
label: 'SN',
prop: 'sn',
show: true
}, {
label: this.$t('asset.manageIp'),
prop: 'manageIp',
show: true,
width: 120
}, {
label: this.$t('overall.parent'),
prop: 'parent',
show: true,
show: false,
width: 110
}, {
label: this.$t('overall.type'),
prop: 'type',
show: true,
width: 110
width: 140
}, {
label: this.$t('asset.state'),
prop: 'state',
show: true,
width: 110
}, {
label: this.$t('asset.brand'),
prop: 'brand',
show: true,
width: 120
}, {
label: this.$t('asset.model'),
prop: 'model',
show: true,
width: 110
width: 80
}, {
label: this.$t('overall.dc'),
prop: 'dc',
@@ -142,21 +127,31 @@ export default {
prop: 'cabinet',
show: true,
width: 110
}, {
label: this.$t('asset.manageIp'),
prop: 'manageIp',
show: true,
width: 120
}, {
label: this.$t('asset.alertNum'),
prop: 'alert',
prop: 'alertNum',
show: true,
width: 120
width: 140
}, {
label: this.$t('asset.endpointNum2'),
prop: 'endpointNum',
show: true,
width: 150
width: 140
}, {
label: this.$t('asset.brand'),
prop: 'brand',
show: true,
width: 120
}, {
label: this.$t('asset.model'),
prop: 'model',
show: true,
width: 110
}, {
label: 'SN',
prop: 'sn',
show: true,
width: 110
}, {
label: this.$t('asset.purchaseDate'),
prop: 'purchaseDate',