desc: 修改代码

This commit is contained in:
zyy 2019-11-13 09:06:57 +08:00
parent 9c0ad7adb8
commit 2266f6d823
8 changed files with 82 additions and 36 deletions

View File

@ -30,11 +30,8 @@
"stompjs": "^2.3.3", "stompjs": "^2.3.3",
"storejs": "^1.0.25", "storejs": "^1.0.25",
"three": "^0.107.0", "three": "^0.107.0",
"vue": "2.6.10",
"vue-i18n": "^8.12.0", "vue-i18n": "^8.12.0",
"vue-router": "3.0.6",
"vuedraggable": "^2.20.0", "vuedraggable": "^2.20.0",
"vuex": "3.1.0",
"xlsx": "^0.14.2", "xlsx": "^0.14.2",
"zrender": "^4.0.4" "zrender": "^4.0.4"
}, },
@ -54,6 +51,7 @@
"babel-preset-env": "1.6.1", "babel-preset-env": "1.6.1",
"babel-preset-stage-2": "6.24.1", "babel-preset-stage-2": "6.24.1",
"chalk": "2.4.2", "chalk": "2.4.2",
"compression-webpack-plugin": "^3.0.0",
"connect": "3.6.6", "connect": "3.6.6",
"copy-webpack-plugin": "^4.5.2", "copy-webpack-plugin": "^4.5.2",
"eslint": "5.15.3", "eslint": "5.15.3",

View File

@ -6,10 +6,17 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.png"> <link rel="icon" href="<%= BASE_URL %>favicon.png">
<!-- <link rel="stylesheet" href="https://cdn.bootcss.com/element-ui/2.12.0/theme-chalk/index.css"> --> <!-- <link rel="stylesheet" href="https://cdn.bootcss.com/element-ui/2.12.0/theme-chalk/index.css"> -->
<!-- <link href="https://cdn.bootcss.com/nprogress/0.2.0/nprogress.min.css" rel="stylesheet"> -->
<title><%= webpackConfig.name %></title> <title><%= webpackConfig.name %></title>
<script src="/static/inflate.min.js"></script> <script src="/static/inflate.min.js"></script>
<script src="/static/three.min.js"></script> <script src="/static/three.min.js"></script>
<script src="https://cdn.bootcss.com/echarts/4.4.0-rc.1/echarts-en.common.js"></script> <script src="https://cdn.bootcss.com/echarts/4.4.0-rc.1/echarts-en.common.js"></script>
<script src="https://cdn.bootcss.com/vue/2.6.10/vue.min.js"></script>
<script src="https://cdn.bootcss.com/vuex/3.1.1/vuex.min.js"></script>
<script src="https://cdn.bootcss.com/vue-router/3.1.3/vue-router.min.js"></script>
<!-- <script src="https://cdn.bootcss.com/nprogress/0.2.0/nprogress.min.js"></script> -->
<!-- <script src="https://cdn.bootcss.com/element-ui/2.12.0/index.js"></script> <!-- <script src="https://cdn.bootcss.com/element-ui/2.12.0/index.js"></script>
<script src="https://cdn.bootcss.com/element-ui/2.12.0/locale/en.min.js"></script> <script src="https://cdn.bootcss.com/element-ui/2.12.0/locale/en.min.js"></script>
<script src="https://cdn.bootcss.com/element-ui/2.12.0/locale/zh-CN.min.js"></script> --> <script src="https://cdn.bootcss.com/element-ui/2.12.0/locale/zh-CN.min.js"></script> -->

View File

@ -1,5 +1,5 @@
import zrender from 'zrender'; import zrender from 'zrender';
import * as zrUtil from 'zrender/src/core/util'; // import * as zrUtil from 'zrender/src/core/util';
import localStore from 'storejs'; import localStore from 'storejs';
import Options from './options'; import Options from './options';
import MouseController from './mouseController'; import MouseController from './mouseController';

View File

@ -3,24 +3,21 @@ import Vue from 'vue';
import 'normalize.css/normalize.css'; // A modern alternative to CSS resets import 'normalize.css/normalize.css'; // A modern alternative to CSS resets
import ElementUI from 'element-ui'; import ElementUI from 'element-ui';
// import ELEMENT from 'element-ui';
import ElementLocale from 'element-ui/lib/locale'; import ElementLocale from 'element-ui/lib/locale';
import 'element-ui/lib/theme-chalk/index.css'; import 'element-ui/lib/theme-chalk/index.css';
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n
import '@/styles/index.scss'; // global css import '@/styles/index.scss'; // global css
import LangStorage from '@/utils/lang'; import LangStorage from '@/utils/lang';
import App from './App'; import App from './App';
import VueI18n from 'vue-i18n'; import VueI18n from 'vue-i18n';
import store from './store'; import store from './store';
import router from './router'; import router from './router';
import '@/icons'; // icon import '@/icons'; // icon
import '@/permission'; // permission control import '@/permission'; // permission control
import '@/scripts/GlobalPlugin'; import '@/scripts/GlobalPlugin';
// import '@/directives';
import '@/directive/dialogDrag/index.js'; import '@/directive/dialogDrag/index.js';
import '@/directive/dialogDragWidth/index.js'; import '@/directive/dialogDragWidth/index.js';
import '@/directive/drag/index.js'; import '@/directive/drag/index.js';

View File

@ -1,7 +1,8 @@
import Vue from 'vue'; // import Vue from 'vue';
import Router from 'vue-router'; import Router from 'vue-router';
// import VueRouter from 'vue-router';
Vue.use(Router); // Vue.use(Router);
/* Layout */ /* Layout */
const Layout = () => import('@/layout'); const Layout = () => import('@/layout');

View File

@ -1,4 +1,4 @@
import Vue from 'vue'; // import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import app from './modules/app'; import app from './modules/app';
import settings from './modules/settings'; import settings from './modules/settings';
@ -17,7 +17,7 @@ import ibp from './modules/ibp';
import getters from './getters'; import getters from './getters';
Vue.use(Vuex); // Vue.use(Vuex);
const store = new Vuex.Store({ const store = new Vuex.Store({
modules: { modules: {

View File

@ -6,6 +6,10 @@ const defaultSettings = require('./src/settings.js');
const CopyWebpackPlugin = require('copy-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin');
// const CompressionWebpackPlugin = require('compression-webpack-plugin');
// const productionGzipExtensions = ['js', 'css'];
// const isProduction = process.env.NODE_ENV === 'production';
function resolve(dir) { function resolve(dir) {
return path.join(__dirname, dir); return path.join(__dirname, dir);
} }
@ -47,30 +51,69 @@ module.exports = {
// }, // },
// after: require('./mock/mock-server.js') // after: require('./mock/mock-server.js')
}, },
configureWebpack: { configureWebpack: config => {
// provide the app's title in webpack's name field, so that config.name = name;
// it can be accessed in index.html to inject the correct title. config.resolve = {
name: name,
resolve: {
extensions: ['.js', '.vue', '.json'], extensions: ['.js', '.vue', '.json'],
alias: { alias: {
'@': resolve('src') '@': resolve('src')
} }
}, };
plugins: [ config.plugins.push(new CopyWebpackPlugin([
new CopyWebpackPlugin([
{ {
from: path.resolve(__dirname, './static'), from: path.resolve(__dirname, './static'),
to: 'static', to: 'static',
ignore: ['.*'] ignore: ['.*']
} }
]) ]));
],
externals: { // if (isProduction) {
'echarts': 'echarts' // 配置使用CDN // config.plugins.push(new CompressionWebpackPlugin({
// 'element-ui': 'ELEMENT' // algorithm: 'gzip',
} // test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$'),
// threshold: 10240,
// minRatio: 0.8
// }));
// }
config.externals = { // 配置使用CDN
'vue': 'Vue',
'vuex': 'Vuex',
'vue-router': 'VueRouter',
// 'nprogress': 'NProgress',
'echarts': 'echarts'
};
}, },
// {
// // provide the app's title in webpack's name field, so that
// // it can be accessed in index.html to inject the correct title.
// name: name,
// resolve: {
// extensions: ['.js', '.vue', '.json'],
// alias: {
// '@': resolve('src')
// }
// },
// plugins: [
// new CopyWebpackPlugin([
// {
// from: path.resolve(__dirname, './static'),
// to: 'static',
// ignore: ['.*']
// }
// ]),
// new CompressionWebpackPlugin({
// algorithm: 'gzip',
// test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$'),
// threshold: 10240,
// minRatio: 0.8
// })
// ],
// externals: {
// 'echarts': 'echarts' // 配置使用CDN
// }
// },
chainWebpack(config) { chainWebpack(config) {
config.plugins.delete('preload'); // TODO: need test config.plugins.delete('preload'); // TODO: need test
config.plugins.delete('prefetch'); // TODO: need test config.plugins.delete('prefetch'); // TODO: need test