ソースを参照

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

xzw 2 年 前
コミット
ebbdf849de

ファイルの差分が大きいため隠しています
+ 2 - 2
public/js/smart.js


+ 61 - 27
public/static/lib/potree/potree.js

@@ -57158,6 +57158,7 @@
 	    depthTexture:{ value: null },
 	    nearPlane:{value: 0.1},
 	    farPlane:{value: 100000},
+	    //uUseOrthographicCamera:{ type: "b", value: false },
 
 	};
 
@@ -57379,7 +57380,7 @@
 				offset *= lineWidth;
 
 				// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
-				offset /= resolution.y * devicePixelRatio;
+				offset /= resolution.y; //* devicePixelRatio;
 
 				// select end
 				vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;
@@ -57407,7 +57408,7 @@
 		uniform vec3 diffuse;
 		uniform float opacity;
 		uniform float lineWidth;
-         
+        uniform bool uUseOrthographicCamera; 
 		#ifdef USE_DASH
 
 			uniform float dashOffset;
@@ -57461,8 +57462,12 @@
         #if defined(GL_EXT_frag_depth) && defined(useDepth)  
             float convertToLinear(float zValue)
             {
-                float z = zValue * 2.0 - 1.0;
-                return (2.0 * nearPlane * farPlane) / (farPlane + nearPlane - z * (farPlane - nearPlane));
+                //if(uUseOrthographicCamera){
+                //    return zValue*(farPlane-nearPlane)+nearPlane;
+                //}else{ 
+                    float z = zValue * 2.0 - 1.0;
+                    return (2.0 * nearPlane * farPlane) / (farPlane + nearPlane - z * (farPlane - nearPlane));
+                //} 
             }
         #endif
 
@@ -57961,7 +57966,7 @@
 	        this.events = {
 	            setSize:(e)=>{//如果出现横条状的异常,往往是viewportOffset出错  //地图不需要
 	                let viewport = e.viewport; 
-	                this.uniforms.resolution.value.copy(viewport.resolution);  
+	                this.uniforms.resolution.value.copy(viewport.resolution2);  
 	                this.uniforms.devicePixelRatio.value = window.devicePixelRatio; 
 	                this.lineWidth = this.lineWidth_; //update
 	                if(!this.useDepth || !e.viewport.camera.isPerspectiveCamera || !e.viewport)return
@@ -58043,7 +58048,7 @@
 	            this.uniforms.nearPlane.value = camera.near;
 	            this.uniforms.farPlane.value = camera.far;
 	        }
-	           
+	        //this.uniforms.uUseOrthographicCamera.value = !camera.isPerspectiveCamera
 	    }
 
 	}
@@ -63553,12 +63558,17 @@ uniform vec3 baseColor;
     uniform float clipDistance;
     uniform float maxClipFactor;
     uniform float maxOcclusionFactor;
+    //uniform bool uUseOrthographicCamera;                                    
 
     float convertToLinear(float zValue)
     {
-        float z = zValue * 2.0 - 1.0;
-        return (2.0 * nearPlane * farPlane) / (farPlane + nearPlane - z * (farPlane - nearPlane));
-    }
+        //if(uUseOrthographicCamera){
+        //   return zValue*(farPlane-nearPlane)+nearPlane;
+        //}else{ 
+            float z = zValue * 2.0 - 1.0;
+            return (2.0 * nearPlane * farPlane) / (farPlane + nearPlane - z * (farPlane - nearPlane));
+        //}      
+     }
 #endif
   
 void main() {
@@ -70795,7 +70805,8 @@ void main()
 	        
 	        let uniforms = {
 				resolution:    { type: 'v2',  value: new Vector2(width, height ) },
-	            viewportOffset: { type: 'v2',  value: new Vector2(0, 0 ) }, //left, top    
+	            viewportOffset: { type: 'v2',  value: new Vector2(0, 0 ) }, //left, top 
+	            //uUseOrthographicCamera:{ type: "b", value: false },
 				nearPlane:     { type: 'f', 	value: 0.1 },
 				farPlane:      { type: 'f', 	value: 10000 }, 
 				depthTexture:   { type: 't', 	value: null }, 
@@ -70827,8 +70838,22 @@ void main()
 	                if(!this.useDepth || !e.viewport.camera.isPerspectiveCamera || !e.viewport)return
 	                let viewport = e.viewport;
 	                let viewportOffset = viewport.offset || new Vector2(); 
-	                this.uniforms.resolution.value.copy(viewport.resolution); 
+	                this.uniforms.resolution.value.copy(viewport.resolution2);  //2023.6.12突然发现ratio>1的用resolution不对,得用2才对。但是之前明明记得不是这样
 	                this.uniforms.viewportOffset.value.copy(viewportOffset);
+	                
+	                
+	                /* let dt = this.uniforms.depthTexture.value
+	                if(window.logDep != 1000 && dt ){ 
+	                    window.logDep = (window.logDep || 0) + 1
+	                    
+	                    
+	                    console.log(' DepthParams', [ viewport.resolution.x, viewport.resolution.y], 
+	                        [dt.image.width, dt.image.height] ,
+	                        this.uniforms.nearPlane.value, this.uniforms.farPlane.value
+	                    )
+	                    
+	                } */
+	                
 	            },
 	            render:(e)=>{//before render  如果有大于两个viewport的话,不同viewport用不同的depthTex
 	                this.updateDepthParams(e);
@@ -70958,8 +70983,10 @@ void main()
 	            this.uniforms.depthTexture.value = viewer.getPRenderer().getRtEDL(viewport).depthTexture;   //其实只赋值一次就行
 	            this.uniforms.nearPlane.value = camera.near;
 	            this.uniforms.farPlane.value = camera.far;
+	            
+	            
 	        }
-	              
+	        //this.uniforms.uUseOrthographicCamera.value = !camera.isPerspectiveCamera
 	    }
 
 	    
@@ -71029,7 +71056,7 @@ void main()
 	        while(parent){
 	            if(parent.visible === false){
 	                v = false;
-	                break; 
+	                break;  
 	            }
 	            lastParent = parent;
 	            parent = parent.parent;
@@ -72852,11 +72879,13 @@ void main()
 	    let gl_;
 	    Features.EXT_DEPTH = { 
 	        isSupported: function (gl) { 
-	        
+	         
 	            gl = gl || gl_;
 	            gl_ = gl;
 	            if(browser.detectIOS()){
 	                let {major,minor,patch} = browser.iosVersion();
+	                //console.warn('iosVersion',major,minor,patch)
+	                
 	                if(major == 15 && minor == 4 && patch == 1){
 	                    console.warn('检测到是ios15.4.1, 关闭EXT_frag_depth');//该版本ext_depth有问题,导致clear错乱。没有解决办法先关闭。
 	                    return false
@@ -73541,9 +73570,12 @@ void main()
 	    update(); 
 	    
 	}; 
-	 
-	 
-	 
+	/* 
+	    复杂案例: 如果物体默认隐藏, 当符合任何一个其他条件时可见,则可:
+	    Potree.Utils.updateVisible(this, "default", false, 0 ) //默认隐藏    
+	    Potree.Utils.updateVisible(this, 条件名,  ifShow, 1, ifShow?'add':'cancel' ) //其他的条件
+	*/ 
+
 	 
 	Utils.getObjVisiByReason = function(object,reason){//获取在某条件下是否可见.  注: 用户在数据集选择可不可见为"datasetSelection"
 	    if(object.visible)return true
@@ -74800,6 +74832,11 @@ void main()
 	     */ 
 	    Potree.settings.number = number || 't-o5YMR13';// 't-iksBApb'// 写在viewer前
 	 
+	    if(!Potree.settings.isOfficial){ 
+	        if(/* Potree.settings.isTest && */ browser.isMobile()){
+	            changeLog();
+	        }
+	    }  
 	    
 	    if(browser.urlHasValue('google'))Potree.settings.mapCompany = 'google'; 
 	    if(browser.urlHasValue('timing'))Potree.measureTimings = 1;
@@ -74826,10 +74863,7 @@ void main()
 	            viewer.toggleSidebar();
 	        }); 
 	        Potree.settings.sizeFitToLevel = true;//当type为衰减模式时自动根据level调节大小。每长一级,大小就除以2
-	        Potree.settings.rotAroundPoint = false;
-	        if(/* Potree.settings.isTest && */ browser.isMobile()){
-	            changeLog();
-	        }
+	        Potree.settings.rotAroundPoint = false; 
 	    }  
 
 	    Potree.loadDatasetsCallback = function(data, ifReload){
@@ -92459,10 +92493,11 @@ void main()
 	                
 	                var width_ = width * view.width;
 	                var height_ = height * view.height;
+	                 
+	                view.setResolution(Math.ceil(width_), Math.ceil(height_), width, height ); //本来应该是floor,但是这样奇数时会少一个像素,导致向左移一个像素且宽度少1。现在则多绘制1个像素,超出的1个像素应该不会绘制出来(但不知道其他地方是否有偏差,比如pick时)
 	                
-	                if(height_ == 0)return  //avoid NAN
 	                
-	                view.setResolution(Math.ceil(width_), Math.ceil(height_), width, height ); //本来应该是floor,但是这样奇数时会少一个像素,导致向左移一个像素且宽度少1。现在则多绘制1个像素,超出的1个像素应该不会绘制出来(但不知道其他地方是否有偏差,比如pick时)
+	                if(height_ == 0)return  //avoid NAN
 	                let aspect = width_ / height_;  //camera的参数精确些,不用视口的归整的resolution像素值,否则hasChange无法为true, 导致canvasResize了但map没update从而闪烁
 	                view.camera.aspect = aspect;
 	                
@@ -92962,9 +92997,8 @@ void main()
                     vec2 depth1 = getDepth(vWorldPosition1N, depthMap1, cameraHeight1, ceilHeight1, eyePos);
                     
                     
-                    gl_FragDepthEXT = mix(depth0.y,depth1.y,progress);
-                    
-                    
+                    gl_FragDepthEXT = mix(depth0.y,depth1.y,progress); 
+                    gl_FragDepthEXT = clamp(gl_FragDepthEXT, 0.0, 1.0);    //防止部分手机出现黑块。ios 16  。 因为我给的超远值超出范围
                     
 
                 #endif
@@ -95795,7 +95829,7 @@ void main()
 	        
 	        
 	        
-	        if(Potree.settings.isLocal){//原始规则
+	        if(Potree.settings.tileOriginUrl){//原始规则
 	            //1 === config.tiling.customCompression && (u = "_" + config.tiling["q" + e[panoSize]]);
 	            //1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
 	            d = "tiles/" + id + "/" + e[panoSize] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg"; 

ファイルの差分が大きいため隠しています
+ 1 - 1
public/static/lib/potree/potree.js.map


+ 3 - 2
src/components/files/TagEditor.vue

@@ -152,6 +152,7 @@ const handlerUpload = async data => {
         markingStatus: form.value.status,
         markingTitle: form.value.title,
         hotData: tag,
+        num: browser.getURLParam('m'),
     }
     if (tag.id) {
         params.markingId = tag.id
@@ -168,13 +169,13 @@ const handlerUpload = async data => {
                 pushData.content = tag.content
                 pushData.members = tag.members
                 pushData.createTime = response.data.createTime
-                console.error(pushData)
+              
                 tags.value.push(pushData)
                 pushData = null
             }
             isEdit.value = false
             delete notify.value.__temp
-            notify.value.id = response.data
+            notify.value.id = response.data.markingId
             notify.value = null
         } else if (response.code == 4008) {
             showTips.value = t('code.4008')

+ 2 - 0
src/components/files/content/Comment.vue

@@ -370,6 +370,7 @@ onBeforeUnmount(() => {})
                         }
                         .view-middle {
                             .comment-text {
+                                word-break: break-all;
                                 font-size: 14px;
                                 color: #fff;
                             }
@@ -422,6 +423,7 @@ onBeforeUnmount(() => {})
                                         .reply-text {
                                             font-size: 14px;
                                             color: #fff;
+                                            word-break: break-all;
                                             .reply-tips {
                                                 color: #0076f6;
                                                 margin: 0 2px;

+ 5 - 1
src/components/files/index.vue

@@ -38,24 +38,27 @@
             <div>{{ $t('tag.deleteTagText') }}</div>
         </template>
     </ui-confirm>
+    <Toast v-if="showTips" type="warn" :content="showTips" :close="() => (showTips = null)" />
 </template>
 <script setup>
 import { ref, inject, watchEffect, onMounted, nextTick } from 'vue'
+import browser from '@/utils/browser'
 import { http } from '@/utils/request'
 import UiConfirm from '@/components/dialog/Confirm.vue'
+import Toast from '@/components/dialog/Toast'
 let editTag = null
 let tempTag = null
 const exit$ = ref(null)
 const add$ = ref(null)
 const props = defineProps(['show'])
 const emits = defineEmits(['add', 'exit'])
+const showTips = ref(null)
 const handlerDel = status => {
     if (status == 'ok') {
         http.post(`smart-site/marking/del`, {
             markingId: delComfirm.value.id,
         }).then(response => {
             if (response.success) {
-                console.log(delComfirm.value)
                 let index = tags.value.findIndex(item => item.sid == delComfirm.value.sid)
                 if (index != -1) {
                     tags.value.splice(index, 1)
@@ -64,6 +67,7 @@ const handlerDel = status => {
                     notify.value = null
                 }
             } else {
+                showTips.value = response.message
             }
             delComfirm.value = null
         })

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

@@ -4,8 +4,8 @@
             <div class="swiper-wrapper">
                 <div class="swiper-slide" v-for="(item, index) in images" :style="`background-image: url(${item.src})`" :key="index"></div>
             </div>
-            <div class="swiper-button-prev"></div>
-            <div class="swiper-button-next"></div>
+            <div class="swiper-button-prev" @click.stop=""></div>
+            <div class="swiper-button-next" @click.stop=""></div>
         </div>
         <div v-if="isEdit" class="add" @click="file.click()" :class="{ disable: images.length >= 9 }">
             <span style="color: #fff" v-if="images.length < 9">{{ $t('components.continueAdd') }}</span

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

@@ -209,12 +209,14 @@ li {
 }
 header {
     position: relative;
-    height: 60px;
+    height: 61px;
     background-color: #1a1b1d;
     display: flex;
     justify-content: center;
     align-items: center;
     font-size: 16px;
+    outline: none;
+    border: none;
 }
 footer {
     position: absolute;

+ 3 - 2
src/pages/Viewer.vue

@@ -70,7 +70,7 @@
                 </div>
             </div>
             <div class="model" v-show="showWidget && !showAdjust">
-                <div v-if="isLogin" class="file" :class="{ active: fileChecked, disable: fileDisable }" v-show="!fscChecked && !showBim">
+                <div v-if="isLogin" class="file" :class="{ active: fileChecked, disable: fileDisable }" v-show="!fscChecked && !showBim && !dbsChecked && !bimChecked">
                     <div @click="onFileChecked">
                         <i class="iconfont icon-note1"></i>
                         <span>{{ $t('home.tag') }}</span>
@@ -591,11 +591,12 @@ 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 => {