@@ -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%;