import{a as G}from"./api.DNygNRg8.js";import{G as N}from"./api.CAL9rITU.js";import{a as U,r,q as D,aj as n,c as m,o as s,b,J as y,S as e,K as o,R as V,a9 as x,P as I,Q as S}from"./vue.YrNK8sx4.js";import{_ as j}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./index.BKEMpsLA.js";const q={class:"ranking-panel"},z={class:"panel-header"},E={key:1,class:"empty-tip"},F=U({__name:"BorrowRankingList",setup(J){const v=r("all"),d=r(null),k=r(""),u=r([]),i=r(""),_=async()=>{const t={type:v.value};d.value&&(t.start=d.value[0],t.end=d.value[1]),k.value&&(t.keyword=k.value),i.value&&(t.tag_id=i.value);const a=await G(t);a.code===2e3?u.value=a.data.borrow_count_ranking:u.value=[]},w=r([]),B=async()=>{const t=await N({page:1,page_size:20});t.code===2e3&&(w.value=t.data)};return D(()=>{_(),B()}),(t,a)=>{const p=n("el-option"),h=n("el-select"),g=n("el-col"),C=n("el-date-picker"),R=n("el-row"),c=n("el-table-column"),L=n("el-tag"),T=n("el-table");return s(),m("div",q,[a[3]||(a[3]=b("div",{class:"panel-title"},[b("div",{class:"title"},"单台设备累计借用次数排名")],-1)),b("div",z,[e(R,{gutter:24},{default:o(()=>[e(g,{span:6},{default:o(()=>[e(h,{modelValue:v.value,"onUpdate:modelValue":a[0]||(a[0]=l=>v.value=l),clearable:"",placeholder:"借用类型",style:{width:"140px"},onChange:_},{default:o(()=>[e(p,{label:"全部",value:"all"}),e(p,{label:"常规借用",value:"regular"}),e(p,{label:"课堂借用",value:"classroom"}),e(p,{label:"特殊借用",value:"special"})]),_:1},8,["modelValue"])]),_:1}),e(g,{span:12},{default:o(()=>[e(C,{modelValue:d.value,"onUpdate:modelValue":a[1]||(a[1]=l=>d.value=l),type:"daterange","start-placeholder":"开始日期","end-placeholder":"结束日期",clearable:"",onChange:_},null,8,["modelValue"])]),_:1}),e(g,{span:6},{default:o(()=>[e(h,{clearable:"",modelValue:i.value,"onUpdate:modelValue":a[2]||(a[2]=l=>i.value=l),placeholder:"标签类型",style:{"margin-left":"30%",width:"140px"},onChange:_},{default:o(()=>[(s(!0),m(V,null,x(w.value,l=>(s(),y(p,{key:l.id,label:l.name,value:l.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),u.value.length?(s(),y(T,{key:0,data:u.value,style:{width:"100%","margin-top":"20px",height:"350px"},"max-height":"500"},{default:o(()=>[e(c,{type:"index",label:"排名",width:"60"}),e(c,{prop:"device_name",label:"设备名"}),e(c,{prop:"device_name",label:"标签名"},{default:o(l=>[(s(!0),m(V,null,x(l.row.device_tags,f=>(s(),y(L,{key:f,type:f.type},{default:o(()=>[I(S(f.name),1)]),_:2},1032,["type"]))),128))]),_:1}),e(c,{prop:"device_code",label:"设备编号"}),e(c,{prop:"borrow_count",label:"借用次数"})]),_:1},8,["data"])):(s(),m("div",E,"暂无数据"))])}}}),H=j(F,[["__scopeId","data-v-270511ea"]]);export{H as default};
