coding
This commit is contained in:
parent
1527623e2a
commit
90717f5f27
|
@ -15,6 +15,32 @@
|
||||||
</div>
|
</div>
|
||||||
</Grid>
|
</Grid>
|
||||||
</ModuleWrapper>
|
</ModuleWrapper>
|
||||||
|
<ModuleWrapper title="全部房间" style="grid-column: 1 / 3">
|
||||||
|
<template #extra>
|
||||||
|
<a-button type="primary">新建房间</a-button>
|
||||||
|
</template>
|
||||||
|
<div class="normal flex-c ai-c" v-loading="room.loading">
|
||||||
|
<Grid class="room-wrapper" :columns="[1, 1, 1, 1, 1]" :rows="[1, 1]">
|
||||||
|
<div v-for="item in room.list" :key="item.id" class="room-item">
|
||||||
|
<img class="room-image" :src="item.image || '/mockData/68ab3707-2552-4b78-bfc0-cec3502ec62f.png'" alt="" />
|
||||||
|
<div class="room-mask"></div>
|
||||||
|
<div class="room-brief">
|
||||||
|
<div class="room-name">{{ item.name }}</div>
|
||||||
|
<div class="room-author">{{ item.author }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="room-reload" title="进入房间" @click="handleJoinRoom(item)">
|
||||||
|
<a-icon type="reload" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Grid>
|
||||||
|
<a-pagination
|
||||||
|
v-model="room.pagination.current"
|
||||||
|
:pageSize.sync="room.pagination.pageSize"
|
||||||
|
:total="room.pagination.total"
|
||||||
|
@change="getRoomList"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</ModuleWrapper>
|
||||||
<ModuleWrapper v-if="!loadedScenario" title="全部想定" style="grid-column: 1 / 3">
|
<ModuleWrapper v-if="!loadedScenario" title="全部想定" style="grid-column: 1 / 3">
|
||||||
<div class="normal flex-c ai-c" v-loading="loading">
|
<div class="normal flex-c ai-c" v-loading="loading">
|
||||||
<Grid class="scenario-wrapper" :columns="[1, 1, 1, 1, 1]" :rows="[1, 1]">
|
<Grid class="scenario-wrapper" :columns="[1, 1, 1, 1, 1]" :rows="[1, 1]">
|
||||||
|
@ -159,6 +185,22 @@ export default {
|
||||||
name: 'SimulationSceneCentralControl',
|
name: 'SimulationSceneCentralControl',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
ws: null,
|
||||||
|
|
||||||
|
room: {
|
||||||
|
list: [],
|
||||||
|
loading: false,
|
||||||
|
pagination: {
|
||||||
|
current: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
scenario: {
|
||||||
|
list: [],
|
||||||
|
},
|
||||||
|
|
||||||
scenarioList: [],
|
scenarioList: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
loadedScenario: '',
|
loadedScenario: '',
|
||||||
|
@ -193,11 +235,42 @@ export default {
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.initWebsocket()
|
||||||
this.getSystemModules()
|
this.getSystemModules()
|
||||||
|
this.getRoomList()
|
||||||
this.getScenarioList()
|
this.getScenarioList()
|
||||||
},
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
this.ws.close()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(['getSystemModules']),
|
...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() {
|
async getScenarioList() {
|
||||||
try {
|
try {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
|
@ -295,6 +368,63 @@ export default {
|
||||||
border-color: #00f2fe;
|
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 {
|
.scenario-wrapper {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user