import{_ as S}from"./index.76a66f15.js";import{bj as E,a$ as g,C as h,D as F,b1 as p,b2 as a,aJ as s,aV as d,b3 as c,E as y,cd as A,bo as I,bs as L,bS as N,bE as T,bU as V,cf as z,bV as J,bL as j}from"./arco.f3c60d68.js";const q={components:{},data(){return{pageParams:{id:""},tableLoading:!1,collapsed:!1,rowSelection:{type:"checkbox",showCheckedAll:!0,onlyCurrent:!1},scroll:{x:1030},columns:[{title:"\u7528\u6237",slotName:"user",width:330,fixed:"left"},{title:"\u6253\u8D4F\u793C\u7269",slotName:"gift",width:100},{title:"\u91D1\u989D",slotName:"price",dataIndex:"price",width:100,sortable:{sortDirections:["ascend","descend"]}},{title:"\u5173\u8054\u8BA2\u5355",slotName:"order",width:260,align:"center"},{title:"\u8D60\u9001\u65F6\u95F4",slotName:"createtime",dataIndex:"createtime",width:230,sortable:{sortDirections:["ascend","descend"]}},{title:"\u64CD\u4F5C",slotName:"operations",width:70,fixed:"right"}],data:[],dataTotal:0,searchParams:{sort:"createtime",order:"desc",offset:0,limit:10},searchFieldType:{"user.username":"LIKE",order_no:"LIKE",createtime:"RANGE",live_id:"="},searchFilter:{live_id:0,order_no:"","user.username":"",createtime:""},tableCheckedList:[],is_install_live_gift:!1}},props:{},watch:{},computed:{},mounted(){this.pageParams=this.$route.params,this.searchFilter.live_id=this.$route.params.id,this.checkInstallLiveGift()},methods:{getSearchParams(){this.searchParams.op="",this.searchParams.filter="";var t=this.searchParams,e={},m={};if(this.searchFilter){for(var l in this.searchFilter)this.searchFilter[l]!==""&&(l=="createtime"&&this.searchFilter[l]&&this.searchFilter[l]?e[l]=this.searchFilter[l].join(" - "):e[l]=this.searchFilter[l],m[l]=this.searchFieldType[l]);JSON.stringify(e)!=="{}"&&(t.op=JSON.stringify(m),t.filter=JSON.stringify(e))}return t},getData(){this.tableLoading=!0,this.$request.post("admin/live/gift_log/index",this.getSearchParams()).then(t=>{this.data=t.data.rows,this.attr=t.data.attr,this.goodsSelectIds=t.data.select_goods_ids,this.dataTotal=t.data.total,this.tableLoading=!1})},pageChange(t){this.searchParams.offset=t,this.getData()},pageSizeChange(t){this.searchParams.limit=t,this.refresh()},handleChange(t,e,m){e.type=="sorter"&&e.sorter&&(this.searchParams.order=e.sorter.direction=="ascend"?"asc":"desc",this.searchParams.sort=e.sorter.field,this.refresh())},refresh(){this.searchParams.offset=0,this.getData()},delBatch(){this.del(this.tableCheckedList)},delAlone(t){this.del([t])},del(t){if(!t)return this.$message.warning("\u8BF7\u5148\u9009\u62E9\u8981\u5220\u9664\u7684\u8BB0\u5F55"),!1;E.warning({title:"\u63D0\u793A",titleAlign:"start",content:"\u786E\u5B9A\u8981\u5220\u9664\u9009\u4E2D\u8BB0\u5F55\u5417",hideCancel:!1,onOk:()=>{this.$request.post("admin/live/gift_log/del",{ids:t}).then(e=>{this.$message.success(e.msg),this.refresh()}).catch(e=>{this.$message.error(e.msg)})}})},tablecheckedChange(t){this.tableCheckedList=t},order(t){this.$router.push({name:"order.detail",params:{order_no:t}})},download(){this.$message.info("\u5F00\u59CB\u5BFC\u51FA"),this.$request.download("admin/live/gift_log/download",{live_id:this.pageParams.id})},checkInstallLiveGift(){this.is_install_live_gift=!1,this.$request.post("admin/app/project/app/isInstall",{tag:"live_gift"}).then(t=>{this.is_install_live_gift=!0,this.refresh()}).catch(t=>{})}}};const O={key:1},G={style:{width:"100%"}};function U(t,e,m,l,i,o){const w=A,k=g("icon-refresh"),u=I,v=g("icon-cloud-download"),_=L,f=N,C=T,b=V,P=g("user-item"),x=z,B=J,D=j;return h(),F("div",null,[i.is_install_live_gift?(h(),p(D,{key:1,"body-style":{padding:"10px"},bordered:!1},{default:a(()=>[s(b,{style:{"margin-bottom":"16px"}},{default:a(()=>[s(f,{span:12},{default:a(()=>[s(_,null,{default:a(()=>[s(u,{type:"primary",onClick:o.refresh},{icon:a(()=>[s(k)]),_:1},8,["onClick"]),s(u,{onClick:o.download},{icon:a(()=>[s(v)]),default:a(()=>[e[3]||(e[3]=d(" \u5BFC\u51FA\u8BB0\u5F55 ",-1))]),_:1},8,["onClick"])]),_:1})]),_:1}),s(f,{span:12,style:{display:"flex","align-items":"center","justify-content":"end"}},{default:a(()=>[s(_,null,{default:a(()=>[s(C,{modelValue:i.searchFilter["user.username"],"onUpdate:modelValue":e[0]||(e[0]=r=>i.searchFilter["user.username"]=r),onPressEnter:o.refresh,style:{width:"220px"},placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D"},null,8,["modelValue","onPressEnter"]),s(C,{modelValue:i.searchFilter.order_no,"onUpdate:modelValue":e[1]||(e[1]=r=>i.searchFilter.order_no=r),onPressEnter:o.refresh,style:{width:"220px"},placeholder:"\u8BF7\u8F93\u5165\u8BA2\u5355\u53F7"},null,8,["modelValue","onPressEnter"]),s(u,{type:"primary",onClick:o.refresh},{default:a(()=>[...e[4]||(e[4]=[d("\u641C\u7D22",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1}),s(B,{"row-key":"id",scroll:i.scroll,pagination:{total:i.dataTotal,defaultPageSize:i.searchParams.limit,showTotal:!0,showPageSize:!0,showJumper:!0},"row-selection":i.rowSelection,bordered:!1,columns:i.columns,data:i.data,loading:i.tableLoading,onPageChange:o.pageChange,onPageSizeChange:o.pageSizeChange,onChange:o.handleChange,onSelectionChange:o.tablecheckedChange},{rank:a(({rowIndex:r})=>[d(c(r+1),1)]),user:a(({record:r})=>[r.user.id?(h(),p(P,{key:0,userinfo:r.user},null,8,["userinfo"])):(h(),F("span",O,"-"))]),gift:a(({rowIndex:r,record:n})=>[s(x,{color:"orange"},{default:a(()=>[d(c(n.name)+"\xD7"+c(n.count),1)]),_:2},1024)]),price:a(({rowIndex:r,record:n})=>[d(" \xA5"+c(n.price),1)]),createtime:a(({rowIndex:r,record:n})=>[y("span",null,c(t.$format.formatDate(n.createtime)),1)]),order:a(({rowIndex:r,record:n})=>[s(u,{type:"text",onClick:K=>o.order(n.order_no)},{default:a(()=>[d(c(n.order_no),1)]),_:2},1032,["onClick"])]),operations:a(({record:r})=>[s(_,{size:10},{default:a(()=>[s(u,{style:{padding:"0"},type:"text",onClick:n=>o.delAlone(r.id)},{default:a(()=>[...e[5]||(e[5]=[d(" \u5220\u9664 ",-1)])]),_:1},8,["onClick"])]),_:2},1024)]),"pagination-left":a(()=>[y("div",G,[s(b,{gutter:24},{default:a(()=>[s(f,{span:20},{default:a(()=>[s(_,null,{default:a(()=>[s(u,{onClick:e[2]||(e[2]=r=>o.delBatch()),disabled:i.tableCheckedList.length==0},{default:a(()=>[...e[6]||(e[6]=[d(" \u5220\u9664\u9009\u4E2D ",-1)])]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1})])]),_:1},8,["scroll","pagination","row-selection","columns","data","loading","onPageChange","onPageSizeChange","onChange","onSelectionChange"])]),_:1})):(h(),p(w,{key:0,description:"\u5C1A\u672A\u5B89\u88C5\u6253\u8D4F\u793C\u7269\u63D2\u4EF6",style:{padding:"100px"}}))])}const H=S(q,[["render",U],["__scopeId","data-v-85b6cb99"]]);export{H as g};