diff --git a/src/api/eam/basicEamWorkshop/index.ts b/src/api/eam/basicEamWorkshop/index.ts new file mode 100644 index 000000000..330e0a251 --- /dev/null +++ b/src/api/eam/basicEamWorkshop/index.ts @@ -0,0 +1,59 @@ +import request from '@/config/axios' + +export interface BasicEamWorkshopVO { + id: number + code: string + name: string + description: string + type: string + available: string + activeTime: Date + expireTime: Date + remark: string + deletionTime: Date + deleterId: string + extraProperties: string + concurrencyStamp: number + siteId: string +} + +// 查询EAM车间列表 +export const getBasicEamWorkshopPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/basic-eam-workshop/senior', data }) + } else { + return await request.get({ url: `/eam/basic-eam-workshop/page`, params }) + } +} + +// 查询EAM车间详情 +export const getBasicEamWorkshop = async (id: number) => { + return await request.get({ url: `/eam/basic-eam-workshop/get?id=` + id }) +} + +// 新增EAM车间 +export const createBasicEamWorkshop = async (data: BasicEamWorkshopVO) => { + return await request.post({ url: `/eam/basic-eam-workshop/create`, data }) +} + +// 修改EAM车间 +export const updateBasicEamWorkshop = async (data: BasicEamWorkshopVO) => { + return await request.put({ url: `/eam/basic-eam-workshop/update`, data }) +} + +// 删除EAM车间 +export const deleteBasicEamWorkshop = async (id: number) => { + return await request.delete({ url: `/eam/basic-eam-workshop/delete?id=` + id }) +} + +// 导出EAM车间 Excel +export const exportBasicEamWorkshop = async (params) => { + return await request.download({ url: `/eam/basic-eam-workshop/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/basic-eam-workshop/get-import-template' }) +} \ No newline at end of file diff --git a/src/views/eam/basicEamWorkshop/basicEamWorkshop.data.ts b/src/views/eam/basicEamWorkshop/basicEamWorkshop.data.ts new file mode 100644 index 000000000..49809cffb --- /dev/null +++ b/src/views/eam/basicEamWorkshop/basicEamWorkshop.data.ts @@ -0,0 +1,199 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const BasicEamWorkshopRules = reactive({ + code: [required], + available: [required], + concurrencyStamp: [required], +}) + +export const BasicEamWorkshop = useCrudSchemas(reactive([ + { + label: 'id', + field: 'id', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '车间编号', + field: 'code', + sort: 'custom', + isSearch: true, + }, + { + label: '车间名称', + field: 'name', + sort: 'custom', + isSearch: true, + }, + { + label: '描述', + field: 'description', + sort: 'custom', + isSearch: false, + }, + { + label: '车间类型', + field: 'type', + sort: 'custom', + isSearch: true, + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + isSearch: true, + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + }, + { + label: '生效时间', + field: 'activeTime', + 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: '失效时间', + field: 'expireTime', + 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: '备注', + field: 'remark', + sort: 'custom', + isSearch: false, + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: 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')] + } + }, + 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: 'extraProperties', + 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: '地点ID', + field: 'siteId', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/eam/basicEamWorkshop/index.vue b/src/views/eam/basicEamWorkshop/index.vue new file mode 100644 index 000000000..95ce7e199 --- /dev/null +++ b/src/views/eam/basicEamWorkshop/index.vue @@ -0,0 +1,244 @@ + + +