import{d as E,j as e,z as m,B as b,O as V,P as G,Q as R,S as r,C as q,aR as j,F as k,w as B,T as x}from"./index.394decd7.js";import{L as U}from"./index.dc786267.js";import"./index.9e0d46e4.js";import{F as I}from"./index.224299a1.js";import{S as H}from"./index.ada5e712.js";import{I as M}from"./index.ae2dd816.js";import{c as K}from"./index.926ca9c5.js";import{g as Q,m as W}from"./music.8e2b5f5b.js";import{C as J}from"./index.e6e212d8.js";import{T as X}from"./index.88270f6d.js";import"./use-tab-status.723110ee.js";import"./use-id.e2f22365.js";import"./index.75a0444f.js";import"./index.b9aedd1d.js";var Y="./assets/music-icon.fd0e8ce9.png";const Z="_item_18izn_1",$="_header_18izn_8",ee="_mate_18izn_14",ae="_icon_18izn_19",te="_info_18izn_25",se="_btn_18izn_53",ue="_vip_18izn_61",le="_free_18izn_65",oe="_charge_18izn_69",ne="_footer_18izn_73",re="_user_18izn_78",ie="_userIcon_18izn_84",ce="_favorite_18izn_92",de="_tags_18izn_95";var i={item:Z,header:$,mate:ee,icon:ae,info:te,btn:se,vip:ue,free:le,charge:oe,footer:ne,user:re,userIcon:ie,favorite:ce,tags:de};const me={CHARGE:"\u70B9\u64AD",FREE:"\u514D\u8D39",VIP:"VIP"};let N;(function(t){t.UNPASS="\u62D2\u7EDD",t.DOING="\u5BA1\u6838\u4E2D",t.PASS="\u901A\u8FC7"})(N||(N={}));let C;(function(t){t.UNPASS="#f56c6c",t.DOING="#909399",t.PASS="#67c23a"})(C||(C={}));var ve=E({name:"MusicItem",props:{data:{type:Object,default:{}},onClick:{type:Function}},emits:["favorite"],setup({onClick:t,data:o}){return()=>{const h=o.musicPrice>0?"charge":"free";return e("div",{class:i.item,onClick:()=>{t==null||t(o)}},[e("header",{class:i.header},[e("div",{class:i.mate},[e(M,{src:Y,round:!0,class:i.icon},null),e("div",{class:i.info},[e("h4",{class:"van-multi-ellipsis--l2"},[o.musicSheetName]),e("p",null,[e("div",null,[e("span",null,[m("\u5BA1\u6838\u72B6\u6001:")," ",e("b",{style:{color:C[o.auditStatus],fontWeight:"bold"}},[N[o.auditStatus]])]),e("span",null,[m("\u4E0A\u4F20\u4F5C\u8005: "),o.username])]),e("div",null,[e("span",null,[m("\u6536\u8D39\u4EF7\u683C: "),o.musicPrice,m("\u5143")]),e("span",null,[m("\u5BA1\u6279\u4EBA\u5458: "),o.auditName])])])])]),e("div",{class:i.buttons},[e(b,{class:K(i.btn,i[h])},{default:()=>[me[h.toLocaleUpperCase()]]})])])])}}});const fe=()=>{};var Oe=E({name:"ReviewList",props:{hideSearch:{type:Boolean,default:!1},defauleParams:{type:Object,default:()=>({})},onItemClick:{type:Function,default:fe},teacherId:{type:String||Number,default:""}},setup({hideSearch:t,defauleParams:o,onItemClick:h,teacherId:pe},{expose:L}){localStorage.setItem("behaviorId",Q());const _=V();G();const z={},D=_.query;D.version&&(z.version=D.version||"");const c=R({search:_.query.search||"",musicTagIds:_.query.tagids||"",page:1,...z,...o}),s=r(null),v=r(!1),P=r(!1),S=r(!1),T=r(!1),g=a=>{c.page=1,c.search=a,s.value=null,y()},y=async()=>{var a;if(!v.value){v.value=!0,S.value=!1;try{const l=await B.post("/api-admin/music/sheet/audit/list",{data:{...c}});if(s.value){const p=(((a=s.value)==null?void 0:a.rows)||[]).concat(l.data.rows||[]);s.value.rows=p}s.value=s.value||l.data,c.page=l.data.pageNo+1,P.value=l.data.pageNo>=l.data.totalPage}catch{S.value=!0}v.value=!1}};L({onSearch:g,onComfirm:a=>{const l=Object.values(a).flat().filter(Boolean).join(",");c.musicTagIds=l,c.page=1,s.value=null,y(),T.value=!1}});const d=r(""),u=r(null),f=r(!1),A=async a=>{try{await B.post("/api-admin/music/sheet/audit",{data:a}),x.success("\u63D0\u4EA4\u6210\u529F"),f.value=!1,d.value="",g(c.search)}catch{}};return()=>e(k,null,[e(U,{loading:v.value,finished:P.value,"finished-text":s.value&&s.value.rows.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:y,error:S.value},{default:()=>[!t&&e(X,null,{default:()=>[e(J,{border:!1},null),e(H,{onSearch:g},null)]}),s.value&&s.value.rows.length?s.value.rows.map(a=>e(ve,{data:a,onClick:()=>{u.value={...a},f.value=!0,console.log(a)}},null)):!v.value&&e(q,{tips:"\u6682\u65E0\u66F2\u76EE",classImgSize:"SMALL",btnStatus:!1},null)]}),e(j,{position:"bottom",closeable:!0,style:{minHeight:"30%"},show:!!u.value&&f.value,onClosed:()=>u.value=null,onClose:()=>f.value=!1,teleport:"body",round:!0},{default:()=>{var a,l,p,F,w,O;return[e(I,{label:"\u66F2\u76EE\u540D\u79F0",readonly:!0,modelValue:(a=u.value)==null?void 0:a.musicSheetName},null),e(I,{label:"\u66F2\u8C31\u68C0\u67E5",readonly:!0,isLink:!0,modelValue:"\u7ACB\u5373\u67E5\u770B",onClick:()=>{var n;return W({id:(n=u.value)==null?void 0:n.musicSheetId},void 0,{client:"teacher"})}},null),((l=u.value)==null?void 0:l.auditStatus)==="DOING"?e(k,null,[e(I,{readonly:((p=u.value)==null?void 0:p.auditStatus)!=="DOING",modelValue:d.value,"onUpdate:modelValue":n=>d.value=n,rows:"3",clearable:!0,autosize:!0,label:"\u5BA1\u6838\u7406\u7531",type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u5BA1\u6838\u7406\u7531",required:((F=u.value)==null?void 0:F.auditStatus)==="DOING"},null),e("div",{style:{display:"flex"}},[e(b,{disabled:!d.value&&((w=u.value)==null?void 0:w.auditStatus)==="DOING",block:!0,type:"danger",onClick:()=>{var n;return A({musicSheetId:(n=u.value)==null?void 0:n.musicSheetId,authStatus:"UNPASS",remark:d.value})}},{default:()=>[m("\u62D2\u7EDD")]}),e(b,{disabled:!d.value&&((O=u.value)==null?void 0:O.auditStatus)==="DOING",block:!0,type:"primary",onClick:()=>{var n;return A({musicSheetId:(n=u.value)==null?void 0:n.musicSheetId,authStatus:"PASS",remark:d.value})}},{default:()=>[m("\u540C\u610F")]})])]):null]}})])}});export{Oe as default};