From fe936bd29898d981376ab0e9064dd18366dcc833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 28 Sep 2019 09:50:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/config/webpack.config.dev.js | 22 +++++++++++++++++++ public/react/package.json | 2 ++ .../shixunHomework/Listofworksstudentone.js | 5 +++-- .../shixunHomework/Trainingjobsetting.js | 2 ++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/public/react/config/webpack.config.dev.js b/public/react/config/webpack.config.dev.js index aabcd8fb7..819854745 100644 --- a/public/react/config/webpack.config.dev.js +++ b/public/react/config/webpack.config.dev.js @@ -10,6 +10,7 @@ const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeM const eslintFormatter = require('react-dev-utils/eslintFormatter'); const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin'); const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); +const HardSourceWebpackPlugin = require('hard-source-webpack-plugin'); const getClientEnvironment = require('./env'); const paths = require('./paths'); @@ -268,6 +269,27 @@ module.exports = { // You can remove this if you don't use Moment.js: new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), new MonacoWebpackPlugin(), + new HardSourceWebpackPlugin({ + // cacheDirectory是在高速缓存写入。默认情况下,将缓存存储在node_modules下的目录中,因此如 + // 果清除了node_modules,则缓存也是如此 + cacheDirectory: 'node_modules/.cache/hard-source/[confighash]', + // Either an absolute path or relative to webpack's options.context. + // Sets webpack's recordsPath if not already set. + recordsPath: 'node_modules/.cache/hard-source/[confighash]/records.json', + // configHash在启动webpack实例时转换webpack配置,并用于cacheDirectory为不同的webpack配 + // 置构建不同的缓存 + configHash: function(webpackConfig) { + // node-object-hash on npm can be used to build this. + return require('node-object-hash')({sort: false}).hash(webpackConfig); + }, + // 当加载器,插件,其他构建时脚本或其他动态依赖项发生更改时,hard-source需要替换缓存以确保输 + // 出正确。environmentHash被用来确定这一点。如果散列与先前的构建不同,则将使用新的缓存 + environmentHash: { + root: process.cwd(), + directories: [], + files: ['package-lock.json', 'yarn.lock'], + }, + }), ], // 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/package.json b/public/react/package.json index e91e61f03..673ca7dfb 100644 --- a/public/react/package.json +++ b/public/react/package.json @@ -163,6 +163,8 @@ "babel-plugin-import": "^1.11.0", "concat": "^1.0.3", "happypack": "^5.0.1", + "hard-source-webpack-plugin": "^0.13.1", + "node-object-hash": "^2.0.0", "node-sass": "^4.12.0", "sass-loader": "^7.3.1", "webpack-bundle-analyzer": "^3.0.3", diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index fa2490b8f..af28357c2 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -2619,6 +2619,7 @@ class Listofworksstudentone extends Component { } //排序 funordert = (e) => { + debugger // if (e === "update_time") { // // 时间 // // 时间排序是从小到大 @@ -2643,7 +2644,7 @@ class Listofworksstudentone extends Component { //学号 //学号排序是从大到小 this.setState({ - order: "student_id", + orders: "student_id", loadingstate: true, }) this.Startsortingt("student_id", this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit); @@ -3334,7 +3335,7 @@ class Listofworksstudentone extends Component {