bill 1 vuosi sitten
vanhempi
commit
0f8ba5248a

BIN
public/image/logo@2x.png


+ 1 - 1
src/view/login.vue

@@ -219,7 +219,7 @@ const submitClick = async () => {
   .top {
     margin-top: 50px;
     img {
-      width: 300px;
+      width: 142px;
     }
   }
   .bottom {

+ 8 - 6
src/view/map/map-right.vue

@@ -71,12 +71,14 @@
                     <Edit @click.stop="inputPoint = data.raw" />
                   </el-icon>
                 </template>
-                <el-icon
-                  color="#409efc"
-                  style="margin-left: 8px"
-                  v-if="data.type === 'scene'"
-                >
-                  <Link @click.stop="gotoScene(data.raw)" />
+                <el-icon color="#409efc" style="margin-left: 8px">
+                  <Link
+                    @click.stop="
+                      data.type === 'scene'
+                        ? gotoScene(data.raw)
+                        : emit('gotoPoint', data.raw)
+                    "
+                  />
                 </el-icon>
               </span>
             </div>

+ 2 - 2
src/view/map/map.vue

@@ -193,8 +193,8 @@ watch(points, refreshHots, { immediate: true });
 watch(tileType, refreshTileType, { immediate: true });
 watch(
   () => [router.currentRoute.value.name, router.currentRoute.value.params?.relicsId],
-  ([name, rid]) => {
-    if (["map", "query-map"].includes(name as string)) {
+  ([name, rid], old) => {
+    if (["map", "query-map"].includes(name as string) && (!old || old[1] !== rid)) {
       relics.value = undefined;
       const fn = name === "map" ? initSelfRelics : initRelics;
       fn(Number(rid)).finally(() => {

+ 2 - 3
src/view/pano/pano.vue

@@ -69,9 +69,8 @@ watchEffect(() => {
 
     if (!point.value) {
       initRelics(Number(params.value.relicsId)).then(() => {
-        if (scenePoints.value[pid]) {
-          point.value = scenePoints.value[pid];
-        } else {
+        point.value = scenePoints.value.find((scene) => scene.id === pid);
+        if (!point.value) {
           router.replace({ name: "relics" });
         }
       });

+ 5 - 0
src/view/step-tree/example/data.ts

@@ -34,6 +34,11 @@ export default [
                     status: "waiting",
                     serviceTypeParallel: "False",
                     hosts: [
+                      { host: "qladpaxasdasdasd1", status: "success" },
+                      { host: "qladpax1", status: "success" },
+                      { host: "qladpax1", status: "success" },
+                      { host: "qladpax1", status: "success" },
+                      { host: "qladpax1", status: "success" },
                       { host: "qladpax1", status: "success" },
                       { host: "qladpax2", status: "lose" },
                       { host: "qladpax3", status: "wating" },

+ 36 - 13
src/view/step-tree/step-tree.vue

@@ -60,28 +60,51 @@ const getStepSize = (step: any) => {
   );
 
   if (step.hosts?.length) {
-    const hostSize = step.hosts.reduce(
-      (t: any, host: any) => {
-        const size = getTextBound(
-          host.host,
-          props.hostPadding,
-          props.hostMargin,
-          `${props.hostFontSize}px normal ${props.fontFamily}`
-        );
-        t.width += size.width;
-        t.height = Math.max(t.height, size.height);
-        host.bound = size;
+    const hostsGroup = [];
+    const numGroup = 1;
+    for (let i = 0; i < step.hosts.length; i += numGroup) {
+      hostsGroup.push(step.hosts.slice(i, i + numGroup));
+    }
+    let top = 0;
+    const hostSizeGroup = hostsGroup.map((hosts) => {
+      let left = 0;
+      const hostSize = hosts.reduce(
+        (t: any, host: any) => {
+          const size = getTextBound(
+            host.host,
+            props.hostPadding,
+            props.hostMargin,
+            `${props.hostFontSize}px normal ${props.fontFamily}`
+          );
+          t.width += size.width;
+          t.height = Math.max(t.height, size.height);
+          host.bound = {
+            ...size,
+            left,
+            top,
+          };
+          left += size.width;
+          return t;
+        },
+        { width: 0, height: 0 }
+      );
+      top += hostSize.height;
+      return hostSize;
+    });
+
+    const hostSize = hostSizeGroup.reduceRight(
+      (t, hostSize) => {
+        t.width = Math.max(hostSize.width, t.width);
+        t.height += hostSize.height;
         return t;
       },
       { width: 0, height: 0 }
     );
-
     step.hostSize = hostSize;
     size.width = Math.max(
       size.width,
       hostSize.width + (props.padding[1] + props.margin[1]) * 2
     );
-    console.log(hostSize, size);
     size.height += hostSize.height;
   }
 

+ 3 - 7
src/view/step-tree/step.vue

@@ -101,20 +101,16 @@ const textAttrib = computed(() => ({
 }));
 
 const hostBounds = computed(() => {
-  console.log(
-    rectBound.value.width - props.padding[1] * 2 - props.step.raw.hostSize.width
-  );
   let left =
     rectBound.value.x +
     props.padding[1] +
     (rectBound.value.width - props.padding[1] * 2 - props.step.raw.hostSize.width) / 2;
-  let bottom = rectBound.value.y + rectBound.value.height;
+  let top = rectBound.value.y + rectBound.value.height - props.step.raw.hostSize.height;
 
   const hosts = props.step.raw.hosts;
   return hosts.map((host: any) => {
-    const x = left + props.hostMargin[1];
-    const y = bottom - host.bound.height + props.hostMargin[0];
-    left += host.bound.width;
+    const x = left + host.bound.left + props.hostMargin[1];
+    const y = top + props.hostMargin[0] + host.bound.top;
     return {
       x,
       y,