bill 8 mesiacov pred
rodič
commit
dd79d23ae5

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

@@ -18,7 +18,7 @@ interface ServicePosition {
   "tagPoint": string,
   normal: string
   
-  globalVisibility: boolean
+  globalVisibility: 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: position.globalVisibility,
+  globalVisibility: Boolean(position.globalVisibility),
   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: position.globalVisibility,
+  globalVisibility: Number(position.globalVisibility),
   type: position.type,
   mat: position.mat && JSON.stringify(position.mat),
   normal: JSON.stringify(position.normal),

+ 1 - 1
src/api/tagging-style.ts

@@ -100,7 +100,7 @@ export const postAddTaggingStyle = async (props: {
     url: INSERT_TAGGING_STYLE,
     data: jsonToForm({
       file: new File([props.file], `${props.iconTitle}.png`),
-      iconTitle: props.iconTitle,
+      iconTitle: props.iconTitle.toString(),
       caseId: params.caseId,
     }),
   });

+ 4 - 4
src/api/tagging.ts

@@ -23,7 +23,7 @@ interface ServerTagging {
   "tagDescribe": string,
   "tagTitle": string,
 
-  show3dTitle: boolean
+  show3dTitle: number
   audio: string
 
 }
@@ -50,8 +50,8 @@ const serviceToLocal = (serviceTagging: ServerTagging): Tagging => ({
   title: serviceTagging.tagTitle,
   desc: serviceTagging.tagDescribe,
   part: serviceTagging.leaveBehind,
-  show3dTitle: true, 
-  // show3dTitle: serviceTagging.show3dTitle,
+  // show3dTitle: true, 
+  show3dTitle: Boolean(serviceTagging.show3dTitle),
   method: serviceTagging.getMethod,
   principal: serviceTagging.getUser,
   audio: serviceTagging.audio,
@@ -62,7 +62,7 @@ const localToService = (tagging: Tagging, update = false): PartialProps<ServerTa
   "hotIconId": Number(tagging.styleId),
   "fusionId": params.caseId,
   "getMethod": tagging.method,
-  show3dTitle: tagging.show3dTitle,
+  show3dTitle: Number(tagging.show3dTitle),
   "getUser": tagging.principal,
   "hotIconUrl": "static/img_default/lQLPDhrvVzvNvTswMLAOU-UNqYnnZQG1YPJUwLwA_48_48.png",
   "tagId": update ? Number(tagging.id) : undefined,

+ 1 - 1
src/sdk/sdk.ts

@@ -371,7 +371,7 @@ export const initialSDK = async (props: InialSDKProps) => {
     scenes: props.scenes,
     lonlat: props.lonlat,
     mapDom: null,
-  }) as unknown as SDK;
+  } as any) as unknown as SDK;
 
   (window as any).sdk = sdk = localSdk;
   sdk.layout = props.layout;

+ 1 - 2
src/utils/index.ts

@@ -66,9 +66,8 @@ export const getFileUrl = (file: LocalFile | string) =>
     ? file
     : file.url
 export const getFileName = (file: any): string => {
-
   return typeof file === 'string'
-    ? file.substring(file.indexOf('/') + 1)
+    ? file.substring(file.lastIndexOf('/') + 1)
     : file.blob instanceof File ? file.blob.name : getUrlType(file.url)
 }
 

+ 1 - 0
src/views/tagging-position/index.vue

@@ -126,6 +126,7 @@ const keepAdding = () => {
     if (!position) {
       Message.error("当前位置无法添加");
     } else {
+      console.error(tagging.value);
       const storePosition = createTaggingPosition({
         ...position,
         taggingId: tagging.value!.id,

+ 1 - 1
src/views/tagging/style-type-select.vue

@@ -2,7 +2,7 @@
   <!-- <Menu style="width: 256px" mode="vertical" :items="getItems()" @click="handleClick" /> -->
   <Dropdown placement="bottom" v-if="current">
     <span>
-      <span class="count" v-if="count">({{ current.count }})</span>
+      {{ current.title }}<span class="count" v-if="count">({{ current.count }})</span>
       <DownOutlined />
     </span>
     <template #overlay>

+ 5 - 0
vite.config.ts

@@ -27,6 +27,11 @@ const proxy = {
     changeOrigin: true,
     rewrite: path => path.replace(/^\/swkk/, '')
   },
+  '/oss': {
+    target: `${ip}/`,
+    changeOrigin: true,
+    rewrite: path => path.replace(/^\/oss/, '/oss')
+  },
   '/laser': {
     target: `${ip}/`,
     changeOrigin: true,