diff --git a/public/react/config/webpack.config.dev.js b/public/react/config/webpack.config.dev.js index a203e798d..2fc1bbe64 100644 --- a/public/react/config/webpack.config.dev.js +++ b/public/react/config/webpack.config.dev.js @@ -9,7 +9,6 @@ const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin'); const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin'); const eslintFormatter = require('react-dev-utils/eslintFormatter'); const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin'); -const ParallelUglifyPlugin = require('webpack-parallel-uglify-plugin'); // const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); const getClientEnvironment = require('./env'); const paths = require('./paths'); @@ -250,46 +249,6 @@ module.exports = { // https://github.com/jmblog/how-to-optimize-momentjs-with-webpack // You can remove this if you don't use Moment.js: new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), - new ParallelUglifyPlugin({ - // 传递给 UglifyJS的参数如下: - uglifyJS: { - output: { - /* - 是否输出可读性较强的代码,即会保留空格和制表符,默认为输出,为了达到更好的压缩效果, - 可以设置为false - */ - beautify: false, - /* - 是否保留代码中的注释,默认为保留,为了达到更好的压缩效果,可以设置为false - */ - comments: false - }, - compress: { - /* - 是否在UglifyJS删除没有用到的代码时输出警告信息,默认为输出,可以设置为false关闭这些作用 - 不大的警告 - */ - warnings: false, - - /* - 是否删除代码中所有的console语句,默认为不删除,开启后,会删除所有的console语句 - */ - drop_console: false, - - /* - 是否内嵌虽然已经定义了,但是只用到一次的变量,比如将 var x = 1; y = x, 转换成 y = 5, 默认为不 - 转换,为了达到更好的压缩效果,可以设置为false - */ - collapse_vars: false, - - /* - 是否提取出现了多次但是没有定义成变量去引用的静态值,比如将 x = 'xxx'; y = 'xxx' 转换成 - var a = 'xxxx'; x = a; y = a; 默认为不转换,为了达到更好的压缩效果,可以设置为false - */ - reduce_vars: false - } - } - }), ], // Some libraries import Node modules but don't use them in the browser. // Tell Webpack to provide empty mocks for them so importing them works. 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/package.json b/public/react/package.json index ebfda1b41..54519f009 100644 --- a/public/react/package.json +++ b/public/react/package.json @@ -93,7 +93,7 @@ "wrap-md-editor": "^0.2.20" }, "scripts": { - "start": "node --max_old_space_size=8072 scripts/start.js", + "start": "node --max_old_space_size=15360 scripts/start.js", "build": "node --max_old_space_size=15360 scripts/build.js", "concat": "node scripts/concat.js", "gen_stats": "NODE_ENV=production webpack --profile --config=./config/webpack.config.prod.js --json > stats.json", diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index f26d97ad3..1ad136934 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 + }) + 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; + } `} - } +
  • - {currentOrderName} -