From 033e6bcdf80a17d4dfbcae7cfe6280f99ce03e40 Mon Sep 17 00:00:00 2001 From: gaojs <757918719@qq.com> Date: Fri, 17 May 2024 14:01:41 +0800 Subject: [PATCH] =?UTF-8?q?EAM=20=E2=80=94=E2=80=94>=20=E5=B7=A1=E6=A3=80?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=9B=86=20=E4=B8=8E=20=E5=B7=A1=E6=A3=80?= =?UTF-8?q?=E9=A1=B9=20=E5=85=B3=E8=81=94=20=20=E5=89=8D=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/eam/inspectionItemSelectSet/index.ts | 61 ++++ .../eam/inspectionItemSelectSet/index.vue | 287 ++++++++++++++++++ .../inspectionItemSelectSet.data.ts | 141 +++++++++ .../itemSelectSetForm.vue | 283 +++++++++++++++++ 4 files changed, 772 insertions(+) create mode 100644 src/api/eam/inspectionItemSelectSet/index.ts create mode 100644 src/views/eam/inspectionItemSelectSet/index.vue create mode 100644 src/views/eam/inspectionItemSelectSet/inspectionItemSelectSet.data.ts create mode 100644 src/views/eam/inspectionItemSelectSet/itemSelectSetForm.vue diff --git a/src/api/eam/inspectionItemSelectSet/index.ts b/src/api/eam/inspectionItemSelectSet/index.ts new file mode 100644 index 000000000..af1f6e522 --- /dev/null +++ b/src/api/eam/inspectionItemSelectSet/index.ts @@ -0,0 +1,61 @@ +import request from '@/config/axios' +import {EquipmentMainPartVO} from "@/api/eam/equipmentMainPart"; + +export interface InspectionItemSelectSetVO { + id: number + name: string + itemCode: string + departmentCode: string + remark: string + siteId: string + available: string + deletionTime: Date + deleterId: byte[] + concurrencyStamp: number +} + +// 查询巡检项选择集列表 +export const getInspectionItemSelectSetPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/inspection-item-select-set/senior', data }) + } else { + return await request.get({ url: `/eam/inspection-item-select-set/page`, params }) + } +} + +// 查询巡检项选择集详情 +export const getInspectionItemSelectSet = async (id: number) => { + return await request.get({ url: `/eam/inspection-item-select-set/get?id=` + id }) +} + +// 新增巡检项选择集 +export const createInspectionItemSelectSet = async (data: InspectionItemSelectSetVO) => { + return await request.post({ url: `/eam/inspection-item-select-set/create`, data }) +} + +// 修改巡检项选择集 +export const updateInspectionItemSelectSet = async (data: InspectionItemSelectSetVO) => { + return await request.put({ url: `/eam/inspection-item-select-set/update`, data }) +} + +// 删除巡检项选择集 +export const deleteInspectionItemSelectSet = async (id: number) => { + return await request.delete({ url: `/eam/inspection-item-select-set/delete?id=` + id }) +} + +// 导出巡检项选择集 Excel +export const exportInspectionItemSelectSet = async (params) => { + return await request.download({ url: `/eam/inspection-item-select-set/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/inspection-item-select-set/get-import-template' }) +} + +// 启用 / 禁用 +export const updateEnableCode = async (data: EquipmentMainPartVO) => { + return await request.post({ url: `/eam/inspection-item-select-set/ables` , data }) +} diff --git a/src/views/eam/inspectionItemSelectSet/index.vue b/src/views/eam/inspectionItemSelectSet/index.vue new file mode 100644 index 000000000..7b35c7a3f --- /dev/null +++ b/src/views/eam/inspectionItemSelectSet/index.vue @@ -0,0 +1,287 @@ + + + diff --git a/src/views/eam/inspectionItemSelectSet/inspectionItemSelectSet.data.ts b/src/views/eam/inspectionItemSelectSet/inspectionItemSelectSet.data.ts new file mode 100644 index 000000000..67508f157 --- /dev/null +++ b/src/views/eam/inspectionItemSelectSet/inspectionItemSelectSet.data.ts @@ -0,0 +1,141 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const InspectionItemSelectSetRules = reactive({ + name: [required], + itemCode: [required], + concurrencyStamp: [required], +}) + +export const InspectionItemSelectSet = useCrudSchemas(reactive([ + { + label: 'id', + field: 'id', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '选择集名称', + field: 'name', + sort: 'custom', + isSearch: true, + }, + { + label: '项编号', + field: 'itemCode', + sort: 'custom', + isSearch: true, + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + isForm: false, + }, + { + label: '部门id', + field: 'departmentCode', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: true, + }, + { + label: '地点ID', + field: 'siteId', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + isTable: true, + isDetail: false, + isSearch: true, + isTableForm: false, + isForm: false, + }, + { + label: '删除时间', + field: 'deletionTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + }, + { + label: '删除人id', + field: 'deleterId', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '并发乐观锁', + field: 'concurrencyStamp', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/eam/inspectionItemSelectSet/itemSelectSetForm.vue b/src/views/eam/inspectionItemSelectSet/itemSelectSetForm.vue new file mode 100644 index 000000000..f7aa42b20 --- /dev/null +++ b/src/views/eam/inspectionItemSelectSet/itemSelectSetForm.vue @@ -0,0 +1,283 @@ + + + +