Преглед изворни кода

Merge branch 'v1.9.0-position' of http://192.168.0.115:3000/bill/fuse-code into v1.9.0-position

xzw пре 1 недеља
родитељ
комит
c414f27096

+ 8 - 1
src/api/position.ts

@@ -47,5 +47,12 @@ interface DeviceData {
     return positions
   }
   export const saveDevice = async (data: any) => {
-    return axios.post<undefined>(SAVE_DEVICE, { data })
+    console.log(data, 88888)
+    let item = {
+      caseId: params.caseId,
+      macId: data.macId,
+      deviceName: data.deviceName,
+      characterModelId: data.characterModel.id,
+    }
+    return axios.post<undefined>(SAVE_DEVICE, item)
   }

+ 1 - 1
src/components/menu/menu-item.vue

@@ -12,7 +12,7 @@
       @click="emit('select', raw)"
     >
       <slot name="attach" :raw="raw" :active="activePaths.includes(raw.name)" />
-
+      <span>{{ raw.icon }}</span>
       <menu-child-item 
         v-bind="getItemProps()" 
         @enter="enterHandler" 

+ 1 - 1
src/layout/left-pano.vue

@@ -24,7 +24,7 @@ import { useRoute } from 'vue-router';
 import { computed, withDefaults, defineProps } from "vue";
 const route = useRoute();
 const isShow = computed(() => {
-  return ['/show/summary', '/fuseEdit/path','/fuseEdit/animation'].includes(route.path);
+  return ['/show/summary', '/fuseEdit/positioning', '/fuseEdit/path','/fuseEdit/animation'].includes(route.path);
 });
 console.log(route, 777777)
 withDefaults(defineProps<{ show?: boolean }>(), { show: false });

+ 1 - 1
src/router/constant.ts

@@ -95,7 +95,7 @@ export const metas = {
   //   sysTitle: "多元融合",
   // },
   [RoutesName.positioning]: {
-    icon: "positioning",
+    icon: "guide_p",
     title: "定位",
     sysTitle: "多元融合",
   },

+ 13 - 22
src/store/position.ts

@@ -16,28 +16,18 @@ export const positionList = ref<any>([])
 
 export const initialPositionList = async () => {
     positionList.value = await fetchPositionList() as Position[]
-    // positionList.value = [{
-    //     id: 1,
-    //     macId: '1234567890',
-    //     deviceName: '设备1',
-    //     modelName: '模型1',
-    //     createTime: '2021-01-01',
-    //     updateTime: '2021-01-01',
-    //     locationList: [],
-    //     characterModelList: [{
-    //         id: 12,
-    //         value: 0,
-    //         label: '女',
-    //         useDevice: 0,
-    //         name: '女',
-    //         fileUrl: 'https://www.baidu.com',
-    //     }],
-    //     characterModel:{
-    //         id: 11,
-    //         fileUrl: 'https://www.baidu.com',
-    //         useDevice: '0',
-    //     }
-    // }]
+    positionList.value.forEach((item: any) => {
+        item.characterModel = {
+            id: item.characterModel?.id
+        }
+        item.characterModelList = item.characterModelList.map((it: any) => {
+            return {
+                ...it,
+                value: it.id,
+                label: it.name
+            }
+        })
+    })
 }
 
 let bcPosition: Position[] = []
@@ -47,6 +37,7 @@ export const backupPosition = () => {
 }
 export const recoverPosition = recoverStoreItems(positionList, getBackupPosition)
 export const updatePosition = updateStoreItem(positionList, saveDevice)
+console.log(updatePosition, 88888)
 export const savePositions = saveStoreItems(
   positionList,
   getBackupPosition,

+ 9 - 3
src/views/positioning/components/mediaList.vue

@@ -18,18 +18,21 @@
             </div>
             <ui-input
                 v-model="currentPosition.deviceName"
+                type="text"
                 height="40px"
+                style="width: 298px"
             />
           </ui-group-option>
           <ui-group-option>
             <div class="model-name-input">
-                任务模型
+                人物模型
             </div>
             <ui-input
-                v-model="currentPosition.modelName"
+                v-model="currentPosition.characterModel.id"
                 type="select"
                 :options="currentPosition.characterModelList"
                 height="40px"
+                style="width: 298px;"
             />
           </ui-group-option>
          </ui-group>
@@ -53,13 +56,16 @@ watchEffect(() => emit("update:current", currentPosition.value));
 const leaveEdit = () => (currentPosition.value = null);
 const edit = (position: Position) => {
   currentPosition.value = position;
+  console.log(currentPosition.value, 9999);
   enterEdit();
   sysBus.on("leave", leaveEdit);
 };
 
 useViewStack(autoSavePositions);
 
-defineExpose({});
+defineExpose({
+  
+});
 </script>
 
 <style lang="scss" scoped>

+ 2 - 2
src/views/positioning/components/sign.vue

@@ -3,13 +3,13 @@
       <div class="info">
         <div class="position-cover">
           <img src="@/assets/equipment_e.svg" />
-          <!-- <ui-icon
+          <ui-icon
             type="preview"
             class="icon"
             ctrl
             @click="flyPlayGuide(position)"
             v-if="positionList.length"
-          /> -->
+          />
         </div>
         <div>
           <p>{{ position.deviceName }}</p>

+ 10 - 7
src/views/positioning/index.vue

@@ -7,8 +7,8 @@
             <span v-if="!isRecord"></span>
             <span v-else class="timer-display">{{ formatTime(recordingTime) }}</span>
             <span class="tabs-right-img">
-                <img v-if="!isRecord" src="@/assets/record_n.svg" alt="" @click="startRecord('start')">
-                <img v-else src="@/assets/record_s.svg" alt="" @click="startRecord('stop')">
+                <img v-show="!isRecord" src="@/assets/record_n.svg" alt="" @click="startRecord('start')">
+                <img v-show="isRecord" src="@/assets/record_s.svg" alt="" @click="startRecord('stop')">
             </span>
         </div>
       </div>
@@ -21,7 +21,8 @@
 import { RightFillPano } from "@/layout";
 import mediaList from "./components/mediaList.vue";
 import { nextTick, reactive, ref, watchEffect, onUnmounted } from "vue";
-import { guides, isEdit, paths, enterEdit } from "@/store";
+import { enterOld, enterEdit } from "@/store";
+import { loadPack } from '@/utils'
 
 const isRecord = ref(false);
 const startTime = ref<number>(0);
@@ -53,7 +54,7 @@ const startRecord = (type: string) => {
         timer = setInterval(() => {
             recordingTime.value = Math.floor((Date.now() - startTime.value) / 1000);
         }, 1000);
-        
+        let isSave = false;
     } else {
         // 停止录制
         isRecord.value = false;
@@ -69,10 +70,12 @@ const startRecord = (type: string) => {
         recordingTime.value = 0;
         
         console.log('录制时间段:', {
-            startTime: new Date(startTime.value),
-            endTime: new Date(endTime.value),
+            startTime: startTime.value,
+            endTime: endTime.value,
             duration: endTime.value - startTime.value
         });
+        // 这里调path接口传路线数据过去
+        // enterOld(async () => {})
     }
 };
 
@@ -107,7 +110,7 @@ onUnmounted(() => {
     .timer-display {
       font-family: 'Courier New', monospace;
       font-weight: bold;
-      color: #ff4444;
+      color: #FFFFFF;
       font-size: 14px;
       min-width: 65px;
       text-align: center;