bug修改,打包命令去掉NPODE_OPTIONS

master
wangxi 2 years ago
parent c08a42fcf4
commit 5159aea56d

@ -5,7 +5,7 @@
"description": "An out-of-box UI solution for enterprise applications", "description": "An out-of-box UI solution for enterprise applications",
"scripts": { "scripts": {
"analyze": "cross-env ANALYZE=1 umi build", "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", "deploy": "npm run build && npm run gh-pages",
"dev": "npm run start:dev", "dev": "npm run start:dev",
"gh-pages": "gh-pages -d dist", "gh-pages": "gh-pages -d dist",
@ -21,7 +21,7 @@
"openapi": "umi openapi", "openapi": "umi openapi",
"precommit": "lint-staged", "precommit": "lint-staged",
"prettier": "prettier -c --write \"src/**/*\"", "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: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-mock": "cross-env MOCK=none UMI_ENV=dev umi dev",
"start:no-ui": "cross-env UMI_UI=none UMI_ENV=dev umi dev", "start:no-ui": "cross-env UMI_UI=none UMI_ENV=dev umi dev",
@ -133,5 +133,7 @@
}, },
"gitHooks": { "gitHooks": {
"commit-msg": "fabric verify-commit" "commit-msg": "fabric verify-commit"
} },
"main": "index.js",
"license": "MIT"
} }

@ -3,8 +3,8 @@ export default () => {
<div style={{ <div style={{
textAlign: 'center', width: "100%", marginBottom: 40, color: "rgba(0,0,0,.45)", fontSize: 14 textAlign: 'center', width: "100%", marginBottom: 40, color: "rgba(0,0,0,.45)", fontSize: 14
}} > }} >
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; < br /> {/*教育部数字化学习支撑技术工程研究中心&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;东北师大理想软件股份有限公司 < br />*/}
22010202000105&nbsp;&nbsp;&nbsp;&nbsp;ICP13001399-2&nbsp;&nbsp; B2-20150068 {/*吉公网安备22010202000105号&nbsp;&nbsp;&nbsp;&nbsp;吉ICP备13001399号-2&nbsp;&nbsp;增值电信业务经营许可证 吉B2-20150068*/}
</div > </div >
); );
}; };

@ -7,14 +7,14 @@ export const VideoJS = ( props: any ) => {
const videoRef = React.useRef(null); const videoRef = React.useRef(null);
const playerRef = React.useRef<any>(null); const playerRef = React.useRef<any>(null);
const { options, onReady, width, height } = props; const { options, onReady, width, height } = props;
console.log('props', props) // console.log('props', props)
useEffect(() => { useEffect(() => {
// make sure Video.js player is only initialized once // make sure Video.js player is only initialized once
if (!playerRef.current) { if (!playerRef.current) {
const videoElement = videoRef.current; const videoElement = videoRef.current;
if (!videoElement) return; if (!videoElement) return;
const player = playerRef.current = videojs(videoElement, options, () => { const player = playerRef.current = videojs(videoElement, options, () => {
console.log("player is ready"); console.log("player is ready");
onReady && onReady(player); onReady && onReady(player);
@ -23,12 +23,12 @@ export const VideoJS = ( props: any ) => {
// you can update player here [update player through props] // you can update player here [update player through props]
const player = playerRef.current; const player = playerRef.current;
console.log('playerplayerplayer===',player); console.log('playerplayerplayer===',player);
player.src(options.sources[0].src); player.src(options.sources[0].src);
player.autoplay(true); player.autoplay(true);
} }
}, [options, videoRef]); }, [options, videoRef]);
return ( return (
<div data-vjs-player> <div data-vjs-player>
<video style={{ <video style={{
@ -37,4 +37,4 @@ export const VideoJS = ( props: any ) => {
}} ref={videoRef} className="video-js vjs-big-play-centered" /> }} ref={videoRef} className="video-js vjs-big-play-centered" />
</div> </div>
); );
} }

@ -320,6 +320,7 @@ const CourseList: React.FC = () => {
if(info.data.attachment_json.length===undefined){ if(info.data.attachment_json.length===undefined){
info.data.attachment_json=[info.data.attachment_json] info.data.attachment_json=[info.data.attachment_json]
} }
console.log(' info.data.attachment_jsonchchhcchchch', info.data.attachment_json)
setCurrentRow(info.data); setCurrentRow(info.data);
handleDetailModalVisible(true); handleDetailModalVisible(true);
}} }}
@ -329,10 +330,15 @@ const CourseList: React.FC = () => {
<a <a
key="update" key="update"
onClick={async() => { onClick={async() => {
uuid = uuidv4(); // uuid = uuidv4();
const info= await viewCourse({course_id:record.course_id}); if(record.isExistRelation){
setCurrentRow(info.data); message.warning('温馨提示:存在课程与主题章节的关联关系,不允许编辑。');
handleUpdateModalVisible(true); }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 * @param fields
*/ */
const handleUpdate = async (fields: TableListItem) => { const handleUpdate = async (fields: TableListItem) => {
console.log(111)
const info= await saveCourse({ const info= await saveCourse({
...fields, ...fields,
}); });
@ -632,7 +639,8 @@ const CourseList: React.FC = () => {
// values.attachment_json.response.file.response.url // values.attachment_json.response.file.response.url
//console.log('currentRow', currentRow) //console.log('currentRow', currentRow)
//return false; //return false;
console.log('values新增',values) // console.log('values新增',values)
await handleAdd({ await handleAdd({
...values, ...values,
////course_id: currentRow?.course_id, ////course_id: currentRow?.course_id,
@ -676,13 +684,23 @@ const CourseList: React.FC = () => {
formRef={updateFormRef} formRef={updateFormRef}
layout="horizontal" layout="horizontal"
layoutType="Form" layoutType="Form"
preserve={false} preserve={false}
labelCol={{ span: 8 }} labelCol={{ span: 8 }}
wrapperCol={{ span: 12 }} wrapperCol={{ span: 12 }}
onFinish={async (values: any) => { 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({ await handleUpdate({
...values, ...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, // 字节 attachment_filesize: values.attachment_json[0].size||currentRow.attachment_filesize, // 字节
course_id: currentRow?.course_id course_id: currentRow?.course_id
}); });

@ -92,6 +92,7 @@ export default () => {
const [createModalVisible, handleCreateModalVisible] = useState<boolean>(false); const [createModalVisible, handleCreateModalVisible] = useState<boolean>(false);
const [detailModalVisible, handleDetailModalVisible] = useState<boolean>(false); const [detailModalVisible, handleDetailModalVisible] = useState<boolean>(false);
const [updateModalVisible, handleUpdateModalVisible] = useState<boolean>(false); const [updateModalVisible, handleUpdateModalVisible] = useState<boolean>(false);
const [pngSize, setPngSize] = useState<boolean>(true);
const [selectedRowsState, setSelectedRows] = useState<TableListItem[]>([]); const [selectedRowsState, setSelectedRows] = useState<TableListItem[]>([]);
const [uploadFileName, SetUploadFileName] = useState<string>(); const [uploadFileName, SetUploadFileName] = useState<string>();
const [uploadFileExt, SetUploadFileExt] = useState<string>(); const [uploadFileExt, SetUploadFileExt] = useState<string>();
@ -402,23 +403,28 @@ export default () => {
}}*/ }}*/
onFinish={async (value: any) => { onFinish={async (value: any) => {
console.log(value, 'subjectId') console.log(value, 'subjectId')
if(pngSize){
const url = value?.upload[0]?.url?.replace('/dsideal_yy/html/', '') || value?.upload[0]?.response?.url; const url = value?.upload[0]?.url?.replace('/dsideal_yy/html/', '') || value?.upload[0]?.response?.url;
const info = await saveSubject({ const info = await saveSubject({
...value, ...value,
subject_id: subjectId, subject_id: subjectId,
attachment_json: `{ "url": "${url}"}` attachment_json: `{ "url": "${url}"}`
}); });
if (info.code !== 2000) { if (info.code !== 2000) {
message.warning(info.msg); message.warning(info.msg);
return false; return false;
} else { } else {
setSubjectId(info?.data.subject_id) setSubjectId(info?.data.subject_id)
setSubjectIntro({ subject_id: info?.data.subject_id, subject_name: value?.subject_name, subject_describe: value?.subject_describe }); setSubjectIntro({ subject_id: info?.data.subject_id, subject_name: value?.subject_name, subject_describe: value?.subject_describe });
return true; return true;
}
}else {
message.warning('图片大小超过10M,请重新上传!')
return false
} }
}} }}
> >
<Row gutter={24}> <Row gutter={24}>
@ -460,10 +466,13 @@ export default () => {
message.error('只能上传JPG 、JPEG 、GIF、 PNG格式的图片~'); message.error('只能上传JPG 、JPEG 、GIF、 PNG格式的图片~');
return false; return false;
} }
const isLt2M = file.size / 1024 / 1024 < 2; const isLt2M = file.size / 1024 / 1024 < 10;
if (!isLt2M) { if (!isLt2M) {
message.error('超过2M限制不允许上传~'); setPngSize(false)
message.error('超过10M限制不允许上传~');
return false; return false;
}else {
setPngSize(true)
} }
// 获取文件名 // 获取文件名

@ -145,6 +145,8 @@ const ExaminationList: React.FC = () => {
}, },
{ {
validator: (rule, value) => { 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]); // console.log(value[0] > value[1]);
const examinationTime = schemaForm.getFieldValue('examination_time') const examinationTime = schemaForm.getFieldValue('examination_time')
if (examinationTime&&value) { if (examinationTime&&value) {
@ -155,6 +157,9 @@ const ExaminationList: React.FC = () => {
return Promise.reject('报名结束时间不能晚于考试开始时间') return Promise.reject('报名结束时间不能晚于考试开始时间')
} }
} }
if(value[0] ===value[1] ){
return Promise.reject('报名开始时间不能和报名结束时间相同')
}
return Promise.resolve() return Promise.resolve()
} }

@ -390,9 +390,9 @@ const RegistrationList: React.FC = () => {
is_pass:params.type==='kkwh'?'':1, is_pass:params.type==='kkwh'?'':1,
page_number: value.current, page_number: value.current,
page_size: value.pageSize, page_size: value.pageSize,
city_id: value.city_name, city_id:cityId,
district_id:value.district_name, district_id:areaId,
bureau_id: value.bureau_name, bureau_id: schoolId,
examination_id: params.id, examination_id: params.id,
...examination_time ...examination_time
} }

@ -223,8 +223,12 @@ const ExaminationRules: React.FC = () => {
// </a>, // </a>,
<a <a
key="update" key="update"
disabled={record.edit_type ? true : false}
onClick={() => { onClick={() => {
history.push('/examinationrules/attestation/step/' + record.id) if(!record.edit_type){
history.push('/examinationrules/attestation/step/' + record.id)
}
}} }}
> >

@ -316,7 +316,7 @@ export default () => {
const { data } = await saveRules({ const { data } = await saveRules({
...fileds, ...fileds,
b_use: 0, b_use: 0,
is_delete:1, is_delete:params.id?0:1,
rules_type: 1, rules_type: 1,
start_time: fileds.dateRange[0], start_time: fileds.dateRange[0],
end_time: fileds.dateRange[1] end_time: fileds.dateRange[1]

@ -325,7 +325,6 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
</Row> </Row>
</Card >) </Card >)
}; };
export default IntroduceRow; export default IntroduceRow;

@ -58,11 +58,14 @@ const handleUpdate = async (fields: TableListItem) => {
try { try {
await saveQuestion({ ...fields }); await saveQuestion({ ...fields });
hide(); hide();
message.success('保存成功'); handleUpdateModalVisible(false);
actionRef.current?.reloadAndRest?.();
return true; return true;
} catch (error) { } catch (error) {
console.log('error.response',error.response)
hide(); hide();
message.error('保存失败请重试!');
message.error(error.response.data.info);
return false; return false;
} }
}; };
@ -927,10 +930,8 @@ const QuestionBank = () => {
//question_type: currentRow?.question_type, // 题型 //question_type: currentRow?.question_type, // 题型
// subject_id: params?.id || 0, // subject_id: params?.id || 0,
}); });
if (success) { console.log('success',success)
handleUpdateModalVisible(false);
actionRef.current?.reloadAndRest?.();
}
}} }}
submitter={{ submitter={{
render: (props, doms) => ( render: (props, doms) => (

@ -5,7 +5,7 @@
"description": "An out-of-box UI solution for enterprise applications", "description": "An out-of-box UI solution for enterprise applications",
"scripts": { "scripts": {
"analyze": "cross-env ANALYZE=1 umi build", "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", "deploy": "npm run build && npm run gh-pages",
"dev": "npm run start:dev", "dev": "npm run start:dev",
"gh-pages": "gh-pages -d dist", "gh-pages": "gh-pages -d dist",
@ -21,7 +21,7 @@
"openapi": "umi openapi", "openapi": "umi openapi",
"precommit": "lint-staged", "precommit": "lint-staged",
"prettier": "prettier -c --write \"src/**/*\"", "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: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-mock": "cross-env MOCK=none UMI_ENV=dev umi dev",
"start:no-ui": "cross-env UMI_UI=none UMI_ENV=dev umi dev", "start:no-ui": "cross-env UMI_UI=none UMI_ENV=dev umi dev",

@ -3,8 +3,8 @@ export default () => {
<div style={{ <div style={{
textAlign: 'center', width: "100%", marginBottom: 40, color: "rgba(0,0,0,.45)", fontSize: 14 textAlign: 'center', width: "100%", marginBottom: 40, color: "rgba(0,0,0,.45)", fontSize: 14
}} > }} >
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; < br /> {/*教育部数字化学习支撑技术工程研究中心&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;东北师大理想软件股份有限公司 < br />*/}
22010202000105&nbsp;&nbsp;&nbsp;&nbsp;ICP13001399-2&nbsp;&nbsp; B2-20150068 {/*吉公网安备22010202000105号&nbsp;&nbsp;&nbsp;&nbsp;吉ICP备13001399号-2&nbsp;&nbsp;增值电信业务经营许可证 吉B2-20150068*/}
</div > </div >
); );
}; };

@ -117,83 +117,83 @@ export default () => {
<span className='condition-text'>{personInfo?.xb_name}</span></div> <span className='condition-text'>{personInfo?.xb_name}</span></div>
</div> </div>
</TabPane> </TabPane>
<TabPane tab="密码修改" key="2"> {/*<TabPane tab="密码修改" key="2">*/}
<div style={{paddingTop:'3rem',width:'20rem',margin:'0 auto'}}> {/*<div style={{paddingTop:'3rem',width:'20rem',margin:'0 auto'}}>*/}
<div className='condition' > {/*<div className='condition' >*/}
<div className='condition-title' ></div> {/*<div className='condition-title' >原密码:</div>*/}
<div className='condition-text' style={{display:'inline-block',}} > {/*<div className='condition-text' style={{display:'inline-block',}} >*/}
<Input.Password maxLength='12' {/*<Input.Password maxLength='12'*/}
placeholder="输入内容" {/*placeholder="输入内容"*/}
value={oldPassWord} {/*value={oldPassWord}*/}
onChange={(e)=>{ {/*onChange={(e)=>{*/}
const strExp= /^[A-Za-z0-9]+$/; {/*const strExp= /^[A-Za-z0-9]+$/;*/}
if(strExp.test(e.target.value) || e.target.value===''){ {/*if(strExp.test(e.target.value) || e.target.value===''){*/}
setOldPassWord(e.target.value); {/*setOldPassWord(e.target.value);*/}
return true; {/*return true;*/}
}else { {/*}else {*/}
message.warning('请输入英文或者是数字!'); {/*message.warning('请输入英文或者是数字!');*/}
setOldPassWord(e.target.value.replace(/[\W]/g, '')); {/*setOldPassWord(e.target.value.replace(/[\W]/g, ''));*/}
} {/*}*/}
}} {/*}}*/}
/> {/*/>*/}
</div> {/*</div>*/}
</div> {/*</div>*/}
<div className='condition'> {/*<div className='condition'>*/}
<div className='condition-title' ></div> {/*<div className='condition-title' >新密码:</div>*/}
<div className='condition-text' style={{display:'inline-block',}} > {/*<div className='condition-text' style={{display:'inline-block',}} >*/}
<Input.Password maxLength='12' {/*<Input.Password maxLength='12'*/}
value={newPassWord} {/*value={newPassWord}*/}
placeholder="输入内容" {/*placeholder="输入内容"*/}
onChange={(e)=>{ {/*onChange={(e)=>{*/}
const strExp= /^[A-Za-z0-9]+$/; {/*const strExp= /^[A-Za-z0-9]+$/;*/}
if(strExp.test(e.target.value) || e.target.value===''){ {/*if(strExp.test(e.target.value) || e.target.value===''){*/}
setNewPassWord(e.target.value); {/*setNewPassWord(e.target.value);*/}
return true; {/*return true;*/}
}else { {/*}else {*/}
message.warning('请输入英文或者是数字!'); {/*message.warning('请输入英文或者是数字!');*/}
setNewPassWord(e.target.value.replace(/[\W]/g, '')); {/*setNewPassWord(e.target.value.replace(/[\W]/g, ''));*/}
} {/*}*/}
}} {/*}}*/}
/> {/*/>*/}
</div> {/*</div>*/}
</div> {/*</div>*/}
<div className='condition'> {/*<div className='condition'>*/}
<div className='condition-title' ></div> {/*<div className='condition-title' >确认密码:</div>*/}
<div className='condition-text' style={{display:'inline-block',}} > {/*<div className='condition-text' style={{display:'inline-block',}} >*/}
<Input.Password maxLength='12' {/*<Input.Password maxLength='12'*/}
value={secondNewPassWord} {/*value={secondNewPassWord}*/}
placeholder="输入内容" {/*placeholder="输入内容"*/}
onChange={(e)=>{ {/*onChange={(e)=>{*/}
const strExp= /^[A-Za-z0-9]+$/; {/*const strExp= /^[A-Za-z0-9]+$/;*/}
if(strExp.test(e.target.value) || e.target.value===''){ {/*if(strExp.test(e.target.value) || e.target.value===''){*/}
setSecondNewPassWord(e.target.value); {/*setSecondNewPassWord(e.target.value);*/}
return true; {/*return true;*/}
}else { {/*}else {*/}
message.warning('请输入英文或者是数字!'); {/*message.warning('请输入英文或者是数字!');*/}
setSecondNewPassWord(e.target.value.replace(/[\W]/g, '')); {/*setSecondNewPassWord(e.target.value.replace(/[\W]/g, ''));*/}
} {/*}*/}
}} {/*}}*/}
/> {/*/>*/}
</div> {/*</div>*/}
</div> {/*</div>*/}
<div className="tip">6-12</div> {/*<div className="tip">提示密码支持英文和数字长度为6-12位</div>*/}
<div style={{marginTop:'3rem',textAlign:'center'}}> {/*<div style={{marginTop:'3rem',textAlign:'center'}}>*/}
<Button type="primary" onClick={async ()=>{ {/*<Button type="primary" onClick={async ()=>{*/}
if(oldPassWord.trim()===''||newPassWord.trim()===''||secondNewPassWord.trim()===''){ {/*if(oldPassWord.trim()===''||newPassWord.trim()===''||secondNewPassWord.trim()===''){*/}
message.warning('密码不能为空!'); {/*message.warning('密码不能为空!');*/}
}else if(oldPassWord.length<6||newPassWord.length<6||secondNewPassWord.length<6){ {/*}else if(oldPassWord.length<6||newPassWord.length<6||secondNewPassWord.length<6){*/}
message.warning('密码长度不能小于6位'); {/*message.warning('密码长度不能小于6位');*/}
}else if(newPassWord!==secondNewPassWord){ {/*}else if(newPassWord!==secondNewPassWord){*/}
message.warning('两次输入的新密码不一致!'); {/*message.warning('两次输入的新密码不一致!');*/}
}else { {/*}else {*/}
showConfirm(); {/*showConfirm();*/}
} {/*}*/}
}}></Button> {/*}}>确定修改</Button>*/}
</div> {/*</div>*/}
</div> {/*</div>*/}
</TabPane> {/*</TabPane>*/}
</Tabs> </Tabs>
</div> </div>

Loading…
Cancel
Save