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 @@ + + + + + + + + + + + + + + + {{ row.name }} + + + + + + + + + + + + + + + + + + + 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 @@ + + + + + + + + + + + + + + + + + + + + + + {{ ent.content}} + + + + 添加巡检项 + + + + + + + + + 确 定 + 取 消 + + + + + + + + + +