From 9197799574b4e1cb918771f424b93c11c7da8317 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Fri, 23 Jan 2026 17:08:34 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 uniapps/work-wx/src/subPackages/flightApplication/index.vue |   87 ++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 77 insertions(+), 10 deletions(-)

diff --git a/uniapps/work-wx/src/subPackages/flightApplication/index.vue b/uniapps/work-wx/src/subPackages/flightApplication/index.vue
index ec9cbf8..5c9f930 100644
--- a/uniapps/work-wx/src/subPackages/flightApplication/index.vue
+++ b/uniapps/work-wx/src/subPackages/flightApplication/index.vue
@@ -25,10 +25,12 @@
                             <u-image :src="spSvg" class="icon" width="16" height="16"></u-image>
                             <view class="name">{{approvalRecord.flightPlanName}}</view>
                         </view>
-                        <view class="status">{{approvalRecord.planApprovalStatus || ''}}</view>
+                        <view class="status" :class="getStatusClass(approvalRecord.planApprovalStatus)">
+                            {{ approvalRecord.planApprovalStatusLabel || ''}}
+                        </view>
                     </view>
-                    <view class="txt">飞行器:{{approvalRecord.device || ''}}</view>
-                    <view class="txt">飞行任务:{{approvalRecord.flightTaskType || ''}}</view>
+                    <view class="txt">飞行器:{{approvalRecord.spacecraftLabel || '无'}}</view>
+                    <view class="txt">飞行任务:{{approvalRecord.flightTaskTypeLabel || ''}}</view>
                     <view class="txt">飞行起飞时间:{{approvalRecord.actualTakeoffTime || ''}}</view>
                     <view class="txt">飞行降落时间:{{approvalRecord.actualLandingTime || ''}}</view>
                 </view>
@@ -42,7 +44,12 @@
     import { flightPlanPageInfoApi } from '@/api/index.js'
     import fxsqSvg from '@/static/images/fly-apply.png'
     import mysbSvg from '@/static/images/my-sb.png'
-import { ref } from 'vue'
+    import { ref } from 'vue'
+    import { aircraftInfoPageInfoOfMyApi } from '@/api/index'
+
+    // 获取store中的数据 字典
+    import { useAppStore, useUserStore } from "@/store";
+    const appStore = useAppStore()
 
 
 function gridClick(index) {
@@ -58,6 +65,40 @@
     }
 }
 
+const getStatusClass = (status) => {
+    switch (status) {
+        case '0':
+            return 'Sorange'
+        case '99':
+            return 'Sgreen'
+        case '-1':
+            return 'Sred'
+        case '1':
+            return 'Sblue'
+        default:
+            return ''
+    }
+}
+
+// 获取飞行器信息
+const aircraftInfoList = ref([])
+async function getAircraftInfo() {
+    try {
+        const res = await aircraftInfoPageInfoOfMyApi({
+            current: 1,
+            size: 1000,
+        })
+        aircraftInfoList.value = res.data.data.records.map(item => ({
+            label: item.name,
+            value: item.id,
+        }))
+    } catch (error) {
+        console.error('获取飞行器信息失败:', error)
+    }
+}
+
+
+
 // 审批记录是很多条
 const approvalRecords = ref([])
 const formParams = ref({
@@ -70,6 +111,12 @@
     try {
         const res = await flightPlanPageInfoApi(formParams.value)
         const newData = res.data.data.records || []
+        // 处理字典数据
+        newData.forEach(item => {
+            item.spacecraftLabel = aircraftInfoList.value.find(info => info.value === item.spacecraftId)?.label || '无'
+            item.planApprovalStatusLabel = appStore.flyActivityStatus.find(status => status.dictValue === item.planApprovalStatus)?.dictLabel || '无'
+            item.flightTaskTypeLabel = appStore.taskType.find(type => type.dictValue === item.flightTaskType)?.dictLabel || '无'
+        })
         // 如果是第一页,直接替换数据;否则追加数据
         if (formParams.value.current === 1) {
             approvalRecords.value = newData
@@ -106,7 +153,10 @@
         url: '/subPackages/flightApplication/details?id=' + item.id,
     })
 }
-onMounted(() => {
+
+
+onMounted(async () => {
+    await getAircraftInfo()
     getApprovalRecords()
 })
 </script>
@@ -192,12 +242,11 @@
     }
     .name-status {
         display: flex;
-        justify-content: space-between;
-        align-items: center;
+        // justify-content: space-between;
         margin-bottom: 20rpx;
         .name-image {
+            width: calc(100% - 120rpx);
             display: flex;
-            justify-content: center;
             align-items: center;
             .u-image {
                 width: 32rpx;
@@ -208,18 +257,36 @@
                 font-size: 32rpx;
                 color: #1D2129;
                 margin-left: 6rpx;
+                overflow: hidden;
+                text-overflow: ellipsis;
+                white-space: nowrap;
             }
         }
         .status {
             width: 100rpx;
             text-align: center;
-            line-height: 40rpx;
-            background: #FF9604;
+            line-height: 44rpx;
+            height: 44rpx;
             border-radius: 2px 2px 2px 2px;
             font-weight: 500;
             font-size: 24rpx;
             color: #FFFFFF;
+            padding: 0 6rpx;
+
+            &.Sorange {
+                background: #FF9604;
+            }
+            &.Sred {
+                background: #F8422A;
+            }
+            &.Sgreen {
+                background: #17A836;
+            }
+            &.Sblue {
+                background: #1D6FE9;
+            }
         }
+
     }
     .txt {
         font-weight: 400;

--
Gitblit v1.9.3