yyb
2026-05-22 552ec6b7d8ccc56c379da195fc6c9c74312b1070
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
<template>
  <view class="inspection-upload-page">
    <!-- 页面头部 -->
    <PageHeader title="上传巡检记录"
                @back="goBack" />
    <!-- 页面内容 -->
    <view class="upload-content">
      <!-- 任务信息卡片 -->
      <view class="task-info-card"
            v-if="taskInfo">
        <view class="task-info-header">
          <text class="task-name">{{ taskInfo.taskName }}</text>
        </view>
        <view class="task-info-body">
          <view class="info-item">
            <text class="info-label">任务ID</text>
            <text class="info-value">{{ taskInfo.taskId || taskInfo.id }}</text>
          </view>
          <view class="info-item">
            <text class="info-label">巡检位置</text>
            <text class="info-value">{{ taskInfo.inspectionLocation || '-' }}</text>
          </view>
          <view class="info-item">
            <text class="info-label">执行人</text>
            <text class="info-value">{{ taskInfo.inspector || '-' }}</text>
          </view>
        </view>
      </view>
      <!-- 异常状态选择 -->
      <view class="section-card">
        <view class="section-title">巡检状态</view>
        <view class="exception-options">
          <view class="exception-option"
                :class="{ active: hasException === false }"
                @click="setExceptionStatus(false)">
            <u-icon name="checkmark-circle"
                    size="20"
                    color="#52c41a"></u-icon>
            <text class="option-text">正常</text>
          </view>
          <view class="exception-option"
                :class="{ active: hasException === true }"
                @click="setExceptionStatus(true)">
            <u-icon name="close-circle"
                    size="20"
                    color="#ff4d4f"></u-icon>
            <text class="option-text">存在异常</text>
          </view>
        </view>
      </view>
      <!-- 异常描述(仅在异常时显示) -->
      <view class="section-card"
            v-if="hasException === true">
        <view class="section-title">异常描述</view>
        <textarea v-model="abnormalDescription"
                  class="exception-textarea"
                  maxlength="500"
                  placeholder="请描述异常情况..." />
      </view>
      <!-- 分类标签页(仅在异常时显示) -->
      <view class="section-card"
            v-if="hasException === true">
        <view class="upload-tabs">
          <view class="tab-item"
                :class="{ active: currentUploadType === 'before' }"
                @click="switchUploadType('before')">
            生产前
          </view>
          <view class="tab-item"
                :class="{ active: currentUploadType === 'after' }"
                @click="switchUploadType('after')">
            生产中
          </view>
          <view class="tab-item"
                :class="{ active: currentUploadType === 'issue' }"
                @click="switchUploadType('issue')">
            生产后
          </view>
        </view>
        <!-- 当前分类的上传区域 -->
        <view class="upload-area">
          <view class="upload-buttons">
            <u-button type="primary"
                      @click="chooseMedia('image')"
                      :loading="uploading"
                      :disabled="getCurrentFiles().length >= uploadConfig.limit"
                      :customStyle="{ marginRight: '10px', flex: 1 }">
              <u-icon name="camera"
                      size="18"
                      color="#fff"
                      style="margin-right: 5px"></u-icon>
              {{ uploading ? '上传中...' : '拍照' }}
            </u-button>
            <u-button type="success"
                      @click="chooseMedia('video')"
                      :loading="uploading"
                      :disabled="getCurrentFiles().length >= uploadConfig.limit"
                      :customStyle="{ flex: 1 }">
              <uni-icons type="videocam"
                         size="18"
                         color="#fff"
                         style="margin-right: 5px"></uni-icons>
              {{ uploading ? '上传中...' : '拍视频' }}
            </u-button>
          </view>
          <!-- 上传进度 -->
          <view v-if="uploading"
                class="upload-progress">
            <u-line-progress :percentage="uploadProgress"
                             :showText="true"
                             activeColor="#409eff"></u-line-progress>
          </view>
          <!-- 当前分类的文件列表 -->
          <view v-if="getCurrentFiles().length > 0"
                class="file-list">
            <view v-for="(file, index) in getCurrentFiles()"
                  :key="index"
                  class="file-item">
              <view class="file-preview-container">
                <image v-if="file.type === 'image' || (file.type !== 'video' && !file.type)"
                       :src="file.url || file.tempFilePath || file.path || file.downloadUrl"
                       class="file-preview"
                       mode="aspectFill" />
                <view v-else-if="file.type === 'video'"
                      class="video-preview">
                  <uni-icons type="videocam"
                             size="18"
                             color="#fff"
                             style="margin-right: 5px"></uni-icons>
                  <text class="video-text">视频</text>
                </view>
                <!-- 删除按钮 -->
                <view class="delete-btn"
                      @click="removeFile(index)">
                  <u-icon name="close"
                          size="12"
                          color="#fff"></u-icon>
                </view>
              </view>
              <view class="file-info">
                <text class="file-name">{{ file.bucketFilename || file.name || (file.type === 'image' ? '图片' : '视频') }}</text>
                <text class="file-size">{{ formatFileSize(file.size) }}</text>
              </view>
            </view>
          </view>
          <view v-if="getCurrentFiles().length === 0"
                class="empty-state">
            <text>请选择要上传的{{ getUploadTypeText() }}图片或视频</text>
          </view>
        </view>
        <!-- 统计信息 -->
        <view class="upload-summary">
          <text class="summary-text">
            生产前: {{ beforeModelValue.length }}个文件 |
            生产中: {{ afterModelValue.length }}个文件 |
            生产后: {{ issueModelValue.length }}个文件
          </text>
        </view>
      </view>
      <!-- 正常状态提示 -->
      <view class="normal-tip-card"
            v-if="hasException === false">
        <u-icon name="info-circle"
                size="60"
                color="#52c41a"></u-icon>
        <text class="tip-text">设备运行正常,无需上传照片</text>
      </view>
    </view>
    <!-- 底部按钮 -->
    <view class="footer-buttons">
      <u-button @click="goBack"
                :customStyle="{ marginRight: '10px' }">取消</u-button>
      <u-button v-if="hasException === true"
                type="warning"
                @click="goToRepair"
                :customStyle="{ marginRight: '10px' }">
        新增报修
      </u-button>
      <u-button type="primary"
                @click="submitUpload">提交</u-button>
    </view>
  </view>
</template>
 
<script setup>
  import { ref, computed, onMounted } from "vue";
  import { onLoad } from "@dcloudio/uni-app";
  import PageHeader from "@/components/PageHeader.vue";
  import { uploadInspectionTask } from "@/api/inspectionManagement";
  import { getToken } from "@/utils/auth";
  import config from "@/config";
 
  // 任务信息
  const taskInfo = ref(null);
 
  // 上传相关状态
  const uploading = ref(false);
  const uploadProgress = ref(0);
 
  // 三个分类的上传状态
  const beforeModelValue = ref([]); // 生产前
  const afterModelValue = ref([]); // 生产中
  const issueModelValue = ref([]); // 生产后
 
  // 当前激活的上传类型
  const currentUploadType = ref("before"); // 'before', 'after', 'issue'
 
  // 异常状态
  const hasException = ref(null); // null: 未选择, true: 存在异常, false: 正常
  // 异常描述
  const abnormalDescription = ref("");
 
  // 上传配置
  const uploadConfig = {
    action: "/common/upload",
    limit: 10,
    fileSize: 50, // MB
    fileType: ["jpg", "jpeg", "png", "mp4", "mov"],
    maxVideoDuration: 60, // 秒
  };
 
  // 计算上传URL
  const uploadFileUrl = computed(() => {
    const baseUrl = config.baseUrl;
    return baseUrl + uploadConfig.action;
  });
 
  // 页面加载
  onLoad(options => {
    if (options.taskInfo) {
      try {
        const info = JSON.parse(decodeURIComponent(options.taskInfo));
        taskInfo.value = info;
 
        // 回显逻辑:从 taskInfo 中恢复已上传的文件
        const mapFiles = list => {
          if (!list || !Array.isArray(list)) return [];
          return list.map(item => {
            // 处理 URL,去除可能的空格
            const finalUrl = (item.url || item.previewURL || "").trim();
            // 自动推断文件类型
            let fileType = item.type;
            if (!fileType && item.contentType) {
              fileType = item.contentType.startsWith("video") ? "video" : "image";
            } else if (!fileType) {
              fileType = "image"; // 默认图片
            }
 
            return {
              ...item,
              url: finalUrl,
              name: item.name || item.originalFilename,
              tempId: item.tempId || item.id || item.tempFileId,
              size: item.size || item.byteSize || 0, // 映射大小字段
              type: fileType,
              status: "success",
            };
          });
        };
 
        // 根据用户要求映射:AfterDTO(生产前), DTO(生产中), BeforeDTO(生产后)
        if (
          info.commonFileListAfterVO &&
          Array.isArray(info.commonFileListAfterVO)
        ) {
          beforeModelValue.value = mapFiles(info.commonFileListAfterVO);
        }
        console.log(beforeModelValue.value, "beforeModelValue");
 
        if (info.commonFileListVO && Array.isArray(info.commonFileListVO)) {
          afterModelValue.value = mapFiles(info.commonFileListVO);
        }
        if (
          info.commonFileListBeforeVO &&
          Array.isArray(info.commonFileListBeforeVO)
        ) {
          issueModelValue.value = mapFiles(info.commonFileListBeforeVO);
        }
 
        // 如果有异常描述,也恢复
        if (info.abnormalDescription) {
          abnormalDescription.value = info.abnormalDescription;
        }
        // 如果有异常状态,也恢复
        if (info.hasException !== undefined && info.hasException !== null) {
          hasException.value = info.hasException;
        } else if (
          info.inspectionResult !== undefined &&
          info.inspectionResult !== null
        ) {
          // 0-异常,1-正常
          hasException.value = String(info.inspectionResult) === "0";
        }
 
        // 自动兜底:如果存在已上传文件,则必然是异常状态,确保 UI 正常显示
        if (
          !hasException.value &&
          (beforeModelValue.value.length > 0 ||
            afterModelValue.value.length > 0 ||
            issueModelValue.value.length > 0)
        ) {
          hasException.value = true;
        }
      } catch (e) {
        console.error("解析任务信息失败:", e);
      }
    }
  });
 
  // 返回上一页
  const goBack = () => {
    uni.navigateBack();
  };
 
  // 切换上传类型
  const switchUploadType = type => {
    currentUploadType.value = type;
  };
 
  // 获取当前分类的文件列表
  const getCurrentFiles = () => {
    switch (currentUploadType.value) {
      case "before":
        return beforeModelValue.value || [];
      case "after":
        return afterModelValue.value || [];
      case "issue":
        return issueModelValue.value || [];
      default:
        return [];
    }
  };
 
  // 获取上传类型文本
  const getUploadTypeText = () => {
    switch (currentUploadType.value) {
      case "before":
        return "生产前";
      case "after":
        return "生产中";
      case "issue":
        return "生产后";
      default:
        return "";
    }
  };
 
  // 设置异常状态
  const setExceptionStatus = status => {
    hasException.value = status;
  };
 
  // 跳转到新增报修页面
  const goToRepair = () => {
    try {
      const taskData = {
        taskId: taskInfo.value?.taskId || taskInfo.value?.id,
        taskName: taskInfo.value?.taskName,
        inspectionLocation: taskInfo.value?.inspectionLocation,
        inspector: taskInfo.value?.inspector,
        hasException: hasException.value,
        inspectionResult: hasException.value ? 0 : 1, // 0-异常,1-正常
        commonFileListAfterDTO: beforeModelValue.value,
        commonFileListDTO: afterModelValue.value,
        commonFileListBeforeDTO: issueModelValue.value,
        uploadedFiles: {
          before: beforeModelValue.value,
          after: afterModelValue.value,
          issue: issueModelValue.value,
        },
      };
 
      uni.setStorageSync("repairTaskInfo", JSON.stringify(taskData));
 
      uni.navigateTo({
        url: "/pages/equipmentManagement/repair/add",
      });
    } catch (error) {
      console.error("跳转报修页面失败:", error);
      uni.showToast({
        title: "跳转失败,请重试",
        icon: "error",
      });
    }
  };
 
  // 提交上传
  const submitUpload = async () => {
    try {
      // 检查是否选择了异常状态
      if (hasException.value === null) {
        uni.showToast({
          title: "请选择巡检状态",
          icon: "none",
        });
        return;
      }
 
      // 如果是异常状态,检查是否有上传文件和描述
      if (hasException.value === true) {
        const totalFiles =
          beforeModelValue.value.length +
          afterModelValue.value.length +
          issueModelValue.value.length;
        if (totalFiles === 0) {
          uni.showToast({
            title: "请上传异常照片",
            icon: "none",
          });
          return;
        }
        // 检查是否填写了异常描述
        if (!abnormalDescription.value.trim()) {
          uni.showToast({
            title: "请填写异常描述",
            icon: "none",
          });
          return;
        }
      }
 
      // 显示提交中的加载提示
      uni.showLoading({
        title: "提交中...",
        mask: true,
      });
 
      // 按照逻辑合并所有分类的文件用于提取ID
      const allFiles = [
        ...beforeModelValue.value,
        ...afterModelValue.value,
        ...issueModelValue.value,
      ];
 
      // 传给后端的临时文件ID列表
      let tempFileIds = [];
      if (allFiles.length > 0) {
        tempFileIds = allFiles
          .map(item => item?.tempId ?? item?.tempFileId ?? item?.id)
          .filter(v => v !== undefined && v !== null && v !== "");
      }
 
      // 提交数据
      const submitData = {
        ...taskInfo.value,
        commonFileListAfterDTO: beforeModelValue.value, // 生产前
        commonFileListDTO: afterModelValue.value, // 生产中
        commonFileListBeforeDTO: issueModelValue.value, // 生产后
        hasException: hasException.value,
        inspectionResult: hasException.value ? 0 : 1, // 0-异常,1-正常
        abnormalDescription: abnormalDescription.value,
        tempFileIds: tempFileIds,
      };
 
      const result = await uploadInspectionTask(submitData);
 
      // 检查提交结果
      if (result && (result.code === 200 || result.success)) {
        uni.hideLoading();
        uni.showToast({
          title: "提交成功",
          icon: "success",
        });
 
        // 返回列表页并刷新
        setTimeout(() => {
          uni.navigateBack();
        }, 500);
      } else {
        uni.hideLoading();
        uni.showToast({
          title: result?.msg || result?.message || "提交失败",
          icon: "error",
        });
      }
    } catch (error) {
      console.error("提交上传失败:", error);
      uni.hideLoading();
      uni.showToast({
        title: error?.message || "提交失败",
        icon: "error",
      });
    }
  };
 
  // 格式化文件大小
  const formatFileSize = size => {
    if (!size) return "0 B";
    const units = ["B", "KB", "MB", "GB"];
    let index = 0;
    let fileSize = size;
    while (fileSize >= 1024 && index < units.length - 1) {
      fileSize /= 1024;
      index++;
    }
    return `${fileSize.toFixed(2)} ${units[index]}`;
  };
 
  // 拍照/拍视频
  const chooseMedia = type => {
    if (getCurrentFiles().length >= uploadConfig.limit) {
      uni.showToast({
        title: `最多只能选择${uploadConfig.limit}个文件`,
        icon: "none",
      });
      return;
    }
 
    const remaining = uploadConfig.limit - getCurrentFiles().length;
 
    // 优先使用 chooseMedia
    if (typeof uni.chooseMedia === "function") {
      uni.chooseMedia({
        count: Math.min(remaining, 1),
        mediaType: [type || "image"],
        sizeType: ["compressed", "original"],
        sourceType: ["camera"],
        success: res => {
          try {
            const files = res?.tempFiles || [];
            if (!files.length) throw new Error("未获取到文件");
 
            files.forEach((tf, idx) => {
              const filePath = tf.tempFilePath || tf.path || "";
              const fileType = tf.fileType || type || "image";
              const ext = fileType === "video" ? "mp4" : "jpg";
              const file = {
                tempFilePath: filePath,
                path: filePath,
                type: fileType,
                name: `${fileType}_${Date.now()}_${idx}.${ext}`,
                size: tf.size || 0,
                duration: tf.duration || 0,
                createTime: Date.now(),
              };
              uploadFile(file);
            });
          } catch (err) {
            uni.showToast({ title: err.message || "处理文件失败", icon: "none" });
          }
        },
        fail: err => {
          console.error("选择媒体失败:", err);
          uni.showToast({ title: "选择失败", icon: "none" });
        },
      });
    } else {
      // 降级方案
      if (type === "video") {
        uni.chooseVideo({
          sourceType: ["camera"],
          success: res => {
            const file = {
              tempFilePath: res.tempFilePath,
              path: res.tempFilePath,
              type: "video",
              name: `video_${Date.now()}.mp4`,
              size: res.size || 0,
              duration: res.duration || 0,
              createTime: Date.now(),
            };
            uploadFile(file);
          },
          fail: () => {
            uni.showToast({ title: "选择视频失败", icon: "none" });
          },
        });
      } else {
        uni.chooseImage({
          count: Math.min(remaining, 9),
          sizeType: ["compressed"],
          sourceType: ["camera"],
          success: res => {
            const list = res.tempFilePaths || res.tempFiles || [];
            list.forEach((src, idx) => {
              const path = typeof src === "string" ? src : src.path;
              const file = {
                tempFilePath: path,
                path: path,
                type: "image",
                name: `image_${Date.now()}_${idx}.jpg`,
                size: 0,
                createTime: Date.now(),
              };
              uploadFile(file);
            });
          },
          fail: () => {
            uni.showToast({ title: "选择图片失败", icon: "none" });
          },
        });
      }
    }
  };
 
  // 上传单个文件
  const uploadFile = file => {
    const token = getToken();
    if (!token) {
      uni.showToast({ title: "用户未登录", icon: "none" });
      return;
    }
 
    uploading.value = true;
    uploadProgress.value = 0;
 
    const uploadTask = uni.uploadFile({
      url: uploadFileUrl.value,
      filePath: file.tempFilePath,
      name: "files",
      header: {
        Authorization: `Bearer ${token}`,
      },
      formData: {
        type: getTabType(),
      },
      success: res => {
        try {
          const data = JSON.parse(res.data);
          if (data.code === 200) {
            // 兼容 CommonUpload.vue 的处理逻辑
            const resultData = Array.isArray(data.data)
              ? data.data[0]
              : data.data;
 
            // 处理 url 和 name 赋值
            const finalUrl = resultData.url || resultData.previewURL;
            const finalName = resultData.name || resultData.originalFilename;
            const finalId =
              resultData.tempId || resultData.id || resultData.tempFileId;
 
            const uploadedFile = {
              ...file,
              ...resultData, // 包含后端返回的所有字段
              url: finalUrl,
              name: finalName,
              tempId: finalId,
              status: "success",
            };
 
            // 根据当前类型添加到对应数组
            if (currentUploadType.value === "before") {
              beforeModelValue.value.push(uploadedFile);
            } else if (currentUploadType.value === "after") {
              afterModelValue.value.push(uploadedFile);
            } else if (currentUploadType.value === "issue") {
              issueModelValue.value.push(uploadedFile);
            }
 
            uni.showToast({ title: "上传成功", icon: "success" });
          } else {
            uni.showToast({ title: data.msg || "上传失败", icon: "none" });
          }
        } catch (e) {
          uni.showToast({ title: "解析响应失败", icon: "none" });
        }
      },
      fail: err => {
        console.error("上传失败:", err);
        uni.showToast({ title: "上传失败", icon: "none" });
      },
      complete: () => {
        uploading.value = false;
      },
    });
 
    // 监听上传进度
    uploadTask.onProgressUpdate(res => {
      uploadProgress.value = res.progress;
    });
  };
 
  // 获取type值
  const getTabType = () => {
    switch (currentUploadType.value) {
      case "before":
        return 10;
      case "after":
        return 11;
      case "issue":
        return 12;
      default:
        return 10;
    }
  };
 
  // 删除文件
  const removeFile = index => {
    const files = getCurrentFiles();
    files.splice(index, 1);
  };
</script>
 
<style scoped>
  .inspection-upload-page {
    min-height: 100vh;
    background-color: #f5f5f5;
    padding-bottom: 80px;
  }
 
  .upload-content {
    padding: 15px;
  }
 
  /* 任务信息卡片 */
  .task-info-card {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  }
 
  .task-info-header {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
  }
 
  .task-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
  }
 
  .task-info-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
 
  .info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
 
  .info-label {
    font-size: 13px;
    color: #999;
  }
 
  .info-value {
    font-size: 13px;
    color: #666;
  }
 
  /* 通用卡片样式 */
  .section-card {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  }
 
  .section-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
  }
 
  /* 异常状态选择 */
  .exception-options {
    display: flex;
    gap: 12px;
  }
 
  .exception-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
  }
 
  .exception-option.active {
    border-color: #409eff;
    background: #f0f8ff;
  }
 
  .option-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
  }
 
  /* 异常描述 */
  .exception-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    resize: none;
    box-sizing: border-box;
  }
 
  .exception-textarea:focus {
    outline: none;
    border-color: #409eff;
    background: #fff;
  }
 
  /* 分类标签页 */
  .upload-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
  }
 
  .tab-item {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
  }
 
  .tab-item.active {
    background: #409eff;
    color: #fff;
  }
 
  /* 上传区域 */
  .upload-area {
    padding: 10px 0;
  }
 
  .upload-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
  }
 
  .upload-progress {
    margin-bottom: 15px;
  }
 
  /* 文件列表 */
  .file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
 
  .file-item {
    width: calc(33.33% - 7px);
  }
 
  .file-preview-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
  }
 
  .file-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
 
  .video-preview {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #333;
  }
 
  .video-text {
    font-size: 12px;
    color: #fff;
    margin-top: 5px;
  }
 
  .delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
 
  .file-info {
    margin-top: 5px;
  }
 
  .file-name {
    display: block;
    font-size: 11px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
 
  .file-size {
    display: block;
    font-size: 10px;
    color: #999;
    margin-top: 2px;
  }
 
  .empty-state {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 13px;
  }
 
  /* 统计信息 */
  .upload-summary {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #409eff;
  }
 
  .summary-text {
    font-size: 12px;
    color: #666;
  }
 
  /* 正常状态提示 */
  .normal-tip-card {
    background: #f6ffed;
    border: 2px dashed #b7eb8f;
    border-radius: 12px;
    padding: 50px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
  }
 
  .normal-tip-card .tip-text {
    margin-top: 15px;
    font-size: 16px;
    color: #52c41a;
    font-weight: 500;
  }
 
  /* 底部按钮 */
  .footer-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    padding: 15px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  }
</style>