From 37324d04e60837dc6583e5b2268b61a37e456574 Mon Sep 17 00:00:00 2001 From: fyy <2717885210@qq.com> Date: Wed, 16 Jul 2025 16:44:54 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=E5=AE=8C=E6=88=90=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/property/machineType/index.ts | 68 ++++++ .../src/api/property/machineType/model.d.ts | 130 +++++++++++ .../api/property/maintainTaskDetail/index.ts | 61 ++++++ .../property/maintainTaskDetail/model.d.ts | 114 ++++++++++ .../components/machine-type-tree.vue | 119 ++++++++++ .../equipmentManagement/machineType/data.ts | 125 +++++++++++ .../equipmentManagement/machineType/index.vue | 205 ++++++++++++++++++ .../machineType/machineType-modal.vue | 136 ++++++++++++ .../maintainTaskDetail/data.ts | 120 ++++++++++ .../maintainTaskDetail/index.vue | 182 ++++++++++++++++ .../maintainTaskDetail-modal.vue | 101 +++++++++ 11 files changed, 1361 insertions(+) create mode 100644 apps/web-antd/src/api/property/machineType/index.ts create mode 100644 apps/web-antd/src/api/property/machineType/model.d.ts create mode 100644 apps/web-antd/src/api/property/maintainTaskDetail/index.ts create mode 100644 apps/web-antd/src/api/property/maintainTaskDetail/model.d.ts create mode 100644 apps/web-antd/src/views/property/equipmentManagement/components/machine-type-tree.vue create mode 100644 apps/web-antd/src/views/property/equipmentManagement/machineType/data.ts create mode 100644 apps/web-antd/src/views/property/equipmentManagement/machineType/index.vue create mode 100644 apps/web-antd/src/views/property/equipmentManagement/machineType/machineType-modal.vue create mode 100644 apps/web-antd/src/views/property/equipmentManagement/maintainTaskDetail/data.ts create mode 100644 apps/web-antd/src/views/property/equipmentManagement/maintainTaskDetail/index.vue create mode 100644 apps/web-antd/src/views/property/equipmentManagement/maintainTaskDetail/maintainTaskDetail-modal.vue diff --git a/apps/web-antd/src/api/property/machineType/index.ts b/apps/web-antd/src/api/property/machineType/index.ts new file mode 100644 index 00000000..656bb1a3 --- /dev/null +++ b/apps/web-antd/src/api/property/machineType/index.ts @@ -0,0 +1,68 @@ +import type { MachineTypeVO, MachineTypeForm, MachineTypeQuery,MachineTypeTree } 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 machineTypeList(params?: MachineTypeQuery) { + return requestClient.get>('/property/machineType/list', { params }); +} +/** +* 查询设备类型树 +* @param params +* @returns 设备类型树 +*/ +export function getMachineTypeTree() { + return requestClient.get('/property/machineType/typeTree'); +} +/** + * 导出设备类型列表 + * @param params + * @returns 设备类型列表 + */ +export function machineTypeExport(params?: MachineTypeQuery) { + return commonExport('/property/machineType/export', params ?? {}); +} + +/** + * 查询设备类型详情 + * @param id id + * @returns 设备类型详情 + */ +export function machineTypeInfo(id: ID) { + return requestClient.get(`/property/machineType/${id}`); +} + +/** + * 新增设备类型 + * @param data + * @returns void + */ +export function machineTypeAdd(data: MachineTypeForm) { + return requestClient.postWithMsg('/property/machineType', data); +} + +/** + * 更新设备类型 + * @param data + * @returns void + */ +export function machineTypeUpdate(data: MachineTypeForm) { + return requestClient.putWithMsg('/property/machineType', data); +} + +/** + * 删除设备类型 + * @param id id + * @returns void + */ +export function machineTypeRemove(id: ID | IDS) { + return requestClient.deleteWithMsg(`/property/machineType/${id}`); +} diff --git a/apps/web-antd/src/api/property/machineType/model.d.ts b/apps/web-antd/src/api/property/machineType/model.d.ts new file mode 100644 index 00000000..c4bea699 --- /dev/null +++ b/apps/web-antd/src/api/property/machineType/model.d.ts @@ -0,0 +1,130 @@ +import type { PageQuery, BaseEntity } from '#/api/common'; + +export interface MachineTypeVO { + /** + * 主键 + */ + id: string | number; + + /** + * 类型名称 + */ + machineTypeName: string; + + /** + * 类型编号 + */ + machineTypeCode: string; + + /** + * 上级类型 + */ + parentTypeId: string | number; + + /** + * 是否启用 + */ + isEnable: string; + + /** + * 备注 + */ + remark: string; + + /** + * 搜索值 + */ + searchValue: string; + +} + +export interface MachineTypeForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 类型名称 + */ + machineTypeName?: string; + + /** + * 类型编号 + */ + machineTypeCode?: string; + + /** + * 上级类型 + */ + parentTypeId?: string | number; + + /** + * 是否启用 + */ + isEnable?: string; + + /** + * 备注 + */ + remark?: string; + + /** + * 搜索值 + */ + searchValue?: string; + +} + +export interface MachineTypeQuery extends PageQuery { + /** + * 类型名称 + */ + machineTypeName?: string; + + /** + * 类型编号 + */ + machineTypeCode?: string; + + /** + * 上级类型 + */ + parentTypeId?: string | number; + + /** + * 是否启用 + */ + isEnable?: string; + + /** + * 搜索值 + */ + searchValue?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + +/** + * @description: 设备类型树 + */ +export interface MachineTypeTree { + id: number; + /** + * antd组件必须要这个属性 实际是没有这个属性的 + */ + key: string; + parentId: number; + label: string; + weight: number; + children?: MachineTypeTree[]; +} + +export interface MachineTypeTreeData { + id: number; + label: string; + children?: MachineTypeTreeData[]; +} diff --git a/apps/web-antd/src/api/property/maintainTaskDetail/index.ts b/apps/web-antd/src/api/property/maintainTaskDetail/index.ts new file mode 100644 index 00000000..e1611388 --- /dev/null +++ b/apps/web-antd/src/api/property/maintainTaskDetail/index.ts @@ -0,0 +1,61 @@ +import type { MaintainTaskDetailVO, MaintainTaskDetailForm, MaintainTaskDetailQuery } 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 maintainTaskDetailList(params?: MaintainTaskDetailQuery) { + return requestClient.get>('/property/maintainTaskDetail/list', { params }); +} + +/** + * 导出保养明细列表 + * @param params + * @returns 保养明细列表 + */ +export function maintainTaskDetailExport(params?: MaintainTaskDetailQuery) { + return commonExport('/property/maintainTaskDetail/export', params ?? {}); +} + +/** + * 查询保养明细详情 + * @param id id + * @returns 保养明细详情 + */ +export function maintainTaskDetailInfo(id: ID) { + return requestClient.get(`/property/maintainTaskDetail/${id}`); +} + +/** + * 新增保养明细 + * @param data + * @returns void + */ +export function maintainTaskDetailAdd(data: MaintainTaskDetailForm) { + return requestClient.postWithMsg('/property/maintainTaskDetail', data); +} + +/** + * 更新保养明细 + * @param data + * @returns void + */ +export function maintainTaskDetailUpdate(data: MaintainTaskDetailForm) { + return requestClient.putWithMsg('/property/maintainTaskDetail', data); +} + +/** + * 删除保养明细 + * @param id id + * @returns void + */ +export function maintainTaskDetailRemove(id: ID | IDS) { + return requestClient.deleteWithMsg(`/property/maintainTaskDetail/${id}`); +} diff --git a/apps/web-antd/src/api/property/maintainTaskDetail/model.d.ts b/apps/web-antd/src/api/property/maintainTaskDetail/model.d.ts new file mode 100644 index 00000000..4354c3a7 --- /dev/null +++ b/apps/web-antd/src/api/property/maintainTaskDetail/model.d.ts @@ -0,0 +1,114 @@ +import type { PageQuery, BaseEntity } from '#/api/common'; + +export interface MaintainTaskDetailVO { + /** + * 主键 + */ + id: string | number; + + /** + * 任务id + */ + taskId: string | number; + + /** + * 位置编号 + */ + machineId: string | number; + + /** + * 保养情况 + */ + sendFlag: string; + + /** + * 排序 + */ + sortNumber: number; + + /** + * 状态(0未开始,1已完成) + */ + state: string; + + /** + * 搜索值 + */ + searchValue: string; + +} + +export interface MaintainTaskDetailForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 任务id + */ + taskId?: string | number; + + /** + * 位置编号 + */ + machineId?: string | number; + + /** + * 保养情况 + */ + sendFlag?: string; + + /** + * 排序 + */ + sortNumber?: number; + + /** + * 状态(0未开始,1已完成) + */ + state?: string; + + /** + * 搜索值 + */ + searchValue?: string; + +} + +export interface MaintainTaskDetailQuery extends PageQuery { + /** + * 任务id + */ + taskId?: string | number; + + /** + * 位置编号 + */ + machineId?: string | number; + + /** + * 保养情况 + */ + sendFlag?: string; + + /** + * 排序 + */ + sortNumber?: number; + + /** + * 状态(0未开始,1已完成) + */ + state?: string; + + /** + * 搜索值 + */ + searchValue?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/apps/web-antd/src/views/property/equipmentManagement/components/machine-type-tree.vue b/apps/web-antd/src/views/property/equipmentManagement/components/machine-type-tree.vue new file mode 100644 index 00000000..6a383851 --- /dev/null +++ b/apps/web-antd/src/views/property/equipmentManagement/components/machine-type-tree.vue @@ -0,0 +1,119 @@ + + + diff --git a/apps/web-antd/src/views/property/equipmentManagement/machineType/data.ts b/apps/web-antd/src/views/property/equipmentManagement/machineType/data.ts new file mode 100644 index 00000000..f0cdb36a --- /dev/null +++ b/apps/web-antd/src/views/property/equipmentManagement/machineType/data.ts @@ -0,0 +1,125 @@ +import type { FormSchemaGetter } from '#/adapter/form'; +import type { VxeGridProps } from '#/adapter/vxe-table'; + +import { getDictOptions } from '#/utils/dict'; +import { renderDict } from '#/utils/render'; + +export const querySchema: FormSchemaGetter = () => [ + { + component: 'Input', + fieldName: 'machineTypeName', + label: '类型名称', + labelWidth: 100, + }, + { + component: 'Input', + fieldName: 'machineTypeCode', + label: '类型编号', + labelWidth: 100, + }, + { + component: 'Select', + componentProps: { + // 可选从DictEnum中获取 DictEnum.WY_KG 便于维护 + options: getDictOptions('wy_kg'), + }, + fieldName: 'isEnable', + label: '是否启用', + labelWidth: 100, + }, +]; + +// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 +// export const columns: () => VxeGridProps['columns'] = () => [ +export const columns: VxeGridProps['columns'] = [ + { type: 'checkbox', width: 60 }, + { + title: '序号', + field: 'id', + width: 60, + slots: { + default: ({ rowIndex }) => { + return (rowIndex + 1).toString(); + }, + }, + }, + { + title: '类型名称', + field: 'machineTypeName', + minWidth: 180, + }, + { + title: '类型编号', + field: 'machineTypeCode', + minWidth: 180, + }, + { + title: '是否启用', + field: 'isEnable', + slots: { + default: ({ row }) => { + // 可选从DictEnum中获取 DictEnum.WY_KG 便于维护 + return renderDict(row.isEnable, 'wy_kg'); + }, + }, + }, + { + title: '备注', + field: 'remark', + }, + { + 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: 'machineTypeName', + component: 'Input', + rules: 'required', + labelWidth: 100, + }, + { + label: '类型编号', + fieldName: 'machineTypeCode', + component: 'Input', + rules: 'required', + labelWidth: 100, + }, + { + label: '上级类型', + fieldName: 'parentTypeId', + component: 'TreeSelect', + defaultValue: undefined, + labelWidth: 100, + }, + { + label: '是否启用', + fieldName: 'isEnable', + component: 'Select', + componentProps: { + // 可选从DictEnum中获取 DictEnum.WY_KG 便于维护 + options: getDictOptions('wy_kg'), + }, + rules: 'selectRequired', + }, + { + label: '备注', + fieldName: 'remark', + component: 'Input', + }, +]; diff --git a/apps/web-antd/src/views/property/equipmentManagement/machineType/index.vue b/apps/web-antd/src/views/property/equipmentManagement/machineType/index.vue new file mode 100644 index 00000000..6164e9bd --- /dev/null +++ b/apps/web-antd/src/views/property/equipmentManagement/machineType/index.vue @@ -0,0 +1,205 @@ + + + diff --git a/apps/web-antd/src/views/property/equipmentManagement/machineType/machineType-modal.vue b/apps/web-antd/src/views/property/equipmentManagement/machineType/machineType-modal.vue new file mode 100644 index 00000000..e7043536 --- /dev/null +++ b/apps/web-antd/src/views/property/equipmentManagement/machineType/machineType-modal.vue @@ -0,0 +1,136 @@ + + + + diff --git a/apps/web-antd/src/views/property/equipmentManagement/maintainTaskDetail/data.ts b/apps/web-antd/src/views/property/equipmentManagement/maintainTaskDetail/data.ts new file mode 100644 index 00000000..fe63f9bb --- /dev/null +++ b/apps/web-antd/src/views/property/equipmentManagement/maintainTaskDetail/data.ts @@ -0,0 +1,120 @@ +import type { FormSchemaGetter } from '#/adapter/form'; +import type { VxeGridProps } from '#/adapter/vxe-table'; + +import { getDictOptions } from '#/utils/dict'; +import { renderDict } from '#/utils/render'; + +export const querySchema: FormSchemaGetter = () => [ + { + component: 'Input', + fieldName: 'machineId', + label: '位置编号', + }, + { + component: 'Select', + componentProps: { + // 可选从DictEnum中获取 DictEnum.WY_BYMXZT 便于维护 + options: getDictOptions('wy_bymxzt'), + }, + fieldName: 'state', + label: '状态', + }, +]; + +// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 +// export const columns: () => VxeGridProps['columns'] = () => [ +export const columns: VxeGridProps['columns'] = [ + { type: 'checkbox', width: 60 }, + { + title: '设备名称', + field: 'machineId', + }, + { + title: '设备编号', + field: 'machineId', + }, + { + title: '位置编号', + field: 'machineId', + }, + { + title: '计划名称', + field: 'machineId', + }, + { + title: '计划保养人', + field: 'machineId', + }, + { + title: '计划保养时间', + field: 'machineId', + }, + { + title: '实际保养时间', + field: 'machineId', + }, + + { + title: '保养情况', + field: 'sendFlag', + }, + { + title: '状态', + field: 'state', + slots: { + default: ({ row }) => { + // 可选从DictEnum中获取 DictEnum.WY_BYMXZT 便于维护 + return renderDict(row.state, 'wy_bymxzt'); + }, + }, + }, + // { + // 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: 'machineId', + component: 'Input', + rules: 'required', + }, + { + label: '保养情况', + fieldName: 'sendFlag', + component: 'Input', + }, + { + label: '排序', + fieldName: 'sortNumber', + component: 'Input', + }, + { + label: '状态(0未开始,1已完成)', + fieldName: 'state', + component: 'Select', + componentProps: { + // 可选从DictEnum中获取 DictEnum.WY_BYMXZT 便于维护 + options: getDictOptions('wy_bymxzt'), + }, + }, + { + label: '搜索值', + fieldName: 'searchValue', + component: 'Input', + }, +]; diff --git a/apps/web-antd/src/views/property/equipmentManagement/maintainTaskDetail/index.vue b/apps/web-antd/src/views/property/equipmentManagement/maintainTaskDetail/index.vue new file mode 100644 index 00000000..f165a022 --- /dev/null +++ b/apps/web-antd/src/views/property/equipmentManagement/maintainTaskDetail/index.vue @@ -0,0 +1,182 @@ + + + diff --git a/apps/web-antd/src/views/property/equipmentManagement/maintainTaskDetail/maintainTaskDetail-modal.vue b/apps/web-antd/src/views/property/equipmentManagement/maintainTaskDetail/maintainTaskDetail-modal.vue new file mode 100644 index 00000000..9939de1d --- /dev/null +++ b/apps/web-antd/src/views/property/equipmentManagement/maintainTaskDetail/maintainTaskDetail-modal.vue @@ -0,0 +1,101 @@ + + + + From 72ddc3d5f386f244a134293463559a85b5a3eb0a Mon Sep 17 00:00:00 2001 From: FLL <2162874245@qq.com> Date: Wed, 16 Jul 2025 17:30:18 +0800 Subject: [PATCH 2/4] =?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/model.d.ts | 10 ++ .../deviceLocation/data.ts | 107 +++++++++--------- .../deviceLocation/deviceLocation-detail.vue | 52 +++++++++ .../deviceLocation/deviceLocation-modal.vue | 104 ++++++++++++++--- .../deviceLocation/index.vue | 58 ++++------ 5 files changed, 228 insertions(+), 103 deletions(-) create mode 100644 apps/web-antd/src/views/property/equipmentManagement/deviceLocation/deviceLocation-detail.vue 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 index 384a696c..ed267001 100644 --- a/apps/web-antd/src/api/property/equipmentManagement/deviceLocation/model.d.ts +++ b/apps/web-antd/src/api/property/equipmentManagement/deviceLocation/model.d.ts @@ -26,6 +26,16 @@ export interface DeviceLocationVO { */ searchValue: string; + /** + * 位置类型 + */ + locationObjName: string; + + /** + * 搜索值 + */ + remark: string; + } export interface DeviceLocationForm extends BaseEntity { diff --git a/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/data.ts b/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/data.ts index 69886942..a4f6b9f9 100644 --- a/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/data.ts +++ b/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/data.ts @@ -1,5 +1,7 @@ import type { FormSchemaGetter } from '#/adapter/form'; import type { VxeGridProps } from '#/adapter/vxe-table'; +import {getDictOptions} from "#/utils/dict"; +import {renderDict} from "#/utils/render"; export const querySchema: FormSchemaGetter = () => [ @@ -8,23 +10,14 @@ export const querySchema: FormSchemaGetter = () => [ fieldName: 'locationName', label: '位置名称', }, - { - component: 'Input', - fieldName: 'locationCode', - label: '位置编号', - }, { component: 'Select', componentProps: { + options: getDictOptions('pro_location_type'), }, fieldName: 'locationType', label: '位置类型', }, - { - component: 'Input', - fieldName: 'searchValue', - label: '搜索值', - }, ]; // 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 @@ -32,24 +25,30 @@ export const querySchema: FormSchemaGetter = () => [ export const columns: VxeGridProps['columns'] = [ { type: 'checkbox', width: 60 }, { - title: '主键', - field: 'id', + title: '位置编码', + field: 'locationCode', }, { title: '位置名称', field: 'locationName', }, - { - title: '位置编号', - field: 'locationCode', - }, + { title: '位置类型', field: 'locationType', + slots: { + default: ({ row }) => { + return renderDict(row.locationType, 'pro_location_type'); + }, + }, }, { - title: '搜索值', - field: 'searchValue', + title: '位置对象', + field: 'locationObject', + }, + { + title: '备注', + field: 'remark', }, { field: 'action', @@ -60,37 +59,41 @@ export const columns: VxeGridProps['columns'] = [ }, ]; -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', - }, -]; +// export const modalSchema: FormSchemaGetter = () => [ +// { +// label: '主键', +// fieldName: 'id', +// component: 'Input', +// dependencies: { +// show: () => false, +// triggerFields: [''], +// }, +// }, +// { +// label: '位置名称', +// fieldName: 'locationName', +// component: 'Input', +// rules: 'required', +// }, +// { +// label: '位置类型', +// fieldName: 'locationType', +// component: 'Select', +// componentProps: { +// options: getDictOptions('pro_location_type'), +// }, +// rules: 'selectRequired', +// }, +// { +// component: 'TreeSelect', +// fieldName: 'locationObject', +// defaultValue: undefined, +// label: '位置对象', +// rules: 'selectRequired', +// }, +// { +// label: '备注', +// fieldName: 'remark', +// component: 'Textarea', +// }, +// ]; diff --git a/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/deviceLocation-detail.vue b/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/deviceLocation-detail.vue new file mode 100644 index 00000000..bd463857 --- /dev/null +++ b/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/deviceLocation-detail.vue @@ -0,0 +1,52 @@ + + + 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 index ccdbc0c3..5d8a8542 100644 --- a/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/deviceLocation-modal.vue +++ b/apps/web-antd/src/views/property/equipmentManagement/deviceLocation/deviceLocation-modal.vue @@ -1,23 +1,71 @@