|
|
@@ -3,6 +3,7 @@ import { FormSchema } from '/@/components/Table';
|
|
|
import { h } from 'vue';
|
|
|
import { Ref } from 'vue';
|
|
|
import { StatusColorEnum } from '/@/enums/jeecgEnum';
|
|
|
+import { isEmpty } from 'lodash-es';
|
|
|
|
|
|
// 1. 颜色映射(修正原拼写错误,统一规则)
|
|
|
// export const StatusColorEnum: Record<string, string> = {
|
|
|
@@ -80,9 +81,9 @@ export function getColumns(dynamicStatusMap: Ref<ProductionStatusMap>): BasicCol
|
|
|
width: 100,
|
|
|
customRender: ({ record }) => {
|
|
|
// 空值/异常值处理
|
|
|
- const status = String(record.accessStatus || '');
|
|
|
- if (!status || status === 'undefined' || status === 'null') {
|
|
|
- return h('span', { style: { color: StatusColorEnum.black } }, '/');
|
|
|
+ const status = String(record.accessStatus);
|
|
|
+ if (isEmpty(status)) {
|
|
|
+ return h('span', '-');
|
|
|
}
|
|
|
const text = status === '1' ? '接入' : '未接入';
|
|
|
const textColor = status === '1' ? StatusColorEnum.green : StatusColorEnum.gold;
|
|
|
@@ -94,9 +95,9 @@ export function getColumns(dynamicStatusMap: Ref<ProductionStatusMap>): BasicCol
|
|
|
dataIndex: 'status',
|
|
|
width: 100,
|
|
|
customRender: ({ record }) => {
|
|
|
- const status = String(record.status || '');
|
|
|
- if (!status || status === 'undefined' || status === 'null') {
|
|
|
- return h('span', { style: { color: StatusColorEnum.black } }, '/');
|
|
|
+ const status = String(record.status);
|
|
|
+ if (isEmpty(status)) {
|
|
|
+ return h('span', '-');
|
|
|
}
|
|
|
const text = status === '1' ? '在线' : '离线';
|
|
|
const textColor = status === '1' ? StatusColorEnum.green : StatusColorEnum.red;
|