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