review:【antd】【iot】设备管理(暂未彻底 review,等 product 搞完)
This commit is contained in:
@@ -3,7 +3,8 @@ import type { PageParam, PageResult } from '@vben/request';
|
|||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
export namespace IotDeviceApi {
|
export namespace IotDeviceApi {
|
||||||
/** IoT 设备 VO */
|
// TODO @haohao:需要跟后端对齐,必要的 ReqVO、RespVO
|
||||||
|
/** 设备 */
|
||||||
export interface Device {
|
export interface Device {
|
||||||
id?: number; // 设备 ID,主键,自增
|
id?: number; // 设备 ID,主键,自增
|
||||||
deviceName: string; // 设备名称
|
deviceName: string; // 设备名称
|
||||||
@@ -48,7 +49,7 @@ export namespace IotDeviceApi {
|
|||||||
dataSpecsList: any[]; // 数据定义列表
|
dataSpecsList: any[]; // 数据定义列表
|
||||||
}
|
}
|
||||||
|
|
||||||
/** IoT 设备属性 VO */
|
/** 设备属性 VO */
|
||||||
export interface DeviceProperty {
|
export interface DeviceProperty {
|
||||||
identifier: string; // 属性标识符
|
identifier: string; // 属性标识符
|
||||||
value: string; // 最新值
|
value: string; // 最新值
|
||||||
@@ -62,7 +63,7 @@ export namespace IotDeviceApi {
|
|||||||
password: string; // 密码
|
password: string; // 密码
|
||||||
}
|
}
|
||||||
|
|
||||||
/** IoT 设备发送消息 Request VO */
|
/** 设备发送消息 Request VO */
|
||||||
export interface DeviceMessageSendReq {
|
export interface DeviceMessageSendReq {
|
||||||
deviceId: number; // 设备编号
|
deviceId: number; // 设备编号
|
||||||
method: string; // 请求方法
|
method: string; // 请求方法
|
||||||
@@ -77,6 +78,7 @@ export namespace IotDeviceApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** IoT 设备状态枚举 */
|
/** IoT 设备状态枚举 */
|
||||||
|
// TODO @haohao:packages/constants/src/biz-iot-enum.ts 枚举;
|
||||||
export enum DeviceStateEnum {
|
export enum DeviceStateEnum {
|
||||||
INACTIVE = 0, // 未激活
|
INACTIVE = 0, // 未激活
|
||||||
OFFLINE = 2, // 离线
|
OFFLINE = 2, // 离线
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import type { PageParam, PageResult } from '@vben/request';
|
|||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
export namespace IotProductApi {
|
export namespace IotProductApi {
|
||||||
/** IoT 产品 VO */
|
/** 产品 */
|
||||||
export interface Product {
|
export interface Product {
|
||||||
id?: number; // 产品编号
|
id?: number; // 产品编号
|
||||||
name: string; // 产品名称
|
name: string; // 产品名称
|
||||||
@@ -27,6 +27,8 @@ export namespace IotProductApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO @haohao:packages/constants/src/biz-iot-enum.ts 枚举;
|
||||||
|
|
||||||
/** IOT 产品设备类型枚举类 */
|
/** IOT 产品设备类型枚举类 */
|
||||||
export enum DeviceTypeEnum {
|
export enum DeviceTypeEnum {
|
||||||
DEVICE = 0, // 直连设备
|
DEVICE = 0, // 直连设备
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ const viewMode = ref<'card' | 'list'>('card');
|
|||||||
const cardViewRef = ref();
|
const cardViewRef = ref();
|
||||||
|
|
||||||
// Modal instances
|
// Modal instances
|
||||||
|
// TODO @haohao:这个界面,等 product 改完,在一起看看怎么弄更好。
|
||||||
const [DeviceFormModal, deviceFormModalApi] = useVbenModal({
|
const [DeviceFormModal, deviceFormModalApi] = useVbenModal({
|
||||||
connectedComponent: DeviceForm,
|
connectedComponent: DeviceForm,
|
||||||
destroyOnClose: true,
|
destroyOnClose: true,
|
||||||
|
|||||||
1
packages/constants/src/biz-iot-enum.ts
Normal file
1
packages/constants/src/biz-iot-enum.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
// TODO @haohao:枚举可以放到这里;
|
||||||
@@ -2,6 +2,7 @@ export * from './biz-ai-enum';
|
|||||||
export * from './biz-bpm-enum';
|
export * from './biz-bpm-enum';
|
||||||
export * from './biz-erp-enum';
|
export * from './biz-erp-enum';
|
||||||
export * from './biz-infra-enum';
|
export * from './biz-infra-enum';
|
||||||
|
export * from './biz-iot-enum';
|
||||||
export * from './biz-mall-enum';
|
export * from './biz-mall-enum';
|
||||||
export * from './biz-mp-enum';
|
export * from './biz-mp-enum';
|
||||||
export * from './biz-pay-enum';
|
export * from './biz-pay-enum';
|
||||||
|
|||||||
Reference in New Issue
Block a user