| | |
| | | <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> |
| | |
| | | <script> |
| | | export default { |
| | | name: "uploadFile", |
| | | emits:['uploadFiles','choose','delFile'], |
| | | emits: ['uploadFiles', 'choose', 'delFile','downloadFile'], |
| | | props: { |
| | | filesList: { |
| | | type: Array, |
| | |
| | | } |
| | | } |
| | | }, |
| | | 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 |
| | |
| | | index |
| | | }) |
| | | }, |
| | | |
| | | downloadFile(item,index){ |
| | | this.$emit("downloadFile", { |
| | | item, |
| | | index |
| | | }) |
| | | }, |
| | | choose() { |
| | | this.$emit("choose") |
| | | }, |
| | |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .icon-down { |
| | | margin-top: 7px; |
| | | } |
| | | |
| | | .uni-file-picker__files { |
| | | /* #ifndef APP-NVUE */ |
| | | display: flex; |
| | |
| | | } |
| | | |
| | | /* #endif */ |
| | | </style> |
| | | </style> |