From 281fe6b5bd163f275cdf356fa0c7fe818ddd031d Mon Sep 17 00:00:00 2001 From: xialiang <1818147@qq.com> Date: Sat, 29 Jan 2022 11:01:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/src/pages/course/subject/step/index.tsx | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/admin/src/pages/course/subject/step/index.tsx b/admin/src/pages/course/subject/step/index.tsx index 07ddf64..093be49 100644 --- a/admin/src/pages/course/subject/step/index.tsx +++ b/admin/src/pages/course/subject/step/index.tsx @@ -23,7 +23,7 @@ import ProFormRichEdit from '../components/ProFormRichEdit'; import type { ActionType, ProColumns } from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table'; import type { TableListItem, TableListPagination } from '../../option/data'; -import { queryCourseList } from '../../option/service'; +import { queryCourseList, saveSubject } from '../../option/service'; /** 列表项定义 */ const columns: ProColumns[] = [ @@ -213,9 +213,23 @@ export default () => { stepProps={{ description: false, }} - onFinish={async () => { - console.log(formRef.current?.getFieldsValue()); + onFinish={async (fileds) => { + if (params.id) { + fileds = { ...fileds, id: params.id } + } + console.log(fileds, 'fileds', params); + // return false + await saveRules({ + ...fileds, + b_use: 0, + rules_type: 1, + start_time: fileds.dateRange[0], + end_time: fileds.dateRange[1] + }); + + // await waitTime(2000); return true; + }} >
@@ -255,7 +269,11 @@ export default () => { , ]} request={async (value) => { - const _data = await queryCourseList(value); + + const _data = await saveSubject({ + ...value, + attachment_json: `{ "url": "${value.upload[0].response.url}"}` + }); return { current: _data?.page_number, data: _data?.data?.list,