bill 7 meses atrás
pai
commit
c19034ae89

BIN
public/images/新对话-豆包@3x.png


BIN
public/images/路径@1x (2).png


+ 5 - 1
src/components/static-preview/index.vue

@@ -3,7 +3,7 @@
     <span class="close pc" @click="$emit('close')">
       <ui-icon type="close" ctrl />
     </span>
-    <div class="pull-preview pc">
+    <div class="pull-preview pc" :class="pclass">
       <ui-slide
         v-if="items.length > 1"
         :currentIndex="current"
@@ -33,6 +33,10 @@ export type MediaItem = {
 export const Preview = defineComponent({
   name: "static-preview",
   props: {
+    pclass: {
+      type: String,
+      required: false,
+    },
     items: {
       type: Array as PropType<MediaItem[]>,
       required: true,

+ 4 - 2
src/sdk/association/fuseMode.ts

@@ -115,7 +115,7 @@ const setModels = (sdk: SDK, models: FuseModels, oldModels: FuseModels) => {
         }
 
         if (deepIsRevise(update, transform)) {
-          
+          console.error('change', item)
           unSet(() => Object.assign(item, transform));
         }
       }, 16);
@@ -250,6 +250,7 @@ export const associationModels = (sdk: SDK) => {
             () => item.position,
             () => {
               if (!isUnSet) {
+                console.log('position', item.raw.modelTitle, toRaw(item.position))
                 getSceneModel(item)?.changePosition(item.position);
               }
             }
@@ -259,7 +260,8 @@ export const associationModels = (sdk: SDK) => {
             () => item.rotation,
             () => {
               if (!isUnSet) {
-                getSceneModel(item)?.changeRotation(item.rotation);
+                console.log('rotation', item.raw.modelTitle,  toRaw(item.rotation))
+                getSceneModel(item)?.changeRotation(toRaw(item.rotation));
               }
             }
             // { immediate: true }

+ 3 - 1
src/sdk/association/guide.ts

@@ -80,13 +80,14 @@ export const recovery = async (guide: Guide) => {
     );
 };
 
+
 export const playSceneGuide = (
   paths: GuidePath[],
   changeIndexCallback?: (index: number) => void,
   forceFull = false
 ) => {
   let sceneGuide: SceneGuide
-  playScene({
+  return playScene({
     create: () => {
       sceneGuide = sdk.enterSceneGuide(
         paths.map((path) => ({ ...path, ...analysisPoseInfo(path) }))
@@ -98,6 +99,7 @@ export const playSceneGuide = (
       return new Promise((resolve) => sceneGuide.bus.on("playComplete", resolve))
     },
     pause: () => {
+      console.error('pause??')
       sceneGuide.pause();
     },
     clear: () => {

+ 1 - 0
src/sdk/sdk.ts

@@ -188,6 +188,7 @@ export interface SDK {
   screenshot: (width: number, height: number) => Promise<string>;
   getPose: () => Pose;
   comeTo: (pos: CameraComeToProps) => void;
+  
   enterSceneGuide: (data: SceneGuidePath[]) => SceneGuide;
 
   drawMeasure<T extends StoreMeasure["type"]>(

+ 2 - 5
src/store/fuse-model.ts

@@ -107,11 +107,8 @@ watchPostEffect(() => {
 let bcModels: FuseModels = [];
 export const getBackupFuseModels = () => bcModels;
 export const backupFuseModels = () => {
-  bcModels = fuseModels.value.map((model) => ({
-    ...model,
-    rotation: { ...model.rotation },
-    position: { ...model.position },
-  }));
+  bcModels = JSON.parse(JSON.stringify(fuseModels.value))
+  console.log('bcModels', bcModels)
   for (const model of fuseModels.value) {
     initFuseModel(model);
   }

Diferenças do arquivo suprimidas por serem muito extensas
+ 463 - 0
src/views/security/data.ts


+ 104 - 10
src/views/security/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="full-security" v-if="data">
+  <div class="full-security" v-if="data && !isFull">
     <div class="btns">
       <span v-for="v in views" @click="active = v" class="fun-ctrl">
         {{ v.name }}
@@ -9,24 +9,54 @@
     <div class="view" v-if="active">
       <ui-icon type="close" ctrl class="close" @click="active = void 0" />
       <h2>{{ active.name }}</h2>
-      <component :is="active.view" />
+      <!-- <component :is="active.view" v-if="mdata" /> -->
+
+      <template v-if="mdata">
+        <div class="item" v-for="item in mdata.items">
+          <h3 class="title">{{ item.title }}</h3>
+          <div class="content">
+            <p v-for="c in item.content" :class="{ link: c.link, zk: kzs.includes(c) }">
+              {{ kzs.includes(c) ? c.zk : c.title }}
+              <Link :name="c.link" v-if="c.link" :fly-link="flyLink" />
+              <span
+                class="mspan fun-ctrl"
+                v-else-if="c.zk"
+                @click="
+                  kzs.includes(c) ? (kzs = kzs.filter((i) => i !== c)) : kzs.push(c)
+                "
+              >
+                {{ kzs.includes(c) ? "收起" : "更多" }}
+              </span>
+            </p>
+          </div>
+        </div>
+      </template>
     </div>
   </div>
 </template>
 
 <script setup lang="ts">
-import { reactive, ref } from "vue";
-import { data } from "./store";
-import Duty from "./duty.vue";
-import Job from "./job.vue";
-import Site from "./site.vue";
+import { computed, reactive, ref } from "vue";
+import { data, flyLink as flyLinkRaw } from "./store";
+import Link from "./link.vue";
+
+const isFull = ref(false);
+const flyLink = async (name: string) => {
+  isFull.value = true;
+  await flyLinkRaw(name);
+  isFull.value = false;
+};
 
+const kzs = ref<any[]>([]);
 const views = reactive([
-  { name: "职责要求", view: Job },
-  { name: "场所情况", view: Site },
-  { name: "勤务要求", view: Duty },
+  { name: "职责要求", view: "0" },
+  { name: "场所情况", view: "1" },
+  { name: "勤务要求", view: "2" },
 ]);
 const active = ref<typeof views[0]>();
+const mdata = computed(() => {
+  return active.value && data[Number(active.value?.view)];
+});
 </script>
 
 <style lang="scss" scoped>
@@ -85,4 +115,68 @@ const active = ref<typeof views[0]>();
     font-weight: bold;
   }
 }
+
+.c-item {
+  margin-top: 10px;
+
+  p {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+
+    img {
+      height: 15px;
+      cursor: pointer;
+    }
+  }
+}
+
+.item:not(:last-child) .content {
+  margin-bottom: 20px;
+  border-bottom: 1px solid #000;
+  padding-bottom: 20px;
+}
+
+.jb {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.item {
+  margin-top: 20px;
+
+  h3 {
+    font-size: 15px;
+    margin-bottom: 10px;
+  }
+
+  p {
+    font-size: 14px;
+    line-height: 1.89em;
+    color: #9e9e9e;
+
+    &.link {
+      color: #fff;
+      margin: 6px 0;
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+    }
+
+    span {
+      float: right;
+      cursor: pointer;
+    }
+
+    &.zk {
+      white-space: pre-line;
+      span {
+        float: none;
+        display: block;
+        text-align: center;
+      }
+    }
+  }
+}
 </style>

+ 33 - 3
src/views/security/link.vue

@@ -1,15 +1,45 @@
 <template>
-  <img :src="getLinkAttr(name)" v-if="getLinkAttr(name)" @click="flyLink(name)" />
+  <img :src="getLinkAttr(name)" v-if="getLinkAttr(name)" @click="cflyLink(name)" />
+
+  <Preview
+    :items="items"
+    :current="0"
+    v-if="items.length"
+    @close="items.length = 0"
+    pclass="link-pre"
+  />
 </template>
 
 <script setup lang="ts">
-import { flyLink, getLinkAttr } from "./store";
+import { ref } from "vue";
+import { getLinkAttr } from "./store";
+import { Preview, MediaItem } from "@/components/static-preview/index.vue";
 
-defineProps<{ name: string }>();
+const props = defineProps<{ name: string; flyLink: (name: string) => void }>();
+const items = ref<MediaItem[]>([]);
+const cflyLink = (name: string) => {
+  if (name.includes("://")) {
+    items.value.push({ url: name });
+  } else {
+    props.flyLink(name);
+  }
+};
 </script>
 
 <style scoped>
 img {
   cursor: pointer;
+  width: 12px;
+}
+</style>
+
+<style lang="scss">
+.pull-preview .preview-layer .pull-meta > div {
+  overflow-y: auto;
+  display: block;
+  img {
+    width: 100%;
+    max-height: none;
+  }
 }
 </style>

Diferenças do arquivo suprimidas por serem muito extensas
+ 109 - 139
src/views/security/store.ts