NEZ-2199 feat : asset network 二级页面开发

This commit is contained in:
likexuan
2022-09-15 09:30:32 +08:00
parent c8f0167233
commit 4e0481e30f
4 changed files with 344 additions and 1 deletions

View File

@@ -0,0 +1,143 @@
<template>
<el-table
id="assetNetworkTable"
ref="dataTable"
:data="tableData"
:height="height"
tooltip-effect="light"
border
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"
@row-dblclick="(row)=>{queryMessage(row)}"
>
<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']"
:sortable="item.sortable"
:width="`${item.width}`"
:show-overflow-tooltip="item.prop === 'description'"
class="data-column"
>
<template slot="header">
<span class="data-column__span">{{item.label}}</span>
<div class="col-resize-area"></div>
</template>
<template slot-scope="scope" :column="item">
<template v-if="item.prop === 'processCmd'">
<div :title="scope.row[item.prop] || scope.row.processName">{{scope.row[item.prop] || scope.row.processName}}</div>
</template>
<template v-else-if="item.prop === 'processId'">
{{scope.row[item.prop]}}
</template>
<template v-else-if="item.prop === 'transmitQueue'">
{{scope.row[item.prop]}}
</template>
<template v-else-if="item.prop === 'receiveQueue'">
{{scope.row[item.prop]}}
</template>
<span v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</span>
<template v-else>-</template>
</template>
</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>&nbsp;</div>
</template>
</el-table>
</template>
<script>
import table from '@/components/common/mixin/table'
export default {
name: 'assetNetworkTable',
mixins: [table],
props: {
loading: Boolean,
filterTime: {}
},
data () {
return {
tableTitle: [
{
label: this.$t('overall.process'),
prop: 'processCmd',
show: true,
minWidth: 300,
sortable: 'custom'
}, {
label: this.$t('asset.process.PID'),
prop: 'processId',
show: true,
minWidth: 100,
sortable: 'custom'
}, {
label: this.$t('overall.type'),
prop: 'type',
show: true,
minWidth: 100,
sortable: 'custom'
}, {
label: this.$t('asset.network.localAddress'),
prop: 'localAddress',
show: true,
minWidth: 150,
sortable: 'custom'
}, {
label: this.$t('asset.network.foreignAddress'),
prop: 'foreignAddress',
show: true,
minWidth: 200,
sortable: 'custom'
}, {
label: this.$t('overall.state'),
prop: 'state',
show: true,
minWidth: 120
}, {
label: this.$t('asset.network.transmitQueue'),
prop: 'transmitQueue',
show: true,
minWidth: 200,
sortable: 'custom'
}, {
label: this.$t('asset.network.receiveQueue'),
prop: 'receiveQueue',
show: true,
minWidth: 120,
sortable: 'custom'
}
]
}
},
methods: {
// 数据排序
tableDataSort (item) {
const orderBy = { order: item.order, prop: item.prop }
this.$emit('orderBy', orderBy)
}
}
}
</script>
<style>
</style>
<style>
</style>