diff --git a/public/react/config/webpack.config.prod.js b/public/react/config/webpack.config.prod.js index ff6472547..a69eff349 100644 --- a/public/react/config/webpack.config.prod.js +++ b/public/react/config/webpack.config.prod.js @@ -122,21 +122,21 @@ module.exports = { // First, run the linter. // It's important to do this before Babel processes the JS. - // { - // test: /\.(js|jsx|mjs)$/, - // enforce: 'pre', - // use: [ - // { - // options: { - // formatter: eslintFormatter, - // eslintPath: require.resolve('eslint'), - // - // }, - // loader: require.resolve('eslint-loader'), - // }, - // ], - // include: paths.appSrc, - // }, + { + test: /\.(js|jsx|mjs)$/, + enforce: 'pre', + use: [ + { + options: { + formatter: eslintFormatter, + eslintPath: require.resolve('eslint'), + + }, + loader: require.resolve('eslint-loader'), + }, + ], + include: paths.appSrc, + }, { // "oneOf" will traverse all following loaders until one will // match the requirements. When no loader matches it will fall diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index f26d97ad3..06531d142 100644 --- a/public/react/src/modules/courses/Resource/index.js +++ b/public/react/src/modules/courses/Resource/index.js @@ -37,7 +37,8 @@ class Fileslists extends Component{ course_modules:undefined, has_course_groups:false, course_is_public:undefined, - isSpin:false + isSpin:false, + course_second_categories:[] } } componentDidMount=()=>{ @@ -115,12 +116,22 @@ class Fileslists extends Component{ axios.get(url, { }).then((response) => { if(response!=undefined){ + if(response.data&&response.data){ + let list=response.data.course_modules; + let course_second_categoriess; + list.map((item,key)=>{ + course_second_categoriess=item.course_second_categories + }) + debugger this.setState({ course_modules:response.data, - has_course_groups:response.data.has_course_groups + has_course_groups:response.data.has_course_groups, + course_second_categories:course_second_categoriess }) } + + } }) @@ -647,7 +658,8 @@ class Fileslists extends Component{ discussMessageid, course_modules, shixunmodal, - course_is_public + course_is_public, + filesId } = this.state; let category_id= this.props.match.params.category_id; @@ -797,31 +809,37 @@ class Fileslists extends Component{ overflow-y: auto; } .drop_down_menu li { - overflow: visible; - } + overflow: visible; + } + .courseSecond{ + margin-left: 10px; + padding: 10px; + } `} -
+
{this.setState({dirSearchValue: e.target.value})}}/> -
+ :""} - {/*{course_modules&&course_modules.course_modules.map((item,key)=>{*/} - {/*return(*/} - {/*
{/*
{/*
- {datalist&&datalist.course_name}
+ {datalist&&datalist.course_name}
>
{datalist&&datalist.graduation_name}
>
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js
index 9be6b9b06..6f98a9d19 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js
@@ -2,7 +2,7 @@ import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal} from "antd";
import {Link} from 'react-router-dom';
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
-import { WordsBtn,getUrl ,bytesToSize} from 'educoder';
+import { WordsBtn,getUrl ,bytesToSize,appendFileSizeToUploadFileAll} from 'educoder';
import axios from 'axios';
import Modals from '../../../modals/Modals';
import '../../css/Courses.css';
@@ -105,7 +105,9 @@ class GraduationTasksedit extends Component{
// for(var list of fileList ){
// console.log(fileList)
// }
- this.setState({ fileList });
+ this.setState({
+ fileList: appendFileSizeToUploadFileAll(fileList),
+ });
}
// onAttachmentRemove = (file) => {
@@ -143,10 +145,10 @@ class GraduationTasksedit extends Component{
}
onAttachmentRemove = (file) => {
-
+ debugger
this.cancelAttachment();
- // const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
- const url = `/attachments/${file}.json`
+ const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
+ // const url = `/attachments/${file}.json`
axios.delete(url, {
})
.then((response) => {
@@ -281,7 +283,7 @@ class GraduationTasksedit extends Component{
width: 600,
// https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
- showUploadList: false,
+ // showUploadList: false,
action: `${getUrl()}/api/attachments.json`,
onChange: this.handleChange,
onRemove: this.onAttachmentRemove,
@@ -414,12 +416,7 @@ class GraduationTasksedit extends Component{
)}
-
-
-
-
-
- {item.name}
-
-
- {item.response===undefined?"":bytesToSize(item.size)}
-
- this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}>
- */}
+ {/**/}
+ {/**/}
+ {/**/}
+ {/**/}
+ {/*{item.name}*/}
+ {/**/}
+ {/**/}
+ {/*{item.response===undefined?"":bytesToSize(item.size)}*/}
+ {/**/}
+ {/*this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}>*/}
+ {/*
-
-
-
-
- {item.name}
-
-
- {item.response===undefined?"":bytesToSize(item.size)}
-
- this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}>
- */}
+ {/**/}
+ {/**/}
+ {/**/}
+ {/**/}
+ {/*{item.name}*/}
+ {/**/}
+ {/**/}
+ {/*{item.response===undefined?"":bytesToSize(item.size)}*/}
+ {/**/}
+ {/*this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}>*/}
+ {/*