| 1234567 |
- var le=Object.defineProperty,ne=Object.defineProperties;var he=Object.getOwnPropertyDescriptors;var W=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var D=(e,t,s)=>t in e?le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,R=(e,t)=>{for(var s in t||(t={}))F.call(t,s)&&D(e,s,t[s]);if(W)for(var s of W(t))K.call(t,s)&&D(e,s,t[s]);return e},z=(e,t)=>ne(e,he(t));var P=(e,t)=>{var s={};for(var i in e)F.call(e,i)&&t.indexOf(i)<0&&(s[i]=e[i]);if(e!=null&&W)for(var i of W(e))t.indexOf(i)<0&&K.call(e,i)&&(s[i]=e[i]);return s};import{C as ce}from"./index.931a3777.js";import{d as I,bb as E,b as k,c as a,M as y,r as pe,b9 as ue,bA as T,a as b,E as S,b7 as _,b8 as x,am as V,bd as H,be as O,L as B,bf as ee,aJ as te,t as X,v as q,U as j,V as G,x as w,H as Y,G as N,z as de,a7 as Q,bU as Ae,bV as ge,bW as fe,aw as me,ay as ve,az as Z,F as se}from"./index.0153c912.js";import{E as be,a as ie,C as we,i as Ce}from"./index.93c6cf67.js";import{i as Le}from"./icon_teacher.c6352c6e.js";import{E as xe}from"./index2.5ee1afd3.js";import{v as ye}from"./toolsValidate.add49407.js";import{E as Ee,a as Se}from"./index2.ba6b47c6.js";import{E as Ie,b as Ue}from"./index2.90bf5c1c.js";import"./index2.81c01d49.js";const ke="_uploadSection_1p3wv_1",Me="_uploadFile_1p3wv_11",Te="_fileUpload_1p3wv_25",Be="_uploadClass_1p3wv_25",Oe="_disabled_1p3wv_48";var M={uploadSection:ke,uploadFile:Me,fileUpload:Te,uploadClass:Be,disabled:Oe},We="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAAyCAMAAAAz3ZgNAAAAAXNSR0IArs4c6QAAAX1QTFRFAAAAAP8AAP//AP+AAP//AKqqVaqqVf+qAL+AJNu2IL+fM8yZM8yzL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nzj2EfuTge9ZZbaseCyMml/PM/xOfOfsRbUvquxfKVhwNkDflJucXHAXJHhZm9KOblAOb2thzg55H5XX6vgzcp+Z4OXqHkOg5ml8lKruNYOEg7JPew6m0T9ZDteGXSGzkxDunaB/LQ1aItjkY/AA/7Wc4JL6xFAAAAAElFTkSuQmCC",J=I({name:"col-upload-video",props:{modelValue:{type:String,default:""},disabled:{type:Boolean,default:!1},bucket:{type:String,default:"daya"},multiple:{type:Boolean,default:!1},limit:{type:Number,default:1},size:{type:Number,default:50},accept:{type:String,default:".mp4"},tips:{type:String,default:"\u8BF7\u4E0A\u4F20\u89C6\u9891"},extraTips:{type:String,default:"\u89C6\u9891\u6700\u5927\u4E0D\u80FD\u8D85\u8FC750MB"},multipleModel:{type:Function,default:e=>{}}},data(){return{ossUploadUrl:"https://ks3-cn-beijing.ksyuncs.com/"+this.bucket,dataObj:{policy:"",signature:"",key:"",KSSAccessKeyId:"",acl:"public-read",name:""},fileList:[],tempUrls:{},responseList:[],btnLoading:!1,loading:null}},methods:{handleSuccess(e,t,s){var i;if((i=this.loading)==null||i.close(),console.log(this.fileList,"fileList"),console.log(e,t,s,"response"),this.multiple)t.status==="success"&&this.responseList.push(this.tempUrls[t.uid]),s.length===this.responseList.length&&(this.btnLoading=!1,this.multipleModel(this.responseList));else{let o=this.ossUploadUrl+"/"+this.dataObj.key;this.$emit("update:modelValue",o)}},handleRemove(){console.log("remove")},handleChange(){console.log("handleChange")},handleProgress(e){console.log("handleProgress",e)},handleError(){var e;this.btnLoading=!1,(e=this.loading)==null||e.close()},async beforeUpload(e){var s;console.log(e);let t=!0;if(this.size&&(t=e.size/1024/1024<this.size,!t))return E.error(`\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7${this.size}M!`),!1;this.multiple?this.btnLoading=!0:this.loading=be.service({target:this.$refs.uploadDom,lock:!0,fullscreen:!1,text:"\u4E0A\u4F20\u4E2D...",background:"rgba(0, 0, 0, 0.7)"});try{let i=e.name.replaceAll(" ","_"),o=new Date().getTime()+i,r={filename:i,bucketName:this.bucket,postData:{filename:i,acl:"public-read",key:o,unknowValueField:[]}};const{data:l}=await k.post("/api-website/getUploadSign",{data:r});this.dataObj={policy:l.policy,signature:l.signature,key:o,KSSAccessKeyId:l.kssAccessKeyId,acl:"public-read",name:i},this.tempUrls[e.uid]=this.ossUploadUrl+"/"+this.dataObj.key}catch{this.btnLoading=!1,(s=this.loading)==null||s.close()}},fileName(e=""){return e.split("/").pop()},handleExceed(e){if(e.length>this.limit)return E.error(`\u4E00\u6B21\u6027\u6700\u591A\u53EA\u80FD\u4E0A\u4F20${this.limit}\u4E2A\u6587\u4EF6`),!1}},render(){return a("div",{class:[M.colUpload,"w-full"]},[a(ie,{disabled:this.disabled,action:this.ossUploadUrl,data:this.dataObj,onSuccess:this.handleSuccess,onRemove:this.handleRemove,onChange:this.handleChange,onProgress:this.handleProgress,onError:this.handleError,fileList:this.fileList,showFileList:!1,accept:this.accept,beforeUpload:this.beforeUpload,onExceed:this.handleExceed,ref:"uploadRef",multiple:this.multiple,limit:this.limit,class:[this.multiple&&M.fileUpload,this.disabled&&M.disabled]},{default:()=>[a("div",{ref:"uploadDom",class:[M.uploadClass,"w-full"],style:{height:this.multiple?"40px":"106px"}},[this.modelValue?a("video",{ref:"videoUpload",crossorigin:"anonymous",class:M.uploadSection,src:this.modelValue},null):this.multiple?a(y,{size:"large",type:"primary",loading:this.btnLoading},{default:()=>[this.btnLoading?"\u4E0A\u4F20\u4E2D...":"\u70B9\u51FB\u4E0A\u4F20"]}):a("div",{class:[M.uploadSection,"flex items-center flex-col justify-center"]},[a("img",{src:We,class:"w-8 h-7 mb-3"},null),a("p",null,[this.tips])])])]}),!this.multiple&&a("p",{class:"text-3 text-[#999999] leading-6 pt-1"},[this.extraTips])])}});const oe=()=>({groupId:0,active:0,tabIndex:1,loadingStatus:!1,rate:0,subjectList:[],templateList:["https://daya.ks3-cn-beijing.ksyun.com/202204/T3unJdc.png","https://daya.ks3-cn-beijing.ksyun.com/202204/T3unJdl.png","https://daya.ks3-cn-beijing.ksyun.com/202204/T3unJdK.png","https://daya.ks3-cn-beijing.ksyun.com/202204/T3unJeA.png"],lessonGroup:{id:null,lessonName:"",lessonSubject:null,lessonDesc:"",lessonPrice:null,lessonCoverUrl:"",lessonCoverTemplateUrl:""},lessonList:[]}),h=pe(oe()),Xe=()=>{Object.assign(h,oe())},qe="_createSubmit_1kqna_7",Ye="_introduction_1kqna_7",Ve="_userDetail_1kqna_12",Ne="_banner_1kqna_12",He="_userInfo_1kqna_18",De="_avatar_1kqna_24",Fe="_name_1kqna_30",Ke="_buyNum_1kqna_39",Re="_buyNumInfo_1kqna_53",ze="_iconBuy_1kqna_59",Pe="_info_1kqna_62",je="_userTitle_1kqna_68",Ge="_videoImg_1kqna_74",Qe="_videoStop_1kqna_81",Ze="_videoTitle_1kqna_93",Je="_videoTitleText_1kqna_101",$e="_videoTitleContent_1kqna_106";var C={"course-preview":"_course-preview_1kqna_1",createSubmit:qe,introduction:Ye,userDetail:Ve,banner:Ne,userInfo:He,avatar:De,name:Fe,buyNum:Ke,buyNumInfo:Re,iconBuy:ze,info:Pe,userTitle:je,videoImg:Ge,videoStop:Qe,videoTitle:Ze,videoTitleText:Je,videoTitleContent:$e},_e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAAXNSR0IArs4c6QAAAMxQTFRFAAAA/wAA/4AA/1VV/4BA/3hL/3lR/3lJ/3tM/3lK/3ZJ/3VL/3dK/3hM/3dL/3ZL/3lL/3dK/3hL/3dK/3hM/3hM/3ZN/3lK/3dM/3ZL/3dK/3hL/3dL/3hK/3ZM/3dK/3ZL/3ZK/3dL/3dL/3ZL/3dM/3dL/3dM/3dL/3dL/72U/7yT/7yU/3dM/3dL/3ZK/3dM/3hL/3dM/3dL/3dL/3dL/3dK/3dL/3dL/3dK/3dL/3dL/3dL/3hL/3ZK/3dL/3dL/3dL/3dL/7yT8tV7KQA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qJY+5jJInOsPQa/jGi8sTEeNfD//AORQWsF93/GiwAAAABJRU5ErkJggg==",st=I({name:"course-preview",computed:{userInfo(){const e=h.lessonGroup,t=ue.user.data||{};return{id:t.id,username:t.username||`\u6E38\u5BA2${t.id||""}`,headUrl:t.headUrl,lessonName:e.lessonName,buyNum:0,lessonDesc:e.lessonDesc,lessonPrice:e.lessonPrice,lessonCoverUrl:e.lessonCoverTemplateUrl||e.lessonCoverUrl,lessonNum:h.lessonList.length}},lessonList(){return h.lessonList||[]}},render(){return a("div",{class:[C["course-preview"],"pb-3"]},[a("div",{class:C.userDetail},[a(T,{class:[C.banner],src:this.userInfo.lessonCoverUrl,fit:"cover"},null),a("div",{class:"bg-white"},[a("div",{class:"p-[14px] text-lg text-[#1a1a1a] font-medium leading-none"},[b("\u6807\u9898")]),a("div",{class:[C.userInfo,"mx-[14px] py-[14px]"]},[a("div",{class:"flex"},[a(T,{class:C.avatar,src:this.userInfo.headUrl||Le,fit:""},null),a("div",{class:C.name},[this.userInfo.username||`\u6E38\u5BA2${this.userInfo.id||""}`,a("div",{class:C.buyNum},[this.userInfo.buyNum,b("\u4EBA\u5DF2\u8D2D\u4E70")])])]),a("div",{class:C.info},[b("\uFFE5"),this.userInfo.lessonPrice,b("/"),this.userInfo.lessonNum,b("\u8BFE\u65F6")])])])]),a("div",{class:[C["section-detail"],"mt-[10px] mx-[14px] rounded-lg bg-white"]},[a("div",{class:"flex items-center py-3 px-[10px] text-[#333333] text-base"},[a(S,{size:18,class:"mr-2"},{default:()=>[a("img",{src:_e},null)]}),b("\u8BFE\u7A0B\u4ECB\u7ECD")]),a("div",{class:"mx-[10px] pt-[10px] pb-4 text-sm text-[#7A7A7A] border-t border-t-[#EBEBEB]"},[this.userInfo.lessonDesc])]),a("div",{class:[C["section-detail"],"mt-[10px] mx-[14px] rounded-lg bg-white"]},[a("div",{class:"flex items-center py-3 px-[10px] text-[#333333] text-base"},[a(S,{size:18,class:"mr-2"},{default:()=>[a("img",{src:et},null)]}),b("\u8BFE\u7A0B\u5217\u8868")]),a("div",{class:"mx-[10px] pt-[10px] pb-4 text-sm text-[#7A7A7A] border-t border-t-[#EBEBEB] flex flex-col"},[h.lessonList.map(e=>a("div",{class:"flex mb-3"},[a("div",{class:C.videoImg},[a(T,{class:"align-middle h-[70px] w-[100px]",src:e.coverUrl,fit:"cover"},null),a(S,{class:C.videoStop,size:26},{default:()=>[a("img",{src:tt},null)]})]),a("div",{class:[C.videoTitle,"!h-[70px]"]},[a("p",{class:[C.videoTitleText,"whitespace-nowrap overflow-hidden text-ellipsis"]},[e.videoTitle]),a("p",{class:[C.videoTitleContent]},[e.videoContent])])]))])])])}});const it="_courseContent_ca6ve_1";var ot={courseContent:it},rt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADoAAAA6CAMAAADWZboaAAAAAXNSR0IArs4c6QAAAKtQTFRFAAAA////////9vb28/Pz9PT09PT08/Pz8/Pz8/Pz9PT0DQ0NDg4ODw8PERERExMTFRUVFxcXGBgYGxsbHh4eICAgISEhJCQkQUFBRERER0dHS0tLTExMTk5OVVVVXFxcYWFhjY2Nk5OTlZWVlpaWmJiYmZmZnZ2dpaWlrKyss7Ozubm5v7+/xcXFysrKzc3N19fX2NjY5eXl6Ojo6+vr7e3t7u7u7+/v8/PzuMr56AAAAAt0Uk5TAAIFUVWKpNjc8v4WawkrAAABMklEQVRIx+3Xt3LDMBBF0RWDGC6Vc7ICZeVgK9j8/y9zISsV1oBA44KvYIM5DbGYeSsiImI5eS9IlBJ4eceSW2w/SRXf/oU5N0xSJnRzIiLiJhpxRUTsUIeGtojlJ1rxLXESzTiS16V58XSpJ4EuDeTV6bTZnP59+oruIoh2WnQGMNOiMUCc0YxmNKP/gn70G6PDMz2MGv1PBdoD2sdHemwDPQVaAeie7vTUBago0A4Ag/OVngcAdBTovg7A2/eFfr0BUN+r/OFtDYDhBGAyBKC2VbucTRWA1u1DdaN6r+syTymv1UdiVXqUpVWaaVoW77K4TDeIi8JVFhZp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0Uk5TAAIFUVWKpNjc8v4WawkrAAABBElEQVRIx+2XUQ6DIAxAq6KoExHd4P43HbppnNKAVLMf3w9Jw4uVlLQAjKSs4JUJouIFS2EhK80hyuwrJnltDlLnyaTmJoJ8yraOUWubc1qaKMoUmImEQRGrFsCd8V48vogeUTm4K2ExrYvVBphY1SBqQMKYGsI5ar/6QTe/yYPzaFD3fJWQ8H9O+JO0uwRccdgVoEAKU3jU8TDWX5nXOR6gzl+Z1wMqtt7qrd7qRZeOcNW3XKs2dsuwNwcbbjyqtHu6nTt0Niw9qsK7hvKousXMVvsaxxNx25e/52glm63XSKUdPaeK7VYVMnIFwCmDHmG8JAy1hFGaMsBTng2Ex0rsE+kNjFEHody3dJ8AAAAASUVORK5CYII=",nt=I({name:"course-content",data(){return{show:!1,form:{lessonList:[{key:1,videoTitle:"",videoContent:"",videoUrl:"",coverUrl:""}]}}},methods:{handleUpload(e){console.log(e),(e||[]).forEach(s=>{h.lessonList.push({videoTitle:"",videoContent:"",videoUrl:s,coverUrl:""})})},handleSubmit(){this.$refs.form.validate(async e=>{if(e){if(h.lessonList.length<=0){E.error("\u8BF7\u4E0A\u4F20\u8BFE\u7A0B\u89C6\u9891");return}console.log("\u63D0\u4EA4\u6570\u636E"),this.show=!0}else return this.$nextTick(()=>{document.getElementsByClassName("is-error")[0].scrollIntoView({block:"center",behavior:"smooth"})}),!1})},async createSubmit(){try{const e=h.lessonGroup;let t={lessonList:h.lessonList,lessonGroup:z(R({},e),{lessonCoverUrl:e.lessonCoverTemplateUrl||e.lessonCoverUrl})};h.groupId?(await k.post("/api-website/videoLessonGroup/update",{data:t}),E.success("\u4FEE\u6539\u6210\u529F")):(await k.post("/api-website/videoLessonGroup/add",{data:t}),E.success("\u521B\u5EFA\u6210\u529F")),sessionStorage.setItem("videoActiveName","DOING"),this.$router.back()}catch{}},swapItems(e,t,s){return e[t]=e.splice(s,1,e[t])[0],e}},render(){return a("div",{class:ot.courseContent},[a(_,{class:"px-[140px] pb-10 pt-7 min-h-[280px]",size:"large",labelWidth:"90px",labelPosition:"left",ref:"form",model:h},{default:()=>[a(x,{label:"\u8BFE\u7A0B\u89C6\u9891",required:!0},{default:()=>[a(J,{multiple:!0,limit:3,bucket:"video-course",multipleModel:e=>{this.handleUpload(e)}},null)]}),h.lessonList.map((e,t)=>a("div",{class:"p-4 pt-5 rounded-xl mb-3 border border-dashed border-gray-300 relative",key:e.key},[a("div",{class:"absolute right-4 top-4 z-10 flex"},[t!==0&&a(V,{class:"box-item",effect:"dark",content:"\u4E0A\u79FB",placement:"top"},{default:()=>[a("div",{onClick:()=>{this.swapItems(h.lessonList,t,t-1)}},[a(S,{size:29},{default:()=>[a("img",{src:at},null)]})])]}),h.lessonList.length-1!==t&&a(V,{class:"box-item",effect:"dark",content:"\u4E0B\u79FB",placement:"top"},{default:()=>[a("div",{onClick:()=>{this.swapItems(h.lessonList,t,t+1)}},[a(S,{size:29,class:"ml-3"},{default:()=>[a("img",{src:rt,title:"\u5411\u4E0B\u79FB\u52A8"},null)]})])]}),h.lessonList.length>1&&a(V,{class:"box-item",effect:"dark",content:"\u5220\u9664",placement:"top"},{default:()=>[a("div",{onClick:()=>{xe.confirm("\u786E\u5B9A\u5220\u9664\u8BE5\u6761\u6570\u636E\u5417\uFF1F","\u63D0\u793A",{type:"warning"}).then(()=>{h.lessonList.splice(t,1)})}},[a(S,{size:29,class:"ml-3"},{default:()=>[a("img",{src:lt},null)]})])]})]),a(H,null,{default:()=>[a(O,{span:10},{default:()=>[a(x,{label:`\u7B2C${t+1}\u8BFE`},{default:()=>[a(J,{modelValue:e.videoUrl,"onUpdate:modelValue":s=>e.videoUrl=s,disabled:!0},null)]})]}),a(O,{span:10},{default:()=>[a(x,{label:"\u89C6\u9891\u5C01\u9762",prop:`lessonList.${t}.coverUrl`,rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u89C6\u9891\u5C01\u9762"}]},{default:()=>[a(we,{modelValue:e.coverUrl,"onUpdate:modelValue":s=>e.coverUrl=s},null)]})]})]}),a(x,{label:"\u8BFE\u7A0B\u6807\u9898",prop:`lessonList.${t}.videoTitle`,rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u6807\u9898"}]},{default:()=>[a(B,{placeholder:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u6807\u9898",modelValue:e.videoTitle,"onUpdate:modelValue":s=>e.videoTitle=s},null)]}),a(x,{label:"\u8BFE\u7A0B\u4ECB\u7ECD",prop:`lessonList.${t}.videoContent`,rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u4ECB\u7ECD"}]},{default:()=>[a(B,{placeholder:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u4ECB\u7ECD",modelValue:e.videoContent,"onUpdate:modelValue":s=>e.videoContent=s,type:"textarea",maxlength:200,rows:4,showWordLimit:!0},null)]})]))]}),a("div",{class:"border-t border-t-[#E5E5E5] text-center pt-6 pb-7"},[a(y,{class:"!w-40 !h-[38px]",onClick:()=>{h.active=0;const e=document.documentElement.scrollTop||document.body.scrollTop;ee(e,0)}},{default:()=>[b("\u4E0A\u4E00\u6B65")]}),a(y,{type:"primary",class:"!w-40 !h-[38px]",onClick:this.handleSubmit},{default:()=>[b("\u4E0B\u4E00\u6B65")]})]),a(te,{modelValue:this.show,"onUpdate:modelValue":e=>this.show=e,title:"\u9884\u89C8"},{default:()=>[a(st,null,null)],footer:()=>a("span",{class:"dialog-footer !text-center block "},[a(y,{size:"large",round:!0,onClick:()=>{this.show=!1}},{default:()=>[b("\u8FD4\u56DE\u7F16\u8F91")]}),a(y,{size:"large",round:!0,type:"primary",onClick:this.createSubmit},{default:()=>[b("\u521B\u5EFA\u5B8C\u6210")]})])})])}});const ht="_uploadSection_1scl2_1",ct="_uploadClass_1scl2_11",pt="_previewImg_1scl2_34",ut="_operation_1scl2_44";var U={uploadSection:ht,uploadClass:ct,"avatar-upload-preview_range":"_avatar-upload-preview_range_1scl2_19","avatar-upload-preview":"_avatar-upload-preview_1scl2_19",previewImg:pt,operation:ut,"icon-rate":"_icon-rate_1scl2_54","vue-cropper":"_vue-cropper_1scl2_61","el-dialog":"_el-dialog_1scl2_65","el-dialog__header":"_el-dialog__header_1scl2_68","el-dialog__title":"_el-dialog__title_1scl2_72","el-dialog__headerbtn":"_el-dialog__headerbtn_1scl2_75","el-dialog__close":"_el-dialog__close_1scl2_75","el-dialog__body":"_el-dialog__body_1scl2_78"};const re={};re.getData=e=>new Promise((t,s)=>{let i={};dt(e).then(o=>{i.arrayBuffer=o,i.orientation=mt(o),t(i)}).catch(o=>{s(o)})});function dt(e){let t=null;return new Promise((s,i)=>{if(e.src)if(/^data\:/i.test(e.src))t=gt(e.src),s(t);else if(/^blob\:/i.test(e.src)){var o=new FileReader;o.onload=function(l){t=l.target.result,s(t)},At(e.src,function(l){o.readAsArrayBuffer(l)})}else{var r=new XMLHttpRequest;r.onload=function(){if(this.status==200||this.status===0)t=r.response,s(t);else throw"Could not load image";r=null},r.open("GET",e.src,!0),r.responseType="arraybuffer",r.send(null)}else i("img error")})}function At(e,t){var s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="blob",s.onload=function(i){(this.status==200||this.status===0)&&t(this.response)},s.send()}function gt(e){e=e.replace(/^data\:([^\;]+)\;base64,/gmi,"");for(var t=atob(e),s=t.length,i=new ArrayBuffer(s),o=new Uint8Array(i),r=0;r<s;r++)o[r]=t.charCodeAt(r);return i}function ft(e,t,s){var i="",o;for(o=t,s+=t;o<s;o++)i+=String.fromCharCode(e.getUint8(o));return i}function mt(e){var t=new DataView(e),s=t.byteLength,i,o,r,l,n,c,u,p,d,A;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(d=2;d<s;){if(t.getUint8(d)===255&&t.getUint8(d+1)===225){u=d;break}d++}if(u&&(o=u+4,r=u+10,ft(t,o,4)==="Exif"&&(c=t.getUint16(r),n=c===18761,(n||c===19789)&&t.getUint16(r+2,n)===42&&(l=t.getUint32(r+4,n),l>=8&&(p=r+l)))),p){for(s=t.getUint16(p,n),A=0;A<s;A++)if(d=p+A*12+2,t.getUint16(d,n)===274){d+=8,i=t.getUint16(d,n);break}}return i}var vt=(e,t)=>{const s=e.__vccOpts||e;for(const[i,o]of t)s[i]=o;return s};const bt=I({data:function(){return{w:0,h:0,scale:1,x:0,y:0,loading:!0,trueWidth:0,trueHeight:0,move:!0,moveX:0,moveY:0,crop:!1,cropping:!1,cropW:0,cropH:0,cropOldW:0,cropOldH:0,canChangeX:!1,canChangeY:!1,changeCropTypeX:1,changeCropTypeY:1,cropX:0,cropY:0,cropChangeX:0,cropChangeY:0,cropOffsertX:0,cropOffsertY:0,support:"",touches:[],touchNow:!1,rotate:0,isIos:!1,orientation:0,imgs:"",coe:.2,scaling:!1,scalingSet:"",coeStatus:"",isCanShow:!0}},props:{img:{type:[String,Blob,null,File],default:""},outputSize:{type:Number,default:1},outputType:{type:String,default:"jpeg"},info:{type:Boolean,default:!0},canScale:{type:Boolean,default:!0},autoCrop:{type:Boolean,default:!1},autoCropWidth:{type:[Number,String],default:0},autoCropHeight:{type:[Number,String],default:0},fixed:{type:Boolean,default:!1},fixedNumber:{type:Array,default:()=>[1,1]},fixedBox:{type:Boolean,default:!1},full:{type:Boolean,default:!1},canMove:{type:Boolean,default:!0},canMoveBox:{type:Boolean,default:!0},original:{type:Boolean,default:!1},centerBox:{type:Boolean,default:!1},high:{type:Boolean,default:!0},infoTrue:{type:Boolean,default:!1},maxImgSize:{type:[Number,String],default:2e3},enlarge:{type:[Number,String],default:1},preW:{type:[Number,String],default:0},mode:{type:String,default:"contain"},limitMinSize:{type:[Number,Array,String],default:()=>10}},computed:{cropInfo(){let e={};if(e.top=this.cropOffsertY>21?"-21px":"0px",e.width=this.cropW>0?this.cropW:0,e.height=this.cropH>0?this.cropH:0,this.infoTrue){let t=1;this.high&&!this.full&&(t=window.devicePixelRatio),this.enlarge!==1&!this.full&&(t=Math.abs(Number(this.enlarge))),e.width=e.width*t,e.height=e.height*t,this.full&&(e.width=e.width/this.scale,e.height=e.height/this.scale)}return e.width=e.width.toFixed(0),e.height=e.height.toFixed(0),e},isIE(){return!!window.ActiveXObject||"ActiveXObject"in window},passive(){return this.isIE?null:{passive:!1}}},watch:{img(){this.checkedImg()},imgs(e){e!==""&&this.reload()},cropW(){this.showPreview()},cropH(){this.showPreview()},cropOffsertX(){this.showPreview()},cropOffsertY(){this.showPreview()},scale(e,t){this.showPreview()},x(){this.showPreview()},y(){this.showPreview()},autoCrop(e){e&&this.goAutoCrop()},autoCropWidth(){this.autoCrop&&this.goAutoCrop()},autoCropHeight(){this.autoCrop&&this.goAutoCrop()},mode(){this.checkedImg()},rotate(){this.showPreview(),this.autoCrop?this.goAutoCrop(this.cropW,this.cropH):(this.cropW>0||this.cropH>0)&&this.goAutoCrop(this.cropW,this.cropH)}},methods:{getVersion(e){var t=navigator.userAgent.split(" "),s="";let i=0;const o=new RegExp(e,"i");for(var r=0;r<t.length;r++)o.test(t[r])&&(s=t[r]);return s?i=s.split("/")[1].split("."):i=["0","0","0"],i},checkOrientationImage(e,t,s,i){if(this.getVersion("chrome")[0]>=81)t=-1;else if(this.getVersion("safari")[0]>=605){const l=this.getVersion("version");l[0]>13&&l[1]>1&&(t=-1)}else{const l=navigator.userAgent.toLowerCase().match(/cpu iphone os (.*?) like mac os/);if(l){let n=l[1];n=n.split("_"),(n[0]>13||n[0]>=13&&n[1]>=4)&&(t=-1)}}let o=document.createElement("canvas"),r=o.getContext("2d");switch(r.save(),t){case 2:o.width=s,o.height=i,r.translate(s,0),r.scale(-1,1);break;case 3:o.width=s,o.height=i,r.translate(s/2,i/2),r.rotate(180*Math.PI/180),r.translate(-s/2,-i/2);break;case 4:o.width=s,o.height=i,r.translate(0,i),r.scale(1,-1);break;case 5:o.height=s,o.width=i,r.rotate(.5*Math.PI),r.scale(1,-1);break;case 6:o.width=i,o.height=s,r.translate(i/2,s/2),r.rotate(90*Math.PI/180),r.translate(-s/2,-i/2);break;case 7:o.height=s,o.width=i,r.rotate(.5*Math.PI),r.translate(s,-i),r.scale(-1,1);break;case 8:o.height=s,o.width=i,r.translate(i/2,s/2),r.rotate(-90*Math.PI/180),r.translate(-s/2,-i/2);break;default:o.width=s,o.height=i}r.drawImage(e,0,0,s,i),r.restore(),o.toBlob(l=>{let n=URL.createObjectURL(l);URL.revokeObjectURL(this.imgs),this.imgs=n},"image/"+this.outputType,1)},checkedImg(){if(this.img===null||this.img===""){this.imgs="",this.clearCrop();return}this.loading=!0,this.scale=1,this.rotate=0,this.clearCrop();let e=new Image;if(e.onload=()=>{if(this.img==="")return this.$emit("img-load","error"),!1;let s=e.width,i=e.height;re.getData(e).then(o=>{this.orientation=o.orientation||1;let r=Number(this.maxImgSize);if(!this.orientation&&s<r&i<r){this.imgs=this.img;return}s>r&&(i=i/s*r,s=r),i>r&&(s=s/i*r,i=r),this.checkOrientationImage(e,this.orientation,s,i)})},e.onerror=()=>{this.$emit("img-load","error")},this.img.substr(0,4)!=="data"&&(e.crossOrigin=""),this.isIE){var t=new XMLHttpRequest;t.onload=function(){var s=URL.createObjectURL(this.response);e.src=s},t.open("GET",this.img,!0),t.responseType="blob",t.send()}else e.src=this.img},startMove(e){if(e.preventDefault(),this.move&&!this.crop){if(!this.canMove)return!1;this.moveX=("clientX"in e?e.clientX:e.touches[0].clientX)-this.x,this.moveY=("clientY"in e?e.clientY:e.touches[0].clientY)-this.y,e.touches?(window.addEventListener("touchmove",this.moveImg),window.addEventListener("touchend",this.leaveImg),e.touches.length==2&&(this.touches=e.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale))):(window.addEventListener("mousemove",this.moveImg),window.addEventListener("mouseup",this.leaveImg)),this.$emit("imgMoving",{moving:!0,axis:this.getImgAxis()}),this.$emit("img-moving",{moving:!0,axis:this.getImgAxis()})}else this.cropping=!0,window.addEventListener("mousemove",this.createCrop),window.addEventListener("mouseup",this.endCrop),window.addEventListener("touchmove",this.createCrop),window.addEventListener("touchend",this.endCrop),this.cropOffsertX=e.offsetX?e.offsetX:e.touches[0].pageX-this.$refs.cropper.offsetLeft,this.cropOffsertY=e.offsetY?e.offsetY:e.touches[0].pageY-this.$refs.cropper.offsetTop,this.cropX="clientX"in e?e.clientX:e.touches[0].clientX,this.cropY="clientY"in e?e.clientY:e.touches[0].clientY,this.cropChangeX=this.cropOffsertX,this.cropChangeY=this.cropOffsertY,this.cropW=0,this.cropH=0},touchScale(e){e.preventDefault();let t=this.scale;var s={x:this.touches[0].clientX,y:this.touches[0].clientY},i={x:e.touches[0].clientX,y:e.touches[0].clientY},o={x:this.touches[1].clientX,y:this.touches[1].clientY},r={x:e.touches[1].clientX,y:e.touches[1].clientY},l=Math.sqrt(Math.pow(s.x-o.x,2)+Math.pow(s.y-o.y,2)),n=Math.sqrt(Math.pow(i.x-r.x,2)+Math.pow(i.y-r.y,2)),c=n-l,u=1;u=u/this.trueWidth>u/this.trueHeight?u/this.trueHeight:u/this.trueWidth,u=u>.1?.1:u;var p=u*c;if(!this.touchNow){if(this.touchNow=!0,c>0?t+=Math.abs(p):c<0&&t>Math.abs(p)&&(t-=Math.abs(p)),this.touches=e.touches,setTimeout(()=>{this.touchNow=!1},8),!this.checkoutImgAxis(this.x,this.y,t))return!1;this.scale=t}},cancelTouchScale(e){window.removeEventListener("touchmove",this.touchScale)},moveImg(e){if(e.preventDefault(),e.touches&&e.touches.length===2)return this.touches=e.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale),window.removeEventListener("touchmove",this.moveImg),!1;let t="clientX"in e?e.clientX:e.touches[0].clientX,s="clientY"in e?e.clientY:e.touches[0].clientY,i,o;i=t-this.moveX,o=s-this.moveY,this.$nextTick(()=>{if(this.centerBox){let r=this.getImgAxis(i,o,this.scale),l=this.getCropAxis(),n=this.trueHeight*this.scale,c=this.trueWidth*this.scale,u,p,d,A;switch(this.rotate){case 1:case-1:case 3:case-3:u=this.cropOffsertX-this.trueWidth*(1-this.scale)/2+(n-c)/2,p=this.cropOffsertY-this.trueHeight*(1-this.scale)/2+(c-n)/2,d=u-n+this.cropW,A=p-c+this.cropH;break;default:u=this.cropOffsertX-this.trueWidth*(1-this.scale)/2,p=this.cropOffsertY-this.trueHeight*(1-this.scale)/2,d=u-c+this.cropW,A=p-n+this.cropH;break}r.x1>=l.x1&&(i=u),r.y1>=l.y1&&(o=p),r.x2<=l.x2&&(i=d),r.y2<=l.y2&&(o=A)}this.x=i,this.y=o,this.$emit("imgMoving",{moving:!0,axis:this.getImgAxis()}),this.$emit("img-moving",{moving:!0,axis:this.getImgAxis()})})},leaveImg(e){window.removeEventListener("mousemove",this.moveImg),window.removeEventListener("touchmove",this.moveImg),window.removeEventListener("mouseup",this.leaveImg),window.removeEventListener("touchend",this.leaveImg),this.$emit("imgMoving",{moving:!1,axis:this.getImgAxis()}),this.$emit("img-moving",{moving:!1,axis:this.getImgAxis()})},scaleImg(){this.canScale&&window.addEventListener(this.support,this.changeSize,this.passive)},cancelScale(){this.canScale&&window.removeEventListener(this.support,this.changeSize)},changeSize(e){e.preventDefault();let t=this.scale;var s=e.deltaY||e.wheelDelta,i=navigator.userAgent.indexOf("Firefox");s=i>0?s*30:s,this.isIE&&(s=-s);var o=this.coe;o=o/this.trueWidth>o/this.trueHeight?o/this.trueHeight:o/this.trueWidth;var r=o*s;r<0?t+=Math.abs(r):t>Math.abs(r)&&(t-=Math.abs(r));let l=r<0?"add":"reduce";if(l!==this.coeStatus&&(this.coeStatus=l,this.coe=.2),this.scaling||(this.scalingSet=setTimeout(()=>{this.scaling=!1,this.coe=this.coe+=.01},50)),this.scaling=!0,!this.checkoutImgAxis(this.x,this.y,t))return!1;this.scale=t},changeScale(e){let t=this.scale;e=e||1;var s=20;if(s=s/this.trueWidth>s/this.trueHeight?s/this.trueHeight:s/this.trueWidth,e=e*s,e>0?t+=Math.abs(e):t>Math.abs(e)&&(t-=Math.abs(e)),!this.checkoutImgAxis(this.x,this.y,t))return!1;this.scale=t},createCrop(e){e.preventDefault();var t="clientX"in e?e.clientX:e.touches?e.touches[0].clientX:0,s="clientY"in e?e.clientY:e.touches?e.touches[0].clientY:0;this.$nextTick(()=>{var i=t-this.cropX,o=s-this.cropY;if(i>0?(this.cropW=i+this.cropChangeX>this.w?this.w-this.cropChangeX:i,this.cropOffsertX=this.cropChangeX):(this.cropW=this.w-this.cropChangeX+Math.abs(i)>this.w?this.cropChangeX:Math.abs(i),this.cropOffsertX=this.cropChangeX+i>0?this.cropChangeX+i:0),!this.fixed)o>0?(this.cropH=o+this.cropChangeY>this.h?this.h-this.cropChangeY:o,this.cropOffsertY=this.cropChangeY):(this.cropH=this.h-this.cropChangeY+Math.abs(o)>this.h?this.cropChangeY:Math.abs(o),this.cropOffsertY=this.cropChangeY+o>0?this.cropChangeY+o:0);else{var r=this.cropW/this.fixedNumber[0]*this.fixedNumber[1];r+this.cropOffsertY>this.h?(this.cropH=this.h-this.cropOffsertY,this.cropW=this.cropH/this.fixedNumber[1]*this.fixedNumber[0],i>0?this.cropOffsertX=this.cropChangeX:this.cropOffsertX=this.cropChangeX-this.cropW):this.cropH=r,this.cropOffsertY=this.cropOffsertY}})},changeCropSize(e,t,s,i,o){e.preventDefault(),window.addEventListener("mousemove",this.changeCropNow),window.addEventListener("mouseup",this.changeCropEnd),window.addEventListener("touchmove",this.changeCropNow),window.addEventListener("touchend",this.changeCropEnd),this.canChangeX=t,this.canChangeY=s,this.changeCropTypeX=i,this.changeCropTypeY=o,this.cropX="clientX"in e?e.clientX:e.touches[0].clientX,this.cropY="clientY"in e?e.clientY:e.touches[0].clientY,this.cropOldW=this.cropW,this.cropOldH=this.cropH,this.cropChangeX=this.cropOffsertX,this.cropChangeY=this.cropOffsertY,this.fixed&&this.canChangeX&&this.canChangeY&&(this.canChangeY=0),this.$emit("change-crop-size",{width:this.cropW,height:this.cropH})},changeCropNow(e){e.preventDefault();var t="clientX"in e?e.clientX:e.touches?e.touches[0].clientX:0,s="clientY"in e?e.clientY:e.touches?e.touches[0].clientY:0;let i=this.w,o=this.h,r=0,l=0;if(this.centerBox){let n=this.getImgAxis(),c=n.x2,u=n.y2;r=n.x1>0?n.x1:0,l=n.y1>0?n.y1:0,i>c&&(i=c),o>u&&(o=u)}this.$nextTick(()=>{var n=t-this.cropX,c=s-this.cropY;if(this.canChangeX&&(this.changeCropTypeX===1?this.cropOldW-n>0?(this.cropW=i-this.cropChangeX-n<=i-r?this.cropOldW-n:this.cropOldW+this.cropChangeX-r,this.cropOffsertX=i-this.cropChangeX-n<=i-r?this.cropChangeX+n:r):(this.cropW=Math.abs(n)+this.cropChangeX<=i?Math.abs(n)-this.cropOldW:i-this.cropOldW-this.cropChangeX,this.cropOffsertX=this.cropChangeX+this.cropOldW):this.changeCropTypeX===2&&(this.cropOldW+n>0?(this.cropW=this.cropOldW+n+this.cropOffsertX<=i?this.cropOldW+n:i-this.cropOffsertX,this.cropOffsertX=this.cropChangeX):(this.cropW=i-this.cropChangeX+Math.abs(n+this.cropOldW)<=i-r?Math.abs(n+this.cropOldW):this.cropChangeX-r,this.cropOffsertX=i-this.cropChangeX+Math.abs(n+this.cropOldW)<=i-r?this.cropChangeX-Math.abs(n+this.cropOldW):r))),this.canChangeY&&(this.changeCropTypeY===1?this.cropOldH-c>0?(this.cropH=o-this.cropChangeY-c<=o-l?this.cropOldH-c:this.cropOldH+this.cropChangeY-l,this.cropOffsertY=o-this.cropChangeY-c<=o-l?this.cropChangeY+c:l):(this.cropH=Math.abs(c)+this.cropChangeY<=o?Math.abs(c)-this.cropOldH:o-this.cropOldH-this.cropChangeY,this.cropOffsertY=this.cropChangeY+this.cropOldH):this.changeCropTypeY===2&&(this.cropOldH+c>0?(this.cropH=this.cropOldH+c+this.cropOffsertY<=o?this.cropOldH+c:o-this.cropOffsertY,this.cropOffsertY=this.cropChangeY):(this.cropH=o-this.cropChangeY+Math.abs(c+this.cropOldH)<=o-l?Math.abs(c+this.cropOldH):this.cropChangeY-l,this.cropOffsertY=o-this.cropChangeY+Math.abs(c+this.cropOldH)<=o-l?this.cropChangeY-Math.abs(c+this.cropOldH):l))),this.canChangeX&&this.fixed){var u=this.cropW/this.fixedNumber[0]*this.fixedNumber[1];u+this.cropOffsertY>o?(this.cropH=o-this.cropOffsertY,this.cropW=this.cropH/this.fixedNumber[1]*this.fixedNumber[0]):this.cropH=u}if(this.canChangeY&&this.fixed){var p=this.cropH/this.fixedNumber[1]*this.fixedNumber[0];p+this.cropOffsertX>i?(this.cropW=i-this.cropOffsertX,this.cropH=this.cropW/this.fixedNumber[0]*this.fixedNumber[1]):this.cropW=p}})},checkCropLimitSize(){let{cropW:e,cropH:t,limitMinSize:s}=this,i=new Array;return Array.isArray[s]?i=s:i=[s,s],e=parseFloat(i[0]),t=parseFloat(i[1]),[e,t]},changeCropEnd(e){window.removeEventListener("mousemove",this.changeCropNow),window.removeEventListener("mouseup",this.changeCropEnd),window.removeEventListener("touchmove",this.changeCropNow),window.removeEventListener("touchend",this.changeCropEnd)},endCrop(){this.cropW===0&&this.cropH===0&&(this.cropping=!1),window.removeEventListener("mousemove",this.createCrop),window.removeEventListener("mouseup",this.endCrop),window.removeEventListener("touchmove",this.createCrop),window.removeEventListener("touchend",this.endCrop)},startCrop(){this.crop=!0},stopCrop(){this.crop=!1},clearCrop(){this.cropping=!1,this.cropW=0,this.cropH=0},cropMove(e){if(e.preventDefault(),!this.canMoveBox)return this.crop=!1,this.startMove(e),!1;if(e.touches&&e.touches.length===2)return this.crop=!1,this.startMove(e),this.leaveCrop(),!1;window.addEventListener("mousemove",this.moveCrop),window.addEventListener("mouseup",this.leaveCrop),window.addEventListener("touchmove",this.moveCrop),window.addEventListener("touchend",this.leaveCrop);let t="clientX"in e?e.clientX:e.touches[0].clientX,s="clientY"in e?e.clientY:e.touches[0].clientY,i,o;i=t-this.cropOffsertX,o=s-this.cropOffsertY,this.cropX=i,this.cropY=o,this.$emit("cropMoving",{moving:!0,axis:this.getCropAxis()}),this.$emit("crop-moving",{moving:!0,axis:this.getCropAxis()})},moveCrop(e,t){let s=0,i=0;e&&(e.preventDefault(),s="clientX"in e?e.clientX:e.touches[0].clientX,i="clientY"in e?e.clientY:e.touches[0].clientY),this.$nextTick(()=>{let o,r,l=s-this.cropX,n=i-this.cropY;if(t&&(l=this.cropOffsertX,n=this.cropOffsertY),l<=0?o=0:l+this.cropW>this.w?o=this.w-this.cropW:o=l,n<=0?r=0:n+this.cropH>this.h?r=this.h-this.cropH:r=n,this.centerBox){let c=this.getImgAxis();o<=c.x1&&(o=c.x1),o+this.cropW>c.x2&&(o=c.x2-this.cropW),r<=c.y1&&(r=c.y1),r+this.cropH>c.y2&&(r=c.y2-this.cropH)}this.cropOffsertX=o,this.cropOffsertY=r,this.$emit("cropMoving",{moving:!0,axis:this.getCropAxis()}),this.$emit("crop-moving",{moving:!0,axis:this.getCropAxis()})})},getImgAxis(e,t,s){e=e||this.x,t=t||this.y,s=s||this.scale;let i={x1:0,x2:0,y1:0,y2:0},o=this.trueWidth*s,r=this.trueHeight*s;switch(this.rotate){case 0:i.x1=e+this.trueWidth*(1-s)/2,i.x2=i.x1+this.trueWidth*s,i.y1=t+this.trueHeight*(1-s)/2,i.y2=i.y1+this.trueHeight*s;break;case 1:case-1:case 3:case-3:i.x1=e+this.trueWidth*(1-s)/2+(o-r)/2,i.x2=i.x1+this.trueHeight*s,i.y1=t+this.trueHeight*(1-s)/2+(r-o)/2,i.y2=i.y1+this.trueWidth*s;break;default:i.x1=e+this.trueWidth*(1-s)/2,i.x2=i.x1+this.trueWidth*s,i.y1=t+this.trueHeight*(1-s)/2,i.y2=i.y1+this.trueHeight*s;break}return i},getCropAxis(){let e={x1:0,x2:0,y1:0,y2:0};return e.x1=this.cropOffsertX,e.x2=e.x1+this.cropW,e.y1=this.cropOffsertY,e.y2=e.y1+this.cropH,e},leaveCrop(e){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.$emit("cropMoving",{moving:!1,axis:this.getCropAxis()}),this.$emit("crop-moving",{moving:!1,axis:this.getCropAxis()})},getCropChecked(e){let t=document.createElement("canvas"),s=new Image,i=this.rotate,o=this.trueWidth,r=this.trueHeight,l=this.cropOffsertX,n=this.cropOffsertY;s.onload=()=>{if(this.cropW!==0){let p=t.getContext("2d"),d=1;this.high&!this.full&&(d=window.devicePixelRatio),this.enlarge!==1&!this.full&&(d=Math.abs(Number(this.enlarge)));let A=this.cropW*d,L=this.cropH*d,g=o*this.scale*d,f=r*this.scale*d,m=(this.x-l+this.trueWidth*(1-this.scale)/2)*d,v=(this.y-n+this.trueHeight*(1-this.scale)/2)*d;switch(u(A,L),p.save(),i){case 0:this.full?(u(A/this.scale,L/this.scale),p.drawImage(s,m/this.scale,v/this.scale,g/this.scale,f/this.scale)):p.drawImage(s,m,v,g,f);break;case 1:case-3:this.full?(u(A/this.scale,L/this.scale),m=m/this.scale+(g/this.scale-f/this.scale)/2,v=v/this.scale+(f/this.scale-g/this.scale)/2,p.rotate(i*90*Math.PI/180),p.drawImage(s,v,-m-f/this.scale,g/this.scale,f/this.scale)):(m=m+(g-f)/2,v=v+(f-g)/2,p.rotate(i*90*Math.PI/180),p.drawImage(s,v,-m-f,g,f));break;case 2:case-2:this.full?(u(A/this.scale,L/this.scale),p.rotate(i*90*Math.PI/180),m=m/this.scale,v=v/this.scale,p.drawImage(s,-m-g/this.scale,-v-f/this.scale,g/this.scale,f/this.scale)):(p.rotate(i*90*Math.PI/180),p.drawImage(s,-m-g,-v-f,g,f));break;case 3:case-1:this.full?(u(A/this.scale,L/this.scale),m=m/this.scale+(g/this.scale-f/this.scale)/2,v=v/this.scale+(f/this.scale-g/this.scale)/2,p.rotate(i*90*Math.PI/180),p.drawImage(s,-v-g/this.scale,m,g/this.scale,f/this.scale)):(m=m+(g-f)/2,v=v+(f-g)/2,p.rotate(i*90*Math.PI/180),p.drawImage(s,-v-g,m,g,f));break;default:this.full?(u(A/this.scale,L/this.scale),p.drawImage(s,m/this.scale,v/this.scale,g/this.scale,f/this.scale)):p.drawImage(s,m,v,g,f)}p.restore()}else{let p=o*this.scale,d=r*this.scale,A=t.getContext("2d");switch(A.save(),i){case 0:u(p,d),A.drawImage(s,0,0,p,d);break;case 1:case-3:u(d,p),A.rotate(i*90*Math.PI/180),A.drawImage(s,0,-d,p,d);break;case 2:case-2:u(p,d),A.rotate(i*90*Math.PI/180),A.drawImage(s,-p,-d,p,d);break;case 3:case-1:u(d,p),A.rotate(i*90*Math.PI/180),A.drawImage(s,-p,0,p,d);break;default:u(p,d),A.drawImage(s,0,0,p,d)}A.restore()}e(t)};var c=this.img.substr(0,4);c!=="data"&&(s.crossOrigin="Anonymous"),s.src=this.imgs;function u(p,d){t.width=Math.round(p),t.height=Math.round(d)}},getCropData(e){this.getCropChecked(t=>{e(t.toDataURL("image/"+this.outputType,this.outputSize))})},getCropBlob(e){this.getCropChecked(t=>{t.toBlob(s=>e(s),"image/"+this.outputType,this.outputSize)})},showPreview(){if(this.isCanShow)this.isCanShow=!1,setTimeout(()=>{this.isCanShow=!0},16);else return!1;let e=this.cropW,t=this.cropH,s=this.scale;var i={};i.div={width:`${e}px`,height:`${t}px`};let o=(this.x-this.cropOffsertX)/s,r=(this.y-this.cropOffsertY)/s,l=0;i.w=e,i.h=t,i.url=this.imgs,i.img={width:`${this.trueWidth}px`,height:`${this.trueHeight}px`,transform:`scale(${s})translate3d(${o}px, ${r}px, ${l}px)rotateZ(${this.rotate*90}deg)`},i.html=`
- <div class="show-preview" style="width: ${i.w}px; height: ${i.h}px,; overflow: hidden">
- <div style="width: ${e}px; height: ${t}px">
- <img src=${i.url} style="width: ${this.trueWidth}px; height: ${this.trueHeight}px; transform:
- scale(${s})translate3d(${o}px, ${r}px, ${l}px)rotateZ(${this.rotate*90}deg)">
- </div>
- </div>`,this.$emit("realTime",i),this.$emit("real-time",i)},reload(){let e=new Image;e.onload=()=>{this.w=parseFloat(window.getComputedStyle(this.$refs.cropper).width),this.h=parseFloat(window.getComputedStyle(this.$refs.cropper).height),this.trueWidth=e.width,this.trueHeight=e.height,this.original?this.scale=1:this.scale=this.checkedMode(),this.$nextTick(()=>{this.x=-(this.trueWidth-this.trueWidth*this.scale)/2+(this.w-this.trueWidth*this.scale)/2,this.y=-(this.trueHeight-this.trueHeight*this.scale)/2+(this.h-this.trueHeight*this.scale)/2,this.loading=!1,this.autoCrop&&this.goAutoCrop(),this.$emit("img-load","success"),this.$emit("imgLoad","success"),setTimeout(()=>{this.showPreview()},20)})},e.onerror=()=>{this.$emit("imgLoad","error"),this.$emit("img-load","error")},e.src=this.imgs},checkedMode(){let e=1,t=this.trueWidth,s=this.trueHeight;const i=this.mode.split(" ");switch(i[0]){case"contain":this.trueWidth>this.w&&(e=this.w/this.trueWidth),this.trueHeight*e>this.h&&(e=this.h/this.trueHeight);break;case"cover":t=this.w,e=t/this.trueWidth,s=s*e,s<this.h&&(s=this.h,e=s/this.trueHeight);break;default:try{let o=i[0];if(o.search("px")!==-1){o=o.replace("px",""),t=parseFloat(o);const r=t/this.trueWidth;let l=1,n=i[1];n.search("px")!==-1&&(n=n.replace("px",""),s=parseFloat(n),l=s/this.trueHeight),e=Math.min(r,l)}if(o.search("%")!==-1&&(o=o.replace("%",""),t=parseFloat(o)/100*this.w,e=t/this.trueWidth),i.length===2&&o==="auto"){let r=i[1];r.search("px")!==-1&&(r=r.replace("px",""),s=parseFloat(r),e=s/this.trueHeight),r.search("%")!==-1&&(r=r.replace("%",""),s=parseFloat(r)/100*this.h,e=s/this.trueHeight)}}catch{e=1}}return e},goAutoCrop(e,t){if(this.imgs===""||this.imgs===null)return;this.clearCrop(),this.cropping=!0;let s=this.w,i=this.h;if(this.centerBox){const l=Math.abs(this.rotate)%2>0;let n=(l?this.trueHeight:this.trueWidth)*this.scale,c=(l?this.trueWidth:this.trueHeight)*this.scale;s=n<s?n:s,i=c<i?c:i}var o=e||parseFloat(this.autoCropWidth),r=t||parseFloat(this.autoCropHeight);(o===0||r===0)&&(o=s*.8,r=i*.8),o=o>s?s:o,r=r>i?i:r,this.fixed&&(r=o/this.fixedNumber[0]*this.fixedNumber[1]),r>this.h&&(r=this.h,o=r/this.fixedNumber[1]*this.fixedNumber[0]),this.changeCrop(o,r)},changeCrop(e,t){if(this.centerBox){let s=this.getImgAxis();e>s.x2-s.x1&&(e=s.x2-s.x1,t=e/this.fixedNumber[0]*this.fixedNumber[1]),t>s.y2-s.y1&&(t=s.y2-s.y1,e=t/this.fixedNumber[1]*this.fixedNumber[0])}this.cropW=e,this.cropH=t,this.checkCropLimitSize(),this.$nextTick(()=>{this.cropOffsertX=(this.w-this.cropW)/2,this.cropOffsertY=(this.h-this.cropH)/2,this.centerBox&&this.moveCrop(null,!0)})},refresh(){this.img,this.imgs="",this.scale=1,this.crop=!1,this.rotate=0,this.w=0,this.h=0,this.trueWidth=0,this.trueHeight=0,this.clearCrop(),this.$nextTick(()=>{this.checkedImg()})},rotateLeft(){this.rotate=this.rotate<=-3?0:this.rotate-1},rotateRight(){this.rotate=this.rotate>=3?0:this.rotate+1},rotateClear(){this.rotate=0},checkoutImgAxis(e,t,s){e=e||this.x,t=t||this.y,s=s||this.scale;let i=!0;if(this.centerBox){let o=this.getImgAxis(e,t,s),r=this.getCropAxis();o.x1>=r.x1&&(i=!1),o.x2<=r.x2&&(i=!1),o.y1>=r.y1&&(i=!1),o.y2<=r.y2&&(i=!1)}return i}},mounted(){this.support="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";let e=this;var t=navigator.userAgent;this.isIOS=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(s,i,o){for(var r=atob(this.toDataURL(i,o).split(",")[1]),l=r.length,n=new Uint8Array(l),c=0;c<l;c++)n[c]=r.charCodeAt(c);s(new Blob([n],{type:e.type||"image/png"}))}}),this.showPreview(),this.checkedImg()},destroyed(){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.cancelScale()}}),wt={key:0,class:"cropper-box"},Ct=["src"],Lt={class:"cropper-view-box"},xt=["src"],yt={key:1};function Et(e,t,s,i,o,r){return X(),q("div",{class:"vue-cropper",ref:"cropper",onMouseover:t[28]||(t[28]=(...l)=>e.scaleImg&&e.scaleImg(...l)),onMouseout:t[29]||(t[29]=(...l)=>e.cancelScale&&e.cancelScale(...l))},[e.imgs?(X(),q("div",wt,[j(w("div",{class:"cropper-box-canvas",style:Y({width:e.trueWidth+"px",height:e.trueHeight+"px",transform:"scale("+e.scale+","+e.scale+") translate3d("+e.x/e.scale+"px,"+e.y/e.scale+"px,0)rotateZ("+e.rotate*90+"deg)"})},[w("img",{src:e.imgs,alt:"cropper-img",ref:"cropperImg"},null,8,Ct)],4),[[G,!e.loading]])])):N("",!0),w("div",{class:de(["cropper-drag-box",{"cropper-move":e.move&&!e.crop,"cropper-crop":e.crop,"cropper-modal":e.cropping}]),onMousedown:t[0]||(t[0]=(...l)=>e.startMove&&e.startMove(...l)),onTouchstart:t[1]||(t[1]=(...l)=>e.startMove&&e.startMove(...l))},null,34),j(w("div",{class:"cropper-crop-box",style:Y({width:e.cropW+"px",height:e.cropH+"px",transform:"translate3d("+e.cropOffsertX+"px,"+e.cropOffsertY+"px,0)"})},[w("span",Lt,[w("img",{style:Y({width:e.trueWidth+"px",height:e.trueHeight+"px",transform:"scale("+e.scale+","+e.scale+") translate3d("+(e.x-e.cropOffsertX)/e.scale+"px,"+(e.y-e.cropOffsertY)/e.scale+"px,0)rotateZ("+e.rotate*90+"deg)"}),src:e.imgs,alt:"cropper-img"},null,12,xt)]),w("span",{class:"cropper-face cropper-move",onMousedown:t[2]||(t[2]=(...l)=>e.cropMove&&e.cropMove(...l)),onTouchstart:t[3]||(t[3]=(...l)=>e.cropMove&&e.cropMove(...l))},null,32),e.info?(X(),q("span",{key:0,class:"crop-info",style:Y({top:e.cropInfo.top})},Q(e.cropInfo.width)+" \xD7 "+Q(e.cropInfo.height),5)):N("",!0),e.fixedBox?N("",!0):(X(),q("span",yt,[w("span",{class:"crop-line line-w",onMousedown:t[4]||(t[4]=l=>e.changeCropSize(l,!1,!0,0,1)),onTouchstart:t[5]||(t[5]=l=>e.changeCropSize(l,!1,!0,0,1))},null,32),w("span",{class:"crop-line line-a",onMousedown:t[6]||(t[6]=l=>e.changeCropSize(l,!0,!1,1,0)),onTouchstart:t[7]||(t[7]=l=>e.changeCropSize(l,!0,!1,1,0))},null,32),w("span",{class:"crop-line line-s",onMousedown:t[8]||(t[8]=l=>e.changeCropSize(l,!1,!0,0,2)),onTouchstart:t[9]||(t[9]=l=>e.changeCropSize(l,!1,!0,0,2))},null,32),w("span",{class:"crop-line line-d",onMousedown:t[10]||(t[10]=l=>e.changeCropSize(l,!0,!1,2,0)),onTouchstart:t[11]||(t[11]=l=>e.changeCropSize(l,!0,!1,2,0))},null,32),w("span",{class:"crop-point point1",onMousedown:t[12]||(t[12]=l=>e.changeCropSize(l,!0,!0,1,1)),onTouchstart:t[13]||(t[13]=l=>e.changeCropSize(l,!0,!0,1,1))},null,32),w("span",{class:"crop-point point2",onMousedown:t[14]||(t[14]=l=>e.changeCropSize(l,!1,!0,0,1)),onTouchstart:t[15]||(t[15]=l=>e.changeCropSize(l,!1,!0,0,1))},null,32),w("span",{class:"crop-point point3",onMousedown:t[16]||(t[16]=l=>e.changeCropSize(l,!0,!0,2,1)),onTouchstart:t[17]||(t[17]=l=>e.changeCropSize(l,!0,!0,2,1))},null,32),w("span",{class:"crop-point point4",onMousedown:t[18]||(t[18]=l=>e.changeCropSize(l,!0,!1,1,0)),onTouchstart:t[19]||(t[19]=l=>e.changeCropSize(l,!0,!1,1,0))},null,32),w("span",{class:"crop-point point5",onMousedown:t[20]||(t[20]=l=>e.changeCropSize(l,!0,!1,2,0)),onTouchstart:t[21]||(t[21]=l=>e.changeCropSize(l,!0,!1,2,0))},null,32),w("span",{class:"crop-point point6",onMousedown:t[22]||(t[22]=l=>e.changeCropSize(l,!0,!0,1,2)),onTouchstart:t[23]||(t[23]=l=>e.changeCropSize(l,!0,!0,1,2))},null,32),w("span",{class:"crop-point point7",onMousedown:t[24]||(t[24]=l=>e.changeCropSize(l,!1,!0,0,2)),onTouchstart:t[25]||(t[25]=l=>e.changeCropSize(l,!1,!0,0,2))},null,32),w("span",{class:"crop-point point8",onMousedown:t[26]||(t[26]=l=>e.changeCropSize(l,!0,!0,2,2)),onTouchstart:t[27]||(t[27]=l=>e.changeCropSize(l,!0,!0,2,2))},null,32)]))],4),[[G,e.cropping]])],544)}var ae=vt(bt,[["render",Et],["__scopeId","data-v-be5e5ddc"]]);typeof window!="undefined"&&window.Vue&&window.Vue.createApp({}).component("VueCropper",ae);var St="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABBlJREFUaEPtmVuoVkUUx3/HFxWflFIQFPGCL0mBmhdCBEW8PqhkUSEmomjpiyTqiwpeUXxIFE1KyEIzCcUoBStQwhteMJTIEgzRoBTSXnoy/jIT6wyz9579fXt/ng8c2Jzz7Zm91v+/1po1M2s6aPPW0eb4eU4g8OArwERgODDIPH8Dv5vnHHASeNxsBFThgZnAXAdcoMu0L4EfgGPA/TIf+rHNEBDwxcCsRhQH39wD9gP7yhJphEBfYI+zeoj9Z+B7QJb9C3jg/vYAepvnbUBPzwwi61ONUpbAKOA40D9Q8BFwADifqhjoA7wJLARGBt/JAPNSZJUhIKusiwAX+MspynLGKBT1WCI3gJeK5KYSWOrCxsqThWSpKpu8uCAQmIsxhcBs4KtA6ADgbpXIjazNwBrz+1tgepauIgID3aQc4gQ8BAYDyut1tknAaaNgO7AqprCIgLKNwkftV2AO8FOdyI1sTe6Pze/3ImGcu5WYAXxtBMgqSpGtbLuBZU7hb8A44E8LIM8DZ4HX3OBtwOpWIne6XgR+BIa531uD+ZHpgbeAz91H14AJVexbGjTAEmCv+/ZfYDxwxcvK8oBCRyGkthLYGShPXSn9uLLjQ66ngCnupWRtyCOgsFH4qCnrjAC0V7EttqiFSqXEEggXwbzxYd+7wCfu5QVgbB6BLSbelYU0+8PWagJad7Qd901p/bZ+xELokNujqH8+cLCAwP/udOO8pbM8kDI+opKLwGjXsQLYlUXAZp+XgesJBGKhkkegaHyMgPX6DuCDLALKt1pts/r13gprBmiWnBiB5cCHrkNnB23+OoWQXKLdnxaL7kaC0paOgLaFim1fSgg14gGdHz5zio4Ab4QEZPXv3DnWA1I6jZ24mpnEKR6LeWAa8I3rUFqdGgsR6yb163D+S8EciCnTOwtUXvFWr5WAFMs9r7uN1KIMdAKkDPYkksmeWQh5rCqNXAVecGfaLAsXZQq7YqZ4oNMKGxFeOInDSZq6/OdN7qLJWiYLJafRFIvnkUsJoaKsFcOQvJClEiiztymbtUIMpbYSVRHImgNZ8vPmQKnNXCqBonHKUH7fkzKf7PhQtt1O2zTcFtXphg401gLvuNV5Y5HJa+hv+EgpLK+6s4C21GrRqkANoK3Ipg71EnQ0KOKK1KWaQXvxTZdVvKA/gH4GdFEtqQp+lRW2BEYljXBDNwaenpDqaJWWFj1Am4f9u/cBxWiVrZbirgeoG5kTAdpP3a71TJMsai+ve3zaoaq8ER5yVIj9AjgM/JNIpuUXHBbXWmBTBOgdQHUbFYJvAbqkuAl06ypXTBazavY6+OjplWj1rGEtveQLQehq1RPxdZtUPs/0mjUGcjIwFFDlTH/9/4+68kV3qrVrGdeKVbUW4F5o2xP4DzVSDEAyxtmHAAAAAElFTkSuQmCC",It=I({name:"cropper",props:{cropperNo:{type:Function,default:e=>{}},cropperOk:{type:Function,default:e=>{}},bucket:{type:String,default:"daya"}},data(){return{ossUploadUrl:"https://ks3-cn-beijing.ksyuncs.com/"+this.bucket,dataObj:{policy:"",signature:"",key:"",KSSAccessKeyId:"",acl:"public-read",name:""},visible:!1,img:null,options:{img:"",autoCrop:!0,autoCropWidth:180,autoCropHeight:180,fixedBox:!0,full:!1,enlarge:1,previewsCircle:!0,centerBox:!0,outputType:"png",title:"\u4FEE\u6539\u5934\u50CF",name:null},previews:{},url:{upload:"/sys/common/saveToImgByStr"},submitLoading:!1}},methods:{edit(e){const{options:t}=this;this.visible=!0,this.options=Object.assign({},t,e),console.log(this.options)},cancelHandel(){this.visible=!1,this.cropperNo()},okHandel(){this.$refs.cropperRef.getCropBlob(async e=>{this.submitLoading=!0;const t=this.options,s=(t.name?t.name.split(".")[0]:+new Date)+".png";try{let i=new Date().getTime()+s,o={filename:s,bucketName:this.bucket,postData:{filename:s,acl:"public-read",key:i,unknowValueField:[]}};const r=await k.post("/api-website/getUploadSign",{data:o});this.dataObj={policy:r.data.policy,signature:r.data.signature,key:i,KSSAccessKeyId:r.data.kssAccessKeyId,acl:"public-read",name:s};let l=new FormData;for(let c in this.dataObj)l.append(c,this.dataObj[c]);l.append("file",this.blobToFile(e,s),s),await Ae(this.ossUploadUrl,{method:"POST",data:l}),console.log(this.ossUploadUrl+"/"+i);const n=this.ossUploadUrl+"/"+i;this.cropperOk(n)}catch(i){E.error(i)}finally{this.submitLoading=!1,this.cancelHandel()}})},blobToFile(e,t){return e.lastModifiedDate=new Date,e.name=t,e},base64ToFile(e,t){let s=e.split(","),i=s[0].match(/:(.*?);/)[1],o=atob(s[1]),r=o.length,l=new Uint8Array(r);for(;r--;)l[r]=o.charCodeAt(r);return new File([l],t,{type:i})},realTime(e){this.previews=e},changeScale(e){e=e||1,this.$refs.cropperRef.changeScale(e)},rotateLeft(){this.$refs.cropperRef.rotateLeft()},rotateRight(){this.$refs.cropperRef.rotateRight()}},render(){return a(te,{modelValue:this.visible,"onUpdate:modelValue":e=>this.visible=e,appendToBody:!0,title:this.options.title,closeOnClickModal:!1,width:"800px"},{default:()=>[a(H,null,{default:()=>[a(O,{xs:24,md:12,style:{width:"350px"}},{default:()=>[a(ae,{ref:"cropperRef",img:this.options.img,info:!0,autoCrop:this.options.autoCrop,autoCropWidth:this.options.autoCropWidth,full:this.options.full,outputType:this.options.outputType,autoCropHeight:this.options.autoCropHeight,fixedBox:this.options.fixedBox,enlarge:this.options.enlarge,onRealTime:this.realTime,style:{height:"350px"}},null),a("div",{class:"flex pt-2"},[a("div",{onClick:()=>{this.changeScale(1)},class:"mr-2 cursor-pointer",title:"\u653E\u5927"},[a(S,{size:30,color:"#333"},{default:()=>[a(ge,null,null)]})]),a("div",{onClick:()=>{this.changeScale(-1)},class:"mr-2 cursor-pointer",title:"\u7F29\u5C0F"},[a(S,{size:30,color:"#333"},{default:()=>[a(fe,null,null)]})]),a("div",{onClick:this.rotateRight,title:"\u5411\u53F3\u65CB\u8F6C",class:"cursor-pointer"},[a("img",{src:St,class:"w-[30px] h-[30px]"},null)])])]}),a(O,{xs:24,md:12,style:{height:"350px"}},{default:()=>[a("div",{class:U.previewImg},[a("span",null,[b("\u9884\u89C8\u56FE\u7247")]),a("div",{class:this.options.previewsCircle?U["avatar-upload-preview"]:U["avatar-upload-preview_range"],style:{width:this.options.autoCropWidth+"px",height:this.options.autoCropHeight+"px"}},[a(T,{src:this.previews.url,style:this.previews.img},null)])])]})]})],footer:()=>a("span",{class:"dialog-footer !text-center block"},[a(y,{onClick:this.cancelHandel,disabled:this.submitLoading},{default:()=>[b("\u53D6\u6D88")]}),a(y,{type:"primary",onClick:this.okHandel,loading:this.submitLoading},{default:()=>[b("\u4FDD \u5B58")]})])})}}),Ut=I({name:"col-cropper",props:{modelValue:{type:String,default:""},options:{type:Object,default:{autoCrop:!0,enlarge:1,autoCropWidth:200,autoCropHeight:200,fixedBox:!0,previewsCircle:!0,title:"\u4E0A\u4F20\u56FE\u7247"}},showSize:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},bucket:{type:String,default:"daya"},size:{type:Number,default:5},accept:{type:String,default:"images/*"},tips:{type:String,default:"\u8BF7\u4E0A\u4F20\u56FE\u7247"},extraTips:{type:String,default:"\u56FE\u7247\u6700\u5927\u4E0D\u80FD\u8D85\u8FC75MB"},cropUploadSuccess:{type:Function,default:e=>{}}},data(){return{isStopRun:!1,loading:!1}},methods:{onDelete(){this.$emit("update:modelValue","")},async handleChange(e){if(this.isStopRun)return;this.loading=!0;const t=this.options;this.getBase64(e.file,s=>{const i=Object.assign({},t,{img:s,name:e.file.name});this.$refs.CropperModal.edit(i)})},beforeUpload(e){this.isStopRun=!1;var t=e.type;if(t.indexOf("image")<0)return E.warning("\u8BF7\u4E0A\u4F20\u56FE\u7247"),this.isStopRun=!0,!1;console.log(this.size);const s=this.size||0,i=e.size<s*1024*1024;return i||(E.error("\u56FE\u7247\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7"+this.size+"MB!"),this.isStopRun=!0),i},error(){this.remove(),this.loading=!1},remove(){this.onDelete()},handleCropperSuccess(e){this.loading=!1,console.log(e,"success"),this.$emit("update:modelValue",e),this.cropUploadSuccess(e)},handleCropperClose(){this.loading=!1,this.remove()},getBase64(e,t){const s=new FileReader;s.addEventListener("load",()=>t(s.result)),s.readAsDataURL(e)}},render(){return a("div",{class:[U.colUpload,"w-full"]},[a(ie,{disabled:this.disabled,showFileList:!1,accept:this.accept,beforeUpload:this.beforeUpload,httpRequest:this.handleChange,ref:"uploadRef"},{default:()=>[a("div",{ref:"uploadDom",class:[U.uploadClass,"w-full"],style:{height:"106px"}},[this.modelValue?a(T,{src:this.modelValue,fit:"cover",class:U.uploadSection},null):a("div",{class:[U.uploadSection,"flex items-center flex-col justify-center"]},[a("img",{src:Ce,class:"w-8 h-7 mb-3"},null),a("p",null,[this.tips])])])]}),a("p",{class:"text-3 text-[#999999] leading-6 pt-1"},[this.extraTips]),a(It,{ref:"CropperModal",bucket:this.bucket,cropperNo:this.handleCropperClose,cropperOk:this.handleCropperSuccess},null)])}});const kt="_tabs_1gmo5_1";var Mt={tabs:kt};function $(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!me(e)}var Tt=I({name:"course-info",data(){return{url:"",calcRatePrice:0}},computed:{choiceSubjectIds(){let e=h.lessonGroup.lessonSubject?Number(h.lessonGroup.lessonSubject):null;return e?[e]:[]},subjectList(){return h.subjectList||[]},lessonSubjectName(){let e="";return this.subjectList.forEach(t=>{this.choiceSubjectIds.includes(t.id)&&(e=t.name)}),e}},async mounted(){try{if(h.subjectList.length<=0){const e=await k.post("/api-website/teacher/querySubject");h.subjectList=e.data||[]}}catch{}},methods:{onFormatter(e){e.target.value=ye(e.target.value);let t=h.rate||0,s=e.target.value||0;this.calcRatePrice=(s-t/100*s).toFixed(2)},tabChange(e){this.$refs.form.clearValidate("lessonCoverTemplateUrl"),this.$refs.form.clearValidate("lessonCoverUrl"),h.tabIndex=e},selectImg(e){h.lessonGroup.lessonCoverUrl="",h.lessonGroup.lessonCoverTemplateUrl=e}},render(){let e,t;return a(se,null,[a(_,{class:"px-[200px] pb-10 pt-7",size:"large",ref:"form",labelWidth:"100px",labelPosition:"left",model:h.lessonGroup},{default:()=>[a(x,{label:"\u8BFE\u7A0B\u540D\u79F0",prop:"lessonName",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u540D\u79F0"}]},{default:()=>[a(B,{modelValue:h.lessonGroup.lessonName,"onUpdate:modelValue":s=>h.lessonGroup.lessonName=s,placeholder:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u540D\u79F0"},null)]}),a(x,{label:"\u8BFE\u7A0B\u58F0\u90E8",prop:"lessonSubject",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BFE\u7A0B\u58F0\u90E8"}]},{default:()=>[a(Ee,{class:"w-full",modelValue:h.lessonGroup.lessonSubject,"onUpdate:modelValue":s=>h.lessonGroup.lessonSubject=s,placeholder:"\u8BF7\u9009\u62E9\u8BFE\u7A0B\u58F0\u90E8"},$(e=h.subjectList.map(s=>a(Se,{key:s.id,value:s.id,label:s.name},null)))?e:{default:()=>[e]})]}),a(x,{label:"\u8BFE\u7A0B\u4ECB\u7ECD",prop:"lessonDesc",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u4ECB\u7ECD"}]},{default:()=>[a(B,{placeholder:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u4ECB\u7ECD",modelValue:h.lessonGroup.lessonDesc,"onUpdate:modelValue":s=>h.lessonGroup.lessonDesc=s,type:"textarea",maxlength:200,rows:4,showWordLimit:!0},null)]}),a(x,{label:"\u8BFE\u7A0B\u7EC4\u552E\u4EF7",prop:"lessonPrice",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u7EC4\u552E\u4EF7"}]},{default:()=>[a(B,{placeholder:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u7EC4\u552E\u4EF7",modelValue:h.lessonGroup.lessonPrice,"onUpdate:modelValue":s=>h.lessonGroup.lessonPrice=s,onKeyup:this.onFormatter},{append:()=>a("span",{class:"text-base text-[#333]"},[b("\u5143")])})]}),a("div",{class:"text-sm text-[#999] pl-[100px] leading-relaxed pb-2"},[a("p",null,[b("\u6263\u9664\u624B\u7EED\u8D39\u540E\u60A8\u7684\u8BFE\u7A0B\u9884\u8BA1\u6536\u5165\u4E3A\uFF1A ")]),a("p",null,[b("\u8BFE\u7A0B\u7EC4\u603B\u6536\u5165"),a("span",{class:"px-1 text-[#FF4E19]"},[this.calcRatePrice]),b("\u5143/\u4EBA")]),a("p",null,[b("\u60A8\u7684\u8BFE\u7A0B\u6536\u5165\u5C06\u5728\u8BFE\u7A0B\u7ED3\u675F\u540E\u7ED3\u7B97\u5230\u60A8\u7684\u8D26\u6237\u4E2D ")])]),a(x,{label:"\u8BFE\u7A0B\u5C01\u9762",class:"!mb-0"},{default:()=>[a(ve,{modelValue:h.tabIndex,"onUpdate:modelValue":s=>h.tabIndex=s,class:Mt.tabs,"onTab-change":s=>{this.tabChange(s)}},{default:()=>[a(Z,{label:"\u56FE\u7247\u6A21\u677F",name:1},null),a(Z,{label:"\u81EA\u5B9A\u4E49\u6A21\u677F",name:2},null)]})]}),h.tabIndex===1&&a(x,{prop:"lessonCoverTemplateUrl",rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u8BFE\u7A0B\u5C01\u9762"}]},{default:()=>[a(Ie,{modelValue:h.lessonGroup.lessonCoverTemplateUrl,"onUpdate:modelValue":s=>h.lessonGroup.lessonCoverTemplateUrl=s},{default:()=>[a(H,null,$(t=h.templateList.map(s=>a(O,{span:10,class:"mb-3 cursor-pointer"},{default:()=>[a("div",{class:"w-40 relative rounded-xl overflow-hidden border",onClick:()=>{this.selectImg(s)}},[a(T,{src:s,class:"align-middle"},null),a(Ue,{label:s,class:"!absolute bottom-2 right-0 !h-auto z-10"},{default:()=>[""]})])]})))?t:{default:()=>[t]})]})]}),h.tabIndex===2&&a(x,{prop:"lessonCoverUrl",rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u8BFE\u7A0B\u5C01\u9762",trigger:"change"}]},{default:()=>[a(Ut,{modelValue:h.lessonGroup.lessonCoverUrl,bucket:"video-course",cropUploadSuccess:s=>{h.lessonGroup.lessonCoverUrl=s,h.lessonGroup.lessonCoverTemplateUrl=""},options:{fixedNumber:[3,2],autoCropWidth:300,autoCropHeight:200}},null)]})]}),a("div",{class:"border-t border-t-[#E5E5E5] text-center pt-6 pb-7"},[a(y,{type:"primary",class:"!w-40 !h-[38px]",onClick:()=>{this.$refs.form.validate(async s=>{if(s){h.active=1;const i=document.documentElement.scrollTop||document.body.scrollTop;ee(i,0)}else return this.$nextTick(()=>{document.getElementsByClassName("is-error")[0].scrollIntoView({block:"center",behavior:"smooth"})}),!1})}},{default:()=>[b("\u4E0B\u4E00\u6B65")]})])])}}),Ft=I({name:"video-operation",data(){return{type:this.$route.query.type||"create"}},async created(){Xe();const e=this.$route.query;if(h.groupId=Number(e.groupId)||0,!h.groupId)return!1;try{h.loadingStatus=!0;const i=(await k.get("/api-website/videoLessonGroup/selectVideoLesson",{params:{groupId:h.groupId}})).data,t=i.lessonGroup,{auditStatus:o,lessonCoverUrl:r,lessonPrice:l,lessonDesc:n,lessonSubject:c,lessonName:u,id:p}=t,d=P(t,["auditStatus","lessonCoverUrl","lessonPrice","lessonDesc","lessonSubject","lessonName","id"]);let A=!!h.templateList.includes(r);h.lessonGroup={id:p,lessonName:u,lessonSubject:c,lessonDesc:n,lessonPrice:l,lessonCoverTemplateUrl:A?r:"",lessonCoverUrl:A?"":r},h.lessonList=[],i.detailList&&i.detailList.forEach(L=>{h.lessonList.push({videoTitle:L.videoTitle,videoContent:L.videoContent,videoUrl:L.videoUrl,coverUrl:L.coverUrl,posterUrl:L.posterUrl})}),h.loadingStatus=!1}catch{}h.lessonGroup.lessonCoverUrl&&!h.templateList.includes(h.lessonGroup.lessonCoverUrl)?h.tabIndex=2:h.tabIndex=1},async mounted(){try{const e=await k.get("/api-website/sysConfig/queryByParamName",{params:{paramName:"video_lesson_service_fee"}});h.rate=e.data.paramValue}catch{}},render(){return a(se,null,[a("div",{class:"text-base text-[#333] leading-none px-6 py-5 border-b border-b-[#E5E5E5]"},[this.type==="create"?"\u65B0\u5EFA\u89C6\u9891\u8BFE":"\u7F16\u8F91\u89C6\u9891\u8BFE"]),a("div",{class:"pt-12"},[a(ce,{class:"px-[200px]",type:"large",active:h.active},null),h.active===0&&a(Tt,null,null),h.active===1&&a(nt,null,null)])])}});export{Ft as default};
|