index.ts 3.68 KB
import { RpcCommandType } from '../../device/model/deviceConfigModel';
import { DataType, ExtensionDesc } from '../../device/model/modelOfMatterModel';
import { DataTypeEnum, ObjectModelAccessModeEnum } from '/@/enums/objectModelEnum';
import { TransportTypeEnum } from '/@/views/device/profiles/components/TransportDescript/const';
import { DataSource } from '/@/views/visual/palette/types';

export interface AddDataBoardParams {
  name: string;
  viewType: string;
  remark?: string;
}

export interface UpdateDataBoardParams extends AddDataBoardParams {
  id: string;
}

export interface GetDataBoardParams {
  page?: number;
  pageSize?: number;
  name?: string;
  organizationId?: string;
  orderFiled?: string;
  orderType?: string;
}

export interface Layout {
  h: number;
  id: string;
  w: number;
  x: number;
  y: number;
}

export interface DataBoardRecord {
  name: string;
  roleIds: string[];
  updater: string;
  description: string;
  remark: string;
  viewType: string;
  enabled: boolean;
  updateTime: string;
  createTime: string;
  tenantProfileId: string;
  id: string;
  tenantExpireTime: string;
  icon: string;
  openUrl: string;
  tenantId: string;
  creator: string;
  layout: Layout[];
  defaultConfig: string;
  tenantStatus: string;
  componentNum?: number;
  publicId: string;
  organizationId?: string;
  accessCredentials?: string;
  platform?: string;
}

export interface DataBoardList {
  items: DataBoardRecord[];
  total: number;
}

export interface GradientInfo {
  value: number;
  key: string;
  color: string;
}

export interface ComponentInfo {
  fontColor: string;
  unit: string;
  gradientInfo: GradientInfo[];
  iconColor: string;
  icon: string;
  value?: string | number;
  updateTime?: number;
  showDeviceName: boolean;
}

export interface DataComponentRecord {
  dataBoardId: string;
  dataSource: DataSource[];
  frontId: string;
  name: string;
  tenantId: string;
  tenantStatus: string;
  description: string;
  roleIds: string[];
  updater: string;
  enabled: boolean;
  id: string;
  defaultConfig: string;
  tenantProfileId: string;
  remark: string;
  icon: string;
  tenantExpireTime: string;
  updateTime: string;
  creator: string;
  createTime: string;
}

export interface AddDataComponentParams {
  boardId: string;
  record: Partial<DataComponentRecord> & { layout?: Partial<Layout> };
}

export interface Layout {
  id: string;
  w: number;
  h: number;
  x: number;
  y: number;
}

export interface UpdateDataBoardLayoutParams {
  boardId: string;
  layout: Layout[];
}

export interface UpdateDataComponentParams {
  boardId: string;
  record: Partial<DataComponentRecord>;
}

export interface MasterDeviceList {
  deviceType: 'DIRECT_CONNECTION' | 'GATEWAY';
  deviceProfileId: string;
  tbDeviceId: string;
  id: string;
  name: string;
  label?: string;
  value?: string;
  alias?: string;
  codeType?: string;
  code?: string;
  [key: string]: string | undefined;
}

export interface ComponentInfoDetail {
  data: {
    componentData: DataComponentRecord[];
    componentLayout: Layout[];
    phoneModel?: string | object;
    platform: string;
  };
}

export interface DeviceAttributeParams {
  deviceProfileId: string;
  dataType?: DataTypeEnum;
}

export interface DeviceAttributeRecord {
  name: string;
  identifier: string;
  accessMode: ObjectModelAccessModeEnum;
  detail: { dataType: DataType };
  extensionDesc?: ExtensionDesc;
}

export interface SendCommandParams {
  deviceId: string;
  value: RpcCommandType;
}

export interface GetMeetTheConditionsDeviceParams {
  deviceLabel?: string;
  deviceType?: string;
  organizationId?: string;
  deviceProfileId?: string;
  transportType?: TransportTypeEnum;
  isEdgeDistribution?: boolean;
  edgeId?: string;
  isExcludeEdge?: boolean;
}