Selaa lähdekoodia

Merge branch 'v1.9.0-jm' of http://192.168.0.115:3000/bill/fuse-code into v1.9.0-jm

xzw 8 kuukautta sitten
vanhempi
commit
b771f0bd5d
4 muutettua tiedostoa jossa 12 lisäystä ja 18 poistoa
  1. 0 4
      src/api/tagging-position.ts
  2. 2 1
      src/api/tagging.ts
  3. 10 9
      src/components/tagging/sign-new.vue
  4. 0 4
      src/sdk/sdk.ts

+ 0 - 4
src/api/tagging-position.ts

@@ -19,7 +19,6 @@ interface ServicePosition {
   normal: string
   
   globalVisibility: boolean
-  altitudeAboveGround: number
   type: string,
   mat: string
   fontSize: number,
@@ -40,7 +39,6 @@ export interface TaggingPosition {
   lineHeight: number,
   globalVisibility: boolean
 
-  altitudeAboveGround: number
   type: TaggingPositionType
   mat: Tagging3DProps['mat']
 }
@@ -62,7 +60,6 @@ const serviceToLocal = (position: ServicePosition, taggingId?: Tagging['id']): T
   },
   fontSize: position.fontSize || 12,
   lineHeight: position.lineHeight || 1,
-  altitudeAboveGround: position.altitudeAboveGround
 })
 
 const localToService = (position: TaggingPosition, update = false): PartialProps<ServicePosition, 'tagPointId'> => ({
@@ -73,7 +70,6 @@ const localToService = (position: TaggingPosition, update = false): PartialProps
   globalVisibility: position.globalVisibility,
   type: position.type,
   mat: position.mat && JSON.stringify(position.mat),
-  altitudeAboveGround: position.altitudeAboveGround,
   normal: JSON.stringify(position.normal),
   fontSize: position.fontSize,
   lineHeight: position.lineHeight

+ 2 - 1
src/api/tagging.ts

@@ -50,7 +50,8 @@ const serviceToLocal = (serviceTagging: ServerTagging): Tagging => ({
   title: serviceTagging.tagTitle,
   desc: serviceTagging.tagDescribe,
   part: serviceTagging.leaveBehind,
-  show3dTitle: serviceTagging.show3dTitle,
+  show3dTitle: true, 
+  // show3dTitle: serviceTagging.show3dTitle,
   method: serviceTagging.getMethod,
   principal: serviceTagging.getUser,
   audio: serviceTagging.audio,

+ 10 - 9
src/components/tagging/sign-new.vue

@@ -84,7 +84,6 @@ const tag = sdk.createTagging({
 });
 
 const changePos = () => {
-  console.error("getImageCenter", tag.getImageCenter());
   pos.value = { localPos: tag.getImageCenter(), modelId: props.scenePos.modelId };
 };
 
@@ -92,10 +91,12 @@ watch(taggingStyle, (icon) => icon && tag.changeImage(getFileUrl(icon.icon)));
 watchEffect(() => {
   tag.changeCanMove(router.currentRoute.value.name === RoutesName.tagging);
 });
-// watchEffect(() => tag.changeMat(props.scenePos.mat));
-// watchEffect(() => tag.changeFontSize(props.scenePos.fontSize));
-// watchEffect(() => tag.changeLineHeight(props.scenePos.lineHeight));
-watchEffect(() => tag.changeAltitudeAboveGround(props.scenePos.altitudeAboveGround));
+watchEffect(() => tag.changeMat(props.scenePos.mat));
+watchEffect(() => tag.changeFontSize(props.scenePos.fontSize));
+watchEffect(() => {
+  tag.changeLineHeight(props.scenePos.lineHeight);
+  changePos();
+});
 watchEffect(() => tag.changeTitle(props.tagging.title));
 watchEffect(() => tag.visibilityTitle(props.tagging.show3dTitle));
 watchEffect(() => {
@@ -103,10 +104,10 @@ watchEffect(() => {
   changePos();
 });
 
-const [toCameraDistance] = useCameraChange(
-  () => tag.getCameraDisSquared && tag.getCameraDisSquared()
-);
-const maxDisSqua = Math.sqrt(30);
+const [toCameraDistance] = useCameraChange(() => {
+  return tag.getCameraDisSquared && tag.getCameraDisSquared();
+});
+const maxDisSqua = Math.pow(30, 2);
 const show = computed(
   () => props.scenePos.globalVisibility || toCameraDistance.value <= maxDisSqua
 );

+ 0 - 4
src/sdk/sdk.ts

@@ -258,8 +258,6 @@ export type Tagging3DProps = {
   canMove: boolean,
   // 贴地图片url
   image: string
-  // 离地高度
-  altitudeAboveGround: number,
   
   // 贴地图片的变换
   mat: {
@@ -294,8 +292,6 @@ export type Tagging3D = {
   visibility: (visibility: boolean) => void
   // 标注图片变换,传入变换
   changeMat: (props: Tagging3DProps['mat']) => void
-  // 更改离地高度
-  changeAltitudeAboveGround: (val: number) => void
   // 更改热点类型
   changeType: (val: TaggingPositionType) => void
   // 距离相机位置