1 |
- System.register(["./index-legacy-07b6971b-1726219372904.js","./catchData-legacy-37d10d71-1726219372904.js","./api-legacy-52bf1c98-1726219372904.js","./index-legacy-8150a4c8-1726219372904.js","./index-legacy-a8058a04-1726219372904.js","./Scrollbar-legacy-b3b8ec19-1726219372904.js","./Cascader-legacy-8d1cf251-1726219372904.js"],(function(e,t){"use strict";var a,o,i,l,r,n,d,p,u,c,s,m,_,g,f,v,w,b,h,y,A,M,I,x,C,k,B,j,S,F,U,E,P,R,G,O,Z,D,N,T,V,z;return{setters:[e=>{a=e.d,o=e.r,i=e.b,l=e.e,r=e.A,n=e.q,d=e.b4,p=e.f,u=e.k,c=e.O,s=e.b5,m=e.E,_=e.j,g=e.x,f=e.S,v=e.U,w=e.N,b=e.w,h=e.aE,y=e.g,A=e.h,M=e.F,I=e.l,x=e.m,C=e.D,k=e.b6,B=e.P},e=>{j=e.u},e=>{S=e.u,F=e.w,U=e.x,E=e.y,P=e.z,R=e.A,G=e.B},e=>{O=e.C,Z=e.g,D=e.a,N=e.o},e=>{T=e.i},e=>{V=e.N},e=>{z=e.N}],execute:function(){var t=document.createElement("style");t.textContent='._uploadModal_eir1m_1{padding-top:2.08333333vw}._formModal_eir1m_4{min-height:45vh;padding:0 2.08333333vw}._formModal_eir1m_4 ._formSpace_eir1m_8{gap:2.08333333vw 1.25vw!important}._formModal_eir1m_4 ._previewModal_eir1m_11{position:relative;width:16.66666667vw;height:9.375vw;margin-bottom:.625vw;border:1px solid #DCE2F1;border-radius:.52083333vw;overflow:hidden}._formModal_eir1m_4 ._previewModal_eir1m_11:hover{border-color:#198cfe}._formModal_eir1m_4 ._previewModal_eir1m_11 ._image_eir1m_23{width:16.66666667vw;height:9.375vw}._formModal_eir1m_4 ._previewModal_eir1m_11 ._image_eir1m_23 img{width:inherit;height:fit-content;min-height:100%}._formModal_eir1m_4 ._previewModal_eir1m_11 ._titleType_eir1m_32{position:absolute;top:.3125vw;left:.3125vw;width:1.14583333vw;height:1.14583333vw;z-index:99}._formModal_eir1m_4 ._previewModal_eir1m_11:hover ._iconUploadDelete_eir1m_40{opacity:1;display:block}._formModal_eir1m_4 ._previewModal_eir1m_11 ._iconUploadDelete_eir1m_40{position:absolute;top:.36458333vw;right:.36458333vw;width:1.40625vw;height:1.40625vw;z-index:99;cursor:pointer;opacity:0;display:none}._formModal_eir1m_4 ._previewModal_eir1m_11 ._commonType_eir1m_55{display:flex;align-items:center;position:absolute;bottom:0;left:0;font-size:12Px;font-weight:600;color:#fff;height:2.23958333vw;width:100%;border-radius:0 0 .52083333vw .52083333vw;justify-content:space-between;padding-right:.625vw;padding-left:.625vw;z-index:99;background:rgba(0,0,0,.3);backdrop-filter:blur(1px)}._formModal_eir1m_4 ._previewModal_eir1m_11 ._commonType_eir1m_55 ._changeCover_eir1m_74{background:#FFFFFF;border-radius:.20833333vw;color:#131415!important;--n-height: 1.25vw !important;--n-padding: 0 .41666667vw !important;font-size:max(.72916667rem,12Px)}._formModal_eir1m_4 ._previewModal_eir1m_11 ._commonType_eir1m_55 .n-switch{margin-left:.41666667vw}._formModal_eir1m_4 ._previewModal_eir1m_11 ._commonType_eir1m_55 .n-switch__rail{background-color:#ccc}._formModal_eir1m_4 ._previewModal_eir1m_11 ._commonType_eir1m_55 .n-switch.n-switch--active .n-switch__rail{background-color:var(--n-rail-color-active)}._formModal_eir1m_4 ._formItem_eir1m_91{width:16.66666667vw}._formModal_eir1m_4 ._formItem_eir1m_91 .n-input{margin-bottom:.625vw}._formModal_eir1m_4 ._formItem_eir1m_91 .n-input,._formModal_eir1m_4 ._formItem_eir1m_91 .n-base-selection{border-radius:.41666667vw;font-size:.9375rem}._formModal_eir1m_4 ._formItem_eir1m_91 .n-input .n-input__input-el,._formModal_eir1m_4 ._formItem_eir1m_91 .n-base-selection .n-input__input-el,._formModal_eir1m_4 ._formItem_eir1m_91 .n-input .n-input__input-el::placeholder,._formModal_eir1m_4 ._formItem_eir1m_91 .n-base-selection .n-input__input-el::placeholder,._formModal_eir1m_4 ._formItem_eir1m_91 .n-input .n-tag__content,._formModal_eir1m_4 ._formItem_eir1m_91 .n-base-selection .n-tag__content{font-size:.9375rem}._formModal_eir1m_4 ._formItem_eir1m_91 .n-form-item-feedback-wrapper{min-height:.625vw}._formModal_eir1m_4 ._formItem_eir1m_91 .n-upload-trigger+.n-upload-file-list{margin-top:.625vw}._btnGroup_eir1m_116{padding:1.66666667vw 0}._btnGroup_eir1m_116 .n-button{height:2.44791667vw;min-width:8.125vw}._uploadFile_eir1m_123{margin-bottom:.625vw}._uploadFile_eir1m_123 .n-upload-dragger{padding:0;border:none}._uploadFile_eir1m_123 ._uploadBtn_eir1m_130{display:flex;align-items:center;justify-content:center;flex-direction:column;width:16.66666667vw;height:9.375vw;padding-top:1.04166667vw;background:#F9FAFD;border-radius:.52083333vw;border:1px solid #DCE2F1;font-size:.9375rem;color:#9eadd9}._uploadFile_eir1m_123 ._uploadBtn_eir1m_130:hover{border-color:#198cfe}._uploadFile_eir1m_123 ._uploadBtn_eir1m_130 ._iconUploadAdd_eir1m_147{width:2.60416667vw;height:2.60416667vw;margin-bottom:1.04166667vw}._uploadCover_eir1m_152{width:47.91666667vw}._uploadCover_eir1m_152 .n-card-header{padding-top:0;padding-bottom:0}._uploadCover_eir1m_152 .n-card-header .n-card-header__close{margin-top:3.38541667vw}._uploadFile_t4tbc_1 .n-upload-dragger{padding:0;border:none;display:flex;align-items:center;justify-content:center;background:#FFFFFF;border:1px solid #DCE2F1;border-radius:1.04166667vw}._uploadFile_t4tbc_1 .n-upload-dragger:hover{border-color:#198cfe}._uploadFile_t4tbc_1 ._uploadBtn_t4tbc_14{display:flex;align-items:center;justify-content:center;flex-direction:column;width:22.55208333vw;height:14.32291667vw;font-weight:600;font-size:max(.78125rem,13Px);color:#131415}._uploadFile_t4tbc_1 ._uploadBtn_t4tbc_14 span{padding-top:.67708333vw;display:block;text-align:center;font-weight:400;font-size:max(.67708333rem,11Px);color:#131415}._uploadFile_t4tbc_1 ._uploadBtn_t4tbc_14 ._iconUploadAdd_t4tbc_33{width:2.60416667vw;height:2.60416667vw;margin-bottom:1.40625vw}._uploadHeader_t4tbc_38{padding:0 1.40625vw;display:flex}._uploadHeader_t4tbc_38 ._headerItem_t4tbc_42{position:relative;padding:.88541667vw 0 .67708333vw;font-weight:600;font-size:max(.9375rem,14Px);color:#131415}._uploadHeader_t4tbc_38 ._headerItem_t4tbc_42:after{content:"";display:inline-block;position:absolute;bottom:0;width:100%;left:0;height:.15625vw;background:#198CFE}._uploadContainer_t4tbc_59{text-align:center;height:28.02083333vw;background-color:#f7f8f9;display:flex;align-items:center;justify-content:center}._uploadContainer_t4tbc_59 .n-upload{width:auto}._uploadContainer_t4tbc_59 .cropper-view-box{outline-color:#198cfe!important;outline-width:.10416667vw!important}._uploadContainer_t4tbc_59 .cropper-point{width:.26041667vw!important;height:.26041667vw!important}._uploadContainer_t4tbc_59 .cropper-bg{background-image:none!important}._uploadContainer_t4tbc_59 .cropper-modal{background-color:#f7f8f9;opacity:.7}._imgCropperSection_t4tbc_85{width:32.96875vw;height:21.19791667vw}._imgCropperSection_t4tbc_85 img{max-width:100%}._uploadBtnGroup_t4tbc_92{padding:.88541667vw 1.40625vw;display:flex;justify-content:space-between}._uploadBtnGroup_t4tbc_92 .n-button{border-radius:.41666667vw;font-size:max(.78125rem,13Px);min-width:5.05208333vw}._saveModal_ulplg_1{padding:.9375vw 1.66666667vw}._saveModal_ulplg_1 .n-upload{--n-dragger-border: 1px solid #DCE2F1 !important;--n-dragger-border-hover: 1px solid #198CFE !important;--n-border-radius: 1.35416667vw !important}._saveModal_ulplg_1 .n-upload-file-info__name a{max-width:90%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}._saveModal_ulplg_1 .n-upload-file-list{overflow:auto;max-height:30vh}._saveModal_ulplg_1 .n-upload-dragger{padding:0}._saveModal_ulplg_1 .n-upload-file-list .n-upload-file{border-radius:.41666667vw}._uploadBtn_ulplg_25{display:flex;align-items:center;justify-content:center;flex-direction:column;height:14.0625vw;background:#F9FAFD;border-radius:1.35416667vw;font-size:max(.83333333rem,12Px);color:rgba(19,20,21,.5)}._uploadBtn_ulplg_25 h3{padding-top:1.66666667vw;font-size:max(.9375rem,14Px);color:#131415}._uploadBtn_ulplg_25 p{padding-top:.83333333vw}._uploadBtn_ulplg_25:hover{border-color:#198cfe}._uploadBtn_ulplg_25:hover ._iconUploadAdd_ulplg_47{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHwAAAB8CAMAAACcwCSMAAAA21BMVEUAAAAajv8ajP8Zjf8ZjP8Zjf8ajv8Zjf8fkv8Zjf8bjv8ajf8ajf8dj/8jnv8ajf8ajf8ajP8ckP8ajf8Zjf8Zjf8Zjf8Zjf8ekf8ZjP8ajf8ajP8bj/8aj/8ZjP8ajv8ajf8bjv8ZjP8bj/8bjf8glf8nnf8ZjP8ajf8ajf8bjv8kkv8ajf8ZjP7///+fz/6azP5+vv54u/4jkf4rlf7+/v7M5v632/6x2P6RyP5ttv5jsf7u9v7o8/7B4P6ZzP6Kxf6BwP5JpP4/n/42m/7V6v6m0v5ZrP5Tqf6U52/5AAAALXRSTlMAapXS9a1R/RDUMpF7IAns2Ls++riNhWQp4dqySTnngm9fW0ImGA3IvKVzFZuSBo1aAAACdElEQVRo3u3a6W7aUBCG4Y8EbDD7DgESlpC146QFwpakWbrd/xVVhbFrMEZu5TlKm/P89J9XI3s4EjrQNO3dSbbrmfRB9NKZ3iCHfXKxYpnkxBN9BIodk7SCgZ2yh6RCJQm/Up7UODr1t8ukSj6LTdk8qZM6w4ZDUikBr5h3H066seh1a5UyuUre/T5205kcpFynTWLnuwY/tiCpHd8xetGZ24Isw5k9DUfSeRsZSLvkUhOOtjN4DtIaxLJgdXcD5BW41QHL0NoJ5CW4ZYBVaa0LeR+4Vd+evAZ5re3Je85pB3lNbllgA1orX0Nah9gQLBd3V1/ahXOw+T9Bsw1ZV+T/vPrE4gYkXZnErB2rT+ZlA1I6F+RowcOg3/JHqcPopZpxcpmbE1ZIpSo2JI9InSK2nOZJlUIS27IpUqOYhN9ZghQwq9hNRf0EAQ5IXkzHdVzHddxDx99gfPwyIg+V8fHUtic3bl5t/M7+ZUZMaXxpr70SUxmfc3xBTGX8huOfaEXHdVzHdVzH/8n4cn7r8ZXjj96HTz9k4uM7O4zpSCI+tcOZC8THdkj3AvEXO6xR9PHRJGT7QeKdfwsZf5aIj2Zh0pPPQnv+uvjo4WzezPtw8eW//IXTcR3X8RUd13HZ+BPHl8RUxr/zGcrnmNo4Pa7i7vmtNj66vbcfnsmhKu4a04b389+rjuu4jv9NPE3y6giQIXkGAvRInoUAA5I3RIBcnKSlEChB0moI1CdpFoIVSFYLexgkymxgnwpJqmKLwtthRWxReDvMfxtM3e2woq+t7HaYWUU4pXOKWquB0ErpJkUnVbPwZ7IdIxaBumENoWlvwk+UdX0ONunvpgAAAABJRU5ErkJggg==) no-repeat center;background-size:contain}._uploadBtn_ulplg_25 ._iconUploadAdd_ulplg_47{width:3.22916667vw;height:3.22916667vw;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHwAAAB8CAMAAACcwCSMAAAAb1BMVEUAAACQocyRn82Sn82Ros2Rn82Sn82RoM2RoM2RoM2Soc6QoM2dptOdqdORoM2RoM2Sos+Uos6Rn8yVos+UoNWRoM2RoM2QoMyRoc2Soc+RoMyQn82SoM2Up9GRoM2UoM6SoMyRn82Tos2SoM6Qn8xY2+B+AAAAJHRSTlMAapXSp5BwrbuEUfUOCeS0OCj6IBfse9dhMdvIWhKbPktIQkBUIuJJAAACTklEQVRo3u3aaY+iQBCA4UJsLjkVUMBjHOv//8bNZmmapdyVSahmjno+ksm84WhbSYEQ4seJ76dabZan6tN7Av+TOMEe+ez8M/yTkyK3YwRPHVy0IYuBulVoR1vQ9h5tqQ7Ta16hPe7kyrtokw9jzng9hJ6zPC8cr+IbGEk6pOsEuJQKte7ZiacNcHrb6dADBoE+7wZ4RTquQIv13aiB21ZfYtDu+sQT4FZgb1jrp2EF8Dv2rRx6dX8gBH5+3xo2GL0EPOB37VunNc4802c+vecB8Eun9/y9P7AvgVuOvSGV7Ialzy3QGxt9BPENeHlIH6/zsK9EwMi0sflr6WvbArjkAWrZ5AN/ULUuh3aHg31Blp8l9MGOW7QnINtNhbYcL7Z/MxjBBajYRxsUPMdaf7V5bZCf8yrebZfXzo07sLyNxCUucYl/rfilSdaKlz4ibpJ14h3+trUYp994izXiIf5xthinfy1xiUtc4hL/wvEoVCOu/r09Plg/eOJlh3P4CUc8w3lChniJM1UM8RznipePxzhTynHPrziPxxCf+7ZKMa3z5uSNdHptjQ+eD9/yE07iEpe4xCX+3d9M3M3ohf04ZGb/th9PVIWpt97rz8tPffcqcYlL/GP/m3867PoqTqfD2KbBDPbpMDoNZrBPh9FpMIN7OoxOgxns02F0GszgnQ6j02AUnQ5jngajIjSO/mYBVz+l02CGxekwBYS16bAACGvTYXQazN50WEDa1qbD9grmuXW4tKyA2R4qxeW4YQMfc8gjZwlRXoIQn8IvnV8v/NH/vD8AAAAASUVORK5CYII=) no-repeat center;background-size:contain}._btnGroup_ulplg_57{padding:1.66666667vw 0}._btnGroup_ulplg_57 .n-button{height:2.44791667vw;min-width:8.125vw}\n',document.head.appendChild(t);const Q={uploadModal:"_uploadModal_eir1m_1",formModal:"_formModal_eir1m_4",formSpace:"_formSpace_eir1m_8",previewModal:"_previewModal_eir1m_11",image:"_image_eir1m_23",titleType:"_titleType_eir1m_32",iconUploadDelete:"_iconUploadDelete_eir1m_40",commonType:"_commonType_eir1m_55",changeCover:"_changeCover_eir1m_74",formItem:"_formItem_eir1m_91",btnGroup:"_btnGroup_eir1m_116",uploadFile:"_uploadFile_eir1m_123",uploadBtn:"_uploadBtn_eir1m_130",iconUploadAdd:"_iconUploadAdd_eir1m_147",uploadCover:"_uploadCover_eir1m_152"},K="_uploadFile_t4tbc_1",L="_uploadBtn_t4tbc_14",H="_iconUploadAdd_t4tbc_33",Y="_uploadHeader_t4tbc_38",q="_headerItem_t4tbc_42",W="_uploadContainer_t4tbc_59",J="_imgCropperSection_t4tbc_85",X="_uploadBtnGroup_t4tbc_92",$=a({name:"upload-file",props:{img:{type:String,default:""},accept:{type:String,default:".jpg,.png,.jpeg,.gif"},bucketName:{type:String,default:"gyt"},path:{type:String,default:""},fileName:{type:String,default:""},options:{type:Object,default:()=>({viewMode:0,autoCrop:!0,enlarge:1,autoCropWidth:640,autoCropHeight:360,fixedBox:!1,previewsCircle:!0,title:"上传图片"})}},emits:["close","confirm"],setup(e,{emit:t}){const a=o(),v=`https://${e.bucketName}.ks3-cn-beijing.ksyuncs.com/`,w=i(),b=o(!1),h=o(!1),y=o(),A=o({img:"",autoCrop:!0,autoCropWidth:180,autoCropHeight:180,fixedBox:!0,full:!1,enlarge:1,previewsCircle:!0,centerBox:!0,outputType:"png",title:"修改头像",name:null}),M=l({myCropper:null,cropperReady:!1}),I=async(e,t)=>{const a=new FileReader;a.addEventListener("load",(()=>t(a.result))),a.readAsDataURL(e)},x=(t,a)=>{const o=Object.assign({},e.options,{img:t,name:a});b.value=!0,A.value=Object.assign({},A.value,o),f((()=>{C()}))},C=()=>{try{M.cropperReady=!0,M.myCropper=new O(a.value,{viewMode:1,dragMode:"move",aspectRatio:A.value.autoCropWidth/A.value.autoCropHeight,initialAspectRatio:1,autoCropArea:1,cropBoxMovable:!0,cropBoxResizable:!0,background:!0,movable:!1,modal:!0,preview:".before",ready:()=>{M.cropperReady=!1}})}catch{}},k=async a=>{try{const o=`${e.path}${e.fileName||(new Date).getTime()+".png"}`,i={filename:o,bucketName:e.bucketName,postData:{filename:o,acl:"public-read",key:o}},{data:l}=await Z(i),r={policy:l.policy,signature:l.signature,acl:"public-read",key:o,KSSAccessKeyId:l.kssAccessKeyId,name:o,file:a},n=await D(v,r);t("confirm",n),t("close")}catch{}h.value=!1};return r((()=>e.img),(()=>{e.img&&ee(e.img)===d.IMG&&x(e.img)})),n((()=>{e.img&&ee(e.img)===d.IMG&&x(e.img)})),()=>p("div",{class:K},[p("div",{class:Y},[p("div",{class:q},[u("上传封面")])]),b.value?p("div",{class:W},[p(m,{show:M.cropperReady},{default:()=>[p("div",{class:J},[A.value?.img&&p("img",{ref:a,src:A.value?.img,style:{opacity:M.myCropper?.ready?"1":"0"},alt:""},null)])]})]):p("div",{class:W},[p(c,{ref:y,accept:e.accept,multiple:!1,max:1,showFileList:!1,showPreviewButton:!0,onBeforeUpload:e=>(async e=>{const t=e.file;let a=!0;return(t.type.includes("image")?d.IMG:t.type.includes("audio")?d.SONG:d.VIDEO)!==d.IMG?(w.error("上传文件格式错误"),!1):(a=t.file.size/1024/1024<10,a?(I(t.file,(e=>{x(e,t.file.name)})),!1):(w.error("图片大小不能超过10M"),!1))})(e)},{default:()=>[p(s,null,{default:()=>[p("div",{class:L},[p("img",{src:T,class:H},null),p("p",null,[u("点击或将图片拖至此区域")]),p("span",null,[u("(建议比例16:9)")])])]})]})]),p("div",{class:X},[b.value?p(_,{type:"default",onClick:()=>{A.value.img="",b.value=!1}},{default:()=>[u("重新选择")]}):p("span",null,null),p(g,null,{default:()=>[p(_,{type:"default",onClick:()=>t("close")},{default:()=>[u("取消")]}),p(_,{type:"primary",onClick:()=>{M.myCropper.getCroppedCanvas({imageSmoothingQuality:"high"}).toBlob((e=>{h.value=!0,k(e)}))},disabled:!b.value,loading:h.value},{default:()=>[u("保存封面")]})]})])])}}),ee=e("f",(e=>e?e?.indexOf(".mp3")>-1?d.SONG:e?.indexOf(".mp4")>-1?d.VIDEO:e?.indexOf(".ppt")>-1?d.PPT:d.IMG:"")),te=(e("U",a({name:"upload-modal",props:{list:{type:Array,default:()=>[]},showDelete:{type:Boolean,default:!1},editStatus:{type:Boolean,default:!0}},emits:["close","confirm","editAll"],setup(e,{emit:t}){const a=j(),r=o(),d=i(),c=l({list:[],uploading:!1,uploadUrl:"",name:"",instrumentIds:[]}),s=l({uploadCoverStatus:!1,uploadType:"",uploadImg:null,uploadIndex:0}),m=e=>{let t=U;switch(e){case"IMG":t=U;break;case"VIDEO":t=G;break;case"SONG":t=R;break;case"MUSIC":t=P;break;case"PPT":t=E}return t},B=async()=>{r.value?.validate((async a=>{if(a)f(k);else{c.uploading=!0;try{const a=[];if(c.list.forEach((e=>{a.push({instrumentIds:e.instrumentIds.join(","),openFlag:e.openFlag,coverImg:e.coverImg,name:e.name,type:e.type,enableFlag:1,content:e.content,id:e.id||null})})),O.value){if(e.editStatus)t("editAll",a);else{const{data:e}=await S(a);d.success("保存成功"),c.list=[],t("close",!0),t("confirm",e)}c.list=[]}else await F(a),d.success("保存成功"),c.list=[],t("close",!0),t("confirm")}catch{}c.uploading=!1}}))},O=v((()=>e.list.length>0));return n((async()=>{const t=e.list||[],o=[];t.forEach((e=>{o.push({instrumentIds:e.instrumentIds?e.instrumentIds.split(",").map((e=>e)):[],openFlag:e.openFlag,coverImg:e.coverImg,name:e.title,type:e.type,sourceFrom:e.sourceFrom,enableFlag:e.enableFlag,content:e.content,id:e.id})})),c.list=o||[],await a.getSubjects()})),()=>{let o;return p("div",{class:Q.uploadModal},[p(V,{style:{"max-height":"55vh"}},{default:()=>[p(w,{ref:r,labelPlacement:"left",labelWidth:120,model:c,class:Q.formModal},{default:()=>{return[p(g,{class:Q.formSpace},(t=o=c.list.map(((t,o)=>p("div",{class:Q.formItem,key:o},[p("div",{class:Q.previewModal},[p(b,{class:[Q.titleType],src:m(t.type),previewDisabled:!0,objectFit:"cover"},null),(!O.value||e.showDelete)&&p("img",{class:[Q.iconUploadDelete],src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAAAXNSR0IArs4c6QAAA3xJREFUaEPdmk1oE1EQgL/8qQVRVATxoCIqRURBBIsHKQZqTqJgIR4EPUgbf+6Fpoq2hd79IUWwggcDFRRPsRApHkRBBEVEVEQ9iCAqilBt/syE3bJds9l922xa38Ke9r2Z+d6bmZ15uyE0u0It4BEdUUNPEagEqbPZQG3AemAtsNy4F9kApoEfxv0J+ABMNQuyGUBLgY3ABmCNT8M+A++Bd8AvnzJq0+YCtATYCWwFwnMxwjK3DLwEngK//cj0AyTxsB3YAcT8KPUwpwA8A54DEneeL1WgFcB+YJlnDXMb+BO4B3z3KkYFaB0QD3BXnGyW3coDH71AeQUS99rtRWCAYx4bbthQhReghQBjQrhCuQGJmyUCXHU/onON3K8RkCSAg/MQM26QElN3nBKFE5Ck5sMtzGZuEPbnkv1u1UvpTkDywtylqqXF458YL+BZausBSQVwZAG6mn29xPVu2iuKekB7qtu5rcWr7VfdC+ChdbIdSArNpGpt1tnZuTKZTG4ZHx9/k8/nv6pYF4/HV3V3d2/OZrOvJycnv6nMBaT2y1oLWjuQ1GgdKkIFZmJi4mwsFmsrFot/BgYGroyMjLzyIqOvr699cHDwZDQaXVwoFKa6urou+IB6ZNR8NZV2oAOqLUAmk+no6ek5bgKUSqXpdDp92Q1KYIaGhk5FIpGZfimTyVxLpVLy8lS5pPW4a06wAklzdlRFkowVl8nlcudklb1C1YOR3U0kEudVXdbQecNsEq1A7cBeVSAZX89Ap51SGatgy4Nq7Nfc3Aq0D9ikIGTWUC+GehnjU//b6mbctwMdAlb7FFib1shgeW6PGa/x5sGmL9WG87Yd6BhgP9DwIGv2EAeoYigUqoTD4ZkOt4kwYoAcvFy3AonrnVC23mFCPSjr0CbDmKKvyhGZGUOycjOptxlgBtSZSCRinsnVxJbL5UJ/f/8lt7Tuw4YxoBAo0PDw8Gmrm4mRpVKpmE6nLwYNpJ3LyeIFlhTEzSqVSsjqfk2Oo3+SggBpl7a1e7FqV/poV5xKHM1r+zA6OjrW29sr/Y3K5dg+iBDtGjztWnDZJa0OSQRIu2MsgdLqoFGAtDsKFiitDuvN94BWn1NMKK0+eC0kKNevd/ZDErdyQ6uPxiasVp/1TSitfrywuqU2v8bYY02bn5fqJREtfi9zy47/9Q+AbnCBP/8LKzUIU0rUSHAAAAAASUVORK5CYII=",onClick:()=>(e=>{c.list.splice(e,1)})(o)},null),p(b,{class:[Q.cover,Q.image],lazy:!0,previewDisabled:!0,src:t.coverImg,objectFit:"cover"},null),p("div",{class:Q.commonType},["IMG"!==t.type?p(_,{class:Q.changeCover,type:"default",bordered:!1,onClick:()=>{s.uploadIndex=o,s.uploadImg=t.coverImg,s.uploadType=t.type,s.uploadCoverStatus=!0}},{default:()=>[u("更换封面")]}):p("span",null,null),p("div",null,[u("是否公开"),p(h,{size:"small",value:t.openFlag,"onUpdate:value":e=>t.openFlag=e,disabled:"TEACHER"===t.sourceFrom&&"MUSIC"===t.type},null)])])]),p(y,{showFeedback:!1,path:`list.${o}.name`,rule:[{required:!0,message:"请输入资源名称",trigger:["input","blur"]}]},{default:()=>[p(A,{value:t.name,"onUpdate:value":e=>t.name=e,placeholder:"请输入资源名称",maxlength:25,clearable:!0},null)]}),p(y,{path:`list[${o}].instrumentIds`,showFeedback:!1,rule:[{required:!0,message:"请选择素材可用乐器",trigger:"change",type:"array"}]},{default:()=>[p(z,{value:t.instrumentIds,"onUpdate:value":e=>t.instrumentIds=e,placeholder:"请选择素材可用乐器(可多选)",options:a.getEnableSubjects,checkStrategy:"child",showPath:!1,childrenField:"instruments",expandTrigger:"hover",labelField:"name",valueField:"id",clearable:!0,filterable:!0,multiple:!0,maxTagCount:"responsive"},{action:()=>p(M,null,[p(_,{text:!0,style:" --n-width: 100% ",onClick:()=>((e,t)=>{const a=[];t.map((e=>{Array.isArray(e.instruments)&&e.instruments.forEach((e=>{a.push(e.value)}))})),e.instrumentIds=a})(t,a.getEnableSubjects)},{default:()=>[u("全选")]})])})]})]))),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!C(t)?o:{default:()=>[o]}))];var t}})]}),p(g,{class:Q.btnGroup,justify:"center"},{default:()=>[p(_,{round:!0,onClick:()=>t("close")},{default:()=>[e.editStatus?"取消":"上一步"]}),p(_,{round:!0,type:"primary",loading:c.uploading,disabled:0===c.list.length,onClick:B},{default:()=>[u("确定")]})]}),p(I,{maskClosable:x,show:s.uploadCoverStatus,"onUpdate:show":e=>s.uploadCoverStatus=e,preset:"card",showIcon:!1,class:["modalTitle ",Q.uploadCover],blockScroll:!1},{default:()=>[p($,{img:s.uploadImg,onClose:()=>s.uploadCoverStatus=!1,onConfirm:e=>{"IMG"===s.uploadType&&(c.list[s.uploadIndex].content=e),c.list[s.uploadIndex].coverImg=e}},null)]})])}}})),"_saveModal_ulplg_1"),ae="_uploadBtn_ulplg_25",oe="_iconUploadAdd_ulplg_47",ie="_btnGroup_ulplg_57";e("S",a({name:"save-modal",props:{fileList:{type:String,default:""},imageList:{type:Array,default:()=>[]},accept:{type:String,default:".jpg,.png,.jpeg,.gif"},showType:{type:String,default:"default"},showFileList:{type:Boolean,default:!0},max:{type:Number,default:1},multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},bucketName:{type:String,default:"gyt"},directoryDnd:{type:Boolean,default:!1},path:{type:String,default:""},fileName:{type:String,default:""}},emits:["close","confrim"],setup(e,{emit:t}){const a=`https://${e.bucketName}.ks3-cn-beijing.ksyuncs.com/`,r=i(),n=o(!1),m=o(!1),f=o(),w=o(),b=l([]),h=o([]),y=o([]),A=async e=>{console.log(e,"onFinishAfter");const t=b.find((t=>t.id==e.file.id)),a=ee(e.file.url);let o="";"IMG"===a?o=e.file.url:"SONG"===a?o=B.SONG_DEFAULT_COVER:"PPT"===a?o=B.PPT_DEFAULT_COVER:"VIDEO"===a&&(o=await M(t.tempFiileBuffer)),y.value.push({coverImg:o,content:e.file.url,id:e.file.id,name:e.file.name?e.file.name.slice(0,e.file.name.lastIndexOf(".")):""}),n.value=!1,m.value=!1},M=async t=>{try{m.value=!0;const o=await(e=>new Promise(((t,a)=>{const o=document.createElement("video");o.setAttribute("crossOrigin","Anonymous"),o.setAttribute("preload","auto"),o.muted=!0,o.autoplay=!0,o.src=URL.createObjectURL(e),o.addEventListener("loadedmetadata",(()=>{o.play(),setTimeout((()=>{o.currentTime=0,o.pause();const e=document.createElement("canvas");e.width=o.videoWidth,e.height=o.videoHeight,e.getContext("2d").drawImage(o,0,0,e.width,e.height),e.toBlob((e=>{t(e)}))}),500)})),o.addEventListener("error",(e=>{a(e)}))})))(t||f.value),i=`${e.path}${Date.now()+".png"}`,l={filename:i,bucketName:e.bucketName,postData:{filename:i,acl:"public-read",key:i,unknowValueField:[]}},{data:r}=await Z(l),n={policy:r.policy,signature:r.signature,key:i,acl:"public-read",KSSAccessKeyId:r.kssAccessKeyId,name:i,file:o};return await D(a,n)}finally{m.value=!1}},I=v((()=>{let e=!1;return h.value.forEach((t=>{"finished"!==t.status&&(e=!0)})),e||h.value.length<=0})),x=({file:e,action:t,onFinish:a,onError:o,onProgress:i})=>{const l=b.find((t=>t.id==e.id));l.file=e,N({file:e,action:t,data:l,onProgress:i,onFinish:a,onError:o})},C=async()=>{const e=[];h.value.forEach((t=>{const a=y.value.find((e=>e.id===t.id));a&&e.push(a)})),t("confrim",e)};return()=>p("div",{class:te},[p(c,{ref:w,action:a,customRequest:x,fileList:h.value,"onUpdate:fileList":e=>h.value=e,accept:".jpg,jpeg,.png,audio/mp3,video/mp4,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation",multiple:!0,max:10,showFileList:!0,showPreviewButton:!0,onBeforeUpload:t=>(async t=>{const a=t.file;let o=!0;if(!function(e,t){const a=function(e){return e.slice(2+(e.lastIndexOf(".")-1>>>0))}(e).toLowerCase();return t.includes(a)}(a.file.name,["jpg","jpeg","png","mp4","ppt","pptx","mp3"]))return r.error("文件格式不支持"),!1;const i=a.type.includes("image")?d.IMG:a.type.includes("audio")?d.SONG:a.type.includes("video")?d.VIDEO:a.type.includes("vnd.openxmlformats-officedocument.presentationml.presentation")||a.type.includes("vnd.ms-powerpoint")?d.PPT:"other";if("other"===i)return r.error("文件格式不支持"),!1;const l="IMG"===i?2:"SONG"===i?20:500;if(l&&(o=a.file.size/1024/1024<l,!o)){const e="IMG"===i?"图片":"SONG"===i?"音频":"视频";return r.error(`${e}大小不能超过${l}M`),!1}if(!o)return o;try{m.value=!0;const t=a.file.name,o=t.slice(t.lastIndexOf(".")),i=`${e.path}${Date.now()+a.id+o}`,l={filename:i,bucketName:e.bucketName,postData:{filename:i,acl:"public-read",key:i,unknowValueField:[]}},{data:r}=await Z(l);b.push({id:a.id,tempFiileBuffer:a.file,policy:r.policy,signature:r.signature,acl:"public-read",key:i,KSSAccessKeyId:r.kssAccessKeyId,name:i})}catch{return m.value=!1,!1}return!0})(t),onFinish:e=>{(e=>{A(e)})(e)},onRemove:e=>(async e=>{const t=y.value.findIndex((t=>t.id===e.file.id));return y.value.splice(t,1),m.value=!1,!0})(e)},{default:()=>[p(s,null,{default:()=>[p("div",{class:ae},[p("div",{class:oe},null),p("h3",null,[u("点击或者拖动文件到该区域来上传")]),p("p",null,[u("仅支持JPG、PNG、MP3、MP4、PPT格式文件,单次最多支持"),p("br",null,null),u("上传10个文件")])])]})]}),p(g,{class:ie,justify:"center"},{default:()=>[p(_,{round:!0,onClick:()=>t("close")},{default:()=>[u("取消")]}),p(_,{round:!0,type:"primary",disabled:I.value||m.value,onClick:C},{default:()=>[u("确定")]})]})])}}))}}}));
|