Browse Source

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

xzw 4 months ago
parent
commit
f87c6833f4

File diff suppressed because it is too large
+ 939 - 1295
pnpm-lock.yaml


+ 1 - 0
src/components/path/list.vue

@@ -6,6 +6,7 @@
     @delete="deletePath(path)"
     @updatePoints="(data) => updatePosition(index, data)"
     @updateLinePosition="(data) => updateLinePosition(index, data)"
+    @updateLineHeight="(data) => (paths[index].lineAltitudeAboveGround = data)"
     :ref="(node: any) => nodeHandler(index, node)"
     :path="path"
     :key="path.id"

+ 6 - 0
src/components/path/sign.vue

@@ -25,6 +25,7 @@ const emit = defineEmits<{
   (e: "delete"): void;
   (e: "updateLinePosition", val: Path["linePosition"]): void;
   (e: "updatePoints", val: Path["points"]): void;
+  (e: "updateLineHeight", val: Path["lineAltitudeAboveGround"]): void;
 }>();
 
 const getLineProps = () => ({
@@ -69,6 +70,11 @@ path.bus.on("changePoints", (points) => {
   }));
   emit("updatePoints", currentPoints);
 });
+path.bus.on("changeLineHeight", (val) => {
+  emit("updateLineHeight", val);
+  clearTimeout(changLineTimeout);
+});
+
 watchEffect(() => {
   path.changeName(props.path.name);
 });

+ 1 - 0
src/components/tagging/list.vue

@@ -4,6 +4,7 @@
       v-if="getTaggingPositionIsShow(pos)"
       @delete="deletePosition(pos)"
       @changePosition="(data: any) => updatePosition(index, data)"
+      @change-line-height="(data: number) => positions[index].lineHeight = data"
       :tagging="tagging"
       :ref="(node: any) => nodes[index] = ({ node, id: pos.id })"
       :scene-pos="pos"

+ 28 - 5
src/components/tagging/sign-new.vue

@@ -80,6 +80,7 @@ export type SignProps = { tagging: Tagging; scenePos: TaggingPosition; show?: bo
 const props = defineProps<SignProps>();
 const emit = defineEmits<{
   (e: "delete"): void;
+  (e: "changeLineHeight", val: number): void;
   (
     e: "changePosition",
     val: { position: SceneLocalPos; modelId: string; normal: SceneLocalPos }
@@ -124,10 +125,6 @@ const changePos = () => {
 watch(taggingStyle, (icon) => icon && tag.changeImage(getFileUrl(icon.icon)));
 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(() => {
@@ -142,7 +139,6 @@ const getPosition = () => ({
 let currentPosition = getPosition();
 let changeTimeout: any;
 tag.bus.on("changePosition", (data) => {
-  console.error(data);
   clearTimeout(changeTimeout);
   emit(
     "changePosition",
@@ -155,6 +151,22 @@ tag.bus.on("changePosition", (data) => {
   changePos();
 });
 
+tag.bus.on("changePosition", (data) => {
+  clearTimeout(changeTimeout);
+  emit(
+    "changePosition",
+    (currentPosition = {
+      position: { ...data.pos },
+      normal: { ...data.normal },
+      modelId: data.modelId,
+    })
+  );
+  changePos();
+});
+tag.bus.on("changeLineHeight", (lineHeight) => {
+  emit("changeLineHeight", lineHeight);
+});
+
 watch(getPosition, (p) => {
   changeTimeout = setTimeout(() => {
     if (inRevise(p, currentPosition)) {
@@ -165,6 +177,17 @@ watch(getPosition, (p) => {
   }, 16);
 });
 
+watch(
+  () => props.scenePos.lineHeight,
+  () => {
+    changeTimeout = setTimeout(() => {
+      tag.changeLineHeight(props.scenePos.lineHeight);
+      changePos();
+    }, 16);
+  },
+  { immediate: true }
+);
+
 const [toCameraDistance] = useCameraChange(() => {
   return tag.getCameraDisSquared && tag.getCameraDisSquared();
 });

+ 13 - 0
src/sdk/association/setting.ts

@@ -41,6 +41,19 @@ export const associationSetting = (sdk: SDK, mountEl: HTMLDivElement) => {
     }
 
 
+      // sdk.changeMapTile && sdk.changeMapTile([
+        // 谷歌-栅格瓦片
+        // {tempUrl: 'https://mt0.google.com/vt/lyrs=m&x={x}&y={y}&z={z}', maximumLevel: 18},
+        // 谷歌-卫星图
+        // {tempUrl: 'https://mt0.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', maximumLevel: 18},
+        // 谷歌-卫星图+标签
+        // {tempUrl: 'https://mt0.google.com/vt/lyrs=y&x={x}&y={y}&z={z}', maximumLevel: 18},
+        // 地形图
+        // {tempUrl: 'https://mt0.google.com/vt/lyrs=t&x={x}&y={y}&z={z}', maximumLevel: 18},
+        // 仅道路
+        // {tempUrl: 'https://mt0.google.com/vt/lyrs=h&x={x}&y={y}&z={z}', maximumLevel: 18},
+      // ])
+
     if (tile) {
       console.log('切换瓦片图', tile.mapUrls)
       sdk.changeMapTile && sdk.changeMapTile(tile.mapUrls)

+ 2 - 0
src/sdk/sdk.ts

@@ -249,6 +249,7 @@ export type PathProps = {
 };
 export type Path = {
   bus: Emitter<{
+    changeLineHeight: number
     activePoint: number;
     // 标注点击事件
     click: void;
@@ -335,6 +336,7 @@ export type Tagging3D = {
       modelId: string;
       normal: SceneLocalPos;
     };
+    changeLineHeight: number
   }>;
   changePosition: (position: {
     modelId: string;