Compare commits

...

2 Commits

Author SHA1 Message Date
wangxi 1a35dddb05 测试bug修改
3 years ago
wangxi 12761d9ac8 测试bug修改
3 years ago

@ -250,20 +250,6 @@ const CourseList: React.FC = () => {
onRemove={()=>{ onRemove={()=>{
//createFormRef?.current?.setFieldsValue({attachment_json: ""}) //createFormRef?.current?.setFieldsValue({attachment_json: ""})
}} }}
// onChange={(info)=>{
// console.log('file',info)
// let fileList = [...info.fileList];
// fileList = fileList.slice(-2);
// // 2. Read from response and show file link
// fileList = fileList.map(file => {
// if (file.response) {
// // Component will show file.url as link
// file.url = file.response.url;
// console.log(222,fileList)
// }
// return file;
// });
// this.setState({ fileList }); // this.setState({ fileList });
// console.log(999,fileList) // console.log(999,fileList)
// }} // }}
@ -335,6 +321,10 @@ const CourseList: React.FC = () => {
key="detail" key="detail"
onClick={async() => { onClick={async() => {
const info= await viewCourse({course_id:record.course_id}); const info= await viewCourse({course_id:record.course_id});
if(info.data.attachment_json.length===undefined){
info.data.attachment_json=[info.data.attachment_json]
}
setCurrentRow(info.data); setCurrentRow(info.data);
handleDetailModalVisible(true); handleDetailModalVisible(true);
}} }}

@ -86,6 +86,7 @@ export default () => {
const formRef = useRef<ProFormInstance>(); const formRef = useRef<ProFormInstance>();
const actionRef = useRef<ActionType>(); const actionRef = useRef<ActionType>();
const actionRef1 = useRef<ActionType>();
/** 更新窗口的弹窗 */ /** 更新窗口的弹窗 */
const [createModalVisible, handleCreateModalVisible] = useState<boolean>(false); const [createModalVisible, handleCreateModalVisible] = useState<boolean>(false);
@ -97,6 +98,7 @@ export default () => {
const [subjectIntro, setSubjectIntro] = useState({}); const [subjectIntro, setSubjectIntro] = useState({});
const [subjectId, setSubjectId] = useState({}); const [subjectId, setSubjectId] = useState({});
const [list,setList] = useState({});
const [chapterList, setChapterList] = useState({}); const [chapterList, setChapterList] = useState({});
const [currentRow, setCurrentRow] = useState<TableListItem>(); const [currentRow, setCurrentRow] = useState<TableListItem>();
const formMapRef = useRef<React.MutableRefObject<ProFormInstance<any> | undefined>[]>([]); const formMapRef = useRef<React.MutableRefObject<ProFormInstance<any> | undefined>[]>([]);
@ -137,12 +139,8 @@ export default () => {
hideInForm: false, hideInForm: false,
hideInSearch: true, hideInSearch: true,
formItemProps: { formItemProps: {
rules: [ required: true,
{ message: '请填写简介',
required: true,
message: '请填写章节简介',
},
]
}, },
renderText: (val: string) => (<div dangerouslySetInnerHTML={{ __html: val }} />), renderText: (val: string) => (<div dangerouslySetInnerHTML={{ __html: val }} />),
renderFormItem: (item, { defaultRender, ...rest }, form) => ( renderFormItem: (item, { defaultRender, ...rest }, form) => (
@ -538,7 +536,7 @@ export default () => {
<ProTable<TableListItem, TableListPagination> <ProTable<TableListItem, TableListPagination>
headerTitle={false} headerTitle={false}
actionRef={actionRef} actionRef={actionRef}
rowKey="chapter_id" rowKey="chapter_id1"
options={false} options={false}
search={false} search={false}
params={subjectIntro} params={subjectIntro}
@ -588,6 +586,13 @@ export default () => {
item.course_ids = item.course_ids.map(a => a * 1); item.course_ids = item.course_ids.map(a => a * 1);
}) })
} }
setList({
current: data?.page_number,
data: data?.list,
pageSize: data?.page_size,
success: true,
total: data?.total_row || 0,
})
return { return {
current: data?.page_number, current: data?.page_number,
data: data?.list, data: data?.list,
@ -619,7 +624,7 @@ export default () => {
onFinish={async (values: any) => { onFinish={async (values: any) => {
// 表单处理 // 表单处理
// console.log('columns:', columns); // console.log('columns:', columns);
// console.log('values:新建', values); console.log('values:新建', values);
const success = await handleAddChapter({ const success = await handleAddChapter({
...values, ...values,
subject_id:subjectId, subject_id:subjectId,
@ -661,17 +666,21 @@ export default () => {
labelCol={{ span: 8 }} labelCol={{ span: 8 }}
wrapperCol={{ span: 12 }} wrapperCol={{ span: 12 }}
onFinish={async (values) => { onFinish={async (values) => {
// console.log('values编辑', values) console.log('values编辑', values)
// console.log('currentRow', currentRow) // console.log('currentRow', currentRow)
const success = await handleUpdateChapter({
...values, const success = await handleUpdateChapter({
subject_id: subjectId, ...values,
chapter_id: currentRow.chapter_id subject_id: subjectId,
}); chapter_id: currentRow.chapter_id
if (success) { });
handleUpdateModalVisible(false);
actionRef.current?.reloadAndRest?.(); if (success) {
} handleUpdateModalVisible(false);
actionRef.current?.reloadAndRest?.();
}
}} }}
submitter={{ submitter={{
render: (props, doms) => ( render: (props, doms) => (
@ -704,22 +713,78 @@ export default () => {
return true; return true;
}} }}
> >
<ProDescriptions
layout='horizontal'
column={1}
//actionRef={actionRef}
title="主题信息"
/*
request={async () => {
// console.log('step2 主题信息')
return Promise.resolve({
success: true,
data: { id: '这是一段文本', object: '', date: '2020-07-30 08:00', duration: '', grade: 100, through: '>60', learn: '>20 min', times: 2 },
});
}}*/
extra={false}
>
<ProDescriptions.Item dataIndex="subject_id" hideInDescriptions />
<ProDescriptions.Item dataIndex="subject_name" label="主题名称" valueType="text">{subjectIntro?.subject_name}</ProDescriptions.Item>
<ProDescriptions.Item dataIndex="subject_describe" label="主题介绍" valueType="text" maxLength="2">
<div dangerouslySetInnerHTML={{ __html: subjectIntro?.subject_describe }} />
</ProDescriptions.Item>
</ProDescriptions>
<ProTable<TableListItem, TableListPagination>
headerTitle={false}
actionRef={actionRef1}
rowKey="chapter_id"
options={false}
search={false}
// params={subjectIntro}
toolBarRender={null}
request={async (value) => {
console.log('sssssssss',value)
const { data } = await queryListChapterBySubject({
subject_id: subjectIntro.subject_id,
page_number: value?.current || 1,
page_size: value?.pageSize,
});
if (data.list.length !== 0) {
data.list.forEach((i) => {
i.course_ids = i.course_ids.split(',')
i.course_names = i.course_names.split(',');
if(i.tag_ids&&i.tag_ids!==null){
i.tag_ids = i.tag_ids.split(',')
}
if( i.tag_names){
i.tag_names = i.tag_names.split(',')
}
<Row gutter={24}> })
<Col lg={12} md={12} sm={12} offset={6}>
<Result }
className={styles.registerResult} if (data.list.length !== 0) {
status="success" data.list.forEach((item) => {
title={ if(item.tag_ids&&item.tag_ids!==null){
<div className={styles.title}> item.tag_ids = item.tag_ids.map(i => i * 1);
<span style={{ color: '#1890ff' }}>{subjectIntro?.subject_name} </span>/
</div>
} }
subTitle="点击提交将设置为发布状态。"
//extra={actions} item.course_ids = item.course_ids.map(a => a * 1);
/> })
</Col> }
</Row>
return {
current: data?.page_number,
data: data?.list,
pageSize: data?.page_size,
success: true,
total: data?.total_row || 0,
};
}}
dataSource={list.data}
columns={columns}
rowSelection={false}
/>
</StepsForm.StepForm> </StepsForm.StepForm>
</StepsForm> </StepsForm>
</ProCard> </ProCard>

@ -5,7 +5,7 @@ import { ModalForm } from '@ant-design/pro-form';
import { ProFormRadio } from '@ant-design/pro-form'; import { ProFormRadio } from '@ant-design/pro-form';
import ProForm, { StepsForm, ProFormText, ProFormSelect, ProFormDateRangePicker,ProFormDigit } from '@ant-design/pro-form'; import ProForm, { StepsForm, ProFormText, ProFormSelect, ProFormDateRangePicker,ProFormDigit } from '@ant-design/pro-form';
import ProCard from '@ant-design/pro-card'; import ProCard from '@ant-design/pro-card';
import { Button, Checkbox, Col, Divider, Input, List, Menu, message, Radio, Row, Space, Typography } from 'antd'; import { Button, Checkbox, Col, Divider, Input, List, Menu, message, Radio, Row, Space, Typography,Popconfirm } from 'antd';
import { PageContainer } from '@ant-design/pro-layout'; import { PageContainer } from '@ant-design/pro-layout';
import ProDescriptions from '@ant-design/pro-descriptions'; import ProDescriptions from '@ant-design/pro-descriptions';
import styles from './index.less' import styles from './index.less'
@ -521,16 +521,42 @@ export default () => {
search={false} search={false}
toolBarRender={() => ( toolBarRender={() => (
<Space style={{ margin: -48 }} > <Space style={{ margin: -48 }} >
{questionList&&questionList.length!==0?
<Popconfirm
title="重新组卷后,原有组卷信息会被清空,是否继续?"
// visible={visible}
onConfirm={()=>{
handleAutoModalVisible(true)
}}
onCancel={()=>{}}
okText="是"
cancelText="否"
>
<Button <Button
type="primary" type="primary"
key="primary" key="primary"
onClick={() => { onClick={() => {
handleAutoModalVisible(true) // handleAutoModalVisible(true)
}} }}
style={{ marginRight: 5 }} style={{ marginRight: 5 }}
> >
<PlusOutlined /> <PlusOutlined />
</Button> </Button>
</Popconfirm>
:
<Button
type="primary"
key="primary"
onClick={() => {
handleAutoModalVisible(true)
}}
style={{ marginRight: 5 }}
>
<PlusOutlined />
</Button>
}
<Button <Button
type="primary" type="primary"
key="primary" key="primary"

@ -54,8 +54,17 @@ const CardList = () => {
console.log('result9999',result); console.log('result9999',result);
let info={img:'',url:''}; let info={img:'',url:''};
if(JSON.stringify(result.course.attachment_json.url)!=='{}'){ if(JSON.stringify(result.course.attachment_json.url)!=='{}'){
info.url= '/dsideal_yy/html/'+result.course.attachment_json.url; console.log('1111s')
info.img=result.course.attachment_json.img; if(result.course.attachment_json.length!==undefined){
info.url= '/dsideal_yy/html/'+result.course.attachment_json[0].url;
info.img=result.course.attachment_json[0].img;
}else {
info.url= '/dsideal_yy/html/'+result.course.attachment_json.url;
info.img=result.course.attachment_json.img;
}
}else {
console.log(2222)
} }
setVideo(info); setVideo(info);
@ -113,38 +122,7 @@ const CardList = () => {
},[learning]); },[learning]);
//
const content = (
<div className={styles.pageHeaderContent}>
<Card
title={<a>{'生涯规划师初级认证培训课程你收到了 14 份新周报'}</a>}
hoverable={false}
className={styles.card}
actions={[]}
extra={<><span style={{padding:10}}>: 2020-4-9</span><span style={{padding:10}}>300</span><span style={{padding:10}}>36</span></>}
>
<Card.Meta
avatar={<img alt="" className={styles.cardAvatar} src={'https://gw.alipayobjects.com/zos/rmsportal/uMfMFlvUuceEyPpotzlq.png'} style={{width:'270px', height:'150px', borderRadius:'10px'}} />}
title={false}
description={
<>
<Card.Grid hoverable={false} style={{width:'100%',padding:0, boxShadow:'none'}}>
<Paragraph className={styles.item} ellipsis={{ rows: 4 }} style={{paddingLeft:10}}>
{'请大家在规定时间内完成本培训任务安排,逾期本培训任务将自动关闭。祝大家学习愉快!请大家在规定时间内完成本培训任务安排,逾期本培训任务将自动关闭。祝大家学习愉快!这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像'}
</Paragraph>
<Row>
<Col span={16} style={{display:'inline-block', padding:10}}><span></span><span style={{display:'inline-block', width:'80%'}}><Progress percent={75} /></span></Col>
</Row>
<Row>
<Col span={10} style={{padding:10}}><span></span><span></span></Col> <Col span={10} style={{padding:10}}><span></span></Col> <Col span={4} style={{padding:10}}><Button type="primary"></Button></Col>
</Row>
</Card.Grid>
</>
}
/>
</Card>
</div>
);
//const videoInfo = {url:'http://cctvalih5ca.v.myalicdn.com/live/cctv1_2/index.m3u8', img:''} //const videoInfo = {url:'http://cctvalih5ca.v.myalicdn.com/live/cctv1_2/index.m3u8', img:''}
//const videoInfo = {url:'https://media.w3.org/2010/05/sintel/trailer_hd.mp4', img:''} //const videoInfo = {url:'https://media.w3.org/2010/05/sintel/trailer_hd.mp4', img:''}
const videoInfo = {url:'http://10.10.14.199/dsideal_yy/html/down/M3u8/2D/2D99BF1D-2F37-47FB-8A24-45112A236B8F.m3u8', img:''}//有视频 const videoInfo = {url:'http://10.10.14.199/dsideal_yy/html/down/M3u8/2D/2D99BF1D-2F37-47FB-8A24-45112A236B8F.m3u8', img:''}//有视频
@ -161,6 +139,7 @@ const CardList = () => {
// content={content} // content={content}
extraContent={false}> extraContent={false}>
<Row> <Row>
{console.log('redddd')}
<Col span={6} style={{paddingRight:24}}> <Col span={6} style={{paddingRight:24}}>
<Menu <Menu
mode="inline" mode="inline"
@ -190,7 +169,7 @@ const CardList = () => {
{ {
video?.url&&( video?.url&&(
<VideoJS <VideoJS
style={{width:640,height:480}} style={{width:640,height:400}}
width='100%' width='100%'
height='480px' height='480px'
options={{ options={{
@ -241,10 +220,10 @@ const CardList = () => {
saveProcess({time:play.currentTime(),num:num}) saveProcess({time:play.currentTime(),num:num})
} }
// console.log('playcurrentTime--', play.currentTime()) console.log('playcurrentTime--', Math.floor(play.currentTime()))
// console.log('play-%-', parseInt(play.currentTime()) % 30) // console.log('play-%-', parseInt(play.currentTime()) % 30)
if (parseInt(play.currentTime())>0&&parseInt(play.currentTime()) % 30 === 0) { // 每15秒更新进度 if (parseInt(play.currentTime())>0&&parseInt(play.currentTime()) % 30 === 0) { // 每15秒更新进度
console.log(1) console.log(11111111111)
saveProcess({time:play.currentTime(),num:30}) saveProcess({time:play.currentTime(),num:30})
} }
//var currentTime = parseInt(this.currentTime()); //当前时间 //var currentTime = parseInt(this.currentTime()); //当前时间
@ -278,5 +257,4 @@ const CardList = () => {
</PageContainer> </PageContainer>
); );
}; };
export default CardList; export default CardList;

Loading…
Cancel
Save