平台聚合服务新增平台产品物模型以及产品标准物模型属性更新
This commit is contained in:
parent
142584be52
commit
f208976dd8
@ -2183,6 +2183,26 @@ export const DeviceOnlineStatusEnumSchema = {
|
||||
'说明:': '在线=1,离线=2'
|
||||
} as const;
|
||||
|
||||
export const DevicePropertyValueForApiInputSchema = {
|
||||
required: ['id', 'propertyList'],
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: {
|
||||
type: 'string',
|
||||
format: 'uuid'
|
||||
},
|
||||
propertyList: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string'
|
||||
},
|
||||
description: '设备在物联网平台中属性标识符列表'
|
||||
}
|
||||
},
|
||||
additionalProperties: false,
|
||||
description: '设备属性抄读'
|
||||
} as const;
|
||||
|
||||
export const DeviceSourceTypeEnumSchema = {
|
||||
enum: [1, 2, 3, 4, 5, 6],
|
||||
type: 'integer',
|
||||
@ -10193,6 +10213,23 @@ export const UpdateFeaturesDtoSchema = {
|
||||
additionalProperties: false
|
||||
} as const;
|
||||
|
||||
export const UpdateIoTPlatformProductPropertyInfoInputSchema = {
|
||||
required: ['ioTPlatformProductId', 'ioTPlatformType'],
|
||||
type: 'object',
|
||||
properties: {
|
||||
ioTPlatformType: {
|
||||
'$ref': '#/components/schemas/IoTPlatformTypeEnum'
|
||||
},
|
||||
ioTPlatformProductId: {
|
||||
minLength: 1,
|
||||
type: 'string',
|
||||
description: '物联网平台中对应的产品Id'
|
||||
}
|
||||
},
|
||||
additionalProperties: false,
|
||||
description: '平台产品属性更新输入'
|
||||
} as const;
|
||||
|
||||
export const UpdateLanguageInputSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1199,6 +1199,17 @@ export type DeviceManagementInfoDtoPagedResultDto = {
|
||||
*/
|
||||
export type DeviceOnlineStatusEnum = 1 | 2;
|
||||
|
||||
/**
|
||||
* 设备属性抄读
|
||||
*/
|
||||
export type DevicePropertyValueForApiInput = {
|
||||
id: string;
|
||||
/**
|
||||
* 设备在物联网平台中属性标识符列表
|
||||
*/
|
||||
propertyList: Array<(string)>;
|
||||
};
|
||||
|
||||
/**
|
||||
* 设备来源类型枚举
|
||||
*/
|
||||
@ -5422,6 +5433,17 @@ export type UpdateFeaturesDto = {
|
||||
features?: Array<UpdateFeatureDto> | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* 平台产品属性更新输入
|
||||
*/
|
||||
export type UpdateIoTPlatformProductPropertyInfoInput = {
|
||||
ioTPlatformType: IoTPlatformTypeEnum;
|
||||
/**
|
||||
* 物联网平台中对应的产品Id
|
||||
*/
|
||||
ioTPlatformProductId: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除语言
|
||||
*/
|
||||
@ -5987,6 +6009,18 @@ export type PostAggregationDeviceDeviceCommandForApiAsyncResponse = (boolean);
|
||||
|
||||
export type PostAggregationDeviceDeviceCommandForApiAsyncError = unknown;
|
||||
|
||||
export type PostAggregationDeviceGetDevicePropertyValueForApiAsyncData = {
|
||||
query?: {
|
||||
input?: DevicePropertyValueForApiInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostAggregationDeviceGetDevicePropertyValueForApiAsyncResponse = ({
|
||||
[key: string]: unknown;
|
||||
});
|
||||
|
||||
export type PostAggregationDeviceGetDevicePropertyValueForApiAsyncError = unknown;
|
||||
|
||||
export type PostDeviceInfoFindByDeviceAddressData = {
|
||||
query?: {
|
||||
deviceAddress?: string;
|
||||
@ -6363,6 +6397,16 @@ export type PostAggregationIoTplatformGetIoTplatformProductPropertyInfoAsyncResp
|
||||
|
||||
export type PostAggregationIoTplatformGetIoTplatformProductPropertyInfoAsyncError = unknown;
|
||||
|
||||
export type PostAggregationIoTplatformUpdateIoTplatformProductPropertyInfoAsyncData = {
|
||||
query?: {
|
||||
input?: UpdateIoTPlatformProductPropertyInfoInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostAggregationIoTplatformUpdateIoTplatformProductPropertyInfoAsyncResponse = (unknown);
|
||||
|
||||
export type PostAggregationIoTplatformUpdateIoTplatformProductPropertyInfoAsyncError = unknown;
|
||||
|
||||
export type PostIoTplatformThingModelInfoCreateAsyncData = {
|
||||
query?: {
|
||||
input?: IoTPlatformThingModelCreateInput;
|
||||
@ -6739,7 +6783,7 @@ export type PostOneNetProductProductStatusChangeAsyncError = unknown;
|
||||
|
||||
export type PostOneNetProductUpdateThingModelAsyncData = {
|
||||
query?: {
|
||||
input?: IdInput;
|
||||
input?: StringIdInput;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -12,6 +12,7 @@ import { message as Message, Tag } from 'ant-design-vue';
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import {
|
||||
postAggregationIoTplatformUpdateIoTplatformProductPropertyInfoAsync,
|
||||
postFilesDownload,
|
||||
postFilesUpload,
|
||||
postOneNetProductDeleteAsync,
|
||||
@ -334,6 +335,27 @@ function onThingModelManagement(record: any) {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// 物模型更新函数
|
||||
async function onThingModelUpdate(record: any) {
|
||||
try {
|
||||
const resp = await postAggregationIoTplatformUpdateIoTplatformProductPropertyInfoAsync({
|
||||
body: {
|
||||
ioTPlatformType: 2, // OneNET 平台类型为 2
|
||||
ioTPlatformProductId: record.ioTPlatformProductId,
|
||||
},
|
||||
});
|
||||
if (resp.data) {
|
||||
Message.success('物模型更新成功');
|
||||
gridApi.reload();
|
||||
} else {
|
||||
Message.error('物模型更新失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('物模型更新失败:', error);
|
||||
Message.error('物模型更新失败');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -386,6 +408,12 @@ function onThingModelManagement(record: any) {
|
||||
type: 'link',
|
||||
size: 'small',
|
||||
onClick: onThingModelManagement.bind(null, row),
|
||||
},
|
||||
{
|
||||
label: 'OneNET物模型更新',
|
||||
type: 'link',
|
||||
size: 'small',
|
||||
onClick: onThingModelUpdate.bind(null, row),
|
||||
}
|
||||
]" :drop-down-actions="[
|
||||
{
|
||||
|
||||
@ -97,7 +97,7 @@ export const tableSchema: any = computed((): VxeGridProps['columns'] => [
|
||||
title: $t('common.action'),
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
width: '250',
|
||||
width: '380',
|
||||
slots: { default: 'action' },
|
||||
},
|
||||
]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user