|
@@ -11,7 +11,7 @@
|
|
|
<div
|
|
<div
|
|
|
class="device-content-item"
|
|
class="device-content-item"
|
|
|
:class="{active:item.check}"
|
|
:class="{active:item.check}"
|
|
|
- @click="item.check=!item.check && showBar"
|
|
|
|
|
|
|
+ @click="item.check= !item.check && showBar"
|
|
|
>
|
|
>
|
|
|
<n-image
|
|
<n-image
|
|
|
width="50"
|
|
width="50"
|
|
@@ -59,16 +59,16 @@ const deviceList = ref([
|
|
|
{ check: false, url: new URL('./img/1.png', import.meta.url).href },
|
|
{ check: false, url: new URL('./img/1.png', import.meta.url).href },
|
|
|
{ check: false, url: new URL('./img/1.png', import.meta.url).href }
|
|
{ check: false, url: new URL('./img/1.png', import.meta.url).href }
|
|
|
])
|
|
])
|
|
|
-const showBar = computed(() => router.options.history.state.back === '/create')
|
|
|
|
|
|
|
+const backRoute:{[key:string]:string} = { '/list': '/list', '/create': '/room' }
|
|
|
|
|
+const showBar = computed(() => !!(backRoute[router.options.history.state.back as string]))
|
|
|
|
|
|
|
|
function change() {
|
|
function change() {
|
|
|
- console.log('跳转到设备list')
|
|
|
|
|
- router.push('/room')
|
|
|
|
|
|
|
+ router.push(backRoute[router.options.history.state.back as string])
|
|
|
store.setRoomData(null)
|
|
store.setRoomData(null)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
- console.log(123, store.newRoomData)
|
|
|
|
|
|
|
+ console.log(123, store.newRoomData, router.options.history.state)
|
|
|
})
|
|
})
|
|
|
</script>
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
@@ -87,7 +87,7 @@ onMounted(() => {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-wrap: wrap;
|
|
flex-wrap: wrap;
|
|
|
align-content: flex-start;
|
|
align-content: flex-start;
|
|
|
- height: calc(100% - 86px);
|
|
|
|
|
|
|
+ height: calc(100% - 96px);
|
|
|
overflow-y: auto;
|
|
overflow-y: auto;
|
|
|
gap: 15px;
|
|
gap: 15px;
|
|
|
|
|
|
|
@@ -137,7 +137,7 @@ onMounted(() => {
|
|
|
|
|
|
|
|
&-bar {
|
|
&-bar {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
- height: 40px;
|
|
|
|
|
|
|
+ height: 50px;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|