|
@@ -3,7 +3,7 @@
|
|
<div v-if="project">{{ project.projectName }}</div>
|
|
<div v-if="project">{{ project.projectName }}</div>
|
|
<div class="sync">
|
|
<div class="sync">
|
|
<button @click="onCancel">取消</button>
|
|
<button @click="onCancel">取消</button>
|
|
- <button type="submit" @click="onSubmit">同步</button>
|
|
|
|
|
|
+ <button type="submit" @click="onSubmit" :class="{ active: points.p1 && points.p2 }">同步</button>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
</header>
|
|
<header v-else>
|
|
<header v-else>
|
|
@@ -29,6 +29,14 @@
|
|
</div>
|
|
</div>
|
|
<Login v-if="showLogin" @close="showLogin = false" @user="info => (user = info)" />
|
|
<Login v-if="showLogin" @close="showLogin = false" @user="info => (user = info)" />
|
|
</header>
|
|
</header>
|
|
|
|
+ <footer v-if="props.showAdjust">
|
|
|
|
+ <h4>为场景设置关联位置</h4>
|
|
|
|
+ <div>请选择位置,确认左右视图中的场景在同一位置后,单击右侧按钮将其设为关联位置。</div>
|
|
|
|
+ <div class="points">
|
|
|
|
+ <button @click="onSetP1" :class="{ active: points.p1 }">设为P1</button>
|
|
|
|
+ <button @click="onSetP2" :class="{ active: points.p2 }">设为P2</button>
|
|
|
|
+ </div>
|
|
|
|
+ </footer>
|
|
</template>
|
|
</template>
|
|
<script setup>
|
|
<script setup>
|
|
import { ref, defineProps, onMounted } from 'vue'
|
|
import { ref, defineProps, onMounted } from 'vue'
|
|
@@ -37,11 +45,24 @@ import browser from '@/utils/browser'
|
|
import Login from './Login'
|
|
import Login from './Login'
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
project: Object,
|
|
project: Object,
|
|
- showAdjust:Boolean
|
|
|
|
|
|
+ showAdjust: Boolean,
|
|
})
|
|
})
|
|
|
|
+const emits = defineEmits(['update'])
|
|
|
|
|
|
const user = ref(null)
|
|
const user = ref(null)
|
|
|
|
+const points = ref({ p1: null, p2: null })
|
|
const showLogin = ref(false)
|
|
const showLogin = ref(false)
|
|
|
|
+
|
|
|
|
+const onSetP1 = () => {
|
|
|
|
+ points.value.p1 = { id: 0, position: { x: 1, y: 1, z: 1 } }
|
|
|
|
+ emits('update','p1')
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+const onSetP2 = () => {
|
|
|
|
+ points.value.p2 = { id: 0, position: { x: 1, y: 1, z: 1 } }
|
|
|
|
+ emits('update','p2')
|
|
|
|
+}
|
|
|
|
+
|
|
const getUserInfo = () => {
|
|
const getUserInfo = () => {
|
|
http.post(`smart-site/getUserInfo`)
|
|
http.post(`smart-site/getUserInfo`)
|
|
.then(response => {
|
|
.then(response => {
|
|
@@ -58,8 +79,9 @@ const getUserInfo = () => {
|
|
})
|
|
})
|
|
.catch(() => {})
|
|
.catch(() => {})
|
|
}
|
|
}
|
|
-const onLogout = ()=>[
|
|
|
|
- http.post(`smart-site/fdLogout`)
|
|
|
|
|
|
+const onLogout = () => [
|
|
|
|
+ http
|
|
|
|
+ .post(`smart-site/fdLogout`)
|
|
.then(response => {
|
|
.then(response => {
|
|
if (response.success) {
|
|
if (response.success) {
|
|
localStorage.removeItem('token')
|
|
localStorage.removeItem('token')
|
|
@@ -69,21 +91,24 @@ const onLogout = ()=>[
|
|
user.value = null
|
|
user.value = null
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- .catch(() => {})
|
|
|
|
-
|
|
|
|
|
|
+ .catch(() => {}),
|
|
]
|
|
]
|
|
-const onCancel = () =>{
|
|
|
|
- window.location.href = window.location.href.replace('&adjust','')
|
|
|
|
|
|
+const onCancel = () => {
|
|
|
|
+ window.location.href = window.location.href.replace('&adjust', '')
|
|
}
|
|
}
|
|
-const onSubmit =()=>{
|
|
|
|
- http.post(`smart-site/fdLogout`)
|
|
|
|
|
|
+const onSubmit = () => {
|
|
|
|
+ http.post(`smart-site/project/updatePanos`, {
|
|
|
|
+ projet_id: props.project.projectId,
|
|
|
|
+ panos: JSON.stringify(points.value),
|
|
|
|
+ })
|
|
.then(response => {
|
|
.then(response => {
|
|
if (response.success) {
|
|
if (response.success) {
|
|
- window.location.href = window.location.href.replace('&adjust','&split')
|
|
|
|
|
|
+ window.location.href = window.location.href.replace('&adjust', '&split')
|
|
}
|
|
}
|
|
})
|
|
})
|
|
.catch(() => {})
|
|
.catch(() => {})
|
|
}
|
|
}
|
|
|
|
+
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
if (localStorage.getItem('token')) {
|
|
if (localStorage.getItem('token')) {
|
|
getUserInfo()
|
|
getUserInfo()
|
|
@@ -106,6 +131,48 @@ header {
|
|
align-items: center;
|
|
align-items: center;
|
|
font-size: 16px;
|
|
font-size: 16px;
|
|
}
|
|
}
|
|
|
|
+footer {
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: 0;
|
|
|
|
+ bottom: 0;
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 90px;
|
|
|
|
+ color: rgba(255, 255, 255, 0.8);
|
|
|
|
+ backdrop-filter: blur(4px);
|
|
|
|
+ background: rgba(27, 27, 28, 0.8);
|
|
|
|
+ z-index: 99999;
|
|
|
|
+ padding: 20px 24px;
|
|
|
|
+ h4 {
|
|
|
|
+ font-size: 20px;
|
|
|
|
+ margin: 0;
|
|
|
|
+ padding: 0;
|
|
|
|
+ color: #fff;
|
|
|
|
+ margin-bottom: 14px;
|
|
|
|
+ }
|
|
|
|
+ .points {
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 20px;
|
|
|
|
+ right: 0;
|
|
|
|
+ bottom: 20px;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ button {
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ outline: none;
|
|
|
|
+ color: #0076f6;
|
|
|
|
+ margin-right: 24px;
|
|
|
|
+ width: 160px;
|
|
|
|
+ height: 36px;
|
|
|
|
+ background: transparent;
|
|
|
|
+ border: 1px solid #0076f6;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ &.active {
|
|
|
|
+ background: #0076f6;
|
|
|
|
+ color: #fff;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
.user {
|
|
.user {
|
|
position: absolute;
|
|
position: absolute;
|
|
top: 0;
|
|
top: 0;
|
|
@@ -155,8 +222,8 @@ header {
|
|
border-width: 0 0 5px 5px;
|
|
border-width: 0 0 5px 5px;
|
|
border-style: solid;
|
|
border-style: solid;
|
|
}
|
|
}
|
|
- &:hover{
|
|
|
|
- .menu{
|
|
|
|
|
|
+ &:hover {
|
|
|
|
+ .menu {
|
|
display: block;
|
|
display: block;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -187,13 +254,13 @@ header {
|
|
border-radius: 4px;
|
|
border-radius: 4px;
|
|
box-shadow: 0 0 4px #333;
|
|
box-shadow: 0 0 4px #333;
|
|
padding: 0 15px;
|
|
padding: 0 15px;
|
|
- margin-top: 15px
|
|
|
|
|
|
+ margin-top: 15px;
|
|
}
|
|
}
|
|
li {
|
|
li {
|
|
height: 45px;
|
|
height: 45px;
|
|
line-height: 45px;
|
|
line-height: 45px;
|
|
text-align: center;
|
|
text-align: center;
|
|
- &.split{
|
|
|
|
|
|
+ &.split {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 1px;
|
|
height: 1px;
|
|
background-color: rgba(255, 255, 255, 0.16);
|
|
background-color: rgba(255, 255, 255, 0.16);
|
|
@@ -202,25 +269,31 @@ header {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-.sync{
|
|
|
|
|
|
+.sync {
|
|
position: absolute;
|
|
position: absolute;
|
|
right: 0;
|
|
right: 0;
|
|
top: 0;
|
|
top: 0;
|
|
height: 100%;
|
|
height: 100%;
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|
|
- button{
|
|
|
|
|
|
+ button {
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
width: 90px;
|
|
width: 90px;
|
|
height: 35px;
|
|
height: 35px;
|
|
- background:#313131 ;
|
|
|
|
|
|
+ background: #313131;
|
|
color: #fff;
|
|
color: #fff;
|
|
border: none;
|
|
border: none;
|
|
outline: none;
|
|
outline: none;
|
|
border-radius: 4px;
|
|
border-radius: 4px;
|
|
margin-right: 10px;
|
|
margin-right: 10px;
|
|
- &[type=submit]{
|
|
|
|
- background: #0076F6;
|
|
|
|
|
|
+ &[type='submit'] {
|
|
|
|
+ background: #0076f6;
|
|
|
|
+ opacity: 0.5;
|
|
|
|
+ pointer-events: none;
|
|
|
|
+ }
|
|
|
|
+ &[type='submit'].active {
|
|
|
|
+ opacity: 1;
|
|
|
|
+ pointer-events: all;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|