|
|
|
@ -9,16 +9,17 @@ import styles from './style.less';
|
|
|
|
|
//import SubMenu from 'antd/lib/menu/SubMenu';
|
|
|
|
|
//import ProCard from '@ant-design/pro-card';
|
|
|
|
|
import ProList from '@ant-design/pro-list';
|
|
|
|
|
import { ReactText, useEffect, useRef, useState } from 'react';
|
|
|
|
|
import type { ReactText } from 'react';
|
|
|
|
|
import { useEffect, useRef, useState } from 'react';
|
|
|
|
|
import { PlusOutlined, DeleteOutlined, DownloadOutlined, UploadOutlined, EditOutlined, EyeOutlined, EyeInvisibleOutlined, DownOutlined, UserOutlined } from '@ant-design/icons';
|
|
|
|
|
import { exportQuestionTemplate, queryQuestionById, queryQuestionList, queryQuestionType, removeQuestion, saveQuestion } from './service';
|
|
|
|
|
import { useParams, useRequest, history, useRouteMatch } from 'umi';
|
|
|
|
|
import { queryCourseListByTag, queryCourseView, queryTagList } from '@/pages/course/option/service';
|
|
|
|
|
import ProForm, { BetaSchemaForm, ProFormCheckbox, ProFormList, ProFormRadio, ProFormSelect, ProFormText } from '@ant-design/pro-form';
|
|
|
|
|
import { DataItem } from '../dashboard/analysis/data';
|
|
|
|
|
import { ActionType, ProColumns } from '@ant-design/pro-table';
|
|
|
|
|
import type { DataItem } from '../dashboard/analysis/data';
|
|
|
|
|
import type { ActionType, ProColumns } from '@ant-design/pro-table';
|
|
|
|
|
import ProFormRichEdit from '../course/subject/components/ProFormRichEdit';
|
|
|
|
|
import { TableListItem } from '../course/option/data';
|
|
|
|
|
import type { TableListItem } from '../course/option/data';
|
|
|
|
|
import AnswersSelector from './components/AnswersEditor';
|
|
|
|
|
//const { Paragraph } = Typography;
|
|
|
|
|
const { Text, Link } = Typography;
|
|
|
|
@ -295,22 +296,31 @@ const QuestionBank = () => {
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请填写试题解析',
|
|
|
|
|
},
|
|
|
|
|
}, {
|
|
|
|
|
validator: (rule, value) => {
|
|
|
|
|
console.log("表单:", value, value.replace(/(^\s*)|(\s*$)/g, ""), "|")
|
|
|
|
|
if (value.replace(/(^\s*)|(\s*$)/g, "") === "") {
|
|
|
|
|
return Promise.reject('请填写试题解析')
|
|
|
|
|
} else {
|
|
|
|
|
return Promise.resolve()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
renderText: (val: string) => (<div dangerouslySetInnerHTML={{ __html: val }} />),
|
|
|
|
|
renderFormItem: (item, { defaultRender, ...rest }, form) => (
|
|
|
|
|
<ProFormRichEdit
|
|
|
|
|
name="parsing"
|
|
|
|
|
label=""
|
|
|
|
|
width="xl"
|
|
|
|
|
// tooltip="最长为 6 位汉字,需要与考生身份证一致"
|
|
|
|
|
placeholder="请填写试题解析"
|
|
|
|
|
// rules={[{ required: true }]}
|
|
|
|
|
value=""
|
|
|
|
|
// disabled
|
|
|
|
|
/>
|
|
|
|
|
),
|
|
|
|
|
// renderFormItem: (item, { defaultRender, ...rest }, form) => (
|
|
|
|
|
// <ProFormRichEdit
|
|
|
|
|
// name="parsing"
|
|
|
|
|
// label=""
|
|
|
|
|
// width="xl"
|
|
|
|
|
// // tooltip="最长为 6 位汉字,需要与考生身份证一致"
|
|
|
|
|
// placeholder="请填写试题解析"
|
|
|
|
|
// // rules={[{ required: true }]}
|
|
|
|
|
// value=""
|
|
|
|
|
// // disabled
|
|
|
|
|
// />
|
|
|
|
|
// ),
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
]
|
|
|
|
@ -772,6 +782,8 @@ const QuestionBank = () => {
|
|
|
|
|
}}
|
|
|
|
|
onFinish={async (values: any) => {
|
|
|
|
|
//console.log('formRef.current', formRef.current.getFieldsValue(['answertrue']))
|
|
|
|
|
console.log(values);
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
// 表单处理
|
|
|
|
|
console.log('columns:', columns);
|
|
|
|
|