|
@@ -0,0 +1,547 @@
|
|
|
|
|
+import type { VNodeChild } from 'vue'
|
|
|
|
|
+import type { DataTableBaseColumn, SelectOption } from 'naive-ui'
|
|
|
|
|
+import { SiteInfoFilterType } from '@/service/siteInfoManage/interface'
|
|
|
|
|
+import type { SiteInfo } from '@/service/siteInfoManage/interface'
|
|
|
|
|
+import {
|
|
|
|
|
+ render4gSignal,
|
|
|
|
|
+ renderActStatus,
|
|
|
|
|
+ renderAPowerSn,
|
|
|
|
|
+ renderConnType,
|
|
|
|
|
+ renderDspStatus,
|
|
|
|
|
+ renderEmsModel,
|
|
|
|
|
+ renderGridStatus,
|
|
|
|
|
+ renderGridType,
|
|
|
|
|
+ renderNetStatus,
|
|
|
|
|
+ renderRunStatus,
|
|
|
|
|
+ renderWifiSignal,
|
|
|
|
|
+} from './infoRender'
|
|
|
|
|
+
|
|
|
|
|
+// interface TitleSelectOption {
|
|
|
|
|
+// value: keyof SiteInfo
|
|
|
|
|
+// label: string
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+// export const titleSelectOption: TitleSelectOption[] = [
|
|
|
|
|
+// { label: 'SN', value: 'sn' },
|
|
|
|
|
+// { label: '设备名', value: 'name' },
|
|
|
|
|
+// { label: '经销商', value: 'distributorName' },
|
|
|
|
|
+// { label: '安装商账号', value: 'installerAccount' },
|
|
|
|
|
+// { label: '安装商', value: 'installerName' },
|
|
|
|
|
+// { label: '维护商', value: 'maintName' },
|
|
|
|
|
+// { label: '安装时间', value: 'installTime' },
|
|
|
|
|
+// { label: '激活状态', value: 'activeStatus' },
|
|
|
|
|
+// { label: '激活时间(北京时间)', value: 'activeTime' },
|
|
|
|
|
+// { label: '激活时间(站点当地时间)', value: 'localActiveTime' },
|
|
|
|
|
+// { label: '网络状态', value: 'status' },
|
|
|
|
|
+// { label: '最后上线时间', value: 'onLineTime' },
|
|
|
|
|
+// { label: '最后离线时间', value: 'offLineTime' },
|
|
|
|
|
+// { label: '信号', value: 'signal' },
|
|
|
|
|
+// { label: 'ICCID', value: 'iccId' },
|
|
|
|
|
+// { label: '固件更新时间', value: 'firmUpgradeTime' },
|
|
|
|
|
+// { label: 'SOC', value: 'batterySoc' },
|
|
|
|
|
+// { label: '运行状态', value: 'runStatus' },
|
|
|
|
|
+// { label: 'EMS调度模式', value: 'emsModel' },
|
|
|
|
|
+// { label: '电网类型', value: 'electricityType' },
|
|
|
|
|
+// { label: 'aPower SN', value: 'fhpSn' },
|
|
|
|
|
+// { label: '时区数值', value: 'timeZone' },
|
|
|
|
|
+// { label: '固件版本', value: 'version' },
|
|
|
|
|
+// { label: 'EMS-DSP版本', value: 'slVersion' },
|
|
|
|
|
+// { label: 'EMS-DSP版本JSON', value: 'slVersionJson' },
|
|
|
|
|
+// { label: '电表版本', value: 'meterVersion' },
|
|
|
|
|
+// { label: 'MODBUS版本', value: 'mbVersion' },
|
|
|
|
|
+// { label: 'AWS版本', value: 'awsVersion' },
|
|
|
|
|
+// { label: 'APP版本', value: 'appVersion' },
|
|
|
|
|
+// { label: '电网状态', value: 'elecnetStatus' },
|
|
|
|
|
+// { label: 'EMS-DSP状态', value: 'slaverStat' },
|
|
|
|
|
+// { label: '夏令时', value: 'dst' },
|
|
|
|
|
+// { label: '时区信息', value: 'zoneInfo' },
|
|
|
|
|
+// { label: '设备时间', value: 'deviceTime' },
|
|
|
|
|
+// { label: '协议版本', value: 'protocolVer' },
|
|
|
|
|
+// { label: 'aGate硬件版本', value: 'sysHdVersion' },
|
|
|
|
|
+// { label: 'aGate系统版本', value: 'realSysHdVersion' },
|
|
|
|
|
+// { label: 'WIFI信号', value: 'wifiSignal' },
|
|
|
|
|
+// { label: '网络连接', value: 'connType' },
|
|
|
|
|
+// { label: '大客户', value: 'financierName' },
|
|
|
|
|
+// { label: '备注', value: 'remark' },
|
|
|
|
|
+// { label: '发电机使能', value: 'genEn' },
|
|
|
|
|
+// { label: '国家', value: 'country' },
|
|
|
|
|
+// { label: '州/省', value: 'province' },
|
|
|
|
|
+// { label: '城市', value: 'city' },
|
|
|
|
|
+// { label: 'EMS版本', value: 'emsDeviceVer' },
|
|
|
|
|
+// { label: '站点ID名', value: 'site' },
|
|
|
|
|
+// { label: '站点ID', value: 'siteId' },
|
|
|
|
|
+// { label: 'Job Code', value: 'jobCode' },
|
|
|
|
|
+// ]
|
|
|
|
|
+
|
|
|
|
|
+interface SiteInfoConfig {
|
|
|
|
|
+ title: string
|
|
|
|
|
+ width: number
|
|
|
|
|
+ fixed?: 'left' | 'right'
|
|
|
|
|
+ filterType?: SiteInfoFilterType[]
|
|
|
|
|
+ render?: (rowData: SiteInfo, rowIndex: number) => VNodeChild
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const siteInfoConfigMap: Record<keyof SiteInfo, SiteInfoConfig> = {
|
|
|
|
|
+ sn: {
|
|
|
|
|
+ title: 'SN',
|
|
|
|
|
+ width: 240,
|
|
|
|
|
+ fixed: 'left',
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ name: {
|
|
|
|
|
+ title: '设备名',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ distributorName: {
|
|
|
|
|
+ title: '经销商',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ installerAccount: {
|
|
|
|
|
+ title: '安装商账号',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ installerName: {
|
|
|
|
|
+ title: '安装商',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ maintName: {
|
|
|
|
|
+ title: '维护商',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ installTime: {
|
|
|
|
|
+ title: '安装时间',
|
|
|
|
|
+ width: 180,
|
|
|
|
|
+ filterType: [SiteInfoFilterType.FilterRangeTime, SiteInfoFilterType.FilterExists],
|
|
|
|
|
+ },
|
|
|
|
|
+ activeStatus: {
|
|
|
|
|
+ title: '激活状态',
|
|
|
|
|
+ width: 150,
|
|
|
|
|
+ filterType: [SiteInfoFilterType.FilterEqualInt, SiteInfoFilterType.FilterExists],
|
|
|
|
|
+ render: renderActStatus,
|
|
|
|
|
+ },
|
|
|
|
|
+ activeTime: {
|
|
|
|
|
+ title: '激活时间(北京时间)',
|
|
|
|
|
+ width: 180,
|
|
|
|
|
+ filterType: [SiteInfoFilterType.FilterRangeTime, SiteInfoFilterType.FilterExists],
|
|
|
|
|
+ },
|
|
|
|
|
+ localActiveTime: {
|
|
|
|
|
+ title: '激活时间(站点当地时间)',
|
|
|
|
|
+ width: 180,
|
|
|
|
|
+ filterType: [SiteInfoFilterType.FilterRangeTime, SiteInfoFilterType.FilterExists],
|
|
|
|
|
+ },
|
|
|
|
|
+ status: {
|
|
|
|
|
+ title: '网络状态',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [SiteInfoFilterType.FilterEqualInt, SiteInfoFilterType.FilterExists],
|
|
|
|
|
+ render: renderNetStatus,
|
|
|
|
|
+ },
|
|
|
|
|
+ onLineTime: {
|
|
|
|
|
+ title: '最后上线时间',
|
|
|
|
|
+ width: 180,
|
|
|
|
|
+ filterType: [SiteInfoFilterType.FilterRangeTime, SiteInfoFilterType.FilterExists],
|
|
|
|
|
+ },
|
|
|
|
|
+ offLineTime: {
|
|
|
|
|
+ title: '最后离线时间',
|
|
|
|
|
+ width: 180,
|
|
|
|
|
+ filterType: [SiteInfoFilterType.FilterRangeTime, SiteInfoFilterType.FilterExists],
|
|
|
|
|
+ },
|
|
|
|
|
+ signal: {
|
|
|
|
|
+ title: '信号',
|
|
|
|
|
+ width: 250,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualInt,
|
|
|
|
|
+ SiteInfoFilterType.FilterRangeInt,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ render: render4gSignal,
|
|
|
|
|
+ },
|
|
|
|
|
+ iccId: {
|
|
|
|
|
+ title: 'ICCID',
|
|
|
|
|
+ width: 200,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ firmUpgradeTime: {
|
|
|
|
|
+ title: '固件更新时间',
|
|
|
|
|
+ width: 180,
|
|
|
|
|
+ filterType: [SiteInfoFilterType.FilterRangeTime, SiteInfoFilterType.FilterExists],
|
|
|
|
|
+ },
|
|
|
|
|
+ batterySoc: {
|
|
|
|
|
+ title: 'SOC',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualInt,
|
|
|
|
|
+ SiteInfoFilterType.FilterRangeInt,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ runStatus: {
|
|
|
|
|
+ title: '运行状态',
|
|
|
|
|
+ width: 80,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualInt,
|
|
|
|
|
+ SiteInfoFilterType.FilterRangeInt,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ render: renderRunStatus,
|
|
|
|
|
+ },
|
|
|
|
|
+ emsModel: {
|
|
|
|
|
+ title: 'EMS调度模式',
|
|
|
|
|
+ width: 150,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualInt,
|
|
|
|
|
+ SiteInfoFilterType.FilterRangeInt,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ render: renderEmsModel,
|
|
|
|
|
+ },
|
|
|
|
|
+ electricityType: {
|
|
|
|
|
+ title: '电网类型',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [SiteInfoFilterType.FilterEqualInt, SiteInfoFilterType.FilterExists],
|
|
|
|
|
+ render: renderGridType,
|
|
|
|
|
+ },
|
|
|
|
|
+ fhpSn: {
|
|
|
|
|
+ title: 'aPower SN',
|
|
|
|
|
+ width: 250,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ render: renderAPowerSn,
|
|
|
|
|
+ },
|
|
|
|
|
+ timeZone: {
|
|
|
|
|
+ title: '时区数值',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualInt,
|
|
|
|
|
+ SiteInfoFilterType.FilterRangeInt,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ version: {
|
|
|
|
|
+ title: '固件版本',
|
|
|
|
|
+ width: 350,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ slVersion: {
|
|
|
|
|
+ title: 'EMS-DSP版本',
|
|
|
|
|
+ width: 150,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ slVersionJson: {
|
|
|
|
|
+ title: 'EMS-DSP版本JSON',
|
|
|
|
|
+ width: 300,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ meterVersion: {
|
|
|
|
|
+ title: '电表版本',
|
|
|
|
|
+ width: 150,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ mbVersion: {
|
|
|
|
|
+ title: 'MODBUS版本',
|
|
|
|
|
+ width: 150,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ awsVersion: {
|
|
|
|
|
+ title: 'AWS版本',
|
|
|
|
|
+ width: 150,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ appVersion: {
|
|
|
|
|
+ title: 'APP版本',
|
|
|
|
|
+ width: 150,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ elecnetStatus: {
|
|
|
|
|
+ title: '电网状态',
|
|
|
|
|
+ width: 80,
|
|
|
|
|
+ filterType: [SiteInfoFilterType.FilterEqualInt, SiteInfoFilterType.FilterExists],
|
|
|
|
|
+ render: renderGridStatus,
|
|
|
|
|
+ },
|
|
|
|
|
+ slaverStat: {
|
|
|
|
|
+ title: 'EMS-DSP状态',
|
|
|
|
|
+ width: 120,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualInt,
|
|
|
|
|
+ SiteInfoFilterType.FilterRangeInt,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ render: renderDspStatus,
|
|
|
|
|
+ },
|
|
|
|
|
+ dst: {
|
|
|
|
|
+ title: '夏令时',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [SiteInfoFilterType.FilterEqualInt, SiteInfoFilterType.FilterExists],
|
|
|
|
|
+ },
|
|
|
|
|
+ zoneInfo: {
|
|
|
|
|
+ title: '时区信息',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ deviceTime: {
|
|
|
|
|
+ title: '设备时间',
|
|
|
|
|
+ width: 180,
|
|
|
|
|
+ filterType: [SiteInfoFilterType.FilterRangeTime, SiteInfoFilterType.FilterExists],
|
|
|
|
|
+ },
|
|
|
|
|
+ protocolVer: {
|
|
|
|
|
+ title: '协议版本',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ sysHdVersion: {
|
|
|
|
|
+ title: 'aGate硬件版本',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualInt,
|
|
|
|
|
+ SiteInfoFilterType.FilterRangeInt,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ realSysHdVersion: {
|
|
|
|
|
+ title: 'aGate系统版本',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ wifiSignal: {
|
|
|
|
|
+ title: 'WIFI信号',
|
|
|
|
|
+ width: 250,
|
|
|
|
|
+ render: renderWifiSignal,
|
|
|
|
|
+ },
|
|
|
|
|
+ connType: {
|
|
|
|
|
+ title: '网络连接',
|
|
|
|
|
+ width: 120,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualInt,
|
|
|
|
|
+ SiteInfoFilterType.FilterRangeInt,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ render: renderConnType,
|
|
|
|
|
+ },
|
|
|
|
|
+ financierName: {
|
|
|
|
|
+ title: '大客户',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ remark: {
|
|
|
|
|
+ title: '备注',
|
|
|
|
|
+ width: 300,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ genEn: {
|
|
|
|
|
+ title: '发电机使能',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [SiteInfoFilterType.FilterEqualInt, SiteInfoFilterType.FilterExists],
|
|
|
|
|
+ },
|
|
|
|
|
+ country: {
|
|
|
|
|
+ title: '国家',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ province: {
|
|
|
|
|
+ title: '州/省',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ city: {
|
|
|
|
|
+ title: '城市',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ emsDeviceVer: {
|
|
|
|
|
+ title: 'EMS版本',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualInt,
|
|
|
|
|
+ SiteInfoFilterType.FilterRangeInt,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ site: {
|
|
|
|
|
+ title: '站点ID名',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ siteId: {
|
|
|
|
|
+ title: '站点ID',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualInt,
|
|
|
|
|
+ SiteInfoFilterType.FilterRangeInt,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ jobCode: {
|
|
|
|
|
+ title: 'Job Code',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ filterType: [
|
|
|
|
|
+ SiteInfoFilterType.FilterEqualString,
|
|
|
|
|
+ SiteInfoFilterType.FilterIncludeString,
|
|
|
|
|
+ SiteInfoFilterType.FilterExists,
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const siteInfoFilterTypeNameMap: Record<SiteInfoFilterType, string> = {
|
|
|
|
|
+ [SiteInfoFilterType.FilterUnknown]: 'Unknown',
|
|
|
|
|
+ [SiteInfoFilterType.FilterEqualInt]: '等于',
|
|
|
|
|
+ [SiteInfoFilterType.FilterEqualFloat]: '等于',
|
|
|
|
|
+ [SiteInfoFilterType.FilterEqualString]: '等于',
|
|
|
|
|
+ [SiteInfoFilterType.FilterIncludeString]: '包含',
|
|
|
|
|
+ [SiteInfoFilterType.FilterRangeInt]: '范围',
|
|
|
|
|
+ [SiteInfoFilterType.FilterRangeFloat]: '范围',
|
|
|
|
|
+ [SiteInfoFilterType.FilterRangeTime]: '范围',
|
|
|
|
|
+ [SiteInfoFilterType.FilterExists]: '是否存在',
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function isSiteInfoKey(key: string): key is keyof SiteInfo {
|
|
|
|
|
+ return key in siteInfoConfigMap
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+export const siteInfoKeyList = Object.keys(siteInfoConfigMap) as (keyof SiteInfo)[]
|
|
|
|
|
+
|
|
|
|
|
+// 获取表格列配置
|
|
|
|
|
+export const getSiteInfoTableColumnsConfig = (
|
|
|
|
|
+ opt: (keyof SiteInfo)[],
|
|
|
|
|
+): DataTableBaseColumn<SiteInfo>[] => {
|
|
|
|
|
+ return opt.map((key) => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ title: siteInfoConfigMap[key].title,
|
|
|
|
|
+ key,
|
|
|
|
|
+ width: siteInfoConfigMap[key].width,
|
|
|
|
|
+ minWidth: siteInfoConfigMap[key].width,
|
|
|
|
|
+ fixed: siteInfoConfigMap[key].fixed,
|
|
|
|
|
+ render: siteInfoConfigMap[key].render,
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+interface TitleOption {
|
|
|
|
|
+ label: string
|
|
|
|
|
+ value: string
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 获取表格标题选项
|
|
|
|
|
+export const getTitleOption = (): TitleOption[] => {
|
|
|
|
|
+ const result: TitleOption[] = []
|
|
|
|
|
+ Object.entries(siteInfoConfigMap).forEach(([key, value]) => {
|
|
|
|
|
+ result.push({
|
|
|
|
|
+ label: value.title,
|
|
|
|
|
+ value: key,
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ return result
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 获取过滤类型配置
|
|
|
|
|
+export const getKeyFilterType = (key: string): SiteInfoFilterType[] | undefined => {
|
|
|
|
|
+ if (isSiteInfoKey(key)) {
|
|
|
|
|
+ const config = siteInfoConfigMap[key]
|
|
|
|
|
+ return config.filterType
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return undefined
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 获取过滤类型名称
|
|
|
|
|
+export const getKeyFilterTypeName = (type: SiteInfoFilterType): string => {
|
|
|
|
|
+ return siteInfoFilterTypeNameMap[type]
|
|
|
|
|
+}
|