diff --git a/.env.development b/.env.development index e775b57..37cff62 100644 --- a/.env.development +++ b/.env.development @@ -2,5 +2,4 @@ NODE_ENV=development VUE_APP_PREVIEW=true VUE_APP_API_BASE_URL=/api VUE_APP_API_URL=http://192.168.0.189:8099 -VUE_APP_WEBSOCKET_URL=ws://192.168.0.96:9001 -VUE_APP_MAPVIEW_URL = ws://192.168.0.189:8099 \ No newline at end of file +VUE_APP_MAPVIEW_URL = ws://192.168.0.189:8099 diff --git a/.env.production b/.env.production index b55556a..faa5370 100644 --- a/.env.production +++ b/.env.production @@ -2,4 +2,3 @@ NODE_ENV=production VUE_APP_PREVIEW=true VUE_APP_API_BASE_URL=/api VUE_APP_API_URL=http://192.168.0.189:8099 -VUE_APP_WEBSOCKET_URL=ws://192.168.0.96:9001 \ No newline at end of file diff --git a/public/config.js b/public/config.js index 746bf24..e81bcb4 100644 --- a/public/config.js +++ b/public/config.js @@ -1,3 +1,4 @@ +// @ts-ignore window._CONFIG = { ImageryProviderUrl: '/map/mapWX/{z}/{x}/{y}.jpg', RoadProviderUrl: '', @@ -6,5 +7,6 @@ window._CONFIG = { clientId: '0123456789', evaluationSrc: 'http://127.0.0.1:8000', VUE_APP_API_URL: 'http://192.168.0.189:8099', + VUE_APP_WEBSOCKET_URL: 'ws://192.168.0.189:8099', VUE_APP_MAPVIEW_URL:'ws://192.168.0.189:8099' } diff --git a/src/assets/images/control/u155.png b/src/assets/images/control/u155.png new file mode 100644 index 0000000..e7df149 Binary files /dev/null and b/src/assets/images/control/u155.png differ diff --git a/src/assets/images/control/u157.png b/src/assets/images/control/u157.png new file mode 100644 index 0000000..87c37b9 Binary files /dev/null and b/src/assets/images/control/u157.png differ diff --git a/src/assets/images/control/u159.png b/src/assets/images/control/u159.png new file mode 100644 index 0000000..12a10bf Binary files /dev/null and b/src/assets/images/control/u159.png differ diff --git a/src/assets/images/control/u161.png b/src/assets/images/control/u161.png new file mode 100644 index 0000000..5d09184 Binary files /dev/null and b/src/assets/images/control/u161.png differ diff --git a/src/assets/images/control/u163.png b/src/assets/images/control/u163.png new file mode 100644 index 0000000..301d7da Binary files /dev/null and b/src/assets/images/control/u163.png differ diff --git a/src/components/Common/Layout/ModuleWrapper.vue b/src/components/Common/Layout/ModuleWrapper.vue index d770e42..abbb63b 100644 --- a/src/components/Common/Layout/ModuleWrapper.vue +++ b/src/components/Common/Layout/ModuleWrapper.vue @@ -47,7 +47,7 @@ export default { font-weight: bold; line-height: 26px; letter-spacing: 2px; - color: #00deff; + color: #00d5fe; padding: 0 8px; } } diff --git a/src/components/Common/Websocket/index.js b/src/components/Common/Websocket/index.js index 11767f9..5d18555 100644 --- a/src/components/Common/Websocket/index.js +++ b/src/components/Common/Websocket/index.js @@ -6,7 +6,7 @@ export default class MyWebSocket { */ constructor(path, messageCallback) { // 拼接完整 WebSocket 地址 - const baseUrl = process.env.VUE_APP_WEBSOCKET_URL + const baseUrl = window._CONFIG.VUE_APP_WEBSOCKET_URL this.url = new URL(path, baseUrl).href.replace(/^http/, 'ws') this.messageCallback = messageCallback this.reconnectAttempts = 0 diff --git a/src/config/router.config.js b/src/config/router.config.js index 20da6d4..59e6a42 100644 --- a/src/config/router.config.js +++ b/src/config/router.config.js @@ -82,12 +82,52 @@ export const constantRouterMap = [ }, ], }, + { + path: '/subsystem', + name: 'Subsystem', + component: () => import(/* webpackChunkName: "fail" */ '@/views/subsystem/index.vue'), + redirect: '/404', + children: [ + { + path: '/subsystem/control', + name: 'SubsystemControl', + component: () => import(/* webpackChunkName: "fail" */ '@/views/subsystem/control/index.vue'), + meta: { title: '系统控制子系统' }, + }, + // { + // path: '/subsystem/database', + // name: 'SimulationSceneDatabase', + // component: () => import(/* webpackChunkName: "fail" */ '@/views/subsystem/database/index.vue'), + // meta: { title: '数据库子系统' }, + // }, + // { + // path: '/subsystem/simulationModel', + // name: 'SimulationSceneSimulationModel', + // component: () => import(/* webpackChunkName: "fail" */ '@/views/subsystem/simulationModel/index.vue'), + // meta: { title: '仿真模型子系统' }, + // }, + // { + // path: '/subsystem/sceneEditing', + // name: 'SimulationSceneSceneEditing', + // component: () => import(/* webpackChunkName: "fail" */ '@/views/subsystem/sceneEditing/index.vue'), + // meta: { title: '场景编辑子系统' }, + // }, + // { + // path: '/subsystem/display', + // name: 'SimulationSceneDisplay', + // component: () => import(/* webpackChunkName: "fail" */ '@/views/subsystem/display/index.vue'), + // meta: { title: '显示子系统' }, + // }, + // { + // path: '/subsystem/evaluation', + // name: 'SimulationSceneEvaluation', + // component: () => import(/* webpackChunkName: "fail" */ '@/views/subsystem/evaluation/index.vue'), + // meta: { title: '评估子系统' }, + // }, + ], + }, { path: '/404', component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404'), }, - { - path: '*', - redirect: '/404', - }, ] diff --git a/src/views/subsystem/control/index.vue b/src/views/subsystem/control/index.vue new file mode 100644 index 0000000..6e9855c --- /dev/null +++ b/src/views/subsystem/control/index.vue @@ -0,0 +1,382 @@ + + + + + diff --git a/src/views/subsystem/index.vue b/src/views/subsystem/index.vue new file mode 100644 index 0000000..aa725b3 --- /dev/null +++ b/src/views/subsystem/index.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/src/views/user/Welcome.vue b/src/views/user/Welcome.vue index c1571c2..4ca7a5a 100644 --- a/src/views/user/Welcome.vue +++ b/src/views/user/Welcome.vue @@ -28,6 +28,7 @@ import { mapState } from 'vuex' export default { data() { return { + openChildren: [], systemPathMap: { db_system: '/simulationScene/database', simulation_system: '/simulationScene/simulationModel', @@ -40,7 +41,7 @@ export default { moduleCode: 'db_system', moduleName: '数据库子系统', icon: require('@/assets/images/simulation-scene/system-icon/database.png'), - modulePath: '/simulationScene/database', + modulePath: '/databaseSystem/zzllsjk', }, { moduleCode: 'simulation_system', @@ -64,13 +65,13 @@ export default { moduleCode: 'evaluation_system', moduleName: '评估子系统', icon: require('@/assets/images/simulation-scene/system-icon/evaluation.png'), - modulePath: '/simulationScene/evaluation', + modulePath: window._CONFIG.evaluationSrc, }, { moduleCode: 'control_system', moduleName: '系统控制子系统', icon: require('@/assets/images/simulation-scene/system-icon/database.png'), - modulePath: '/simulationScene/centralControl', + modulePath: '/subSystem/control', }, ], } @@ -80,16 +81,26 @@ export default { userInfo: (state) => state.user.info, }), }, + created() { + window.addEventListener('beforeunload', (e) => { + this.openChildren.forEach((childWindow) => { + childWindow && childWindow.close() + }) + return true // 必须设置 returnValue 才能显示确认框 + }) + }, methods: { handleClick(module) { - window.open( - window.location.origin + module.modulePath, - '_blank', - 'height=' + - window.screen.height + - ',width=' + - window.screen.width + - ',top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no' + this.openChildren.push( + window.open( + module.modulePath, + '_blank', + 'height=' + + window.screen.height + + ',width=' + + window.screen.width + + ',top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no' + ) ) }, }, @@ -101,7 +112,7 @@ export default { font-size: 20px; line-height: 50px; font-weight: bolder; - color: #00deff; + color: #00d5fe; letter-spacing: 2px; margin: 0 20px; } @@ -120,6 +131,6 @@ export default { } } .module-block:hover { - border-color: #00deff; + border-color: #00d5fe; }