chunk-commons.b49eb189.js 31 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-commons"],{"095c":function(e,t,i){"use strict";i.r(t);var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"editor"},[i("quill-editor",{ref:"myAlias",staticClass:"ql-editor",attrs:{options:e.editorOption},on:{blur:function(t){return e.onEditorBlur(t)},focus:function(t){return e.onEditorFocus(t)},change:function(t){return e.onEditorChange(t)}},model:{value:e.form,callback:function(t){e.form=t},expression:"form"}}),e._v(" "),i("el-upload",{ref:"ivuUpload",staticClass:"ivu-upload",staticStyle:{height:"1px"},attrs:{"show-file-list":!1,"on-success":e.handleSuccess,accept:".jpg, .jpeg, .png","before-upload":e.beforeImgUpload,"max-size":2048,multiple:"",action:e.ossUploadUrl,data:e.dataObj}},[i("p")]),e._v(" "),i("el-dialog",{attrs:{title:"插入视频",width:"500px",visible:e.dialogFormVisible,"append-to-body":""},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[i("el-form",{ref:"diologForm",attrs:{model:e.dialogForm,rules:e.dialogFormRules}},[i("el-form-item",{attrs:{label:"封面图地址","label-width":"90px"}},[i("el-upload",{staticClass:"avatar-uploader",staticStyle:{"line-height":"0",display:"inline-block"},attrs:{"show-file-list":!1,accept:".jpg, .jpeg, .png","on-success":e.handleImgSuccess,"on-error":e.handleUploadImgError,"before-upload":e.beforeImgUpload,action:e.ossUploadUrl,data:e.dataObj}},[e.dialogForm.poster?i("img",{staticClass:"avatar",attrs:{width:"300px",src:e.dialogForm.poster}}):i("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1),e._v(" "),i("el-form-item",{attrs:{label:"视频类型","label-width":"90px"}},[i("el-radio-group",{model:{value:e.formRadio,callback:function(t){e.formRadio=t},expression:"formRadio"}},[i("el-radio",{attrs:{label:1}},[e._v("外部链接")]),e._v(" "),i("el-radio",{attrs:{label:2}},[e._v("上传")])],1)],1),e._v(" "),1==e.formRadio?i("el-form-item",{attrs:{label:"视频地址","label-width":"90px",prop:"url"}},[i("el-input",{staticStyle:{width:"100%"},attrs:{autocomplete:"off"},model:{value:e.dialogForm.url,callback:function(t){e.$set(e.dialogForm,"url",t)},expression:"dialogForm.url"}})],1):e._e(),e._v(" "),2==e.formRadio?i("el-form-item",{attrs:{label:"上传视频","label-width":"90px",prop:"videoUrl"}},[i("el-upload",{directives:[{name:"loading",rawName:"v-loading",value:e.uploadLoading,expression:"uploadLoading"}],staticClass:"upload-demo",staticStyle:{display:"inline-block"},attrs:{"before-upload":e.beforeUpload,"on-success":e.handleUploadSuccess,"on-error":e.handleUploadError,"show-file-list":!1,accept:".mp4","file-list":e.fileList,"on-exceed":e.handleExceed,action:e.ossUploadUrl,data:e.dataObj}},[e.dialogForm.videoUrl?i("video",{staticStyle:{width:"120px",height:"120px"},attrs:{type:"video/mp4",preload:"auto",src:e.dialogForm.videoUrl}}):i("i",{staticClass:"el-icon-plus avatar-uploader-icon"})]),e._v(" "),i("p",{staticClass:"imageSize"},[e._v("只能上传mp4文件, 且不超过100M")])],1):e._e()],1),e._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){e.dialogFormVisible=!1}}},[e._v("取 消")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.onVideoComfirm("diologForm")}}},[e._v("确 定")])],1)],1)],1)},o=[],n=i("c80c"),r=(i("7f7f"),i("96cf"),i("3b8d")),s=(i("ac6a"),i("5f87")),l=(i("a753"),i("8096"),i("14e1"),i("9339")),c=i.n(l),u=i("953d"),d=i("3607"),p=i("7590"),h=(i("5a0c"),[["bold","italic","underline","strike"],["blockquote","code-block"],[{header:1},{header:2}],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{size:["small","middle","large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["clean"],["link","image","video"]]),g={"ql-bold":"加粗","ql-color":"颜色","ql-font":"字体","ql-code":"插入代码","ql-italic":"斜体","ql-background":"背景颜色","ql-size":"字体大小","ql-strike":"删除线","ql-script":"上标/下标","ql-underline":"下划线","ql-blockquote":"引用","ql-header":"标题","ql-indent":"缩进","ql-list":"列表","ql-align":"文本对齐","ql-direction":"文本方向","ql-code-block":"代码块","ql-formula":"公式","ql-image":"图片","ql-video":"视频","ql-clean":"清除字体样式","ql-upload":"文件"};c.a.register(p["a"],!0);var f={props:{id:"",keyWord:{type:String,default:"content"},form:{type:String},alias:{type:String,default:"myQuillEditor"},bucket_name:{type:String,default:"daya"}},name:"editor",components:{quillEditor:u["quillEditor"]},data:function(){var e=this;return{content:null,headers:{Authorization:Object(s["b"])()},dialogFormVisible:!1,dialogForm:{poster:null,url:null,videoUrl:null},uploadLoading:!1,uploadImgLoading:!1,fileList:[],dialogFormRules:{url:[{required:!0,message:"请输入视频地址",trigger:"blur"}],videoUrl:[{required:!0,message:"请上传视频",trigger:"blur"}]},formRadio:1,editorOption:{placeholder:"请输入内容",modules:{toolbar:{container:h,handlers:{image:function(t){if(t){var i,a=e.editor;e.editorIndex=(null===(i=a.getSelection())||void 0===i?void 0:i.index)||0,e.$refs.ivuUpload.$children[0].$refs.input.click()}else e.quill.format("image",!1)},video:function(t){if(t){var i;e.dialogFormVisible=!0;var a=e.editor;e.editorIndex=(null===(i=a.getSelection())||void 0===i?void 0:i.index)||0}else e.quill.format("image",!1)}}}}},ActiveEditor:null,dataObj:{policy:"",signature:"",key:"",KSSAccessKeyId:"",acl:"public-read",name:""},ossUploadUrl:"https://".concat(this.bucket_name,".ks3-cn-beijing.ksyuncs.com")}},created:function(){},mounted:function(){this},methods:{onEditorBlur:function(e){e.quill,e.html,e.text},onEditorFocus:function(e){console.log(e,this.id),this.ActiveEditor=e},onEditorChange:function(e){e.quill;var t=e.html;e.text;this.$emit("onEditorChange",t)},onVideoComfirm:function(e){var t=this;this.$refs[e].validate((function(e){if(!e)return!1;var i=t.dialogForm,a=t.editor;console.log(a,t.keyWord);var o={poster:i.poster,url:1==t.formRadio?i.url:i.videoUrl};a.insertEmbed(t.editorIndex,"video",o),a.setSelection(t.editorIndex+1,{preload:!1}),t.dialogFormVisible=!1,t.dialogForm={poster:null,url:null,videoUrl:null}}))},handleSuccess:function(e){var t=this.ActiveEditor,i=this.ossUploadUrl+"/"+this.dataObj.key;if(i){var a=t.getSelection().index||0;t.insertEmbed(a,"image",i),t.setSelection(a+1)}else this.$message.error("图片插入失败")},addQuillTitle:function(){var e=document.querySelector(".ql-toolbar"),t=e.querySelectorAll("button"),i=e.querySelectorAll("select");t.forEach((function(e){"ql-script"===e.className?"sub"===e.value?e.title="下标":e.title="上标":"ql-indent"===e.className?"+1"===e.value?e.title="向右缩进":e.title="向左缩进":e.title=g[e.classList[0]]})),i.forEach((function(e){e.parentNode.title=g[e.classList[0]]}))},handleUploadImgError:function(e){this.uploadImgLoading=!1,this.$message.error("上传失败")},handleImgSuccess:function(e,t){this.uploadImgLoading=!1;var i=this.ossUploadUrl+"/"+this.dataObj.key;this.dialogForm.poster=i},beforeImgUpload:function(){var e=Object(r["a"])(Object(n["a"])().mark((function e(t){var i,a,o,r,s,l,c;return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i={"image/png":!0,"image/jpeg":!0},a=i[t.type],o=t.size/1024/1024<2,a||this.$message.error("只能上传图片格式!"),o||this.$message.error("上传图片大小不能超过 2MB!"),a&&o&&(this.uploadImgLoading=!0),e.prev=7,r=t.name.replaceAll(" ","_"),s=(new Date).getTime()+r,l={filename:r,bucketName:this.bucket_name,postData:{filename:r,acl:"public-read",key:s,unknowValueField:[]}},e.next=13,Object(d["p"])(l);case 13:c=e.sent,this.dataObj={policy:c.data.policy,signature:c.data.signature,key:s,KSSAccessKeyId:c.data.kssAccessKeyId,acl:"public-read",name:r},e.next=21;break;case 17:return e.prev=17,e.t0=e["catch"](7),console.log(e.t0),e.abrupt("return",!1);case 21:return e.abrupt("return",a&&o);case 22:case"end":return e.stop()}}),e,this,[[7,17]])})));function t(t){return e.apply(this,arguments)}return t}(),beforeAvatarUpload:function(e){var t={"image/png":!0,"image/jpeg":!0},i=t[e.type],a=e.size/1024/1024<2;return i||this.$message.error("只能上传图片格式!"),a||this.$message.error("上传图片大小不能超过 2M!"),i&&a},beforeUpload:function(){var e=Object(r["a"])(Object(n["a"])().mark((function e(t){var i,a,o,r,s;return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=t.size/1024/1024<100,i||this.$message.error("上传视频大小不能超过 100MB!"),this.uploadLoading=!0,e.prev=3,a=t.name.replaceAll(" ","_"),o=(new Date).getTime()+a,r={filename:a,bucketName:this.bucket_name,postData:{filename:a,acl:"public-read",key:o,unknowValueField:[]}},e.next=9,Object(d["p"])(r);case 9:s=e.sent,this.dataObj={policy:s.data.policy,signature:s.data.signature,key:o,KSSAccessKeyId:s.data.kssAccessKeyId,acl:"public-read",name:a},e.next=17;break;case 13:return e.prev=13,e.t0=e["catch"](3),console.log(e.t0),e.abrupt("return",!1);case 17:return e.abrupt("return",i);case 18:case"end":return e.stop()}}),e,this,[[3,13]])})));function t(t){return e.apply(this,arguments)}return t}(),handleUploadError:function(e){this.uploadLoading=!1,this.$message.error("上传视频失败")},handleUploadSuccess:function(e,t){this.uploadLoading=!1;var i=this.ossUploadUrl+"/"+this.dataObj.key;this.dialogForm.videoUrl=i},handleExceed:function(e,t){this.$message.error("您已上传过视频")}},computed:{editor:function(){return this.$refs.myAlias.quill},ActiveEditors:function(){return console.log(this.id),this.ActiveEditor}}},m=f,b=(i("0a62"),i("2877")),v=Object(b["a"])(m,a,o,!1,null,"bb2671c6",null);t["default"]=v.exports},"0a62":function(e,t,i){"use strict";i("df45")},1062:function(e,t,i){"use strict";var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"emptWrap"},[i("div",{staticClass:"emptLeft"},[i("h2",[e._v(e._s(e.title))]),e._v(" "),i("p",[e._v(e._s(e.context))]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:e.addSome}},[e._v(e._s(e.btnTitle))])],1),e._v(" "),e._m(0)])},o=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"emptRight"},[a("div",{staticClass:"imgWrap"},[a("img",{attrs:{src:i("d3d7"),width:"100%",alt:""}})])])}],n={props:["title","btnTitle","context"],data:function(){return{}},methods:{addSome:function(){this.$emit("submit")}}},r=n,s=(i("8aff"),i("2877")),l=Object(s["a"])(r,a,o,!1,null,"2f38df2e",null);t["a"]=l.exports},"333d":function(e,t,i){"use strict";var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"pagination-container",class:{hidden:e.hidden}},[i("el-pagination",e._b({attrs:{"current-page":e.currentPage,size:"mini","page-size":e.pageSize,layout:e.layout,"page-sizes":e.pageSizes,total:e.total},on:{"update:currentPage":function(t){e.currentPage=t},"update:current-page":function(t){e.currentPage=t},"update:pageSize":function(t){e.pageSize=t},"update:page-size":function(t){e.pageSize=t},"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}},"el-pagination",e.$attrs,!1))],1)},o=[],n=(i("c5f6"),i("09f4")),r=i("ce96"),s={name:"Pagination",props:{total:{required:!0,type:Number},page:{type:Number,default:1},limit:{type:Number,default:10},pageSizes:{type:Array,default:function(){return[10,20,30,50]}},layout:{type:String,default:"total,sizes,prev, pager, next, jumper"},background:{type:Boolean,default:!0},autoScroll:{type:Boolean,default:!0},hidden:{type:Boolean,default:!1},sync:{type:Boolean,default:!1},saveKey:{type:String,default:""}},data:function(){return{pageInformation:null}},computed:{currentPage:{get:function(){return this.page},set:function(e){this.$emit("update:page",e)}},pageSize:{get:function(){return this.limit},set:function(e){this.$emit("update:limit",e)}}},watch:{currentPage:function(){this.syncStore()},pageSize:function(){this.syncStore()}},mounted:function(){if(this.sync){var e=new r["a"](this.saveKey||this.$route.path),t=e.get();if(this.pageInformation=t,t&&t.page)for(var i in t.page)if(t.page.hasOwnProperty(i)){var a=t.page[i];this.$emit("update:"+i,a)}this.saveKey&&e.update(this.$route.path,void 0,"bind")}window.addEventListener("watchStorage",this.watchStorage)},methods:{watchStorage:function(){var e=this.pageInformation&&this.pageInformation.page?this.pageInformation.page:null;this.currentPage=e&&e.page?e.page:1},syncStore:function(){if(this.sync){var e=new r["a"](this.saveKey||this.$route.path);e.update(this._props,void 0,"page")}},handleSizeChange:function(e){this.currentPage=1,this.$emit("pagination",{page:this.currentPage,limit:e}),this.autoScroll&&Object(n["a"])(0,800),this.syncStore()},handleCurrentChange:function(e){this.$emit("pagination",{page:e,limit:this.pageSize}),this.autoScroll&&Object(n["a"])(0,800),this.syncStore()}},destroyed:function(){window.removeEventListener("watchStorage",this.watchStorage)}},l=s,c=(i("cc01"),i("2877")),u=Object(c["a"])(l,a,o,!1,null,"1d2bc8a0",null);t["a"]=u.exports},3655:function(e,t,i){"use strict";var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("el-button",{attrs:{type:"primary"},on:{click:e.exportDataStart}},[e._v(e._s(e.name))]),e._v(" "),i("el-dialog",{attrs:{title:"请选择导出字段",visible:e.chioseVisiable,width:"850px"},on:{"update:visible":function(t){e.chioseVisiable=t}}},[i("div",{staticClass:"chioseWrap"},[i("el-checkbox",{attrs:{indeterminate:e.isIndeterminate},on:{change:e.handleCheckAllChange},model:{value:e.checkAll,callback:function(t){e.checkAll=t},expression:"checkAll"}},[e._v("全选")]),e._v(" "),i("div",{staticStyle:{margin:"15px 0"}}),e._v(" "),i("el-checkbox-group",{on:{change:e.handleCheckedChange},model:{value:e.checked,callback:function(t){e.checked=t},expression:"checked"}},e._l(e.chioseList,(function(t){return i("el-checkbox",{key:t,staticStyle:{"min-width":"125px","margin-bottom":"10px"},attrs:{label:t}},[e._v(e._s(t))])})),1)],1),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){e.chioseVisiable=!1}}},[e._v("取 消")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:e.exportDataStart}},[e._v("确 定")])],1)])],1)},o=[],n=i("c80c"),r=(i("96cf"),i("3b8d")),s=(i("e3eb"),i("4328"),i("829b")),l=function(e){return Object(s["a"])({url:"/api-web/export/getFields",data:e,params:e,method:"post"})},c=i("adb21"),u={props:{name:{type:String,default:"导出"},fileName:{type:String,default:"导出文件.xls"},message:{type:String,default:"您确定导出"},errorMsg:{type:String,default:"参数错误"},flag:{type:Boolean,default:!1},isDownList:{type:Boolean,default:!1},ExportEnum:{type:String},exportData:{type:Object}},data:function(){return{chioseVisiable:!1,isIndeterminate:!0,checkAll:!1,checked:[],chioseList:[]}},mounted:function(){},methods:{startExport:function(){var e=Object(r["a"])(Object(n["a"])().mark((function e(){var t;return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!this.flag){e.next=3;break}return this.$message.error(this.errorMsg),e.abrupt("return");case 3:if(this.ExportEnum){e.next=6;break}return this.$message.error("导出参数异常"),e.abrupt("return");case 6:return e.prev=6,e.next=9,l({exportEnum:this.ExportEnum});case 9:t=e.sent,this.chioseList=t.data,this.checked=t.data,this.checkAll=!0,this.isIndeterminate=!1,this.chioseVisiable=!0,e.next=20;break;case 17:e.prev=17,e.t0=e["catch"](6),console.log(e.t0);case 20:case"end":return e.stop()}}),e,this,[[6,17]])})));function t(){return e.apply(this,arguments)}return t}(),handleCheckedChange:function(e){var t=e.length;this.checkAll=t===this.chioseList.length,this.isIndeterminate=t>0&&t<this.chioseList.length},handleCheckAllChange:function(e){this.checked=e?this.chioseList:[],this.isIndeterminate=!1},exportDataStart:function(){var e=this;console.log(this.exportData),this.flag?this.$message.error(this.errorMsg):this.isDownList?Object(c["a"])(this,{url:"/api-web/export/managerDownload",fileName:this.fileName,method:"post",params:{queryInfo:this.exportData,exportEnum:this.ExportEnum,headColumns:this.checked}},this.message,(function(){e.chioseVisiable=!1})):Object(c["a"])(this,{url:"/api-web/export/now",fileName:this.fileName,method:"post",params:{queryInfo:this.exportData,exportEnum:this.ExportEnum,headColumns:this.checked}},this.message,(function(){e.chioseVisiable=!1}))}}},d=u,p=i("2877"),h=Object(p["a"])(d,a,o,!1,null,"89a203e8",null);t["a"]=h.exports},"46c4":function(e,t,i){"use strict";i("e4fb")},"641c":function(e,t,i){"use strict";var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"qrCode"},[i("el-dialog",{attrs:{title:e.title,visible:e.status,"append-to-body":"",width:"321px"},on:{"update:visible":function(t){e.status=t},close:e.onDialogClose}},[i("div",{staticClass:"left-code"},[e._t("default"),e._v(" "),i("div",{attrs:{id:"preview"}}),e._v(" "),e.codeUrl?i("p",{staticClass:"code-url"},[i("copy-text",[e._v(e._s(e.codeUrl))])],1):e._e()],2),e._v(" "),e.ispreLook?i("el-button",{staticStyle:{width:"100%"},attrs:{type:"primary"},on:{click:e.preLook}},[e._v("预 览")]):e._e(),e._v(" "),e.isDown?i("el-button",{staticStyle:{width:"100%"},attrs:{type:"primary"},on:{click:e.downImage}},[e._v("下载图片")]):e._e()],1)],1)},o=[],n=i("f2e5"),r=i("f904"),s=i.n(r),l=i("e774"),c={data:function(){return{status:!1,logo:i("9d64")}},props:{value:{type:Boolean,required:!0,default:function(){return!1}},title:{type:String,default:function(){return"查看二维码"}},codeUrl:{type:String},ispreLook:{type:Boolean,default:function(){return!1}},isDown:{type:Boolean,default:function(){return!1}}},mounted:function(){this.status=this.value},methods:{onDialogClose:function(){this.status=!1,this.$emit("input",!1)},copyUrl:function(e){s()(e),this.$message.success("复制成功")},preLook:function(){this.$emit("preLook")},downImage:function(){var e=this,t=document.getElementById("preview");Object(l["a"])(t).then((function(t){var i=new Image;i.src=t;var a=document.createElement("a"),o="二维码.png";a.href=t,a.setAttribute("download",o),document.body.appendChild(a),a.click(),e.$emit("close")})).catch((function(e){console.error("oops, something went wrong!",e)}))},resetImage:function(){var e=this,t=document.getElementById("preview").firstChild;t&&document.getElementById("preview").removeChild(t);var i=new Image;i.src=this.logo,i.width=58,i.height=58,i.onload=function(){var t=Object(n["a"])({options:{w:281,h:281},cellSize:5,data:e.codeUrl,padding:8,logo:{image:i}});document.getElementById("preview").appendChild(t)}}},watch:{value:function(e){var t=this;if(this.status=e,e){var i=new Image;i.src=this.logo,i.width=58,i.height=58,i.onload=function(){var e=Object(n["a"])({options:{w:281,h:281},cellSize:5,data:t.codeUrl,padding:8,logo:{image:i}});document.getElementById("preview").appendChild(e)}}else{var a=document.getElementById("preview").firstChild;a&&document.getElementById("preview").removeChild(a)}},title:function(e,t){e!=t&&(this.title=e)}},beforeDestroy:function(){}},u=c,d=(i("ec6b"),i("2877")),p=Object(d["a"])(u,a,o,!1,null,null,null);t["a"]=p.exports},7195:function(e,t,i){},"78b6":function(e,t,i){"use strict";i("bb59")},"85b2":function(e,t,i){},"896b":function(e,t,i){"use strict";var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"ant-upload-preview"},[i("div",{staticStyle:{width:"100%"}},[i("el-upload",{staticClass:"avatar-uploader",attrs:{accept:e.accept,"show-file-list":!1,action:e.ossUploadUrl,data:e.dataObj,"http-request":e.handleChange}},[e.isDelete&&e.imageUrl?i("i",{staticStyle:{position:"absolute",right:"-14px","font-size":"24px",top:"-14px",color:"#787878",background:"#fff"},on:{click:function(t){return t.stopPropagation(),e.onDelete(t)}}}):e._e(),e._v(" "),e.imageUrl?i("img",{staticClass:"avatar",style:e.showBox,attrs:{src:e.imageUrl}}):i("span",[e.loading?i("i",{staticClass:"el-icon-loading avatar-uploader-icon",style:e.showBox}):i("i",{staticClass:"el-icon-plus avatar-uploader-icon",style:e.showBox}),e._v(" "),i("span",{staticClass:"upload-desc"},[e._v("添加上传图片")])])])],1),e._v(" "),i("cropper-modal",{ref:"CropperModal",on:{"cropper-no":e.handleCropperClose,"cropper-ok":e.handleCropperSuccess}})],1)},o=[],n=i("db72"),r=(i("6762"),i("2fdb"),i("c80c")),s=(i("7f7f"),i("96cf"),i("3b8d")),l=i("bd86"),c=(i("c5f6"),function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{attrs:{visible:e.visible,title:e.options.title,"append-to-body":"","close-on-click-modal":!1,width:"800px"},on:{"update:visible":function(t){e.visible=t},close:e.cancelHandel}},[i("el-row",[i("el-col",{style:{height:"350px",width:"350px"},attrs:{xs:24,md:12}},[i("vue-cropper",{ref:"cropper",attrs:{img:e.options.img,info:!0,autoCrop:!0,centerBox:!1,autoCropWidth:e.options.autoCropWidth,full:e.options.full,outputType:e.options.outputType,autoCropHeight:e.options.autoCropHeight,fixedBox:e.options.fixedBox,enlarge:e.options.enlarge},on:{realTime:e.realTime}}),e._v(" "),i("div",{staticClass:"operation"},[i("i",{staticClass:"el-icon-circle-plus-outline",on:{click:function(t){return e.changeScale(1)}}}),e._v(" "),i("i",{staticClass:"el-icon-remove-outline",on:{click:function(t){return e.changeScale(-1)}}}),e._v(" "),i("i",{staticClass:"icon-rate",on:{click:e.rotateRight}})])],1),e._v(" "),i("el-col",{style:{height:"350px"},attrs:{xs:24,md:12}},[i("div",{staticClass:"previewImg"},[i("span",[e._v("预览图片")]),e._v(" "),i("div",{class:e.options.previewsCircle?"avatar-upload-preview":"avatar-upload-preview_range",style:{width:e.options.autoCropWidth+"px",height:e.options.autoCropHeight+"px"}},[i("img",{style:e.previews.img,attrs:{src:e.previews.url}})])])])],1),e._v(" "),i("template",{slot:"footer"},[i("div",{staticStyle:{"text-align":"center"}},[i("el-button",{attrs:{size:"mini"},on:{click:e.cancelHandel}},[e._v("取消")]),e._v(" "),i("el-button",{attrs:{size:"mini",type:"primary",loading:e.confirmLoading},on:{click:e.okHandel}},[e._v("保存")])],1)])],2)}),u=[],d=(i("34ef"),i("4917"),i("28a5"),i("7e79")),p=i("3607"),h={name:"CropperModal",components:{VueCropper:d["VueCropper"]},props:{},data:function(){return{visible:!1,img:null,confirmLoading:!1,options:{img:"",autoCrop:!0,autoCropWidth:180,autoCropHeight:180,fixedBox:!0,full:!1,enlarge:1,previewsCircle:!0,centerBox:!0,outputType:"png",title:"修改头像",name:null},previews:{},url:{upload:"/sys/common/saveToImgByStr"}}},methods:{edit:function(e){var t=this.options;this.visible=!0,this.options=Object.assign({},t,e)},cancelHandel:function(){this.confirmLoading=!1,this.visible=!1,this.$emit("cropper-no")},okHandel:function(){var e=this;e.confirmLoading=!0,this.$refs.cropper.getCropBlob(function(){var t=Object(s["a"])(Object(r["a"])().mark((function t(i){return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:try{e.$emit("cropper-ok",i)}catch(a){e.$message.error(a)}finally{e.cancelHandel()}case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},base64ToFile:function(e,t){var i=e.split(","),a=i[0].match(/:(.*?);/)[1],o=atob(i[1]),n=o.length,r=new Uint8Array(n);while(n--)r[n]=o.charCodeAt(n);return new File([r],t,{type:a})},blobToFile:function(e,t){return e.lastModifiedDate=new Date,e.name=t,e},realTime:function(e){this.previews=e},changeScale:function(e){e=e||1,this.$refs.cropper.changeScale(e)},rotateLeft:function(){this.$refs.cropper.rotateLeft()},rotateRight:function(){this.$refs.cropper.rotateRight()}}},g=h,f=(i("ca51"),i("2877")),m=Object(f["a"])(g,c,u,!1,null,"0befe5c4",null),b=m.exports,v=i("bc3a"),y=i.n(v),w={name:"ImageCropper",components:{CropperModal:b},props:{options:{type:Object,default:function(){return{autoCrop:!0,enlarge:1,autoCropWidth:200,autoCropHeight:200,fixedBox:!1,previewsCircle:!0,title:"上传图片"}}},showSize:{type:Boolean,default:!1},imgSize:{type:Number,default:2},isDelete:{type:Boolean,default:!1},imageUrl:{type:String,default:""},accept:{type:String,default:".png,.jpg,.jpeg,.gif"},acceptArray:{type:[Array,Object],default:function(){return["image/jpeg","image/png","image/jpg","image/gif"]}},bucket_name:{type:String,default:"daya"},disabled:{type:Boolean,default:!1}},data:function(){return Object(l["a"])({loading:!1,isStopRun:!1,info:null,ossUploadUrl:"https://".concat(this.bucket_name,".ks3-cn-beijing.ksyuncs.com"),dataObj:{policy:"",signature:"",key:"",KSSAccessKeyId:"",acl:"public-read",name:""}},"isStopRun",!1)},computed:{showBox:function(){var e={};return this.showSize&&(e={width:this.options.autoCropWidth+"px",height:this.options.autoCropHeight+"px",lineHeight:this.options.autoCropHeight+"px"}),e}},methods:{onDelete:function(){this.$emit("update:imageUrl","")},handleChange:function(){var e=Object(s["a"])(Object(r["a"])().mark((function e(t){var i,a=this;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this.info=t,!this.isStopRun){e.next=3;break}return e.abrupt("return");case 3:this.loading=!0,i=this.options,this.getBase64(t.file,(function(e){var o=Object.assign({},i,{img:e,name:t.file.name});a.$refs.CropperModal.edit(o)}));case 6:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}(),beforeUpload:function(e){this.isStopRun=!1;var t=e.type;if(t.indexOf("image")<0)return this.$message.warning("请上传图片"),this.isStopRun=!0,!1;var i=this.acceptArray.includes(e.type);i||(this.$message.error("你上传图片格式不正确!"),this.isStopRun=!0);var a=e.size<1024*this.imgSize*1024;return a||(this.$message.error("图片大小不能超过"+this.imgSize+"MB!"),this.isStopRun=!0),i&&a},handleCropperSuccess:function(){var e=Object(s["a"])(Object(r["a"])().mark((function e(t){var i,a,o,s,l,c,u,d,h,g,f=this;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=this.info,a=i.action,o=i.headers,s=i.filename,l=this.info.file.name.replaceAll(" ","_"),c=new FormData,e.prev=3,u=(new Date).getTime()+l,d={filename:l,bucketName:this.bucket_name,postData:{filename:l,acl:"public-read",key:u,unknowValueField:[]}},e.next=8,Object(p["p"])(d);case 8:for(g in h=e.sent,this.dataObj={policy:h.data.policy,signature:h.data.signature,key:u,KSSAccessKeyId:h.data.kssAccessKeyId,acl:"public-read",name:l},this.dataObj)c.append(g,this.dataObj[g]);c.append(s,t,l),y.a.post(a,c,Object(n["a"])({},o)).then((function(e){var t=f.ossUploadUrl+"/"+f.dataObj.key;if(t){var i={data:{url:t}};f.loading=!1,f.$emit("crop-upload-success",i),b.value.closeVisible()}else f.handleCropperClose()})).catch((function(e){f.handleCropperClose()})),e.next=19;break;case 15:e.prev=15,e.t0=e["catch"](3),this.handleCropperClose(),this.$message.error("上传失败");case 19:this.loading=!1;case 20:case"end":return e.stop()}}),e,this,[[3,15]])})));function t(t){return e.apply(this,arguments)}return t}(),handleCropperClose:function(){this.loading=!1,this.$emit("crop-upload-close")},getBase64:function(e,t){var i=new FileReader;i.addEventListener("load",(function(){return t(i.result)})),i.readAsDataURL(e)}}},k=w,x=(i("46c4"),Object(f["a"])(k,a,o,!1,null,"622c4c92",null));t["a"]=x.exports},"8aff":function(e,t,i){"use strict";i("7195")},afa8:function(e,t,i){},bb59:function(e,t,i){},c7f0:function(e,t,i){"use strict";var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"upload"},[i("el-upload",{directives:[{name:"loading",rawName:"v-loading",value:e.uploadImgLoading,expression:"uploadImgLoading"}],staticClass:"avatar-uploader",staticStyle:{"line-height":"0",display:"inline-block"},attrs:{action:e.ossUploadUrl,data:e.dataObj,"show-file-list":!1,accept:e.accept,"on-success":e.handleImgSuccess,"on-error":e.handleUploadImgError,"before-upload":e.beforeImgUpload}},[e.imgUrl?i("img",{staticClass:"avatar",attrs:{src:e.imgUrl}}):i("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1)},o=[],n=i("c80c"),r=(i("7f7f"),i("96cf"),i("3b8d")),s=(i("c5f6"),i("3908"),i("5f87")),l=i("3607"),c={data:function(){return{headers:{Authorization:Object(s["b"])()},uploadImgLoading:!1,imgUrl:null,ossUploadUrl:"https://".concat(this.bucket_name,".ks3-cn-beijing.ksyuncs.com"),dataObj:{policy:"",signature:"",key:"",KSSAccessKeyId:"",acl:"public-read",name:""}}},props:{value:{type:String},accept:{type:String,default:function(){return".jpg, .jpeg, .png, .gif"}},imageSizeM:{type:Number,default:function(){return 2}},imageWidthM:{type:Number,default:function(){return null}},imageHeightM:{type:Number,default:function(){return null}},imageType:{type:Object,default:function(){return{"image/png":!0,"image/jpeg":!0,"image/jpg":!0,"image/gif":!0}}},bucket_name:{type:String,default:"daya"}},mounted:function(){this.imgUrl=this.value},methods:{beforeImgUpload:function(){var e=Object(r["a"])(Object(n["a"])().mark((function e(t){var i,a,o,r,s,c,u,d,p,h,g=this;return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=this.imageType[t.type],a=t.size/1024/1024<this.imageSizeM,o=this.imageWidthM,r=this.imageHeightM,s=window.URL||window.webkitURL,c=new Promise((function(e,i){var a=new Image;a.onload=function(){o&&r?this.width===o&&this.height===r?e():i("请上传".concat(o,"x").concat(r,"尺寸图片")):o&&!r?this.width===o?e():i("请上传宽为".concat(o,"的图片")):!o&&r?this.height===r?e():i("请上传高为".concat(r,"的图片")):e()},a.src=s.createObjectURL(t)})).then((function(){return t}),(function(e){return g.$message.error(e),g.uploadImgLoading=!1,Promise.reject()})),i||this.$message.error("只能上传图片格式!"),a||this.$message.error("上传图片大小不能超过 ".concat(this.imageSizeM,"MB!")),i&&a&&c&&(this.uploadImgLoading=!0),e.prev=9,u=t.name.replaceAll(" ","_"),d=(new Date).getTime()+u,p={filename:u,bucketName:this.bucket_name,postData:{filename:u,acl:"public-read",key:d,unknowValueField:[]}},e.next=15,Object(l["p"])(p);case 15:return h=e.sent,this.dataObj={policy:h.data.policy,signature:h.data.signature,key:d,KSSAccessKeyId:h.data.kssAccessKeyId,acl:"public-read",name:u},e.abrupt("return",i&&a&&c);case 20:return e.prev=20,e.t0=e["catch"](9),console.log(e.t0),e.abrupt("return",!1);case 24:case"end":return e.stop()}}),e,this,[[9,20]])})));function t(t){return e.apply(this,arguments)}return t}(),handleUploadImgError:function(e){this.uploadImgLoading=!1,this.$message.error("上传失败")},handleImgSuccess:function(e,t){this.uploadImgLoading=!1;var i=this.ossUploadUrl+"/"+this.dataObj.key;this.imgUrl=i,this.$emit("input",i)}},watch:{value:function(e){this.imgUrl=e}},beforeDestroy:function(){}},u=c,d=(i("78b6"),i("2877")),p=Object(d["a"])(u,a,o,!1,null,"dc216590",null);t["a"]=p.exports},ca51:function(e,t,i){"use strict";i("85b2")},cc01:function(e,t,i){"use strict";i("f6f9")},d3d7:function(e,t,i){e.exports=i.p+"static/img/emptyPage_bg.0a9eb319.png"},ddec:function(e,t,i){"use strict";i("7f7f");var a=i("ca45");a["a"].install=function(e){return e.component(a["a"].name,a["a"])},t["a"]=a["a"]},df45:function(e,t,i){},e4fb:function(e,t,i){},ec6b:function(e,t,i){"use strict";i("afa8")},f6f9:function(e,t,i){}}]);