Merge branches 'dev_Ysl', 'dev_Ysm' and 'topic_bank' of https://bdgit.educoder.net/Hjqreturn/educoder into topic_bank

# Conflicts:
#	public/react/src/modules/courses/busyWork/NewWork.js
dev_aliyun_beta
杨树明 6 years ago
commit d609b22f44

@ -283,6 +283,11 @@ const Completetaskpage =Loadable({
loader: () => import('../../modules/courses/completetaskdetails/Completetaskpage'), loader: () => import('../../modules/courses/completetaskdetails/Completetaskpage'),
loading: Loading, loading: Loading,
}); });
//问卷编辑
const PollNewQuestbank =Loadable({
loader: () => import('../../modules/courses/poll/PollNewQuestbank'),
loading: Loading,
});
class CoursesIndex extends Component{ class CoursesIndex extends Component{
constructor(props) { constructor(props) {
super(props) super(props)
@ -461,13 +466,19 @@ class CoursesIndex extends Component{
// console.log(commons) // console.log(commons)
return ( return (
<Switch {...this.props}> <Switch {...this.props}>
{/*题库问卷编辑详情*/}
<Route path="/courses/questreediting/:workid/edit"
render={
(props) => (<PollNewQuestbank {...this.props} {...props} {...this.state} />)
}
></Route>
{/*毕设任务题库详情*/} {/*毕设任务题库详情*/}
<Route path="/courses/completetask/:workid" <Route path="/courses/completetask/:workid"
render={ render={
(props) => (<Completetaskpage {...this.props} {...props} {...this.state} />) (props) => (<Completetaskpage {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
{/*毕设内容题库详情*/} {/*毕设选题题库详情*/}
<Route path="/courses/completetopic/:workid" <Route path="/courses/completetopic/:workid"
render={ render={
(props) => (<CompletetopicdePage {...this.props} {...props} {...this.state} />) (props) => (<CompletetopicdePage {...this.props} {...props} {...this.state} />)

@ -320,10 +320,13 @@ class CommonWorkPost extends Component{
// ModalSave: ()=>this.deleteAttachment(file), // ModalSave: ()=>this.deleteAttachment(file),
// ModalCancel:this.cancelAttachment // ModalCancel:this.cancelAttachment
// }) // })
if(file.response!=undefined){
this.deleteAttachment(file) this.deleteAttachment(file)
return false; return false;
} }
}
cancelAttachment=()=>{ cancelAttachment=()=>{
this.setState({ this.setState({
Modalstype:false, Modalstype:false,

@ -3,11 +3,11 @@ import { Input, InputNumber, Form, Button, Checkbox, Upload, Icon, message, Moda
import axios from 'axios' import axios from 'axios'
import '../css/busyWork.css' import '../css/busyWork.css'
import '../css/Courses.css' import '../css/Courses.css'
import { WordsBtn, getUrl, ConditionToolTip } from 'educoder' import { WordsBtn, getUrl, ConditionToolTip, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll } from 'educoder'
import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor';
import CBreadcrumb from '../common/CBreadcrumb' import CBreadcrumb from '../common/CBreadcrumb'
import NewWorkForm from './NewWorkForm'
const confirm = Modal.confirm;
const $ = window.$ const $ = window.$
const MAX_TITLE_LENGTH = 60; const MAX_TITLE_LENGTH = 60;
class NewWork extends Component{ class NewWork extends Component{
@ -17,6 +17,15 @@ class NewWork extends Component{
this.answerMdRef = React.createRef(); this.answerMdRef = React.createRef();
this.state={ this.state={
title_value:"",
title_num: 0,
contentFileList: [],
answerFileList: [],
workLoaded: false,
base_on_project: true,
category: {},
min_num: 2,
max_num: 10,
} }
} }
componentDidMount () { componentDidMount () {
@ -41,6 +50,7 @@ class NewWork extends Component{
course_id: data.course_id, course_id: data.course_id,
course_name: data.course_name, course_name: data.course_name,
category: data.category, category: data.category,
}) })
} }
}) })
@ -55,13 +65,56 @@ class NewWork extends Component{
.then((response) => { .then((response) => {
if (response.data.name) { if (response.data.name) {
const data = response.data; const data = response.data;
data.isEdit = true;
const contentFileList = data.attachments.map(item => {
return {
id: item.id,
uid: item.id,
name: appendFileSizeToUploadFile(item),
url: item.url,
filesize: item.filesize,
status: 'done'
}
})
const answerFileList = data.ref_attachments.map(item => {
return {
id: item.id,
uid: item.id,
name: appendFileSizeToUploadFile(item),
url: item.url,
filesize: item.filesize,
status: 'done'
}
})
this.setState({ this.setState({
category: data.category, ...data,
course_id: data.course_id, // course_id: data.course_id,
course_name: data.course_name, // course_name: data.course_name,
// category: data.category,
title_num: parseInt(data.name.length),
workLoaded: true,
init_min_num: data.min_num,
init_max_num: data.max_num,
// description: data.description,
reference_answer: data.reference_answer,
contentFileList,
answerFileList,
}, () => {
setTimeout(() => {
this.contentMdRef.current.setValue(data.description || '')
this.answerMdRef.current.setValue(data.reference_answer || '')
}, 2000)
this.props.form.setFieldsValue({
title: data.name,
description: data.description || '',
reference_answer: data.reference_answer || '',
});
}) })
this.newWorkFormRef.initValue(data);
} }
}) })
.catch(function (error) { .catch(function (error) {
@ -69,12 +122,72 @@ class NewWork extends Component{
}); });
} }
doEdit = (params) => { // 输入title
changeTitle=(e)=>{
console.log(e.target.value.length);
this.setState({
title_num: parseInt(e.target.value.length)
})
}
handleSubmit = () => {
const courseId = this.state.course_id || this.props.match.params.coursesId ;
this.props.form.validateFieldsAndScroll((err, values) => {
console.log(values)
const mdContnet = this.contentMdRef.current.getValue().trim();
console.log(mdContnet)
values.description = mdContnet;
// return;
{/* max={has_commit ? init_min_num : null } */}
{/* min={has_commit ? init_max_num : (min_num == undefined ? 2 : min_num + 1) } */}
// 已有提交作品,人数范围只能扩大
const { has_commit, max_num, init_max_num, min_num, init_min_num } = this.state;
if (has_commit) {
if (max_num < init_max_num || min_num > init_min_num) {
this.props.showNotification(`已有提交作品,人数范围只能扩大(原设置为:${init_min_num} - ${init_max_num})`)
return;
}
}
// const errKeys = Object.keys(err); // || errKeys.length == 1 && errKeys[0] == 'content' && mdContnet
if (!err) {
if (this.isEdit) {
this.doEdit(courseId, values)
} else {
this.doNew(courseId, values)
}
} else {
$("html").animate({ scrollTop: $('html').scrollTop() - 100 })
}
})
}
doEdit = (courseId, values) => {
const workId = this.props.match.params.workId const workId = this.props.match.params.workId
const newUrl = `/homework_commons/${workId}.json` const newUrl = `/homework_commons/${workId}.json`
let attachment_ids = this.state.contentFileList.map(item => {
return item.response ? item.response.id : item.id
})
let reference_attachment_ids = this.state.answerFileList.map(item => {
return item.response ? item.response.id : item.id
})
const { min_num, max_num, base_on_project, category } = this.state
const isGroup = this.props.isGroup() const isGroup = this.props.isGroup()
axios.put(newUrl, params) axios.put(newUrl, {
type: isGroup ? 3 : 1,
name: values.title,
description: values.description,
reference_answer: values.reference_answer,
attachment_ids,
reference_attachment_ids,
min_num,
max_num,
base_on_project
})
.then((response) => { .then((response) => {
if (response.data.status == 0) { if (response.data.status == 0) {
this.props.showNotification('保存成功') this.props.showNotification('保存成功')
@ -85,11 +198,30 @@ class NewWork extends Component{
console.log(error); console.log(error);
}); });
} }
doNew = (params) => { doNew = (courseId, values) => {
const courseId = this.props.match.params.coursesId ;
const newUrl = `/courses/${courseId}/homework_commons.json` const newUrl = `/courses/${courseId}/homework_commons.json`
axios.post(newUrl, params) let attachment_ids = this.state.contentFileList.map(item => {
return item.response ? item.response.id : item.id
})
let reference_attachment_ids = this.state.answerFileList.map(item => {
return item.response ? item.response.id : item.id
})
const isGroup = this.props.isGroup()
const { min_num, max_num, base_on_project, category } = this.state
axios.post(newUrl, {
type: isGroup ? 3 : 1,
name: values.title,
description: values.description,
reference_answer: values.reference_answer,
attachment_ids,
reference_attachment_ids,
min_num,
max_num,
base_on_project
})
.then((response) => { .then((response) => {
if (response.data.status == 0) { if (response.data.status == 0) {
this.props.showNotification('保存成功') this.props.showNotification('保存成功')
@ -101,25 +233,146 @@ class NewWork extends Component{
}); });
} }
handleContentUploadChange = (info) => {
let contentFileList = info.fileList;
this.setState({ contentFileList: appendFileSizeToUploadFileAll(contentFileList) });
}
handleAnswerUploadChange = (info) => {
let answerFileList = info.fileList;
this.setState({ answerFileList: appendFileSizeToUploadFileAll(answerFileList) });
}
onAttachmentRemove = (file, stateName) => {
if(file.response!=undefined){
this.props.confirm({
content: '是否确认删除?',
onOk: () => {
this.deleteAttachment(file, stateName)
},
onCancel() {
console.log('Cancel');
},
});
return false;
}
}
deleteAttachment = (file, stateName) => {
// 初次上传不能直接取uid
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, {
})
.then((response) => {
if (response.data) {
const { status } = response.data;
if (status == 0) {
console.log('--- success')
this.setState((state) => {
const index = state[stateName].indexOf(file);
const newFileList = state[stateName].slice();
newFileList.splice(index, 1);
return {
[stateName]: newFileList,
};
});
}
}
})
.catch(function (error) {
console.log(error);
});
}
max_num_change = (val) => {
if (val < 2) {
this.setState({
max_num: 2,
})
return;
}
const { min_num } = this.state;
this.setState({
max_num: val,
min_num: val <= min_num ? val - 1 : min_num
})
}
min_num_change = (val) => {
this.setState({ min_num: val })
}
base_on_project_change = () => {
this.setState({ base_on_project: !this.state.base_on_project })
}
render(){ render(){
let {typeId,coursesId,pageType}=this.props.match.params; let {typeId,coursesId,pageType}=this.props.match.params;
const { getFieldDecorator } = this.props.form;
const isGroup = this.props.isGroup() const isGroup = this.props.isGroup()
const moduleName = !isGroup? "普通作业":"分组作业"; const moduleName = !isGroup? "普通作业":"分组作业";
const moduleEngName = this.props.getModuleName() const moduleEngName = this.props.getModuleName()
let{ let{
category title_value, contentFileList, answerFileList, max_num, min_num, base_on_project,
init_max_num, init_min_num,
title_num, course_name, category, has_commit, has_project
}=this.state }=this.state
const { current_user } = this.props const { current_user } = this.props
const courseId = this.props.match.params.coursesId ; const courseId = this.state.course_id || this.props.match.params.coursesId ;
const isEdit = this.isEdit; const isEdit = this.isEdit;
if ((isEdit == undefined || isEdit) && !this.state.workLoaded) {
return ''
}
const uploadProps = {
width: 600,
fileList: contentFileList,
multiple: true,
// https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false,
action: `${getUrl()}/api/attachments.json`,
onChange: this.handleContentUploadChange,
onRemove: (file) => this.onAttachmentRemove(file, 'contentFileList'),
beforeUpload: (file) => {
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
message.error('文件大小必须小于150MB!');
}
return isLt150M;
},
};
const answerUploadProps = {
width: 600,
fileList: answerFileList,
multiple: true,
// https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false,
action: `${getUrl()}/api/attachments.json`,
onChange: this.handleAnswerUploadChange,
onRemove: (file) => this.onAttachmentRemove(file, 'answerFileList'),
beforeUpload: (file) => {
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
message.error('文件大小必须小于150MB!');
}
return isLt150M;
},
};
return( return(
<div className="newMain"> <div className="newMain">
<div className="educontent mt20 mb50"> <div className="educontent mt20 mb50">
{/* <p className="clearfix">
<WordsBtn style="grey" className="fl">{course_name}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl">{typeId==1 ?"普通作业":"分组作业"}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span>{pageType==="new"?"新建":"编辑"}</span>
</p> */}
<CBreadcrumb items={[ <CBreadcrumb items={[
{ to: current_user && current_user.first_category_url, name: this.state.course_name}, { to: current_user && current_user.first_category_url, name: this.state.course_name},
{ to: `/courses/${courseId}/${moduleEngName}/${category && category.category_id ? category.category_id : ''}` { to: `/courses/${courseId}/${moduleEngName}/${category && category.category_id ? category.category_id : ''}`
@ -138,16 +391,161 @@ class NewWork extends Component{
</a> </a>
</p> </p>
<div> <div>
<NewWorkForm wrappedComponentRef={(ref) => {this.newWorkFormRef = ref}} {/* onSubmit={this.handleSubmit} */}
{...this.props} <style>
onSave={this.onSave} {
doNew={this.doNew} `
doEdit={this.doEdit} .yslnewworkinputaddonAfter .ant-input{
></NewWorkForm> border-right: none !important;
height: 40px !important;
}
`
}
</style>
<Form className="courseForm">
<Form.Item
label="标题"
className="AboutInputForm"
>
{getFieldDecorator('title', {
rules: [{
required: true, message: '请输入标题'
}],
})(
<Input placeholder="请输入作业标题最大限制60个字符" onInput={this.changeTitle} className="searchView yslnewworkinputaddonAfter searchViewAfter" style={{"width":"100%"}} maxLength={MAX_TITLE_LENGTH} addonAfter={`${String(title_num)}/${MAX_TITLE_LENGTH}`}/>
)}
</Form.Item>
<style>{`
.uploadBtn.ant-btn {
border: none;
color: #4CACFF;
box-shadow: none;
background: transparent;
padding: 0 6px;
}
.ant-upload-list-item:hover .ant-upload-list-item-info{
background-color:#fff;
}
.upload_1 .ant-upload-list {
width: 350px;
}
.ant-input-number {
height: 40px;
line-height: 40px;
}
.workContent.AboutInputForm.ant-form-item {
border-bottom: none;
padding-bottom: 0px !important;
}
.newWorkUpload {
padding: 0px 30px 30px 30px!important;
background: #fff;
width: 100%;
display: inline-block;
border-bottom: 1px solid #EDEDED;
}
`}</style>
{ <Form.Item
label="内容"
className="AboutInputForm workContent mdInForm"
>
{getFieldDecorator('description', {
rules: [{
required: true, message: '请输入作业内容和要求'
}],
})(
<TPMMDEditor ref={this.contentMdRef} placeholder="请在此输入作业内容和要求,最大限制5000个字符" mdID={'courseContentMD'} refreshTimeout={1500}
className="courseMessageMD" initValue={this.state.description}></TPMMDEditor>
)}
</Form.Item> }
<Upload {...uploadProps} className="upload_1 newWorkUpload">
<Button className="uploadBtn">
<Icon type="upload" /> 上传附件
</Button>
(单个文件150M以内)
</Upload>
{ isGroup &&
<Form.Item
label="分组设置"
className="AboutInputForm"
>
{getFieldDecorator('personNum', {
rules: [{
required: false
// required: true, message: '请输入最小人数和最大人数'
}],
})(
<div>
<p className="clearfix">
<ConditionToolTip condition={has_commit} title={'已有提交作品,人数范围只能扩大'}>
{/* max={has_commit ? init_min_num : null } */}
<InputNumber placeholder="请填写每组最小人数" min={1} className="winput-240-40" value={min_num}
onChange={this.min_num_change} style={{width:'180px'}} />
</ConditionToolTip>
<span className="ml15 mr15">~</span>
{/* min={has_commit ? init_max_num : (min_num == undefined ? 2 : min_num + 1) } */}
<ConditionToolTip condition={has_commit} title={'已有提交作品,人数范围只能扩大'}>
<InputNumber className="winput-240-40" placeholder="请填写每组最大人数" value={max_num} max={10}
onChange={this.max_num_change} style={{width:'180px'}} />
</ConditionToolTip>
<label className="color-grey-9 ml20 font-14">项目管理员角色的成员都可以提交作品提交作品时需要关联同组成员组内成员作品共享</label>
</p>
<p className="mt20">
<ConditionToolTip condition={has_commit || has_project} title={'已有关联项目或作品,不能修改'}>
<Checkbox checked={base_on_project} onChange={this.base_on_project_change}
disabled={has_project || has_commit}
>基于项目实施</Checkbox>
</ConditionToolTip>
<label className="color-grey-9 ml12 font-14">勾选后各小组必须在educoder平台创建项目教师可随时观察平台对各小组最新进展的实时统计</label>
</p>
</div>
)}
</Form.Item>
}
<Form.Item
label="参考答案"
className="AboutInputForm"
style={{"borderBottom":"none"}}
>
{getFieldDecorator('reference_answer', {
rules: [{
required: false
}],
})(
<TPMMDEditor ref={this.answerMdRef} placeholder="请在此输入作业的参考答案,最大限制5000个字符" mdID={'workAnswerMD'}
className="courseMessageMD" refreshTimeout={1500} initValue={this.state.reference_answer || ''}></TPMMDEditor>
)}
<Upload {...answerUploadProps} className="upload_1">
<Button className="uploadBtn">
<Icon type="upload" /> 上传附件
</Button>
(单个文件150M以内)
</Upload>
</Form.Item>
<Form.Item>
<div className="clearfix mt30 mb30">
{/* htmlType="submit" */}
<Button type="primary" onClick={this.handleSubmit} className="defalutSubmitbtn fl mr20">提交</Button>
<a className="defalutCancelbtn fl" onClick={() => this.props.toListPage(this.props.match.params, category.category_id)}>取消</ a>
</div>
</Form.Item>
</Form>
</div> </div>
</div> </div>
</div> </div>
) )
} }
} }
export default NewWork; const WrappedBoardsNew = Form.create({ name: 'NewWork' })(NewWork);
export default WrappedBoardsNew;

@ -57,20 +57,22 @@ class Groupjobbandetails extends Component {
render() { render() {
let{datas}=this.props;
return ( return (
<div className=" clearfix edu-back-white" ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}> <div className=" clearfix edu-back-white" ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}>
<div className="yslquestionbank1"> <div className="yslquestionbank1">
<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML("C++是C语言的面向对象扩展是C语言的一个超集同时也是历史最悠久、最受欢迎的程序设计语言之一。根据C++创始人Stroustrup的自述C++是一个“更好的C语言”。\n" + <div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas&&datas.description).replace(/▁/g, "▁▁▁")}}/>
"\n" +
"输入输出是计算机程序的基本功能。程序本质上是对数据进行处理的一系列操作,一般程序都可以分解为:“数据输入”、“数据处理”和“数据输出”三个步骤。标准输入输出(键盘输入和显示器输出)是程序的重要组成部分。\n" + {datas.attachments === undefined ? "" : datas.attachments.map((item, key) => {
"\n" + return (
"本实训项目的主要目标是学习和掌握C++程序的基本结构和基本输入输出主要内容包括标准C语言自有的单个字符的输入输出、格式化的输入输出以及C++扩展的使用流对象的输入输出").replace(/▁/g, "▁▁▁")}}/> <GroupPackage key={key} attachments={item}></GroupPackage>
)
})}
<GroupPackage2 datas={datas} bool={false}></GroupPackage2>
<GroupPackage></GroupPackage>
<GroupPackage2></GroupPackage2>
</div> </div>

@ -18,17 +18,20 @@ class Completetaskpage extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
// this.answerMdRef = React.createRef(); // this.answerMdRef = React.createRef();
this.setState({ this.state={
workid:1, workid:1,
isSpin:false, isSpin:false,
datas:[], datas:[],
}) }
} }
componentDidMount() { componentDidMount() {
// console.log("父组件加载框"); // console.log("父组件加载框");
this.getonedata();
}
getonedata(){
if( this.props.match.params.workid){ if( this.props.match.params.workid){
this.setState({ this.setState({
workid: this.props.match.params.workid, workid: this.props.match.params.workid,
@ -47,13 +50,13 @@ class Completetaskpage extends Component {
this.setState({ this.setState({
isSpin:true, isSpin:true,
}) })
let url = `/homework_banks/${workids}.json`; let url = `/task_banks/${workids}.json`;
// //
axios.get(url).then((response) => { axios.get(url).then((response) => {
if(response){ if(response){
if(response.data){ if(response.data){
this.setState({ this.setState({
datas:response.data.informs, datas:response.data,
}) })
}else { }else {
this.setState({ this.setState({
@ -86,6 +89,7 @@ class Completetaskpage extends Component {
///////////////教师截止 ///////////////教师截止
render() { render() {
let{datas}=this.state;
const isAdmin = this.props.isAdmin(); const isAdmin = this.props.isAdmin();
// console.log(119) // console.log(119)
@ -108,10 +112,10 @@ class Completetaskpage extends Component {
</div> </div>
<div className="educontent mb20"> <div className="educontent mb20">
<p className=" fl color-black summaryname" style={{heigth: "33px"}}> <p className=" fl color-black summaryname" style={{heigth: "33px"}}>
MySQL数据库编程开发实训基础篇 {datas&&datas.name}
</p> </p>
<CoursesListType <CoursesListType
typelist={["公开"]} typelist={datas&&datas.is_public?["公开"]:["私有"]}
/> />
</div> </div>
@ -126,7 +130,7 @@ class Completetaskpage extends Component {
</div> </div>
</div> </div>
<Completetaskdetails/> <Completetaskdetails {...this.state} {...this.props} datas={datas}/>
</div> </div>
</div> </div>

@ -19,11 +19,11 @@ class CompletetopicdePage extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
// this.answerMdRef = React.createRef(); // this.answerMdRef = React.createRef();
this.setState({ this.state={
workid:1, workid:1,
isSpin:false, isSpin:false,
datas:[], datas:[],
}) }
} }
@ -48,13 +48,13 @@ class CompletetopicdePage extends Component {
this.setState({ this.setState({
isSpin:true, isSpin:true,
}) })
let url = `/homework_banks/${workids}.json`; let url = `/gtopic_banks/${workids}.json`;
// //
axios.get(url).then((response) => { axios.get(url).then((response) => {
if(response){ if(response){
if(response.data){ if(response.data){
this.setState({ this.setState({
datas:response.data.informs, datas:response.data,
}) })
}else { }else {
this.setState({ this.setState({
@ -88,7 +88,7 @@ class CompletetopicdePage extends Component {
///////////////教师截止 ///////////////教师截止
render() { render() {
let{datas}=this.state;
const isAdmin = this.props.isAdmin(); const isAdmin = this.props.isAdmin();
// console.log(119) // console.log(119)
@ -110,10 +110,10 @@ class CompletetopicdePage extends Component {
</div> </div>
<div className="educontent mb20"> <div className="educontent mb20">
<p className=" fl color-black summaryname" style={{heigth: "33px"}}> <p className=" fl color-black summaryname" style={{heigth: "33px"}}>
MySQL数据库编程开发实训基础篇 {datas&&datas.name}
</p> </p>
<CoursesListType <CoursesListType
typelist={["公开"]} typelist={datas&&datas.is_public?["公开"]:["私有"]}
/> />
</div> </div>
@ -128,7 +128,7 @@ class CompletetopicdePage extends Component {
</div> </div>
</div> </div>
<Completetopicdetails/> <Completetopicdetails {...this.state} {...this.props} datas={datas}/>
{/*{parseInt(tab) === 1 ? <Completetopicdeswer/>:""}*/} {/*{parseInt(tab) === 1 ? <Completetopicdeswer/>:""}*/}
</div> </div>

@ -56,52 +56,52 @@ class Completetopicdetails extends Component {
render() { render() {
let{datas}=this.props;
return ( return (
<div className=" clearfix edu-back-white " ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}> <div className=" clearfix edu-back-white " ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}>
<div className="bor-bottom-greyE"> <div className="bor-bottom-greyE">
<div className="yslquestionbank1"> <div className="yslquestionbank1">
<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML("C++是C语言的面向对象扩展是C语言的一个超集同时也是历史最悠久、最受欢迎的程序设计语言之一。根据C++创始人Stroustrup的自述C++是一个“更好的C语言”。\n" + <div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas&&datas.description).replace(/▁/g, "▁▁▁")}}/>
"\n" +
"输入输出是计算机程序的基本功能。程序本质上是对数据进行处理的一系列操作,一般程序都可以分解为:“数据输入”、“数据处理”和“数据输出”三个步骤。标准输入输出(键盘输入和显示器输出)是程序的重要组成部分。\n" +
"\n" +
"本实训项目的主要目标是学习和掌握C++程序的基本结构和基本输入输出主要内容包括标准C语言自有的单个字符的输入输出、格式化的输入输出以及C++扩展的使用流对象的输入输出").replace(/▁/g, "▁▁▁")}}/>
<GroupPackage></GroupPackage> {datas.attachment_list === undefined ? "" : datas.attachment_list.map((item, key) => {
return (
<GroupPackage key={key} attachments={item}></GroupPackage>
)
})}
</div> </div>
</div> </div>
<div style={{width:"100%", padding: "36px"}}> <div style={{width:"100%", padding: "36px"}}>
<div className="yslboomdivs"> <div className="yslboomdivs">
<p> <p>
<span className="yslboomdivsy">课题类型</span> <span className="yslboomdivsy">课题类型</span>
<span className="yslboomdivsys">设计</span> <span className="yslboomdivsys">{datas&&datas.topic_type===1?"设计":datas&&datas.topic_type===2?"论文":datas&&datas.topic_type===3?"创作":"设计"}</span>
</p> </p>
<p> <p>
<span className="yslboomdivsy">课题来源</span> <span className="yslboomdivsy">课题来源</span>
<span className="yslboomdivsys">生产/社会实践</span> <span className="yslboomdivsys">{datas&&datas.topic_source===1?"生产/社会实际":datas&&datas.topic_source===2?"结合科研":datas&&datas.topic_source===3?"其它":"生产/社会实际"}</span>
</p> </p>
<p> <p>
<span className="yslboomdivsy">课题性质1</span> <span className="yslboomdivsy">课题性质1</span>
<span className="yslboomdivsys">设计</span> <span className="yslboomdivsys">{datas&&datas.topic_property_first===1?"真题":datas&&datas.topic_property_first===2?"模拟题":"真题"}</span>
</p> </p>
<p> <p>
<span className="yslboomdivsy">课题性质2</span> <span className="yslboomdivsy">课题性质2</span>
<span className="yslboomdivsys">设计</span> <span className="yslboomdivsys">{datas&&datas.topic_property_second===1?"纵向课题":datas&&datas.topic_property_second===2?"横向课题":datas&&datas.topic_property_second===3?"自选":"纵向课题"}</span>
</p> </p>
</div> </div>
<div className="yslboomdivs"> <div className="yslboomdivs">
<p> <p>
<span className="yslboomdivsy">课题重复情况 </span> <span className="yslboomdivsy">课题重复情况 </span>
<span className="yslboomdivsys">新需求</span> <span className="yslboomdivsys">{datas&&datas.topic_repeat===1?"新题":datas&&datas.topic_repeat===2?"往届题,有新要求":datas&&datas.topic_repeat===3?"往届题,无新要求":"新题"}</span>
</p> </p>
<p> <p>
<span className="yslboomdivsy">调研或实习地点</span> <span className="yslboomdivsy">调研或实习地点</span>
<span className="yslboomdivsys">长沙</span> <span className="yslboomdivsys">{datas&&datas.province}{datas&&datas.city}</span>
</p> </p>
<p style={{width:"564px"}}> <p style={{width:"564px"}}>
<span className="yslboomdivsy">课题单位来源</span> <span className="yslboomdivsy">课题单位来源</span>
<span className="yslboomdivsys">湖南省据C++创始人Stroustrup有限公司</span> <span className="yslboomdivsys">{datas&&datas.source_unit}</span>
</p> </p>
</div> </div>
</div> </div>

@ -73,9 +73,10 @@ class AccessoryModal extends Component{
// ModalCancel:this.cancelAttachment // ModalCancel:this.cancelAttachment
// }) // })
// return false; // return false;
if(file.response!=undefined){
this.deleteAttachment(file); this.deleteAttachment(file);
} }
}

@ -64,10 +64,12 @@ class AccessoryModal2 extends Component{
// ModalCancel:this.cancelAttachment // ModalCancel:this.cancelAttachment
// }) // })
// return false; // return false;
if(file.response!=undefined){
this.deleteAttachment(file); this.deleteAttachment(file);
} }
}

@ -296,8 +296,7 @@ class Selectsetting extends Component{
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(file.response!=undefined){
// const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
const url = `/attachments/${file.response ? file.response.id : file.uid}.json` const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, { axios.delete(url, {
}) })
@ -328,6 +327,9 @@ class Selectsetting extends Component{
fileListtype:false, fileListtype:false,
}) })
} }
// const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
}
onChangeTimepublishs= (date, dateString,key) => { onChangeTimepublishs= (date, dateString,key) => {
let {course_groups}=this.state; let {course_groups}=this.state;

@ -132,7 +132,7 @@ class Sendresource extends Component{
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
debugger if(file.response!=undefined){
const url = `/attachments/${file.response ? file.response.id : file.uid}.json` const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, { axios.delete(url, {
}) })
@ -155,6 +155,7 @@ debugger
fileListtype:false, fileListtype:false,
}) })
} }
}
ModalCancelModalCancel=()=>{ ModalCancelModalCancel=()=>{
this.setState({ this.setState({

@ -157,6 +157,7 @@ class GraduationTasksSubmitedit extends Component{
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(file.response!=undefined){
let {attachments,fileList}=this.state; let {attachments,fileList}=this.state;
const url = `/attachments/${file}.json` const url = `/attachments/${file}.json`
axios.delete(url, { axios.delete(url, {
@ -202,6 +203,8 @@ class GraduationTasksSubmitedit extends Component{
}); });
} }
}
inputSearchValue=(e)=>{ inputSearchValue=(e)=>{
if(e.target.value===""){ if(e.target.value===""){

@ -146,7 +146,7 @@ class GraduationTasksSubmitnew extends Component{
// }, // },
// }); // });
// return false; // return false;
if(file.response!=undefined){
this.setState({ this.setState({
Modalstype:true, Modalstype:true,
Modalstopval:'确定要删除这个附件吗?', Modalstopval:'确定要删除这个附件吗?',
@ -156,6 +156,8 @@ class GraduationTasksSubmitnew extends Component{
return false; return false;
} }
}
cancelAttachment=()=>{ cancelAttachment=()=>{
this.setState({ this.setState({
Modalstype:false, Modalstype:false,

@ -173,6 +173,7 @@ class GraduationTasksnew extends Component {
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(file.response!=undefined){
const url = `/attachments/${file.response ? file.response.id : file.uid}.json` const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
// const url = `/attachments/${file}.json` // const url = `/attachments/${file}.json`
axios.delete(url, {}) axios.delete(url, {})
@ -199,6 +200,8 @@ class GraduationTasksnew extends Component {
}); });
} }
}
//滚动 //滚动
ifHasAnchorJustScorll() { ifHasAnchorJustScorll() {
// let anchor = this.getURLStuff("anchor"); // let anchor = this.getURLStuff("anchor");

@ -21,7 +21,9 @@ class GroupPackage extends Component {
} }
} }
DownloadOpenPdf=(type,url)=>{
type===true?window.open(url):window.location.href=url;
}
componentDidMount() { componentDidMount() {
console.log("Groupjobquesanswer"); console.log("Groupjobquesanswer");
console.log("componentDidMount"); console.log("componentDidMount");
@ -54,9 +56,9 @@ class GroupPackage extends Component {
render() { render() {
let{attachments}=this.props;
return ( return (
<div className="color-grey df yslquesmat26" key={0} style={{ lineHeight: '17px'}}> <div className="color-grey df yslquesmat26" key={this.props.key} style={{ lineHeight: '17px'}}>
<a className="color-grey "> <a className="color-grey ">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i> <i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a> </a>
@ -73,11 +75,11 @@ class GroupPackage extends Component {
` `
} }
</style> </style>
<a href={"/"} title={''} <a onClick={()=>this.DownloadOpenPdf(attachments.is_pdf,attachments.url)} title={attachments&&attachments.title}
className="mr12 yslahover overflowHidden1" length="58" style={{maxWidth:'480px',fontSize:"16px",}}> className="mr12 yslahover overflowHidden1" length="58" style={{maxWidth:'480px',fontSize:"16px",}}>
<span>清除浏览器缓存或换个浏览器操作指南更新版本.zip</span> <span>{attachments&&attachments.title}</span>
</a> </a>
<span className="color656565 color-grey-6 font-12 mr8">{2}</span> <span className="color656565 color-grey-6 font-12 mr8">{attachments&&attachments.filesize}</span>
</div> </div>
) )

@ -54,17 +54,41 @@ class GroupPackage extends Component {
render() { render() {
let{datas,bool}=this.props;
return ( return (
bool===true?
<div className="ml47text"> <div className="ml47text">
{
datas===undefined?"":datas.min_num===undefined||datas.max_num===undefined?"":datas.min_num===null||datas.max_num===null?"":
<p>
<span className="ysltextcolor66">分组要求</span>
<span className="ysltextcolor05">{datas&&datas.min_num}~ {datas&&datas.max_num}学生提交作品时需要关联同组成员组内成员作品共享</span>
</p>
}
<p>
<span className="ysltextcolor66">基于项目实施</span>
<span className="ysltextcolor05">学生必须在本平台创建项目项目管理员可以提交作品</span>
</p>
</div>
:<div className="ml47text">
{
datas===undefined?"":datas.group_info===undefined?"":datas.group_info.min_number===undefined||datas.group_info.max_number===undefined?"":
datas.group_info.min_number===null||datas.group_info.max_number===null?"":
<p> <p>
<span className="ysltextcolor66">分组要求</span> <span className="ysltextcolor66">分组要求</span>
<span className="ysltextcolor05">2~ 5学生提交作品时需要关联同组成员组内成员作品共享</span> <span className="ysltextcolor05">{datas&&datas.group_info&&datas.group_info.min_number}~ {datas&&datas.group_info&&datas.group_info.max_number}学生提交作品时需要关联同组成员组内成员作品共享</span>
</p> </p>
}
{
datas&&datas.group_info&&datas.group_info.base_on_project?
<p> <p>
<span className="ysltextcolor66">基于项目实施</span> <span className="ysltextcolor66">基于项目实施</span>
<span className="ysltextcolor05">学生必须在本平台创建项目项目管理员可以提交作品</span> <span className="ysltextcolor05">学生必须在本平台创建项目项目管理员可以提交作品</span>
</p> </p>
:""
}
</div> </div>
) )
} }

@ -57,20 +57,21 @@ class Groupjobbandetails extends Component {
render() { render() {
let{datas}=this.props;
return ( return (
<div className=" clearfix edu-back-white" ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}> <div className=" clearfix edu-back-white" ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}>
<div className="yslquestionbank1"> <div className="yslquestionbank1">
<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML("C++是C语言的面向对象扩展是C语言的一个超集同时也是历史最悠久、最受欢迎的程序设计语言之一。根据C++创始人Stroustrup的自述C++是一个“更好的C语言”。\n" + <div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas&&(datas.description===null?"无":datas.description==="null"?"无":datas.description)).replace(/▁/g, "▁▁▁")}}/>
"\n" +
"输入输出是计算机程序的基本功能。程序本质上是对数据进行处理的一系列操作,一般程序都可以分解为:“数据输入”、“数据处理”和“数据输出”三个步骤。标准输入输出(键盘输入和显示器输出)是程序的重要组成部分。\n" +
"\n" +
"本实训项目的主要目标是学习和掌握C++程序的基本结构和基本输入输出主要内容包括标准C语言自有的单个字符的输入输出、格式化的输入输出以及C++扩展的使用流对象的输入输出").replace(/▁/g, "▁▁▁")}}/>
<GroupPackage></GroupPackage> {datas.attachments === undefined ? "" : datas.attachments.map((item, key) => {
return (
<GroupPackage key={key} attachments={item}></GroupPackage>
)
})}
<GroupPackage2></GroupPackage2> <GroupPackage2 datas={datas} bool={true}></GroupPackage2>
</div> </div>

@ -14,6 +14,7 @@ import "../common/formCommon.css";
import '../css/Courses.css'; import '../css/Courses.css';
import '../css/busyWork.css'; import '../css/busyWork.css';
import '../poll/pollStyle.css'; import '../poll/pollStyle.css';
import Generaljobdetails from "../questionbank/Generaljobdetails";
class GroupjobbankPage extends Component { class GroupjobbankPage extends Component {
//分组作业内容详情 //分组作业内容详情
@ -43,7 +44,7 @@ class GroupjobbankPage extends Component {
console.log(e); console.log(e);
console.log("44"); console.log("44");
} }
this.getonedata();
} }
@ -64,6 +65,9 @@ class GroupjobbankPage extends Component {
this.setState({ this.setState({
shixuntypes: types[3] shixuntypes: types[3]
}) })
this.getonedata();
}
getonedata=()=>{
if( this.props.match.params.workid){ if( this.props.match.params.workid){
this.setState({ this.setState({
workid: this.props.match.params.workid, workid: this.props.match.params.workid,
@ -88,7 +92,7 @@ class GroupjobbankPage extends Component {
if(response){ if(response){
if(response.data){ if(response.data){
this.setState({ this.setState({
datas:response.data.informs, datas:response.data,
}) })
}else { }else {
this.setState({ this.setState({
@ -120,7 +124,7 @@ class GroupjobbankPage extends Component {
///////////////教师截止 ///////////////教师截止
render() { render() {
let {tab} = this.state; let {tab,datas} = this.state;
const isAdmin = this.props.isAdmin(); const isAdmin = this.props.isAdmin();
// console.log(119) // console.log(119)
@ -143,10 +147,10 @@ class GroupjobbankPage extends Component {
</div> </div>
<div className="educontent mb20"> <div className="educontent mb20">
<p className=" fl color-black summaryname" style={{heigth: "33px"}}> <p className=" fl color-black summaryname" style={{heigth: "33px"}}>
MySQL数据库编程开发实训基础篇 {datas&&datas.name}
</p> </p>
<CoursesListType <CoursesListType
typelist={["公开"]} typelist={datas.is_public===true?["公开"]:["私有"]}
/> />
</div> </div>
@ -162,8 +166,8 @@ class GroupjobbankPage extends Component {
</div> </div>
</div> </div>
<Spin size="large" spinning={this.state.isSpin} id={"cdiv"}> <Spin size="large" spinning={this.state.isSpin} id={"cdiv"}>
{parseInt(tab) === 0 ? <Groupjobbandetails/>:""} {parseInt(tab) === 0 ? <Groupjobbandetails {...this.props} {...this.state} datas={datas}/>:""}
{parseInt(tab) === 1 ? <Groupjobquesanswer/>:""} {parseInt(tab) === 1 ? <Groupjobquesanswer {...this.props} {...this.state} datas={datas}/>:""}
</Spin> </Spin>
</div> </div>
</div> </div>

@ -56,20 +56,20 @@ class Groupjobquesanswer extends Component {
render() { render() {
let{datas}=this.props;
return ( return (
<div className=" clearfix edu-back-white" ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}> <div className=" clearfix edu-back-white" ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}>
<div className="yslquestionbank1"> <div className="yslquestionbank1">
<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML("C++是C语言的面向对象扩展是C语言的一个超集同时也是历史最悠久、最受欢迎的程序设计语言之一。根据C++创始人Stroustrup的自述C++是一个“更好的C语言”。\n" + <div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas&&(datas.description===null?"无":datas.description==="null"?"无":datas.description)).replace(/▁/g, "▁▁▁")}}/>
"\n" +
"输入输出是计算机程序的基本功能。程序本质上是对数据进行处理的一系列操作,一般程序都可以分解为:“数据输入”、“数据处理”和“数据输出”三个步骤。标准输入输出(键盘输入和显示器输出)是程序的重要组成部分。\n" +
"\n" +
"本实训项目的主要目标是学习和掌握C++程序的基本结构和基本输入输出主要内容包括标准C语言自有的单个字符的输入输出、格式化的输入输出以及C++扩展的使用流对象的输入输出").replace(/▁/g, "▁▁▁")}}/>
<GroupPackage></GroupPackage> {datas.attachments === undefined ? "" : datas.attachments.map((item, key) => {
return (
<GroupPackage key={key} attachments={item}></GroupPackage>
)
})}
<GroupPackage2></GroupPackage2> <GroupPackage2 datas={datas} bool={true}></GroupPackage2>
</div> </div>

@ -73,6 +73,7 @@ class CreateGroupByImportModal extends Component{
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(file.response!=undefined){
this.props.confirm({ this.props.confirm({
content: '是否确认删除?', content: '是否确认删除?',
@ -86,6 +87,8 @@ class CreateGroupByImportModal extends Component{
return false; return false;
} }
}
deleteAttachment = (file) => { deleteAttachment = (file) => {
const url = `/attachments/${file.response ? file.response.id : file.uid}.json` const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, { axios.delete(url, {

File diff suppressed because it is too large Load Diff

@ -55,18 +55,19 @@ class Generaljobanswer extends Component {
render() { render() {
let{datas}=this.props
return ( return (
<div className=" clearfix edu-back-white" ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}> <div className=" clearfix edu-back-white" ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}>
<div className="yslquestionbank1"> <div className="yslquestionbank1">
<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML("C++是C语言的面向对象扩展是C语言的一个超集同时也是历史最悠久、最受欢迎的程序设计语言之一。根据C++创始人Stroustrup的自述C++是一个“更好的C语言”。\n" + <div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas&&(datas.reference_answer===null?"无":datas.reference_answer==="null"?"无":datas.reference_answer)).replace(/▁/g, "▁▁▁")}}/>
"\n" + {datas.attachments === undefined ? "" : datas.attachments.map((item, key) => {
"输入输出是计算机程序的基本功能。程序本质上是对数据进行处理的一系列操作,一般程序都可以分解为:“数据输入”、“数据处理”和“数据输出”三个步骤。标准输入输出(键盘输入和显示器输出)是程序的重要组成部分。\n" + return (
"\n" + <GroupPackage key={key} attachments={item}></GroupPackage>
"本实训项目的主要目标是学习和掌握C++程序的基本结构和基本输入输出主要内容包括标准C语言自有的单个字符的输入输出、格式化的输入输出以及C++扩展的使用流对象的输入输出").replace(/▁/g, "▁▁▁")}}/> )
})}
<GroupPackage></GroupPackage>
</div> </div>

@ -43,7 +43,7 @@ class Generaljobbankdetails extends Component {
console.log(e); console.log(e);
console.log("44"); console.log("44");
} }
this.getonedata();
} }
@ -58,17 +58,19 @@ class Generaljobbankdetails extends Component {
this.setState({ this.setState({
tab: type[1], tab: type[1],
}); });
console.log("Generaljobbankdetails"); console.log("Generaljobbankdetails");
console.log(this.props); console.log(this.props);
this.getonedata();
}
getonedata=()=>{
if( this.props.match.params.workid){ if( this.props.match.params.workid){
this.setState({ this.setState({
workid: this.props.match.params.workid, workid: this.props.match.params.workid,
}) })
} }
this.getdata(this.props.match.params.workid); this.getdata(this.props.match.params.workid);
} };
//获取数据的地方 //获取数据的地方
getdata=(workid)=>{ getdata=(workid)=>{
var workids= workid; var workids= workid;
@ -86,7 +88,7 @@ class Generaljobbankdetails extends Component {
if(response){ if(response){
if(response.data){ if(response.data){
this.setState({ this.setState({
datas:response.data.informs, datas:response.data,
}) })
}else { }else {
this.setState({ this.setState({
@ -118,7 +120,7 @@ class Generaljobbankdetails extends Component {
///////////////教师截止 ///////////////教师截止
render() { render() {
let {tab} = this.state; let {tab,datas} = this.state;
const isAdmin = this.props.isAdmin(); const isAdmin = this.props.isAdmin();
// console.log(119) // console.log(119)
@ -141,10 +143,10 @@ class Generaljobbankdetails extends Component {
</div> </div>
<div className="educontent mb20"> <div className="educontent mb20">
<p className=" fl color-black summaryname" style={{heigth: "33px"}}> <p className=" fl color-black summaryname" style={{heigth: "33px"}}>
MySQL数据库编程开发实训基础篇 {datas&&datas.name}
</p> </p>
<CoursesListType <CoursesListType
typelist={["公开"]} typelist={datas.is_public===true?["公开"]:["私有"]}
/> />
</div> </div>
@ -160,8 +162,8 @@ class Generaljobbankdetails extends Component {
</div> </div>
</div> </div>
<Spin size="large" spinning={this.state.isSpin} id={"cdiv"}> <Spin size="large" spinning={this.state.isSpin} id={"cdiv"}>
{parseInt(tab) === 0 ? <Generaljobdetails {...this.props} {...this.state}/> :""} {parseInt(tab) === 0 ? <Generaljobdetails {...this.props} {...this.state} datas={datas}/> :""}
{parseInt(tab) === 1 ? <Generaljobanswer{...this.props} {...this.state}/>:""} {parseInt(tab) === 1 ? <Generaljobanswer{...this.props} {...this.state} datas={datas}/>:""}
</Spin> </Spin>
</div> </div>
</div> </div>

@ -13,14 +13,13 @@ import {
import GroupPackage from '../groupjobbank/GroupPackage' import GroupPackage from '../groupjobbank/GroupPackage'
import './questionbank.css'; import './questionbank.css';
//内容详情
class Generaljobdetails extends Component { class Generaljobdetails extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
} }
} }
@ -56,18 +55,18 @@ class Generaljobdetails extends Component {
render() { render() {
let{datas}=this.props;
return ( return (
<div className=" clearfix edu-back-white" ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}> <div className=" clearfix edu-back-white" ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}>
<div className="yslquestionbank1"> <div className="yslquestionbank1">
<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML("C++是C语言的面向对象扩展是C语言的一个超集同时也是历史最悠久、最受欢迎的程序设计语言之一。根据C++创始人Stroustrup的自述C++是一个“更好的C语言”。\n" + <div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas&&(datas.description===null?"无":datas.description==="null"?"无":datas.description)).replace(/▁/g, "▁▁▁")}}/>
"\n" + {datas.attachments === undefined ? "" : datas.attachments.map((item, key) => {
"输入输出是计算机程序的基本功能。程序本质上是对数据进行处理的一系列操作,一般程序都可以分解为:“数据输入”、“数据处理”和“数据输出”三个步骤。标准输入输出(键盘输入和显示器输出)是程序的重要组成部分。\n" + return (
"\n" + <GroupPackage key={key} attachments={item}></GroupPackage>
"本实训项目的主要目标是学习和掌握C++程序的基本结构和基本输入输出主要内容包括标准C语言自有的单个字符的输入输出、格式化的输入输出以及C++扩展的使用流对象的输入输出").replace(/▁/g, "▁▁▁")}}/> )
})}
<GroupPackage></GroupPackage>
</div> </div>

@ -242,7 +242,10 @@ class CaseNew extends Component{
// 选择标签 // 选择标签
changeType=(type)=>{ changeType=(type)=>{
// console.log(this.state.casesTags);
// debugger
let tags = []; let tags = [];
if(this.state.casesTags.indexOf(type) > -1){ if(this.state.casesTags.indexOf(type) > -1){
tags = this.state.casesTags.filter(item => item != type); tags = this.state.casesTags.filter(item => item != type);
}else{ }else{
@ -377,6 +380,7 @@ class CaseNew extends Component{
<ul className="fl libraries_tab"> <ul className="fl libraries_tab">
<li className={ casesTags.indexOf(1) > -1 ? "active" :"" } onClick={()=>this.changeType(1)}>获奖案例</li> <li className={ casesTags.indexOf(1) > -1 ? "active" :"" } onClick={()=>this.changeType(1)}>获奖案例</li>
<li className={ casesTags.indexOf(2) > -1 ? "active" :"" } onClick={()=>this.changeType(2)}>入库案例</li> <li className={ casesTags.indexOf(2) > -1 ? "active" :"" } onClick={()=>this.changeType(2)}>入库案例</li>
{/*<li className={casesTags.indexOf(3) > -1 ? "active" : ""} onclick={() => this.changeType(3)}>企业案例</li>*/}
</ul> </ul>
{ {
checkTag && <div class="ant-form-explain">请选择标签</div> checkTag && <div class="ant-form-explain">请选择标签</div>

@ -1384,6 +1384,7 @@ export default class TPMsettings extends Component {
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(file.response!=undefined){
confirm({ confirm({
title: '确定要删除这个附件吗?', title: '确定要删除这个附件吗?',
okText: '确定', okText: '确定',
@ -1400,6 +1401,8 @@ export default class TPMsettings extends Component {
return false; return false;
} }
}
deleteAttachment = (file) => { deleteAttachment = (file) => {
console.log(file); console.log(file);
let id=file.response ==undefined ? file.id : file.response.id let id=file.response ==undefined ? file.id : file.response.id

@ -772,6 +772,7 @@ class Newshixuns extends Component {
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(file.response!=undefined){
confirm({ confirm({
title: '确定要删除这个附件吗?', title: '确定要删除这个附件吗?',
okText: '确定', okText: '确定',
@ -787,6 +788,8 @@ class Newshixuns extends Component {
}); });
return false; return false;
} }
}
deleteAttachment = (file) => { deleteAttachment = (file) => {
console.log(file); console.log(file);
let id=file.response ==undefined ? file.id : file.response.id let id=file.response ==undefined ? file.id : file.response.id

@ -457,7 +457,7 @@ class InfosTopics extends Component{
<a className="btn colorblue mr25 font-16 fr" <a className="btn colorblue mr25 font-16 fr"
href={category==="normal"?`/courses/ordinarywork/${item.id}?tab=0`: href={category==="normal"?`/courses/ordinarywork/${item.id}?tab=0`:
category==="group"?`/courses/groupingwork/${item.id}?tab=0`: category==="group"?`/courses/groupingwork/${item.id}?tab=0`:
category==="poll"?`/courses/poll/${item.id}`: category==="poll"?`/courses/questreediting/${item.id}/edit`:
category==="exercise"?`/courses/poll/${item.id}`: category==="exercise"?`/courses/poll/${item.id}`:
category==="gtask"?`/courses/completetask/${item.id}`: category==="gtask"?`/courses/completetask/${item.id}`:
category==="gtopic"?`/courses/completetopic/${item.id}`:"" category==="gtopic"?`/courses/completetopic/${item.id}`:""

Loading…
Cancel
Save