调整OneNET账号和设备
This commit is contained in:
parent
a8f585d7e9
commit
55ac423faa
@ -3,6 +3,9 @@
|
|||||||
import type { Options, OptionsLegacyParser } from '@hey-api/client-axios';
|
import type { Options, OptionsLegacyParser } from '@hey-api/client-axios';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
|
DeviceArchivesDown,
|
||||||
|
DeviceInfoPageListInput,
|
||||||
|
DeviceInfoPageListResult,
|
||||||
GetApiAbpApiDefinitionData,
|
GetApiAbpApiDefinitionData,
|
||||||
GetApiAbpApiDefinitionError,
|
GetApiAbpApiDefinitionError,
|
||||||
GetApiAbpApiDefinitionResponse,
|
GetApiAbpApiDefinitionResponse,
|
||||||
@ -16,11 +19,23 @@ import type {
|
|||||||
GetApiAppAbpProBasicApplicationConfigurationResponse,
|
GetApiAppAbpProBasicApplicationConfigurationResponse,
|
||||||
IoTDBCTWingLogInfoDtoPageListInput,
|
IoTDBCTWingLogInfoDtoPageListInput,
|
||||||
IoTDBCTWingLogInfoDtoPageListResult,
|
IoTDBCTWingLogInfoDtoPageListResult,
|
||||||
IoTDBDataInfoErrorResponse,
|
|
||||||
IoTDBOneNETLogInfoPageListInput,
|
IoTDBOneNETLogInfoPageListInput,
|
||||||
IoTDBOneNETLogInfoPageListResult,
|
IoTDBOneNETLogInfoPageListResult,
|
||||||
IoTDBTreeModelDeviceDataPageAllResponse,
|
IoTDBTreeModelDeviceDataPageAllResponse,
|
||||||
IoTDBTreeModelDeviceDataPageDataInput,
|
IoTDBTreeModelDeviceDataPageDataInput,
|
||||||
|
IoTErrorResponse,
|
||||||
|
OneNETAccountCreateInput,
|
||||||
|
OneNETAccountCreateInput,
|
||||||
|
OneNETAccountCreateResponse,
|
||||||
|
OneNETAccountCreateResponse,
|
||||||
|
OneNETAccountPageListInput,
|
||||||
|
OneNETAccountPageListResult,
|
||||||
|
OneNETProductCreateInput,
|
||||||
|
OneNETProductCreateInput,
|
||||||
|
OneNETProductCreateResponse,
|
||||||
|
OneNETProductCreateResponse,
|
||||||
|
OneNETProductPageListInput,
|
||||||
|
OneNETProductPageListResult,
|
||||||
PostApiAppAccountLogin2FaData,
|
PostApiAppAccountLogin2FaData,
|
||||||
PostApiAppAccountLogin2FaError,
|
PostApiAppAccountLogin2FaError,
|
||||||
PostApiAppAccountLogin2FaResponse,
|
PostApiAppAccountLogin2FaResponse,
|
||||||
@ -147,8 +162,6 @@ import type {
|
|||||||
PostFilesUploadData,
|
PostFilesUploadData,
|
||||||
PostFilesUploadError,
|
PostFilesUploadError,
|
||||||
PostFilesUploadResponse,
|
PostFilesUploadResponse,
|
||||||
PostFoucsCreateData,
|
|
||||||
postFoucsUpdateData,
|
|
||||||
PostGeneratorDownData,
|
PostGeneratorDownData,
|
||||||
PostGeneratorDownError,
|
PostGeneratorDownError,
|
||||||
PostGeneratorDownResponse,
|
PostGeneratorDownResponse,
|
||||||
@ -202,8 +215,6 @@ import type {
|
|||||||
PostMenusUpdateResponse,
|
PostMenusUpdateResponse,
|
||||||
PostMenusUserMenuError,
|
PostMenusUserMenuError,
|
||||||
PostMenusUserMenuResponse,
|
PostMenusUserMenuResponse,
|
||||||
postMetersArchivesIssued,
|
|
||||||
PostMetersCreateData,
|
|
||||||
PostNotificationBatchReadData,
|
PostNotificationBatchReadData,
|
||||||
PostNotificationBatchReadError,
|
PostNotificationBatchReadError,
|
||||||
PostNotificationBatchReadResponse,
|
PostNotificationBatchReadResponse,
|
||||||
@ -2960,25 +2971,25 @@ export const postUsersNeedChangePassword = <
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取集中器分页
|
* 获取设备管理分页
|
||||||
*/
|
*/
|
||||||
export const postFocusesPage = <ThrowOnError extends boolean = false>(
|
export const postDeviceInfoPage = <ThrowOnError extends boolean = false>(
|
||||||
options?: Options<PostUsersPageData, ThrowOnError>,
|
options?: Options<DeviceInfoPageListInput, ThrowOnError>,
|
||||||
) => {
|
) => {
|
||||||
return (options?.client ?? client).post<
|
return (options?.client ?? client).post<
|
||||||
PostRolesAllResponse,
|
DeviceInfoPageListResult,
|
||||||
PostRolesAllError,
|
PostRolesAllError,
|
||||||
ThrowOnError
|
ThrowOnError
|
||||||
>({
|
>({
|
||||||
...options,
|
...options,
|
||||||
url: '/Focuses/Page',
|
url: '/DeviceInfo/Page',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* 创建集中器
|
* 创建设备
|
||||||
*/
|
*/
|
||||||
export const postFocusesCreate = <ThrowOnError extends boolean = false>(
|
export const postDeviceInfoCreate = <ThrowOnError extends boolean = false>(
|
||||||
options?: Options<PostFoucsCreateData, ThrowOnError>,
|
options?: Options<PostDeviceInfoCreateData, ThrowOnError>,
|
||||||
) => {
|
) => {
|
||||||
return (options?.client ?? client).post<
|
return (options?.client ?? client).post<
|
||||||
PostUsersCreateResponse,
|
PostUsersCreateResponse,
|
||||||
@ -2986,14 +2997,14 @@ export const postFocusesCreate = <ThrowOnError extends boolean = false>(
|
|||||||
ThrowOnError
|
ThrowOnError
|
||||||
>({
|
>({
|
||||||
...options,
|
...options,
|
||||||
url: '/Focuses/Create',
|
url: '/Aggregation/Device/Create',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* 编辑集中器
|
* 编辑设备
|
||||||
*/
|
*/
|
||||||
export const postFocusesUpdate = <ThrowOnError extends boolean = false>(
|
export const postDeviceInfoUpdate = <ThrowOnError extends boolean = false>(
|
||||||
options?: Options<postFoucsUpdateData, ThrowOnError>,
|
options?: Options<PostDeviceInfoCreateData, ThrowOnError>,
|
||||||
) => {
|
) => {
|
||||||
return (options?.client ?? client).post<
|
return (options?.client ?? client).post<
|
||||||
PostUsersUpdateResponse,
|
PostUsersUpdateResponse,
|
||||||
@ -3001,13 +3012,13 @@ export const postFocusesUpdate = <ThrowOnError extends boolean = false>(
|
|||||||
ThrowOnError
|
ThrowOnError
|
||||||
>({
|
>({
|
||||||
...options,
|
...options,
|
||||||
url: '/Focuses/Update',
|
url: '/Aggregation/Device/Update',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* 删除集中器
|
* 删除设备
|
||||||
*/
|
*/
|
||||||
export const postFocusesDelete = <ThrowOnError extends boolean = false>(
|
export const postDeviceInfoDelete = <ThrowOnError extends boolean = false>(
|
||||||
options?: Options<PostUsersDeleteData, ThrowOnError>,
|
options?: Options<PostUsersDeleteData, ThrowOnError>,
|
||||||
) => {
|
) => {
|
||||||
return (options?.client ?? client).post<
|
return (options?.client ?? client).post<
|
||||||
@ -3016,77 +3027,17 @@ export const postFocusesDelete = <ThrowOnError extends boolean = false>(
|
|||||||
ThrowOnError
|
ThrowOnError
|
||||||
>({
|
>({
|
||||||
...options,
|
...options,
|
||||||
url: '/Focuses/Delete',
|
url: '/Aggregation/Device/Delete',
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取表计管理分页
|
|
||||||
*/
|
|
||||||
export const postMetersPage = <ThrowOnError extends boolean = false>(
|
|
||||||
options?: Options<PostUsersPageData, ThrowOnError>,
|
|
||||||
) => {
|
|
||||||
return (options?.client ?? client).post<
|
|
||||||
PostRolesAllResponse,
|
|
||||||
PostRolesAllError,
|
|
||||||
ThrowOnError
|
|
||||||
>({
|
|
||||||
...options,
|
|
||||||
// ...formDataBodySerializer,
|
|
||||||
url: '/Meters/Page',
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* 创建表计
|
|
||||||
*/
|
|
||||||
export const postMetersCreate = <ThrowOnError extends boolean = false>(
|
|
||||||
options?: Options<PostMetersCreateData, ThrowOnError>,
|
|
||||||
) => {
|
|
||||||
return (options?.client ?? client).post<
|
|
||||||
PostUsersCreateResponse,
|
|
||||||
PostUsersCreateError,
|
|
||||||
ThrowOnError
|
|
||||||
>({
|
|
||||||
...options,
|
|
||||||
url: '/Meters/Create',
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* 编辑表计
|
|
||||||
*/
|
|
||||||
export const postMetersUpdate = <ThrowOnError extends boolean = false>(
|
|
||||||
options?: Options<PostMetersCreateData, ThrowOnError>,
|
|
||||||
) => {
|
|
||||||
return (options?.client ?? client).post<
|
|
||||||
PostUsersUpdateResponse,
|
|
||||||
PostUsersUpdateError,
|
|
||||||
ThrowOnError
|
|
||||||
>({
|
|
||||||
...options,
|
|
||||||
url: '/Meters/Update',
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* 删除表计
|
|
||||||
*/
|
|
||||||
export const postMetersDelete = <ThrowOnError extends boolean = false>(
|
|
||||||
options?: Options<PostUsersDeleteData, ThrowOnError>,
|
|
||||||
) => {
|
|
||||||
return (options?.client ?? client).post<
|
|
||||||
PostUsersDeleteResponse,
|
|
||||||
PostUsersDeleteError,
|
|
||||||
ThrowOnError
|
|
||||||
>({
|
|
||||||
...options,
|
|
||||||
url: '/Meters/Delete',
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 档案下发
|
* 档案下发
|
||||||
*/
|
*/
|
||||||
export const postMetersArchivesDown = <ThrowOnError extends boolean = false>(
|
export const postDeviceInfoArchivesDown = <
|
||||||
options?: Options<postMetersArchivesIssued, ThrowOnError>,
|
ThrowOnError extends boolean = false,
|
||||||
|
>(
|
||||||
|
options?: Options<DeviceArchivesDown, ThrowOnError>,
|
||||||
) => {
|
) => {
|
||||||
return (options?.client ?? client).post<
|
return (options?.client ?? client).post<
|
||||||
PostUsersDeleteResponse,
|
PostUsersDeleteResponse,
|
||||||
@ -3094,30 +3045,12 @@ export const postMetersArchivesDown = <ThrowOnError extends boolean = false>(
|
|||||||
ThrowOnError
|
ThrowOnError
|
||||||
>({
|
>({
|
||||||
...options,
|
...options,
|
||||||
url: '/Meters/ArchivesDown',
|
url: '/DeviceInfo/ArchivesDown',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取集中器状态分页
|
* 获取遥测日志分页
|
||||||
*/
|
|
||||||
export const postTreeModelFocusStatusInfoPage = <
|
|
||||||
ThrowOnError extends boolean = false,
|
|
||||||
>(
|
|
||||||
options?: Options<PostUsersPageData, ThrowOnError>,
|
|
||||||
) => {
|
|
||||||
return (options?.client ?? client).post<
|
|
||||||
PostRolesAllResponse,
|
|
||||||
PostRolesAllError,
|
|
||||||
ThrowOnError
|
|
||||||
>({
|
|
||||||
...options,
|
|
||||||
url: '/TreeModel/FocusStatusInfoPage',
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取日志分页
|
|
||||||
*/
|
*/
|
||||||
export const postTableModelPacketInfoPage = <
|
export const postTableModelPacketInfoPage = <
|
||||||
ThrowOnError extends boolean = false,
|
ThrowOnError extends boolean = false,
|
||||||
@ -3144,7 +3077,7 @@ export const postTreeModelDeviceDataInfoPage = <
|
|||||||
) => {
|
) => {
|
||||||
return (options?.client ?? client).post<
|
return (options?.client ?? client).post<
|
||||||
IoTDBTreeModelDeviceDataPageAllResponse,
|
IoTDBTreeModelDeviceDataPageAllResponse,
|
||||||
IoTDBDataInfoErrorResponse,
|
IoTErrorResponse,
|
||||||
ThrowOnError
|
ThrowOnError
|
||||||
>({
|
>({
|
||||||
...options,
|
...options,
|
||||||
@ -3161,7 +3094,7 @@ export const getSelectResultList = <ThrowOnError extends boolean = false>(
|
|||||||
) => {
|
) => {
|
||||||
return (options?.client ?? client).get<
|
return (options?.client ?? client).get<
|
||||||
SelectResultListAllResponse,
|
SelectResultListAllResponse,
|
||||||
IoTDBDataInfoErrorResponse,
|
IoTErrorResponse,
|
||||||
ThrowOnError
|
ThrowOnError
|
||||||
>({
|
>({
|
||||||
...options,
|
...options,
|
||||||
@ -3177,7 +3110,7 @@ export const postOneNETLogInfoPage = <ThrowOnError extends boolean = false>(
|
|||||||
) => {
|
) => {
|
||||||
return (options?.client ?? client).post<
|
return (options?.client ?? client).post<
|
||||||
IoTDBOneNETLogInfoPageListResult,
|
IoTDBOneNETLogInfoPageListResult,
|
||||||
IoTDBDataInfoErrorResponse,
|
IoTErrorResponse,
|
||||||
ThrowOnError
|
ThrowOnError
|
||||||
>({
|
>({
|
||||||
...options,
|
...options,
|
||||||
@ -3194,7 +3127,7 @@ export const postCTWingLogInfoPage = <ThrowOnError extends boolean = false>(
|
|||||||
) => {
|
) => {
|
||||||
return (options?.client ?? client).post<
|
return (options?.client ?? client).post<
|
||||||
IoTDBCTWingLogInfoDtoPageListResult,
|
IoTDBCTWingLogInfoDtoPageListResult,
|
||||||
IoTDBDataInfoErrorResponse,
|
IoTErrorResponse,
|
||||||
ThrowOnError
|
ThrowOnError
|
||||||
>({
|
>({
|
||||||
...options,
|
...options,
|
||||||
@ -3202,3 +3135,69 @@ export const postCTWingLogInfoPage = <ThrowOnError extends boolean = false>(
|
|||||||
url: '/TableModel/CTWingLogInfo',
|
url: '/TableModel/CTWingLogInfo',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OneNET 账号管理
|
||||||
|
*/
|
||||||
|
export const postOneNETAccountInfoPage = <ThrowOnError extends boolean = false>(
|
||||||
|
options?: Options<OneNETAccountPageListInput, ThrowOnError>,
|
||||||
|
) => {
|
||||||
|
return (options?.client ?? client).post<
|
||||||
|
OneNETAccountPageListResult,
|
||||||
|
IoTErrorResponse,
|
||||||
|
ThrowOnError
|
||||||
|
>({
|
||||||
|
...options,
|
||||||
|
...formDataBodySerializer,
|
||||||
|
url: '/OneNETAccount/ListAsync',
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OneNET 创建账号
|
||||||
|
*/
|
||||||
|
export const postOneNETAccountCreate = <ThrowOnError extends boolean = false>(
|
||||||
|
options?: Options<OneNETAccountCreateInput, ThrowOnError>,
|
||||||
|
) => {
|
||||||
|
return (options?.client ?? client).post<
|
||||||
|
OneNETAccountCreateResponse,
|
||||||
|
IoTErrorResponse,
|
||||||
|
ThrowOnError
|
||||||
|
>({
|
||||||
|
...options,
|
||||||
|
url: '/OneNETAccount/InsertAsync',
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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',
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|||||||
@ -1783,24 +1783,6 @@ export type IdentityFocusUpdateDto = {
|
|||||||
selfDevelop?: boolean;
|
selfDevelop?: boolean;
|
||||||
status?: boolean;
|
status?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type IdentityMetersUpdateDto = {
|
|
||||||
dynamicPassword?: boolean;
|
|
||||||
haveValve?: boolean;
|
|
||||||
id?: string;
|
|
||||||
meterAddress: number;
|
|
||||||
meterName: string;
|
|
||||||
meterType?: number;
|
|
||||||
password?: number | string;
|
|
||||||
selfDevelop?: boolean;
|
|
||||||
singleRate?: number | string;
|
|
||||||
};
|
|
||||||
export type IdentityMetersArchivesDown = {
|
|
||||||
focusAddress: number | string;
|
|
||||||
meterAddress: number | string;
|
|
||||||
meterType: number | string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type IdInput = {
|
export type IdInput = {
|
||||||
id?: string;
|
id?: string;
|
||||||
};
|
};
|
||||||
@ -4930,14 +4912,6 @@ export type PostUsersCreateData = {
|
|||||||
body?: IdentityUserCreateDto;
|
body?: IdentityUserCreateDto;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type PostFoucsCreateData = {
|
|
||||||
body?: IdentityFocusUpdateDto;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type PostMetersCreateData = {
|
|
||||||
body?: IdentityMetersUpdateDto;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type PostUsersCreateResponse = IdentityUserDto;
|
export type PostUsersCreateResponse = IdentityUserDto;
|
||||||
|
|
||||||
export type PostUsersCreateError = RemoteServiceErrorResponse;
|
export type PostUsersCreateError = RemoteServiceErrorResponse;
|
||||||
@ -4946,18 +4920,6 @@ export type PostUsersUpdateData = {
|
|||||||
body?: UpdateUserInput;
|
body?: UpdateUserInput;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type postFoucsUpdateData = {
|
|
||||||
body?: IdentityFocusUpdateDto;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type postMetersUpdateData = {
|
|
||||||
body?: IdentityMetersUpdateDto;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type postMetersArchivesIssued = {
|
|
||||||
body?: IdentityMetersArchivesDown;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type PostUsersUpdateResponse = IdentityUserDto;
|
export type PostUsersUpdateResponse = IdentityUserDto;
|
||||||
|
|
||||||
export type PostUsersUpdateError = RemoteServiceErrorResponse;
|
export type PostUsersUpdateError = RemoteServiceErrorResponse;
|
||||||
@ -5050,7 +5012,7 @@ export type PostUsersNeedChangePasswordResponse = NeedChangePasswordOutput;
|
|||||||
|
|
||||||
export type PostUsersNeedChangePasswordError = RemoteServiceErrorResponse;
|
export type PostUsersNeedChangePasswordError = RemoteServiceErrorResponse;
|
||||||
|
|
||||||
export type IoTDBDataInfoPageInput = {
|
export type IoTPageInput = {
|
||||||
/**
|
/**
|
||||||
* 关键字
|
* 关键字
|
||||||
*/
|
*/
|
||||||
@ -5076,12 +5038,12 @@ export type IoTDBDataInfoPageInput = {
|
|||||||
sorting?: null | string;
|
sorting?: null | string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type IoTDBDataInfoErrorResponse = {
|
export type IoTErrorResponse = {
|
||||||
error?: RemoteServiceErrorInfo;
|
error?: RemoteServiceErrorInfo;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type IoTDBTreeModelDeviceDataPageDataInput = {
|
export type IoTDBTreeModelDeviceDataPageDataInput = {
|
||||||
body?: IoTDBDataInfoPageInput;
|
body?: IoTPageInput;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type IoTDBTreeModelDeviceDataDto = {
|
export type IoTDBTreeModelDeviceDataDto = {
|
||||||
@ -5142,7 +5104,7 @@ export type OneNETLogInfoDto = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type IoTDBOneNETLogInfoPageListInput = {
|
export type IoTDBOneNETLogInfoPageListInput = {
|
||||||
body?: IoTDBDataInfoPageInput;
|
body?: IoTPageInput;
|
||||||
};
|
};
|
||||||
export type IoTDBOneNETLogInfoPageListResult = {
|
export type IoTDBOneNETLogInfoPageListResult = {
|
||||||
items?: Array<OneNETLogInfoDto> | null;
|
items?: Array<OneNETLogInfoDto> | null;
|
||||||
@ -5193,9 +5155,89 @@ export type CTWingLogInfoDto = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type IoTDBCTWingLogInfoDtoPageListInput = {
|
export type IoTDBCTWingLogInfoDtoPageListInput = {
|
||||||
body?: IoTDBDataInfoPageInput;
|
body?: IoTPageInput;
|
||||||
};
|
};
|
||||||
export type IoTDBCTWingLogInfoDtoPageListResult = {
|
export type IoTDBCTWingLogInfoDtoPageListResult = {
|
||||||
items?: Array<CTWingLogInfoDto> | null;
|
items?: Array<CTWingLogInfoDto> | null;
|
||||||
totalCount?: number;
|
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 OneNETAccountCreateInput = {
|
||||||
|
body?: OneNETAccountDto;
|
||||||
|
};
|
||||||
|
export type OneNETAccountCreateResponse = {
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|||||||
@ -195,35 +195,18 @@
|
|||||||
"checkFocusAddress": "The concentrator address is 9 bits",
|
"checkFocusAddress": "The concentrator address is 9 bits",
|
||||||
"statusData": "statusData"
|
"statusData": "statusData"
|
||||||
},
|
},
|
||||||
"meters": {
|
"deviceInfos": {
|
||||||
"meterName": "meterName",
|
"deviceName": "DeviceName",
|
||||||
"meterAddress": "meterAddress",
|
"deviceAddress": "DeviceAddress",
|
||||||
"meterType": "meterType",
|
"ioTPlatform": "Platform Type",
|
||||||
"dynamicPassword": "dynamicPassword",
|
"ioTPlatformName": "PlatformName",
|
||||||
"password": "password",
|
"ioTPlatformDeviceOpenInfo": "DeviceOpenInfo",
|
||||||
"singleRate": "singleRate",
|
"platformPassword": "Password",
|
||||||
"selfDevelop": "selfDevelopedOrNot",
|
"ioTPlatformProductId": "ProductId",
|
||||||
"brandType": "BrandAndModel",
|
"ioTPlatformProductName": "ProductName",
|
||||||
"archiveStatus": "File distribution status",
|
"ioTPlatformAccountId": "AccountId",
|
||||||
"tripState": "Valve control status",
|
"ioTPlatformAccountName": "AccountName",
|
||||||
"timesA": "CT",
|
"ioTPlatformResponse": "Response"
|
||||||
"timev": "PT",
|
|
||||||
"haveValve": "With or without valve",
|
|
||||||
"gatherCount": "Quantity of collected items",
|
|
||||||
"functionCount": "Number of functions",
|
|
||||||
"checkmeterAddress": "Table The communication address is 9 pure numbers",
|
|
||||||
"ElectricityMeter": "ElectricityMeter",
|
|
||||||
"waterMeter": "waterMeter",
|
|
||||||
"GasMeter": "GasMeter",
|
|
||||||
"HeatMeter": "HeatMeter",
|
|
||||||
"WaterMeterFlowmeter": "WaterMeterFlowmeter",
|
|
||||||
"GasMeterFlowmeter": "GasMeterFlowmeter",
|
|
||||||
"MultipleRate": "MultipleRate",
|
|
||||||
"SingleRate": "SingleRate",
|
|
||||||
"meteringCode": "meteringCode",
|
|
||||||
"DeviceType": "DeviceType",
|
|
||||||
"pointData": "pointData",
|
|
||||||
"archivesIssued": "archivesIssued"
|
|
||||||
},
|
},
|
||||||
"IoTDBBase": {
|
"IoTDBBase": {
|
||||||
"IoTDataType": "IoTDataType",
|
"IoTDataType": "IoTDataType",
|
||||||
|
|||||||
@ -195,35 +195,18 @@
|
|||||||
"checkFocusAddress": "集中器地址为9位",
|
"checkFocusAddress": "集中器地址为9位",
|
||||||
"statusData": "状态数据"
|
"statusData": "状态数据"
|
||||||
},
|
},
|
||||||
"meters": {
|
"deviceInfos": {
|
||||||
"meterName": "表计名称",
|
"deviceName": "设备名称",
|
||||||
"meterAddress": "表通信地址",
|
"deviceAddress": "设备地址",
|
||||||
"meterType": "表计类型",
|
"ioTPlatform": "物联网平台类型",
|
||||||
"dynamicPassword": "是否动态密码",
|
"ioTPlatformName": "物联网平台类型",
|
||||||
"password": "表密码",
|
"ioTPlatformDeviceOpenInfo": "平台设备信息",
|
||||||
"singleRate": "费率类型",
|
"platformPassword": "设备密码",
|
||||||
"selfDevelop": "是否自研",
|
"ioTPlatformProductId": "产品Id",
|
||||||
"brandType": "品牌型号",
|
"ioTPlatformProductName": "产品名称",
|
||||||
"archiveStatus": "档案下发状态",
|
"ioTPlatformAccountId": "所属账号Id",
|
||||||
"tripState": "阀控状态",
|
"ioTPlatformAccountName": "所属账号",
|
||||||
"timesA": "CT",
|
"ioTPlatformResponse": "平台响应"
|
||||||
"timev": "PT",
|
|
||||||
"haveValve": "是否带阀",
|
|
||||||
"gatherCount": "采集项数量",
|
|
||||||
"functionCount": "功能数量",
|
|
||||||
"checkmeterAddress": "表通信地址为9纯数字",
|
|
||||||
"ElectricityMeter": "电表",
|
|
||||||
"waterMeter": "水表",
|
|
||||||
"GasMeter": "燃气表",
|
|
||||||
"HeatMeter": "热能表",
|
|
||||||
"WaterMeterFlowmeter": "水表流量计",
|
|
||||||
"GasMeterFlowmeter": "燃气表流量计",
|
|
||||||
"MultipleRate": "复费率",
|
|
||||||
"SingleRate": "单费率",
|
|
||||||
"meteringCode": "计量点",
|
|
||||||
"DeviceType": "设备类型",
|
|
||||||
"pointData": "测点数据",
|
|
||||||
"archivesIssued": "档案下发"
|
|
||||||
},
|
},
|
||||||
"IoTDBBase": {
|
"IoTDBBase": {
|
||||||
"IoTDataType": "数据类型",
|
"IoTDataType": "数据类型",
|
||||||
@ -278,5 +261,17 @@
|
|||||||
"DeviceCreateTime": "设备创建时间",
|
"DeviceCreateTime": "设备创建时间",
|
||||||
"DeviceUpdateTime": "设备更新时间",
|
"DeviceUpdateTime": "设备更新时间",
|
||||||
"DeviceLastActiveTime": "设备最后活跃时间"
|
"DeviceLastActiveTime": "设备最后活跃时间"
|
||||||
|
},
|
||||||
|
"OneNETManagement": {
|
||||||
|
"AccountName": "账号名称",
|
||||||
|
"AccountId": "账号ID",
|
||||||
|
"PhoneNumber": "手机号码",
|
||||||
|
"AccountAccesskey": "账户通信密钥",
|
||||||
|
"ProductCount": "产品数量",
|
||||||
|
"OneNETAccountId": "OneNET账户Id",
|
||||||
|
"IoTPlatformProductId": "物联网平台对应的产品Id",
|
||||||
|
"ProductName": "产品名称",
|
||||||
|
"ProductAccesskey": "产品访问密钥",
|
||||||
|
"IsEncrypted": "是否加密"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,5 +52,6 @@
|
|||||||
"exporting": "正在导出数据...",
|
"exporting": "正在导出数据...",
|
||||||
"exportSuccess": "数据导出成功",
|
"exportSuccess": "数据导出成功",
|
||||||
"exportFailed": "数据导出失败",
|
"exportFailed": "数据导出失败",
|
||||||
"getDataFailed": "获取数据失败"
|
"getDataFailed": "获取数据失败",
|
||||||
|
"IsEnabled": "是否启用"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,18 +12,18 @@ import { message as Message, Modal, Tag } from 'ant-design-vue';
|
|||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import {
|
import {
|
||||||
postMetersArchivesDown,
|
postDeviceInfoArchivesDown,
|
||||||
postMetersCreate,
|
postDeviceInfoCreate,
|
||||||
postMetersDelete,
|
postDeviceInfoDelete,
|
||||||
postMetersPage,
|
postDeviceInfoPage,
|
||||||
postMetersUpdate,
|
postDeviceInfoUpdate,
|
||||||
} from '#/api-client';
|
} from '#/api-client';
|
||||||
import { TableAction } from '#/components/table-action';
|
import { TableAction } from '#/components/table-action';
|
||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
addUserFormSchema,
|
addDeviceFormSchema,
|
||||||
editUserFormSchemaEdit,
|
editDeviceFormSchemaEdit,
|
||||||
meterTypeOptions,
|
meterTypeOptions,
|
||||||
querySchema,
|
querySchema,
|
||||||
rateOptions,
|
rateOptions,
|
||||||
@ -31,7 +31,7 @@ import {
|
|||||||
} from './schema';
|
} from './schema';
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'AbpUser',
|
name: 'DeviceInfo',
|
||||||
});
|
});
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@ -56,7 +56,7 @@ const gridOptions: VxeGridProps<any> = {
|
|||||||
proxyConfig: {
|
proxyConfig: {
|
||||||
ajax: {
|
ajax: {
|
||||||
query: async ({ page }, formValues) => {
|
query: async ({ page }, formValues) => {
|
||||||
const { data } = await postMetersPage({
|
const { data } = await postDeviceInfoPage({
|
||||||
body: {
|
body: {
|
||||||
pageIndex: page.currentPage,
|
pageIndex: page.currentPage,
|
||||||
pageSize: page.pageSize,
|
pageSize: page.pageSize,
|
||||||
@ -92,7 +92,7 @@ const [AddForm, addFormApi] = useVbenForm({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
layout: 'horizontal',
|
layout: 'horizontal',
|
||||||
schema: addUserFormSchema.value,
|
schema: addDeviceFormSchema.value,
|
||||||
showCollapseButton: false,
|
showCollapseButton: false,
|
||||||
showDefaultActions: false,
|
showDefaultActions: false,
|
||||||
wrapperClass: 'grid-cols-2',
|
wrapperClass: 'grid-cols-2',
|
||||||
@ -110,7 +110,7 @@ const [EditForm, editFormApi] = useVbenForm({
|
|||||||
},
|
},
|
||||||
// 提交函数
|
// 提交函数
|
||||||
layout: 'horizontal',
|
layout: 'horizontal',
|
||||||
schema: editUserFormSchemaEdit.value,
|
schema: editDeviceFormSchemaEdit.value,
|
||||||
showCollapseButton: false,
|
showCollapseButton: false,
|
||||||
showDefaultActions: false,
|
showDefaultActions: false,
|
||||||
wrapperClass: 'grid-cols-2',
|
wrapperClass: 'grid-cols-2',
|
||||||
@ -120,7 +120,7 @@ const [EditForm, editFormApi] = useVbenForm({
|
|||||||
async function submit() {
|
async function submit() {
|
||||||
const isEdit = !!editRow.value.id;
|
const isEdit = !!editRow.value.id;
|
||||||
const formApi = isEdit ? editFormApi : addFormApi;
|
const formApi = isEdit ? editFormApi : addFormApi;
|
||||||
const api = isEdit ? postMetersUpdate : postMetersCreate;
|
const api = isEdit ? postDeviceInfoUpdate : postDeviceInfoCreate;
|
||||||
const { valid } = await formApi.validate();
|
const { valid } = await formApi.validate();
|
||||||
if (!valid) return;
|
if (!valid) return;
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ function onDel(row: any) {
|
|||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: `${$t('common.confirmDelete')}${row.meterName} ?`,
|
title: `${$t('common.confirmDelete')}${row.meterName} ?`,
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
const result = await postMetersDelete({ body: { id: row.id } });
|
const result = await postDeviceInfoDelete({ body: { id: row.id } });
|
||||||
if (result) {
|
if (result) {
|
||||||
gridApi.reload();
|
gridApi.reload();
|
||||||
Message.success($t('common.deleteSuccess'));
|
Message.success($t('common.deleteSuccess'));
|
||||||
@ -189,7 +189,7 @@ const toStatusData = (row: Record<string, any>) => {
|
|||||||
};
|
};
|
||||||
// 档案下发
|
// 档案下发
|
||||||
const archivesIssued = async (row: Record<string, any>) => {
|
const archivesIssued = async (row: Record<string, any>) => {
|
||||||
const result = await postMetersArchivesDown({
|
const result = await postDeviceInfoArchivesDown({
|
||||||
body: {
|
body: {
|
||||||
meterAddress: row.meterAddress,
|
meterAddress: row.meterAddress,
|
||||||
meterType: row.meterType,
|
meterType: row.meterType,
|
||||||
@ -284,14 +284,14 @@ const openAddModal = async () => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: $t('abp.meters.pointData'),
|
label: $t('abp.DeviceInfo.pointData'),
|
||||||
icon: 'ant-design:profile-outlined',
|
icon: 'ant-design:profile-outlined',
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
auth: ['AbpIdentity.Users.Delete'],
|
auth: ['AbpIdentity.Users.Delete'],
|
||||||
onClick: toStatusData.bind(null, row),
|
onClick: toStatusData.bind(null, row),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: $t('abp.meters.archivesIssued'),
|
label: $t('abp.DeviceInfo.archivesIssued'),
|
||||||
icon: 'ant-design:cloud-download-outlined',
|
icon: 'ant-design:cloud-download-outlined',
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
auth: ['AbpIdentity.Users.Delete'],
|
auth: ['AbpIdentity.Users.Delete'],
|
||||||
|
|||||||
@ -9,109 +9,92 @@ import { $t } from '#/locales';
|
|||||||
export const querySchema = computed(() => [
|
export const querySchema = computed(() => [
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'meterAddress',
|
fieldName: 'deviceAddress',
|
||||||
label: $t('abp.meters.meterAddress'),
|
label: $t('abp.deviceInfos.deviceAddress'),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
export const meterTypeOptions = [
|
export const meterTypeOptions = [
|
||||||
{
|
{
|
||||||
label: $t('abp.meters.ElectricityMeter'),
|
label: $t('abp.deviceInfos.ElectricityMeter'),
|
||||||
value: 1,
|
value: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: $t('abp.meters.waterMeter'),
|
label: $t('abp.deviceInfos.waterMeter'),
|
||||||
value: 2,
|
value: 2,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: $t('abp.meters.GasMeter'),
|
label: $t('abp.deviceInfos.GasMeter'),
|
||||||
value: 3,
|
value: 3,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: $t('abp.meters.HeatMeter'),
|
label: $t('abp.deviceInfos.HeatMeter'),
|
||||||
value: 4,
|
value: 4,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: $t('abp.meters.WaterMeterFlowmeter'),
|
label: $t('abp.deviceInfos.WaterMeterFlowmeter'),
|
||||||
value: 5,
|
value: 5,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: $t('abp.meters.GasMeterFlowmeter'),
|
label: $t('abp.deviceInfos.GasMeterFlowmeter'),
|
||||||
value: 6,
|
value: 6,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
export const rateOptions = [
|
export const rateOptions = [
|
||||||
{
|
{
|
||||||
label: $t('abp.meters.MultipleRate'),
|
label: $t('abp.deviceInfos.MultipleRate'),
|
||||||
value: false,
|
value: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: $t('abp.meters.SingleRate'),
|
label: $t('abp.deviceInfos.SingleRate'),
|
||||||
value: true,
|
value: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
export const tableSchema: any = computed((): VxeGridProps['columns'] => [
|
export const tableSchema: any = computed((): VxeGridProps['columns'] => [
|
||||||
{ title: $t('common.seq'), type: 'seq', width: 50 },
|
{ title: $t('common.seq'), type: 'seq', width: 50 },
|
||||||
{ field: 'meterName', title: $t('abp.meters.meterName'), minWidth: '150' },
|
|
||||||
{
|
{
|
||||||
field: 'meterAddress',
|
field: 'deviceName',
|
||||||
title: $t('abp.meters.meterAddress'),
|
title: $t('abp.deviceInfos.deviceName'),
|
||||||
minWidth: '150',
|
minWidth: '150',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'meterType',
|
field: 'deviceAddress',
|
||||||
title: $t('abp.meters.meterType'),
|
title: $t('abp.deviceInfos.deviceAddress'),
|
||||||
minWidth: '150',
|
minWidth: '150',
|
||||||
slots: { default: 'isMeterType' },
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'dynamicPassword',
|
field: 'ioTPlatform',
|
||||||
title: $t('abp.meters.dynamicPassword'),
|
title: $t('abp.deviceInfos.ioTPlatform'),
|
||||||
minWidth: '150',
|
minWidth: '150',
|
||||||
slots: { default: 'isDynamicPassword' },
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'password',
|
field: 'ioTPlatformName',
|
||||||
title: $t('abp.meters.password'),
|
title: $t('abp.deviceInfos.ioTPlatformName'),
|
||||||
|
minWidth: '150',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'ioTPlatformDeviceOpenInfo',
|
||||||
|
title: $t('abp.deviceInfos.ioTPlatformDeviceOpenInfo'),
|
||||||
minWidth: '100',
|
minWidth: '100',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'singleRate',
|
field: 'platformPassword',
|
||||||
title: $t('abp.meters.singleRate'),
|
title: $t('abp.deviceInfos.platformPassword'),
|
||||||
minWidth: '150',
|
minWidth: '150',
|
||||||
slots: { default: 'isSingleRate' },
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'selfDevelop',
|
field: 'ioTPlatformProductName',
|
||||||
title: $t('abp.meters.selfDevelop'),
|
title: $t('abp.deviceInfos.ioTPlatformProductName'),
|
||||||
minWidth: '150',
|
minWidth: '150',
|
||||||
slots: { default: 'isSelfDevelop' },
|
|
||||||
},
|
|
||||||
{ field: 'brandType', title: $t('abp.meters.brandType'), minWidth: '150' },
|
|
||||||
{
|
|
||||||
field: 'archiveStatus',
|
|
||||||
title: $t('abp.meters.archiveStatus'),
|
|
||||||
minWidth: '150',
|
|
||||||
slots: { default: 'isArchiveStatus' },
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'tripState',
|
field: 'ioTPlatformAccountName',
|
||||||
title: $t('abp.meters.tripState'),
|
title: $t('abp.deviceInfos.ioTPlatformAccountName'),
|
||||||
minWidth: '150',
|
minWidth: '150',
|
||||||
slots: { default: 'isTripState' },
|
|
||||||
},
|
|
||||||
{ field: 'timesA', title: $t('abp.meters.timesA'), minWidth: '100' },
|
|
||||||
{ field: 'timev', title: $t('abp.meters.timev'), minWidth: '100' },
|
|
||||||
{
|
|
||||||
field: 'haveValve',
|
|
||||||
title: $t('abp.meters.haveValve'),
|
|
||||||
minWidth: '150',
|
|
||||||
slots: { default: 'isHaveValve' },
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'enabled',
|
field: 'ioTPlatformResponse',
|
||||||
title: $t('common.isEnable'),
|
title: $t('abp.deviceInfos.ioTPlatformResponse'),
|
||||||
minWidth: '150',
|
minWidth: '150',
|
||||||
slots: { default: 'isEnable' },
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: $t('common.action'),
|
title: $t('common.action'),
|
||||||
@ -122,184 +105,40 @@ export const tableSchema: any = computed((): VxeGridProps['columns'] => [
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export const addUserFormSchema: any = computed(() => [
|
export const addDeviceFormSchema: any = computed(() => [
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'meterName',
|
fieldName: 'deviceAddress',
|
||||||
label: $t('abp.meters.meterName'),
|
label: $t('abp.deviceInfos.deviceAddress'),
|
||||||
rules: z.string().min(1, {
|
rules: z.string().min(1, {
|
||||||
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.meters.meterName')}`,
|
message: `${$t('common.pleaseInput')}${$t('abp.deviceInfos.deviceAddress')}`,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'meterAddress',
|
fieldName: 'platformPassword',
|
||||||
label: $t('abp.meters.meterAddress'),
|
label: $t('abp.deviceInfos.platformPassword'),
|
||||||
rules: z
|
rules: z.string().min(1, {
|
||||||
.string()
|
message: `${$t('common.pleaseInput')}${$t('abp.deviceInfos.platformPassword')}`,
|
||||||
.min(1, {
|
|
||||||
message: `${$t('common.pleaseInput')}${$t('common.numberType')}${$t('abp.meters.meterAddress')}`,
|
|
||||||
})
|
|
||||||
.refine((value) => /^\d+$/.test(value), {
|
|
||||||
message: $t('abp.meters.checkmeterAddress'),
|
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
component: 'Select',
|
|
||||||
componentProps: {
|
|
||||||
allowClear: true,
|
|
||||||
options: meterTypeOptions,
|
|
||||||
placeholder: `${$t('common.pleaseSelect')}${$t('abp.meters.meterType')}`,
|
|
||||||
},
|
|
||||||
fieldName: 'meterType',
|
|
||||||
label: $t('abp.meters.meterType'),
|
|
||||||
rules: z
|
|
||||||
.number()
|
|
||||||
.min(1, {
|
|
||||||
message: `${$t('common.pleaseSelect')}${$t('abp.meters.meterType')}`,
|
|
||||||
})
|
|
||||||
.default(1),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Select',
|
|
||||||
componentProps: {
|
|
||||||
allowClear: true,
|
|
||||||
options: rateOptions,
|
|
||||||
placeholder: `${$t('common.pleaseSelect')}${$t('abp.meters.singleRate')}`,
|
|
||||||
},
|
|
||||||
dependencies: {
|
|
||||||
show(values: any) {
|
|
||||||
return values.meterType === 1;
|
|
||||||
},
|
|
||||||
rules(values: any) {
|
|
||||||
if (values.meterType === 1) {
|
|
||||||
return 'required';
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
triggerFields: ['meterType'],
|
|
||||||
},
|
|
||||||
fieldName: 'singleRate',
|
|
||||||
label: $t('abp.meters.singleRate'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Switch',
|
|
||||||
componentProps: {
|
|
||||||
class: 'w-auto',
|
|
||||||
},
|
|
||||||
fieldName: 'selfDevelop',
|
|
||||||
label: $t('abp.meters.selfDevelop'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'brandType',
|
|
||||||
label: $t('abp.meters.brandType'),
|
|
||||||
rules: z.string().optional(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Switch',
|
|
||||||
componentProps: {
|
|
||||||
class: 'w-auto',
|
|
||||||
},
|
|
||||||
fieldName: 'dynamicPassword',
|
|
||||||
label: $t('abp.meters.dynamicPassword'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'password',
|
|
||||||
label: $t('abp.meters.password'),
|
|
||||||
rules: z.string().optional(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Switch',
|
|
||||||
componentProps: {
|
|
||||||
class: 'w-auto',
|
|
||||||
},
|
|
||||||
dependencies: {
|
|
||||||
show(values: any) {
|
|
||||||
return values.meterType === 2;
|
|
||||||
},
|
|
||||||
triggerFields: ['meterType'],
|
|
||||||
},
|
|
||||||
fieldName: 'haveValve',
|
|
||||||
label: $t('abp.meters.haveValve'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'timesA',
|
|
||||||
label: $t('abp.meters.timesA'),
|
|
||||||
componentProps: {
|
|
||||||
allowClear: true,
|
|
||||||
placeholder: `${$t('common.pleaseInput')}${$t('abp.meters.timesA')}`,
|
|
||||||
},
|
|
||||||
dependencies: {
|
|
||||||
show(values: any) {
|
|
||||||
return values.meterType === 1;
|
|
||||||
},
|
|
||||||
triggerFields: ['meterType'],
|
|
||||||
},
|
|
||||||
rules: z
|
|
||||||
.string({
|
|
||||||
message: `${$t('common.pleaseInput')}${$t('abp.meters.timesA')}`,
|
|
||||||
})
|
|
||||||
.default('1'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'timev',
|
|
||||||
label: $t('abp.meters.timev'),
|
|
||||||
componentProps: {
|
|
||||||
allowClear: true,
|
|
||||||
placeholder: `${$t('common.pleaseInput')}${$t('abp.meters.timev')}`,
|
|
||||||
},
|
|
||||||
dependencies: {
|
|
||||||
show(values: any) {
|
|
||||||
return values.meterType === 1;
|
|
||||||
},
|
|
||||||
triggerFields: ['meterType'],
|
|
||||||
},
|
|
||||||
rules: z
|
|
||||||
.string({
|
|
||||||
message: `${$t('common.pleaseInput')}${$t('abp.meters.timesA')}`,
|
|
||||||
})
|
|
||||||
.default('1'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'meteringCode',
|
|
||||||
label: $t('abp.meters.meteringCode'),
|
|
||||||
componentProps: {
|
|
||||||
allowClear: true,
|
|
||||||
placeholder: `${$t('common.pleaseInput')}${$t('abp.meters.meteringCode')}`,
|
|
||||||
},
|
|
||||||
rules: z
|
|
||||||
.string({
|
|
||||||
message: `${$t('common.pleaseInput')}${$t('abp.meters.meteringCode')}`,
|
|
||||||
})
|
|
||||||
.default('1'),
|
|
||||||
},
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export const editUserFormSchemaEdit: any = computed(() => [
|
export const editDeviceFormSchemaEdit: any = computed(() => [
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'meterName',
|
fieldName: 'deviceAddress',
|
||||||
label: $t('abp.meters.meterName'),
|
label: $t('abp.deviceInfos.deviceAddress'),
|
||||||
rules: z.string().min(1, {
|
rules: z.string().min(1, {
|
||||||
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.meters.meterName')}`,
|
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.deviceInfos.deviceAddress')}`,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'meterAddress',
|
fieldName: 'platformPassword',
|
||||||
label: $t('abp.meters.meterAddress'),
|
label: $t('abp.deviceInfos.platformPassword'),
|
||||||
rules: z
|
rules: z.string().min(1, {
|
||||||
.string()
|
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.deviceInfos.platformPassword')}`,
|
||||||
.min(1, {
|
|
||||||
message: `${$t('common.pleaseInput')}${$t('common.numberType')}${$t('abp.meters.meterAddress')}`,
|
|
||||||
})
|
|
||||||
.refine((value) => /^\d+$/.test(value), {
|
|
||||||
message: $t('abp.meters.checkmeterAddress'),
|
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -307,14 +146,14 @@ export const editUserFormSchemaEdit: any = computed(() => [
|
|||||||
componentProps: {
|
componentProps: {
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
options: meterTypeOptions,
|
options: meterTypeOptions,
|
||||||
placeholder: `${$t('common.pleaseSelect')}${$t('abp.meters.meterType')}`,
|
placeholder: `${$t('common.pleaseSelect')}${$t('abp.deviceInfos.meterType')}`,
|
||||||
},
|
},
|
||||||
fieldName: 'meterType',
|
fieldName: 'meterType',
|
||||||
label: $t('abp.meters.meterType'),
|
label: $t('abp.deviceInfos.meterType'),
|
||||||
rules: z
|
rules: z
|
||||||
.number()
|
.number()
|
||||||
.min(1, {
|
.min(1, {
|
||||||
message: `${$t('common.pleaseSelect')}${$t('abp.meters.meterType')}`,
|
message: `${$t('common.pleaseSelect')}${$t('abp.deviceInfos.meterType')}`,
|
||||||
})
|
})
|
||||||
.default(1),
|
.default(1),
|
||||||
},
|
},
|
||||||
@ -323,7 +162,7 @@ export const editUserFormSchemaEdit: any = computed(() => [
|
|||||||
componentProps: {
|
componentProps: {
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
options: rateOptions,
|
options: rateOptions,
|
||||||
placeholder: `${$t('common.pleaseSelect')}${$t('abp.meters.singleRate')}`,
|
placeholder: `${$t('common.pleaseSelect')}${$t('abp.deviceInfos.singleRate')}`,
|
||||||
},
|
},
|
||||||
dependencies: {
|
dependencies: {
|
||||||
show(values: any) {
|
show(values: any) {
|
||||||
@ -338,7 +177,7 @@ export const editUserFormSchemaEdit: any = computed(() => [
|
|||||||
triggerFields: ['meterType'],
|
triggerFields: ['meterType'],
|
||||||
},
|
},
|
||||||
fieldName: 'singleRate',
|
fieldName: 'singleRate',
|
||||||
label: $t('abp.meters.singleRate'),
|
label: $t('abp.deviceInfos.singleRate'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Switch',
|
component: 'Switch',
|
||||||
@ -346,12 +185,12 @@ export const editUserFormSchemaEdit: any = computed(() => [
|
|||||||
class: 'w-auto',
|
class: 'w-auto',
|
||||||
},
|
},
|
||||||
fieldName: 'selfDevelop',
|
fieldName: 'selfDevelop',
|
||||||
label: $t('abp.meters.selfDevelop'),
|
label: $t('abp.deviceInfos.selfDevelop'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'brandType',
|
fieldName: 'brandType',
|
||||||
label: $t('abp.meters.brandType'),
|
label: $t('abp.deviceInfos.brandType'),
|
||||||
rules: z.string().optional(),
|
rules: z.string().optional(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -360,12 +199,12 @@ export const editUserFormSchemaEdit: any = computed(() => [
|
|||||||
class: 'w-auto',
|
class: 'w-auto',
|
||||||
},
|
},
|
||||||
fieldName: 'dynamicPassword',
|
fieldName: 'dynamicPassword',
|
||||||
label: $t('abp.meters.dynamicPassword'),
|
label: $t('abp.deviceInfos.dynamicPassword'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'password',
|
fieldName: 'password',
|
||||||
label: $t('abp.meters.password'),
|
label: $t('abp.deviceInfos.password'),
|
||||||
rules: z.string().optional(),
|
rules: z.string().optional(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -380,15 +219,15 @@ export const editUserFormSchemaEdit: any = computed(() => [
|
|||||||
triggerFields: ['meterType'],
|
triggerFields: ['meterType'],
|
||||||
},
|
},
|
||||||
fieldName: 'haveValve',
|
fieldName: 'haveValve',
|
||||||
label: $t('abp.meters.haveValve'),
|
label: $t('abp.deviceInfos.haveValve'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'timesA',
|
fieldName: 'timesA',
|
||||||
label: $t('abp.meters.timesA'),
|
label: $t('abp.deviceInfos.timesA'),
|
||||||
componentProps: {
|
componentProps: {
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
placeholder: `${$t('common.pleaseInput')}${$t('abp.meters.timesA')}`,
|
placeholder: `${$t('common.pleaseInput')}${$t('abp.deviceInfos.timesA')}`,
|
||||||
},
|
},
|
||||||
dependencies: {
|
dependencies: {
|
||||||
show(values: any) {
|
show(values: any) {
|
||||||
@ -398,17 +237,17 @@ export const editUserFormSchemaEdit: any = computed(() => [
|
|||||||
},
|
},
|
||||||
rules: z
|
rules: z
|
||||||
.string({
|
.string({
|
||||||
message: `${$t('common.pleaseInput')}${$t('abp.meters.timesA')}`,
|
message: `${$t('common.pleaseInput')}${$t('abp.deviceInfos.timesA')}`,
|
||||||
})
|
})
|
||||||
.default('1'),
|
.default('1'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'timev',
|
fieldName: 'timev',
|
||||||
label: $t('abp.meters.timev'),
|
label: $t('abp.deviceInfos.timev'),
|
||||||
componentProps: {
|
componentProps: {
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
placeholder: `${$t('common.pleaseInput')}${$t('abp.meters.timev')}`,
|
placeholder: `${$t('common.pleaseInput')}${$t('abp.deviceInfos.timev')}`,
|
||||||
},
|
},
|
||||||
dependencies: {
|
dependencies: {
|
||||||
show(values: any) {
|
show(values: any) {
|
||||||
@ -418,21 +257,21 @@ export const editUserFormSchemaEdit: any = computed(() => [
|
|||||||
},
|
},
|
||||||
rules: z
|
rules: z
|
||||||
.string({
|
.string({
|
||||||
message: `${$t('common.pleaseInput')}${$t('abp.meters.timev')}`,
|
message: `${$t('common.pleaseInput')}${$t('abp.deviceInfos.timev')}`,
|
||||||
})
|
})
|
||||||
.default('1'),
|
.default('1'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'meteringCode',
|
fieldName: 'meteringCode',
|
||||||
label: $t('abp.meters.meteringCode'),
|
label: $t('abp.deviceInfos.meteringCode'),
|
||||||
componentProps: {
|
componentProps: {
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
placeholder: `${$t('common.pleaseInput')}${$t('abp.meters.meteringCode')}`,
|
placeholder: `${$t('common.pleaseInput')}${$t('abp.deviceInfos.meteringCode')}`,
|
||||||
},
|
},
|
||||||
rules: z
|
rules: z
|
||||||
.string({
|
.string({
|
||||||
message: `${$t('common.pleaseInput')}${$t('abp.meters.meteringCode')}`,
|
message: `${$t('common.pleaseInput')}${$t('abp.deviceInfos.meteringCode')}`,
|
||||||
})
|
})
|
||||||
.min(1, {
|
.min(1, {
|
||||||
message: `${$t('common.MustGreaterTthan0')}`,
|
message: `${$t('common.MustGreaterTthan0')}`,
|
||||||
|
|||||||
@ -1,279 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
import type { VbenFormProps } from '#/adapter/form';
|
|
||||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
|
||||||
|
|
||||||
import { h, ref } from 'vue';
|
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
|
|
||||||
import { Page, useVbenModal } from '@vben/common-ui';
|
|
||||||
|
|
||||||
import { message as Message, Modal, Tag } from 'ant-design-vue';
|
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
|
||||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
|
||||||
import {
|
|
||||||
postFocusesCreate,
|
|
||||||
postFocusesDelete,
|
|
||||||
postFocusesPage,
|
|
||||||
postFocusesUpdate,
|
|
||||||
} from '#/api-client';
|
|
||||||
import { TableAction } from '#/components/table-action';
|
|
||||||
import { $t } from '#/locales';
|
|
||||||
|
|
||||||
import {
|
|
||||||
addUserFormSchema,
|
|
||||||
editUserFormSchemaEdit,
|
|
||||||
querySchema,
|
|
||||||
tableSchema,
|
|
||||||
} from './schema';
|
|
||||||
|
|
||||||
defineOptions({
|
|
||||||
name: 'AbpUser',
|
|
||||||
});
|
|
||||||
const router = useRouter();
|
|
||||||
const formOptions: VbenFormProps = {
|
|
||||||
schema: querySchema.value,
|
|
||||||
};
|
|
||||||
const gridOptions: VxeGridProps<any> = {
|
|
||||||
checkboxConfig: {
|
|
||||||
highlight: true,
|
|
||||||
labelField: 'name',
|
|
||||||
},
|
|
||||||
columns: tableSchema.value,
|
|
||||||
height: 'auto',
|
|
||||||
keepSource: true,
|
|
||||||
pagerConfig: {},
|
|
||||||
toolbarConfig: {
|
|
||||||
custom: true,
|
|
||||||
},
|
|
||||||
customConfig: {
|
|
||||||
storage: true,
|
|
||||||
},
|
|
||||||
proxyConfig: {
|
|
||||||
ajax: {
|
|
||||||
query: async ({ page }, formValues) => {
|
|
||||||
const { data } = await postFocusesPage({
|
|
||||||
body: {
|
|
||||||
pageIndex: page.currentPage,
|
|
||||||
pageSize: page.pageSize,
|
|
||||||
...formValues,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
return data;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({ formOptions, gridOptions });
|
|
||||||
|
|
||||||
const editRow: Record<string, any> = ref({});
|
|
||||||
const [UserModal, userModalApi] = useVbenModal({
|
|
||||||
draggable: true,
|
|
||||||
onConfirm: submit,
|
|
||||||
onBeforeClose: () => {
|
|
||||||
editRow.value = {};
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const [AddForm, addFormApi] = useVbenForm({
|
|
||||||
// 默认展开
|
|
||||||
collapsed: false,
|
|
||||||
// 所有表单项共用,可单独在表单内覆盖
|
|
||||||
commonConfig: {
|
|
||||||
labelWidth: 110,
|
|
||||||
componentProps: {
|
|
||||||
class: 'w-4/5',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
layout: 'horizontal',
|
|
||||||
schema: addUserFormSchema.value,
|
|
||||||
showCollapseButton: false,
|
|
||||||
showDefaultActions: false,
|
|
||||||
wrapperClass: 'grid-cols-2',
|
|
||||||
});
|
|
||||||
|
|
||||||
const [EditForm, editFormApi] = useVbenForm({
|
|
||||||
// 默认展开
|
|
||||||
collapsed: false,
|
|
||||||
// 所有表单项共用,可单独在表单内覆盖
|
|
||||||
commonConfig: {
|
|
||||||
labelWidth: 110,
|
|
||||||
componentProps: {
|
|
||||||
class: 'w-4/5',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
// 提交函数
|
|
||||||
layout: 'horizontal',
|
|
||||||
schema: editUserFormSchemaEdit.value,
|
|
||||||
showCollapseButton: false,
|
|
||||||
showDefaultActions: false,
|
|
||||||
wrapperClass: 'grid-cols-2',
|
|
||||||
});
|
|
||||||
|
|
||||||
// 新增和编辑提交的逻辑
|
|
||||||
async function submit() {
|
|
||||||
const isEdit = !!editRow.value.id;
|
|
||||||
const formApi = isEdit ? editFormApi : addFormApi;
|
|
||||||
const api = isEdit ? postFocusesUpdate : postFocusesCreate;
|
|
||||||
const { valid } = await formApi.validate();
|
|
||||||
if (!valid) return;
|
|
||||||
|
|
||||||
const formValues = await formApi.getValues();
|
|
||||||
const fetchParams: any = isEdit
|
|
||||||
? {
|
|
||||||
id: editRow.value.id,
|
|
||||||
...formValues,
|
|
||||||
}
|
|
||||||
: formValues;
|
|
||||||
|
|
||||||
try {
|
|
||||||
userModalApi.setState({ loading: true, confirmLoading: true });
|
|
||||||
const resp = await api({ body: fetchParams });
|
|
||||||
if (resp.data) {
|
|
||||||
Message.success(
|
|
||||||
editRow.value.id ? $t('common.editSuccess') : $t('common.addSuccess'),
|
|
||||||
);
|
|
||||||
userModalApi.close();
|
|
||||||
gridApi.reload();
|
|
||||||
} else {
|
|
||||||
Message.error(
|
|
||||||
editRow.value.id ? $t('common.editFail') : $t('common.addFail'),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
userModalApi.setState({ loading: false, confirmLoading: false });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function onEdit(record: any) {
|
|
||||||
editRow.value = record;
|
|
||||||
userModalApi.open();
|
|
||||||
editFormApi.setValues({ ...record });
|
|
||||||
}
|
|
||||||
|
|
||||||
function onDel(row: any) {
|
|
||||||
Modal.confirm({
|
|
||||||
title: `${$t('common.confirmDelete')}${row.name} ?`,
|
|
||||||
onOk: async () => {
|
|
||||||
const result = await postFocusesDelete({ body: { id: row.id } });
|
|
||||||
if (result) {
|
|
||||||
gridApi.reload();
|
|
||||||
Message.success($t('common.deleteSuccess'));
|
|
||||||
} else {
|
|
||||||
Message.error($t('common.deleteFail'));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const toStatusData = (row: Record<string, any>) => {
|
|
||||||
// 或者使用编程式导航
|
|
||||||
router.push({
|
|
||||||
path: '/iotdb/deviceData',
|
|
||||||
query: {
|
|
||||||
DeviceType: 10,
|
|
||||||
DeviceId: row.focusId,
|
|
||||||
FocusAddress: row.focusAddress,
|
|
||||||
SystemName: row.businessSystemName,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const onLock = async (row: Record<string, any>) => {
|
|
||||||
await postFocusesUpdate({
|
|
||||||
body: {
|
|
||||||
id: row.id,
|
|
||||||
name: row.name,
|
|
||||||
focusAddress: row.focusAddress,
|
|
||||||
enabled: !row.enabled,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
gridApi.reload();
|
|
||||||
};
|
|
||||||
|
|
||||||
const openAddModal = async () => {
|
|
||||||
editRow.value = {};
|
|
||||||
userModalApi.open();
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<Page auto-content-height>
|
|
||||||
<Grid>
|
|
||||||
<template #toolbar-actions>
|
|
||||||
<TableAction :actions="[
|
|
||||||
{
|
|
||||||
label: $t('common.add'),
|
|
||||||
type: 'primary',
|
|
||||||
icon: 'ant-design:plus-outlined',
|
|
||||||
onClick: openAddModal.bind(null),
|
|
||||||
auth: ['AbpIdentity.Users.Create'],
|
|
||||||
},
|
|
||||||
]" />
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #isSelfDevelop="{ row }">
|
|
||||||
<component :is="h(Tag, { color: row.selfDevelop ? 'green' : 'red' }, () =>
|
|
||||||
row.selfDevelop ? $t('common.yes') : $t('common.no'),
|
|
||||||
)
|
|
||||||
" />
|
|
||||||
</template>
|
|
||||||
<template #isStatus="{ row }">
|
|
||||||
<component :is="h(Tag, { color: row.status ? 'green' : 'red' }, () =>
|
|
||||||
row.status ? $t('common.yes') : $t('common.no'),
|
|
||||||
)
|
|
||||||
" />
|
|
||||||
</template>
|
|
||||||
<template #isEnable="{ row }">
|
|
||||||
<component :is="h(Tag, { color: row.enabled ? 'green' : 'red' }, () =>
|
|
||||||
row.enabled ? $t('common.yes') : $t('common.no'),
|
|
||||||
)
|
|
||||||
" />
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #action="{ row }">
|
|
||||||
<TableAction :actions="[
|
|
||||||
{
|
|
||||||
label: $t('common.edit'),
|
|
||||||
type: 'link',
|
|
||||||
size: 'small',
|
|
||||||
auth: ['AbpIdentity.Users.Update'],
|
|
||||||
onClick: onEdit.bind(null, row),
|
|
||||||
},
|
|
||||||
]" :drop-down-actions="[
|
|
||||||
{
|
|
||||||
label: row.enabled ? $t('common.disabled') : $t('common.enabled'),
|
|
||||||
icon: `ant-design:${row.enabled ? 'close' : 'check'}-outlined`,
|
|
||||||
type: 'link',
|
|
||||||
size: 'small',
|
|
||||||
auth: ['AbpIdentity.Users.Enable'],
|
|
||||||
onClick: onLock.bind(null, row),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: $t('common.delete'),
|
|
||||||
icon: 'ant-design:delete-outlined',
|
|
||||||
type: 'primary',
|
|
||||||
auth: ['AbpIdentity.Users.Delete'],
|
|
||||||
popConfirm: {
|
|
||||||
title: $t('common.askConfirmDelete'),
|
|
||||||
confirm: onDel.bind(null, row),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: $t('abp.focus.statusData'),
|
|
||||||
icon: 'ant-design:profile-outlined',
|
|
||||||
type: 'primary',
|
|
||||||
auth: ['AbpIdentity.Users.Delete'],
|
|
||||||
onClick: toStatusData.bind(null, row),
|
|
||||||
},
|
|
||||||
]" />
|
|
||||||
</template>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<UserModal :title="editRow.id ? $t('common.edit') : $t('common.add')" class="w-[800px]">
|
|
||||||
<component :is="editRow.id ? EditForm : AddForm" />
|
|
||||||
</UserModal>
|
|
||||||
</Page>
|
|
||||||
</template>
|
|
||||||
@ -1,216 +0,0 @@
|
|||||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
|
||||||
|
|
||||||
import { computed } from 'vue';
|
|
||||||
|
|
||||||
import { z } from '@vben/common-ui';
|
|
||||||
|
|
||||||
import dayjs from 'dayjs';
|
|
||||||
|
|
||||||
import { $t } from '#/locales';
|
|
||||||
|
|
||||||
export const querySchema = computed(() => [
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'focusAddress',
|
|
||||||
label: $t('abp.focus.focusAddress'),
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
export const tableSchema: any = computed((): VxeGridProps['columns'] => [
|
|
||||||
{ title: $t('common.seq'), type: 'seq', width: 50 },
|
|
||||||
{ field: 'name', title: $t('abp.focus.name'), minWidth: '150' },
|
|
||||||
{
|
|
||||||
field: 'focusAddress',
|
|
||||||
title: $t('abp.focus.focusAddress'),
|
|
||||||
minWidth: '150',
|
|
||||||
},
|
|
||||||
{ field: 'focusCode', title: $t('abp.focus.focusCode'), minWidth: '150' },
|
|
||||||
{
|
|
||||||
field: 'selfDevelop',
|
|
||||||
title: $t('abp.focus.selfDevelop'),
|
|
||||||
minWidth: '150',
|
|
||||||
slots: { default: 'isSelfDevelop' },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'enabled',
|
|
||||||
title: $t('common.isEnable'),
|
|
||||||
minWidth: '150',
|
|
||||||
slots: { default: 'isEnable' },
|
|
||||||
},
|
|
||||||
{ field: 'apn', title: $t('abp.focus.apn'), minWidth: '100' },
|
|
||||||
{
|
|
||||||
field: 'masterStation',
|
|
||||||
title: $t('abp.focus.masterStation'),
|
|
||||||
minWidth: '150',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'status',
|
|
||||||
title: $t('abp.focus.status'),
|
|
||||||
minWidth: '150',
|
|
||||||
slots: { default: 'isStatus' },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'heartbeatInterval',
|
|
||||||
title: $t('abp.focus.heartbeatInterval'),
|
|
||||||
minWidth: '150',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'lastRefreshTime',
|
|
||||||
title: $t('abp.focus.lastRefreshTime'),
|
|
||||||
minWidth: '150',
|
|
||||||
formatter: ({ cellValue }) => {
|
|
||||||
return cellValue ? dayjs(cellValue).format('YYYY-MM-DD HH:mm:ss') : '-';
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'deviceNo',
|
|
||||||
title: $t('abp.focus.deviceNo'),
|
|
||||||
minWidth: '150',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: $t('common.action'),
|
|
||||||
field: 'action',
|
|
||||||
fixed: 'right',
|
|
||||||
width: '150',
|
|
||||||
slots: { default: 'action' },
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
export const addUserFormSchema: any = computed(() => [
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
componentProps: {},
|
|
||||||
fieldName: 'name',
|
|
||||||
label: $t('abp.focus.name'),
|
|
||||||
rules: z.string().min(1, {
|
|
||||||
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.focus.name')}`,
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
componentProps: {},
|
|
||||||
fieldName: 'focusAddress',
|
|
||||||
label: $t('abp.focus.focusAddress'),
|
|
||||||
rules: z
|
|
||||||
.string()
|
|
||||||
.min(1, {
|
|
||||||
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.focus.focusAddress')}`,
|
|
||||||
})
|
|
||||||
.refine((value) => value.length === 9, {
|
|
||||||
message: $t('abp.focus.checkFocusAddress'),
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Switch',
|
|
||||||
componentProps: {
|
|
||||||
class: 'w-auto',
|
|
||||||
},
|
|
||||||
fieldName: 'selfDevelop',
|
|
||||||
label: $t('abp.focus.selfDevelop'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
componentProps: {},
|
|
||||||
fieldName: 'focusCode',
|
|
||||||
label: $t('abp.focus.focusCode'),
|
|
||||||
rules: z.string().optional(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
componentProps: {},
|
|
||||||
fieldName: 'apn',
|
|
||||||
label: $t('abp.focus.apn'),
|
|
||||||
rules: z.string().optional(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Switch',
|
|
||||||
componentProps: {
|
|
||||||
class: 'w-auto',
|
|
||||||
},
|
|
||||||
fieldName: 'enabled',
|
|
||||||
label: $t('common.isEnable'),
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// component: 'Input',
|
|
||||||
// componentProps: {},
|
|
||||||
// fieldName: 'phoneNumber',
|
|
||||||
// label: $t('abp.focus.phone'),
|
|
||||||
// rules: z
|
|
||||||
// .string()
|
|
||||||
// .min(1, { message: $t('common.pleaseInput') + $t('abp.focus.phone') }),
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// component: 'Input',
|
|
||||||
// componentProps: {},
|
|
||||||
// fieldName: 'password',
|
|
||||||
// label: $t('abp.focus.password'),
|
|
||||||
// rules: z
|
|
||||||
// .string()
|
|
||||||
// .min(1, { message: $t('common.pleaseInput') + $t('abp.focus.password') }),
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// component: 'Input',
|
|
||||||
// componentProps: {},
|
|
||||||
// fieldName: 'confirmPassword',
|
|
||||||
// label: $t('abp.focus.comfirmPassword'),
|
|
||||||
// rules: z.string().min(1, {
|
|
||||||
// message: $t('common.pleaseInput') + $t('abp.focus.comfirmPassword'),
|
|
||||||
// }),
|
|
||||||
// },
|
|
||||||
]);
|
|
||||||
|
|
||||||
export const editUserFormSchemaEdit: any = computed(() => [
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
componentProps: {},
|
|
||||||
fieldName: 'name',
|
|
||||||
label: $t('abp.focus.name'),
|
|
||||||
rules: z.string().min(1, {
|
|
||||||
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.focus.name')}`,
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
componentProps: {},
|
|
||||||
fieldName: 'focusAddress',
|
|
||||||
label: $t('abp.focus.focusAddress'),
|
|
||||||
rules: z
|
|
||||||
.string()
|
|
||||||
.min(1, {
|
|
||||||
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.focus.focusAddress')}`,
|
|
||||||
})
|
|
||||||
.refine((value) => value.length === 9, {
|
|
||||||
message: $t('abp.focus.checkFocusAddress'),
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Switch',
|
|
||||||
componentProps: {
|
|
||||||
class: 'w-auto',
|
|
||||||
},
|
|
||||||
fieldName: 'selfDevelop',
|
|
||||||
label: $t('abp.focus.selfDevelop'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
componentProps: {},
|
|
||||||
fieldName: 'focusCode',
|
|
||||||
label: $t('abp.focus.focusCode'),
|
|
||||||
rules: z.string().optional(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
componentProps: {},
|
|
||||||
fieldName: 'apn',
|
|
||||||
label: $t('abp.focus.apn'),
|
|
||||||
rules: z.string().optional(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Switch',
|
|
||||||
componentProps: {
|
|
||||||
class: 'w-auto',
|
|
||||||
},
|
|
||||||
fieldName: 'enabled',
|
|
||||||
label: $t('common.isEnable'),
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
@ -2,31 +2,26 @@
|
|||||||
import type { VbenFormProps } from '#/adapter/form';
|
import type { VbenFormProps } from '#/adapter/form';
|
||||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
|
|
||||||
import { h, ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
import { Page, useVbenModal } from '@vben/common-ui';
|
import { Page, useVbenModal } from '@vben/common-ui';
|
||||||
|
|
||||||
import { message as Message, Modal, Tag } from 'ant-design-vue';
|
import { message as Message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import {
|
import {
|
||||||
postMetersArchivesDown,
|
postOneNETAccountCreate,
|
||||||
postMetersCreate,
|
postOneNETAccountInfoPage,
|
||||||
postMetersDelete,
|
|
||||||
postMetersPage,
|
|
||||||
postMetersUpdate,
|
|
||||||
} from '#/api-client';
|
} from '#/api-client';
|
||||||
import { TableAction } from '#/components/table-action';
|
import { TableAction } from '#/components/table-action';
|
||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
addUserFormSchema,
|
addAccountFormSchema,
|
||||||
editUserFormSchemaEdit,
|
editAccountFormSchemaEdit,
|
||||||
meterTypeOptions,
|
|
||||||
querySchema,
|
querySchema,
|
||||||
rateOptions,
|
|
||||||
tableSchema,
|
tableSchema,
|
||||||
} from './schema';
|
} from './schema';
|
||||||
|
|
||||||
@ -56,7 +51,7 @@ const gridOptions: VxeGridProps<any> = {
|
|||||||
proxyConfig: {
|
proxyConfig: {
|
||||||
ajax: {
|
ajax: {
|
||||||
query: async ({ page }, formValues) => {
|
query: async ({ page }, formValues) => {
|
||||||
const { data } = await postMetersPage({
|
const { data } = await postOneNETAccountInfoPage({
|
||||||
body: {
|
body: {
|
||||||
pageIndex: page.currentPage,
|
pageIndex: page.currentPage,
|
||||||
pageSize: page.pageSize,
|
pageSize: page.pageSize,
|
||||||
@ -92,7 +87,7 @@ const [AddForm, addFormApi] = useVbenForm({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
layout: 'horizontal',
|
layout: 'horizontal',
|
||||||
schema: addUserFormSchema.value,
|
schema: addAccountFormSchema.value,
|
||||||
showCollapseButton: false,
|
showCollapseButton: false,
|
||||||
showDefaultActions: false,
|
showDefaultActions: false,
|
||||||
wrapperClass: 'grid-cols-2',
|
wrapperClass: 'grid-cols-2',
|
||||||
@ -110,7 +105,7 @@ const [EditForm, editFormApi] = useVbenForm({
|
|||||||
},
|
},
|
||||||
// 提交函数
|
// 提交函数
|
||||||
layout: 'horizontal',
|
layout: 'horizontal',
|
||||||
schema: editUserFormSchemaEdit.value,
|
schema: editAccountFormSchemaEdit.value,
|
||||||
showCollapseButton: false,
|
showCollapseButton: false,
|
||||||
showDefaultActions: false,
|
showDefaultActions: false,
|
||||||
wrapperClass: 'grid-cols-2',
|
wrapperClass: 'grid-cols-2',
|
||||||
@ -120,7 +115,7 @@ const [EditForm, editFormApi] = useVbenForm({
|
|||||||
async function submit() {
|
async function submit() {
|
||||||
const isEdit = !!editRow.value.id;
|
const isEdit = !!editRow.value.id;
|
||||||
const formApi = isEdit ? editFormApi : addFormApi;
|
const formApi = isEdit ? editFormApi : addFormApi;
|
||||||
const api = isEdit ? postMetersUpdate : postMetersCreate;
|
const api = postOneNETAccountCreate;
|
||||||
const { valid } = await formApi.validate();
|
const { valid } = await formApi.validate();
|
||||||
if (!valid) return;
|
if (!valid) return;
|
||||||
|
|
||||||
@ -161,47 +156,6 @@ async function onEdit(record: any) {
|
|||||||
editFormApi.setValues({ ...record });
|
editFormApi.setValues({ ...record });
|
||||||
}
|
}
|
||||||
|
|
||||||
function onDel(row: any) {
|
|
||||||
Modal.confirm({
|
|
||||||
title: `${$t('common.confirmDelete')}${row.meterName} ?`,
|
|
||||||
onOk: async () => {
|
|
||||||
const result = await postMetersDelete({ body: { id: row.id } });
|
|
||||||
if (result) {
|
|
||||||
gridApi.reload();
|
|
||||||
Message.success($t('common.deleteSuccess'));
|
|
||||||
} else {
|
|
||||||
Message.error($t('common.deleteFail'));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
const toStatusData = (row: Record<string, any>) => {
|
|
||||||
// 或者使用编程式导航
|
|
||||||
router.push({
|
|
||||||
path: '/iotdb/point',
|
|
||||||
query: {
|
|
||||||
DeviceType: row.meterType,
|
|
||||||
DeviceId: row.meterId,
|
|
||||||
FocusAddress: row.focusAddress,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
||||||
// 档案下发
|
|
||||||
const archivesIssued = async (row: Record<string, any>) => {
|
|
||||||
const result = await postMetersArchivesDown({
|
|
||||||
body: {
|
|
||||||
meterAddress: row.meterAddress,
|
|
||||||
meterType: row.meterType,
|
|
||||||
focusAddress: row.focusAddress,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
if (result) {
|
|
||||||
gridApi.reload();
|
|
||||||
Message.success($t('common.success'));
|
|
||||||
} else {
|
|
||||||
Message.error($t('common.error'));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const openAddModal = async () => {
|
const openAddModal = async () => {
|
||||||
editRow.value = {};
|
editRow.value = {};
|
||||||
userModalApi.open();
|
userModalApi.open();
|
||||||
@ -212,8 +166,7 @@ const openAddModal = async () => {
|
|||||||
<Page auto-content-height>
|
<Page auto-content-height>
|
||||||
<Grid>
|
<Grid>
|
||||||
<template #toolbar-actions>
|
<template #toolbar-actions>
|
||||||
<TableAction
|
<TableAction :actions="[
|
||||||
:actions="[
|
|
||||||
{
|
{
|
||||||
label: $t('common.add'),
|
label: $t('common.add'),
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
@ -221,64 +174,11 @@ const openAddModal = async () => {
|
|||||||
onClick: openAddModal.bind(null),
|
onClick: openAddModal.bind(null),
|
||||||
auth: ['AbpIdentity.Users.Create'],
|
auth: ['AbpIdentity.Users.Create'],
|
||||||
},
|
},
|
||||||
]"
|
]" />
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #isMeterType="{ row }">
|
|
||||||
{{ meterTypeOptions[row.meterType - 1]?.label }}
|
|
||||||
</template>
|
|
||||||
<template #isSingleRate="{ row }">
|
|
||||||
{{ rateOptions.find((item) => item.value === row.singleRate)?.label }}
|
|
||||||
</template>
|
|
||||||
<template #isArchiveStatus="{ row }">
|
|
||||||
{{
|
|
||||||
row.archiveStatus ? $t('common.Issued') : $t('common.Undistributed')
|
|
||||||
}}
|
|
||||||
</template>
|
|
||||||
<template #isTripState="{ row }">
|
|
||||||
{{ row.tripState ? $t('common.SwitchOff') : $t('common.Closing') }}
|
|
||||||
</template>
|
|
||||||
<template #isHaveValve="{ row }">
|
|
||||||
<component
|
|
||||||
:is="
|
|
||||||
h(Tag, { color: row.haveValve ? 'green' : 'red' }, () =>
|
|
||||||
row.haveValve ? $t('common.yes') : $t('common.no'),
|
|
||||||
)
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template #isSelfDevelop="{ row }">
|
|
||||||
<component
|
|
||||||
:is="
|
|
||||||
h(Tag, { color: row.selfDevelop ? 'green' : 'red' }, () =>
|
|
||||||
row.selfDevelop ? $t('common.yes') : $t('common.no'),
|
|
||||||
)
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template #isDynamicPassword="{ row }">
|
|
||||||
<component
|
|
||||||
:is="
|
|
||||||
h(Tag, { color: row.dynamicPassword ? 'green' : 'red' }, () =>
|
|
||||||
row.dynamicPassword ? $t('common.yes') : $t('common.no'),
|
|
||||||
)
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template #isEnable="{ row }">
|
|
||||||
<component
|
|
||||||
:is="
|
|
||||||
h(Tag, { color: row.enabled ? 'green' : 'red' }, () =>
|
|
||||||
row.enabled ? $t('common.yes') : $t('common.no'),
|
|
||||||
)
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #action="{ row }">
|
<template #action="{ row }">
|
||||||
<TableAction
|
<TableAction :actions="[
|
||||||
:actions="[
|
|
||||||
{
|
{
|
||||||
label: $t('common.edit'),
|
label: $t('common.edit'),
|
||||||
type: 'link',
|
type: 'link',
|
||||||
@ -286,8 +186,7 @@ const openAddModal = async () => {
|
|||||||
auth: ['AbpIdentity.Users.Update'],
|
auth: ['AbpIdentity.Users.Update'],
|
||||||
onClick: onEdit.bind(null, row),
|
onClick: onEdit.bind(null, row),
|
||||||
},
|
},
|
||||||
]"
|
]" :drop-down-actions="[
|
||||||
:drop-down-actions="[
|
|
||||||
{
|
{
|
||||||
label: $t('common.delete'),
|
label: $t('common.delete'),
|
||||||
icon: 'ant-design:delete-outlined',
|
icon: 'ant-design:delete-outlined',
|
||||||
@ -299,27 +198,23 @@ const openAddModal = async () => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: $t('abp.meters.pointData'),
|
label: $t('abp.Account.pointData'),
|
||||||
icon: 'ant-design:profile-outlined',
|
icon: 'ant-design:profile-outlined',
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
auth: ['AbpIdentity.Users.Delete'],
|
auth: ['AbpIdentity.Users.Delete'],
|
||||||
onClick: toStatusData.bind(null, row),
|
onClick: toStatusData.bind(null, row),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: $t('abp.meters.archivesIssued'),
|
label: $t('abp.Account.archivesIssued'),
|
||||||
icon: 'ant-design:cloud-download-outlined',
|
icon: 'ant-design:cloud-download-outlined',
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
auth: ['AbpIdentity.Users.Delete'],
|
auth: ['AbpIdentity.Users.Delete'],
|
||||||
onClick: archivesIssued.bind(null, row),
|
onClick: archivesIssued.bind(null, row),
|
||||||
},
|
},
|
||||||
]"
|
]" />
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</Grid>
|
</Grid>
|
||||||
<UserModal
|
<UserModal :title="editRow.id ? $t('common.edit') : $t('common.add')" class="w-[800px]">
|
||||||
:title="editRow.id ? $t('common.edit') : $t('common.add')"
|
|
||||||
class="w-[800px]"
|
|
||||||
>
|
|
||||||
<component :is="editRow.id ? EditForm : AddForm" />
|
<component :is="editRow.id ? EditForm : AddForm" />
|
||||||
</UserModal>
|
</UserModal>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
@ -9,109 +9,37 @@ import { $t } from '#/locales';
|
|||||||
export const querySchema = computed(() => [
|
export const querySchema = computed(() => [
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'meterAddress',
|
fieldName: 'phoneNumber',
|
||||||
label: $t('abp.meters.meterAddress'),
|
label: $t('abp.OneNETManagement.PhoneNumber'),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
export const meterTypeOptions = [
|
|
||||||
{
|
|
||||||
label: $t('abp.meters.ElectricityMeter'),
|
|
||||||
value: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: $t('abp.meters.waterMeter'),
|
|
||||||
value: 2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: $t('abp.meters.GasMeter'),
|
|
||||||
value: 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: $t('abp.meters.HeatMeter'),
|
|
||||||
value: 4,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: $t('abp.meters.WaterMeterFlowmeter'),
|
|
||||||
value: 5,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: $t('abp.meters.GasMeterFlowmeter'),
|
|
||||||
value: 6,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
export const rateOptions = [
|
|
||||||
{
|
|
||||||
label: $t('abp.meters.MultipleRate'),
|
|
||||||
value: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: $t('abp.meters.SingleRate'),
|
|
||||||
value: true,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
export const tableSchema: any = computed((): VxeGridProps['columns'] => [
|
export const tableSchema: any = computed((): VxeGridProps['columns'] => [
|
||||||
{ title: $t('common.seq'), type: 'seq', width: 50 },
|
{ title: $t('common.seq'), type: 'seq', width: 50 },
|
||||||
{ field: 'meterName', title: $t('abp.meters.meterName'), minWidth: '150' },
|
|
||||||
{
|
{
|
||||||
field: 'meterAddress',
|
field: 'accountId',
|
||||||
title: $t('abp.meters.meterAddress'),
|
title: $t('abp.OneNETManagement.AccountId'),
|
||||||
minWidth: '150',
|
minWidth: '150',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'meterType',
|
field: 'accountName',
|
||||||
title: $t('abp.meters.meterType'),
|
title: $t('abp.OneNETManagement.AccountName'),
|
||||||
minWidth: '150',
|
minWidth: '150',
|
||||||
slots: { default: 'isMeterType' },
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'dynamicPassword',
|
field: 'phoneNumber',
|
||||||
title: $t('abp.meters.dynamicPassword'),
|
title: $t('abp.OneNETManagement.PhoneNumber'),
|
||||||
minWidth: '150',
|
minWidth: '150',
|
||||||
slots: { default: 'isDynamicPassword' },
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'password',
|
field: 'accesskey',
|
||||||
title: $t('abp.meters.password'),
|
title: $t('abp.OneNETManagement.AccountAccesskey'),
|
||||||
minWidth: '100',
|
minWidth: '150',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'singleRate',
|
field: 'productCount',
|
||||||
title: $t('abp.meters.singleRate'),
|
title: $t('abp.OneNETManagement.ProductCount'),
|
||||||
minWidth: '150',
|
minWidth: '150',
|
||||||
slots: { default: 'isSingleRate' },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'selfDevelop',
|
|
||||||
title: $t('abp.meters.selfDevelop'),
|
|
||||||
minWidth: '150',
|
|
||||||
slots: { default: 'isSelfDevelop' },
|
|
||||||
},
|
|
||||||
{ field: 'brandType', title: $t('abp.meters.brandType'), minWidth: '150' },
|
|
||||||
{
|
|
||||||
field: 'archiveStatus',
|
|
||||||
title: $t('abp.meters.archiveStatus'),
|
|
||||||
minWidth: '150',
|
|
||||||
slots: { default: 'isArchiveStatus' },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'tripState',
|
|
||||||
title: $t('abp.meters.tripState'),
|
|
||||||
minWidth: '150',
|
|
||||||
slots: { default: 'isTripState' },
|
|
||||||
},
|
|
||||||
{ field: 'timesA', title: $t('abp.meters.timesA'), minWidth: '100' },
|
|
||||||
{ field: 'timev', title: $t('abp.meters.timev'), minWidth: '100' },
|
|
||||||
{
|
|
||||||
field: 'haveValve',
|
|
||||||
title: $t('abp.meters.haveValve'),
|
|
||||||
minWidth: '150',
|
|
||||||
slots: { default: 'isHaveValve' },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'enabled',
|
|
||||||
title: $t('common.isEnable'),
|
|
||||||
minWidth: '150',
|
|
||||||
slots: { default: 'isEnable' },
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: $t('common.action'),
|
title: $t('common.action'),
|
||||||
@ -122,165 +50,47 @@ export const tableSchema: any = computed((): VxeGridProps['columns'] => [
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export const addUserFormSchema: any = computed(() => [
|
export const addAccountFormSchema: any = computed(() => [
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'meterName',
|
fieldName: 'accountId',
|
||||||
label: $t('abp.meters.meterName'),
|
label: $t('abp.OneNETManagement.AccountId'),
|
||||||
rules: z.string().min(1, {
|
rules: z.string().min(1, {
|
||||||
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.meters.meterName')}`,
|
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.OneNETManagement.AccountId')}`,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'meterAddress',
|
fieldName: 'accountName',
|
||||||
label: $t('abp.meters.meterAddress'),
|
label: $t('abp.OneNETManagement.AccountName'),
|
||||||
|
rules: z.string().min(1, {
|
||||||
|
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.OneNETManagement.AccountName')}`,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: 'Input',
|
||||||
|
fieldName: 'accountAccesskey',
|
||||||
|
label: $t('abp.OneNETManagement.AccountAccesskey'),
|
||||||
|
rules: z.string().min(1, {
|
||||||
|
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.OneNETManagement.AccountAccesskey')}`,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: 'Input',
|
||||||
|
fieldName: 'phoneNumber',
|
||||||
|
label: $t('abp.OneNETManagement.PhoneNumber'),
|
||||||
rules: z
|
rules: z
|
||||||
.string()
|
.string()
|
||||||
.min(1, {
|
.min(1, {
|
||||||
message: `${$t('common.pleaseInput')}${$t('common.numberType')}${$t('abp.meters.meterAddress')}`,
|
message: `${$t('common.pleaseInput')}${$t('common.numberType')}${$t('abp.OneNETManagement.PhoneNumber')}`,
|
||||||
})
|
})
|
||||||
.refine((value) => /^\d+$/.test(value), {
|
.refine((value) => /^\d+$/.test(value), {
|
||||||
message: $t('abp.meters.checkmeterAddress'),
|
message: $t('abp.OneNETManagement.PhoneNumber'),
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
component: 'Select',
|
|
||||||
componentProps: {
|
|
||||||
allowClear: true,
|
|
||||||
options: meterTypeOptions,
|
|
||||||
placeholder: `${$t('common.pleaseSelect')}${$t('abp.meters.meterType')}`,
|
|
||||||
},
|
|
||||||
fieldName: 'meterType',
|
|
||||||
label: $t('abp.meters.meterType'),
|
|
||||||
rules: z
|
|
||||||
.number()
|
|
||||||
.min(1, {
|
|
||||||
message: `${$t('common.pleaseSelect')}${$t('abp.meters.meterType')}`,
|
|
||||||
})
|
|
||||||
.default(1),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Select',
|
|
||||||
componentProps: {
|
|
||||||
allowClear: true,
|
|
||||||
options: rateOptions,
|
|
||||||
placeholder: `${$t('common.pleaseSelect')}${$t('abp.meters.singleRate')}`,
|
|
||||||
},
|
|
||||||
dependencies: {
|
|
||||||
show(values: any) {
|
|
||||||
return values.meterType === 1;
|
|
||||||
},
|
|
||||||
rules(values: any) {
|
|
||||||
if (values.meterType === 1) {
|
|
||||||
return 'required';
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
triggerFields: ['meterType'],
|
|
||||||
},
|
|
||||||
fieldName: 'singleRate',
|
|
||||||
label: $t('abp.meters.singleRate'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Switch',
|
|
||||||
componentProps: {
|
|
||||||
class: 'w-auto',
|
|
||||||
},
|
|
||||||
fieldName: 'selfDevelop',
|
|
||||||
label: $t('abp.meters.selfDevelop'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'brandType',
|
|
||||||
label: $t('abp.meters.brandType'),
|
|
||||||
rules: z.string().optional(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Switch',
|
|
||||||
componentProps: {
|
|
||||||
class: 'w-auto',
|
|
||||||
},
|
|
||||||
fieldName: 'dynamicPassword',
|
|
||||||
label: $t('abp.meters.dynamicPassword'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'password',
|
|
||||||
label: $t('abp.meters.password'),
|
|
||||||
rules: z.string().optional(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Switch',
|
|
||||||
componentProps: {
|
|
||||||
class: 'w-auto',
|
|
||||||
},
|
|
||||||
dependencies: {
|
|
||||||
show(values: any) {
|
|
||||||
return values.meterType === 2;
|
|
||||||
},
|
|
||||||
triggerFields: ['meterType'],
|
|
||||||
},
|
|
||||||
fieldName: 'haveValve',
|
|
||||||
label: $t('abp.meters.haveValve'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'timesA',
|
|
||||||
label: $t('abp.meters.timesA'),
|
|
||||||
componentProps: {
|
|
||||||
allowClear: true,
|
|
||||||
placeholder: `${$t('common.pleaseInput')}${$t('abp.meters.timesA')}`,
|
|
||||||
},
|
|
||||||
dependencies: {
|
|
||||||
show(values: any) {
|
|
||||||
return values.meterType === 1;
|
|
||||||
},
|
|
||||||
triggerFields: ['meterType'],
|
|
||||||
},
|
|
||||||
rules: z
|
|
||||||
.string({
|
|
||||||
message: `${$t('common.pleaseInput')}${$t('abp.meters.timesA')}`,
|
|
||||||
})
|
|
||||||
.default('1'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'timev',
|
|
||||||
label: $t('abp.meters.timev'),
|
|
||||||
componentProps: {
|
|
||||||
allowClear: true,
|
|
||||||
placeholder: `${$t('common.pleaseInput')}${$t('abp.meters.timev')}`,
|
|
||||||
},
|
|
||||||
dependencies: {
|
|
||||||
show(values: any) {
|
|
||||||
return values.meterType === 1;
|
|
||||||
},
|
|
||||||
triggerFields: ['meterType'],
|
|
||||||
},
|
|
||||||
rules: z
|
|
||||||
.string({
|
|
||||||
message: `${$t('common.pleaseInput')}${$t('abp.meters.timesA')}`,
|
|
||||||
})
|
|
||||||
.default('1'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'meteringCode',
|
|
||||||
label: $t('abp.meters.meteringCode'),
|
|
||||||
componentProps: {
|
|
||||||
allowClear: true,
|
|
||||||
placeholder: `${$t('common.pleaseInput')}${$t('abp.meters.meteringCode')}`,
|
|
||||||
},
|
|
||||||
rules: z
|
|
||||||
.string({
|
|
||||||
message: `${$t('common.pleaseInput')}${$t('abp.meters.meteringCode')}`,
|
|
||||||
})
|
|
||||||
.default('1'),
|
|
||||||
},
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export const editUserFormSchemaEdit: any = computed(() => [
|
export const editAccountFormSchemaEdit: any = computed(() => [
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'meterName',
|
fieldName: 'meterName',
|
||||||
@ -302,141 +112,4 @@ export const editUserFormSchemaEdit: any = computed(() => [
|
|||||||
message: $t('abp.meters.checkmeterAddress'),
|
message: $t('abp.meters.checkmeterAddress'),
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
component: 'Select',
|
|
||||||
componentProps: {
|
|
||||||
allowClear: true,
|
|
||||||
options: meterTypeOptions,
|
|
||||||
placeholder: `${$t('common.pleaseSelect')}${$t('abp.meters.meterType')}`,
|
|
||||||
},
|
|
||||||
fieldName: 'meterType',
|
|
||||||
label: $t('abp.meters.meterType'),
|
|
||||||
rules: z
|
|
||||||
.number()
|
|
||||||
.min(1, {
|
|
||||||
message: `${$t('common.pleaseSelect')}${$t('abp.meters.meterType')}`,
|
|
||||||
})
|
|
||||||
.default(1),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Select',
|
|
||||||
componentProps: {
|
|
||||||
allowClear: true,
|
|
||||||
options: rateOptions,
|
|
||||||
placeholder: `${$t('common.pleaseSelect')}${$t('abp.meters.singleRate')}`,
|
|
||||||
},
|
|
||||||
dependencies: {
|
|
||||||
show(values: any) {
|
|
||||||
return values.meterType === 1;
|
|
||||||
},
|
|
||||||
rules(values: any) {
|
|
||||||
if (values.meterType === 1) {
|
|
||||||
return 'required';
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
triggerFields: ['meterType'],
|
|
||||||
},
|
|
||||||
fieldName: 'singleRate',
|
|
||||||
label: $t('abp.meters.singleRate'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Switch',
|
|
||||||
componentProps: {
|
|
||||||
class: 'w-auto',
|
|
||||||
},
|
|
||||||
fieldName: 'selfDevelop',
|
|
||||||
label: $t('abp.meters.selfDevelop'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'brandType',
|
|
||||||
label: $t('abp.meters.brandType'),
|
|
||||||
rules: z.string().optional(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Switch',
|
|
||||||
componentProps: {
|
|
||||||
class: 'w-auto',
|
|
||||||
},
|
|
||||||
fieldName: 'dynamicPassword',
|
|
||||||
label: $t('abp.meters.dynamicPassword'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'password',
|
|
||||||
label: $t('abp.meters.password'),
|
|
||||||
rules: z.string().optional(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Switch',
|
|
||||||
componentProps: {
|
|
||||||
class: 'w-auto',
|
|
||||||
},
|
|
||||||
dependencies: {
|
|
||||||
show(values: any) {
|
|
||||||
return values.meterType === 2;
|
|
||||||
},
|
|
||||||
triggerFields: ['meterType'],
|
|
||||||
},
|
|
||||||
fieldName: 'haveValve',
|
|
||||||
label: $t('abp.meters.haveValve'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'timesA',
|
|
||||||
label: $t('abp.meters.timesA'),
|
|
||||||
componentProps: {
|
|
||||||
allowClear: true,
|
|
||||||
placeholder: `${$t('common.pleaseInput')}${$t('abp.meters.timesA')}`,
|
|
||||||
},
|
|
||||||
dependencies: {
|
|
||||||
show(values: any) {
|
|
||||||
return values.meterType === 1;
|
|
||||||
},
|
|
||||||
triggerFields: ['meterType'],
|
|
||||||
},
|
|
||||||
rules: z
|
|
||||||
.string({
|
|
||||||
message: `${$t('common.pleaseInput')}${$t('abp.meters.timesA')}`,
|
|
||||||
})
|
|
||||||
.default('1'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'timev',
|
|
||||||
label: $t('abp.meters.timev'),
|
|
||||||
componentProps: {
|
|
||||||
allowClear: true,
|
|
||||||
placeholder: `${$t('common.pleaseInput')}${$t('abp.meters.timev')}`,
|
|
||||||
},
|
|
||||||
dependencies: {
|
|
||||||
show(values: any) {
|
|
||||||
return values.meterType === 1;
|
|
||||||
},
|
|
||||||
triggerFields: ['meterType'],
|
|
||||||
},
|
|
||||||
rules: z
|
|
||||||
.string({
|
|
||||||
message: `${$t('common.pleaseInput')}${$t('abp.meters.timev')}`,
|
|
||||||
})
|
|
||||||
.default('1'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'meteringCode',
|
|
||||||
label: $t('abp.meters.meteringCode'),
|
|
||||||
componentProps: {
|
|
||||||
allowClear: true,
|
|
||||||
placeholder: `${$t('common.pleaseInput')}${$t('abp.meters.meteringCode')}`,
|
|
||||||
},
|
|
||||||
rules: z
|
|
||||||
.string({
|
|
||||||
message: `${$t('common.pleaseInput')}${$t('abp.meters.meteringCode')}`,
|
|
||||||
})
|
|
||||||
.min(1, {
|
|
||||||
message: `${$t('common.MustGreaterTthan0')}`,
|
|
||||||
})
|
|
||||||
.default('1'),
|
|
||||||
},
|
|
||||||
]);
|
]);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user