rindy 2 年之前
父节点
当前提交
dc0c370252
共有 4 个文件被更改,包括 54 次插入6 次删除
  1. 3 0
      src/components/footer/index.vue
  2. 40 2
      src/components/header/index.vue
  3. 10 3
      src/pages/Viewer.vue
  4. 1 1
      vue.config.js

+ 3 - 0
src/components/footer/index.vue

@@ -0,0 +1,3 @@
+<template>
+    
+</template>

+ 40 - 2
src/components/header/index.vue

@@ -1,6 +1,10 @@
 <template>
-    <header v-if="showAdjust">
+    <header v-if="props.showAdjust">
         <div v-if="project">{{ project.projectName }}</div>
+        <div class="sync">
+            <button @click="onCancel">取消</button>
+            <button type="submit" @click="onSubmit">同步</button>
+        </div>
     </header>
     <header v-else>
         <div v-if="project">{{ project.projectName }}</div>
@@ -33,11 +37,11 @@ import browser from '@/utils/browser'
 import Login from './Login'
 const props = defineProps({
     project: Object,
+    showAdjust:Boolean
 })
 
 const user = ref(null)
 const showLogin = ref(false)
-const showAdjust = ref(browser.urlHasValue('adjust'))
 const getUserInfo = () => {
     http.post(`smart-site/getUserInfo`)
         .then(response => {
@@ -68,6 +72,18 @@ const onLogout = ()=>[
         .catch(() => {})
     
 ]
+const onCancel = () =>{
+    window.location.href = window.location.href.replace('&adjust','')
+}
+const onSubmit =()=>{
+    http.post(`smart-site/fdLogout`)
+        .then(response => {
+            if (response.success) {
+                window.location.href = window.location.href.replace('&adjust','&split')
+            }
+        })
+        .catch(() => {})
+}
 onMounted(() => {
     if (localStorage.getItem('token')) {
         getUserInfo()
@@ -186,4 +202,26 @@ header {
         }
     }
 }
+.sync{
+    position: absolute;
+    right: 0;
+    top: 0;
+    height: 100%;
+    display: flex;
+    align-items: center;
+    button{
+        cursor: pointer;
+        width: 90px;
+        height: 35px;
+        background:#313131 ;
+        color: #fff;
+        border: none;
+        outline: none;
+        border-radius: 4px;
+        margin-right: 10px;
+        &[type=submit]{
+            background: #0076F6;
+        }
+    }
+}
 </style>

+ 10 - 3
src/pages/Viewer.vue

@@ -1,5 +1,5 @@
 <template>
-    <AppHeader v-show="!fscChecked" :project="project" />
+    <AppHeader v-show="!fscChecked" :project="project" :show-adjust="showAdjust" />
     <article>
         <main>
             <div class="split" v-if="source">
@@ -40,6 +40,7 @@
             </div>
         </main>
     </article>
+    <AppFooter v-if="showAdjust" />
 </template>
 
 <script setup>
@@ -47,9 +48,14 @@ import { ref, onMounted, computed, nextTick } from 'vue'
 import { http } from '@/utils/request'
 import browser from '@/utils/browser'
 import AppHeader from '@/components/header'
+import AppFooter from '@/components/footer'
 import Calendar from '@/components/calendar'
 import sync, { loadSourceScene, loadTargetScene } from '@/utils/sync'
 
+// 是否校准模式
+const showSplit = ref(browser.urlHasValue('split'))
+const showAdjust = ref(browser.urlHasValue('adjust'))
+
 const bimChecked = ref(null)
 const dbsChecked = ref(null)
 const fscChecked = ref(null)
@@ -63,7 +69,7 @@ const mode = ref(0)
 const source = ref(null)
 const target = ref(null)
 const project = ref(null)
-const adjust = ref(browser.urlHasValue('adjust'))
+
 
 const scenes = computed(() => {
     if (!project.value) {
@@ -148,6 +154,7 @@ const targetDays = computed(() => {
     }
 })
 
+
 const onLoadSource = () => {
     if (bimChecked.value && !dbsChecked.value) {
         // BIM单屏模式
@@ -352,7 +359,7 @@ onMounted(() => {
                 project.value = response.data
                 if (project.value.sceneList.length) {
                     source.value = project.value.sceneList[0]
-                    if (adjust.value) {
+                    if (showAdjust.value || showSplit.value) {
                         onBimChecked()
                         nextTick(() => onDbsChecked())
                     }

+ 1 - 1
vue.config.js

@@ -20,7 +20,7 @@ const devServer = {
             changeOrigin: true
         },
         '/smart-site': {
-            target: 'http://192.168.0.38:8011/',
+            target: 'https://test.4dkankan.com/',
             changeOrigin: true
         }
     }