From 8052d3d63d067ef62084f282390cdd1886bacbde Mon Sep 17 00:00:00 2001 From: FLL <2162874245@qq.com> Date: Tue, 15 Jul 2025 17:31:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../deviceLocation/index.ts | 61 ++++++ .../deviceLocation/model.d.ts | 84 ++++++++ .../deviceLocation/data.ts | 96 +++++++++ .../deviceLocation/deviceLocation-modal.vue | 101 ++++++++++ .../deviceLocation/index.vue | 182 ++++++++++++++++++ 5 files changed, 524 insertions(+) create mode 100644 apps/web-antd/src/api/property/equipmentManagement/deviceLocation/index.ts create mode 100644 apps/web-antd/src/api/property/equipmentManagement/deviceLocation/model.d.ts create mode 100644 apps/web-antd/src/views/property/equipmentManagement/deviceLocation/data.ts create mode 100644 apps/web-antd/src/views/property/equipmentManagement/deviceLocation/deviceLocation-modal.vue create mode 100644 apps/web-antd/src/views/property/equipmentManagement/deviceLocation/index.vue diff --git a/apps/web-antd/src/api/property/equipmentManagement/deviceLocation/index.ts b/apps/web-antd/src/api/property/equipmentManagement/deviceLocation/index.ts new file mode 100644 index 00000000..e9096c27 --- /dev/null +++ b/apps/web-antd/src/api/property/equipmentManagement/deviceLocation/index.ts @@ -0,0 +1,61 @@ +import type { DeviceLocationVO, DeviceLocationForm, DeviceLocationQuery } from './model'; + +import type { ID, IDS } from '#/api/common'; +import type { PageResult } from '#/api/common'; + +import { commonExport } from '#/api/helper'; +import { requestClient } from '#/api/request'; + +/** +* 查询设备位置列表 +* @param params +* @returns 设备位置列表 +*/ +export function deviceLocationList(params?: DeviceLocationQuery) { + return requestClient.get>('/property/deviceLocation/list', { params }); +} + +/** + * 导出设备位置列表 + * @param params + * @returns 设备位置列表 + */ +export function deviceLocationExport(params?: DeviceLocationQuery) { + return commonExport('/property/deviceLocation/export', params ?? {}); +} + +/** + * 查询设备位置详情 + * @param id id + * @returns 设备位置详情 + */ +export function deviceLocationInfo(id: ID) { + return requestClient.get(`/property/deviceLocation/${id}`); +} + +/** + * 新增设备位置 + * @param data + * @returns void + */ +export function deviceLocationAdd(data: DeviceLocationForm) { + return requestClient.postWithMsg('/property/deviceLocation', data); +} + +/** + * 更新设备位置 + * @param data + * @returns void + */ +export function deviceLocationUpdate(data: DeviceLocationForm) { + return requestClient.putWithMsg('/property/deviceLocation', data); +} + +/** + * 删除设备位置 + * @param id id + * @returns void + */ +export function deviceLocationRemove(id: ID | IDS) { + return requestClient.deleteWithMsg(`/property/deviceLocation/${id}`); +} diff --git a/apps/web-antd/src/api/property/equipmentManagement/deviceLocation/model.d.ts b/apps/web-antd/src/api/property/equipmentManagement/deviceLocation/model.d.ts new file mode 100644 index 00000000..384a696c --- /dev/null +++ b/apps/web-antd/src/api/property/equipmentManagement/deviceLocation/model.d.ts @@ -0,0 +1,84 @@ +import type { PageQuery, BaseEntity } from '#/api/common'; + +export interface DeviceLocationVO { + /** + * 主键 + */ + id: string | number; + + /** + * 位置名称 + */ + locationName: string; + + /** + * 位置编号 + */ + locationCode: string; + + /** + * 位置类型 + */ + locationType: string; + + /** + * 搜索值 + */ + searchValue: string; + +} + +export interface DeviceLocationForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 位置名称 + */ + locationName?: string; + + /** + * 位置编号 + */ + locationCode?: string; + + /** + * 位置类型 + */ + locationType?: string; + + /** + * 搜索值 + */ + searchValue?: string; + +} + +export interface DeviceLocationQuery extends PageQuery { + /** + * 位置名称 + */ + locationName?: string; + + /** + * 位置编号 + */ + locationCode?: string; + + /** + * 位置类型 + */ + locationType?: string; + + /** + * 搜索值 + */ + searchValue?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/data.ts b/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/data.ts new file mode 100644 index 00000000..69886942 --- /dev/null +++ b/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/data.ts @@ -0,0 +1,96 @@ +import type { FormSchemaGetter } from '#/adapter/form'; +import type { VxeGridProps } from '#/adapter/vxe-table'; + + +export const querySchema: FormSchemaGetter = () => [ + { + component: 'Input', + fieldName: 'locationName', + label: '位置名称', + }, + { + component: 'Input', + fieldName: 'locationCode', + label: '位置编号', + }, + { + component: 'Select', + componentProps: { + }, + fieldName: 'locationType', + label: '位置类型', + }, + { + component: 'Input', + fieldName: 'searchValue', + label: '搜索值', + }, +]; + +// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 +// export const columns: () => VxeGridProps['columns'] = () => [ +export const columns: VxeGridProps['columns'] = [ + { type: 'checkbox', width: 60 }, + { + title: '主键', + field: 'id', + }, + { + title: '位置名称', + field: 'locationName', + }, + { + title: '位置编号', + field: 'locationCode', + }, + { + title: '位置类型', + field: 'locationType', + }, + { + title: '搜索值', + field: 'searchValue', + }, + { + field: 'action', + fixed: 'right', + slots: { default: 'action' }, + title: '操作', + width: 180, + }, +]; + +export const modalSchema: FormSchemaGetter = () => [ + { + label: '主键', + fieldName: 'id', + component: 'Input', + dependencies: { + show: () => false, + triggerFields: [''], + }, + }, + { + label: '位置名称', + fieldName: 'locationName', + component: 'Input', + rules: 'required', + }, + { + label: '位置编号', + fieldName: 'locationCode', + component: 'Input', + }, + { + label: '位置类型', + fieldName: 'locationType', + component: 'Select', + componentProps: { + }, + }, + { + label: '搜索值', + fieldName: 'searchValue', + component: 'Input', + }, +]; diff --git a/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/deviceLocation-modal.vue b/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/deviceLocation-modal.vue new file mode 100644 index 00000000..ccdbc0c3 --- /dev/null +++ b/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/deviceLocation-modal.vue @@ -0,0 +1,101 @@ + + + + diff --git a/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/index.vue b/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/index.vue new file mode 100644 index 00000000..557d3582 --- /dev/null +++ b/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/index.vue @@ -0,0 +1,182 @@ + + +