From 2fda34643bc22e25f6c569415da5f955c81536bf Mon Sep 17 00:00:00 2001
From: Houjie <714924425@qq.com>
Date: 星期二, 03 六月 2025 09:37:08 +0800
Subject: [PATCH] 设备详情通过ID过滤/设备详情增加上传附件

---
 uni_modules/uni-file-picker/components/uni-file-picker/upload-file.vue |   44 ++++++++++++++++++++++++++++----------------
 1 files changed, 28 insertions(+), 16 deletions(-)

diff --git a/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.vue b/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.vue
index 625d92e..d133b7f 100644
--- a/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.vue
+++ b/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.vue
@@ -7,28 +7,28 @@
 		<view v-if="list.length > 0" class="uni-file-picker__lists is-text-box" :style="borderStyle">
 			<!-- ,'is-list-card':showType === 'list-card' -->
 
-			<view class="uni-file-picker__lists-box" v-for="(item ,index) in list" :key="index" :class="{
-				'files-border':index !== 0 && styles.dividline}"
-			 :style="index !== 0 && styles.dividline &&borderLineStyle">
+			<!-- <view class="uni-file-picker__lists-box" v-for="(item ,index) in list" :key="index" :class="{
+				'files-border':index !== 0 && styles.dividline}" :style="index !== 0 && styles.dividline &&borderLineStyle">
 				<view class="uni-file-picker__item">
-					<!-- :class="{'is-text-image':showType === 'list'}" -->
-					<!-- 	<view class="files__image is-text-image">
-						<image class="header-image" :src="item.logo" mode="aspectFit"></image>
-					</view> -->
+					
+						<view class="files__image is-text-image">
+						<image class="cuIcon-down icon-down" @click.stop="downloadFile(item,index)"></image>
+					</view>
 					<view class="files__name">{{item.name}}</view>
 					<view v-if="delIcon&&!readonly" class="icon-del-box icon-files" @click="delFile(index)">
 						<view class="icon-del icon-files"></view>
 						<view class="icon-del rotate"></view>
 					</view>
 				</view>
-				<view v-if="(item.progress && item.progress !== 100) ||item.progress===0 " class="file-picker__progress">
-					<progress class="file-picker__progress-item" :percent="item.progress === -1?0:item.progress" stroke-width="4"
-					 :backgroundColor="item.errMsg?'#ff5a5f':'#EBEBEB'" />
+				<view v-if="(item.progress && item.progress !== 100) ||item.progress===0 "
+					class="file-picker__progress">
+					<progress class="file-picker__progress-item" :percent="item.progress === -1?0:item.progress"
+						stroke-width="4" :backgroundColor="item.errMsg?'#ff5a5f':'#EBEBEB'" />
 				</view>
 				<view v-if="item.status === 'error'" class="file-picker__mask" @click.stop="uploadFiles(item,index)">
 					鐐瑰嚮閲嶈瘯
 				</view>
-			</view>
+			</view> -->
 
 		</view>
 	</view>
@@ -37,7 +37,7 @@
 <script>
 	export default {
 		name: "uploadFile",
-		emits:['uploadFiles','choose','delFile'],
+		emits: ['uploadFiles', 'choose', 'delFile','downloadFile'],
 		props: {
 			filesList: {
 				type: Array,
@@ -70,15 +70,16 @@
 					}
 				}
 			},
-			readonly:{
-				type:Boolean,
-				default:false
+			readonly: {
+				type: Boolean,
+				default: false
 			}
 		},
 		computed: {
 			list() {
 				let files = []
 				this.filesList.forEach(v => {
+					console.log(v);
 					files.push(v)
 				})
 				return files
@@ -157,6 +158,13 @@
 					index
 				})
 			},
+			
+			downloadFile(item,index){
+				this.$emit("downloadFile", {
+					item,
+					index
+				})
+			},
 			choose() {
 				this.$emit("choose")
 			},
@@ -176,6 +184,10 @@
 </script>
 
 <style lang="scss">
+.icon-down {
+margin-top: 7px;
+}
+
 	.uni-file-picker__files {
 		/* #ifndef APP-NVUE */
 		display: flex;
@@ -322,4 +334,4 @@
 	}
 
 	/* #endif */
-</style>
+</style>
\ No newline at end of file

--
Gitblit v1.9.3