bill пре 3 година
родитељ
комит
84b7a58bda

+ 5 - 5
src/api/constant.ts

@@ -37,10 +37,10 @@ export const DELETE_TAGGING_POINT = `/laser/caseTagPoint/${params.m}/delete`
 export const TAGGING_STYLE_LIST = ''
 
 // 路径
-export const GUIDE_LIST = ''
-export const INSERT_GUIDE = ''
-export const UPDATE_GUIDE = ''
-export const DELETE_GUIDE = ''
+export const GUIDE_LIST = `/laser/fusionGuide/${params.m}/list/${params.fushId}`
+export const INSERT_GUIDE = `/laser/fusionGuide/${params.m}/add`
+export const UPDATE_GUIDE = `/laser/fusionGuide/${params.m}/edit`
+export const DELETE_GUIDE = `/laser/fusionGuide/${params.m}/delete`
 
 // 文件上传
-export const UPLOAD_FILE = ''
+export const UPLOAD_FILE = `/laser/oss/${params.m}/fuse-code/upload/fire`

Разлика између датотеке није приказан због своје велике величине
+ 3 - 5
src/api/guide.ts


+ 9 - 2
src/api/sys.ts

@@ -1,5 +1,6 @@
-import { UPLOAD_FILE } from './constant'
+import { UPLOAD_FILE, UPLOAD_HEADS } from './constant'
 import { axios } from './instance'
+import { jsonToForm } from '@/utils'
 
 type UploadFile = LocalFile | string
 
@@ -7,6 +8,12 @@ export const uploadFile = async (file: UploadFile) => {
   if (typeof file === 'string') {
     return file
   } else {
-    return file.url
+    const url = await axios<string>({
+      method: 'POST',
+      url: UPLOAD_FILE, 
+      data: jsonToForm({ file: file.blob }),
+      headers: {...UPLOAD_HEADS}
+    })
+    return url
   }
 }

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

@@ -13,7 +13,7 @@ interface ServicePosition {
   "id": number,
   "tagId": number,
   "modelId": number
-  "tagPoint": SceneLocalPos,
+  "tagPoint": string,
 }
 
 export interface TaggingPosition {
@@ -30,14 +30,14 @@ const serviceToLocal = (position: ServicePosition, taggingId?: Tagging['id']): T
   id: position.id.toString(),
   modelId: position.modelId.toString(),
   taggingId: taggingId || position.tagId.toString(),
-  localPos: position.tagPoint
+  localPos: JSON.parse(position.tagPoint)
 })
 
 const localToService = (position: TaggingPosition, update = false): PartialProps<ServicePosition, 'id'> => ({
   "id": update ? Number(position.id) : undefined,
   "tagId": Number(position.taggingId),
   "modelId": Number(position.modelId),
-  "tagPoint": position.localPos,
+  "tagPoint": JSON.stringify(position.localPos),
 })
 
 

+ 4 - 0
src/components/bill-ui/assets/scss/_base.scss

@@ -286,6 +286,10 @@ progress {
 :disabled{
     opacity: 0.3 !important;
     pointer-events: none !important;
+
+    * {
+        pointer-events: none !important;
+    }
 }
 
 

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

@@ -21,6 +21,7 @@
 
 <script lang="ts">
 import { ref, watchEffect, defineComponent, PropType } from 'vue'
+import { getResource } from '@/env'
 
 export enum MediaType {
   video,
@@ -48,7 +49,7 @@ export const Preview =  defineComponent({
     watchEffect(() => {
       const data = props.url
       const url = typeof data === 'string'
-        ? data
+        ? getResource(data)
         : URL.createObjectURL(data)
 
       staticURL.value = url

+ 5 - 2
src/layout/model-list/index.vue

@@ -4,7 +4,6 @@
       title="数据列表" 
       key="id" 
       :data="modelList" 
-      @change-select="item => modelChangeSelect(item.raw)"
     >
       <template #action>
         <ui-input
@@ -23,7 +22,11 @@
       </ui-input>
       </template>
       <template #atom="{ item }">
-        <ModelSign :model="item.raw" @delete="modelDelete(item.raw)" />
+        <ModelSign 
+          :model="item.raw" 
+          @delete="modelDelete(item.raw)" 
+          @click="modelChangeSelect(item.raw)"
+        />
       </template>
     </List>
   </LeftPano>

+ 3 - 2
src/layout/model-list/sign.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="model-header">
+  <div class="model-header" :class="{disabled: model.error}" @click="$emit('click')">
     <p>{{ model.title }}</p>
     <div class="model-action" @click.stop>
       <ui-input type="checkbox" v-model="show" />
@@ -11,7 +11,7 @@
       />
     </div>
   </div>
-  <div class="model-desc">
+  <div class="model-desc" @click="$emit('click')">
     <p><span>数据来源:</span>{{ ModelTypeDesc[model.type] }}</p>
     <p><span>数据大小:</span>{{ model.size }}</p>
     <p><span>拍摄时间:</span>{{ model.time }}</p>
@@ -30,6 +30,7 @@ const props = defineProps<ModelProps>()
 type ModelEmits = {
   (e: 'changeSelect', selected: boolean): void
   (e: 'delete'): void
+  (e: 'click'): void
 }
 defineEmits<ModelEmits>();
 

+ 11 - 2
src/sdk/association.ts

@@ -6,7 +6,9 @@ import {
   mount, 
   diffArrayChange, 
   shallowWatchArray, 
-  arrayChildEffectScope 
+  arrayChildEffectScope,
+  showLoad,
+  hideLoad
 } from '@/utils'
 
 import TaggingComponent from '@/components/tagging/list.vue'
@@ -43,10 +45,17 @@ const associationModels = (sdk: SDK) => {
           custom.currentModel = item
         }
       })
-      sceneModel.bus.on('loadDone', () => item.loaded = true)
+      showLoad()
+      sceneModel.bus.on('loadDone', () => {
+        item.loaded = true
+        hideLoad()
+      })
       sceneModel.bus.on('loadError', () => {
         console.error(item, '加载失败')
         item.error = true
+        item.show = false
+        custom.showModelsMap.delete(item)
+        hideLoad()
       })
       sceneModel.bus.on('loadProgress', progress => item.progress = progress)
     }

+ 3 - 1
src/store/model.ts

@@ -40,9 +40,11 @@ export const getModelShowVariable = (model: Model) =>
   
 export const modelsLoaded = ref(false)
 watchPostEffect(() => {
-  modelsLoaded.value = models.value.every(model => model.loaded || model.error)
+  const loaded = models.value.every(model => model.loaded || model.error)
+  modelsLoaded.value = loaded
 })
 
+
 let bcModels: Models = []
 export const getBackupModels = () => bcModels
 export const backupModels = () => {

+ 9 - 0
src/utils/index.ts

@@ -45,6 +45,15 @@ export const getFileUrl = (file: LocalFile | string) =>
 
 export const asyncTimeout = (mis: number = 0) => new Promise(resolve => setTimeout(resolve, mis))
 
+
+export const jsonToForm = (data: { [key in string]: any }) => {
+  const formData = new FormData()
+  for (const [key, val] of Object.entries(data)) {
+    formData.append(key, val)
+  }
+  return formData
+}
+
 export * from './store-help'
 export * from "./stack";
 export * from "./loading";

+ 1 - 0
src/utils/store-help.ts

@@ -68,6 +68,7 @@ export function updateStoreItem <T extends {id: any}, K extends {id: any} = T>(
     } else {
       actionData = item as unknown as K
     }
+    console.error(actionData, oldItem)
     await updateAction(actionData, oldItem)
     const storeItem = items.value.find(atom => atom.id === item.id)
     if (storeItem) {

+ 2 - 1
src/views/tagging/images.vue

@@ -14,7 +14,7 @@
           :class="{ full: inFull }" 
           @click="inFull && $emit('pull', index)"
         >
-          <img :src="getFileUrl(raw)" />
+          <img :src="getResource(getFileUrl(raw))" />
         </div>
       </template>
       <template v-slot:attach="{ active }">
@@ -30,6 +30,7 @@
 import { ref } from 'vue'
 import { getFileUrl } from '@/utils'
 import { Tagging } from '@/store'
+import { getResource } from '@/env'
 
 export type ImagesProps = {
   tagging: Tagging

+ 0 - 3
vite.config.ts

@@ -24,9 +24,6 @@ export default defineConfig({
     host: '0.0.0.0',
     port: 5173,
     open: true,
-    watch: {
-      usePolling: true
-    },
     proxy: {
       '/api': {
         target: 'http://192.168.0.152:8088/',