From 90717f5f27eb794e7224904e3c27428fb69232df Mon Sep 17 00:00:00 2001 From: liaoboping <2824044657@qq.com> Date: Thu, 21 Aug 2025 16:14:50 +0800 Subject: [PATCH] coding --- .../simulationScene/centralControl/index.vue | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) diff --git a/src/views/simulationScene/centralControl/index.vue b/src/views/simulationScene/centralControl/index.vue index 765dca1..e1304b4 100644 --- a/src/views/simulationScene/centralControl/index.vue +++ b/src/views/simulationScene/centralControl/index.vue @@ -15,6 +15,32 @@ + + +
+ +
+ +
+
+
{{ item.name }}
+
{{ item.author }}
+
+
+ +
+
+
+ +
+
@@ -159,6 +185,22 @@ export default { name: 'SimulationSceneCentralControl', data() { return { + ws: null, + + room: { + list: [], + loading: false, + pagination: { + current: 1, + pageSize: 10, + total: 0, + }, + }, + + scenario: { + list: [], + }, + scenarioList: [], loading: false, loadedScenario: '', @@ -193,11 +235,42 @@ export default { }), }, created() { + this.initWebsocket() this.getSystemModules() + this.getRoomList() this.getScenarioList() }, + beforeDestroy() { + this.ws.close() + }, methods: { ...mapActions(['getSystemModules']), + initWebsocket() { + this.ws = new window.MyWebsocket('/', (error, data) => { + if (error) return + console.log('----data----', data) + }) + }, + async getRoomList() { + try { + this.loading = true + const res = await this.$http({ + url: '/baseData/room/list', + method: 'get', + params: { + pageNum: this.room.pagination.current, + pageSize: this.room.pagination.pageSize, + }, + }) + this.room.list = res.data.data + this.room.pagination.total = res.data.totalCount + } catch (error) { + console.log(error) + } finally { + this.loading = false + } + }, + handleJoinRoom(item) {}, async getScenarioList() { try { this.loading = true @@ -295,6 +368,63 @@ export default { border-color: #00f2fe; } +.room-wrapper { + flex: 1; + width: 100%; + overflow: hidden; + margin-bottom: 20px; +} +.room-item { + position: relative; + cursor: pointer; + .room-image { + width: 100%; + height: 100%; + object-fit: cover; + } + .room-mask { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); + } + .room-brief { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 60px; + background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 1)); + padding-left: 10px; + .room-name { + font-size: 20px; + line-height: 36px; + } + .room-author { + font-size: 12px; + line-height: 24px; + } + } + .room-reload { + position: absolute; + right: 20px; + bottom: 10px; + width: 40px; + height: 40px; + font-size: 40px; + line-height: 1; + display: none; + } + &:hover .room-reload { + display: block; + } + .room-reload:hover { + color: #00f2fe; + } +} + .scenario-wrapper { flex: 1; width: 100%;