diff --git a/admin/package.json b/admin/package.json index fc2241e..0e84e1c 100644 --- a/admin/package.json +++ b/admin/package.json @@ -5,7 +5,7 @@ "description": "An out-of-box UI solution for enterprise applications", "scripts": { "analyze": "cross-env ANALYZE=1 umi build", - "build": "cross-env NODE_OPTIONS=--openssl-legacy-provider umi build", + "build": "cross-env umi build", "deploy": "npm run build && npm run gh-pages", "dev": "npm run start:dev", "gh-pages": "gh-pages -d dist", @@ -21,7 +21,7 @@ "openapi": "umi openapi", "precommit": "lint-staged", "prettier": "prettier -c --write \"src/**/*\"", - "start": "cross-env UMI_ENV=dev NODE_OPTIONS=--openssl-legacy-provider umi dev", + "start": "cross-env UMI_ENV=dev umi dev", "start:dev": "cross-env REACT_APP_ENV=dev MOCK=none UMI_ENV=dev umi dev", "start:no-mock": "cross-env MOCK=none UMI_ENV=dev umi dev", "start:no-ui": "cross-env UMI_UI=none UMI_ENV=dev umi dev", @@ -133,5 +133,7 @@ }, "gitHooks": { "commit-msg": "fabric verify-commit" - } + }, + "main": "index.js", + "license": "MIT" } diff --git a/admin/src/components/Footer/index.tsx b/admin/src/components/Footer/index.tsx index b39ab5f..133abeb 100644 --- a/admin/src/components/Footer/index.tsx +++ b/admin/src/components/Footer/index.tsx @@ -3,8 +3,8 @@ export default () => {
- 教育部数字化学习支撑技术工程研究中心          东北师大理想软件股份有限公司 < br /> - 吉公网安备22010202000105号    吉ICP备13001399号-2  增值电信业务经营许可证 吉B2-20150068 + {/*教育部数字化学习支撑技术工程研究中心          东北师大理想软件股份有限公司 < br />*/} + {/*吉公网安备22010202000105号    吉ICP备13001399号-2  增值电信业务经营许可证 吉B2-20150068*/}
); }; diff --git a/admin/src/pages/course/option/components/VideoJS/index.tsx b/admin/src/pages/course/option/components/VideoJS/index.tsx index a5f9eed..828b742 100644 --- a/admin/src/pages/course/option/components/VideoJS/index.tsx +++ b/admin/src/pages/course/option/components/VideoJS/index.tsx @@ -7,14 +7,14 @@ export const VideoJS = ( props: any ) => { const videoRef = React.useRef(null); const playerRef = React.useRef(null); const { options, onReady, width, height } = props; - console.log('props', props) + // console.log('props', props) useEffect(() => { - + // make sure Video.js player is only initialized once if (!playerRef.current) { const videoElement = videoRef.current; if (!videoElement) return; - + const player = playerRef.current = videojs(videoElement, options, () => { console.log("player is ready"); onReady && onReady(player); @@ -23,12 +23,12 @@ export const VideoJS = ( props: any ) => { // you can update player here [update player through props] const player = playerRef.current; console.log('playerplayerplayer===',player); - player.src(options.sources[0].src); + player.src(options.sources[0].src); player.autoplay(true); - + } }, [options, videoRef]); - + return (
); - } \ No newline at end of file + } diff --git a/admin/src/pages/course/option/index.tsx b/admin/src/pages/course/option/index.tsx index 6e116ac..a4e0d56 100644 --- a/admin/src/pages/course/option/index.tsx +++ b/admin/src/pages/course/option/index.tsx @@ -320,6 +320,7 @@ const CourseList: React.FC = () => { if(info.data.attachment_json.length===undefined){ info.data.attachment_json=[info.data.attachment_json] } + console.log(' info.data.attachment_jsonchchhcchchch', info.data.attachment_json) setCurrentRow(info.data); handleDetailModalVisible(true); }} @@ -329,10 +330,15 @@ const CourseList: React.FC = () => { { - uuid = uuidv4(); - const info= await viewCourse({course_id:record.course_id}); - setCurrentRow(info.data); - handleUpdateModalVisible(true); + // uuid = uuidv4(); + if(record.isExistRelation){ + message.warning('温馨提示:存在课程与主题章节的关联关系,不允许编辑。'); + }else { + const info= await viewCourse({course_id:record.course_id}); + setCurrentRow(info.data); + handleUpdateModalVisible(true); + } + }} > 编辑 @@ -402,6 +408,7 @@ const CourseList: React.FC = () => { * @param fields */ const handleUpdate = async (fields: TableListItem) => { + console.log(111) const info= await saveCourse({ ...fields, }); @@ -632,7 +639,8 @@ const CourseList: React.FC = () => { // values.attachment_json.response.file.response.url //console.log('currentRow', currentRow) //return false; - console.log('values新增',values) + // console.log('values新增',values) + await handleAdd({ ...values, ////course_id: currentRow?.course_id, @@ -676,13 +684,23 @@ const CourseList: React.FC = () => { formRef={updateFormRef} layout="horizontal" layoutType="Form" - preserve={false} + preserve={false} labelCol={{ span: 8 }} wrapperCol={{ span: 12 }} onFinish={async (values: any) => { + console.log('values编辑',values) + console.log('currentRow编辑',currentRow) + let url=""; + if(values.attachment_json[0].response!==undefined){ + url=`down/Syzx/${uuid?.substr(0, 2)}/${uuid}.mp4` + }else { + url=values.attachment_json[0].url + } + console.log('url',url); await handleUpdate({ ...values, - attachment_json: `[{"img":"", "name": "${values?.attachment_json[0]?.name}", "url": "down/Syzx/${uuid?.substr(0, 2)}/${uuid}.mp4"}]`, + attachment_json: `[{"img":"", "name": "${values?.attachment_json[0]?.name}", "url": "${url}"}]`, + // attachment_json: `[{"img":"", "name": "${values?.attachment_json[0]?.name}", "url": "${currentRow?.attachment_json[0]?.url}" }]`, attachment_filesize: values.attachment_json[0].size||currentRow.attachment_filesize, // 字节 course_id: currentRow?.course_id }); diff --git a/admin/src/pages/course/subject/step/index.tsx b/admin/src/pages/course/subject/step/index.tsx index aaba279..c550b95 100644 --- a/admin/src/pages/course/subject/step/index.tsx +++ b/admin/src/pages/course/subject/step/index.tsx @@ -92,6 +92,7 @@ export default () => { const [createModalVisible, handleCreateModalVisible] = useState(false); const [detailModalVisible, handleDetailModalVisible] = useState(false); const [updateModalVisible, handleUpdateModalVisible] = useState(false); + const [pngSize, setPngSize] = useState(true); const [selectedRowsState, setSelectedRows] = useState([]); const [uploadFileName, SetUploadFileName] = useState(); const [uploadFileExt, SetUploadFileExt] = useState(); @@ -402,23 +403,28 @@ export default () => { }}*/ onFinish={async (value: any) => { console.log(value, 'subjectId') - - const url = value?.upload[0]?.url?.replace('/dsideal_yy/html/', '') || value?.upload[0]?.response?.url; - const info = await saveSubject({ - ...value, - subject_id: subjectId, - attachment_json: `{ "url": "${url}"}` - }); - - if (info.code !== 2000) { - message.warning(info.msg); - return false; - } else { - setSubjectId(info?.data.subject_id) - setSubjectIntro({ subject_id: info?.data.subject_id, subject_name: value?.subject_name, subject_describe: value?.subject_describe }); - return true; + if(pngSize){ + const url = value?.upload[0]?.url?.replace('/dsideal_yy/html/', '') || value?.upload[0]?.response?.url; + const info = await saveSubject({ + ...value, + subject_id: subjectId, + attachment_json: `{ "url": "${url}"}` + }); + + if (info.code !== 2000) { + message.warning(info.msg); + return false; + } else { + setSubjectId(info?.data.subject_id) + setSubjectIntro({ subject_id: info?.data.subject_id, subject_name: value?.subject_name, subject_describe: value?.subject_describe }); + return true; + } + }else { + message.warning('图片大小超过10M,请重新上传!') + return false } + }} > @@ -460,10 +466,13 @@ export default () => { message.error('只能上传JPG 、JPEG 、GIF、 PNG格式的图片~'); return false; } - const isLt2M = file.size / 1024 / 1024 < 2; + const isLt2M = file.size / 1024 / 1024 < 10; if (!isLt2M) { - message.error('超过2M限制,不允许上传~'); + setPngSize(false) + message.error('超过10M限制,不允许上传~'); return false; + }else { + setPngSize(true) } // 获取文件名 diff --git a/admin/src/pages/examination/option/index.tsx b/admin/src/pages/examination/option/index.tsx index 3475738..2be255b 100644 --- a/admin/src/pages/examination/option/index.tsx +++ b/admin/src/pages/examination/option/index.tsx @@ -145,6 +145,8 @@ const ExaminationList: React.FC = () => { }, { validator: (rule, value) => { + console.log('value[0]value[0]',value[0].getTime()) + console.log('value[1]value[1]',value[1]) // console.log(value[0] > value[1]); const examinationTime = schemaForm.getFieldValue('examination_time') if (examinationTime&&value) { @@ -155,6 +157,9 @@ const ExaminationList: React.FC = () => { return Promise.reject('报名结束时间不能晚于考试开始时间') } } + if(value[0] ===value[1] ){ + return Promise.reject('报名开始时间不能和报名结束时间相同') + } return Promise.resolve() } diff --git a/admin/src/pages/examination/registration/index.tsx b/admin/src/pages/examination/registration/index.tsx index be65741..42aec20 100644 --- a/admin/src/pages/examination/registration/index.tsx +++ b/admin/src/pages/examination/registration/index.tsx @@ -390,9 +390,9 @@ const RegistrationList: React.FC = () => { is_pass:params.type==='kkwh'?'':1, page_number: value.current, page_size: value.pageSize, - city_id: value.city_name, - district_id:value.district_name, - bureau_id: value.bureau_name, + city_id:cityId, + district_id:areaId, + bureau_id: schoolId, examination_id: params.id, ...examination_time } diff --git a/admin/src/pages/examinationrules/attestation/index.tsx b/admin/src/pages/examinationrules/attestation/index.tsx index 5ea8199..c273fd0 100644 --- a/admin/src/pages/examinationrules/attestation/index.tsx +++ b/admin/src/pages/examinationrules/attestation/index.tsx @@ -223,8 +223,12 @@ const ExaminationRules: React.FC = () => { // , { - history.push('/examinationrules/attestation/step/' + record.id) + if(!record.edit_type){ + history.push('/examinationrules/attestation/step/' + record.id) + } + }} > 编辑 diff --git a/admin/src/pages/examinationrules/attestation/step/index.tsx b/admin/src/pages/examinationrules/attestation/step/index.tsx index d3b102b..91e4fdd 100644 --- a/admin/src/pages/examinationrules/attestation/step/index.tsx +++ b/admin/src/pages/examinationrules/attestation/step/index.tsx @@ -316,7 +316,7 @@ export default () => { const { data } = await saveRules({ ...fileds, b_use: 0, - is_delete:1, + is_delete:params.id?0:1, rules_type: 1, start_time: fileds.dateRange[0], end_time: fileds.dateRange[1] diff --git a/admin/src/pages/history/analysis/components/IntroduceRow.tsx b/admin/src/pages/history/analysis/components/IntroduceRow.tsx index edfe949..3c9d13d 100644 --- a/admin/src/pages/history/analysis/components/IntroduceRow.tsx +++ b/admin/src/pages/history/analysis/components/IntroduceRow.tsx @@ -325,7 +325,6 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat ) - }; export default IntroduceRow; diff --git a/admin/src/pages/questionbank/index.tsx b/admin/src/pages/questionbank/index.tsx index 51241aa..eb799e2 100644 --- a/admin/src/pages/questionbank/index.tsx +++ b/admin/src/pages/questionbank/index.tsx @@ -58,11 +58,14 @@ const handleUpdate = async (fields: TableListItem) => { try { await saveQuestion({ ...fields }); hide(); - message.success('保存成功'); + handleUpdateModalVisible(false); + actionRef.current?.reloadAndRest?.(); return true; } catch (error) { + console.log('error.response',error.response) hide(); - message.error('保存失败请重试!'); + + message.error(error.response.data.info); return false; } }; @@ -927,10 +930,8 @@ const QuestionBank = () => { //question_type: currentRow?.question_type, // 题型 // subject_id: params?.id || 0, }); - if (success) { - handleUpdateModalVisible(false); - actionRef.current?.reloadAndRest?.(); - } + console.log('success',success) + }} submitter={{ render: (props, doms) => ( diff --git a/web/package.json b/web/package.json index 6f7c0fa..f77a658 100644 --- a/web/package.json +++ b/web/package.json @@ -5,7 +5,7 @@ "description": "An out-of-box UI solution for enterprise applications", "scripts": { "analyze": "cross-env ANALYZE=1 umi build", - "build": "cross-env NODE_OPTIONS=--openssl-legacy-provider umi build", + "build": "cross-env umi build", "deploy": "npm run build && npm run gh-pages", "dev": "npm run start:dev", "gh-pages": "gh-pages -d dist", @@ -21,7 +21,7 @@ "openapi": "umi openapi", "precommit": "lint-staged", "prettier": "prettier -c --write \"src/**/*\"", - "start": "cross-env UMI_ENV=dev NODE_OPTIONS=--openssl-legacy-provider umi dev", + "start": "cross-env UMI_ENV=dev umi dev", "start:dev": "cross-env REACT_APP_ENV=dev MOCK=none UMI_ENV=dev umi dev", "start:no-mock": "cross-env MOCK=none UMI_ENV=dev umi dev", "start:no-ui": "cross-env UMI_UI=none UMI_ENV=dev umi dev", diff --git a/web/src/components/Footer/index.tsx b/web/src/components/Footer/index.tsx index b39ab5f..133abeb 100644 --- a/web/src/components/Footer/index.tsx +++ b/web/src/components/Footer/index.tsx @@ -3,8 +3,8 @@ export default () => {
- 教育部数字化学习支撑技术工程研究中心          东北师大理想软件股份有限公司 < br /> - 吉公网安备22010202000105号    吉ICP备13001399号-2  增值电信业务经营许可证 吉B2-20150068 + {/*教育部数字化学习支撑技术工程研究中心          东北师大理想软件股份有限公司 < br />*/} + {/*吉公网安备22010202000105号    吉ICP备13001399号-2  增值电信业务经营许可证 吉B2-20150068*/}
); }; diff --git a/web/src/pages/personalCenter/index.tsx b/web/src/pages/personalCenter/index.tsx index 543fccd..cf57077 100644 --- a/web/src/pages/personalCenter/index.tsx +++ b/web/src/pages/personalCenter/index.tsx @@ -117,83 +117,83 @@ export default () => { {personInfo?.xb_name} - -
-
-
原密码:
-
- { - const strExp= /^[A-Za-z0-9]+$/; - if(strExp.test(e.target.value) || e.target.value===''){ - setOldPassWord(e.target.value); - return true; - }else { - message.warning('请输入英文或者是数字!'); - setOldPassWord(e.target.value.replace(/[\W]/g, '')); - } - }} - /> -
-
-
-
新密码:
-
- { - const strExp= /^[A-Za-z0-9]+$/; - if(strExp.test(e.target.value) || e.target.value===''){ - setNewPassWord(e.target.value); - return true; - }else { - message.warning('请输入英文或者是数字!'); - setNewPassWord(e.target.value.replace(/[\W]/g, '')); - } - }} - /> -
-
-
-
确认密码:
-
- { - const strExp= /^[A-Za-z0-9]+$/; - if(strExp.test(e.target.value) || e.target.value===''){ - setSecondNewPassWord(e.target.value); - return true; - }else { - message.warning('请输入英文或者是数字!'); - setSecondNewPassWord(e.target.value.replace(/[\W]/g, '')); - } - }} - /> -
-
-
提示:密码支持英文和数字,长度为6-12位
-
- -
-
+ {/*}}>确定修改*/} + {/**/} + {/**/} -
+ {/**/}