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 ( -