瀏覽代碼

Merge branch 'dev' of http://192.168.0.115:3000/4dkankan/4dkankan_bim into dev

xzw 2 年之前
父節點
當前提交
284163dabe
共有 36 個文件被更改,包括 1470 次插入4274 次删除
  1. 1 1
      package.json
  2. 11 1
      public/__langs/locales/en.json
  3. 11 1
      public/__langs/locales/ja.json
  4. 11 1
      public/__langs/locales/zh.json
  5. 1 0
      public/js/2.js
  6. 18 5
      public/smart-kankan.html
  7. 1 1
      public/smart-laser.html
  8. 704 2843
      public/static/ext/iconfont/demo_index.html
  9. 88 460
      public/static/ext/iconfont/iconfont.css
  10. 1 1
      public/static/ext/iconfont/iconfont.js
  11. 213 864
      public/static/ext/iconfont/iconfont.json
  12. 二進制
      public/static/ext/iconfont/iconfont.ttf
  13. 二進制
      public/static/ext/iconfont/iconfont.woff
  14. 二進制
      public/static/ext/iconfont/iconfont.woff2
  15. 1 1
      src/components/files/TagEditor.vue
  16. 6 1
      src/components/files/TagItem.vue
  17. 22 5
      src/components/files/TagView.vue
  18. 18 17
      src/components/files/content/Comment.vue
  19. 21 16
      src/components/files/content/TagMsg.vue
  20. 39 8
      src/components/files/index.vue
  21. 7 5
      src/components/form/SelectList.vue
  22. 1 1
      src/components/form/medias/Audio.vue
  23. 1 1
      src/components/form/medias/Image.vue
  24. 2 2
      src/components/form/medias/Link.vue
  25. 1 1
      src/components/form/medias/Video.vue
  26. 10 3
      src/components/header/Login.vue
  27. 1 1
      src/components/header/index.vue
  28. 11 1
      src/locales/en.json
  29. 11 1
      src/locales/ja.json
  30. 13 1
      src/locales/zh.json
  31. 84 0
      src/pages/DesignOption/measure.scss
  32. 68 0
      src/pages/Rules/index.vue
  33. 2 0
      src/pages/SViewer.vue
  34. 89 30
      src/pages/Viewer.vue
  35. 1 0
      src/pages/kankan.js
  36. 1 1
      vue.config.js

+ 1 - 1
package.json

@@ -1,7 +1,7 @@
 {
   "name": "@kankan/smart-bim",
   "private": true,
-  "version": "4.9.1",
+  "version": "4.9.1-apl",
   "scripts": {
     "serve": "vue-cli-service serve",
     "build": "vue-cli-service build",

+ 11 - 1
public/__langs/locales/en.json

@@ -77,6 +77,12 @@
     "tag.name": "标注",
     "components.name": "组件",
     "header.name": "头部",
+    "toast": {
+        "clickLeft": "请先在左侧点击",
+        "clickTop": "请先在上方点击",
+        "ruleConfirmTips": "起点确定完毕,请定位终点"
+    },
+    "toast.name": "提示",
     "common": {
         "high": "高",
         "middle": "中",
@@ -92,9 +98,13 @@
         "login": "login",
         "cancel": "cancel",
         "sync": "sync",
+        "deleteRuleLine": "删除测量线",
         "deleteSuccess": "删除成功",
         "copySuccess": "复制成功",
-        "syncSuccess": "同步成功"
+        "syncSuccess": "同步成功",
+        "endPoint": "终点",
+        "startPoint": "起点",
+        "measure": "测量"
     },
     "common.name": "通用",
     "code": {

+ 11 - 1
public/__langs/locales/ja.json

@@ -77,6 +77,12 @@
     "tag.name": "标注",
     "components.name": "组件",
     "header.name": "头部",
+    "toast": {
+        "clickLeft": "请先在左侧点击",
+        "clickTop": "请先在上方点击",
+        "ruleConfirmTips": "起点确定完毕,请定位终点"
+    },
+    "toast.name": "提示",
     "common": {
         "high": "高",
         "middle": "中",
@@ -92,9 +98,13 @@
         "login": "登录",
         "cancel": "取消",
         "sync": "同步",
+        "deleteRuleLine": "删除测量线",
         "deleteSuccess": "删除成功",
         "copySuccess": "复制成功",
-        "syncSuccess": "同步成功"
+        "syncSuccess": "同步成功",
+        "endPoint": "终点",
+        "startPoint": "起点",
+        "measure": "测量"
     },
     "common.name": "通用",
     "code": {

+ 11 - 1
public/__langs/locales/zh.json

@@ -77,6 +77,12 @@
     "tag.name": "标注",
     "components.name": "组件",
     "header.name": "头部",
+    "toast": {
+        "clickLeft": "请先在左侧点击",
+        "clickTop": "请先在上方点击",
+        "ruleConfirmTips": "起点确定完毕,请定位终点"
+    },
+    "toast.name": "提示",
     "common": {
         "high": "高",
         "middle": "中",
@@ -92,9 +98,13 @@
         "login": "登录",
         "cancel": "取消",
         "sync": "同步",
+        "deleteRuleLine": "删除测量线",
         "deleteSuccess": "删除成功",
         "copySuccess": "复制成功",
-        "syncSuccess": "同步成功"
+        "syncSuccess": "同步成功",
+        "endPoint": "终点",
+        "startPoint": "起点",
+        "measure": "测量"
     },
     "common.name": "通用",
     "code": {

File diff suppressed because it is too large
+ 1 - 0
public/js/2.js


+ 18 - 5
public/smart-kankan.html

@@ -17,6 +17,8 @@
                 width: 100%;
                 height: 100%;
             }
+            .widgets-design-option {
+            }
         </style>
     </head>
 
@@ -24,12 +26,23 @@
         <noscript>
             <strong>We're sorry but doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
         </noscript>
-        <div id="app"></div>
+        <div id="app">
+            <div class="widgets-design-option" style="display: none">
+                <div class="delete-ruler">
+                    <li>删除测量线</li>
+                </div>
+            </div>
+            <div xui_tags></div>
+        </div>
         <script src="<%= BASE_URL %><%= VUE_APP_SDK_DIR %>kankan-sdk-deps.js?v=<%= VUE_APP_VERSION %>"></script>
         <script src="<%= BASE_URL %><%= VUE_APP_SDK_DIR %>kankan-sdk.js?v=<%= VUE_APP_VERSION %>"></script>
-        
-        <script src="http://192.168.0.80:3099/dist/sdk/kankan-sdk-deps.js?v=<%= VUE_APP_VERSION %>"></script>
-        <script src="http://192.168.0.80:3099/dist/sdk/kankan-sdk.js?v=<%= VUE_APP_VERSION %>"></script>
-        
+
+        <!-- <script src="http://127.0.0.1:3099/dist/sdk/kankan-sdk-deps.js"></script>
+        <script src="http://127.0.0.1:3099/dist/sdk/kankan-sdk.js"></script> -->
+        <script>
+            window.onload = function () {
+                document.querySelector('.widgets-design-option').style.display = 'block'
+            }
+        </script>
     </body>
 </html>

File diff suppressed because it is too large
+ 1 - 1
public/smart-laser.html


File diff suppressed because it is too large
+ 704 - 2843
public/static/ext/iconfont/demo_index.html


+ 88 - 460
public/static/ext/iconfont/iconfont.css

@@ -1,8 +1,8 @@
 @font-face {
-  font-family: "iconfont"; /* Project id 2596172 */
-  src: url('iconfont.woff2?t=1659061669448') format('woff2'),
-       url('iconfont.woff?t=1659061669448') format('woff'),
-       url('iconfont.ttf?t=1659061669448') format('truetype');
+  font-family: "iconfont"; /* Project id 3693743 */
+  src: url('iconfont.woff2?t=1686640137507') format('woff2'),
+       url('iconfont.woff?t=1686640137507') format('woff'),
+       url('iconfont.ttf?t=1686640137507') format('truetype');
 }
 
 .iconfont {
@@ -13,559 +13,187 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
-.icon-show_share:before {
-  content: "\e690";
+.icon-measurement:before {
+  content: "\e734";
 }
 
-.icon-show_more_ruler:before {
-  content: "\e67b";
-}
-
-.icon-transparency:before {
-  content: "\e6d7";
-}
-
-.icon-mosaic_e:before {
-  content: "\e6d2";
-}
-
-.icon-eraser:before {
-  content: "\e6d3";
-}
-
-.icon-video2:before {
-  content: "\e6d4";
-}
-
-.icon-down:before {
-  content: "\e6d5";
-}
-
-.icon-qingkong-copy-copy:before {
-  content: "\e68f";
-}
-
-.icon-_qq:before {
-  content: "\e64b";
-}
-
-.icon-_friend:before {
-  content: "\e64c";
-}
-
-.icon-link1:before {
-  content: "\e6ff";
-}
-
-.icon-icon_share_facebook:before {
-  content: "\e745";
-}
-
-.icon-icon_share_whatsapp:before {
-  content: "\e746";
-}
-
-.icon-_wechat:before {
-  content: "\e64a";
-}
-
-.icon-watermark:before {
-  content: "\e6cb";
-}
-
-.icon-camera_h:before {
-  content: "\e6c7";
-}
-
-.icon-a-1V1:before {
-  content: "\e6c8";
-}
-
-.icon-hengbiaoEN:before {
-  content: "\e6b9";
-}
-
-.icon-hot_spot:before {
-  content: "\e6b8";
-}
-
-.icon-foot:before {
-  content: "\e6ba";
-}
-
-.icon-music-t:before {
-  content: "\e6b7";
-}
-
-.icon-yes:before {
-  content: "\e6b5";
-}
-
-.icon-no:before {
-  content: "\e6b6";
-}
-
-.icon-floor_rename:before {
-  content: "\e75b";
-}
-
-.icon-play_stop:before {
-  content: "\e6b4";
-}
-
-.icon-scene_auto:before {
-  content: "\e721";
-}
-
-.icon-compass:before {
-  content: "\e6b3";
-}
-
-.icon-h-d:before {
-  content: "\e6b2";
-}
-
-.icon-scene_screen:before {
-  content: "\e717";
-}
-
-.icon-scene_full:before {
-  content: "\e712";
-}
-
-.icon-scene_window:before {
-  content: "\e713";
-}
-
-.icon-_back:before {
-  content: "\e609";
-}
-
-.icon-show_back:before {
-  content: "\e678";
-}
-
-.icon-show_more_share:before {
-  content: "\e680";
-}
-
-.icon-show_more_finish:before {
-  content: "\e67a";
-}
-
-.icon-show_more_music:before {
-  content: "\e67c";
-}
-
-.icon-show_map_collect:before {
-  content: "\e679";
-}
-
-.icon-data-j:before {
-  content: "\e6b1";
-}
-
-.icon-cancel:before {
-  content: "\e688";
-}
-
-.icon-affirm:before {
-  content: "\e689";
-}
-
-.icon-checkbox_p:before {
-  content: "\e6b0";
-}
-
-.icon-left:before {
-  content: "\e6ae";
-}
-
-.icon-right:before {
-  content: "\e6af";
-}
-
-.icon-_loading_:before {
-  content: "\e627";
-}
-
-.icon-show_function_collect:before {
-  content: "\e687";
-}
-
-.icon-show_more:before {
-  content: "\e67e";
-}
-
-.icon-d-r:before {
-  content: "\e68d";
-}
-
-.icon-up-a:before {
-  content: "\e68e";
-}
-
-.icon-fanzhuan:before {
-  content: "\e6fa";
-}
-
-.icon-cad-neiqiang:before {
-  content: "\e698";
-}
-
-.icon-cad-waiqiang:before {
-  content: "\e69a";
-}
-
-.icon-cad-shuangkaimen:before {
-  content: "\e69b";
-}
-
-.icon-cad-zimumen:before {
-  content: "\e69c";
-}
-
-.icon-cad-men:before {
-  content: "\e69d";
-}
-
-.icon-cad-yimen:before {
-  content: "\e69e";
-}
-
-.icon-cad-zhediemen:before {
-  content: "\e69f";
-}
-
-.icon-cad-luodichuang:before {
-  content: "\e6a0";
-}
-
-.icon-cad-chuang:before {
-  content: "\e6a1";
-}
-
-.icon-cad-piaochuang:before {
-  content: "\e6a2";
-}
-
-.icon-cad-uxingchuang:before {
-  content: "\e6a4";
-}
-
-.icon-cad-lxingchuang:before {
-  content: "\e6a5";
-}
-
-.icon-cad-lpiaochuang:before {
-  content: "\e6a6";
-}
-
-.icon-cad-upiaochuang:before {
-  content: "\e6a7";
-}
-
-.icon-cad-liang:before {
-  content: "\e6a8";
-}
-
-.icon-cad-yandao:before {
-  content: "\e6a9";
-}
-
-.icon-cad-zhuzi:before {
-  content: "\e6aa";
-}
-
-.icon-cad-dianti:before {
-  content: "\e6ab";
-}
-
-.icon-cad-loudao:before {
-  content: "\e6ac";
-}
-
-.icon-cad-dange:before {
-  content: "\e6ad";
-}
-
-.icon-cad-yakou:before {
-  content: "\e699";
+.icon-comment_delete:before {
+  content: "\e727";
 }
 
 .icon-more:before {
   content: "\e600";
 }
 
-.icon-mosaic1:before {
-  content: "\e697";
-}
-
-.icon-hengbiaoCN:before {
-  content: "\e6a3";
-}
-
-.icon-nor:before {
-  content: "\e696";
-}
-
 .icon-checkbox1:before {
   content: "\e65d";
 }
 
-.icon-rotate:before {
-  content: "\e695";
-}
-
-.icon-adapt:before {
-  content: "\e692";
-}
-
-.icon-recover:before {
-  content: "\e693";
-}
-
-.icon-repeal:before {
-  content: "\e694";
-}
-
-.icon-reset:before {
-  content: "\e65a";
-}
-
-.icon-course1:before {
-  content: "\e68c";
-}
-
-.icon-publish:before {
-  content: "\e68a";
+.icon-affirm:before {
+  content: "\e689";
 }
 
-.icon-save:before {
-  content: "\e68b";
+.icon-add:before {
+  content: "\e631";
 }
 
-.icon-checkbox:before {
-  content: "\e649";
+.icon-video:before {
+  content: "\e612";
 }
 
-.icon-mosaic:before {
-  content: "\e646";
+.icon-web:before {
+  content: "\e635";
 }
 
-.icon-media:before {
-  content: "\e647";
+.icon-music:before {
+  content: "\e637";
 }
 
 .icon-pic:before {
   content: "\e648";
 }
 
-.icon-eye_f:before {
-  content: "\e644";
-}
-
-.icon-eye_c:before {
-  content: "\e645";
+.icon-note1:before {
+  content: "\e726";
 }
 
-.icon-size-o:before {
-  content: "\e640";
+.icon-note_right:before {
+  content: "\e723";
 }
 
-.icon-size-f:before {
-  content: "\e641";
+.icon-note_text:before {
+  content: "\e724";
 }
 
-.icon-magnify:before {
-  content: "\e642";
+.icon-note_wrong:before {
+  content: "\e725";
 }
 
-.icon-reduce:before {
-  content: "\e643";
+.icon-check:before {
+  content: "\e720";
 }
 
-.icon-video1:before {
-  content: "\e63b";
-}
-
-.icon-uploading_s:before {
-  content: "\e63c";
-}
-
-.icon-path:before {
-  content: "\e63d";
+.icon-arrows_down:before {
+  content: "\e721";
 }
 
-.icon-record:before {
-  content: "\e63e";
+.icon-logo_login:before {
+  content: "\e71f";
 }
 
-.icon-clear:before {
-  content: "\e63f";
+.icon-logo:before {
+  content: "\e71e";
 }
 
-.icon-pause:before {
-  content: "\e636";
+.icon-delete:before {
+  content: "\e71d";
 }
 
-.icon-preview:before {
-  content: "\e63a";
+.icon-user:before {
+  content: "\e71a";
 }
 
-.icon-full:before {
-  content: "\e638";
+.icon-password:before {
+  content: "\e71b";
 }
 
-.icon-add:before {
-  content: "\e631";
-}
-
-.icon-del:before {
-  content: "\e632";
+.icon-eye:before {
+  content: "\e71c";
 }
 
 .icon-close:before {
   content: "\e633";
 }
 
-.icon-web:before {
-  content: "\e635";
-}
-
-.icon-music:before {
-  content: "\e637";
+.icon-log_eye_selected:before {
+  content: "\e718";
 }
 
-.icon-uploading1:before {
-  content: "\e639";
+.icon-log_eye_normal:before {
+  content: "\e719";
 }
 
-.icon-state_e:before {
-  content: "\e624";
+.icon-full_screen_normal:before {
+  content: "\e716";
 }
 
-.icon-state_f:before {
-  content: "\e625";
-}
-
-.icon-state_s:before {
-  content: "\e626";
-}
-
-.icon-vip_uploading:before {
-  content: "\e623";
-}
-
-.icon-eye-n:before {
-  content: "\e621";
-}
-
-.icon-eye-s:before {
-  content: "\e622";
-}
-
-.icon-course:before {
-  content: "\e620";
-}
-
-.icon-edit:before {
-  content: "\e61f";
-}
-
-.icon-help:before {
-  content: "\e615";
-}
-
-.icon-rule:before {
-  content: "\e617";
-}
-
-.icon-link:before {
-  content: "\e618";
-}
-
-.icon-uploading:before {
-  content: "\e619";
-}
-
-.icon-vr:before {
-  content: "\e61a";
+.icon-full_screen_selected:before {
+  content: "\e717";
 }
 
-.icon-complete:before {
-  content: "\e61b";
+.icon-show_roaming:before {
+  content: "\e714";
 }
 
-.icon-download:before {
-  content: "\e61c";
+.icon-show_plane:before {
+  content: "\e715";
 }
 
-.icon-pull-down:before {
-  content: "\e61d";
+.icon-note:before {
+  content: "\e707";
 }
 
-.icon-pull-up:before {
-  content: "\e61e";
+.icon-BIM:before {
+  content: "\e70f";
 }
 
-.icon-updown:before {
-  content: "\e613";
+.icon-split_screen:before {
+  content: "\e713";
 }
 
-.icon-scene:before {
-  content: "\e614";
+.icon-positioning02:before {
+  content: "\e711";
 }
 
-.icon-message:before {
-  content: "\e60c";
+.icon-positioning01:before {
+  content: "\e712";
 }
 
-.icon-basic:before {
-  content: "\e60d";
+.icon-mail:before {
+  content: "\e708";
 }
 
-.icon-hotspot:before {
-  content: "\e60e";
+.icon-share:before {
+  content: "\e709";
 }
 
-.icon-guide:before {
-  content: "\e60f";
+.icon-projects:before {
+  content: "\e70c";
 }
 
-.icon-wander:before {
-  content: "\e610";
+.icon-date:before {
+  content: "\e706";
 }
 
-.icon-house:before {
-  content: "\e611";
+.icon-arrows_right:before {
+  content: "\e700";
 }
 
-.icon-video:before {
-  content: "\e612";
+.icon-arrows:before {
+  content: "\e703";
 }
 
-.icon-show_3d_normal:before {
-  content: "\e677";
+.icon-calendar:before {
+  content: "\e704";
 }
 
-.icon-show_plane_normal:before {
-  content: "\e67d";
+.icon-arrows_left:before {
+  content: "\e705";
 }
 
-.icon-show_roaming_selected:before {
-  content: "\e682";
+.icon-phone:before {
+  content: "\e70a";
 }
 
-.icon-show_plane_selected:before {
-  content: "\e684";
+.icon-me:before {
+  content: "\e70b";
 }
 
-.icon-show_3d_selected:before {
-  content: "\e685";
+.icon-search:before {
+  content: "\e70d";
 }
 
-.icon-show_roaming_normal:before {
-  content: "\e686";
+.icon-upload:before {
+  content: "\e70e";
 }
 

File diff suppressed because it is too large
+ 1 - 1
public/static/ext/iconfont/iconfont.js


File diff suppressed because it is too large
+ 213 - 864
public/static/ext/iconfont/iconfont.json


二進制
public/static/ext/iconfont/iconfont.ttf


二進制
public/static/ext/iconfont/iconfont.woff


二進制
public/static/ext/iconfont/iconfont.woff2


+ 1 - 1
src/components/files/TagEditor.vue

@@ -88,7 +88,7 @@ const onClose = () => {
 }
 let pushData = null
 const onSubmit = async () => {
-    if (!form.value.title) {
+    if (!form.value.title.trim()) {
         return (showTips.value = t('tag.inputTagName'))
     }
     if (!form.value.status) {

+ 6 - 1
src/components/files/TagItem.vue

@@ -7,7 +7,7 @@
         class="tag-item"
     >
         <div class="tag-icon">
-            <span>{{ props.index }}</span>
+            <span>{{ props.index }} </span>
         </div>
     </div>
 </template>
@@ -25,7 +25,12 @@ const props = defineProps({
 })
 
 const notify = inject('notify')
+const isEdit = inject('isEdit')
 const onClick = () => {
+  console.log(isEdit.value)
+    if (isEdit.value) {
+        return
+    }
     notify.value = props.tag //{ event: 'focus', sid: props.tag.sid, tag: props.tag }
 }
 </script>

+ 22 - 5
src/components/files/TagView.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="tag-view" v-show="canShow">
         <!-- <div class="tag-view-content" :style="{ height: height + 'px' }"> -->
-        <div class="tag-view-content">
+        <div class="tag-view-content" :class="!isLogin ? 'no-comment' : ''">
             <header>
                 <span>{{ notify.title }}</span>
                 <!-- <i class="iconfont icon-close" @click="emits('action', null)"></i> -->
@@ -9,18 +9,20 @@
             </header>
             <article>
                 <TagMsg @setShow="setShow"></TagMsg>
-                <Comment :slideHeigt="slideHeigt"></Comment>
+                <Comment v-if="isLogin" :slideHeigt="slideHeigt"></Comment>
             </article>
             <!-- <footer></footer> -->
         </div>
     </div>
 </template>
 <script setup>
-import { ref, onMounted, onBeforeUnmount, computed, inject } from 'vue'
+import { ref, onMounted, onBeforeUnmount, computed, inject, watch } from 'vue'
 
 import TagMsg from './content/TagMsg.vue'
 import Comment from './content/Comment.vue'
 import { nextTick } from 'process'
+
+const isLogin = inject('isLogin')
 const notify = inject('notify')
 const emits = defineEmits(['action'])
 const height = ref(0)
@@ -45,7 +47,16 @@ const setShow = data => {
         slideHeigt.value = document.querySelector('.left-item').offsetHeight
     })
 }
-onMounted(() => {
+
+watch(
+    () => notify.value,
+    (val, old) => {
+        if (val) {
+            goFocusTag()
+        }
+    }
+)
+const goFocusTag = () => {
     if (window.kankan) {
         window.kankan.TagManager.focusTag(notify.value.sid, {
             direction: 'left',
@@ -60,6 +71,9 @@ onMounted(() => {
             sdk.scene.comeToTag(new THREE.Vector3(pos.x, pos.y, pos.z))
         })
     }
+}
+onMounted(() => {
+  goFocusTag()
     onResize()
     window.addEventListener('resize', onResize)
 })
@@ -281,6 +295,9 @@ onBeforeUnmount(() => {
     border: 1px solid #000000;
     backdrop-filter: blur(4px);
     color: #fff;
+    &.no-comment {
+        width: 400px;
+    }
 
     header {
         padding: 0 20px;
@@ -306,7 +323,7 @@ onBeforeUnmount(() => {
         overflow: hidden;
         > div {
             width: 50%;
-            
+
             // &.left-item {
             //     border-right: solid 1px rgba(255, 255, 255, 0.16);
             // }

+ 18 - 17
src/components/files/content/Comment.vue

@@ -11,7 +11,7 @@
                     <div class="comment-box">
                         <div class="view-box view-top">
                             <span class="user-name">{{ i.nickName || $t('tag.unkownUser') }}</span>
-                            <i class="iconfont icon-del" v-if="i.userId == userId" @click="delComment({ commentId: i.commentId, index })"></i>
+                            <i class="iconfont icon-comment_delete" v-if="i.userId == userId" @click="delComment({ commentId: i.commentId, index })"></i>
                         </div>
                         <div class="view-box view-middle">
                             <span class="comment-text">{{ i.content }}</span>
@@ -26,7 +26,7 @@
                                 <div class="reply-box">
                                     <div class="view-box view-top">
                                         <span class="user-name">{{ j.nickName || $t('tag.unkownUser') }}</span>
-                                        <i class="iconfont icon-del" v-if="j.userId == userId" @click="delComment({ commentId: j.commentId, index: j_index, parentIndex: index })"></i>
+                                        <i class="iconfont icon-comment_delete" v-if="j.userId == userId" @click="delComment({ commentId: j.commentId, index: j_index, parentIndex: index })"></i>
                                     </div>
                                     <div class="view-box view-middle">
                                         <span class="reply-text"
@@ -219,20 +219,20 @@ const delComment = data => {
 }
 onMounted(() => {
     getAllComments()
-    if (window.kankan) {
-        window.kankan.TagManager.focusTag(notify.value.sid, {
-            direction: 'left',
-            attrs: {
-                width: 0,
-                // height: 400,
-            },
-        })
-    } else if (window.laser) {
-        window.laser.then(sdk => {
-            let pos = notify.value.position
-            sdk.scene.comeToTag(new THREE.Vector3(pos.x, pos.y, pos.z))
-        })
-    }
+    // if (window.kankan) {
+    //     window.kankan.TagManager.focusTag(notify.value.sid, {
+    //         direction: 'left',
+    //         attrs: {
+    //             width: 0,
+    //             // height: 400,
+    //         },
+    //     })
+    // } else if (window.laser) {
+    //     window.laser.then(sdk => {
+    //         let pos = notify.value.position
+    //         sdk.scene.comeToTag(new THREE.Vector3(pos.x, pos.y, pos.z))
+    //     })
+    // }
     nextTick(() => {
         input$.value.addEventListener('keydown', function (e) {
             if (e.keyCode == 8) {
@@ -275,7 +275,8 @@ onBeforeUnmount(() => {})
                 border: 1px solid rgba(255, 255, 255, 0.2);
                 position: relative;
                 input {
-                    width: 75%;
+                    // width: 75%;
+                    width: 73%;
                     line-height: 34px;
                     padding: 0 5px;
                     color: #fff;

+ 21 - 16
src/components/files/content/TagMsg.vue

@@ -1,7 +1,7 @@
 <!--  -->
 <template>
-    <div class="aside-item left-item">
-        <UiAudio v-if="notify.type == 'audio'" :src="notify.media?.[notify.type][0].src" />
+    <div class="aside-item left-item" :class="!isLogin ? 'no-comment' : ''">
+        <UiAudio v-if="notify.type == 'audio' && notify.media?.[notify.type]" :src="notify.media?.[notify.type][0].src" />
 
         <div class="content-item">
             <div class="item-title">{{ $t('tag.createTime') }}</div>
@@ -64,6 +64,7 @@ import i18n from '@/i18n'
 const { t } = i18n.global
 const projectId = browser.valueFromUrl('projectId') || 1
 const notify = inject('notify')
+const isLogin = inject('isLogin')
 // const props = defineProps(['notify'])
 const emits = defineEmits(['action', 'setShow'])
 const height = ref(0)
@@ -155,20 +156,20 @@ onMounted(() => {
         }
     })
 
-    if (window.kankan) {
-        window.kankan.TagManager.focusTag(notify.value.sid, {
-            direction: 'left',
-            attrs: {
-                width: 0,
-                // height: 400,
-            },
-        })
-    } else if (window.laser) {
-        window.laser.then(sdk => {
-            let pos = notify.value.position
-            sdk.scene.comeToTag(new THREE.Vector3(pos.x, pos.y, pos.z))
-        })
-    }
+    // if (window.kankan) {
+    //     window.kankan.TagManager.focusTag(notify.value.sid, {
+    //         direction: 'left',
+    //         attrs: {
+    //             width: 0,
+    //             // height: 400,
+    //         },
+    //     })
+    // } else if (window.laser) {
+    //     window.laser.then(sdk => {
+    //         let pos = notify.value.position
+    //         sdk.scene.comeToTag(new THREE.Vector3(pos.x, pos.y, pos.z))
+    //     })
+    // }
 })
 
 onBeforeUnmount(() => {})
@@ -228,6 +229,7 @@ onBeforeUnmount(() => {})
     position: relative;
     .content-item {
         margin-bottom: 20px;
+        word-break: break-all;
         &:last-of-type {
             margin-bottom: 0;
         }
@@ -235,6 +237,9 @@ onBeforeUnmount(() => {})
     &.left-item {
         width: 400px;
         border-right: solid 1px rgba(255, 255, 255, 0.16);
+        &.no-comment {
+            border-right: none;
+        }
         .item-title {
             font-size: 14px;
             color: #999;

+ 39 - 8
src/components/files/index.vue

@@ -8,7 +8,7 @@
                     >)
                 </div>
             </div>
-            <div class="list" :style="`height:${listStyle};`">
+            <div class="list" :style="`height:${listStyle};`" :class="{ disabled: isFlying }">
                 <ul>
                     <li v-for="tag in tags" @click="onClick(tag)" :class="{ active: notify?.sid == tag.sid }">
                         <div class="title"><i></i>{{ tag.title }}</div>
@@ -83,11 +83,18 @@ const tags = inject('tags')
 
 const notify = inject('notify')
 const isEdit = inject('isEdit')
+const isFlying = inject('isFlying')
 const onClick = tag => {
-    notify.value = tag //{ event: 'focus', sid: props.tag.sid, tag: props.tag }
+    notify.value = null
+    nextTick(() => {
+        notify.value = tag //{ event: 'focus', sid: props.tag.sid, tag: props.tag }
+    })
 }
 let isAdd = false
 const onAdd = () => {
+    if (notify.value) {
+        notify.value = null
+    }
     isEdit.value = true
     isAdd = true
     if (window.kankan) {
@@ -102,8 +109,10 @@ const onAdd = () => {
         showToolbar.value = true
     }
 }
-const laserPosition = () => {
+const laserPosition = (tag) => {
     window.laser.then(sdk => {
+        let pos = tag.position
+        sdk.scene.comeToTag(new THREE.Vector3(pos.x, pos.y, pos.z))
         sdk.addMouseDownEvent(e => {
             if (showToolbar.value == false) {
                 return
@@ -188,6 +197,8 @@ const onAddConfirm = () => {
                 // tags.value.push(tag)
                 notify.value = tag
                 isEdit.value = true
+            } else {
+                onAddCancel()
             }
         })
     } else {
@@ -238,7 +249,7 @@ const onMoreHandler = (type, tag) => {
                 editor.enter(editTag)
             })
         } else {
-            laserPosition()
+            laserPosition(editTag)
         }
         // window.kankan.TagManager.focusBeforeModify(editTag.sid)
     } else if (type == 'delete') {
@@ -259,7 +270,27 @@ watchEffect(() => {
     }
 })
 
-onMounted(() => {})
+onMounted(() => {
+    // app.Camera.on('flying.started', pano => {
+    //     store.commit('setFlying', true)
+    // })
+    // app.Camera.on('flying.ended', ({ targetPano }) => {
+    //     store.commit('setFlying', false)
+    // })
+    // if (window.kankan) {
+    //     console.error(window.kankan)
+    // } else if (window.laser) {
+    //     window.laser.then(res => {
+    //         console.error(res)
+    //     })
+    // }
+    // window[0].Scene.on('loaded', sdk => {
+    //     console.error(e)
+    // })
+    // window[0].loaded.then(sdk => {
+    //     console.error(sdk)
+    // })
+})
 </script>
 <style lang="scss" scoped>
 button {
@@ -375,7 +406,7 @@ li {
     justify-content: space-between;
     font-size: 14px;
     &.active {
-        background-color: rgba(0, 118, 246, 0.1);
+        background-color: rgba(0, 118, 246, 0.3);
     }
     .title {
     }
@@ -410,13 +441,13 @@ li {
                 height: 32px;
                 line-height: 32px;
                 &:hover {
-                    background-color: rgb(0, 118, 246, 0.1);
+                    background-color: rgb(0, 118, 246, 0.3);
                 }
             }
         }
     }
     &:hover {
-        background-color: rgb(0, 118, 246, 0.1);
+        background-color: rgb(0, 118, 246, 0.3);
     }
 }
 

+ 7 - 5
src/components/form/SelectList.vue

@@ -114,11 +114,12 @@ li {
             left: -1px;
             right: -1px;
             top: calc(100% + 4px);
-            background: rgba(27, 27, 28, 0.8);
+            background: rgba(27, 27, 28, 0.9);
+            // background: rgb(57, 57, 60, 0.9);
             box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
             border-radius: 4px 4px 4px 4px;
             border: 1px solid #000000;
-            max-height: 200px;
+            max-height: 250px;
             overflow: hidden;
             overflow-y: auto;
             z-index: 1000;
@@ -133,6 +134,7 @@ li {
                 > div {
                     display: flex;
                     align-items: center;
+                    color:rgba(255, 255, 255, 0.6)
                 }
             }
         }
@@ -160,8 +162,8 @@ li {
         content: '';
         border: 1px solid #666;
         border-radius: 2px;
-        width: 16px;
-        height: 16px;
+        width: 14px;
+        height: 14px;
         position: absolute;
         left: 0px;
         top: 0;
@@ -173,7 +175,7 @@ li {
             background-color: #0076f6;
         }
         &::after {
-            left: 4px;
+            left: 3px;
             top: 7px;
             position: absolute;
             display: table;

+ 1 - 1
src/components/form/medias/Audio.vue

@@ -12,7 +12,7 @@
         <input ref="file" type="file" style="display: none" accept=".mp3, .wav" @change="onChange" />
     </div>
     <div class="del-btn" v-if="isEdit && notify.media?.[notify.type]?.length" @click="delMedia">
-        <i class="iconfont icon-del"></i>
+        <i class="iconfont icon-delete"></i>
     </div>
 </template>
 <script setup>

+ 1 - 1
src/components/form/medias/Image.vue

@@ -23,7 +23,7 @@
     </div>
 
     <div class="del-btn" v-if="isEdit" v-show="notify.media?.[notify.type]?.length" @click="delPic">
-        <i class="iconfont icon-del"></i>
+        <i class="iconfont icon-delete"></i>
     </div>
 </template>
 <script setup>

+ 2 - 2
src/components/form/medias/Link.vue

@@ -6,11 +6,11 @@
     </div>
     <div class="placeholder" v-show="url == null">
         <div class="icon">
-            <span>{{$t('components.linkView')}}</span>
+            <span>{{ $t('components.linkView') }}</span>
         </div>
         <div class="link">
             <input type="text" placeholder="https://" v-model.trim="href" />
-            <div class="save" @click="onConfirm"><i class="iconfont icon-checkbox1"></i></div>
+            <div class="save" :class="{ disabled: !href }" @click="onConfirm"><i class="iconfont icon-checkbox1"></i></div>
         </div>
     </div>
 </template>

+ 1 - 1
src/components/form/medias/Video.vue

@@ -21,7 +21,7 @@
         <input ref="file" type="file" style="display: none" accept=".mp4, .mov" @change="onChange" />
     </div>
     <div class="del-btn" v-if="notify.media?.[notify.type]?.length && isEdit" @click="delMedia">
-        <i class="iconfont icon-del"></i>
+        <i class="iconfont icon-delete"></i>
     </div>
 </template>
 <script setup>

+ 10 - 3
src/components/header/Login.vue

@@ -9,14 +9,14 @@
                         <span class="icon">
                             <i class="iconfont icon-user"></i>
                         </span>
-                        <input type="text" v-model.trim="username" />
+                        <input type="text" v-model.trim="username" :placeholder="$t('header.inputPhoneNum')" />
                         <div class="tips" v-show="errors.username">{{ errors.username }}</div>
                     </div>
                     <div class="input">
                         <span class="icon">
                             <i class="iconfont icon-password"></i>
                         </span>
-                        <input :type="showpass ? 'text' : 'password'" v-model.trim="password" />
+                        <input :type="showpass ? 'text' : 'password'" v-model.trim="password" :placeholder="$t('header.inputPassword')" />
                         <div class="tips" v-show="errors.password">{{ errors.password }}</div>
                         <span class="showpass" @click="showpass = !showpass">
                             <i class="iconfont" :class="[showpass ? 'icon-log_eye_selected' : 'icon-log_eye_normal']"></i>
@@ -45,7 +45,9 @@
 import { ref, onMounted } from 'vue'
 import { http } from '@/utils/request'
 import common from '@/utils/common'
+import browser from '@/utils/browser'
 import { useI18n, getLocale } from '@/i18n'
+const projectId = browser.valueFromUrl('projectId') || ''
 const { t } = useI18n({ useScope: 'global' })
 const emits = defineEmits(['close', 'user'])
 const showpass = ref(false)
@@ -73,6 +75,7 @@ const onLogin = () => {
         phoneNum: username.value,
         rememberMe: remember.value,
         randomcode: '1234',
+        projectId
     })
         .then(response => {
             if (response.success) {
@@ -94,7 +97,11 @@ const onLogin = () => {
                 })
                 emits('close')
             } else {
-                errors.value.message = response.message
+                if (response.code == 4002) {
+                    errors.value.message = '该账号下未检测到当前场景,请更换账号重新登录'
+                } else {
+                    errors.value.message = response.message
+                }
             }
         })
         .catch(() => {

+ 1 - 1
src/components/header/index.vue

@@ -15,7 +15,7 @@
                 </li>
                 <li><em></em></li>
                 <li v-if="user" class="uinfo" @click="showDrop = true">
-                    <img :src="user.head + '&x-oss-process=image/resize,m_fill,w_64,h_64/quality,q_70'" alt="" />
+                    <img :src="user.head.indexOf('/newHead.png') != -1 ? user.head : user.head + '&x-oss-process=image/resize,m_fill,w_64,h_64/quality,q_70'" alt="" />
                     <div class="menu">
                         <ul>
                             <li>

+ 11 - 1
src/locales/en.json

@@ -77,6 +77,12 @@
     "tag.name": "标注",
     "components.name": "组件",
     "header.name": "头部",
+    "toast": {
+        "clickLeft": "请先在左侧点击",
+        "clickTop": "请先在上方点击",
+        "ruleConfirmTips": "起点确定完毕,请定位终点"
+    },
+    "toast.name": "提示",
     "common": {
         "high": "高",
         "middle": "中",
@@ -92,9 +98,13 @@
         "login": "login",
         "cancel": "cancel",
         "sync": "sync",
+        "deleteRuleLine": "删除测量线",
         "deleteSuccess": "删除成功",
         "copySuccess": "复制成功",
-        "syncSuccess": "同步成功"
+        "syncSuccess": "同步成功",
+        "endPoint": "终点",
+        "startPoint": "起点",
+        "measure": "测量"
     },
     "common.name": "通用",
     "code": {

+ 11 - 1
src/locales/ja.json

@@ -77,6 +77,12 @@
     "tag.name": "标注",
     "components.name": "组件",
     "header.name": "头部",
+    "toast": {
+        "clickLeft": "请先在左侧点击",
+        "clickTop": "请先在上方点击",
+        "ruleConfirmTips": "起点确定完毕,请定位终点"
+    },
+    "toast.name": "提示",
     "common": {
         "high": "高",
         "middle": "中",
@@ -92,9 +98,13 @@
         "login": "登录",
         "cancel": "取消",
         "sync": "同步",
+        "deleteRuleLine": "删除测量线",
         "deleteSuccess": "删除成功",
         "copySuccess": "复制成功",
-        "syncSuccess": "同步成功"
+        "syncSuccess": "同步成功",
+        "endPoint": "终点",
+        "startPoint": "起点",
+        "measure": "测量"
     },
     "common.name": "通用",
     "code": {

+ 13 - 1
src/locales/zh.json

@@ -12,6 +12,8 @@
   },
   "home.name": "首页",
   "header": {
+    "inputPhoneNum": "请输入手机号码",
+    "inputPassword": "请输入密码",
     "passwordText1": "密码不能为空",
     "phoneText1": "手机号码不能为空",
     "phoneText2": "请输入正确手机号",
@@ -77,6 +79,12 @@
   "tag.name": "标注",
   "components.name": "组件",
   "header.name": "头部",
+  "toast": {
+    "clickLeft": "请先在左侧点击",
+    "clickTop": "请先在上方点击",
+    "ruleConfirmTips": "起点确定完毕,请定位终点"
+  },
+  "toast.name": "提示",
   "common": {
     "high": "高",
     "middle": "中",
@@ -92,9 +100,13 @@
     "login": "登录",
     "cancel": "取消",
     "sync": "同步",
+    "deleteRuleLine": "删除测量线",
     "deleteSuccess": "删除成功",
     "copySuccess": "复制成功",
-    "syncSuccess": "同步成功"
+    "syncSuccess": "同步成功",
+    "endPoint": "终点",
+    "startPoint": "起点",
+    "measure": "测量"
   },
   "common.name": "通用",
   "code": {

+ 84 - 0
src/pages/DesignOption/measure.scss

@@ -0,0 +1,84 @@
+.delete-ruler {
+    li {
+        white-space: nowrap;
+    }
+}
+
+.widgets-design-option {
+    width: 100%;
+    height: 100%;
+    z-index: 4;
+    position: absolute;
+    user-select: none;
+    overflow: hidden;
+    pointer-events: none;
+    left: 0;
+    top: 0;
+
+    i {
+        margin: 0 5px;
+        &:before {
+            font-family: 'iconfont' !important;
+            font-size: 32px;
+            line-height: 36px;
+            font-style: normal;
+        }
+    }
+
+    li {
+        cursor: pointer;
+    }
+
+    > div {
+        height: 36px;
+        background: #262729;
+        position: absolute;
+        transform: translate(-100%, -50%) translateX(-15px);
+        border-top-left-radius: 18px;
+        border-bottom-left-radius: 18px;
+        padding-left: 10px;
+        pointer-events: auto;
+        box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.4);
+        &:after {
+            position: absolute;
+            right: -15px;
+            top: 0;
+            content: '';
+            width: 0;
+            height: 0;
+            border-style: solid;
+            border-width: 18px 0 18px 15px;
+            border-color: transparent transparent transparent #262729;
+        }
+    }
+
+    &.right > div {
+        transform: translate(15px, -50%);
+        border-top-left-radius: 0;
+        border-bottom-left-radius: 0;
+        border-top-right-radius: 18px;
+        border-bottom-right-radius: 18px;
+        padding: 0 10px 0 0;
+        &:after {
+            right: auto;
+            left: -15px;
+            border-width: 18px 15px 18px 0;
+            border-color: transparent #262729 transparent transparent;
+        }
+    }
+    .delete-ruler li {
+        line-height: 36px;
+        padding: 0 10px;
+        word-break: keep-all;
+        list-style: none;
+        color: #fff;
+    }
+}
+
+
+
+[xui_tags] {
+    position: absolute;
+    width: 100%;
+    height: 100%;
+}

+ 68 - 0
src/pages/Rules/index.vue

@@ -0,0 +1,68 @@
+<!--  -->
+<template>
+    <div class="rules-box">
+        <button class="ui-button primary" @click="confirmRules" :class="{ disabled: !next }">{{ rulesIndex >= 2 ? $t('common.endPoint') : $t('common.startPoint') }}({{ rulesIndex }}/2)</button
+        ><button class="ui-button cancel" @click="cancelRules">{{ $t('common.cancel') }}</button>
+    </div>
+
+    <Toast v-if="showTips" type="warn" :content="showTips" :close="() => (showTips = null)" />
+</template>
+
+<script setup>
+import { reactive, toRefs, onBeforeMount, onMounted, ref, defineEmits } from 'vue'
+import Toast from '@/components/dialog/Toast'
+import i18n from '@/i18n'
+const showTips = ref(null)
+const { t } = i18n.global
+const rulesIndex = ref(1)
+const emits = defineEmits(['close'])
+const confirmRules = () => {
+    next.value = false
+    window.kankan.TagManager.confirmMeasure(rulesIndex.value)
+    if (rulesIndex.value < 2) {
+        showTips.value = t('toast.ruleConfirmTips')
+        rulesIndex.value++
+    } else {
+        cancelRules()
+    }
+}
+const cancelRules = () => {
+    emits('close')
+    rulesIndex.value = 1
+}
+const next = ref(false)
+onMounted(() => {
+    window.kankan.TagManager.on('tagManager.markTagPos', res => {
+        next.value = true
+    })
+})
+</script>
+<style lang="scss" scoped>
+.rules-box {
+    position: fixed;
+    z-index: 1001;
+
+    bottom: 20px;
+    left: 50%;
+    transform: translateX(-50%);
+    min-width: 150px;
+    .ui-button {
+        margin-bottom: 10px;
+        &:last-of-type {
+            margin-bottom: 0;
+        }
+        &.cancel {
+            background: rgba(92, 92, 92, 0.51) !important;
+            color: #fff !important;
+            border: none !important;
+        }
+    }
+}
+
+.ui-button.primary {
+    background-color: var(--colors-primary-base) !important;
+    color: var(--colors-normal-fill-hover);
+    border: none;
+    opacity: 1;
+}
+</style>

+ 2 - 0
src/pages/SViewer.vue

@@ -197,6 +197,8 @@ const onSelected = data => {
         if (find.num != source.value.num) {
             source.value = find
         }
+    } else {
+        showTips.value = t('home.dateScene')
     }
 }
 

+ 89 - 30
src/pages/Viewer.vue

@@ -1,10 +1,12 @@
 <template>
+    <Rules v-if="showRules" @close="closeRules" />
+
     <AppHeader v-show="!fscChecked" :project="project" @getUserId="getUserId" :show-adjust="showAdjust" @update="onPointsUpdate" />
     <article>
         <main>
             <div class="split">
                 <iframe ref="sourceFrame" v-if="sourceURL" :src="sourceURL" frameborder="0" @load="onLoadSource"></iframe>
-                <div class="tools" v-if="source" v-show="showWidget && !showAdjust && !fscChecked && (dbsChecked || (!target && !bimChecked))">
+                <div class="tools" v-if="source && !showRules && !ruleChecked" v-show="showWidget && !showAdjust && !fscChecked && (dbsChecked || (!target && !bimChecked))">
                     <div class="item-date">
                         <calendar
                             name="source"
@@ -69,20 +71,26 @@
                     </div>
                 </div>
             </div>
-            <div class="model" v-show="showWidget && !showAdjust">
-                <div v-if="isLogin" class="file" :class="{ active: fileChecked, disable: fileDisable }" v-show="!fscChecked && !showBim && !dbsChecked && !bimChecked">
+            <div class="model" v-show="showWidget && !showAdjust && !showRules">
+                <div v-if="isLogin" class="file" :class="{ active: fileChecked, disable: fileDisable }" v-show="!fscChecked && !showBim && !dbsChecked && !bimChecked && !ruleChecked">
                     <div @click="onFileChecked">
                         <i class="iconfont icon-note1"></i>
                         <span>{{ $t('home.tag') }}</span>
                     </div>
                 </div>
-                <div class="bim" :class="{ active: bimChecked, disable: bimDisable }" v-show="!fscChecked && !showBim">
+                <div class="rule" :class="{ active: ruleChecked, disable: fileDisable }" v-show="!fscChecked && !showBim && !dbsChecked && !bimChecked">
+                    <div @click="onRuleChecked">
+                        <i class="iconfont icon-measurement"></i>
+                        <span>{{ $t('common.measure') }}</span>
+                    </div>
+                </div>
+                <div class="bim" :class="{ active: bimChecked, disable: bimDisable }" v-show="!fscChecked && !showBim && !ruleChecked">
                     <div @click="onBimChecked">
                         <i class="iconfont icon-BIM"></i>
                         <span>BIM</span>
                     </div>
                 </div>
-                <div class="dbs" :class="{ active: dbsChecked, disable: dbsDisable }" v-show="!fscChecked && !showBim">
+                <div class="dbs" :class="{ active: dbsChecked, disable: dbsDisable }" v-show="!fscChecked && !showBim && !ruleChecked">
                     <div @click="onDbsChecked">
                         <i class="iconfont icon-split_screen"></i>
                         <span>{{ $t('home.splitScreen') }}</span>
@@ -112,22 +120,30 @@ import Files from '@/components/files'
 import TagManager from '@/components/files/TagManager'
 import sync, { beforeChangeURL, loadSourceScene, loadTargetScene, setPanoWithBim, flyToP1P2 } from '@/utils/sync'
 import i18n from '@/i18n'
+import Rules from './Rules'
 const { t } = i18n.global
 const isDev = process.env.VUE_APP_TEST == 1
-
+const rules = []
 const tags = ref([])
 const notify = ref(null)
 const isEdit = ref(false)
 const isLogin = ref(false)
+const isFlying = ref(false)
 provide('tags', tags)
 provide('notify', notify)
 provide('isEdit', isEdit)
 provide('isLogin', isLogin)
+provide('isFlying', isFlying)
 const userId = ref(localStorage.getItem('userId') || null)
 
 const getUserId = id => {
     userId.value = id
 }
+const showRules = ref(false)
+const closeRules = () => {
+    showRules.value = false
+    window.kankan.TagManager.cancelMeasure()
+}
 
 // 是否BIM模式
 const showBim = ref(browser.urlHasValue('bim'))
@@ -139,6 +155,7 @@ const bimChecked = ref()
 const dbsChecked = ref(null)
 const fscChecked = ref(null)
 const fileChecked = ref(false)
+const ruleChecked = ref(false)
 
 const datepickName = ref(null)
 
@@ -199,7 +216,8 @@ const sourceURL = computed(() => {
     if (!source.value) {
         return
     }
-
+    // console.log(1111)
+    getTagList(source.value.num)
     if (source.value.type < 2) {
         // 看看、看见场景
         return `smart-kankan.html?m=${source.value.num}${isDev ? '&dev' : ''}`
@@ -212,8 +230,8 @@ const targetURL = computed(() => {
     if (bimChecked.value) {
         return `smart-bim.html?m=${project.value.bimData.bimOssFilePath}`
     }
-
-    if (source.value.type < 2) {
+    getTagList(target.value.num)
+    if (target.value.type < 2) {
         // 看看、看见场景
         return `smart-kankan.html?m=${target.value.num}${isDev ? '&dev' : ''}`
     } else {
@@ -294,8 +312,25 @@ const onLoadSource = () => {
     if (source.value.type < 2) {
         window['kankan'] = sourceFrame.value.contentWindow.app
         window['kankan'].TagManager.load(tags.value)
+
+        window['kankan'].Camera.on('flying.started', pano => {
+            isFlying.value = true
+        })
+        window['kankan'].Camera.on('flying.ended', pano => {
+            isFlying.value = false
+        })
     } else {
         window['laser'] = sourceFrame.value.contentWindow.loaded
+        window.laser.then(sdk => {
+            console.error(window[0].viewer)
+
+            window[0].viewer.images360.addEventListener('flyToPano', () => {
+                isFlying.value = true
+            })
+            window[0].viewer.images360.addEventListener('flyToPanoDone', () => {
+                isFlying.value = false
+            })
+        })
     }
     loadSourceScene(sourceFrame, source.value.type < 2 ? 'kankan' : 'laser', mode.value)
 }
@@ -542,10 +577,44 @@ const onP2Click = type => {
 
     flyToP1P2(points.value.p2)
 }
-
-onMounted(() => {
-    const num = browser.valueFromUrl('m') || ''
-    const projectId = browser.valueFromUrl('projectId') || 1
+const onRuleChecked = () => {
+    if (ruleChecked.value) {
+        ruleChecked.value = false
+        rules.forEach(rule => {
+            rule.clear()
+        })
+        return
+    }
+    if (source.value.type < 2) {
+        showRules.value = true
+        window.kankan.TagManager.startMeasure()
+    } else {
+        sync.sourceInst.loaded.then(sdk => {
+            const rule = sdk.startMeasure()
+            rules.push(rule)
+        })
+        ruleChecked.value = true
+    }
+}
+const getTagList = num => {
+    http.post(`smart-site/marking/list`, {
+        projectId: projectId,
+        pageNum: 1,
+        pageSize: 200,
+        num: num ? num : browser.getURLParam('m'),
+    }).then(response => {
+        if (response.data && response.data.list) {
+            tags.value = response.data.list.map(item => {
+                item.hotData.visible = false
+                item.hotData.id = item.markingId
+                item.hotData.createTime = item.createTime
+                item.hotData.lastCreateBy = item.lastCreateBy
+                return item.hotData
+            })
+        }
+    })
+}
+const getInfo = () => {
     http.get(`smart-site/project/info?projectId=${projectId}&sceneOrder=asc`)
         .then(response => {
             if (response.success) {
@@ -593,23 +662,13 @@ onMounted(() => {
         .catch(() => {
             showTips.value = t('code.failed')
         })
-    console.error(browser.getURLParam('m'))
-    http.post(`smart-site/marking/list`, {
-        projectId: projectId,
-        pageNum: 1,
-        pageSize: 200,
-        num: browser.getURLParam('m'),
-    }).then(response => {
-        if (response.data && response.data.list) {
-            tags.value = response.data.list.map(item => {
-                item.hotData.visible = false
-                item.hotData.id = item.markingId
-                item.hotData.createTime = item.createTime
-                item.hotData.lastCreateBy = item.lastCreateBy
-                return item.hotData
-            })
-        }
-    })
+}
+const num = browser.valueFromUrl('m') || ''
+const projectId = browser.valueFromUrl('projectId') || 1
+
+onMounted(() => {
+    getInfo()
+    getTagList()
 })
 </script>
 

+ 1 - 0
src/pages/kankan.js

@@ -1,3 +1,4 @@
+import './DesignOption/measure.scss'
 import browser from '../utils/browser'
 
 window.app = new KanKan({

+ 1 - 1
vue.config.js

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