diff --git a/package.json b/package.json index b097aa46f..fae095787 100644 --- a/package.json +++ b/package.json @@ -17,11 +17,14 @@ }, "dependencies": { "axios": "0.18.0", + "echarts": "^4.7.0", + "element-ui": "^2.7.2", "file-saver": "^1.3.3", "js-cookie": "2.2.0", "js-md5": "^0.7.3", "lodash": "^4.17.11", "normalize.css": "7.0.0", + "nprogress": "^0.2.0", "path-to-regexp": "2.4.0", "qrcode.vue": "^1.6.2", "script-loader": "^0.7.2", @@ -30,8 +33,11 @@ "stompjs": "^2.3.3", "storejs": "^1.0.25", "three": "^0.107.0", + "vue": "^2.6.10", "vue-i18n": "^8.12.0", + "vue-router": "^3.1.6", "vuedraggable": "^2.23.2", + "vuex": "^3.1.0", "xlsx": "^0.14.2", "zrender": "^4.0.4" }, @@ -51,7 +57,7 @@ "babel-preset-env": "1.6.1", "babel-preset-stage-2": "6.24.1", "chalk": "2.4.2", - "compression-webpack-plugin": "^3.0.0", + "compression-webpack-plugin": "^3.1.0", "connect": "3.6.6", "copy-webpack-plugin": "^4.5.2", "eslint": "5.15.3", @@ -67,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 29a987a35..032c92604 100644 --- a/public/index.html +++ b/public/index.html @@ -6,24 +6,25 @@ - - + <%= webpackConfig.name %> - - - - - - - - - - - + <% 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.js b/src/i18n/langs/en/index_Common.js similarity index 96% rename from src/i18n/langs/en/index.js rename to src/i18n/langs/en/index_Common.js index edfbe50bb..a9afb2e9d 100644 --- a/src/i18n/langs/en/index.js +++ b/src/i18n/langs/en/index_Common.js @@ -1,4 +1,3 @@ -// import enLocale from 'element-ui/lib/locale/lang/en'; import ELEMENT from 'element-ui'; import map from './map'; import global from './global'; diff --git a/src/i18n/langs/en/index_HYD.js b/src/i18n/langs/en/index_HYD.js new file mode 100644 index 000000000..6b247f001 --- /dev/null +++ b/src/i18n/langs/en/index_HYD.js @@ -0,0 +1,63 @@ +import enLocale from 'element-ui/lib/locale/lang/en'; +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 { + enLocale, + 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/tip.js b/src/i18n/langs/en/tip.js index 2a9a6daac..91c39c666 100644 --- a/src/i18n/langs/en/tip.js +++ b/src/i18n/langs/en/tip.js @@ -233,5 +233,6 @@ export default { stopPointOffsetTip: 'Set block stop offset in bulk successfully!', mapSortSuccessfully: 'Map sort successfully!', mapSortFailed: 'Map sort failed', - enterTrainingRoomFailed: 'Failed to enter the comprehensive drill, please consult the administrator is still in the room!' + enterTrainingRoomFailed: 'Failed to enter the comprehensive drill, please consult the administrator is still in the room!', + failedToAddNewRoom: 'Failed to add new room' }; diff --git a/src/i18n/langs/zh/index.js b/src/i18n/langs/zh/index_Common.js similarity index 96% rename from src/i18n/langs/zh/index.js rename to src/i18n/langs/zh/index_Common.js index 14bb3e3ad..48ee88d10 100644 --- a/src/i18n/langs/zh/index.js +++ b/src/i18n/langs/zh/index_Common.js @@ -1,4 +1,3 @@ -// import cnLocale from 'element-ui/lib/locale/lang/zh-CN'; import ELEMENT from 'element-ui'; import map from './map'; import global from './global'; diff --git a/src/i18n/langs/zh/index_HYD.js b/src/i18n/langs/zh/index_HYD.js new file mode 100644 index 000000000..3974061e3 --- /dev/null +++ b/src/i18n/langs/zh/index_HYD.js @@ -0,0 +1,63 @@ +import cnLocale from 'element-ui/lib/locale/lang/zh-CN'; +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 { + cnLocale, + 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/tip.js b/src/i18n/langs/zh/tip.js index d33ed76a3..373531735 100644 --- a/src/i18n/langs/zh/tip.js +++ b/src/i18n/langs/zh/tip.js @@ -233,5 +233,6 @@ export default { stopPointOffsetTip: '批量设置区段停车点偏移量成功!', mapSortSuccessfully: '地图排序成功!', mapSortFailed: '地图排序失败!', - enterTrainingRoomFailed: '进入综合演练失败,请咨询管理员是否还在房间内!' + enterTrainingRoomFailed: '进入综合演练失败,请咨询管理员是否还在房间内!', + failedToAddNewRoom: '加入新房间失败' }; 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 ee5c9ceaa..aad226366 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/EDirection.js b/src/jmapNew/shape/Train/EDirection.js index aee22e8f5..0cb36290e 100644 --- a/src/jmapNew/shape/Train/EDirection.js +++ b/src/jmapNew/shape/Train/EDirection.js @@ -36,18 +36,6 @@ class EDirection extends Group { this.create(); this.arrow.setStyle('fill', color); } - - // 隐藏 - hide() { - this.create(); - this.arrow.hide(); - } - - // 显示 - show() { - this.create(); - this.arrow.show(); - } } export default EDirection; 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/components/Entry.vue b/src/layout/components/Entry.vue index cc9188a2d..885311959 100644 --- a/src/layout/components/Entry.vue +++ b/src/layout/components/Entry.vue @@ -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'); diff --git a/src/layout/components/Qcode.vue b/src/layout/components/Qcode.vue index 282713f1b..392ae707d 100644 --- a/src/layout/components/Qcode.vue +++ b/src/layout/components/Qcode.vue @@ -45,7 +45,8 @@ export default { } this.dialogShow = false; } catch (error) { - this.$messageBox(`${this.$t('error.scanningError')}:${error.message}`); + const errorMessage = this.isShow ? this.$t('tip.failedToAddNewRoom') : this.$t('error.scanningError'); + this.$messageBox(`${errorMessage}:${error.message}`); } finally { this.loading = false; } 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 5459a0b5f..bf8f2874f 100644 --- a/src/main.js +++ b/src/main.js @@ -1,18 +1,17 @@ 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 'element-ui/lib/theme-chalk/index.css'; import '@/styles/index.scss'; // global css 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 @@ -27,7 +26,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; @@ -36,8 +35,7 @@ export const i18n = new VueI18n({ locale: LangStorage.getLang('zh'), messages }); - -ELEMENT.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 3437b509a..52544fafe 100644 --- a/src/router/index_HYD.js +++ b/src/router/index_HYD.js @@ -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'); @@ -756,7 +756,7 @@ export const asyncRouter = [ } ]; -const createRouter = () => new Router({ +const createRouter = () => new VueRouter({ mode: 'history', // require service support scrollBehavior: () => ({ y: 0 }), routes: constantRoutes @@ -771,8 +771,8 @@ router.beforeEach((to, from, next) => { }); // 兼容 vue-router在3.1.0版本以上的路由跳转使用的是 promise 的方式 -const originalPush = Router.prototype.push; -Router.prototype.push = function push(location) { +const originalPush = VueRouter.prototype.push; +VueRouter.prototype.push = function push(location) { return originalPush.call(this, location).catch(err => err); }; 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 48e0d2868..3ec7adf69 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 96% rename from src/store/index.js rename to src/store/index_Common.js index a994e562f..3d4220bed 100644 --- a/src/store/index.js +++ b/src/store/index_Common.js @@ -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: { 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/src/views/newMap/displayNew/menuSchema.vue b/src/views/newMap/displayNew/menuSchema.vue index 4ee53e07e..db1df16b0 100644 --- a/src/views/newMap/displayNew/menuSchema.vue +++ b/src/views/newMap/displayNew/menuSchema.vue @@ -64,7 +64,7 @@ export default { } }, stationList: { - type: Object, + type: Array, default() { return []; } diff --git a/src/views/newMap/jlmapNew/pendant/switchStation.vue b/src/views/newMap/jlmapNew/pendant/switchStation.vue index 7924a4084..99fa14001 100644 --- a/src/views/newMap/jlmapNew/pendant/switchStation.vue +++ b/src/views/newMap/jlmapNew/pendant/switchStation.vue @@ -10,7 +10,7 @@ export default { name: 'SwitchStation', props: { concentrationStationList: { - type: String, + type: Array, default() { return []; } diff --git a/vue.config.js b/vue.config.js index ec52dd3f0..fa3c08d41 100644 --- a/vue.config.js +++ b/vue.config.js @@ -6,7 +6,7 @@ const defaultSettings = require('./src/settings.js'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const webpack = require('webpack'); -// const CompressionPlugin = require('compression-webpack-plugin'); +const CompressionPlugin = require('compression-webpack-plugin'); // const productionGzipExtensions = ['js', 'css']; // const isProduction = process.env.NODE_ENV === 'production'; @@ -86,6 +86,16 @@ module.exports = { // // 为开发环境修改配置... // config.mode = 'development'; // } + if (process.env.NODE_ENV !== 'development') { + config.plugins.push(new CompressionPlugin({ + filename: '[path].gz[query]', + algorithm: 'gzip', + test:/\.js$|\.html$|.\css/, // 匹配文件名 + threshold: 10240, // 对超过10k的数据压缩 + minRatio: 0.8, // 只有压缩好这个比率的资产才能被处理 + deleteOriginalAssets: true + })); + } config.name = name; config.resolve = { extensions: ['.js', '.vue', '.json'], @@ -93,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}`); @@ -106,8 +116,7 @@ module.exports = { ignore: ['.*'] } ])); - - config.externals = { // 配置使用CDN + const externalsConfig = { 'vue': 'Vue', 'vuex': 'Vuex', 'vue-router': 'VueRouter', @@ -115,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) {