diff --git a/package.json b/package.json index d5da227e7..fae095787 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "three": "^0.107.0", "vue": "^2.6.10", "vue-i18n": "^8.12.0", - "vue-router": "^3.0.6", + "vue-router": "^3.1.6", "vuedraggable": "^2.23.2", "vuex": "^3.1.0", "xlsx": "^0.14.2", @@ -73,7 +73,7 @@ "serve-static": "^1.13.2", "svg-sprite-loader": "4.1.3", "svgo": "1.2.2", - "vue-template-compiler": "2.6.10" + "vue-template-compiler": "2.6.11" }, "engines": { "node": ">=8.9", diff --git a/public/index.html b/public/index.html index c5a546f5b..032c92604 100644 --- a/public/index.html +++ b/public/index.html @@ -10,8 +10,7 @@ <%= webpackConfig.name %> - <% if (process.env.NODE_ENV !== 'development') { %> -

今天是周末

+ <% if (process.env.VUE_APP_PRO !== 'local') { %> diff --git a/src/directive/dialogDrag/dialogDrag.js b/src/directive/dialogDrag/dialogDrag.js index a0652b16c..2e1b1ec67 100644 --- a/src/directive/dialogDrag/dialogDrag.js +++ b/src/directive/dialogDrag/dialogDrag.js @@ -1,4 +1,4 @@ -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; export default { bind(el) { diff --git a/src/i18n/index.js b/src/i18n/index.js index 3b11fe883..ff63ffa44 100644 --- a/src/i18n/index.js +++ b/src/i18n/index.js @@ -1,7 +1,7 @@ -import en from './langs/en/index'; -import zh from './langs/zh/index'; +import en from './langs/en/index_APP_TARGET'; +import zh from './langs/zh/index_APP_TARGET'; export default { - en, - zh + en, + zh }; diff --git a/src/i18n/langs/en/index_Common.js b/src/i18n/langs/en/index_Common.js new file mode 100644 index 000000000..a9afb2e9d --- /dev/null +++ b/src/i18n/langs/en/index_Common.js @@ -0,0 +1,63 @@ +import ELEMENT from 'element-ui'; +import map from './map'; +import global from './global'; +import router from './router'; +import lesson from './lesson'; +import error from './error'; +import rules from './rules'; +import scriptRecord from './scriptRecord'; +import tip from './tip'; +import system from './system'; +import orderAuthor from './orderAuthor'; +import teach from './teach'; +import publish from './publish'; +import permission from './permission'; +import replay from './replay'; +import planMonitor from './planMonitor'; +import screenMonitor from './screenMonitor'; +import demonstration from './demonstration'; +import exam from './exam'; +import dashboard from './dashboard'; +import jlmap3d from './jlmap3d'; +import display from './display'; +import joinTraining from './joinTraining'; +import trainRoom from './trainRoom'; +import menu from './menu'; +import ibp from './ibp'; +import approval from './approval'; +import systemGenerate from './systemGenerate'; +import login from './login'; +import designPlatform from './designPlatform'; + +export default { + ...ELEMENT.lang.en, + map, + global, + router, + lesson, + teach, + error, + rules, + scriptRecord, + tip, + system, + orderAuthor, + publish, + permission, + replay, + planMonitor, + screenMonitor, + demonstration, + exam, + dashboard, + jlmap3d, + display, + joinTraining, + trainRoom, + menu, + ibp, + approval, + systemGenerate, + login, + designPlatform +}; diff --git a/src/i18n/langs/en/index.js b/src/i18n/langs/en/index_HYD.js similarity index 95% rename from src/i18n/langs/en/index.js rename to src/i18n/langs/en/index_HYD.js index dcce3bf53..6b247f001 100644 --- a/src/i18n/langs/en/index.js +++ b/src/i18n/langs/en/index_HYD.js @@ -1,5 +1,4 @@ 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 +30,6 @@ import login from './login'; import designPlatform from './designPlatform'; export default { - // ...ELEMENT.lang.en, enLocale, map, global, diff --git a/src/i18n/langs/zh/index_Common.js b/src/i18n/langs/zh/index_Common.js new file mode 100644 index 000000000..48ee88d10 --- /dev/null +++ b/src/i18n/langs/zh/index_Common.js @@ -0,0 +1,63 @@ +import ELEMENT from 'element-ui'; +import map from './map'; +import global from './global'; +import router from './router'; +import lesson from './lesson'; +import error from './error'; +import rules from './rules'; +import scriptRecord from './scriptRecord'; +import tip from './tip'; +import system from './system'; +import orderAuthor from './orderAuthor'; +import teach from './teach'; +import publish from './publish'; +import permission from './permission'; +import replay from './replay'; +import planMonitor from './planMonitor'; +import screenMonitor from './screenMonitor'; +import demonstration from './demonstration'; +import exam from './exam'; +import dashboard from './dashboard'; +import jlmap3d from './jlmap3d'; +import display from './display'; +import joinTraining from './joinTraining'; +import trainRoom from './trainRoom'; +import menu from './menu'; +import ibp from './ibp'; +import approval from './approval'; +import systemGenerate from './systemGenerate'; +import login from './login'; +import designPlatform from './designPlatform'; + +export default { + ...ELEMENT.lang.zhCN, + map, + global, + router, + lesson, + error, + teach, + rules, + scriptRecord, + tip, + system, + orderAuthor, + publish, + permission, + replay, + planMonitor, + screenMonitor, + demonstration, + exam, + dashboard, + jlmap3d, + display, + joinTraining, + trainRoom, + menu, + ibp, + approval, + systemGenerate, + login, + designPlatform +}; diff --git a/src/i18n/langs/zh/index.js b/src/i18n/langs/zh/index_HYD.js similarity index 95% rename from src/i18n/langs/zh/index.js rename to src/i18n/langs/zh/index_HYD.js index 94e7b8a5f..3974061e3 100644 --- a/src/i18n/langs/zh/index.js +++ b/src/i18n/langs/zh/index_HYD.js @@ -1,5 +1,4 @@ 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 +30,6 @@ import login from './login'; import designPlatform from './designPlatform'; export default { - // ...ELEMENT.lang.zhCN, cnLocale, map, global, diff --git a/src/ibp/mouseController.js b/src/ibp/mouseController.js index 24b63cd21..26af6ceff 100644 --- a/src/ibp/mouseController.js +++ b/src/ibp/mouseController.js @@ -1,7 +1,7 @@ import deviceType from './constant/deviceType'; import Eventful from 'zrender/src/mixin/Eventful'; import * as eventTool from 'zrender/src/core/event'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; class EventModel { constructor(e) { diff --git a/src/ibp/utils/parser.js b/src/ibp/utils/parser.js index 1ee536314..397e4092d 100644 --- a/src/ibp/utils/parser.js +++ b/src/ibp/utils/parser.js @@ -2,7 +2,7 @@ import * as zrUtil from 'zrender/src/core/util'; import * as matrix from 'zrender/src/core/matrix'; import deviceType from '../constant/deviceType'; import deviceRender from '../constant/deviceRender'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; export function createTransform(opts) { let transform = matrix.create(); diff --git a/src/iscs/iscs.js b/src/iscs/iscs.js index f257c1973..26ac62398 100644 --- a/src/iscs/iscs.js +++ b/src/iscs/iscs.js @@ -6,7 +6,7 @@ import Painter from './painter'; import deviceType from './constant/deviceType'; import {calculateDCenter, createBoundingRect, deviceFactory} from './utils/parser'; import { updateIscsData } from './utils/parser'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; const renderer = 'canvas'; const devicePixelRatio = 1; diff --git a/src/iscs/mouseController.js b/src/iscs/mouseController.js index cb5eab76d..9ea858b75 100644 --- a/src/iscs/mouseController.js +++ b/src/iscs/mouseController.js @@ -1,7 +1,7 @@ import deviceType from './constant/deviceType'; import Eventful from 'zrender/src/mixin/Eventful'; import * as eventTool from 'zrender/src/core/event'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; class EventModel { constructor(e) { diff --git a/src/iscs/utils/parser.js b/src/iscs/utils/parser.js index 45216f7a9..c303abfff 100644 --- a/src/iscs/utils/parser.js +++ b/src/iscs/utils/parser.js @@ -2,7 +2,7 @@ import * as zrUtil from 'zrender/src/core/util'; import * as matrix from 'zrender/src/core/matrix'; import deviceType from '../constant/deviceType'; import deviceRender from '../constant/deviceRender'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import { deepClone } from '@/utils/index'; export function createTransform(opts) { diff --git a/src/jmap/mouseController.js b/src/jmap/mouseController.js index 7cfa6e7ce..f73ee90d0 100644 --- a/src/jmap/mouseController.js +++ b/src/jmap/mouseController.js @@ -1,7 +1,7 @@ import deviceType from './constant/deviceType'; import Eventful from 'zrender/src/mixin/Eventful'; import * as eventTool from 'zrender/src/core/event'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; class EventModel { constructor(e) { diff --git a/src/jmap/shape/Section/EMouse.js b/src/jmap/shape/Section/EMouse.js index 850274745..17a26e812 100644 --- a/src/jmap/shape/Section/EMouse.js +++ b/src/jmap/shape/Section/EMouse.js @@ -2,7 +2,7 @@ import Group from 'zrender/src/container/Group'; import Text from 'zrender/src/graphic/Text'; import Rect from 'zrender/src/graphic/shape/Rect'; // import Vue from 'vue'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; class EMouse extends Group { constructor(device, code) { super(); diff --git a/src/jmap/shape/Switch/EMouse.js b/src/jmap/shape/Switch/EMouse.js index 5ae837984..0645e4f5d 100644 --- a/src/jmap/shape/Switch/EMouse.js +++ b/src/jmap/shape/Switch/EMouse.js @@ -1,6 +1,6 @@ import Group from 'zrender/src/container/Group'; import Rect from 'zrender/src/graphic/shape/Rect'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; class EMouse extends Group { constructor(device) { super(); diff --git a/src/jmap/shape/Train/TrainBody.js b/src/jmap/shape/Train/TrainBody.js index 58596d45f..1d339a3c9 100644 --- a/src/jmap/shape/Train/TrainBody.js +++ b/src/jmap/shape/Train/TrainBody.js @@ -3,7 +3,7 @@ import TrainBodyBox from './TrainBodyBox'; import '../StationStand/EDetain'; import ETextName from '../element/ETextName'; // 名称文字 (共有) import EMouse from './EMouse'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; /** 车身*/ export default class TrainBody extends Group { diff --git a/src/jmap/shape/TrainWindow/index.js b/src/jmap/shape/TrainWindow/index.js index e432ffdcb..3403d39df 100644 --- a/src/jmap/shape/TrainWindow/index.js +++ b/src/jmap/shape/TrainWindow/index.js @@ -2,7 +2,7 @@ import Polygon from 'zrender/src/graphic/shape/Polygon'; import Group from 'zrender/src/container/Group'; import EMouse from './EMouse'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; class TrainWindow extends Group { constructor(model, style) { diff --git a/src/jmap/theme/batong_01/menus/utils/menuItemStatus.js b/src/jmap/theme/batong_01/menus/utils/menuItemStatus.js index f5f5a3ad1..dd467c4e8 100644 --- a/src/jmap/theme/batong_01/menus/utils/menuItemStatus.js +++ b/src/jmap/theme/batong_01/menus/utils/menuItemStatus.js @@ -1,4 +1,4 @@ -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import deviceState from '@/jmap/constant/deviceState'; import { OperateMode } from '@/scripts/ConstDic'; diff --git a/src/jmap/theme/beijing_01/menus/utils/menuItemStatus.js b/src/jmap/theme/beijing_01/menus/utils/menuItemStatus.js index dada7aa32..9778d96b3 100644 --- a/src/jmap/theme/beijing_01/menus/utils/menuItemStatus.js +++ b/src/jmap/theme/beijing_01/menus/utils/menuItemStatus.js @@ -1,5 +1,5 @@ import Vue from 'vue'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import deviceState from '@/jmap/constant/deviceState'; import { OperateMode } from '@/scripts/ConstDic'; diff --git a/src/jmap/theme/chengdu_03/menus/utils/menuItemStatus.js b/src/jmap/theme/chengdu_03/menus/utils/menuItemStatus.js index c1f62d7f4..3b5e29d01 100644 --- a/src/jmap/theme/chengdu_03/menus/utils/menuItemStatus.js +++ b/src/jmap/theme/chengdu_03/menus/utils/menuItemStatus.js @@ -1,4 +1,4 @@ -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import deviceState from '@/jmap/constant/deviceState'; import { OperateMode } from '@/scripts/ConstDic'; diff --git a/src/jmap/theme/chengdu_04/menus/utils/menuItemStatus.js b/src/jmap/theme/chengdu_04/menus/utils/menuItemStatus.js index 44d3cbb9a..cf14bd2b0 100644 --- a/src/jmap/theme/chengdu_04/menus/utils/menuItemStatus.js +++ b/src/jmap/theme/chengdu_04/menus/utils/menuItemStatus.js @@ -1,4 +1,4 @@ -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import deviceState from '@/jmap/constant/deviceState'; import { OperateMode } from '@/scripts/ConstDic'; diff --git a/src/jmap/theme/fuzhou_01/menus/utils/menuItemStatus.js b/src/jmap/theme/fuzhou_01/menus/utils/menuItemStatus.js index 230fc7be0..c41559f8c 100644 --- a/src/jmap/theme/fuzhou_01/menus/utils/menuItemStatus.js +++ b/src/jmap/theme/fuzhou_01/menus/utils/menuItemStatus.js @@ -1,4 +1,4 @@ -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import deviceState from '@/jmap/constant/deviceState'; import { OperateMode } from '@/scripts/ConstDic'; diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index 2c9bc2753..d893fa8bd 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -10,7 +10,7 @@ import deviceType from './constant/deviceType'; import { selectLineCode } from './config/deviceStyle'; import { deviceFactory, createBoundingRect, calculateDCenter } from './utils/parser'; import { deepAssign } from '@/utils/index'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; const renderer = 'canvas'; const devicePixelRatio = 1; diff --git a/src/jmapNew/mouseController.js b/src/jmapNew/mouseController.js index e9e12645c..de4a2928d 100644 --- a/src/jmapNew/mouseController.js +++ b/src/jmapNew/mouseController.js @@ -1,7 +1,7 @@ import deviceType from './constant/deviceType'; import Eventful from 'zrender/src/mixin/Eventful'; import * as eventTool from 'zrender/src/core/event'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; class EventModel { constructor(e) { diff --git a/src/jmapNew/shape/Section/EMouse.js b/src/jmapNew/shape/Section/EMouse.js index 77ae6aa67..c3f8c6ae7 100644 --- a/src/jmapNew/shape/Section/EMouse.js +++ b/src/jmapNew/shape/Section/EMouse.js @@ -1,7 +1,7 @@ import Group from 'zrender/src/container/Group'; import Text from 'zrender/src/graphic/Text'; import Rect from 'zrender/src/graphic/shape/Rect'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; class EMouse extends Group { constructor(device, code) { super(); diff --git a/src/jmapNew/shape/Section/index.js b/src/jmapNew/shape/Section/index.js index 8438efdf9..945584221 100644 --- a/src/jmapNew/shape/Section/index.js +++ b/src/jmapNew/shape/Section/index.js @@ -11,7 +11,7 @@ import { EBackArrow, EBackArrowTriangle } from './EBackArrow'; // 折返进路 import ELimitName from './ELimitName'; // 成都三号线 限速名称 import JTriangle from '../../utils/JTriangle'; import { drawSectionStyle } from '../../config/defaultStyle'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import Vue from 'vue'; /** 区段*/ diff --git a/src/jmapNew/shape/Switch/EMouse.js b/src/jmapNew/shape/Switch/EMouse.js index 5185dd030..e49fad194 100644 --- a/src/jmapNew/shape/Switch/EMouse.js +++ b/src/jmapNew/shape/Switch/EMouse.js @@ -1,6 +1,6 @@ import Group from 'zrender/src/container/Group'; import Rect from 'zrender/src/graphic/shape/Rect'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; class EMouse extends Group { constructor(device) { super(); diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index df3ebe68e..760cdda04 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -13,7 +13,7 @@ import EMouse from './EMouse'; import EHighlight from '../element/EHighlight'; import ERhomboid from './ERhomboid'; import ETriangle from './ETriangle'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import Vue from 'vue'; export default class Switch extends Group { diff --git a/src/jmapNew/shape/Train/TrainBody.js b/src/jmapNew/shape/Train/TrainBody.js index b24973c8c..4c504a250 100644 --- a/src/jmapNew/shape/Train/TrainBody.js +++ b/src/jmapNew/shape/Train/TrainBody.js @@ -3,7 +3,7 @@ import TrainBodyBox from './TrainBodyBox'; import '../StationStand/EDetain'; import ETextName from '../element/ETextName'; // 名称文字 (共有) import EMouse from './EMouse'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import Circle from 'zrender/src/graphic/shape/Circle'; import BoundingRect from 'zrender/src/core/BoundingRect'; diff --git a/src/jmapNew/shape/Train/index.js b/src/jmapNew/shape/Train/index.js index 600c6a838..891a6cd3d 100644 --- a/src/jmapNew/shape/Train/index.js +++ b/src/jmapNew/shape/Train/index.js @@ -4,7 +4,7 @@ import TrainBody from './TrainBody'; import BoundingRect from 'zrender/src/core/BoundingRect'; import Rect from 'zrender/src/graphic/shape/Rect'; import ETriangle from '../Train/ETriangle'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import EDirection from './EDirection'; /** 列车 */ diff --git a/src/jmapNew/shape/TrainWindow/index.js b/src/jmapNew/shape/TrainWindow/index.js index 860844258..e8209aeea 100644 --- a/src/jmapNew/shape/TrainWindow/index.js +++ b/src/jmapNew/shape/TrainWindow/index.js @@ -2,7 +2,7 @@ import Polygon from 'zrender/src/graphic/shape/Polygon'; import Group from 'zrender/src/container/Group'; import EMouse from './EMouse'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; class TrainWindow extends Group { constructor(model, style) { diff --git a/src/jmapNew/theme/beijing_01/menus/utils/menuItemStatus.js b/src/jmapNew/theme/beijing_01/menus/utils/menuItemStatus.js index dada7aa32..9778d96b3 100644 --- a/src/jmapNew/theme/beijing_01/menus/utils/menuItemStatus.js +++ b/src/jmapNew/theme/beijing_01/menus/utils/menuItemStatus.js @@ -1,5 +1,5 @@ import Vue from 'vue'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import deviceState from '@/jmap/constant/deviceState'; import { OperateMode } from '@/scripts/ConstDic'; diff --git a/src/jmapNew/theme/beijing_01/menus/utils/menuOperate.js b/src/jmapNew/theme/beijing_01/menus/utils/menuOperate.js index a4f519a67..c8a60f23d 100644 --- a/src/jmapNew/theme/beijing_01/menus/utils/menuOperate.js +++ b/src/jmapNew/theme/beijing_01/menus/utils/menuOperate.js @@ -1,4 +1,4 @@ -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; diff --git a/src/jmapNew/theme/chengdu_01/menus/utils/menuItemStatus.js b/src/jmapNew/theme/chengdu_01/menus/utils/menuItemStatus.js index bb63524dd..d4170dc30 100644 --- a/src/jmapNew/theme/chengdu_01/menus/utils/menuItemStatus.js +++ b/src/jmapNew/theme/chengdu_01/menus/utils/menuItemStatus.js @@ -1,4 +1,4 @@ -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import deviceState from '@/jmap/constant/deviceState'; import { OperateMode } from '@/scripts/ConstDic'; diff --git a/src/jmapNew/theme/chengdu_03/menus/utils/menuItemStatus.js b/src/jmapNew/theme/chengdu_03/menus/utils/menuItemStatus.js index bb63524dd..d4170dc30 100644 --- a/src/jmapNew/theme/chengdu_03/menus/utils/menuItemStatus.js +++ b/src/jmapNew/theme/chengdu_03/menus/utils/menuItemStatus.js @@ -1,4 +1,4 @@ -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import deviceState from '@/jmap/constant/deviceState'; import { OperateMode } from '@/scripts/ConstDic'; diff --git a/src/jmapNew/theme/foshan_01/menus/utils/menuItemStatus.js b/src/jmapNew/theme/foshan_01/menus/utils/menuItemStatus.js index dada7aa32..9778d96b3 100644 --- a/src/jmapNew/theme/foshan_01/menus/utils/menuItemStatus.js +++ b/src/jmapNew/theme/foshan_01/menus/utils/menuItemStatus.js @@ -1,5 +1,5 @@ import Vue from 'vue'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import deviceState from '@/jmap/constant/deviceState'; import { OperateMode } from '@/scripts/ConstDic'; diff --git a/src/jmapNew/theme/foshan_01/menus/utils/menuOperate.js b/src/jmapNew/theme/foshan_01/menus/utils/menuOperate.js index 030a78876..abaeb2ea0 100644 --- a/src/jmapNew/theme/foshan_01/menus/utils/menuOperate.js +++ b/src/jmapNew/theme/foshan_01/menus/utils/menuOperate.js @@ -1,4 +1,4 @@ -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; diff --git a/src/jmapNew/theme/fuzhou_01/menus/utils/menuItemStatus.js b/src/jmapNew/theme/fuzhou_01/menus/utils/menuItemStatus.js index bd43672d1..6263f872b 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/utils/menuItemStatus.js +++ b/src/jmapNew/theme/fuzhou_01/menus/utils/menuItemStatus.js @@ -1,4 +1,4 @@ -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import deviceState from '@/jmap/constant/deviceState'; import { OperateMode } from '@/scripts/ConstDic'; diff --git a/src/jmapNew/theme/haerbin_01/menus/utils/menuItemStatus.js b/src/jmapNew/theme/haerbin_01/menus/utils/menuItemStatus.js index bd43672d1..6263f872b 100644 --- a/src/jmapNew/theme/haerbin_01/menus/utils/menuItemStatus.js +++ b/src/jmapNew/theme/haerbin_01/menus/utils/menuItemStatus.js @@ -1,4 +1,4 @@ -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import deviceState from '@/jmap/constant/deviceState'; import { OperateMode } from '@/scripts/ConstDic'; diff --git a/src/jmapNew/theme/ningbo_01/menus/utils/menuItemStatus.js b/src/jmapNew/theme/ningbo_01/menus/utils/menuItemStatus.js index dada7aa32..9778d96b3 100644 --- a/src/jmapNew/theme/ningbo_01/menus/utils/menuItemStatus.js +++ b/src/jmapNew/theme/ningbo_01/menus/utils/menuItemStatus.js @@ -1,5 +1,5 @@ import Vue from 'vue'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import deviceState from '@/jmap/constant/deviceState'; import { OperateMode } from '@/scripts/ConstDic'; diff --git a/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js b/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js index 10e10f8f1..5dcae4248 100644 --- a/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js +++ b/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js @@ -1,4 +1,4 @@ -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; diff --git a/src/layout/mixin/ResizeHandler.js b/src/layout/mixin/ResizeHandler.js index 43dcfbd3e..199995b4c 100644 --- a/src/layout/mixin/ResizeHandler.js +++ b/src/layout/mixin/ResizeHandler.js @@ -1,4 +1,4 @@ -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; const { body } = document; const WIDTH = 1024; diff --git a/src/main.js b/src/main.js index 1111bc0cd..bf8f2874f 100644 --- a/src/main.js +++ b/src/main.js @@ -1,9 +1,7 @@ import Vue from 'vue'; import 'normalize.css/normalize.css'; // A modern alternative to CSS resets -// 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 @@ -11,10 +9,9 @@ import LangStorage from '@/utils/lang'; import App from './App'; import VueI18n from 'vue-i18n'; -import store from './store'; +import store from './store/index_APP_TARGET'; import router from './router/index_APP_TARGET'; import CancelMouseState from '@/mixin/CancelMouseState.js'; - Vue.mixin(CancelMouseState); import '@/icons'; // icon @@ -38,8 +35,7 @@ export const i18n = new VueI18n({ locale: LangStorage.getLang('zh'), messages }); - -ElementLocale.i18n((key, value) => i18n.t(key, value)); +Vue.use(ElementUI, {i18n: (key, value) => i18n.t(key, value)}); new Vue({ el: '#app', diff --git a/src/permission.js b/src/permission.js index 228986993..a22076726 100644 --- a/src/permission.js +++ b/src/permission.js @@ -1,5 +1,5 @@ import Vue from 'vue'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import router from './router/index_APP_TARGET'; import NProgress from 'nprogress'; import { admin} from './router/index_APP_TARGET'; diff --git a/src/router/index_HYD.js b/src/router/index_HYD.js index a68a92f6f..52544fafe 100644 --- a/src/router/index_HYD.js +++ b/src/router/index_HYD.js @@ -771,9 +771,9 @@ router.beforeEach((to, from, next) => { }); // 兼容 vue-router在3.1.0版本以上的路由跳转使用的是 promise 的方式 -// const originalPush = VueRouter.prototype.push; -// VueRouter.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; diff --git a/src/scripts/cmdPlugin/Handler.js b/src/scripts/cmdPlugin/Handler.js index c40a5842a..b8ce8ff28 100644 --- a/src/scripts/cmdPlugin/Handler.js +++ b/src/scripts/cmdPlugin/Handler.js @@ -1,4 +1,4 @@ -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import router from '@/router/index_APP_TARGET'; import CommandHandler from './CommandHandler.js'; import ValidateHandler from './ValidateHandler.js'; diff --git a/src/scripts/cmdPlugin/MenuContextHandler.js b/src/scripts/cmdPlugin/MenuContextHandler.js index bb6f0ee7d..854d9463a 100644 --- a/src/scripts/cmdPlugin/MenuContextHandler.js +++ b/src/scripts/cmdPlugin/MenuContextHandler.js @@ -1,4 +1,4 @@ -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import CommandHandler from './CommandHandler'; import { State2SimulationMap, State2ControlMap } from './Config'; import { OperateMode } from '@/scripts/ConstDic'; diff --git a/src/scripts/cmdPlugin/ValidateHandler.js b/src/scripts/cmdPlugin/ValidateHandler.js index 3bed8730e..1e69bf282 100644 --- a/src/scripts/cmdPlugin/ValidateHandler.js +++ b/src/scripts/cmdPlugin/ValidateHandler.js @@ -1,4 +1,4 @@ -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import LangStorage from '@/utils/lang'; import Handler from './Handler.js'; import { TrainingMode } from '@/scripts/ConstDic'; diff --git a/src/scripts/plugin/Converter/SectionOperationConverter.js b/src/scripts/plugin/Converter/SectionOperationConverter.js index 75e9d0369..5ef818977 100644 --- a/src/scripts/plugin/Converter/SectionOperationConverter.js +++ b/src/scripts/plugin/Converter/SectionOperationConverter.js @@ -1,6 +1,6 @@ import { OperationEvent, getOperateTypeBy, MapDeviceType } from '@/scripts/ConstDic'; import localStore from 'storejs'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; const SectionOperation = OperationEvent.Section; diff --git a/src/scripts/plugin/Converter/SignalRouteOperationConverter.js b/src/scripts/plugin/Converter/SignalRouteOperationConverter.js index 3baa1c8ae..daf3a1597 100644 --- a/src/scripts/plugin/Converter/SignalRouteOperationConverter.js +++ b/src/scripts/plugin/Converter/SignalRouteOperationConverter.js @@ -1,6 +1,5 @@ import { OperationEvent, getOperateTypeBy, MapDeviceType } from '@/scripts/ConstDic'; // import localStore from 'storejs'; -// import store from '@/store'; const SignalOperation = OperationEvent.Signal; diff --git a/src/scripts/plugin/OperateConvert2Command.js b/src/scripts/plugin/OperateConvert2Command.js index 2bff425c1..7beb50167 100644 --- a/src/scripts/plugin/OperateConvert2Command.js +++ b/src/scripts/plugin/OperateConvert2Command.js @@ -1,4 +1,4 @@ -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import router from '@/router/index_APP_TARGET'; import OperateHandler from '@/scripts/plugin/OperateHandler'; import { sendCommand } from '@/api/jmap/training'; diff --git a/src/scripts/plugin/OperateHandler.js b/src/scripts/plugin/OperateHandler.js index ba699447f..df540862b 100644 --- a/src/scripts/plugin/OperateHandler.js +++ b/src/scripts/plugin/OperateHandler.js @@ -1,4 +1,4 @@ -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import router from '@/router/index_APP_TARGET'; import OperateConverter from '@/scripts/plugin/OperateConvert2Command'; import { TrainingMode } from '@/scripts/ConstDic'; diff --git a/src/store/index.js b/src/store/index_Common.js similarity index 100% rename from src/store/index.js rename to src/store/index_Common.js diff --git a/src/store/index_HYD.js b/src/store/index_HYD.js new file mode 100644 index 000000000..295be5d36 --- /dev/null +++ b/src/store/index_HYD.js @@ -0,0 +1,46 @@ +import Vuex from 'vuex'; +import Vue from 'vue'; +import app from './modules/app'; +import settings from './modules/settings'; +import user from './modules/user'; +import config from './modules/config'; +import permission from './modules/permission'; +import map from './modules/map'; +import menuOperation from './modules/menuoperation'; +import training from './modules/training'; +import trainingList from './modules/trainingList'; +import exam from './modules/exam'; +import runPlan from './modules/runplan'; +import socket from './modules/socket'; +import scriptRecord from './modules/scriptRecord'; +import ibp from './modules/ibp'; +import order from './modules/order'; +import iscs from './modules/iscs'; + +import getters from './getters'; + +Vue.use(Vuex); + +const store = new Vuex.Store({ + modules: { + app, + settings, + user, + permission, + config, + map, + menuOperation, + training, + trainingList, + exam, + runPlan, + socket, + scriptRecord, + ibp, + order, + iscs + }, + getters +}); + +export default store; diff --git a/src/store/modules/exam.js b/src/store/modules/exam.js index 1079e8ef7..a3cf6583d 100644 --- a/src/store/modules/exam.js +++ b/src/store/modules/exam.js @@ -1,4 +1,4 @@ -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; const exam = { namespaced: true, diff --git a/src/store/modules/socket.js b/src/store/modules/socket.js index a89f819c6..e3e4ad1d6 100644 --- a/src/store/modules/socket.js +++ b/src/store/modules/socket.js @@ -1,4 +1,4 @@ -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import { Notification } from 'element-ui'; function handle(state, data) { diff --git a/src/utils/loaddata.js b/src/utils/loaddata.js index d4d2e8a5e..08d695429 100644 --- a/src/utils/loaddata.js +++ b/src/utils/loaddata.js @@ -1,4 +1,4 @@ -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import { getPublishMapVersionById, getPublishMapDetailById} from '@/api/jmap/map'; import { getNewMapDataByGroup } from '@/api/simulation'; diff --git a/src/utils/request.js b/src/utils/request.js index d8d2f83c3..214f5d288 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,5 +1,5 @@ import axios from 'axios'; -import store from '../store'; +import store from '@/store/index_APP_TARGET'; import { i18n } from '@/main.js'; import { MessageBox } from 'element-ui'; import { getToken } from '@/utils/auth'; diff --git a/src/utils/runPlan.js b/src/utils/runPlan.js index ff2d0b985..32342e4e3 100644 --- a/src/utils/runPlan.js +++ b/src/utils/runPlan.js @@ -1,4 +1,4 @@ -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; import { timeFormat } from '@/utils/date'; /** 创建一个车次数据点*/ diff --git a/src/utils/sock.js b/src/utils/sock.js index 66eeb5ca1..dfa76679c 100644 --- a/src/utils/sock.js +++ b/src/utils/sock.js @@ -2,7 +2,7 @@ import { getToken } from '@/utils/auth'; import { checkLoginLine } from '@/api/login'; import { getBaseUrl } from '@/utils/baseUrl'; import { MessageBox, Message } from 'element-ui'; -import store from '../store'; +import store from '@/store/index_APP_TARGET'; import SockJS from 'sockjs-client'; import Stomp from 'stompjs'; diff --git a/src/utils/stomp.js b/src/utils/stomp.js index 87ff7f943..2febbf668 100644 --- a/src/utils/stomp.js +++ b/src/utils/stomp.js @@ -1,6 +1,6 @@ import Vue from 'vue'; import StompClient from '@/utils/sock'; -import store from '@/store'; +import store from '@/store/index_APP_TARGET'; export const displayTopic = '/user/queue/simulation'; // 其他仿真topic export const perpetualTopic = '/user/topic/message'; // 公用topic diff --git a/vue.config.js b/vue.config.js index 62c1a3a1f..fa3c08d41 100644 --- a/vue.config.js +++ b/vue.config.js @@ -103,7 +103,7 @@ module.exports = { '@': path.resolve('src') } }; - var appTarget = process.env.NODE_ENV === 'Local' || process.env.VUE_APP_PRO === 'local' ? 'HYD' : 'Common'; + const appTarget = process.env.NODE_ENV === 'Local' || process.env.VUE_APP_PRO === 'local' ? 'HYD' : 'Common'; config.plugins.push(new webpack.NormalModuleReplacementPlugin(/(.*)_APP_TARGET(\.*)/, function (resourse) { resourse.request = resourse.request.replace(/APP_TARGET/, `${appTarget}`); @@ -116,8 +116,7 @@ module.exports = { ignore: ['.*'] } ])); - - config.externals = { // 配置使用CDN + const externalsConfig = { 'vue': 'Vue', 'vuex': 'Vuex', 'vue-router': 'VueRouter', @@ -125,7 +124,7 @@ module.exports = { 'echarts': 'echarts', 'element-ui': 'ELEMENT' }; - + config.externals = process.env.NODE_ENV === 'Local' || process.env.VUE_APP_PRO === 'local' ? {} : externalsConfig; // 配置CDN使用 }, // webpack配置 chainWebpack(config) {