Parcourir la source

🐞 fix(ruido): 上传文件回显问题

Zimo il y a 1 mois
Parent
commit
b6dd36c317
1 fichiers modifiés avec 21 ajouts et 21 suppressions
  1. 21 21
      pages/ruiDu/compontents/report-form.vue

+ 21 - 21
pages/ruiDu/compontents/report-form.vue

@@ -1,12 +1,12 @@
 <script setup>
   import { useDataDictStore } from '@/store/modules/dataDict';
-  import { onMounted, reactive, ref, computed, getCurrentInstance, watch } from 'vue';
+import { onMounted, reactive, ref, computed, getCurrentInstance, watch } from 'vue';
 
   import tpfTimeRange from '@/components/tpf-time-range/tpf-time-range.vue';
-  import deviceTransfer from '@/components/device-transfer/index.vue';
+import deviceTransfer from '@/components/device-transfer/index.vue';
 
   import { updateRuiDuReportBatch, getRuiDuReportAttrs } from '@/api/ruiDu.js';
-  import config from '@/utils/config';
+import config from '@/utils/config';
 
   import { getTenantId, getAccessToken } from '@/utils/auth.js';
 
@@ -180,6 +180,8 @@
       responseData.push(data);
     });
 
+    console.log('responseData :>> ', responseData);
+
     // 提交表单
     updateRuiDuReportBatch(responseData).then(res => {
       // 提交成功
@@ -232,11 +234,13 @@
 
     console.log('props.reportData :>> ', props.reportData);
 
-    if (props.formDisable) {
-      form.platformIds = props.reportData.platforms?.map(v => v.reportId) ?? [];
-    } else {
-      form.platformIds = [props.reportData.id];
-    }
+    form.platformIds = props.reportData.platforms?.map(v => v.reportId) ?? [];
+
+    // if (props.formDisable) {
+
+    // } else {
+    //   form.platformIds = [props.reportData.id];
+    // }
 
     if (props.reportData.platformWell === 1) {
       props.reportData.platforms.forEach(p => {
@@ -263,12 +267,12 @@
     // 附件
     form.attachments = props.reportData.attachments || [];
     // 展示用的文件列表
-    attachmentsFileList.value =
-      props.reportData?.attachments?.map(item => ({
-        ...item,
-        name: item.filename,
-        url: item.filePath,
-      })) || [];
+    // attachmentsFileList.value =
+    //   props.reportData?.attachments?.map(item => ({
+    //     ...item,
+    //     name: item.filename,
+    //     url: item.filePath,
+    //   })) || [];
   };
   // 初始化时间范围
   const timeRangeFormat = () => {
@@ -350,8 +354,6 @@
           return;
         }
 
-        console.log('11 :>> ', 11);
-
         form.attachments.push({
           bizId: props.reportId,
           category: 'daily_report',
@@ -362,8 +364,6 @@
           remark: '',
           type: 'attachment',
         });
-
-        console.log('form.attachments :>> ', form.attachments);
       },
       fail: e => {
         file.status = 'fail';
@@ -762,7 +762,7 @@
           <view class="file-list item-col" v-else>
             <view v-for="(file, index) in form.attachments" :key="index">
               {{ file.filename }}
-              <button @click="downloadFile(file)" type="primary" size="mini" class="file-picker-btn">下载文件</button>
+              <!-- <button @click="downloadFile(file)" type="primary" size="mini" class="file-picker-btn">下载文件</button> -->
             </view>
           </view>
         </uni-forms-item>
@@ -972,7 +972,7 @@
     flex-direction: column;
     align-items: end;
     justify-content: end;
-    width: 300px;
+    max-width: 300px;
 
     & > view {
       width: 100%;
@@ -1030,7 +1030,7 @@
   }
 
   .item-col {
-    float: right;
+    justify-content: end;
   }
 
   .time-range-item {