更新后端接口并修改应用
This commit is contained in:
parent
ecebc32a99
commit
afeb8fcaee
@ -2,6 +2,6 @@ import { defineConfig } from '@hey-api/openapi-ts';
|
||||
|
||||
export default defineConfig({
|
||||
client: '@hey-api/client-axios',
|
||||
input: 'http://localhost:44315/swagger/AbpPro/swagger.json',
|
||||
input: 'http://localhost:10500/swagger/AbpPro/swagger.json',
|
||||
output: 'src/api-client',
|
||||
});
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
// IoTClient 主入口文件
|
||||
export * from './services';
|
||||
export * from './types';
|
||||
@ -1,301 +0,0 @@
|
||||
import type { Options } from '@hey-api/client-axios';
|
||||
|
||||
import type {
|
||||
DeviceArchivesDown,
|
||||
DeviceInfoPageListInput,
|
||||
DeviceInfoPageListResult,
|
||||
IoTDBCTWingLogInfoDtoPageListInput,
|
||||
IoTDBCTWingLogInfoDtoPageListResult,
|
||||
IoTDBOneNETLogInfoPageListInput,
|
||||
IoTDBOneNETLogInfoPageListResult,
|
||||
IoTDBTreeModelDeviceDataPageAllResponse,
|
||||
IoTDBTreeModelDeviceDataPageDataInput,
|
||||
IoTErrorResponse,
|
||||
OneNetAccountDeleteInput,
|
||||
OneNETAccountDeleteResponse,
|
||||
OneNetAccountInsertInput,
|
||||
OneNetAccountInsertResponse,
|
||||
OneNetAccountModifyInput,
|
||||
OneNetAccountModifyResponse,
|
||||
OneNETAccountPageListInput,
|
||||
OneNETAccountPageListResult,
|
||||
OneNETProductCreateInput,
|
||||
OneNETProductCreateResponse,
|
||||
OneNETProductPageListInput,
|
||||
OneNETProductPageListResult,
|
||||
PostDeviceInfoCreateData,
|
||||
PostUsersPageData,
|
||||
SelectResultListAllResponse,
|
||||
SelectResultListInput,
|
||||
} from './types';
|
||||
|
||||
import {
|
||||
createClient,
|
||||
createConfig,
|
||||
formDataBodySerializer,
|
||||
} from '@hey-api/client-axios';
|
||||
|
||||
export const client = createClient(createConfig());
|
||||
|
||||
/**
|
||||
* 获取设备管理分页
|
||||
*/
|
||||
export const postDeviceInfoPage = <ThrowOnError extends boolean = false>(
|
||||
options?: Options<DeviceInfoPageListInput, ThrowOnError>,
|
||||
) => {
|
||||
return (options?.client ?? client).post<
|
||||
DeviceInfoPageListResult,
|
||||
PostRolesAllError,
|
||||
ThrowOnError
|
||||
>({
|
||||
...options,
|
||||
url: '/DeviceInfo/Page',
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 创建设备
|
||||
*/
|
||||
export const postDeviceInfoCreate = <ThrowOnError extends boolean = false>(
|
||||
options?: Options<PostDeviceInfoCreateData, ThrowOnError>,
|
||||
) => {
|
||||
return (options?.client ?? client).post<
|
||||
PostUsersCreateResponse,
|
||||
PostUsersCreateError,
|
||||
ThrowOnError
|
||||
>({
|
||||
...options,
|
||||
url: '/Aggregation/Device/Create',
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 编辑设备
|
||||
*/
|
||||
export const postDeviceInfoUpdate = <ThrowOnError extends boolean = false>(
|
||||
options?: Options<PostDeviceInfoCreateData, ThrowOnError>,
|
||||
) => {
|
||||
return (options?.client ?? client).post<
|
||||
PostUsersUpdateResponse,
|
||||
PostUsersUpdateError,
|
||||
ThrowOnError
|
||||
>({
|
||||
...options,
|
||||
url: '/Aggregation/Device/Update',
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 删除设备
|
||||
*/
|
||||
export const postDeviceInfoDelete = <ThrowOnError extends boolean = false>(
|
||||
options?: Options<PostUsersDeleteData, ThrowOnError>,
|
||||
) => {
|
||||
return (options?.client ?? client).post<
|
||||
PostUsersDeleteResponse,
|
||||
PostUsersDeleteError,
|
||||
ThrowOnError
|
||||
>({
|
||||
...options,
|
||||
url: '/Aggregation/Device/Delete',
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 档案下发
|
||||
*/
|
||||
export const postDeviceInfoArchivesDown = <
|
||||
ThrowOnError extends boolean = false,
|
||||
>(
|
||||
options?: Options<DeviceArchivesDown, ThrowOnError>,
|
||||
) => {
|
||||
return (options?.client ?? client).post<
|
||||
PostUsersDeleteResponse,
|
||||
PostUsersDeleteError,
|
||||
ThrowOnError
|
||||
>({
|
||||
...options,
|
||||
url: '/DeviceInfo/ArchivesDown',
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取遥测日志分页
|
||||
*/
|
||||
export const postTableModelPacketInfoPage = <
|
||||
ThrowOnError extends boolean = false,
|
||||
>(
|
||||
options?: Options<PostUsersPageData, ThrowOnError>,
|
||||
) => {
|
||||
return (options?.client ?? client).post<
|
||||
PostRolesAllResponse,
|
||||
PostRolesAllError,
|
||||
ThrowOnError
|
||||
>({
|
||||
...options,
|
||||
url: '/TableModel/PacketInfoPage',
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取IoTDB设备树模型数据分页
|
||||
*/
|
||||
export const postTreeModelDeviceDataInfoPage = <
|
||||
ThrowOnError extends boolean = false,
|
||||
>(
|
||||
options?: Options<IoTDBTreeModelDeviceDataPageDataInput, ThrowOnError>,
|
||||
) => {
|
||||
return (options?.client ?? client).post<
|
||||
IoTDBTreeModelDeviceDataPageAllResponse,
|
||||
IoTErrorResponse,
|
||||
ThrowOnError
|
||||
>({
|
||||
...options,
|
||||
...formDataBodySerializer,
|
||||
url: '/TreeModel/DeviceDataInfoPage',
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取后端通用下拉框列表集合
|
||||
*/
|
||||
export const getSelectResultList = <ThrowOnError extends boolean = false>(
|
||||
options?: Options<SelectResultListInput, ThrowOnError>,
|
||||
) => {
|
||||
return (options?.client ?? client).get<
|
||||
SelectResultListAllResponse,
|
||||
IoTErrorResponse,
|
||||
ThrowOnError
|
||||
>({
|
||||
...options,
|
||||
url: '/Common/GetSelectList',
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* OneNET 设备日志
|
||||
*/
|
||||
export const postOneNETLogInfoPage = <ThrowOnError extends boolean = false>(
|
||||
options?: Options<IoTDBOneNETLogInfoPageListInput, ThrowOnError>,
|
||||
) => {
|
||||
return (options?.client ?? client).post<
|
||||
IoTDBOneNETLogInfoPageListResult,
|
||||
IoTErrorResponse,
|
||||
ThrowOnError
|
||||
>({
|
||||
...options,
|
||||
...formDataBodySerializer,
|
||||
url: '/TableModel/OneNETLogInfo',
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* CTWing 设备日志
|
||||
*/
|
||||
export const postCTWingLogInfoPage = <ThrowOnError extends boolean = false>(
|
||||
options?: Options<IoTDBCTWingLogInfoDtoPageListInput, ThrowOnError>,
|
||||
) => {
|
||||
return (options?.client ?? client).post<
|
||||
IoTDBCTWingLogInfoDtoPageListResult,
|
||||
IoTErrorResponse,
|
||||
ThrowOnError
|
||||
>({
|
||||
...options,
|
||||
...formDataBodySerializer,
|
||||
url: '/TableModel/CTWingLogInfo',
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* OneNET 账号管理
|
||||
*/
|
||||
export const postOneNETAccountInfoPage = <ThrowOnError extends boolean = false>(
|
||||
options?: Options<OneNETAccountPageListInput, ThrowOnError>,
|
||||
) => {
|
||||
return (options?.client ?? client).post<
|
||||
OneNETAccountPageListResult,
|
||||
IoTErrorResponse,
|
||||
ThrowOnError
|
||||
>({
|
||||
...options,
|
||||
url: '/OneNETAccount/ListAsync',
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* OneNET 创建账号
|
||||
*/
|
||||
export const postOneNETAccountInsert = <ThrowOnError extends boolean = false>(
|
||||
options?: Options<OneNetAccountInsertInput, ThrowOnError>,
|
||||
) => {
|
||||
return (options?.client ?? client).post<
|
||||
OneNetAccountInsertResponse,
|
||||
IoTErrorResponse,
|
||||
ThrowOnError
|
||||
>({
|
||||
...options,
|
||||
url: '/OneNETAccount/InsertAsync',
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* OneNET 修改账号
|
||||
*/
|
||||
export const postOneNETAccountModify = <ThrowOnError extends boolean = false>(
|
||||
options?: Options<OneNetAccountModifyInput, ThrowOnError>,
|
||||
) => {
|
||||
return (options?.client ?? client).post<
|
||||
OneNetAccountModifyResponse,
|
||||
IoTErrorResponse,
|
||||
ThrowOnError
|
||||
>({
|
||||
...options,
|
||||
url: '/OneNETAccount/ModifyAsync',
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* OneNET 删除账号
|
||||
*/
|
||||
export const postOneNETAccountDelete = <ThrowOnError extends boolean = false>(
|
||||
options?: Options<OneNetAccountDeleteInput, ThrowOnError>,
|
||||
) => {
|
||||
return (options?.client ?? client).post<
|
||||
OneNETAccountDeleteResponse,
|
||||
IoTErrorResponse,
|
||||
ThrowOnError
|
||||
>({
|
||||
...options,
|
||||
url: '/OneNETAccount/DeleteAsync',
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* OneNET 产品管理
|
||||
*/
|
||||
export const postOneNETProductInfoPage = <ThrowOnError extends boolean = false>(
|
||||
options?: Options<OneNETProductPageListInput, ThrowOnError>,
|
||||
) => {
|
||||
return (options?.client ?? client).post<
|
||||
OneNETProductPageListResult,
|
||||
IoTErrorResponse,
|
||||
ThrowOnError
|
||||
>({
|
||||
...options,
|
||||
...formDataBodySerializer,
|
||||
url: '/OneNETProduct/ListAsync',
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* OneNET 创建产品
|
||||
*/
|
||||
export const postOneNETProductCreate = <ThrowOnError extends boolean = false>(
|
||||
options?: Options<OneNETProductCreateInput, ThrowOnError>,
|
||||
) => {
|
||||
return (options?.client ?? client).post<
|
||||
OneNETProductCreateResponse,
|
||||
IoTErrorResponse,
|
||||
ThrowOnError
|
||||
>({
|
||||
...options,
|
||||
url: '/OneNETProduct/InsertAsync',
|
||||
});
|
||||
};
|
||||
@ -1,259 +0,0 @@
|
||||
export type IoTPageInput = {
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
filter?: null | string;
|
||||
/**
|
||||
* 当前页面.默认从1开始
|
||||
*/
|
||||
pageIndex?: number;
|
||||
/**
|
||||
* 每页多少条.每页显示多少记录
|
||||
*/
|
||||
pageSize?: number;
|
||||
/**
|
||||
* 跳过多少条
|
||||
*/
|
||||
readonly skipCount?: number;
|
||||
/**
|
||||
* 排序
|
||||
* <example>
|
||||
* name desc
|
||||
* </example>
|
||||
*/
|
||||
sorting?: null | string;
|
||||
};
|
||||
|
||||
export type IoTIdInput = {
|
||||
id?: string;
|
||||
};
|
||||
|
||||
export type IoTRemoteServiceValidationErrorInfo = {
|
||||
members?: Array<string> | null;
|
||||
message?: null | string;
|
||||
};
|
||||
|
||||
export type IoTErrorResponse = {
|
||||
code?: null | string;
|
||||
data?: null | {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
details?: null | string;
|
||||
message?: null | string;
|
||||
validationErrors?: Array<IoTRemoteServiceValidationErrorInfo> | null;
|
||||
};
|
||||
|
||||
export type IoTDBTreeModelDeviceDataPageDataInput = {
|
||||
body?: IoTPageInput;
|
||||
};
|
||||
|
||||
export type IoTDBTreeModelDeviceDataDto = {
|
||||
DeviceId?: null | string;
|
||||
DeviceType?: null | string;
|
||||
IoTDataType?: null | string;
|
||||
ProjectId?: null | string;
|
||||
ProjectName?: null | string;
|
||||
SystemName?: null | string;
|
||||
Timestamps?: null | string;
|
||||
};
|
||||
|
||||
export type IoTDBTreeModelDeviceDataPageListResultDto = {
|
||||
items?: Array<IoTDBTreeModelDeviceDataDto> | null;
|
||||
totalCount?: number;
|
||||
};
|
||||
|
||||
export type IoTDBTreeModelDeviceDataPageAllResponse =
|
||||
IoTDBTreeModelDeviceDataPageListResultDto;
|
||||
|
||||
export type SelectResultListInput = {
|
||||
query?: {
|
||||
ThirdAttributeTypeName?: null | string;
|
||||
TypeName?: null | string;
|
||||
};
|
||||
};
|
||||
|
||||
export type SelectResultListDto = {
|
||||
key?: null | string;
|
||||
secondValue?: null | string;
|
||||
thirdValue?: null | string;
|
||||
value?: null | string;
|
||||
};
|
||||
export type SelectResultListAllResponse = {
|
||||
items?: Array<SelectResultListDto> | null;
|
||||
};
|
||||
|
||||
export type OneNETLogInfoDto = {
|
||||
deviceId: string;
|
||||
devicePath: string;
|
||||
deviceType: string;
|
||||
focusAddress: string;
|
||||
/** 数据类型 */
|
||||
ioTDataType?: string;
|
||||
isEncrypted: boolean;
|
||||
messageType: string;
|
||||
meterAddress: string;
|
||||
plaintextMessage: string;
|
||||
platformDeviceId: string;
|
||||
productId: string;
|
||||
projectId: string;
|
||||
protocol: string;
|
||||
rawMessage: string;
|
||||
receivedPayload: string;
|
||||
receivedTime: Date;
|
||||
systemName: string;
|
||||
timestamps: number;
|
||||
};
|
||||
|
||||
export type IoTDBOneNETLogInfoPageListInput = {
|
||||
body?: IoTPageInput;
|
||||
};
|
||||
export type IoTDBOneNETLogInfoPageListResult = {
|
||||
items?: Array<OneNETLogInfoDto> | null;
|
||||
totalCount?: number;
|
||||
};
|
||||
|
||||
export type CTWingLogInfoDto = {
|
||||
/** 设备ID */
|
||||
deviceId?: string;
|
||||
/** 设备路径 */
|
||||
devicePath?: string;
|
||||
/** 设备类型 */
|
||||
deviceType?: string;
|
||||
/** 集中器地址 */
|
||||
focusAddress?: string;
|
||||
/** IMEI */
|
||||
imei?: string;
|
||||
/** IMSI */
|
||||
imsi?: string;
|
||||
/** 数据类型 */
|
||||
ioTDataType?: string;
|
||||
/** 消息类型 */
|
||||
messageType?: string;
|
||||
/** 表计地址 */
|
||||
meterAddress?: string;
|
||||
/** 平台设备ID */
|
||||
platformDeviceId?: string;
|
||||
/** 平台租户ID */
|
||||
platformTenantId?: string;
|
||||
/** 产品ID */
|
||||
productId?: string;
|
||||
/** 项目ID */
|
||||
projectId?: string;
|
||||
/** 协议 */
|
||||
protocol?: string;
|
||||
/** 原始消息 */
|
||||
rawMessage?: string;
|
||||
/** 接收载荷 */
|
||||
receivedPayload?: string;
|
||||
/** 接收时间 */
|
||||
receivedTime?: Date;
|
||||
/** 服务ID */
|
||||
serviceId?: string;
|
||||
/** 系统名称 */
|
||||
systemName?: string;
|
||||
/** 时间戳 */
|
||||
timestamps?: number;
|
||||
};
|
||||
|
||||
export type IoTDBCTWingLogInfoDtoPageListInput = {
|
||||
body?: IoTPageInput;
|
||||
};
|
||||
export type IoTDBCTWingLogInfoDtoPageListResult = {
|
||||
items?: Array<CTWingLogInfoDto> | null;
|
||||
totalCount?: number;
|
||||
};
|
||||
|
||||
export type OneNETAccountDto = {
|
||||
accesskey: string;
|
||||
accountName: string;
|
||||
oneNETAccountId?: string;
|
||||
phoneNumber: string;
|
||||
productCount: number;
|
||||
};
|
||||
|
||||
export type OneNETAccountPageListInput = {
|
||||
body?: IoTPageInput;
|
||||
};
|
||||
export type OneNETAccountPageListResult = {
|
||||
items?: Array<OneNETAccountDto> | null;
|
||||
totalCount?: number;
|
||||
};
|
||||
|
||||
export type OneNetAccountInsertInput = {
|
||||
body?: OneNETAccountDto;
|
||||
};
|
||||
export type OneNetAccountInsertResponse = {
|
||||
body?: OneNETAccountDto;
|
||||
};
|
||||
|
||||
export type OneNetAccountModifyInput = {
|
||||
body?: OneNETAccountDto;
|
||||
};
|
||||
export type OneNetAccountModifyResponse = {
|
||||
body?: OneNETAccountDto;
|
||||
};
|
||||
|
||||
export type OneNetAccountDeleteInput = {
|
||||
body?: IoTIdInput;
|
||||
};
|
||||
|
||||
export type OneNETAccountDeleteResponse = {
|
||||
body?: OneNETAccountDto;
|
||||
};
|
||||
|
||||
export type OneNETProductDto = {
|
||||
ioTPlatformProductId: string;
|
||||
isEncrypted?: string;
|
||||
oneNETAccountId: string;
|
||||
productAccesskey: string;
|
||||
productName: string;
|
||||
};
|
||||
|
||||
export type OneNETProductPageListInput = {
|
||||
body?: IoTPageInput;
|
||||
};
|
||||
export type OneNETProductPageListResult = {
|
||||
items?: Array<OneNETProductDto> | null;
|
||||
totalCount?: number;
|
||||
};
|
||||
|
||||
export type OneNETProductCreateInput = {
|
||||
body?: OneNETProductDto;
|
||||
};
|
||||
export type OneNETProductCreateResponse = {
|
||||
body?: OneNETProductDto;
|
||||
};
|
||||
|
||||
export type DeviceInfoDto = {
|
||||
dynamicPassword?: boolean;
|
||||
haveValve?: boolean;
|
||||
id?: string;
|
||||
meterAddress: number;
|
||||
meterName: string;
|
||||
meterType?: number;
|
||||
password?: number | string;
|
||||
selfDevelop?: boolean;
|
||||
singleRate?: number | string;
|
||||
};
|
||||
|
||||
export type DeviceInfoPageListInput = {
|
||||
body?: IoTPageInput;
|
||||
};
|
||||
export type DeviceInfoPageListResult = {
|
||||
items?: Array<DeviceInfoDto> | null;
|
||||
totalCount?: number;
|
||||
};
|
||||
|
||||
export type DeviceArchivesDown = {
|
||||
focusAddress: number | string;
|
||||
meterAddress: number | string;
|
||||
meterType: number | string;
|
||||
};
|
||||
|
||||
export type PostDeviceCreateData = {
|
||||
body?: DeviceInfoDto;
|
||||
};
|
||||
|
||||
export type postDeviceUpdateData = {
|
||||
body?: DeviceInfoDto;
|
||||
};
|
||||
@ -2,4 +2,3 @@
|
||||
export * from './schemas.gen';
|
||||
export * from './services.gen';
|
||||
export * from './types.gen';
|
||||
export * from './IoTClient';
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -12,10 +12,10 @@ import { message as Message, Modal, Tag } from 'ant-design-vue';
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import {
|
||||
postMetersCreate,
|
||||
postMetersDelete,
|
||||
postMetersPage,
|
||||
postMetersUpdate,
|
||||
postDeviceInfoPage,
|
||||
postAggregationDeviceDeleteAsync,
|
||||
postDeviceInfoPage,
|
||||
postAggregationDeviceCreateAsync,
|
||||
} from '#/api-client';
|
||||
import { TableAction } from '#/components/table-action';
|
||||
import { $t } from '#/locales';
|
||||
@ -55,7 +55,7 @@ const gridOptions: VxeGridProps<any> = {
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
const { data } = await postMetersPage({
|
||||
const { data } = await postDeviceInfoPage({
|
||||
body: {
|
||||
pageIndex: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
@ -119,7 +119,8 @@ const [EditForm, editFormApi] = useVbenForm({
|
||||
async function submit() {
|
||||
const isEdit = !!editRow.value.id;
|
||||
const formApi = isEdit ? editFormApi : addFormApi;
|
||||
const api = isEdit ? postMetersUpdate : postMetersCreate;
|
||||
// TODO: 需要确认设备更新接口,暂时使用创建接口
|
||||
const api = postAggregationDeviceCreateAsync;
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) return;
|
||||
|
||||
@ -164,7 +165,7 @@ function onDel(row: any) {
|
||||
Modal.confirm({
|
||||
title: `${$t('common.confirmDelete')}${row.meterName} ?`,
|
||||
onOk: async () => {
|
||||
const result = await postMetersDelete({ body: { id: row.id } });
|
||||
const result = await postAggregationDeviceDeleteAsync({ body: { id: row.id } });
|
||||
if (result) {
|
||||
gridApi.reload();
|
||||
Message.success($t('common.deleteSuccess'));
|
||||
|
||||
@ -12,10 +12,10 @@ import { message as Message, Modal, Tag } from 'ant-design-vue';
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import {
|
||||
postMetersCreate,
|
||||
postMetersDelete,
|
||||
postMetersPage,
|
||||
postMetersUpdate,
|
||||
postDeviceInfoPage,
|
||||
postAggregationDeviceDeleteAsync,
|
||||
postDeviceInfoPage,
|
||||
postAggregationDeviceCreateAsync,
|
||||
} from '#/api-client';
|
||||
import { TableAction } from '#/components/table-action';
|
||||
import { $t } from '#/locales';
|
||||
@ -55,7 +55,7 @@ const gridOptions: VxeGridProps<any> = {
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
const { data } = await postMetersPage({
|
||||
const { data } = await postDeviceInfoPage({
|
||||
body: {
|
||||
pageIndex: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
@ -119,7 +119,8 @@ const [EditForm, editFormApi] = useVbenForm({
|
||||
async function submit() {
|
||||
const isEdit = !!editRow.value.id;
|
||||
const formApi = isEdit ? editFormApi : addFormApi;
|
||||
const api = isEdit ? postMetersUpdate : postMetersCreate;
|
||||
// TODO: 需要确认设备更新接口,暂时使用创建接口
|
||||
const api = postAggregationDeviceCreateAsync;
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) return;
|
||||
|
||||
@ -164,7 +165,7 @@ function onDel(row: any) {
|
||||
Modal.confirm({
|
||||
title: `${$t('common.confirmDelete')}${row.meterName} ?`,
|
||||
onOk: async () => {
|
||||
const result = await postMetersDelete({ body: { id: row.id } });
|
||||
const result = await postAggregationDeviceDeleteAsync({ body: { id: row.id } });
|
||||
if (result) {
|
||||
gridApi.reload();
|
||||
Message.success($t('common.deleteSuccess'));
|
||||
|
||||
@ -13,11 +13,11 @@ import { useVbenForm } from '#/adapter/form';
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import {
|
||||
postDeviceInfoArchivesDown,
|
||||
postDeviceInfoCreate,
|
||||
postDeviceInfoDelete,
|
||||
postAggregationDeviceCreateAsync,
|
||||
postAggregationDeviceDeleteAsync,
|
||||
postDeviceInfoPage,
|
||||
postDeviceInfoUpdate,
|
||||
} from '#/api-client/IoTClient';
|
||||
postAggregationDeviceFindByIdAsync,
|
||||
} from '#/api-client';
|
||||
import { TableAction } from '#/components/table-action';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
@ -120,7 +120,8 @@ const [EditForm, editFormApi] = useVbenForm({
|
||||
async function submit() {
|
||||
const isEdit = !!editRow.value.id;
|
||||
const formApi = isEdit ? editFormApi : addFormApi;
|
||||
const api = isEdit ? postDeviceInfoUpdate : postDeviceInfoCreate;
|
||||
// TODO: 需要确认设备更新接口,暂时使用创建接口
|
||||
const api = postAggregationDeviceCreateAsync;
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) return;
|
||||
|
||||
@ -165,7 +166,7 @@ function onDel(row: any) {
|
||||
Modal.confirm({
|
||||
title: `${$t('common.confirmDelete')}${row.meterName} ?`,
|
||||
onOk: async () => {
|
||||
const result = await postDeviceInfoDelete({ body: { id: row.id } });
|
||||
const result = await postAggregationDeviceDeleteAsync({ body: { id: row.id } });
|
||||
if (result) {
|
||||
gridApi.reload();
|
||||
Message.success($t('common.deleteSuccess'));
|
||||
|
||||
@ -8,8 +8,8 @@ import { useRoute } from 'vue-router';
|
||||
import { Page } from '@vben/common-ui';
|
||||
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import { postMetersPage } from '#/api-client';
|
||||
import { postCTWingLogInfoPage } from '#/api-client/IoTClient';
|
||||
import { postDeviceInfoPage } from '#/api-client';
|
||||
import { postCTWingLogInfoPage } from '#/api-client';
|
||||
|
||||
import DeviceSelect from '../deviceData/DeviceSelect.vue';
|
||||
import { querySchema, tableSchema } from './schema';
|
||||
@ -33,7 +33,7 @@ const deviceOptions = ref<any[]>();
|
||||
// 获取设备信息的完整数据
|
||||
const fetchDeviceOptions = async () => {
|
||||
try {
|
||||
const { data } = await postMetersPage({
|
||||
const { data } = await postDeviceInfoPage({
|
||||
body: {
|
||||
pageIndex: 1,
|
||||
pageSize: 1000,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
import { ref, computed } from 'vue';
|
||||
import { Select, Divider, Row } from 'ant-design-vue';
|
||||
import { ChevronLeft, ChevronRight } from '@vben/icons';
|
||||
import { postMetersPage } from '#/api-client';
|
||||
import { postDeviceInfoPage } from '#/api-client';
|
||||
import { $t } from '#/locales';
|
||||
import { useDebounceFn } from '@vueuse/core';
|
||||
|
||||
@ -49,7 +49,7 @@ const maxPage = computed(() => {
|
||||
const fetchData = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const { data } = await postMetersPage({
|
||||
const { data } = await postDeviceInfoPage({
|
||||
body: {
|
||||
pageIndex: query.value.pageIndex,
|
||||
pageSize: query.value.pageSize,
|
||||
|
||||
@ -8,8 +8,8 @@ import { useRoute } from 'vue-router';
|
||||
import { Page } from '@vben/common-ui';
|
||||
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import { postMetersPage } from '#/api-client';
|
||||
import { postTreeModelDeviceDataInfoPage } from '#/api-client/IoTClient';
|
||||
import { postDeviceInfoPage } from '#/api-client';
|
||||
import { postTreeModelDeviceDataInfoPage } from '#/api-client';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { generateDynamicColumns } from './dynamicColumns';
|
||||
@ -27,7 +27,7 @@ const selectedDeviceInfo = ref<any>(null);
|
||||
// 获取设备信息的完整数据(用于根据设备ID获取设备信息)
|
||||
const fetchDeviceOptions = async () => {
|
||||
try {
|
||||
const { data } = await postMetersPage({
|
||||
const { data } = await postDeviceInfoPage({
|
||||
body: {
|
||||
pageIndex: 1,
|
||||
pageSize: 1000,
|
||||
|
||||
@ -8,8 +8,8 @@ import { useRoute } from 'vue-router';
|
||||
import { Page } from '@vben/common-ui';
|
||||
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import { postMetersPage } from '#/api-client';
|
||||
import { postOneNETLogInfoPage } from '#/api-client/IoTClient';
|
||||
import { postDeviceInfoPage } from '#/api-client';
|
||||
import { postOneNETLogInfoPage } from '#/api-client';
|
||||
|
||||
import DeviceSelect from '../deviceData/DeviceSelect.vue';
|
||||
import { querySchema, tableSchema } from './schema';
|
||||
@ -33,7 +33,7 @@ const deviceOptions = ref<any[]>();
|
||||
// 获取设备信息的完整数据
|
||||
const fetchDeviceOptions = async () => {
|
||||
try {
|
||||
const { data } = await postMetersPage({
|
||||
const { data } = await postDeviceInfoPage({
|
||||
body: {
|
||||
pageIndex: 1,
|
||||
pageSize: 1000,
|
||||
|
||||
@ -9,7 +9,7 @@ import { Page } from '@vben/common-ui';
|
||||
import { Tag } from 'ant-design-vue';
|
||||
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import { postTableModelPacketInfoPage } from '#/api-client/IoTClient';
|
||||
import { postTableModelPacketInfoPage } from '#/api-client';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { querySchema, tableSchema } from './schema';
|
||||
@ -62,40 +62,28 @@ const [Grid] = useVbenVxeGrid({ formOptions, gridOptions });
|
||||
{{ row.deviceType }}
|
||||
</template>
|
||||
<template #ismanualOrNot="{ row }">
|
||||
<component
|
||||
:is="
|
||||
h(Tag, { color: row.manualOrNot ? 'green' : 'red' }, () =>
|
||||
<component :is="h(Tag, { color: row.manualOrNot ? 'green' : 'red' }, () =>
|
||||
row.manualOrNot ? $t('common.yes') : $t('common.no'),
|
||||
)
|
||||
"
|
||||
/>
|
||||
" />
|
||||
</template>
|
||||
<template #isTimeout="{ row }">
|
||||
<component
|
||||
:is="
|
||||
h(Tag, { color: row.isTimeout ? 'green' : 'red' }, () =>
|
||||
<component :is="h(Tag, { color: row.isTimeout ? 'green' : 'red' }, () =>
|
||||
row.isTimeout ? $t('common.yes') : $t('common.no'),
|
||||
)
|
||||
"
|
||||
/>
|
||||
" />
|
||||
</template>
|
||||
<template #isSend="{ row }">
|
||||
<component
|
||||
:is="
|
||||
h(Tag, { color: row.isSend ? 'green' : 'red' }, () =>
|
||||
<component :is="h(Tag, { color: row.isSend ? 'green' : 'red' }, () =>
|
||||
row.isSend ? $t('common.yes') : $t('common.no'),
|
||||
)
|
||||
"
|
||||
/>
|
||||
" />
|
||||
</template>
|
||||
<template #isReceived="{ row }">
|
||||
<component
|
||||
:is="
|
||||
h(Tag, { color: row.isReceived ? 'green' : 'red' }, () =>
|
||||
<component :is="h(Tag, { color: row.isReceived ? 'green' : 'red' }, () =>
|
||||
row.isReceived ? $t('common.yes') : $t('common.no'),
|
||||
)
|
||||
"
|
||||
/>
|
||||
" />
|
||||
</template>
|
||||
</Grid>
|
||||
</Page>
|
||||
|
||||
@ -12,11 +12,11 @@ import { message as Message } from 'ant-design-vue';
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import {
|
||||
postOneNETAccountDelete,
|
||||
postOneNETAccountInfoPage,
|
||||
postOneNETAccountInsert,
|
||||
postOneNETAccountModify,
|
||||
} from '#/api-client/IoTClient';
|
||||
postOneNetAccountDeleteAsync,
|
||||
postOneNetAccountListAsync,
|
||||
postOneNetAccountInsertAsync,
|
||||
postOneNetAccountModifyAsync,
|
||||
} from '#/api-client';
|
||||
import { TableAction } from '#/components/table-action';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
@ -53,7 +53,7 @@ const gridOptions: VxeGridProps<any> = {
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
const { data } = await postOneNETAccountInfoPage({
|
||||
const { data } = await postOneNetAccountListAsync({
|
||||
body: {
|
||||
pageIndex: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
@ -117,7 +117,7 @@ const [EditForm, editFormApi] = useVbenForm({
|
||||
async function submit() {
|
||||
const isEdit = !!editRow.value.id;
|
||||
const formApi = isEdit ? editFormApi : addFormApi;
|
||||
const api = isEdit ? postOneNETAccountModify : postOneNETAccountInsert;
|
||||
const api = isEdit ? postOneNetAccountModifyAsync : postOneNetAccountInsertAsync;
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) return;
|
||||
|
||||
@ -172,7 +172,7 @@ async function onDel(record: any) {
|
||||
}
|
||||
|
||||
try {
|
||||
const resp = await postOneNETAccountDelete({ body: { id: record.id } });
|
||||
const resp = await postOneNetAccountDeleteAsync({ body: { id: record.id } });
|
||||
if (resp.data) {
|
||||
Message.success($t('common.deleteSuccess'));
|
||||
gridApi.reload();
|
||||
@ -189,7 +189,8 @@ async function onDel(record: any) {
|
||||
<Page auto-content-height>
|
||||
<Grid>
|
||||
<template #toolbar-actions>
|
||||
<TableAction :actions="[
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: $t('common.add'),
|
||||
type: 'primary',
|
||||
@ -197,11 +198,13 @@ async function onDel(record: any) {
|
||||
onClick: openAddModal.bind(null),
|
||||
auth: ['AbpIdentity.Users.Create'],
|
||||
},
|
||||
]" />
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template #action="{ row }">
|
||||
<TableAction :actions="[
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: $t('common.edit'),
|
||||
type: 'link',
|
||||
@ -209,7 +212,8 @@ async function onDel(record: any) {
|
||||
auth: ['AbpIdentity.Users.Update'],
|
||||
onClick: onEdit.bind(null, row),
|
||||
},
|
||||
]" :drop-down-actions="[
|
||||
]"
|
||||
:drop-down-actions="[
|
||||
{
|
||||
label: $t('common.delete'),
|
||||
icon: 'ant-design:delete-outlined',
|
||||
@ -224,10 +228,14 @@ async function onDel(record: any) {
|
||||
confirm: onDel.bind(null, row),
|
||||
},
|
||||
},
|
||||
]" />
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</Grid>
|
||||
<UserModal :title="editRow.id ? $t('common.edit') : $t('common.add')" class="w-[800px]">
|
||||
<UserModal
|
||||
:title="editRow.id ? $t('common.edit') : $t('common.add')"
|
||||
class="w-[800px]"
|
||||
>
|
||||
<component :is="editRow.id ? EditForm : AddForm" />
|
||||
</UserModal>
|
||||
</Page>
|
||||
|
||||
@ -12,10 +12,10 @@ import { message as Message, Modal, Tag } from 'ant-design-vue';
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import {
|
||||
postMetersCreate,
|
||||
postMetersDelete,
|
||||
postMetersPage,
|
||||
postMetersUpdate,
|
||||
postOneNetProductInsertAsync,
|
||||
postOneNetProductDeleteAsync,
|
||||
postOneNetProductListAsync,
|
||||
postOneNetProductModifyAsync,
|
||||
} from '#/api-client';
|
||||
import { TableAction } from '#/components/table-action';
|
||||
import { $t } from '#/locales';
|
||||
@ -55,7 +55,7 @@ const gridOptions: VxeGridProps<any> = {
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
const { data } = await postMetersPage({
|
||||
const { data } = await postOneNetProductListAsync({
|
||||
body: {
|
||||
pageIndex: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
@ -119,7 +119,7 @@ const [EditForm, editFormApi] = useVbenForm({
|
||||
async function submit() {
|
||||
const isEdit = !!editRow.value.id;
|
||||
const formApi = isEdit ? editFormApi : addFormApi;
|
||||
const api = isEdit ? postMetersUpdate : postMetersCreate;
|
||||
const api = isEdit ? postOneNetProductModifyAsync : postOneNetProductInsertAsync;
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) return;
|
||||
|
||||
@ -164,7 +164,7 @@ function onDel(row: any) {
|
||||
Modal.confirm({
|
||||
title: `${$t('common.confirmDelete')}${row.meterName} ?`,
|
||||
onOk: async () => {
|
||||
const result = await postMetersDelete({ body: { id: row.id } });
|
||||
const result = await postOneNetProductDeleteAsync({ body: { id: row.id } });
|
||||
if (result) {
|
||||
gridApi.reload();
|
||||
Message.success($t('common.deleteSuccess'));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user