You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
3.9 KiB
JavaScript
11 lines
3.9 KiB
JavaScript
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/image-upload"],{"0eee":function(e,t,i){"use strict";i.d(t,"b",(function(){return n})),i.d(t,"c",(function(){return o})),i.d(t,"a",(function(){return a}));var a={uIcon:function(){return Promise.all([i.e("common/vendor"),i.e("node-modules/uview-ui/components/u-icon/u-icon")]).then(i.bind(null,"da7f"))}},n=function(){var e=this.$createElement,t=(this._self._c,!this.detail&&this.lists.length<this.maxCount);this.$mp.data=Object.assign({},{$root:{g0:t}})},o=[]},"1dff":function(e,t,i){"use strict";var a=i("fce2"),n=i.n(a);n.a},"6dc1":function(e,t,i){"use strict";i.r(t);var a=i("9722"),n=i.n(a);for(var o in a)["default"].indexOf(o)<0&&function(e){i.d(t,e,(function(){return a[e]}))}(o);t["default"]=n.a},"7a08":function(e,t,i){"use strict";i.r(t);var a=i("0eee"),n=i("6dc1");for(var o in n)["default"].indexOf(o)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(o);i("1dff");var u=i("f0c5"),s=Object(u["a"])(n["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],void 0);t["default"]=s.exports},9722:function(e,t,i){"use strict";(function(e){var a=i("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(i("3f96")),o={props:{waterMark:{type:Boolean,default:!1},maxCount:{type:Number,default:9},deleteable:{type:Boolean,default:!0},detail:{type:Boolean,default:!1},desc:{default:""},descColor:{default:"#2593F2"},delColor:{default:"#666666"},both:{type:Boolean,default:!1},maxSize:{type:Number,default:10},limitType:{type:Array,default:function(){return["png","jpg","jpeg","gif","webp","image"]}},value:{type:Array,default:function(){return[]}},ossFileDTOList:{type:Array,default:function(){return[]}}},data:function(){return{lists:[],imageWidth:300,imageHeight:500}},watch:{value:{handler:function(e,t){this.lists=e},deep:!0,immediate:!0}},methods:{previewImage:function(t){e.previewImage({current:t,urls:this.lists[t].fileUrl,indicator:"default",loop:!0})},deleteImageList:function(e){var t=this.lists.splice(e,1);this.$emit("update: ossFileDTOList",t)},selectFile:function(){var t=this,i=this.maxSize,a=this.maxCount,n=this.waterMark,o=null;o=new Promise((function(t,i){e.chooseImage({count:10,success:t,fail:i})})),o.then((function(e){var o=e.tempFiles[0];if(t.checkFileType(o))if(o.size>1024*i*1024)t.$u.toast("最大允许上传"+i+"MB的图片");else if(t.lists.length>=a)t.$u.toast("最多允许上传"+a+"张图片");else{var u=e.tempFilePaths[0];n?t.uploadWaterMarkImage(u):t.uploadImage(u)}})).catch((function(e){t.$emit("on-choose-fail",e)}))},uploadImage:function(t){var i=this;e.getImageInfo({src:t,success:function(t){n.default.storge.getPolicy({bucket:"public-aaf-shenzhen-file"}).then((function(a){var n=a.data,o=t.path.substring(t.path.lastIndexOf("/")+1);t.name=o;var u=n.dir+o,s={key:u,policy:n.policy,OSSAccessKeyId:n.accessid,success_action_status:"200",signature:n.signature,file:t};e.uploadFile({url:n.host,filePath:t.path,name:"file",formData:s,complete:function(e){var t="".concat(n.host,"/").concat(n.dir).concat(o);i.lists.push({fileUrl:t,fileName:o}),i.$emit("update: ossFileDTOList",i.lists)}})}))}})},uploadWaterMarkImage:function(t){var i=this;e.getImageInfo({src:t,success:function(t){i.imageWidth=t.width,i.imageHeight=t.height;var a=e.createCanvasContext("canone",i);t.type,t.height,t.width}})},uploadError:function(e){this.$emit("on-error",e,this.lists)},checkFileType:function(e){var t,i;return i=e.path.replace(/.+\./,"").toLowerCase(),t=this.limitType.some((function(e){return(null===e||void 0===e?void 0:e.toLowerCase())===i})),t}}};t.default=o}).call(this,i("543d")["default"])},fce2:function(e,t,i){}}]);
|
|
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
|
|
'components/image-upload-create-component',
|
|
{
|
|
'components/image-upload-create-component':(function(module, exports, __webpack_require__){
|
|
__webpack_require__('543d')['createComponent'](__webpack_require__("7a08"))
|
|
})
|
|
},
|
|
[['components/image-upload-create-component']]
|
|
]);
|