|
|
@ -15,7 +15,7 @@ |
|
|
|
<n-spin :show="loadingShow"> |
|
|
|
<vxe-grid ref="tableRef" class="tableGrid" align="center" auto-resize keep-source :height="sidebarHeight - 4" |
|
|
|
header-row-class-name="headerRowClass" header-cell-class-name="headerCellClass" row-class-name="tableRowClass" |
|
|
|
cell-class-name="tableCellClass" :sort-config="{ multiple: true, trigger: 'cell' }" :stripe="true" :border="false" |
|
|
|
cell-class-name="tableCellClass" :sort-config="{ multiple: true, trigger: 'cell' }" :stripe="!tableBorder" :border="tableBorder" |
|
|
|
:column-config="{ resizable: true, useKey: true }" :row-config="{ useKey: true }" :span-method="mergeRowMethod" |
|
|
|
:columns="tableColumn" :data="tableData" @cell-dblclick="cellDBLClickEvent"> |
|
|
|
<template #deviceuuid_default="{ row }"> |
|
|
@ -24,7 +24,7 @@ |
|
|
|
v-if="row.deviceuuid.deviceStatus === 0" /> |
|
|
|
<svg-icon icon-class="warning_lights" style="fill:currentColor;width: 15px;height: 15px;color: red;" |
|
|
|
v-if="row.deviceuuid.deviceStatus === 2" /> |
|
|
|
<span class="name" @click.native="nameClick(row.deviceuuid)">{{ row.deviceuuid.title }}</span> |
|
|
|
<span class="name" @click.native="nameClick(row.deviceuuid)">{{ row.gTitle }}</span> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</vxe-grid> |
|
|
@ -85,7 +85,8 @@ const tableData = ref<TableVo[]>([]); |
|
|
|
const tableRef = ref<VxeGridInstance<TableVo>>(); |
|
|
|
const cellRow = ref({}) |
|
|
|
const cellColumn = ref() |
|
|
|
const cellField = ref(); |
|
|
|
const cellField = ref() |
|
|
|
const tableBorder=ref(true) |
|
|
|
// const fields = ref(['deviceuuid']) //需要合并的列数据字段 |
|
|
|
// const waringArrow = ref([]) |
|
|
|
|
|
|
@ -347,7 +348,7 @@ const formatRole: VxeColumnPropTypes.Formatter<HeaderVo> = ({ cellValue }) => { |
|
|
|
|
|
|
|
// 通用行合并函数(将相同多列数据合并为一行) |
|
|
|
const mergeRowMethod: VxeTablePropTypes.SpanMethod<TableVo> = ({ row, _rowIndex, column, visibleData }) => { |
|
|
|
const fields = ['title'] |
|
|
|
const fields = ['gTitle'] |
|
|
|
const cellValue = row[column.field] |
|
|
|
if (cellValue && fields.includes(column.field)) { |
|
|
|
const prevRow = visibleData[_rowIndex - 1] |
|
|
|