From 55b30e73915609d61855e6107d512fb833abddde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 5 Jul 2019 00:19:09 +0800 Subject: [PATCH 1/2] b --- public/react/config/webpack.config.prod.js | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) 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 From 6db7980d6001368b87eb027f32114faf2d389a50 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 5 Jul 2019 09:54:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=88=86=E7=8F=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/members/studentsList.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js index ca5e859b9..26fa8984e 100644 --- a/public/react/src/modules/courses/members/studentsList.js +++ b/public/react/src/modules/courses/members/studentsList.js @@ -32,6 +32,7 @@ const dataSource = [{ }]; const buildColumns = (that) => { + const { course_groups } = that.state const columns=[{ title: '序号', dataIndex: 'id', @@ -72,14 +73,17 @@ const buildColumns = (that) => { return {student_id} } - }, { - title: '分班', - dataIndex: 'course_group_name', - key: 'course_group_name', - align:'center', - width:"50%", - className:"color-grey-6" }]; + if (course_groups && course_groups.length) { + columns.push({ + title: '分班', + dataIndex: 'course_group_name', + key: 'course_group_name', + align:'center', + width:"50%", + className:"color-grey-6" + }) + } const isAdminOrStudent = that.props.isAdminOrStudent() if (!isAdminOrStudent) { columns.some((item,key)=> {