1 line
11 KiB
Plaintext
1 line
11 KiB
Plaintext
|
{"version":3,"file":"upload-file.js","sources":["../../../../../../src/sheep/components/s-uploader/upload-file.vue","../../../../../../uniComponent:/RDovQXBwL1dvcmsvYWRkci9hY2RyLXVpL3NyYy9zaGVlcC9jb21wb25lbnRzL3MtdXBsb2FkZXIvdXBsb2FkLWZpbGUudnVl"],"sourcesContent":["<template>\r\n <view class=\"uni-file-picker__files\">\r\n <view v-if=\"!readonly\" class=\"files-button\" @click=\"choose\">\r\n <slot></slot>\r\n </view>\r\n <!-- :class=\"{'is-text-box':showType === 'list'}\" -->\r\n <view v-if=\"list.length > 0\" class=\"uni-file-picker__lists is-text-box\" :style=\"borderStyle\">\r\n <!-- ,'is-list-card':showType === 'list-card' -->\r\n\r\n <view\r\n class=\"uni-file-picker__lists-box\"\r\n v-for=\"(item, index) in list\"\r\n :key=\"index\"\r\n :class=\"{\r\n 'files-border': index !== 0 && styles.dividline,\r\n }\"\r\n :style=\"index !== 0 && styles.dividline && borderLineStyle\"\r\n >\r\n <view class=\"uni-file-picker__item\">\r\n <!-- :class=\"{'is-text-image':showType === 'list'}\" -->\r\n <!-- \t<view class=\"files__image is-text-image\">\r\n\t\t\t\t\t\t<image class=\"header-image\" :src=\"item.logo\" mode=\"aspectFit\"></image>\r\n\t\t\t\t\t</view> -->\r\n <view class=\"files__name\">{{ item.name }}</view>\r\n <view v-if=\"delIcon && !readonly\" class=\"icon-del-box icon-files\" @click=\"delFile(index)\">\r\n <view class=\"icon-del icon-files\"></view>\r\n <view class=\"icon-del rotate\"></view>\r\n </view>\r\n </view>\r\n <view\r\n v-if=\"(item.progress && item.progress !== 100) || item.progress === 0\"\r\n class=\"file-picker__progress\"\r\n >\r\n <progress\r\n class=\"file-picker__progress-item\"\r\n :percent=\"item.progress === -1 ? 0 : item.progress\"\r\n stroke-width=\"4\"\r\n :backgroundColor=\"item.errMsg ? '#ff5a5f' : '#EBEBEB'\"\r\n />\r\n </view>\r\n <view\r\n v-if=\"item.status === 'error'\"\r\n class=\"file-picker__mask\"\r\n @click.stop=\"uploadFiles(item, index)\"\r\n >\r\n 点击重试\r\n </view>\r\n </view>\r\n </view>\r\n </view>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'uploadFile',\r\n emits: ['uploadFiles', 'choose', 'delFile'],\r\n props: {\r\n filesList: {\r\n type: Array,\r\n default() {\r\n return []\r\n },\r\n },\r\n delIcon: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n limit: {\r\n type: [Number, String],\r\n default: 9,\r\n },\r\n showType: {\r\n type: String,\r\n default: '',\r\n },\r\n listStyles: {\r\n type: Object,\r\n default() {\r\n return {\r\n // 是否显示边框\r\n border: true,\r\n // 是否显示分隔线\r\n dividline: true,\r\n // 线条样式\r\n borderStyle: {},\r\n }\r\n },\r\n },\r\n readonly: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n },\r\n computed: {\r\n list() {\r\n const files = []\r\n this.filesList.forEach((v) => {\r\n files.push(v)\r\n })\r\n return files\r\n },\r\n styles() {\r\n const styles = {\r\n border: true,\r\n dividline: true,\r\n 'border-style': {},\r\n }\r\n return Object.assign(styles, this.listStyles)\r\n },\r\n borderStyle() {\r\n const { borderStyle, border } = this.styles\r\n let obj = {}\r\n if (!border) {\r\n obj.border = 'none'\r\n } else {\r\n let width = (borderStyle && borderStyle.width) || 1\r\n width = this.value2px(width)\r\n let radius = (borderStyle && borderStyle.radius) || 5\r\n radius = this.value2px(radius)\r\n obj = {\r\n 'border-width': width,\r\n 'border-style': (borderStyle && borderStyle.style) || 'solid',\r\n 'borde
|