From 2690f60e118dde64d828cac16d793397fdfca203 Mon Sep 17 00:00:00 2001 From: zhengpengju Date: Wed, 16 Feb 2022 17:34:57 +0800 Subject: [PATCH] fix --- admin/src/pages/course/option/index.tsx | 12 +++++--- .../questionbank/components/AnswersEditor.tsx | 29 +++++++------------ admin/src/pages/questionbank/style.less | 5 ++++ 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/admin/src/pages/course/option/index.tsx b/admin/src/pages/course/option/index.tsx index 4328530..fa313e5 100644 --- a/admin/src/pages/course/option/index.tsx +++ b/admin/src/pages/course/option/index.tsx @@ -44,7 +44,7 @@ const handleAdd = async (fields: TableListItem) => { */ const handleUpdate = async (fields: FormValueType, currentRow?: TableListItem) => { const hide = message.loading('正在配置'); - +console.log('fields',fields) try { await saveCourse({ ...currentRow, @@ -286,7 +286,7 @@ const CourseList: React.FC = () => { hideInForm: true, hideInSearch: true, width: 100, - renderText: (val: string) => `${val}M`, + renderText: (val: string) => `${val} 字节`, formItemProps: { // 参照 https://ant.design/components/form-cn/#Rule rules: [ @@ -600,14 +600,18 @@ const CourseList: React.FC = () => { labelCol={{ span: 8 }} wrapperCol={{ span: 12 }} onFinish={async (values) => { - alert(0) + console.log('values', values) console.log('currentRow', currentRow) + //const url = values?.upload[0]?.url?.replace('/dsideal_yy/html/','') || values?.upload[0]?.response?.url; + //console.log('url', url) await handleUpdate({ ...values, + attachment_filesize: attachment_json?.size || 0, // Bit 字节 course_id: currentRow?.course_id, - //attachment_json: `{"img":"", "name": "${values.attachment_json.file.name}", "url": "down/M3u8/${uuid?.substr(0, 2)}/${uuid}.m3u8"}` + attachment_json: `{"img":"", "name": "${values.attachment_json?.name}", "url": "${values.attachment_json?.url}", "size": "${values.attachment_json?.size}"}` }); handleUpdateModalVisible(false); // 隐藏编辑窗口 + actionRef.current?.reloadAndRest?.(); console.log(values); }} submitter={{ diff --git a/admin/src/pages/questionbank/components/AnswersEditor.tsx b/admin/src/pages/questionbank/components/AnswersEditor.tsx index 62a5282..73e7558 100644 --- a/admin/src/pages/questionbank/components/AnswersEditor.tsx +++ b/admin/src/pages/questionbank/components/AnswersEditor.tsx @@ -17,7 +17,7 @@ import { queryQuestionById, queryQuestionList, queryQuestionType } from '@/pages import ProForm, { ProFormSelect } from '@ant-design/pro-form'; import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table'; - +const labels = ['A','B','C','D','E','F','G','H','I','J']; // 默认10个 //const { Paragraph } = Typography; const formItemLayout = { @@ -40,13 +40,14 @@ console.log('first'); const AnswersSelector = () => { return ( - { if (!names || names.length < 2) { - return Promise.reject(new Error('At least 2 passengers')); + return Promise.reject(new Error('至少填写2个选项')); } }, }, @@ -56,24 +57,24 @@ const AnswersSelector = () => { <> {fields.map((field, index) => ( - + {fields.length > 1 ? ( { - diff --git a/admin/src/pages/questionbank/style.less b/admin/src/pages/questionbank/style.less index 9c2feb3..25108de 100644 --- a/admin/src/pages/questionbank/style.less +++ b/admin/src/pages/questionbank/style.less @@ -1,4 +1,9 @@ @import '~antd/es/style/themes/default.less'; +:global { + .anticon.anticon-minus-circle.dynamic-delete-button{ + padding: 10px; + } +} .questionbank{ :global { .ant-list-split.ant-list-something-after-last-item .ant-spin-container > .ant-list-items > .ant-list-item:last-child{