index-legacy-0204908a-1743496079034.js 24 KB

1
  1. System.register(["./index-legacy-db852529-1743496079034.js","./catchData-legacy-30876512-1743496079034.js","./index-legacy-8fd68c23-1743496079034.js","./index-legacy-c3e0751f-1743496079034.js","./index-legacy-9a3f9a23-1743496079034.js","./Scrollbar-legacy-0667fe62-1743496079034.js","./Cascader-legacy-de005957-1743496079034.js"],(function(e,t){"use strict";var a,o,l,n,i,r,d,p,u,s,c,_,m,g,f,y,v,b,w,h,A,I,q,M,x,C,k,B,j,S,F,U,E,P,R,G,Z,N,O,D,T,V,z;return{setters:[e=>{a=e.d,o=e.r,l=e.b,n=e.e,i=e.a5,r=e.q,d=e.bn,p=e.f,u=e.k,s=e.ah,c=e.bo,_=e.a9,m=e.j,g=e.x,f=e.ak,y=e.J,v=e.N,b=e.w,w=e.aR,h=e.g,A=e.h,I=e.ac,q=e.l,M=e.m,x=e.a8,C=e.bp,k=e.P},e=>{B=e.u,j=e.b,S=e.d,F=e.e},e=>{U=e.v,E=e.w,P=e.x,R=e.y,G=e.z},e=>{Z=e.C,N=e.g,O=e.a,D=e.o},e=>{T=e.i},e=>{V=e.N},e=>{z=e.N}],execute:function(){var t=document.createElement("style");t.textContent='._uploadModal_q67y7_1{padding-top:2.08333333vw}._mb12_q67y7_4{margin-bottom:.625vw}._formModal_q67y7_7{min-height:45vh;padding:0 2.08333333vw}._formModal_q67y7_7 ._formSpace_q67y7_11{gap:2.08333333vw 1.25vw!important}._formModal_q67y7_7 ._previewModal_q67y7_14{position:relative;width:16.66666667vw;height:9.375vw;margin-bottom:.625vw;border:1px solid #DCE2F1;border-radius:.52083333vw;overflow:hidden}._formModal_q67y7_7 ._previewModal_q67y7_14:hover{border-color:#198cfe}._formModal_q67y7_7 ._previewModal_q67y7_14 ._image_q67y7_26{width:16.66666667vw;height:9.375vw}._formModal_q67y7_7 ._previewModal_q67y7_14 ._image_q67y7_26 img{width:inherit;height:fit-content;min-height:100%}._formModal_q67y7_7 ._previewModal_q67y7_14 ._titleType_q67y7_35{position:absolute;top:.3125vw;left:.3125vw;width:1.14583333vw;height:1.14583333vw;z-index:99}._formModal_q67y7_7 ._previewModal_q67y7_14:hover ._iconUploadDelete_q67y7_43{opacity:1;display:block}._formModal_q67y7_7 ._previewModal_q67y7_14 ._iconUploadDelete_q67y7_43{position:absolute;top:.36458333vw;right:.36458333vw;width:1.40625vw;height:1.40625vw;z-index:99;cursor:pointer;opacity:0;display:none}._formModal_q67y7_7 ._previewModal_q67y7_14 ._commonType_q67y7_58{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_q67y7_7 ._previewModal_q67y7_14 ._commonType_q67y7_58 ._changeCover_q67y7_77{background:#FFFFFF;border-radius:.20833333vw;color:#131415!important;--n-height: 1.25vw !important;--n-padding: 0 .41666667vw !important;font-size:max(.72916667rem,12Px)}._formModal_q67y7_7 ._previewModal_q67y7_14 ._commonType_q67y7_58 .n-switch{margin-left:.41666667vw}._formModal_q67y7_7 ._previewModal_q67y7_14 ._commonType_q67y7_58 .n-switch__rail{background-color:#ccc}._formModal_q67y7_7 ._previewModal_q67y7_14 ._commonType_q67y7_58 .n-switch.n-switch--active .n-switch__rail{background-color:var(--n-rail-color-active)}._formModal_q67y7_7 ._formItem_q67y7_94{width:16.66666667vw}._formModal_q67y7_7 ._formItem_q67y7_94 .n-input{margin-bottom:.625vw}._formModal_q67y7_7 ._formItem_q67y7_94 .n-input,._formModal_q67y7_7 ._formItem_q67y7_94 .n-base-selection{border-radius:.41666667vw;font-size:.9375rem}._formModal_q67y7_7 ._formItem_q67y7_94 .n-input .n-input__input-el,._formModal_q67y7_7 ._formItem_q67y7_94 .n-base-selection .n-input__input-el,._formModal_q67y7_7 ._formItem_q67y7_94 .n-input .n-input__input-el::placeholder,._formModal_q67y7_7 ._formItem_q67y7_94 .n-base-selection .n-input__input-el::placeholder,._formModal_q67y7_7 ._formItem_q67y7_94 .n-input .n-tag__content,._formModal_q67y7_7 ._formItem_q67y7_94 .n-base-selection .n-tag__content{font-size:.9375rem}._formModal_q67y7_7 ._formItem_q67y7_94 .n-form-item-feedback-wrapper{min-height:.625vw}._formModal_q67y7_7 ._formItem_q67y7_94 .n-upload-trigger+.n-upload-file-list{margin-top:.625vw}._btnGroup_q67y7_119{padding:1.66666667vw 0}._btnGroup_q67y7_119 .n-button{height:2.44791667vw;min-width:8.125vw}._uploadFile_q67y7_126{margin-bottom:.625vw}._uploadFile_q67y7_126 .n-upload-dragger{padding:0;border:none}._uploadFile_q67y7_126 ._uploadBtn_q67y7_133{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_q67y7_126 ._uploadBtn_q67y7_133:hover{border-color:#198cfe}._uploadFile_q67y7_126 ._uploadBtn_q67y7_133 ._iconUploadAdd_q67y7_150{width:2.60416667vw;height:2.60416667vw;margin-bottom:1.04166667vw}._uploadCover_q67y7_155{width:47.91666667vw}._uploadCover_q67y7_155 .n-card-header{padding-top:0;padding-bottom:0}._uploadCover_q67y7_155 .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_q67y7_1",mb12:"_mb12_q67y7_4",formModal:"_formModal_q67y7_7",formSpace:"_formSpace_q67y7_11",previewModal:"_previewModal_q67y7_14",image:"_image_q67y7_26",titleType:"_titleType_q67y7_35",iconUploadDelete:"_iconUploadDelete_q67y7_43",commonType:"_commonType_q67y7_58",changeCover:"_changeCover_q67y7_77",formItem:"_formItem_q67y7_94",btnGroup:"_btnGroup_q67y7_119",uploadFile:"_uploadFile_q67y7_126",uploadBtn:"_uploadBtn_q67y7_133",iconUploadAdd:"_iconUploadAdd_q67y7_150",uploadCover:"_uploadCover_q67y7_155"},K="_uploadFile_t4tbc_1",L="_uploadBtn_t4tbc_14",H="_iconUploadAdd_t4tbc_33",Y="_uploadHeader_t4tbc_38",W="_headerItem_t4tbc_42",J="_uploadContainer_t4tbc_59",X="_imgCropperSection_t4tbc_85",$="_uploadBtnGroup_t4tbc_92",ee=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(),y=`https://${e.bucketName}.ks3-cn-beijing.ksyuncs.com/`,v=l(),b=o(!1),w=o(!1),h=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}),I=n({myCropper:null,cropperReady:!1}),q=async(e,t)=>{const a=new FileReader;a.addEventListener("load",(()=>t(a.result))),a.readAsDataURL(e)},M=(t,a)=>{const o=Object.assign({},e.options,{img:t,name:a});b.value=!0,A.value=Object.assign({},A.value,o),f((()=>{x()}))},x=()=>{try{I.cropperReady=!0,I.myCropper=new Z(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:()=>{I.cropperReady=!1}})}catch{}},C=async a=>{try{const o=`${e.path}${e.fileName||(new Date).getTime()+".png"}`,l={filename:o,bucketName:e.bucketName,postData:{filename:o,acl:"public-read",key:o}},{data:n}=await N(l),i={policy:n.policy,signature:n.signature,acl:"public-read",key:o,KSSAccessKeyId:n.kssAccessKeyId,name:o,file:a},r=await O(y,i);t("confirm",r),t("close")}catch{}w.value=!1};return i((()=>e.img),(()=>{e.img&&te(e.img)===d.IMG&&M(e.img)})),r((()=>{e.img&&te(e.img)===d.IMG&&M(e.img)})),()=>p("div",{class:K},[p("div",{class:Y},[p("div",{class:W},[u("上传封面")])]),b.value?p("div",{class:J},[p(_,{show:I.cropperReady},{default:()=>[p("div",{class:X},[A.value?.img&&p("img",{ref:a,src:A.value?.img,style:{opacity:I.myCropper?.ready?"1":"0"},alt:""},null)])]})]):p("div",{class:J},[p(s,{ref:h,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?(v.error("上传文件格式错误"),!1):(a=t.file.size/1024/1024<10,a?(q(t.file,(e=>{M(e,t.file.name)})),!1):(v.error("图片大小不能超过10M"),!1))})(e)},{default:()=>[p(c,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:$},[b.value?p(m,{type:"default",onClick:()=>{A.value.img="",b.value=!1}},{default:()=>[u("重新选择")]}):p("span",null,null),p(g,null,{default:()=>[p(m,{type:"default",onClick:()=>t("close")},{default:()=>[u("取消")]}),p(m,{type:"primary",onClick:()=>{I.myCropper.getCroppedCanvas({imageSmoothingQuality:"high"}).toBlob((e=>{w.value=!0,C(e)}))},disabled:!b.value,loading:w.value},{default:()=>[u("保存封面")]})]})])])}}),te=e("f",(e=>e?e?.indexOf(".mp3")>-1?d.SONG:e?.indexOf(".mp4")>-1?d.VIDEO:e?.indexOf(".ppt")>-1?d.PPT:d.IMG:"")),ae=(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=B(),i=o(),d=l(),s=o([]),c=n({list:[],uploading:!1,uploadUrl:"",name:"",instrumentIds:[]}),_=n({uploadCoverStatus:!1,uploadType:"",uploadImg:null,uploadIndex:0}),k=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},Z=async()=>{i.value?.validate((async a=>{if(a)f(C);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,tagIds:e.tagIds?.join(","),type:e.type,enableFlag:1,content:e.content,id:e.id||null})})),N.value){if(e.editStatus)t("editAll",a);else{const{data:e}=await j(a);d.success("保存成功"),c.list=[],t("close",!0),t("confirm",e)}c.list=[]}else await S(a),d.success("保存成功"),c.list=[],t("close",!0),t("confirm")}catch{}c.uploading=!1}}))},N=y((()=>e.list.length>0));return r((async()=>{await a.getSubjects(),await(async()=>{const e=await F({page:1,rows:1e3}),t=e.data.rows||[];200===e.code&&Array.isArray(t)&&(s.value=t.map((e=>({label:e.name,value:e.id}))))})();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,tagIds:e.tagIds?.split(","),id:e.id})})),c.list=o||[]})),()=>{let o;return p("div",{class:Q.uploadModal},[p(V,{style:{"max-height":"55vh"}},{default:()=>[p(v,{ref:i,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:k(t.type),previewDisabled:!0,objectFit:"cover"},null),(!N.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(m,{class:Q.changeCover,type:"default",bordered:!1,onClick:()=>{_.uploadIndex=o,_.uploadImg=t.coverImg,_.uploadType=t.type,_.uploadCoverStatus=!0}},{default:()=>[u("更换封面")]}):p("span",null,null),p("div",null,[u("是否公开"),p(w,{size:"small",value:t.openFlag,"onUpdate:value":e=>t.openFlag=e,disabled:"TEACHER"===t.sourceFrom&&"MUSIC"===t.type},null)])])]),p(h,{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(h,{class:Q.mb12,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,{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("全选")]})})]}),p(h,{path:`list[${o}].tagIds`,showFeedback:!1},{default:()=>[p(I,{placeholder:"请选择资源标签(最多选择3个)",options:s.value,clearable:!0,filterable:!0,multiple:!0,maxTagCount:"responsive",value:t.tagIds,"onUpdate:value":e=>{e.length>3?(t.tagIds=e.slice(0,3),d.info("最多选择3个标签")):t.tagIds=e}},null)]})]))),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!x(t)?o:{default:()=>[o]}))];var t}})]}),p(g,{class:Q.btnGroup,justify:"center"},{default:()=>[p(m,{round:!0,onClick:()=>t("close")},{default:()=>[e.editStatus?"取消":"上一步"]}),p(m,{round:!0,type:"primary",loading:c.uploading,disabled:0===c.list.length,onClick:Z},{default:()=>[u("确定")]})]}),p(q,{maskClosable:M,show:_.uploadCoverStatus,"onUpdate:show":e=>_.uploadCoverStatus=e,preset:"card",showIcon:!1,class:["modalTitle ",Q.uploadCover],blockScroll:!1},{default:()=>[p(ee,{img:_.uploadImg,onClose:()=>_.uploadCoverStatus=!1,onConfirm:e=>{"IMG"===_.uploadType&&(c.list[_.uploadIndex].content=e),c.list[_.uploadIndex].coverImg=e}},null)]})])}}})),"_saveModal_ulplg_1"),oe="_uploadBtn_ulplg_25",le="_iconUploadAdd_ulplg_47",ne="_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/`,i=l(),r=o(!1),_=o(!1),f=o(),v=o(),b=n([]),w=o([]),h=o([]),A=async e=>{console.log(e,"onFinishAfter");const t=b.find((t=>t.id==e.file.id)),a=te(e.file.url);let o="";"IMG"===a?o=e.file.url:"SONG"===a?o=k.SONG_DEFAULT_COVER:"PPT"===a?o=k.PPT_DEFAULT_COVER:"VIDEO"===a&&(o=await I(t.tempFiileBuffer)),h.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(".")):""}),r.value=!1,_.value=!1},I=async t=>{try{_.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),l=`${e.path}${Date.now()+".png"}`,n={filename:l,bucketName:e.bucketName,postData:{filename:l,acl:"public-read",key:l,unknowValueField:[]}},{data:i}=await N(n),r={policy:i.policy,signature:i.signature,key:l,acl:"public-read",KSSAccessKeyId:i.kssAccessKeyId,name:l,file:o};return await O(a,r)}finally{_.value=!1}},q=y((()=>{let e=!1;return w.value.forEach((t=>{"finished"!==t.status&&(e=!0)})),e||w.value.length<=0})),M=({file:e,action:t,onFinish:a,onError:o,onProgress:l})=>{const n=b.find((t=>t.id==e.id));n.file=e,D({file:e,action:t,data:n,onProgress:l,onFinish:a,onError:o})},x=async()=>{const e=[];w.value.forEach((t=>{const a=h.value.find((e=>e.id===t.id));a&&e.push(a)})),t("confrim",e)};return()=>p("div",{class:ae},[p(s,{ref:v,action:a,customRequest:M,fileList:w.value,"onUpdate:fileList":e=>w.value=e,accept:".jpg,jpeg,.png,audio/mp3,video/mp4",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","mp3"]))return i.error("文件格式不支持"),!1;const l=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"===l)return i.error("文件格式不支持"),!1;const n="IMG"===l?2:"SONG"===l?20:500;if(n&&(o=a.file.size/1024/1024<n,!o)){const e="IMG"===l?"图片":"SONG"===l?"音频":"视频";return i.error(`${e}大小不能超过${n}M`),!1}if(!o)return o;try{_.value=!0;const t=a.file.name,o=t.slice(t.lastIndexOf(".")),l=`${e.path}${Date.now()+a.id+o}`,n={filename:l,bucketName:e.bucketName,postData:{filename:l,acl:"public-read",key:l,unknowValueField:[]}},{data:i}=await N(n);b.push({id:a.id,tempFiileBuffer:a.file,policy:i.policy,signature:i.signature,acl:"public-read",key:l,KSSAccessKeyId:i.kssAccessKeyId,name:l})}catch{return _.value=!1,!1}return!0})(t),onFinish:e=>{(e=>{A(e)})(e)},onRemove:e=>(async e=>{const t=h.value.findIndex((t=>t.id===e.file.id));return h.value.splice(t,1),_.value=!1,!0})(e)},{default:()=>[p(c,null,{default:()=>[p("div",{class:oe},[p("div",{class:le},null),p("h3",null,[u("点击或者拖动文件到该区域来上传")]),p("p",null,[u("仅支持JPG、PNG、MP3、MP4,单次最多支持"),p("br",null,null),u("上传10个文件")])])]})]}),p(g,{class:ne,justify:"center"},{default:()=>[p(m,{round:!0,onClick:()=>t("close")},{default:()=>[u("取消")]}),p(m,{round:!0,type:"primary",disabled:q.value||_.value,onClick:x},{default:()=>[u("确定")]})]})])}}))}}}));