11 lines
9.2 KiB
JavaScript
11 lines
9.2 KiB
JavaScript
|
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["tuniao-ui/components/tn-image-upload/tn-image-upload"],{"113f":function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return s}));var s={tnLineProgress:function(){return n.e("tuniao-ui/components/tn-line-progress/tn-line-progress").then(n.bind(null,"d277"))}},i=function(){var e=this,t=e.$createElement,n=(e._self._c,e.showUploadList?e.__map(e.lists,(function(t,n){var s=e.__get_orig(t),i=e.$tn.string.getLengthUnitValue(e.width),o=e.$tn.string.getLengthUnitValue(e.height);return{$orig:s,g0:i,g1:o}})):null);e.$initSSP();var s=e.lists.length,i=e.maxCount>s&&!e.customBtn?e.$tn.string.getLengthUnitValue(e.width):null,o=e.maxCount>s&&!e.customBtn?e.$tn.string.getLengthUnitValue(e.height):null;e.$mp.data=Object.assign({},{$root:{l0:n,g2:s,g3:i,g4:o}}),"augmented"===e.$scope.data.scopedSlotsCompiler&&e.$setSSP("file",{file:e.lists}),e.$callSSP()},o=[]},"79e9":function(e,t,n){"use strict";n.r(t);var s=n("7df7"),i=n.n(s);for(var o in s)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return s[e]}))}(o);t["default"]=i.a},"7df7":function(e,t,n){"use strict";(function(e,s){var i=n("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n("2eee")),a=i(n("c973")),r={name:"tn-image-upload",props:{fileList:{type:Array,default:function(){return[]}},isUniCloud:{type:Boolean,default:!1},action:{type:String,default:""},name:{type:String,default:"file"},header:{type:Object,default:function(){return{}}},formData:{type:Object,default:function(){return{}}},disabled:{type:Boolean,default:!1},autoUpload:{type:Boolean,default:!0},maxCount:{type:Number,default:9},showUploadList:{type:Boolean,default:!0},imageMode:{type:String,default:"aspectFill"},previewFullImage:{type:Boolean,default:!0},showProgress:{type:Boolean,default:!0},deleteable:{type:Boolean,default:!0},deleteIcon:{type:String,default:"close"},deleteBackgroundColor:{type:String,default:""},deleteColor:{type:String,default:""},uploadText:{type:String,default:"选择图片"},showTips:{type:Boolean,default:!0},customBtn:{type:Boolean,default:!1},width:{type:Number,default:200},height:{type:Number,default:200},sizeType:{type:Array,default:function(){return["original","compressed"]}},sourceType:{type:Array,default:function(){return["album","camera"]}},multiple:{type:Boolean,default:!0},maxSize:{type:Number,default:10485760},limitType:{type:Array,default:function(){return["png","jpg","jpeg","webp","gif","image"]}},toJson:{type:Boolean,default:!0},beforeUpload:{type:Function,default:null},beforeRemove:{type:Function,default:null},index:{type:[Number,String],default:""}},computed:{},data:function(){return{lists:[],uploading:!1}},watch:{fileList:{handler:function(e){var t=this;e.map((function(e){var n=t.lists.some((function(t){return t.url===e.url}));!n&&t.lists.push({url:e.url,error:!1,progress:100})}))},immediate:!0},lists:function(e){this.$emit("on-list-change",e,this.index)}},methods:{clear:function(){this.lists=[]},reUpload:function(){this.uploadFile()},selectFile:function(){var t=this;if(!this.disabled){this.name;var n=this.maxCount,s=this.multiple,i=this.maxSize,o=this.sizeType,a=this.lists,r=(this.camera,this.compressed,this.sourceType),l=null,u=n-a.length;l=new Promise((function(t,n){e.chooseImage({count:s?u>9?9:u:1,sourceType:r,sizeType:o,success:t,fail:n})})),l.then((function(e){var o=a.length;e.tempFiles.map((function(e,o){if(t.checkFileExt(e)&&(s||!(o>=1)))if(e.size>i)t.$emit("on-oversize",e,a,t.index),t.showToast("超出可允许文件大小");else{if(n<=a.length)return t.$emit("on-exceed",e,a,t.index),void t.showToast("超出最大允许的文件数");a.push({url:e.path,progress:0,error:!1,file:e,extension:e.path.substring(e.path.lastIndexOf("."))})}})),t.$emit("on-choose-complete",t.lists,t.index),t.autoUpload&&t.uploadFile(o)})).catch((function(e){t.$emit("on-choose-fail",e)}))}},showToast:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(this.showTips||t)&&this.$tn.message.toast(e)},upload:function()
|
||
|
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
|
||
|
'tuniao-ui/components/tn-image-upload/tn-image-upload-create-component',
|
||
|
{
|
||
|
'tuniao-ui/components/tn-image-upload/tn-image-upload-create-component':(function(module, exports, __webpack_require__){
|
||
|
__webpack_require__('543d')['createComponent'](__webpack_require__("8be7"))
|
||
|
})
|
||
|
},
|
||
|
[['tuniao-ui/components/tn-image-upload/tn-image-upload-create-component']]
|
||
|
]);
|