调整本地项目
This commit is contained in:
parent
7dfd5967eb
commit
007c3658c6
@ -6,19 +6,23 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.png">
|
||||
<!-- cdn.bootcss.com替换成cdnjs.cloudflare.com/ajax/libs -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/element-ui/2.7.2/theme-chalk/index.css">
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.css" rel="stylesheet">
|
||||
|
||||
<title><%= webpackConfig.name %></title>
|
||||
<script src="/static/inflate.min.js"></script>
|
||||
<script src="/static/three.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/echarts/4.4.0-rc.1/echarts-en.common.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/vuex/3.1.0/vuex.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue-router/3.1.2/vue-router.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/element-ui/2.7.2/index.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/element-ui/2.7.2/locale/en.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/element-ui/2.7.2/locale/zh-CN.min.js"></script>
|
||||
<% if (process.env.NODE_ENV !== 'development') { %>
|
||||
<p>今天是周末</p>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/element-ui/2.7.2/theme-chalk/index.css">
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.css" rel="stylesheet">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/echarts/4.4.0-rc.1/echarts-en.common.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/vuex/3.1.0/vuex.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue-router/3.1.2/vue-router.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/element-ui/2.7.2/index.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/element-ui/2.7.2/locale/en.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/element-ui/2.7.2/locale/zh-CN.min.js"></script>
|
||||
<% } %>
|
||||
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/sockjs-client/1.4.0/sockjs.min.js"></script>-->
|
||||
</head>
|
||||
<body>
|
||||
|
@ -1,5 +1,5 @@
|
||||
// import enLocale from 'element-ui/lib/locale/lang/en';
|
||||
import ELEMENT from 'element-ui';
|
||||
import enLocale from 'element-ui/lib/locale/lang/en';
|
||||
// import ELEMENT from 'element-ui';
|
||||
import map from './map';
|
||||
import global from './global';
|
||||
import router from './router';
|
||||
@ -31,7 +31,8 @@ import login from './login';
|
||||
import designPlatform from './designPlatform';
|
||||
|
||||
export default {
|
||||
...ELEMENT.lang.en,
|
||||
// ...ELEMENT.lang.en,
|
||||
enLocale,
|
||||
map,
|
||||
global,
|
||||
router,
|
||||
|
@ -1,5 +1,5 @@
|
||||
// import cnLocale from 'element-ui/lib/locale/lang/zh-CN';
|
||||
import ELEMENT from 'element-ui';
|
||||
import cnLocale from 'element-ui/lib/locale/lang/zh-CN';
|
||||
// import ELEMENT from 'element-ui';
|
||||
import map from './map';
|
||||
import global from './global';
|
||||
import router from './router';
|
||||
@ -31,7 +31,8 @@ import login from './login';
|
||||
import designPlatform from './designPlatform';
|
||||
|
||||
export default {
|
||||
...ELEMENT.lang.zhCN,
|
||||
// ...ELEMENT.lang.zhCN,
|
||||
cnLocale,
|
||||
map,
|
||||
global,
|
||||
router,
|
||||
|
@ -57,7 +57,7 @@ export default {
|
||||
},
|
||||
{
|
||||
name: 'global.caseShow',
|
||||
// handle: this.goToCaseShow,
|
||||
handle: this.goEmpty,
|
||||
isHelp:true,
|
||||
style:'padding-right:0px;',
|
||||
hidden:getSessionStorage('project').endsWith('hyd')
|
||||
@ -134,6 +134,7 @@ export default {
|
||||
const href = 'https://joylink.club/helps/help1.pdf';
|
||||
window.open(href, '_blank');
|
||||
},
|
||||
goEmpty() {},
|
||||
goToCaseShow() {
|
||||
const href = 'https://joylink.club/helps/西安铁路职业技术学院.pdf';
|
||||
window.open(href, '_blank');
|
||||
|
10
src/main.js
10
src/main.js
@ -1,8 +1,10 @@
|
||||
import Vue from 'vue';
|
||||
|
||||
import 'normalize.css/normalize.css'; // A modern alternative to CSS resets
|
||||
import ELEMENT from 'element-ui';
|
||||
|
||||
// import ELEMENT from 'element-ui';
|
||||
import ElementUI from 'element-ui';
|
||||
import ElementLocale from 'element-ui/lib/locale';
|
||||
import 'element-ui/lib/theme-chalk/index.css';
|
||||
import '@/styles/index.scss'; // global css
|
||||
|
||||
import LangStorage from '@/utils/lang';
|
||||
@ -27,7 +29,7 @@ import '@/directive/quickMenuDrag/index.js';
|
||||
import '@/directive/waves/index.js';
|
||||
import messages from '@/i18n/index';
|
||||
|
||||
Vue.use(ELEMENT);
|
||||
Vue.use(ElementUI);
|
||||
Vue.use(VueI18n);
|
||||
Vue.config.devtools = true; // 开发环境显示vue控制台
|
||||
Vue.config.productionTip = false;
|
||||
@ -37,7 +39,7 @@ export const i18n = new VueI18n({
|
||||
messages
|
||||
});
|
||||
|
||||
ELEMENT.i18n((key, value) => i18n.t(key, value));
|
||||
ElementLocale.i18n((key, value) => i18n.t(key, value));
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
|
@ -1,8 +1,8 @@
|
||||
// import Vue from 'vue';
|
||||
import Router from 'vue-router';
|
||||
import Vue from 'vue';
|
||||
import VueRouter from 'vue-router';
|
||||
// import VueRouter from 'vue-router';
|
||||
|
||||
// Vue.use(Router);
|
||||
Vue.use(VueRouter);
|
||||
|
||||
/* Layout */
|
||||
const Layout = () => import('@/layout');
|
||||
@ -867,7 +867,7 @@ export const asyncRouter = [
|
||||
}
|
||||
];
|
||||
|
||||
const createRouter = () => new Router({
|
||||
const createRouter = () => new VueRouter({
|
||||
mode: 'history', // require service support
|
||||
scrollBehavior: () => ({ y: 0 }),
|
||||
routes: constantRoutes
|
||||
@ -882,9 +882,9 @@ router.beforeEach((to, from, next) => {
|
||||
});
|
||||
|
||||
// 兼容 vue-router在3.1.0版本以上的路由跳转使用的是 promise 的方式
|
||||
const originalPush = Router.prototype.push;
|
||||
Router.prototype.push = function push(location) {
|
||||
return originalPush.call(this, location).catch(err => err);
|
||||
};
|
||||
// const originalPush = VueRouter.prototype.push;
|
||||
// VueRouter.prototype.push = function push(location) {
|
||||
// return originalPush.call(this, location).catch(err => err);
|
||||
// };
|
||||
|
||||
export default router;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// import Vue from 'vue';
|
||||
import Vue from 'vue';
|
||||
import Vuex from 'vuex';
|
||||
import app from './modules/app';
|
||||
import settings from './modules/settings';
|
||||
@ -19,7 +19,7 @@ import iscs from './modules/iscs';
|
||||
|
||||
import getters from './getters';
|
||||
|
||||
// Vue.use(Vuex);
|
||||
Vue.use(Vuex);
|
||||
|
||||
const store = new Vuex.Store({
|
||||
modules: {
|
||||
|
@ -64,7 +64,7 @@ export default {
|
||||
}
|
||||
},
|
||||
stationList: {
|
||||
type: Object,
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ export default {
|
||||
name: 'SwitchStation',
|
||||
props: {
|
||||
concentrationStationList: {
|
||||
type: String,
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
|
@ -94,8 +94,8 @@ module.exports = {
|
||||
}
|
||||
};
|
||||
// var appTarget = 'Common';
|
||||
// var appTarget = 'HYD';// 哈尔滨项目打包
|
||||
var appTarget = process.env.NODE_ENV === 'Local' ? 'HYD' : 'Common';
|
||||
var appTarget = 'HYD';// 哈尔滨项目打包
|
||||
// var appTarget = process.env.NODE_ENV === 'Local' ? 'HYD' : 'Common';
|
||||
config.plugins.push(new webpack.NormalModuleReplacementPlugin(/(.*)_APP_TARGET(\.*)/,
|
||||
function (resourse) {
|
||||
resourse.request = resourse.request.replace(/APP_TARGET/, `${appTarget}`);
|
||||
@ -110,12 +110,12 @@ module.exports = {
|
||||
]));
|
||||
|
||||
config.externals = { // 配置使用CDN
|
||||
'vue': 'Vue',
|
||||
'vuex': 'Vuex',
|
||||
'vue-router': 'VueRouter',
|
||||
'nprogress': 'NProgress',
|
||||
'echarts': 'echarts',
|
||||
'element-ui': 'ELEMENT'
|
||||
// 'vue': 'Vue',
|
||||
// 'vuex': 'Vuex',
|
||||
// 'vue-router': 'VueRouter',
|
||||
// 'nprogress': 'NProgress',
|
||||
// 'echarts': 'echarts',
|
||||
// 'element-ui': 'ELEMENT'
|
||||
};
|
||||
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user