diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f5523e..8b661e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.1.0 (2021-07-30) +# 0.1.0 (2021-08-02) ### 🌟 新功能 范围|描述|commitId @@ -56,6 +56,7 @@ ID1000343 | 解决向下预加载查询参数时间没+1颗粒度;以及滚动加载颗粒度写死的问题 | 940603a, closes #ID1000343 plugin | 插件解析机制完善 | 0f5a27d project title | 项目标题修改; 切换角色移除script | 5c20017 + roles | 修复默认显示不是我的角色的问题 | b69f94f role | 切换角色的逻辑修正完善 | 4ae534f task任务逻辑完善 | 减少初始global及regular的不必要请求 | bd4bd38 - | 上下滑动加载定期任务 | 4090d89 diff --git a/package.json b/package.json index 6d80665..432ebdd 100644 --- a/package.json +++ b/package.json @@ -63,36 +63,38 @@ "@dcloudio/webpack-uni-pages-loader": "^2.0.0-31920210709003", "@tailwindcss/postcss7-compat": "^2.2.7", "@vue/cli-plugin-babel": "~4.5.0", - "@vue/cli-service": "~4.5.0", - "autoprefixer": "^9.8.6", - "babel-plugin-import": "^1.11.0", - "core-js": "^3.15.2", - "cross-env": "^7.0.2", - "jest": "^25.4.0", - "mini-types": "*", - "miniprogram-api-typings": "*", - "sass-loader": "^8.0.2", - "node-sass": "^4.14.1", - "postcss": "^7.0.36", - "postcss-comment": "^2.0.0", - "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.7", - "vue-template-compiler": "^2.6.11", "@vue/cli-plugin-eslint": "~4.5.0", "@vue/cli-plugin-vuex": "~4.5.0", + "@vue/cli-service": "~4.5.0", "@vue/eslint-config-prettier": "^6.0.0", + "autoprefixer": "^9.8.6", "babel-eslint": "^10.1.0", + "babel-plugin-import": "^1.11.0", "commitizen": "^4.0.3", "commitlint": "^8.2.0", + "compression-webpack-plugin": "^5.0.1", "conventional-changelog-cli": "^2.0.28", + "core-js": "^3.15.2", + "cross-env": "^7.0.2", "eslint": "^6.7.2", "eslint-plugin-prettier": "^3.3.1", "eslint-plugin-vue": "^6.2.2", "husky": "^3.0.9", + "jest": "^25.4.0", "lint-staged": "^11.0.0", - "right-pad": "^1.0.1", + "mini-types": "*", + "miniprogram-api-typings": "*", + "node-sass": "^4.14.1", + "postcss": "^7.0.36", "postcss-class-rename": "^1.0.1", + "postcss-comment": "^2.0.0", "prettier": "^2.2.1", - "vue-cli-plugin-commitlint": "~1.0.12" + "right-pad": "^1.0.1", + "sass-loader": "^8.0.2", + "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.7", + "vue-cli-plugin-commitlint": "~1.0.12", + "vue-cli-plugin-eruda": "^1.3.0", + "vue-template-compiler": "^2.6.11" }, "browserslist": [ "Android >= 4", diff --git a/src/components/Plugin/Plugin.vue b/src/components/Plugin/Plugin.vue index 328cb98..2ab39ca 100644 --- a/src/components/Plugin/Plugin.vue +++ b/src/components/Plugin/Plugin.vue @@ -4,6 +4,7 @@ @@ -41,6 +43,7 @@ export default { pluginId: { default: '1', type: String }, styleType: { default: 0, type: Number }, pluginTaskId: { default: '', type: String }, + param: { type: String, default: '' }, }, data() { @@ -48,9 +51,10 @@ export default { }, computed: { + ...mapState('role', ['roleId']), + ...mapState('user', ['token']), ...mapGetters('user', ['userId']), ...mapGetters('project', ['projectId']), - ...mapState('role', ['roleId']), }, created() { @@ -77,13 +81,13 @@ export default { uuid = RegExp.$1; // console.log('uuid: ', uuid, `p${this.pluginTaskId}`); - const str = data.html.replaceAll(uuid, `p${this.pluginTaskId}`); + const str = data.html.replace(new RegExp(uuid, 'g'), `p${this.pluginTaskId}`); this.pluginContent = str; } else { this.pluginContent = data.html; } - const str = data.js.replaceAll(uuid, `p${this.pluginTaskId}`); + const str = data.js.replace(new RegExp(uuid, 'g'), `p${this.pluginTaskId}`); this.handleDom(str); } // console.log(this.pluginContent); @@ -91,7 +95,7 @@ export default { // if (data.js) { // if (reg.test(data.js)) { // const uuid = RegExp.$1; - // const str = data.js.replaceAll(uuid, `p${this.pluginTaskId}`); + // const str = data.js.replace(new RegExp(uuid, 'g'), `p${this.pluginTaskId}`); // this.handleDom(str); // } else { // this.handleDom(data.js); diff --git a/src/components/TimeLine/component/TimeBox.vue b/src/components/TimeLine/component/TimeBox.vue index 47b27eb..97d266a 100644 --- a/src/components/TimeLine/component/TimeBox.vue +++ b/src/components/TimeLine/component/TimeBox.vue @@ -39,8 +39,9 @@ :task="task" :key="plugin.pluginTaskId" :plugin-task-id="plugin.pluginTaskId" - :pluginId="plugin.pluginId" - :styleType="styleType || 0" + :plugin-id="plugin.pluginId" + :param="plugin.param" + :style-type="styleType || 0" v-for="plugin in row" /> diff --git a/src/utils/time.js b/src/utils/time.js index eb7e9c4..00b8567 100644 --- a/src/utils/time.js +++ b/src/utils/time.js @@ -1,4 +1,5 @@ import dayjs from 'dayjs'; + const advancedFormat = require('dayjs/plugin/advancedFormat'); const weekOfYear = require('dayjs/plugin/weekOfYear'); diff --git a/vue.config.js b/vue.config.js index eeab753..982e9f1 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,20 +1,39 @@ const path = require('path'); -const CopyWebpackPlugin = require('copy-webpack-plugin'); // 最新版本copy-webpack-plugin插件暂不兼容,推荐v5.0.0 +// const CopyWebpackPlugin = require('copy-webpack-plugin'); // 最新版本copy-webpack-plugin插件暂不兼容,推荐v5.0.0 +const CompressionWebpackPlugin = require('compression-webpack-plugin'); +const productionGzipExtensions = /\.(js|css|json|txt|html|ico|svg|ttf|woff|woff2)(\?.*)?$/i; const publicPath = process.env.VUE_APP_PUBLIC_PATH; +const isPro = process.env.NODE_ENV === 'production'; module.exports = { lintOnSave: process.env.NODE_ENV !== 'production', productionSourceMap: false, - publicPath: process.env.NODE_ENV === 'production' ? publicPath : '/', + publicPath: isPro ? publicPath : '/', devServer: { // open: true, // host: '127.0.0.1', overlay: { warnings: false, errors: true }, // proxy: {} }, - configureWebpack: { plugins: [] }, - // , disable: true + configureWebpack: { + plugins: isPro + ? [ + new CompressionWebpackPlugin({ + filename: '[path].gz[query]', + algorithm: 'gzip', + test: productionGzipExtensions, + threshold: 10240, + minRatio: 0.8, + deleteOriginalAssets: false, + }), + ] + : [], + }, pluginOptions: { // mock: { entry: './src/mock/mock.js', debug: true, disable: true }, + eruda: {}, + webpackBundleAnalyzer: { + openAnalyzer: isPro, + }, }, };