deviceConfigModel.ts 4.1 KB
import { BasicPageParams } from '/@/api/model/baseModel';

export type TDeviceConfigPageQueryParam = BasicPageParams & TDeviceConfigParams;

export type TDeviceConfigParams = {
  name?: string;
  transportType?: string;
  orderFiled?: string;
  orderType?: string;
};

export interface IDeviceConfigAddOrEditModel {
  alarmProfile?: {
    alarmContactId: string;
    createTime: '2021-12-15T02:17:26.644Z';
    creator: string;
    defaultConfig: string;
    description: string;
    deviceProfileId: string;
    enabled: true;
    icon: string;
    id: string;
    messageMode: string;
    name: string;
    roleIds: [string];
    tenantExpireTime: '2021-12-15T02:17:26.644Z';
    tenantId: string;
    tenantStatus: 'DISABLED';
    updateTime: '2021-12-15T02:17:26.644Z';
    updater: string;
  };
  convertJs?: string;
  createTime?: '2021-12-15T02:17:26.644Z';
  creator?: string;
  defaultConfig?: string;
  defaultRuleChainId?: string;
  description?: string;
  enabled?: true;
  icon?: string;
  id?: string;
  name?: string;
  profileData?: {
    configuration: {};
    transportConfiguration: {};
    provisionConfiguration: {
      provisionDeviceSecret: string;
    };
    alarms: [
      {
        id: 'highTemperatureAlarmID';
        alarmType: 'High Temperature Alarm';
        createRules: {
          additionalProp1: {
            condition: {
              condition: [
                {
                  key: {
                    type: 'TIME_SERIES';
                    key: 'temp';
                  };
                  valueType: 'NUMERIC';
                  value: {};
                  predicate: {};
                }
              ];
              spec: {};
            };
            schedule: {
              type: 'ANY_TIME';
            };
            alarmDetails: string;
            dashboardId: {
              id: '784f394c-42b6-435a-983c-b7beff2784f9';
              entityType: 'DASHBOARD';
            };
          };
          additionalProp2: {
            condition: {
              condition: [
                {
                  key: {
                    type: 'TIME_SERIES';
                    key: 'temp';
                  };
                  valueType: 'NUMERIC';
                  value: {};
                  predicate: {};
                }
              ];
              spec: {};
            };
            schedule: {
              type: 'ANY_TIME';
            };
            alarmDetails: string;
            dashboardId: {
              id: '784f394c-42b6-435a-983c-b7beff2784f9';
              entityType: 'DASHBOARD';
            };
          };
          additionalProp3: {
            condition: {
              condition: [
                {
                  key: {
                    type: 'TIME_SERIES';
                    key: 'temp';
                  };
                  valueType: 'NUMERIC';
                  value: {};
                  predicate: {};
                }
              ];
              spec: {};
            };
            schedule: {
              type: 'ANY_TIME';
            };
            alarmDetails: string;
            dashboardId: {
              id: '784f394c-42b6-435a-983c-b7beff2784f9';
              entityType: 'DASHBOARD';
            };
          };
        };
        clearRule: {
          condition: {
            condition: [
              {
                key: {
                  type: 'TIME_SERIES';
                  key: 'temp';
                };
                valueType: 'NUMERIC';
                value: {};
                predicate: {};
              }
            ];
            spec: {};
          };
          schedule: {
            type: 'ANY_TIME';
          };
          alarmDetails: string;
          dashboardId: {
            id: '784f394c-42b6-435a-983c-b7beff2784f9';
            entityType: 'DASHBOARD';
          };
        };
        propagate: true;
        propagateRelationTypes: [string];
      }
    ];
  };
  roleIds?: [string];
  tbProfileId?: string;
  tenantExpireTime?: '2021-12-15T02:17:26.645Z';
  tenantId?: string;
  tenantStatus?: 'DISABLED';
  transportType?: 'COAP';
  updateTime?: '2021-12-15T02:17:26.645Z';
  updater?: string;
}