From e7cdafc6f1b74aa36f2b262d25e85c351f7e0bc9 Mon Sep 17 00:00:00 2001 From: louis <869322496@qq.com> Date: Fri, 8 Mar 2024 10:41:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=85=A8=E9=83=A8=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E5=BC=80=E5=90=AFenter=E8=87=AA=E5=8A=A8=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/enums/contractEnum.ts | 1 - src/views/contract/index.vue | 2 +- .../materials-inventory/company/index.vue | 8 +++----- .../inventory-check/index.vue | 8 +------- .../materials-inventory/product/index.vue | 18 +----------------- .../materials-inventory/project/index.vue | 7 +++---- 6 files changed, 9 insertions(+), 35 deletions(-) diff --git a/src/enums/contractEnum.ts b/src/enums/contractEnum.ts index 94b1ad3..17a0ec3 100644 --- a/src/enums/contractEnum.ts +++ b/src/enums/contractEnum.ts @@ -3,4 +3,3 @@ export enum ContractStatusEnum { Approved = 1, // 已通过 Rejected = 2, // 已拒绝 } -// 使用es6数组方法遍历枚举 diff --git a/src/views/contract/index.vue b/src/views/contract/index.vue index fe06f88..3afeaab 100644 --- a/src/views/contract/index.vue +++ b/src/views/contract/index.vue @@ -37,7 +37,7 @@ defineOptions({ name: 'Contract', }); - const [DynamicTable, dynamicTableInstance] = useTable(); + const [DynamicTable, dynamicTableInstance] = useTable({ formProps: { autoSubmitOnEnter: true } }); const [showModal] = useFormModal(); const [fnModal] = useModal(); const isUploadPopupVisiable = ref(false); diff --git a/src/views/materials-inventory/company/index.vue b/src/views/materials-inventory/company/index.vue index bcf53dd..4ee8e2e 100644 --- a/src/views/materials-inventory/company/index.vue +++ b/src/views/materials-inventory/company/index.vue @@ -32,16 +32,14 @@ import AttachmentManage from '@/components/business/attachment-manage/index.vue'; import AttachmentUpload from '@/components/business/attachment-upload/index.vue'; import { ref, onMounted, type FunctionalComponent } from 'vue'; -import { useDictStore } from '@/store/modules/dict'; + import { useDictStore } from '@/store/modules/dict'; defineOptions({ name: 'Company', }); - const [DynamicTable, dynamicTableInstance] = useTable(); + const [DynamicTable, dynamicTableInstance] = useTable({ formProps: { autoSubmitOnEnter: true } }); const [showModal] = useFormModal(); const [fnModal] = useModal(); const isUploadPopupVisiable = ref(false); - const dictStore = useDictStore(); - // companyList; let columns = ref(); onMounted(() => { columns.value = [ @@ -59,7 +57,7 @@ import { useDictStore } from '@/store/modules/dict'; maxWidth: 150, width: 150, minWidth: 150, - fixed:'right', + fixed: 'right', dataIndex: 'ACTION', hideInSearch: true, actions: ({ record }) => [ diff --git a/src/views/materials-inventory/inventory-check/index.vue b/src/views/materials-inventory/inventory-check/index.vue index b194bf3..8b1c9fa 100644 --- a/src/views/materials-inventory/inventory-check/index.vue +++ b/src/views/materials-inventory/inventory-check/index.vue @@ -31,20 +31,15 @@ import { onMounted, ref, type FunctionalComponent } from 'vue'; import { DictEnum } from '@/enums/dictEnum'; import { useFormModal, useModal } from '@/hooks/useModal'; - import { contractSchemas } from './formSchemas'; - import { formatToDate } from '@/utils/dateUtil'; import { Button } from 'ant-design-vue'; - import AttachmentManage from '@/components/business/attachment-manage/index.vue'; - import AttachmentUpload from '@/components/business/attachment-upload/index.vue'; + defineOptions({ name: 'MaterialsInventory', }); const [DynamicTable, dynamicTableInstance] = useTable(); - const [showModal] = useFormModal(); const [fnModal] = useModal(); const isUploadPopupVisiable = ref(false); - // contractList; let columns = ref(); onMounted(() => { columns.value = [ @@ -156,7 +151,6 @@ // schemas: contractSchemas(contractTypes.value), // }, // }); - // // 如果是编辑的话,需要获取角色详情 // if (record.id) { // const info = await Api.contract.contractInfo({ id: record.id }); diff --git a/src/views/materials-inventory/product/index.vue b/src/views/materials-inventory/product/index.vue index 49a18f1..0674801 100644 --- a/src/views/materials-inventory/product/index.vue +++ b/src/views/materials-inventory/product/index.vue @@ -37,27 +37,11 @@ defineOptions({ name: 'Product', }); - const [DynamicTable, dynamicTableInstance] = useTable(); + const [DynamicTable, dynamicTableInstance] = useTable({ formProps: { autoSubmitOnEnter: true } }); const [showModal] = useFormModal(); const [fnModal] = useModal(); const isUploadPopupVisiable = ref(false); - const dictStore = useDictStore(); let columns = ref(); - // const loadData = async (params): Promise => { - // console.log('params', params); - // return Api.product.productList(params); - // }; - // const loadTableData = async (params: any) => { - // const { company, ...res } = params; - // const data = await Api.product.productList({ - // ...res, - // company, - // }); - // return data; - // }; - const exportFormatter = (columns: TableColumn[], tableData: any[]) => { - return { header: columns.map((item) => item.title), data: [] }; - }; onMounted(() => { columns.value = [ ...baseColumns, diff --git a/src/views/materials-inventory/project/index.vue b/src/views/materials-inventory/project/index.vue index 219c50e..b11055e 100644 --- a/src/views/materials-inventory/project/index.vue +++ b/src/views/materials-inventory/project/index.vue @@ -32,15 +32,14 @@ import AttachmentManage from '@/components/business/attachment-manage/index.vue'; import AttachmentUpload from '@/components/business/attachment-upload/index.vue'; import { ref, onMounted, type FunctionalComponent } from 'vue'; -import { useDictStore } from '@/store/modules/dict'; + import { useDictStore } from '@/store/modules/dict'; defineOptions({ name: 'Project', }); - const [DynamicTable, dynamicTableInstance] = useTable(); + const [DynamicTable, dynamicTableInstance] = useTable({ formProps: { autoSubmitOnEnter: true } }); const [showModal] = useFormModal(); const [fnModal] = useModal(); const isUploadPopupVisiable = ref(false); - const dictStore = useDictStore(); // projectList; let columns = ref(); onMounted(() => { @@ -59,7 +58,7 @@ import { useDictStore } from '@/store/modules/dict'; maxWidth: 150, width: 150, minWidth: 150, - fixed:'right', + fixed: 'right', dataIndex: 'ACTION', hideInSearch: true, actions: ({ record }) => [