bill hace 8 meses
padre
commit
bf5c966ce2

+ 1 - 1
package.json

@@ -19,7 +19,7 @@
     "simaqcore": "^1.2.0",
     "swiper": "^11.1.15",
     "vite-plugin-mkcert": "^1.10.1",
-    "vue": "^3.2.37",
+    "vue": "3.2.47",
     "vue-cropper": "1.0.2",
     "vue-router": "^4.1.3",
     "vuedraggable": "^4.1.0"

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 918 - 1056
pnpm-lock.yaml


+ 1 - 1
src/api/scene.ts

@@ -25,7 +25,7 @@ export const SceneTypeDesc: Record<SceneType, string>  = {
   [SceneType.SWKK]: '八目',
   [SceneType.SWKJ]: '双目转台',
   [SceneType.SWSS]: '激光转台点云场景',
-  [SceneType.SWMX]: '三维模型',
+  [SceneType.SWMX]: '媒体库',
   [SceneType.SWSSMX]: '激光转台Mesh场景',
   [SceneType.SWYDSS]: '激光移动点云场景',
   [SceneType.SWYDMX]: '激光移动Mesh场景',

+ 3 - 3
src/api/tagging-position.ts

@@ -18,7 +18,7 @@ interface ServicePosition {
   "tagPoint": string,
   normal: string
   
-  globalVisibility: number
+  show3dTitle: number
   type: string,
   mat: string
   fontSize: number,
@@ -54,7 +54,7 @@ const serviceToLocal = (position: ServicePosition, taggingId?: Tagging['id']): T
   taggingId: taggingId || position.tagId.toString(),
   localPos: JSON.parse(position.tagPoint),
   type: (position.type || TaggingPositionType['2d']) as TaggingPositionType,
-  globalVisibility: Boolean(position.globalVisibility),
+  globalVisibility: Boolean(position.show3dTitle),
   normal: position.normal ? JSON.parse(position.normal) : { x: 0, y: 0, z: 1 },
   mat: position.mat ? JSON.parse(position.mat) : {
     scale: 1,
@@ -70,7 +70,7 @@ const localToService = (position: TaggingPosition, update = false): PartialProps
   "tagId": Number(position.taggingId),
   "fusionNumId": Number(position.modelId),
   "tagPoint": JSON.stringify(position.localPos),
-  globalVisibility: Number(position.globalVisibility),
+  show3dTitle: Number(position.globalVisibility),
   type: position.type,
   mat: position.mat && JSON.stringify(position.mat),
   normal: JSON.stringify(position.normal),

+ 4 - 1
src/api/tagging.ts

@@ -25,7 +25,7 @@ interface ServerTagging {
 
   show3dTitle: number
   audio: string
-
+  fileName: string
 }
 
 export interface Tagging {
@@ -39,6 +39,7 @@ export interface Tagging {
   principal: string
   images: string[],
   audio: string
+  audioName: string
 }
 
 export type Taggings = Tagging[]
@@ -51,6 +52,7 @@ const serviceToLocal = (serviceTagging: ServerTagging): Tagging => ({
   desc: serviceTagging.tagDescribe,
   part: serviceTagging.leaveBehind,
   // show3dTitle: true, 
+  audioName: serviceTagging.fileName,
   show3dTitle: Boolean(serviceTagging.show3dTitle),
   method: serviceTagging.getMethod,
   principal: serviceTagging.getUser,
@@ -64,6 +66,7 @@ const localToService = (tagging: Tagging, update = false): PartialProps<ServerTa
   "getMethod": tagging.method,
   show3dTitle: Number(tagging.show3dTitle),
   "getUser": tagging.principal,
+  fileName: tagging.audioName,
   "hotIconUrl": "static/img_default/lQLPDhrvVzvNvTswMLAOU-UNqYnnZQG1YPJUwLwA_48_48.png",
   "tagId": update ? Number(tagging.id) : undefined,
   "tagImgUrl": JSON.stringify(tagging.images),

+ 10 - 10
src/app.vue

@@ -1,5 +1,15 @@
 <template>
   <ConfigProvider v-bind="config">
+    <template v-for="needMount in needMounts">
+      <Teleport :to="needMount[0]">
+        <component
+          :is="needMount[1]"
+          v-bind="needMount[2]"
+          :ref="(v: any) => needMount[3] && needMount[3](v)"
+        />
+      </Teleport>
+    </template>
+
     <ui-editor-layout
       @click.stop
       id="layout-app"
@@ -17,16 +27,6 @@
     </ui-editor-layout>
 
     <PwdModel v-if="inputPwd" @close="inputPwd = false" />
-
-    <template v-for="needMount in needMounts">
-      <Teleport :to="needMount[0]">
-        <component
-          :is="needMount[1]"
-          v-bind="needMount[2]"
-          :ref="(v: any) => needMount[3] && needMount[3](v)"
-        />
-      </Teleport>
-    </template>
   </ConfigProvider>
 </template>
 

+ 1 - 1
src/components/materials/index.vue

@@ -122,7 +122,7 @@ const params = reactive({
 const origin = ref<PagingResult<Material[]>>({
   list: [],
   pageNum: 1,
-  pageSize: 12,
+  pageSize: 10,
   total: 0,
 });
 const groups = ref<MaterialGroup[]>([]);

+ 1 - 1
src/layout/edit/scene-select.vue

@@ -199,7 +199,7 @@ watch(visible, (visible, oldvisible) => {
 const selectModel = async () => {
   const list = await selectMaterials({
     uploadFormat: ["zip"],
-    format: ["obj", "ply", "las", "laz", "b3dm", "shp"],
+    format: ["obj", "ply", "las", "laz", "b3dm", "shp", "osgb"],
     maxSize: 2 * 1024 * 1024 * 1024,
   });
   if (!list?.length) return;

+ 4 - 1
src/store/path.ts

@@ -64,7 +64,10 @@ export const backupPaths = () => {
   bcPaths = JSON.parse(JSON.stringify(paths.value))
 }
 
-export const initialPaths = fetchStoreItems(paths, fetchPaths, backupPaths)
+export const initialPaths = fetchStoreItems(paths, async () => {
+  const paths = await fetchPaths()
+  return paths.filter(getPathIsShow)
+}, backupPaths)
 export const recoverPaths = async () => {
   const backupItems = bcPaths;
   paths.value.length = 0

+ 1 - 0
src/store/tagging.ts

@@ -56,6 +56,7 @@ export const createTagging = (tagging: Partial<Tagging> = {}): Tagging => {
     part: '',
     method: '',
     show3dTitle: false,
+    audioName: '',
     principal: '',
     audio: '',
     images: [],

+ 1 - 1
src/views/guide/guide/sign.vue

@@ -45,7 +45,7 @@ const emit = defineEmits<{
 
 const menus = [
   { label: "编辑", value: "edit" },
-  { label: "下载", value: "download" },
+  // { label: "下载", value: "download" },
   { label: "删除", value: "delete" },
 ];
 const actions = {

+ 1 - 1
src/views/guide/path/edit-path.vue

@@ -19,7 +19,7 @@
               placeholder="路径名称"
               @keydown="keydownHandler"
               v-model="data.name"
-              :maxlength="60"
+              :maxlength="100"
             />
           </ui-group-option>
           <ui-group-option class="item">

+ 14 - 12
src/views/tagging-position/index.vue

@@ -65,6 +65,19 @@ const showId = ref<TaggingPosition["id"]>();
 const tagging = computed(() => getTagging(router.currentRoute.value.params.id as string));
 const positions = computed(() => tagging.value && getTaggingPositions(tagging.value));
 
+onUnmounted(() => unKeepAdding.value && unKeepAdding.value());
+
+useViewStack(autoSaveTaggings);
+useViewStack(() => {
+  taggingsGroup.changeCanMove(true);
+  taggingsGroup.showDelete(true);
+  enterEdit(() => router.back());
+  return () => {
+    taggingsGroup.changeCanMove(false);
+    taggingsGroup.showDelete(false);
+  };
+});
+
 watch(showId, (id) => {
   const position = positions.value?.find((item) => item.id === id);
   position && flyTaggingPosition(position);
@@ -142,18 +155,7 @@ const keepAdding = () => {
     unKeepAdding.value = void 0;
   };
 };
-onUnmounted(() => unKeepAdding.value && unKeepAdding.value());
-
-useViewStack(autoSaveTaggings);
-useViewStack(() => {
-  taggingsGroup.changeCanMove(true);
-  taggingsGroup.showDelete(true);
-  enterEdit(() => router.back());
-  return () => {
-    taggingsGroup.changeCanMove(false);
-    taggingsGroup.showDelete(false);
-  };
-});
+keepAdding();
 </script>
 
 <style lang="scss" scoped>

+ 3 - 2
src/views/tagging-position/sign.vue

@@ -32,11 +32,12 @@
         class="item"
         @apply-global="$emit('applyGlobal', ['mat', 'scale'])"
       >
-        <Slider v-model:value="position.mat.scale" :min="0.1" :max="10" :step="0.1" />
+        <Slider v-model:value="position.mat.scale" :min="0.5" :max="5" :step="0.1" />
       </SignItem>
       <SignItem
         label="图标角度"
         class="item"
+        v-if="TaggingPositionType['2d'] !== position.type"
         @apply-global="$emit('applyGlobal', ['mat', 'rotation'])"
       >
         <Slider v-model:value="position.mat.rotation" :min="0" :max="360" :step="0.1" />
@@ -53,7 +54,7 @@
         class="item"
         @apply-global="$emit('applyGlobal', 'lineHeight')"
       >
-        <Slider v-model:value="position.lineHeight" :min="0" :max="10" :step="0.1" />
+        <Slider v-model:value="position.lineHeight" :min="0.5" :max="5" :step="0.1" />
       </SignItem>
       <SignItem
         label="可见范围"

+ 7 - 3
src/views/tagging/edit.vue

@@ -99,7 +99,7 @@
             </p>
             <p v-else class="rep-val">
               <span>
-                {{ getFileName(tagging.audio) }}
+                {{ tagging.audioName }}
               </span>
               <ui-icon class="icon" @click.stop="tagging.audio = ''" type="del" ctrl />
             </p>
@@ -123,7 +123,7 @@
           height="225px"
           preview
           placeholder="上传图片/视频"
-          othPlaceholder="支持JPG、PNG、MP4、MOV等格式,单个不超过100MB,最多支持上传10张。"
+          othPlaceholder="支持JPG、PNG、MP4等格式,单个不超过100MB,最多支持上传10张。"
           :accept="imageFormat.map((u) => `.${u}`).join(',')"
           :disable="true"
           :multiple="true"
@@ -178,7 +178,7 @@ export type EditProps = {
 
 const imageSize = 100 * 1024 * 1024;
 const imageCount = 10;
-const imageFormat = ["jpg", "png", "mp4", "mov"];
+const imageFormat = ["jpg", "png", "mp4"];
 const audioSize = 30 * 1024 * 1024;
 const audioCount = 1;
 const audioFormat = ["mp3", "wav"];
@@ -265,6 +265,9 @@ const audioChange = (file: LocalImageFile) => {
           blob: file.file,
           url: file.preview,
         };
+  if (!(typeof file === "string" || "blob" in file)) {
+    tagging.value.audioName = file.file.name;
+  }
   tagging.value.audio = data;
 };
 
@@ -299,6 +302,7 @@ const musicSelect = async () => {
   });
   if (list?.length) {
     audioChange(list[0].url);
+    tagging.value.audioName = list[0].name;
   }
 };
 const imageSelect = async () => {

+ 6 - 3
src/views/tagging/images.vue

@@ -14,7 +14,7 @@
           :class="{ full: inFull }"
           @click="inFull && $emit('pull', index)"
         >
-          <ResourceView :data="getFileUrl(raw)" />
+          <ResourceView :data="getFileUrl(raw)" class="p-item" />
           <!-- <img :src="getResource(getFileUrl(raw))" /> -->
         </div>
       </template>
@@ -51,14 +51,17 @@ const index = ref(0);
 <style lang="scss" scoped>
 .mates {
   width: 100%;
-  height: 100%;
-  max-height: 100%;
+  height: 250px;
   overflow-y: auto;
 
   .meta-item {
     width: 100%;
     height: 100%;
 
+    .p-item {
+      height: 100%;
+    }
+
     &.full {
       cursor: zoom-in;
     }