From fd9945914f1156f77341948647a6fbffb71d2962 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Sat, 25 May 2024 08:46:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=8F=B0=E8=B4=A6=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=B7=AE=E8=AE=B0=E5=BD=95=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/eam/attachmentFileUpload/index.ts | 20 + src/api/eam/equipmentMainPart/index.ts | 5 + src/api/eam/equipmentToolSparePart/index.ts | 68 + src/api/eam/relationMainPart/index.ts | 6 + src/api/eam/sparePart/index.ts | 5 + .../eam/tableDataExtendedAttribute/index.ts | 65 + src/components/Annex/src/Annex.vue | 4 +- src/components/Annex/src/AnnexLedger.vue | 175 +++ src/components/AutoIncrementField/index.ts | 3 + .../src/AutoIncrementField.vue | 106 ++ src/components/Detail/src/DetailLedger.vue | 1095 +++++++++++++++++ .../SearchTable/src/SearchTable.vue | 7 +- src/components/Table/src/Table.vue | 8 +- src/components/UploadFile/src/UploadFile.vue | 2 +- src/utils/disposition/defaultButtons.ts | 4 +- src/views/eam/equipmentAccounts/index.vue | 145 ++- .../equipmentToolSparePart.data.ts | 135 ++ .../eam/equipmentToolSparePart/index.vue | 244 ++++ .../eam/tableDataExtendedAttribute/index.vue | 244 ++++ .../tableDataExtendedAttribute.data.ts | 106 ++ 20 files changed, 2395 insertions(+), 52 deletions(-) create mode 100644 src/api/eam/attachmentFileUpload/index.ts create mode 100644 src/api/eam/equipmentToolSparePart/index.ts create mode 100644 src/api/eam/tableDataExtendedAttribute/index.ts create mode 100644 src/components/Annex/src/AnnexLedger.vue create mode 100644 src/components/AutoIncrementField/index.ts create mode 100644 src/components/AutoIncrementField/src/AutoIncrementField.vue create mode 100644 src/components/Detail/src/DetailLedger.vue create mode 100644 src/views/eam/equipmentToolSparePart/equipmentToolSparePart.data.ts create mode 100644 src/views/eam/equipmentToolSparePart/index.vue create mode 100644 src/views/eam/tableDataExtendedAttribute/index.vue create mode 100644 src/views/eam/tableDataExtendedAttribute/tableDataExtendedAttribute.data.ts diff --git a/src/api/eam/attachmentFileUpload/index.ts b/src/api/eam/attachmentFileUpload/index.ts new file mode 100644 index 000000000..9008e96ab --- /dev/null +++ b/src/api/eam/attachmentFileUpload/index.ts @@ -0,0 +1,20 @@ +import request from '@/config/axios' +// 上传图片 +export const uploadFiles = async (data) => { + return await request.post({ url: `/eam/attachment-file/upload`, data }) +} + +// 查询图片 +export const getFiles = async (data) => { + return await request.post({ url: `/eam/attachment-file/listNoPage`, data }) +} + +// 新增图片 +export const addFile = async (data) => { + return await request.post({ url: `/eam/attachment-file/create`, data }) +} + +// 删除图片 +export const delFile = async (id: number) => { + return await request.delete({ url: `/eam/attachment-file/delete?uid=`, id }) +} \ No newline at end of file diff --git a/src/api/eam/equipmentMainPart/index.ts b/src/api/eam/equipmentMainPart/index.ts index b92db6d86..c50e500b9 100644 --- a/src/api/eam/equipmentMainPart/index.ts +++ b/src/api/eam/equipmentMainPart/index.ts @@ -64,4 +64,9 @@ export const importTemplate = () => { // 启用 / 禁用 export const updateEnableCode = async (data: EquipmentMainPartVO) => { return await request.post({ url: `/eam/equipment-main-part/ables` , data }) +} + +// 查询主要部件列表 +export const getEquipmentMainPartNoPage = async (params) => { + return await request.get({ url: `/eam/equipment-main-part/noPage`, params }) } \ No newline at end of file diff --git a/src/api/eam/equipmentToolSparePart/index.ts b/src/api/eam/equipmentToolSparePart/index.ts new file mode 100644 index 000000000..a1ae42042 --- /dev/null +++ b/src/api/eam/equipmentToolSparePart/index.ts @@ -0,0 +1,68 @@ +import request from '@/config/axios' + +export interface EquipmentToolSparePartVO { + id: number + sparePartCode: string + equipmentToolCode: string + type: string + usePosition: string + departmentCode: string + remark: string + siteId: string + available: string + deletionTime: Date + deleterId: byte[] + concurrencyStamp: number +} + +// 查询设备或工装与备件关联列表 +export const getEquipmentToolSparePartPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/relation/equipment-tool-spare-part/senior', data }) + } else { + return await request.get({ url: `/eam/relation/equipment-tool-spare-part/page`, params }) + } +} + +// 查询设备或工装与备件关联详情 +export const getEquipmentToolSparePart = async (id: number) => { + return await request.get({ url: `/eam/relation/equipment-tool-spare-part/get?id=` + id }) +} + +// 新增设备或工装与备件关联 +export const createEquipmentToolSparePart = async (data: EquipmentToolSparePartVO) => { + return await request.post({ url: `/eam/relation/equipment-tool-spare-part/create`, data }) +} + +// 修改设备或工装与备件关联 +export const updateEquipmentToolSparePart = async (data: EquipmentToolSparePartVO) => { + return await request.put({ url: `/eam/relation/equipment-tool-spare-part/update`, data }) +} + +// 删除设备或工装与备件关联 +export const deleteEquipmentToolSparePart = async (id: number) => { + return await request.delete({ url: `/eam/relation/equipment-tool-spare-part/delete?id=` + id }) +} + +// 导出设备或工装与备件关联 Excel +export const exportEquipmentToolSparePart = async (params) => { + return await request.download({ url: `/eam/relation/equipment-tool-spare-part/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/relation/equipment-tool-spare-part/get-import-template' }) +} + +// 新增设备或工装与备件关联 +export const createEquipmentToolSparePartBatch = async (data: Array) => { + return await request.post({ url: `/eam/relation/equipment-tool-spare-part/createBatch`, data }) +} + +// 查询设备或工装与备件关联列表 +export const getEquipmentToolSparePartNoPage = async (params) => { + return await request.get({ url: `/eam/relation/equipment-tool-spare-part/noPage`, params }) +} + diff --git a/src/api/eam/relationMainPart/index.ts b/src/api/eam/relationMainPart/index.ts index 773210bfb..41d9322f4 100644 --- a/src/api/eam/relationMainPart/index.ts +++ b/src/api/eam/relationMainPart/index.ts @@ -59,3 +59,9 @@ export const importTemplate = () => { export const getRelationMainPartNoPage = async (params) => { return await request.get({ url: `/eam/relation/relation-main-part/noPage`, params }) } + + +// 新增主要部件批量关联 +export const createRelationMainPartBatch = async (data: Array) => { + return await request.post({ url: `/eam/relation/relation-main-part/createBatch`, data }) +} diff --git a/src/api/eam/sparePart/index.ts b/src/api/eam/sparePart/index.ts index 8ae1f345a..58d103d49 100644 --- a/src/api/eam/sparePart/index.ts +++ b/src/api/eam/sparePart/index.ts @@ -72,4 +72,9 @@ export const exportSparePart = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/eam/sparepart/spare-part/get-import-template' }) +} + +// 查询备件基础列表 +export const getSparePartNoPage = async (params) => { + return await request.get({ url: `/eam/sparepart/spare-part/noPage`, params }) } \ No newline at end of file diff --git a/src/api/eam/tableDataExtendedAttribute/index.ts b/src/api/eam/tableDataExtendedAttribute/index.ts new file mode 100644 index 000000000..a1ca18d31 --- /dev/null +++ b/src/api/eam/tableDataExtendedAttribute/index.ts @@ -0,0 +1,65 @@ +import request from '@/config/axios' + +export interface TableDataExtendedAttributeVO { + id: number + tableName: string + dataId: string + fieldName: string + fieldVal: string + siteId: string + available: string + departmentCode: number + remark: string + concurrencyStamp: number +} + +// 查询表数据扩展属性字段列表 +export const getTableDataExtendedAttributePage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/table-data-extended-attribute/senior', data }) + } else { + return await request.get({ url: `/eam/table-data-extended-attribute/page`, params }) + } +} + +// 查询表数据扩展属性字段详情 +export const getTableDataExtendedAttribute = async (id: number) => { + return await request.get({ url: `/eam/table-data-extended-attribute/get?id=` + id }) +} + +// 新增表数据扩展属性字段 +export const createTableDataExtendedAttribute = async (data: TableDataExtendedAttributeVO) => { + return await request.post({ url: `/eam/table-data-extended-attribute/create`, data }) +} + +// 修改表数据扩展属性字段 +export const updateTableDataExtendedAttribute = async (data: TableDataExtendedAttributeVO) => { + return await request.put({ url: `/eam/table-data-extended-attribute/update`, data }) +} + +// 删除表数据扩展属性字段 +export const deleteTableDataExtendedAttribute = async (id: number) => { + return await request.delete({ url: `/eam/table-data-extended-attribute/delete?id=` + id }) +} + +// 导出表数据扩展属性字段 Excel +export const exportTableDataExtendedAttribute = async (params) => { + return await request.download({ url: `/eam/table-data-extended-attribute/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/table-data-extended-attribute/get-import-template' }) +} + +// 查询表数据扩展属性字段列表 +export const getTableDataExtendedAttributeNoPage = async (params) => { + return await request.get({ url: `/eam/table-data-extended-attribute/noPage`, params }) +} + +// 新增表数据扩展属性字段 +export const createTableDataExtendedAttributeBatch = async (data: Object) => { + return await request.post({ url: `/eam/table-data-extended-attribute/createBatch`, data }) +} diff --git a/src/components/Annex/src/Annex.vue b/src/components/Annex/src/Annex.vue index 69c4c614c..1a1b128a6 100644 --- a/src/components/Annex/src/Annex.vue +++ b/src/components/Annex/src/Annex.vue @@ -75,8 +75,8 @@ const props = defineProps({ // 子传父的时候需要先定义好emit这个方法 const emit = defineEmits(['handleAnnexSuccess', 'deleteAnnexSuccess','previewAnnexHandle']) // 添加附件 -const handleAnnexSuccess = () => { - emit('handleAnnexSuccess') +const handleAnnexSuccess = (str,res,uploadFile) => { + emit('handleAnnexSuccess',str,res,uploadFile) } // 删除附件 diff --git a/src/components/Annex/src/AnnexLedger.vue b/src/components/Annex/src/AnnexLedger.vue new file mode 100644 index 000000000..94435ce56 --- /dev/null +++ b/src/components/Annex/src/AnnexLedger.vue @@ -0,0 +1,175 @@ + + + + + + + diff --git a/src/components/AutoIncrementField/index.ts b/src/components/AutoIncrementField/index.ts new file mode 100644 index 000000000..b8696700a --- /dev/null +++ b/src/components/AutoIncrementField/index.ts @@ -0,0 +1,3 @@ +import AutoIncrementField from './src/AutoIncrementField.vue' + +export { AutoIncrementField } diff --git a/src/components/AutoIncrementField/src/AutoIncrementField.vue b/src/components/AutoIncrementField/src/AutoIncrementField.vue new file mode 100644 index 000000000..69ef2f02b --- /dev/null +++ b/src/components/AutoIncrementField/src/AutoIncrementField.vue @@ -0,0 +1,106 @@ +vue + + + \ No newline at end of file diff --git a/src/components/Detail/src/DetailLedger.vue b/src/components/Detail/src/DetailLedger.vue new file mode 100644 index 000000000..5633f4bdb --- /dev/null +++ b/src/components/Detail/src/DetailLedger.vue @@ -0,0 +1,1095 @@ + + + + + diff --git a/src/components/SearchTable/src/SearchTable.vue b/src/components/SearchTable/src/SearchTable.vue index 39e93b2ce..5e10c4025 100644 --- a/src/components/SearchTable/src/SearchTable.vue +++ b/src/components/SearchTable/src/SearchTable.vue @@ -24,6 +24,7 @@ v-model:pageSize="tableObjectRef.pageSize" v-model:currentPage="tableObjectRef.currentPage" v-model:sort="tableObjectRef.sort" + :searchTableSelectionsList="searchTableSelectionsList" :selection="true" :reserveSelection="true" row-key="id" @@ -72,6 +73,7 @@ const rowRef = ref() const allSchemasRef = ref() const multipleBol = ref(false) const searchConditionRef = ref() +const searchTableSelectionsList = ref()//表格弹窗回显的列表 const openData = (titleName: any, tableObject:any ,allSchemas: any,multiple: any) => { dialogWidth.value = '80%' @@ -86,12 +88,12 @@ const openData = (titleName: any, tableObject:any ,allSchemas: any,multiple: any searchSchema.value = allSchemas.searchSchema tableColumns.value = allSchemas.tableColumns } -const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, searchField: any,multiple: any, type: any, row: any, searchCondition:any , isCountRequestRe:any,isConcatDetailSchemas=false,detailSchemas: any) => { +const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, searchField: any,multiple: any, type: any, row: any, searchCondition:any , isCountRequestRe:any,isConcatDetailSchemas=false,detailSchemas: any, searchTableSelections:any) => { dialogWidth.value = '80%' HeadButttondata.value = [ defaultButtons.defaultFilterBtn(null), // 筛选 ] - +debugger searchDialogVisible.value = true formFieldRef.value = formField searchFieldRef.value = searchField @@ -110,6 +112,7 @@ const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, s multipleBol.value = multiple // dialogTitle.value = t('action.' + type) dialogTitle.value = t(`ts.${titleName}`).replace('ts.','') + searchTableSelectionsList.value = searchTableSelections const {tableObject, tableMethods } = useTable({ getListApi: getPage.value // 分页接口 diff --git a/src/components/Table/src/Table.vue b/src/components/Table/src/Table.vue index af95f8b2d..3046e83bf 100644 --- a/src/components/Table/src/Table.vue +++ b/src/components/Table/src/Table.vue @@ -57,7 +57,8 @@ export default defineComponent({ data: { type: Array as PropType, default: () => [] - } + }, + searchTableSelectionsList:[],//回显列表 }, emits: ['update:pageSize', 'update:currentPage', 'register', 'update:sort','getSelectionRows'], setup(props, { attrs, slots, emit, expose }) { @@ -67,6 +68,11 @@ export default defineComponent({ onMounted(() => { const tableRef = unref(elTableRef) emit('register', tableRef?.$parent, elTableRef) + if (props.searchTableSelectionsList && props.searchTableSelectionsList.length > 0) { + props.searchTableSelectionsList.forEach(row => { + elTableRef.value.toggleRowSelection(row, true); + }); + } }) const pageSizeRef = ref(props.pageSize) diff --git a/src/components/UploadFile/src/UploadFile.vue b/src/components/UploadFile/src/UploadFile.vue index bf3cc4895..4b5201ba0 100644 --- a/src/components/UploadFile/src/UploadFile.vue +++ b/src/components/UploadFile/src/UploadFile.vue @@ -117,7 +117,7 @@ const handleFileSuccess: UploadProps['onSuccess'] = (res: any,uploadFile: any): fileList.value = fileList.value.concat(uploadList.value) uploadList.value = [] uploadNumber.value = 0 - emit('update:modelValue', listToString(fileList.value)) + emit('update:modelValue', listToString(fileList.value),res,uploadFile) } } // 文件数超出提示 diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index 73101cc39..ad518a9a4 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -945,10 +945,10 @@ export function componentBtn(option:any) { }) } // 主列表-备件 -export function itemBtn(option:any) { +export function sparePartBtn(option:any) { return __defaultBtnOption(option,{ label: '备件', - name: 'item', + name: 'sparePart', hide: false, type: 'primary', color: '', diff --git a/src/views/eam/equipmentAccounts/index.vue b/src/views/eam/equipmentAccounts/index.vue index a85b33ce1..0067ba461 100644 --- a/src/views/eam/equipmentAccounts/index.vue +++ b/src/views/eam/equipmentAccounts/index.vue @@ -51,10 +51,11 @@ /> - + - - + + + @@ -66,9 +67,15 @@ import * as EquipmentAccountsApi from '@/api/eam/equipmentAccounts' import * as defaultButtons from '@/utils/disposition/defaultButtons' import TableHead from '@/components/TableHead/src/TableHead.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue' -import Detail from '@/components/Detail/src/Detail.vue' +import DetailLedger from '@/components/Detail/src/DetailLedger.vue' import { RelationMainPart,RelationMainPartRules } from '../relationMainPart/relationMainPart.data' import * as RelationMainPartApi from '@/api/eam/relationMainPart' +import { EquipmentMainPart,EquipmentMainPartRules } from '../equipmentMainPart/equipmentMainPart.data' +import * as EquipmentMainPartApi from '@/api/eam/equipmentMainPart' +import { SparePart,SparePartRules } from '../sparePart/sparePart.data' +import * as SparePartApi from '@/api/eam/sparePart' +import { EquipmentToolSparePart,EquipmentToolSparePartRules } from '../equipmentToolSparePart/equipmentToolSparePart.data' +import * as EquipmentToolSparePartApi from '@/api/eam/equipmentToolSparePart' defineOptions({ name: 'EquipmentAccounts' }) @@ -77,9 +84,11 @@ const { t } = useI18n() // 国际化 const route = useRoute() // 路由信息 const routeName = ref() +const deviceNumber = ref() routeName.value = route.name const tableColumns = ref(EquipmentAccounts.allSchemas.tableColumns) - +const tabs = ref<{ label: string; prop: string; }[]>([]) +const subTabList = ref([]); // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef) => { nextTick(() => { @@ -139,7 +148,7 @@ const buttonBaseClick = (val, item) => { const butttondata = [ defaultButtons.mainListEditBtn({hasPermi:'eam:equipment-accounts:update'}), // 编辑 defaultButtons.componentBtn({hasPermi:'eam:equipment-accounts:component'}), // 部件 - defaultButtons.itemBtn({hasPermi:'eam:equipment-accounts:item'}), // 备件 + defaultButtons.sparePartBtn({hasPermi:'eam:equipment-accounts:item'}), // 备件 // defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipment-accounts:delete'}), // 删除 ] @@ -151,8 +160,8 @@ const buttonTableClick = async (val, row) => { handleDelete(row.id) } else if (val == 'component') { // 部件 openComponent(row) - } else if (val == 'part') { // 备件 - openItem(row) + } else if (val == 'sparePart') { // 备件 + openSparePart(row) } } @@ -188,7 +197,8 @@ const formsSuccess = async (formType,data) => { /** 详情操作 */ const detailRef = ref() -const openDetail = (row: any, titleName: any, titleValue: any) => { +const openDetail = async (row: any, titleName: any, titleValue: any) => { + // subTabList.value = await detailRef.value.openDetail(row, titleName, titleValue, 'basicEquipmentAccounts') } @@ -246,42 +256,89 @@ const searchFormClick = (searchData) => { } - const searchTableRef = ref() - const searchTableSelections = ref([]) - // const syncData = async () => { - // await RelationMainPartApi.getRelationMainPartNoPage({ deviceNumber: deviceNumber.value }).then(async (res) => { - // await ItemApi.getItemNoPage().then(response => { - // searchTableSelections.value = response.filter(element => { - // let flag = false; - // res.forEach(item => { - // if (element.number == item.itemNumber) { - // flag = true; - // } - // }); - // return flag; - // }); - // }); - // }); - // }; - /** 绑定备件操作 */ - const openComponent = async (row : any) => { - searchTableRef.value.open( - '选择部件', - RelationMainPart.allSchemas, - RelationMainPartApi.getRelationMainPartPage, - null, - RelationMainPart.allSchemas.searchSchema, - true, - null, - null, - null, - null, - searchTableSelections.value - ) - } +const searchTableRef = ref() +const searchSparePartTableRef = ref() +const searchTableSelections = ref([]) +const searchTableSparePartSelections = ref([]) +const syncData = async (row) => { + await RelationMainPartApi.getRelationMainPartNoPage({ equipmentCode: row.code }).then(async (res) => { + await EquipmentMainPartApi.getEquipmentMainPartNoPage({}).then(response => { + searchTableSelections.value = response.filter(element => { + let flag = false; + res.forEach(item => { + if (element.code == item.mainPartCode) { + flag = true; + } + }); + return flag; + }); + }); + }); +}; +const syncSparePartData = async (row) => { + await EquipmentToolSparePartApi.getEquipmentToolSparePartNoPage({ equipmentCode: row.code }).then(async (res) => { + await SparePartApi.getSparePartNoPage({}).then(response => { + searchTableSparePartSelections.value = response.filter(element => { + let flag = false; + res.forEach(item => { + if (element.code == item.sparePartCode) { + flag = true; + } + }); + return flag; + }); + }); + }); +}; +/** 绑定备件操作 */ +const openComponent = async (row : any) => { + await syncData(row) + searchTableRef.value.open( + '选择部件', + EquipmentMainPart.allSchemas, + EquipmentMainPartApi.getEquipmentMainPartPage, + 'equipmentMainPart', + EquipmentMainPart.allSchemas.searchSchema, + true, + null,//type + row, + null, + null, + null, + null, + searchTableSelections.value + ) +} -const openItem = async (number : String) => { - +const openSparePart = async (row : any) => { + await syncSparePartData(row) + searchSparePartTableRef.value.open( + '选择备件', + SparePart.allSchemas, + SparePartApi.getSparePartPage, + 'sparePartPart', + SparePart.allSchemas.searchSchema, + true, + null,//type + row, + null, + null, + null, + null, + searchTableSparePartSelections.value + ) +} + +const submitEquipmentMainPartRelation = (formField, searchField, val, formRef, rowRef) => { + const deviceMainPartRelList = val.map((element) => ({ + mainPartCode: element.code, + equipmentCode: rowRef.code, + type: 'DEVICE' + })) + RelationMainPartApi.createRelationMainPartBatch(deviceMainPartRelList).then(res => { + message.success(t('common.createSuccess')) + getList() + }) } /** 初始化 **/ diff --git a/src/views/eam/equipmentToolSparePart/equipmentToolSparePart.data.ts b/src/views/eam/equipmentToolSparePart/equipmentToolSparePart.data.ts new file mode 100644 index 000000000..77ff8cb46 --- /dev/null +++ b/src/views/eam/equipmentToolSparePart/equipmentToolSparePart.data.ts @@ -0,0 +1,135 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const EquipmentToolSparePartRules = reactive({ + sparePartCode: [required], + equipmentToolCode: [required], + type: [required], + concurrencyStamp: [required] +}) + +export const EquipmentToolSparePart = useCrudSchemas(reactive([ + { + label: 'id', + field: 'id', + sort: 'custom', + isForm: false + }, + { + label: '备件编号', + field: 'sparePartCode', + sort: 'custom', + isSearch: true + }, + { + label: '设备编码', + field: 'equipmentToolCode', + sort: 'custom', + isSearch: true + }, + { + label: '类型', + field: 'type', + sort: 'custom', + dictType: DICT_TYPE.DEVICE_TYPE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + isSearch: true, + form: { + component: 'SelectV2' + } + }, + { + label: '使用部位', + field: 'usePosition', + 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: true + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: true + }, + { + label: '地点ID', + field: 'siteId', + sort: 'custom', + isSearch: true + }, + { + label: '是否可用默认TRUE', + field: 'available', + sort: 'custom', + isSearch: true + }, + { + label: '删除时间', + field: 'deletionTime', + 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')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + } + }, + { + label: '删除人id', + field: 'deleterId', + sort: 'custom', + isSearch: true + }, + { + label: '并发乐观锁', + field: 'concurrencyStamp', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + } + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/eam/equipmentToolSparePart/index.vue b/src/views/eam/equipmentToolSparePart/index.vue new file mode 100644 index 000000000..aafeaa7f3 --- /dev/null +++ b/src/views/eam/equipmentToolSparePart/index.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/eam/tableDataExtendedAttribute/index.vue b/src/views/eam/tableDataExtendedAttribute/index.vue new file mode 100644 index 000000000..2fab0094e --- /dev/null +++ b/src/views/eam/tableDataExtendedAttribute/index.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/eam/tableDataExtendedAttribute/tableDataExtendedAttribute.data.ts b/src/views/eam/tableDataExtendedAttribute/tableDataExtendedAttribute.data.ts new file mode 100644 index 000000000..332bedd1e --- /dev/null +++ b/src/views/eam/tableDataExtendedAttribute/tableDataExtendedAttribute.data.ts @@ -0,0 +1,106 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const TableDataExtendedAttributeRules = reactive({ + tableName: [required], + dataId: [required], + fieldName: [required], + concurrencyStamp: [required] +}) + +export const TableDataExtendedAttribute = useCrudSchemas(reactive([ + { + label: 'id', + field: 'id', + sort: 'custom', + isForm: false + }, + { + label: '表名称', + field: 'tableName', + sort: 'custom', + isSearch: true + }, + { + label: '数据', + field: 'dataId', + sort: 'custom', + isSearch: true + }, + { + label: '字段名称', + field: 'fieldName', + sort: 'custom', + isSearch: true + }, + { + label: '字段值', + field: 'fieldVal', + 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: '地点', + field: 'siteId', + sort: 'custom', + isSearch: true + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + isSearch: true + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + } + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: true + }, + { + label: '并发乐观锁', + field: 'concurrencyStamp', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + } + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +]))