From 7c7379178782e3609646c9cc116a40e4c4c96ab3 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 15 Apr 2026 15:52:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=9B=B4=E6=96=B0=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=A4=96=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .umirc.ts | 4 +- src/components/Select.tsx | 50 +++++++++++++++++++--- src/pages/contract/contracts_add/index.tsx | 2 +- src/pages/quality/index/index.tsx | 10 ++--- src/pages/quality/index/modals/Create.tsx | 2 +- 5 files changed, 51 insertions(+), 17 deletions(-) diff --git a/.umirc.ts b/.umirc.ts index 437b3a3..832ce32 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -17,8 +17,8 @@ export default defineConfig({ }, proxy: { '/api/': { - target: 'http://10.39.13.78:8002/', - // target: 'https://test-company.linyikj.com.cn/', + // target: 'http://10.39.13.78:8002/', + target: 'http://test-company.linyikj.com.cn/', // target: 'https://company.linyikj.com.cn/', changeOrigin: true, pathRewrite: { '^': '' }, diff --git a/src/components/Select.tsx b/src/components/Select.tsx index 4731c3b..e2a0c10 100644 --- a/src/components/Select.tsx +++ b/src/components/Select.tsx @@ -319,13 +319,13 @@ export const Selects = { valueType: 'select', hideInTable: hideInTable, formItemProps: { ...(required ? rulesHelper.number : {}) }, - request: async (params) => { - let res = await Apis.Asset.AssetProjects.Select({ - keywords: params?.keyWords, - ...params, - }); - return res?.data; - }, + request: async (params) => + ( + await Apis.Asset.AssetProjects.Select({ + keywords: params?.keyWords, + ...params, + }) + ).data, ...rest, fieldProps: { showSearch: true, @@ -961,4 +961,40 @@ export const Selects = { }, }; }, + + //获取班次 + AttendanceShiftsSelect(props?: PropsType): ReturnType { + const { + title = '选择班次', + key = 'attendance_shifts_id', + required = false, + hideInTable = true, + ...rest + } = props ?? {}; + + return { + title: title, + key: key, + valueType: 'select', + dataIndex: key, + hideInTable: hideInTable, + formItemProps: { ...(required ? rulesHelper.number : {}) }, + request: async (params) => { + let res = await Apis.Attendance.AttendanceShifts.Select({ + ...params, + name: params?.keyWords || undefined, + }); + return res?.data; + }, + ...rest, + fieldProps: { + showSearch: true, + fieldNames: { + label: 'name', + value: 'id', + }, + ...rest?.fieldProps, + }, + }; + }, }; diff --git a/src/pages/contract/contracts_add/index.tsx b/src/pages/contract/contracts_add/index.tsx index 6eee0d6..77d7ce8 100644 --- a/src/pages/contract/contracts_add/index.tsx +++ b/src/pages/contract/contracts_add/index.tsx @@ -44,7 +44,7 @@ export default function Index({ title = '补充协议' }) { />, ]; - let permissionsSpace = [ + let permissionsSpace: any = [ { - return getCurrentPermissions({ - create: , - }); - }; + let tableRender = (item: any, action: any) => { return getCurrentPermissions({ show: , @@ -58,7 +54,9 @@ export default function Index({ title = '品质核查' }) { Apis.QualityCheck.QualityChecks.List, ) } - toolBarRender={(action) => [toolBarRender(action)]} + toolBarRender={(action) => [ + action?.reload()} title={title} />, + ]} columns={[ MyColumns.ID({ search: false }), Selects?.AssetProjects({ diff --git a/src/pages/quality/index/modals/Create.tsx b/src/pages/quality/index/modals/Create.tsx index 06b0e3e..4d0666d 100644 --- a/src/pages/quality/index/modals/Create.tsx +++ b/src/pages/quality/index/modals/Create.tsx @@ -26,7 +26,7 @@ export default function Create(props: MyBetaModalFormProps) { form={form} onOpenChange={(open: any) => { if (open) { - form.resetFields(); // 清空表单数据 + // form.resetFields(); // 清空表单数据 } }} onFinish={async (values) =>