acdr-ui/dist/dev/mp-weixin/sheep/components/s-uploader/upload-file.js.map

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 'border-color': (borderStyle && borderStyle.color) || '#eee',\r\n 'border-radius': radius,\r\n }\r\n }\r\n let classles = ''\r\n for (const i in obj) {\r\n classles += `${i}:${obj[i]};`\r\n }\r\n return classles\r\n },\r\n borderLineStyle() {\r\n const obj = {}\r\n const { borderStyle } = this.styles\r\n if (borderStyle && borderStyle.color) {\r\n obj['border-color'] = borderStyle.color\r\n }\r\n if (borderStyle && borderStyle.width) {\r\n let width = (borderStyle && borderStyle.width) || 1\r\n let style = (borderStyle && borderStyle.style) || 0\r\n if (typeof width === 'number') {\r\n width += 'px'\r\n } else {\r\n width = width.indexOf('px') ? width : width + 'px'\r\n }\r\n obj['border-width'] = width\r\n\r\n if (typeof style === 'number') {\r\n style += 'px'\r\n } else {\r\n style = style.indexOf('px') ? style : style + 'px'\r\n }\r\n obj['border-top-style'] = style\r\n }\r\n let classles = ''\r\n for (const i in obj) {\r\n classles += `${i}:${obj[i]};`\r\n }\r\n return classles\r\n },\r\n },\r\n\r\n methods: {\r\n uploadFiles(item, index) {\r\n this.$emit('uploadFiles', {\r\n item,\r\n index,\r\n })\r\n },\r\n choose() {\r\n this.$emit('choose')\r\n },\r\n delFile(index) {\r\n this.$emit('delFile', index)\r\n },\r\n value2px(value) {\r\n if (typeof value === 'number') {\r\n value += 'px'\r\n } else {\r\n value = value.indexOf('px') !== -1 ? value : value + 'px'\r\n }\r\n return value\r\n },\r\n },\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\">\r\n.uni-file-picker__files {\r\n /* #ifndef APP-NVUE */\r\n display: flex;\r\n /* #endif */\r\n flex-direction: column;\r\n justify-content: flex-start;\r\n}\r\n\r\n.files-button {\r\n // border: 1px red solid;\r\n}\r\n\r\n.uni-file-picker__lists {\r\n position: relative;\r\n margin-top: 5px;\r\n overflow: hidden;\r\n}\r\n\r\n.file-picker__mask {\r\n position: absolute;\r\n top: 0;\r\n right: 0;\r\n bottom: 0;\r\n left: 0;\r\n /* #ifndef APP-NVUE */\r\n display: flex;\r\n align-items: center;\r\n /* #endif */\r\n justify-content: center;\r\n font-size: 14px;\r\n color: #fff;\r\n background-color: rgba(0, 0, 0, 0.4);\r\n}\r\n\r\n.uni-file-picker__lists-box {\r\n position: relative;\r\n}\r\n\r\n.uni-file-picker__item {\r\n /* #ifndef APP-NVUE */\r\n display: flex;\r\n /* #endif */\r\n align-items: center;\r\n padding: 8px 10px;\r\n padding-right: 5px;\r\n padding-left: 10px;\r\n}\r\n\r\n.files-border {\r\n border-top: 1px #eee solid;\r\n}\r\n\r\n.files__name {\r\n flex: 1;\r\n margin-right: 25px;\r\n font-size: 14px;\r\n color: #666;\r\n /* #ifndef APP-NVUE */\r\n word-break: break-all;\r\n word-wrap: break-word;\r\n /* #endif */\r\n}\r\n\r\n.icon-files {\r\n /* #ifndef APP-NVUE */\r\n position: static;\r\n background-color: initial;\r\n /* #endif */\r\n}\r\n\r\n// .icon-files .icon-del {\r\n// \tbackground-color: #333;\r\n// \twidth: 12px;\r\n// \theight: 1px;\r\n// }\r\n\r\n.is-list-card {\r\n padding: 5px;\r\n margin-bottom: 5px;\r\n border: 1px #eee solid;\r\n border-radius: 5px;\r\n box-shadow: 0 0 2px 0px rgba(0, 0, 0, 0.1);\r\n}\r\n\r\n.files__image {\r\n width: 40px;\r\n height: 40px;\r\n margin-right: 10px;\r\n}\r\n\r\n.header-image {\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n.is-text-box {\r\n border: 1px #eee solid;\r\n border-radius: 5px;\r\n}\r\n\r\n.is-text-image {\r\n width: 25px;\r\n height: 25px;\r\n margin-left: 5px;\r\n}\r\n\r\n.rotate {\r\n position: absolute;\r\n transform: rotate(90deg);\r\n}\r\n\r\n.icon-del-box {\r\n position: absolute;\r\n top: 0px;\r\n right: 5px;\r\n bottom: 0;\r\n // border-radius: 50%;\r\n // background-color: rgba(0, 0, 0, 0.5);\r\n z-index: 2;\r\n /* #ifndef APP-NVUE */\r\n display: flex;\r\n /* #endif */\r\n align-items: center;\r\n justify-content: center;\r\n width: 26px;\r\n height: 26px;\r\n margin: auto 0;\r\n transform: rotate(-45deg);\r\n}\r\n\r\n.icon-del {\r\n width: 15px;\r\n height: 1px;\r\n background-color: #333;\r\n // border-radius: 1px;\r\n}\r\n/* #ifdef H5 */\r\n@media all and (min-width: 768px) {\r\n .uni-file-picker__files {\r\n max-width: 375px;\r\n }\r\n}\r\n/* #endif */\r\n</style>\r\n","import Component from 'D:/App/Work/addr/acdr-ui/src/sheep/components/s-uploader/upload-file.vue'\nwx.createComponent(Component)"],"names":[],"mappings":";;AAqDA,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EACN,OAAO,CAAC,eAAe,UAAU,SAAS;AAAA,EAC1C,OAAO;AAAA,IACL,WAAW;AAAA,MACT,MAAM;AAAA,MACN,UAAU;AACR,eAAO,CAAC;AAAA,MACT;AAAA,IACF;AAAA,IACD,SAAS;AAAA,MACP,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACD,OAAO;AAAA,MACL,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB,SAAS;AAAA,IACV;AAAA,IACD,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACD,YAAY;AAAA,MACV,MAAM;AAAA,MACN,UAAU;AACR,eAAO;AAAA;AAAA,UAEL,QAAQ;AAAA;AAAA,UAER,WAAW;AAAA;AAAA,UAEX,aAAa,CAAE;AAAA,QACjB;AAAA,MACD;AAAA,IACF;AAAA,IACD,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,EACF;AAAA,EACD,UAAU;AAAA,IACR,OAAO;AACL,YAAM,QAAQ,CAAC;AACf,WAAK,UAAU,QAAQ,CAAC,MAAM;AAC5B,cAAM,KAAK,CAAC;AAAA,OACb;AACD,aAAO;AAAA,IACR;AAAA,IACD,SAAS;AACP,YAAM,SAAS;AAAA,QACb,QAAQ;AAAA,QACR,WAAW;AAAA,QACX,gBAAgB,CAAE;AAAA,MACpB;AACA,aAAO,OAAO,OAAO,QAAQ,KAAK,UAAU;AAAA,IAC7C;AAAA,IACD,cAAc;AACZ,YAAM,EAAE,aAAa,WAAW,KAAK;AACrC,UAAI,MAAM,CAAC;AACX,UAAI,CAAC,QAAQ;AACX,YAAI,SAAS;AAAA,aACR;AACL,YAAI,QAAS,eAAe,YAAY,SAAU;AAClD,gBA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