forked from Open-CT/OpenPBL
style: reformat code
This commit is contained in:
parent
050d87eca9
commit
b4bb1a6d8d
|
@ -52,11 +52,11 @@ function InfoEditPage(obj) {
|
|||
|
||||
const loadSubjectsAndSkills = () => {
|
||||
ProjectApi.getSubjectsAndSkills(pid)
|
||||
.then(res=>{
|
||||
.then(res => {
|
||||
if (res.data.code === 200) {
|
||||
if (res.data.subjects !== null) {
|
||||
let s = res.data.subjects
|
||||
for (let i=0; i<iniSubjects.length; i++) {
|
||||
for (let i = 0; i < iniSubjects.length; i++) {
|
||||
if (s.indexOf(iniSubjects[i]) < 0) {
|
||||
s.push(iniSubjects[i])
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ function InfoEditPage(obj) {
|
|||
}
|
||||
if (res.data.skills !== null) {
|
||||
let s = res.data.skills
|
||||
for (let i=0; i<iniSkills.length; i++) {
|
||||
for (let i = 0; i < iniSkills.length; i++) {
|
||||
if (s.indexOf(iniSkills[i]) < 0) {
|
||||
s.push(iniSkills[i])
|
||||
}
|
||||
|
@ -74,7 +74,9 @@ function InfoEditPage(obj) {
|
|||
}
|
||||
}
|
||||
})
|
||||
.catch(e=>{console.log(e)})
|
||||
.catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
|
||||
const changeTitle = value => {
|
||||
|
|
|
@ -339,7 +339,8 @@ function OutlineEditPage(obj) {
|
|||
</Link>
|
||||
</div>
|
||||
|
||||
<Modal title="" visible={chapterModalVisible} onOk={doChapter} confirmLoading={btLoading} onCancel={cancelDoChapter}>
|
||||
<Modal title="" visible={chapterModalVisible} onOk={doChapter} confirmLoading={btLoading}
|
||||
onCancel={cancelDoChapter}>
|
||||
<br/>
|
||||
<Row>
|
||||
<Col span={3}>
|
||||
|
|
|
@ -1,27 +1,11 @@
|
|||
import React, {useEffect, useState} from "react";
|
||||
import {
|
||||
Button,
|
||||
Row,
|
||||
Divider,
|
||||
Input,
|
||||
InputNumber,
|
||||
List,
|
||||
message,
|
||||
Progress,
|
||||
Tooltip,
|
||||
Upload,
|
||||
Radio,
|
||||
Checkbox, Collapse
|
||||
} from "antd";
|
||||
import {Button, Checkbox, Divider, List, Radio} from "antd";
|
||||
|
||||
import TaskApi from "../../../../api/TaskApi";
|
||||
import ChapterApi from "../../../../api/ChapterApi";
|
||||
import util from "../../../component/Util"
|
||||
import htmlDocx from 'html-docx-js/dist/html-docx';
|
||||
import saveAs from 'file-saver';
|
||||
import {InboxOutlined} from "@ant-design/icons";
|
||||
import FillSurvey from "../../PreviewProject/component/FillSurvey";
|
||||
import ReactEcharts from "echarts-for-react";
|
||||
import Question from "../../CreateProject/Survey/component/Question";
|
||||
|
||||
const blank = Question.blank
|
||||
|
@ -41,7 +25,7 @@ function StudentEvidenceContent(obj) {
|
|||
useEffect(() => {
|
||||
getChapters()
|
||||
getTasks()
|
||||
setTimeout(()=>{
|
||||
setTimeout(() => {
|
||||
saveFile()
|
||||
}, 500)
|
||||
}, []);
|
||||
|
@ -107,7 +91,7 @@ function StudentEvidenceContent(obj) {
|
|||
}
|
||||
const getPercent = (item) => {
|
||||
let p = ((item.learnMinute + item.learnSecond / 60) / item.sectionMinute * 100).toFixed(1)
|
||||
if (p > 100){
|
||||
if (p > 100) {
|
||||
return 100
|
||||
}
|
||||
return p
|
||||
|
@ -124,37 +108,37 @@ function StudentEvidenceContent(obj) {
|
|||
<div style={{float: 'right'}}><Button onClick={saveFile}>保存</Button></div>
|
||||
|
||||
<div id="evidence">
|
||||
<h2>一、章节学习时长</h2>
|
||||
{chapters.map((item, index) => (
|
||||
<div key={index.toString()} style={{textAlign: 'left'}}>
|
||||
<p style={{fontWeight: 'bold', fontSize: '16px'}}>
|
||||
{util.FormatChapterName(item.chapterName, item.chapterNumber)}
|
||||
</p>
|
||||
{(item.sections === null || item.sections === undefined) ?
|
||||
null
|
||||
:
|
||||
<>
|
||||
<List
|
||||
size="large"
|
||||
dataSource={item.sections}
|
||||
locale={{emptyText: '--'}}
|
||||
renderItem={
|
||||
item => (
|
||||
<List.Item>
|
||||
<p>{util.FormatSectionName(item.sectionName, item.chapterNumber, item.sectionNumber)}</p>
|
||||
要求学习时长:{item.sectionMinute}分钟,
|
||||
学生学习时长:{item.learnMinute}分{item.learnSecond}秒,
|
||||
学习进度:{getPercent(item)}%
|
||||
</List.Item>
|
||||
)
|
||||
}
|
||||
/><br/>
|
||||
</>
|
||||
}
|
||||
</div>
|
||||
))}
|
||||
<h2>一、章节学习时长</h2>
|
||||
{chapters.map((item, index) => (
|
||||
<div key={index.toString()} style={{textAlign: 'left'}}>
|
||||
<p style={{fontWeight: 'bold', fontSize: '16px'}}>
|
||||
{util.FormatChapterName(item.chapterName, item.chapterNumber)}
|
||||
</p>
|
||||
{(item.sections === null || item.sections === undefined) ?
|
||||
null
|
||||
:
|
||||
<>
|
||||
<List
|
||||
size="large"
|
||||
dataSource={item.sections}
|
||||
locale={{emptyText: '--'}}
|
||||
renderItem={
|
||||
item => (
|
||||
<List.Item>
|
||||
<p>{util.FormatSectionName(item.sectionName, item.chapterNumber, item.sectionNumber)}</p>
|
||||
要求学习时长:{item.sectionMinute}分钟,
|
||||
学生学习时长:{item.learnMinute}分{item.learnSecond}秒,
|
||||
学习进度:{getPercent(item)}%
|
||||
</List.Item>
|
||||
)
|
||||
}
|
||||
/><br/>
|
||||
</>
|
||||
}
|
||||
</div>
|
||||
))}
|
||||
|
||||
<h2>二、学生任务</h2>
|
||||
<h2>二、学生任务</h2>
|
||||
|
||||
<List
|
||||
size="large"
|
||||
|
@ -165,7 +149,8 @@ function StudentEvidenceContent(obj) {
|
|||
<List.Item>
|
||||
<div style={{textAlign: 'left'}}>
|
||||
<div>
|
||||
<p style={{fontWeight: 'bold'}}>{util.FormatSectionName(item.taskTitle, item.chapterNumber, item.sectionNumber)}</p>
|
||||
<p
|
||||
style={{fontWeight: 'bold'}}>{util.FormatSectionName(item.taskTitle, item.chapterNumber, item.sectionNumber)}</p>
|
||||
{item.submitted ?
|
||||
<span style={{color: 'green'}}>已提交</span>
|
||||
:
|
||||
|
@ -268,7 +253,7 @@ function StudentEvidenceContent(obj) {
|
|||
)
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1,7 +1,14 @@
|
|||
import React from 'react';
|
||||
import DocumentTitle from 'react-document-title';
|
||||
import {Link, Redirect, Route, Switch} from 'react-router-dom'
|
||||
import {CheckCircleOutlined, CheckOutlined, CopyOutlined, HighlightOutlined, SyncOutlined, StarFilled} from "@ant-design/icons";
|
||||
import {
|
||||
CheckCircleOutlined,
|
||||
CheckOutlined,
|
||||
CopyOutlined,
|
||||
HighlightOutlined,
|
||||
StarFilled,
|
||||
SyncOutlined
|
||||
} from "@ant-design/icons";
|
||||
|
||||
import PublishedProject from "../PublishedProject";
|
||||
import EditingProject from "../EditingProject";
|
||||
|
@ -21,7 +28,7 @@ class MyProject extends React.PureComponent {
|
|||
}
|
||||
|
||||
changeMenu = (e) => {
|
||||
if (e !== undefined ) {
|
||||
if (e !== undefined) {
|
||||
this.setState({menu: e.key})
|
||||
return
|
||||
}
|
||||
|
@ -68,7 +75,7 @@ class MyProject extends React.PureComponent {
|
|||
defaultSelectedKeys={['published']}
|
||||
className="menu-bar"
|
||||
selectedKeys={[menu]}
|
||||
onClick={e=>this.changeMenu(e)}
|
||||
onClick={e => this.changeMenu(e)}
|
||||
mode="inline"
|
||||
>
|
||||
<Menu.Item key="published" icon={<CheckCircleOutlined/>}>
|
||||
|
@ -86,7 +93,7 @@ class MyProject extends React.PureComponent {
|
|||
已结束
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="favourite" icon={<StarFilled />}>
|
||||
<Menu.Item key="favourite" icon={<StarFilled/>}>
|
||||
<Link to="/home/my-project/favourite">
|
||||
收藏夹
|
||||
</Link>
|
||||
|
@ -97,7 +104,7 @@ class MyProject extends React.PureComponent {
|
|||
defaultSelectedKeys={['learning']}
|
||||
className="menu-bar"
|
||||
selectedKeys={[menu]}
|
||||
onClick={e=>this.changeMenu(e)}
|
||||
onClick={e => this.changeMenu(e)}
|
||||
mode="inline"
|
||||
>
|
||||
<Menu.Item key="learning" icon={<SyncOutlined/>}>
|
||||
|
@ -110,7 +117,7 @@ class MyProject extends React.PureComponent {
|
|||
已完成
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="favourite" icon={<StarFilled />}>
|
||||
<Menu.Item key="favourite" icon={<StarFilled/>}>
|
||||
<Link to="/home/my-project/favourite">
|
||||
收藏夹
|
||||
</Link>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, {useEffect, useState} from "react";
|
||||
import React from "react";
|
||||
import {BackTop, Card, PageHeader} from "antd";
|
||||
import DocumentTitle from 'react-document-title';
|
||||
|
||||
|
@ -29,10 +29,12 @@ class PreviewSection extends React.Component {
|
|||
second: 0,
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.getSectionDetail()
|
||||
this.getTasks()
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
if (this.state.learning) {
|
||||
if (this.state.timer != null) {
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import React, {useEffect, useState} from 'react';
|
||||
import {Avatar, Button, Comment, Form, Input, Pagination, message, Tooltip, Popconfirm, Switch} from 'antd';
|
||||
import {Avatar, Button, Comment, Form, Input, message, Pagination, Popconfirm, Switch, Tooltip} from 'antd';
|
||||
import {DeleteOutlined} from "@ant-design/icons"
|
||||
import QueueAnim from 'rc-queue-anim';
|
||||
|
||||
import CommentApi from "../../../../api/CommentApi"
|
||||
import util from "../../../component/Util"
|
||||
|
||||
const {TextArea} = Input;
|
||||
|
||||
|
||||
|
@ -21,13 +22,13 @@ function ProjectComment(obj) {
|
|||
|
||||
const updateCommentList = (p, size, isTeacher) => {
|
||||
let query = {
|
||||
from: (p-1)*size,
|
||||
from: (p - 1) * size,
|
||||
size: size,
|
||||
text: '',
|
||||
isTeacher: isTeacher,
|
||||
}
|
||||
CommentApi.getProjectComments(obj.project.id, query)
|
||||
.then(res=>{
|
||||
.then(res => {
|
||||
if (res.data.code === 200) {
|
||||
if (res.data.comments !== null) {
|
||||
setCommentList(res.data.comments)
|
||||
|
@ -35,7 +36,9 @@ function ProjectComment(obj) {
|
|||
}
|
||||
}
|
||||
})
|
||||
.catch(e=>{console.log(e)})
|
||||
.catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
|
||||
setPage(p);
|
||||
};
|
||||
|
@ -50,11 +53,11 @@ function ProjectComment(obj) {
|
|||
}
|
||||
setSubmitting(true);
|
||||
let c = {
|
||||
content: value,
|
||||
content: value,
|
||||
projectId: obj.project.id,
|
||||
}
|
||||
CommentApi.createComment(obj.project.id, c)
|
||||
.then(res=>{
|
||||
.then(res => {
|
||||
setSubmitting(false);
|
||||
if (res.data.code === 200) {
|
||||
message.success(res.data.msg)
|
||||
|
@ -64,11 +67,13 @@ function ProjectComment(obj) {
|
|||
message.error(res.data.msg)
|
||||
}
|
||||
})
|
||||
.catch(e=>{console.log(e)})
|
||||
.catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
};
|
||||
const deleteComment = (item) => {
|
||||
CommentApi.deleteComment(obj.project.id, item.id)
|
||||
.then(res=>{
|
||||
.then(res => {
|
||||
if (res.data.code === 200) {
|
||||
message.success(res.data.msg)
|
||||
updateCommentList(page, pageSize, isTeacher)
|
||||
|
@ -76,7 +81,9 @@ function ProjectComment(obj) {
|
|||
message.error(res.data.msg)
|
||||
}
|
||||
})
|
||||
.catch(e=>{console.log(e)})
|
||||
.catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
|
||||
const onChange = (v) => {
|
||||
|
@ -120,8 +127,8 @@ function ProjectComment(obj) {
|
|||
</>,
|
||||
<>
|
||||
{obj.account.name === item.userId ?
|
||||
<Popconfirm title="确定删除留言?" onConfirm={e=>deleteComment(item)}>
|
||||
<Button type="text" shape="circle" icon={<DeleteOutlined />} />
|
||||
<Popconfirm title="确定删除留言?" onConfirm={e => deleteComment(item)}>
|
||||
<Button type="text" shape="circle" icon={<DeleteOutlined/>}/>
|
||||
</Popconfirm>
|
||||
: null
|
||||
}
|
||||
|
|
|
@ -13,7 +13,8 @@ import {
|
|||
PageHeader,
|
||||
Popconfirm,
|
||||
Row,
|
||||
Tag, Tooltip
|
||||
Tag,
|
||||
Tooltip
|
||||
} from 'antd';
|
||||
import QueueAnim from 'rc-queue-anim';
|
||||
import {Link} from 'react-router-dom';
|
||||
|
@ -221,7 +222,7 @@ class ProjectInfo extends React.PureComponent {
|
|||
favBtLoading: true
|
||||
})
|
||||
ProjectApi.addFavourite(this.state.pid)
|
||||
.then(res=>{
|
||||
.then(res => {
|
||||
this.setState({
|
||||
favBtLoading: false
|
||||
})
|
||||
|
@ -232,14 +233,16 @@ class ProjectInfo extends React.PureComponent {
|
|||
message.error(res.data.msg)
|
||||
}
|
||||
})
|
||||
.catch(e=>{console.log(e)})
|
||||
.catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
removeFavourite = e => {
|
||||
this.setState({
|
||||
favBtLoading: true
|
||||
})
|
||||
ProjectApi.removeFavourite(this.state.pid)
|
||||
.then(res=>{
|
||||
.then(res => {
|
||||
this.setState({
|
||||
favBtLoading: false
|
||||
})
|
||||
|
@ -250,7 +253,9 @@ class ProjectInfo extends React.PureComponent {
|
|||
message.error(res.data.msg)
|
||||
}
|
||||
})
|
||||
.catch(e=>{console.log(e)})
|
||||
.catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
|
||||
setProject = project => {
|
||||
|
@ -274,7 +279,7 @@ class ProjectInfo extends React.PureComponent {
|
|||
cloneBtLoading: true
|
||||
})
|
||||
ProjectApi.cloneProject(this.state.pid)
|
||||
.then(res=>{
|
||||
.then(res => {
|
||||
this.setState({
|
||||
cloneBtLoading: false
|
||||
})
|
||||
|
@ -284,11 +289,25 @@ class ProjectInfo extends React.PureComponent {
|
|||
message.error(res.data.msg)
|
||||
}
|
||||
})
|
||||
.catch(e=>{console.log(e)})
|
||||
.catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
const {project, teacher, menu, pid, lastLearn, favBtLoading, learnBtLoading, exitBtLoading, closeBtLoading, cloneBtLoading, deleteBtLoading} = this.state;
|
||||
const {
|
||||
project,
|
||||
teacher,
|
||||
menu,
|
||||
pid,
|
||||
lastLearn,
|
||||
favBtLoading,
|
||||
learnBtLoading,
|
||||
exitBtLoading,
|
||||
closeBtLoading,
|
||||
cloneBtLoading,
|
||||
deleteBtLoading
|
||||
} = this.state;
|
||||
|
||||
const teacherBt = (
|
||||
<div style={{float: 'right'}}>
|
||||
|
@ -519,11 +538,13 @@ class ProjectInfo extends React.PureComponent {
|
|||
<span style={{float: 'right'}}>
|
||||
{project.favourite ?
|
||||
<Tooltip title="点击取消收藏">
|
||||
<Button shape="circle" type="text" loading={favBtLoading} icon={<StarFilled/>} onClick={this.removeFavourite}/>
|
||||
<Button shape="circle" type="text" loading={favBtLoading} icon={<StarFilled/>}
|
||||
onClick={this.removeFavourite}/>
|
||||
</Tooltip>
|
||||
:
|
||||
<Tooltip title="点击收藏">
|
||||
<Button shape="circle" type="text" loading={favBtLoading} icon={<StarOutlined/>} onClick={this.addFavourite}/>
|
||||
<Button shape="circle" type="text" loading={favBtLoading} icon={<StarOutlined/>}
|
||||
onClick={this.addFavourite}/>
|
||||
</Tooltip>
|
||||
}
|
||||
</span>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, {useEffect, useState} from 'react';
|
||||
import {Card, Col, Divider, Empty, Image, Input, Pagination, Row, Select, Spin, Tag} from 'antd';
|
||||
import {Card, Col, Divider, Image, Input, Pagination, Row, Select, Spin, Tag} from 'antd';
|
||||
import {EyeOutlined, TeamOutlined} from '@ant-design/icons';
|
||||
|
||||
import './project-list.less';
|
||||
|
@ -47,7 +47,7 @@ function ProjectList(obj) {
|
|||
const updateProjectList = (p, size, subject, skill, text) => {
|
||||
setLoadProjects(true)
|
||||
let q = {
|
||||
from: (p - 1)*size,
|
||||
from: (p - 1) * size,
|
||||
size: size,
|
||||
orderBy: 'create_at',
|
||||
orderType: 'desc',
|
||||
|
@ -78,11 +78,11 @@ function ProjectList(obj) {
|
|||
|
||||
const loadSubjectsAndSkills = () => {
|
||||
ProjectApi.getSubjectsAndSkills(obj.pid)
|
||||
.then(res=>{
|
||||
.then(res => {
|
||||
if (res.data.code === 200) {
|
||||
if (res.data.subjects !== null) {
|
||||
let s = res.data.subjects
|
||||
for (let i=0; i<iniSubjects.length; i++) {
|
||||
for (let i = 0; i < iniSubjects.length; i++) {
|
||||
if (s.indexOf(iniSubjects[i]) < 0) {
|
||||
s.push(iniSubjects[i])
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ function ProjectList(obj) {
|
|||
}
|
||||
if (res.data.skills !== null) {
|
||||
let s = res.data.skills
|
||||
for (let i=0; i<iniSkills.length; i++) {
|
||||
for (let i = 0; i < iniSkills.length; i++) {
|
||||
if (s.indexOf(iniSkills[i]) < 0) {
|
||||
s.push(iniSkills[i])
|
||||
}
|
||||
|
@ -100,7 +100,9 @@ function ProjectList(obj) {
|
|||
}
|
||||
}
|
||||
})
|
||||
.catch(e=>{console.log(e)})
|
||||
.catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
|
||||
const handleSubjectsChange = selected => {
|
||||
|
@ -180,74 +182,74 @@ function ProjectList(obj) {
|
|||
</Card>
|
||||
|
||||
<div style={{marginTop: '10px', textAlign: 'center'}}>
|
||||
<Spin spinning={loadProjects} />
|
||||
<Spin spinning={loadProjects}/>
|
||||
<Row gutter={[20, 20]} style={{textAlign: 'left'}}>
|
||||
{
|
||||
learningProjectList.map((item, index) => (
|
||||
<Col key={index.toString()} {...topColResponsiveProps}>
|
||||
<Card
|
||||
hoverable
|
||||
bordered={false}
|
||||
onClick={e=>viewProject(item)}
|
||||
style={{
|
||||
borderRadius: '10px',
|
||||
}}
|
||||
cover={
|
||||
<Image
|
||||
src={item.image}
|
||||
preview={false}
|
||||
style={{
|
||||
borderTopLeftRadius: '10px',
|
||||
borderTopRightRadius: '10px',
|
||||
}}
|
||||
fallback={"https://cdn.open-ct.com/task-resources//openpbl-empty-project.png"}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Meta
|
||||
title={
|
||||
item.projectTitle === '' ? "无": item.projectTitle
|
||||
}
|
||||
description={
|
||||
<div>
|
||||
<span className="des-text">{item.subjects === '' ? '--' : item.subjects}</span>
|
||||
{item.learning ?
|
||||
<Tag color="geekblue" style={{zIndex: '999', float: 'right'}}>学习中</Tag> : null}
|
||||
{item.teacherId === uid && type === 'teacher' ?
|
||||
<Tag color="geekblue" style={{zIndex: '999', float: 'right'}}>我的项目</Tag> : null}
|
||||
</div>
|
||||
}
|
||||
<Card
|
||||
hoverable
|
||||
bordered={false}
|
||||
onClick={e => viewProject(item)}
|
||||
style={{
|
||||
borderRadius: '10px',
|
||||
}}
|
||||
cover={
|
||||
<Image
|
||||
src={item.image}
|
||||
preview={false}
|
||||
style={{
|
||||
borderTopLeftRadius: '10px',
|
||||
borderTopRightRadius: '10px',
|
||||
}}
|
||||
fallback={"https://cdn.open-ct.com/task-resources//openpbl-empty-project.png"}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Meta
|
||||
title={
|
||||
item.projectTitle === '' ? "无" : item.projectTitle
|
||||
}
|
||||
description={
|
||||
<div>
|
||||
<span className="des-text">{item.subjects === '' ? '--' : item.subjects}</span>
|
||||
{item.learning ?
|
||||
<Tag color="geekblue" style={{zIndex: '999', float: 'right'}}>学习中</Tag> : null}
|
||||
{item.teacherId === uid && type === 'teacher' ?
|
||||
<Tag color="geekblue" style={{zIndex: '999', float: 'right'}}>我的项目</Tag> : null}
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
|
||||
<span
|
||||
style={{
|
||||
color: 'gray',
|
||||
fontSize: 'small',
|
||||
}}
|
||||
>
|
||||
<span
|
||||
style={{
|
||||
color: 'gray',
|
||||
fontSize: 'small',
|
||||
}}
|
||||
>
|
||||
<EyeOutlined/>
|
||||
{item.readNum}
|
||||
{item.readNum}
|
||||
</span>
|
||||
<Divider type="vertical"/>
|
||||
<span
|
||||
style={{
|
||||
color: 'gray',
|
||||
fontSize: 'small',
|
||||
}}
|
||||
>
|
||||
<Divider type="vertical"/>
|
||||
<span
|
||||
style={{
|
||||
color: 'gray',
|
||||
fontSize: 'small',
|
||||
}}
|
||||
>
|
||||
<TeamOutlined/>
|
||||
{item.joinNum}
|
||||
{item.joinNum}
|
||||
</span>
|
||||
<span
|
||||
style={{
|
||||
color: 'gray',
|
||||
fontSize: 'small',
|
||||
float: 'right',
|
||||
}}
|
||||
>
|
||||
<span
|
||||
style={{
|
||||
color: 'gray',
|
||||
fontSize: 'small',
|
||||
float: 'right',
|
||||
}}
|
||||
>
|
||||
{util.FilterMoment(item.createAt)}
|
||||
</span>
|
||||
</Card>
|
||||
</Card>
|
||||
</Col>
|
||||
))
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React from "react";
|
||||
import {Avatar, Badge, Button, Col, Dropdown, Layout, Menu, Row, Tag, Image, message} from "antd";
|
||||
import {Avatar, Badge, Button, Col, Dropdown, Image, Layout, Menu, message, Row, Tag} from "antd";
|
||||
import {Link, Redirect, Route, Switch} from "react-router-dom";
|
||||
import {BellOutlined, LogoutOutlined, SettingOutlined} from '@ant-design/icons';
|
||||
|
||||
|
@ -35,13 +35,15 @@ class HeaderLayout extends React.Component {
|
|||
account: res.data.data
|
||||
})
|
||||
})
|
||||
.catch((e) => {console.log(e)})
|
||||
.catch((e) => {
|
||||
console.log(e)
|
||||
})
|
||||
|
||||
this.changeMenu()
|
||||
}
|
||||
|
||||
changeMenu = (e) => {
|
||||
if (e !== undefined ) {
|
||||
if (e !== undefined) {
|
||||
this.setState({menu: e.key})
|
||||
return
|
||||
}
|
||||
|
@ -60,7 +62,7 @@ class HeaderLayout extends React.Component {
|
|||
|
||||
if (this.state.account === null) {
|
||||
message.warn('请先登录')
|
||||
return <Redirect to={'/home'} />
|
||||
return <Redirect to={'/home'}/>
|
||||
} else if (this.state.account === undefined) {
|
||||
return null
|
||||
} else {
|
||||
|
@ -82,7 +84,9 @@ class HeaderLayout extends React.Component {
|
|||
window.location.href = '/'
|
||||
}
|
||||
})
|
||||
.catch(e => {console.log(e)})
|
||||
.catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -146,7 +150,7 @@ class HeaderLayout extends React.Component {
|
|||
style={{border: 0}}
|
||||
defaultSelectedKeys={['home']}
|
||||
selectedKeys={[menu]}
|
||||
onClick={e=>this.changeMenu(e)}
|
||||
onClick={e => this.changeMenu(e)}
|
||||
>
|
||||
<Menu.Item key="home">
|
||||
<Link to="/home">
|
||||
|
@ -190,20 +194,34 @@ class HeaderLayout extends React.Component {
|
|||
</Layout.Header>
|
||||
<Layout.Content>
|
||||
<Switch>
|
||||
<Route exact path="/home" render={(props)=><Home account={this.state.account} {...props} />}/>
|
||||
<Route exact path="/home/public-project" render={(props)=>this.renderHomeIfLoggedIn(<Project account={this.state.account} {...props} />)} />
|
||||
<Route path="/home/my-project" render={(props)=>this.renderHomeIfLoggedIn(<MyProject account={this.state.account} {...props} />)} />
|
||||
<Route path="/home/message" render={(props)=>this.renderHomeIfLoggedIn(<Message account={this.state.account} {...props} />)}/>
|
||||
<Route exact path="/home" render={(props) => <Home account={this.state.account} {...props} />}/>
|
||||
<Route exact path="/home/public-project"
|
||||
render={(props) => this.renderHomeIfLoggedIn(<Project account={this.state.account} {...props} />)}/>
|
||||
<Route path="/home/my-project" render={(props) => this.renderHomeIfLoggedIn(<MyProject
|
||||
account={this.state.account} {...props} />)}/>
|
||||
<Route path="/home/message"
|
||||
render={(props) => this.renderHomeIfLoggedIn(<Message account={this.state.account} {...props} />)}/>
|
||||
|
||||
<Route exact path="/home/project/:id/info" render={(props)=>this.renderHomeIfLoggedIn(<ProjectInfo account={this.state.account} {...props} />)}/>
|
||||
<Route exact path="/home/project/:id/info/edit" render={(props)=>this.renderHomeIfLoggedIn(<EditInfo account={this.state.account} {...props} />)}/>
|
||||
<Route exact path="/home/project/:id/outline/edit" render={(props)=>this.renderHomeIfLoggedIn(<EditOutlined account={this.state.account} {...props} />)}/>
|
||||
<Route exact path="/home/project/:id/info" render={(props) => this.renderHomeIfLoggedIn(<ProjectInfo
|
||||
account={this.state.account} {...props} />)}/>
|
||||
<Route exact path="/home/project/:id/info/edit"
|
||||
render={(props) => this.renderHomeIfLoggedIn(<EditInfo account={this.state.account} {...props} />)}/>
|
||||
<Route exact path="/home/project/:id/outline/edit"
|
||||
render={(props) => this.renderHomeIfLoggedIn(<EditOutlined
|
||||
account={this.state.account} {...props} />)}/>
|
||||
|
||||
<Route exact path="/home/project/:pid/student/:sid/evidence" render={(props)=>this.renderHomeIfLoggedIn(<Evidence account={this.state.account} {...props} />)}/>
|
||||
<Route exact path="/home/project/:pid/student/:sid/evidence"
|
||||
render={(props) => this.renderHomeIfLoggedIn(<Evidence account={this.state.account} {...props} />)}/>
|
||||
|
||||
<Route exact path="/home/project/:pid/section/:sid/edit" render={(props)=>this.renderHomeIfLoggedIn(<SectionEditPage account={this.state.account} {...props} />)}/>
|
||||
<Route exact path="/home/project/:pid/section/:sid/task/:tid/survey/edit" render={(props)=>this.renderHomeIfLoggedIn(<SurveyEditPage account={this.state.account} {...props} />)}/>
|
||||
<Route exact path="/home/project/:pid/section/:sid/preview" render={(props)=>this.renderHomeIfLoggedIn(<PreviewSection account={this.state.account} {...props} />)}/>
|
||||
<Route exact path="/home/project/:pid/section/:sid/edit"
|
||||
render={(props) => this.renderHomeIfLoggedIn(<SectionEditPage
|
||||
account={this.state.account} {...props} />)}/>
|
||||
<Route exact path="/home/project/:pid/section/:sid/task/:tid/survey/edit"
|
||||
render={(props) => this.renderHomeIfLoggedIn(<SurveyEditPage
|
||||
account={this.state.account} {...props} />)}/>
|
||||
<Route exact path="/home/project/:pid/section/:sid/preview"
|
||||
render={(props) => this.renderHomeIfLoggedIn(<PreviewSection
|
||||
account={this.state.account} {...props} />)}/>
|
||||
</Switch>
|
||||
</Layout.Content>
|
||||
<Layout.Footer style={{textAlign: 'center'}}>OpenPBL</Layout.Footer>
|
||||
|
|
Loading…
Reference in New Issue