import{E as e,k as a,M as t,v as s,O as l,o as r,B as o,C as i,A as n,r as d,U as p}from"../element-plus/element-plus.DqqeXZzT.js";import{A as c}from"../api/api.BtQEnbVN.js";import{j as u,h as m,_,o as f,g as v}from"../../assets/index-DYMYfyXS.js";import{r as y,Y as g,d as k,L as h,c as b,a as j,T as x,K as w,o as I,J as P,U as M,a9 as z,O as C,$ as L,S as R,Q as K,R as T,u as O,M as S,ba as U,b8 as D,E as F,n as V}from"../@vue/@vue.lccsL1Mu.js";import{S as E}from"../_select/_select.DVQW4rAo.js";import{a as N,_ as Y}from"../caret-top/caret-top.BxG-YGIs.js";import{_ as A}from"../question-filled/question-filled.CpBGPdbF.js";import{l as B}from"../list/list.W6MLSjHS.js";import{e as q}from"../index/index.vPeoHBQC.js";import{s as H}from"../@element-plus/@element-plus.BWbqilIf.js";import"../lodash-es/lodash-es.LxYfApIs.js";import"../async-validator/async-validator.DSgsWN2H.js";import"../@vueuse/@vueuse.D2YafqsA.js";import"../dayjs/dayjs.D4rZQhfm.js";import"../axios/axios.CUN3se9v.js";import"../@ctrl/@ctrl.D2oWfImC.js";import"../@popperjs/@popperjs.D3lHDW-0.js";import"../escape-html/escape-html.J6B7JOz4.js";import"../normalize-wheel-es/normalize-wheel-es.Erkn7R64.js";import"../vue-router/vue-router.D86bYXwF.js";import"../pinia/pinia.DodrAXQg.js";import"../vue-demi/vue-demi.Dq6ymT-8.js";import"../pinia-plugin-persist/pinia-plugin-persist.Cjrd7Wf_.js";import"../echarts/echarts.C_nC9ACL.js";import"../tslib/tslib.DduEQve-.js";import"../zrender/zrender.XYf_pgl8.js";const J={class:"table_container"},$={class:"tableTop"},G=(e=>(U("data-v-cdf78a38"),e=e(),D(),e))((()=>j("div",{class:"title"},null,-1))),Q=T("导出数据"),W={key:1,class:"sortBox lMar5 pointer"},X=["onClick"],Z=["onClick"],ee={key:0},ae=["src"],te={key:1},se=["title"],le={class:"clampTwo line21",style:{flex:"1"}},re={key:0},oe={key:0,class:"paginationBox flex",style:{"justify-content":"center"}},ie=_(k({__name:"dataList",props:{mainPageInfo:{type:Object,default:()=>{}}},setup(d,{expose:p}){const _=d;y();const v=y(),k=y(!1),U=g({tableList:[],descol:[],summary:[],sortKey:"",currentPage:1,pageSize:20,total:0,totalPages:0,sortType:"desc",updateKey:1}),D=(e,a)=>{U.sortType=a,U.sortKey=e,E(1)},F=e=>{U.currentPage=e,E(e)},V=async()=>{k.value=!0;let a={page:1,page_size:1e3,start_date:_.mainPageInfo.time[0],end_date:_.mainPageInfo.time[1],has_cost:_.mainPageInfo.has_cost,drama_name:_.mainPageInfo.keyword},t=await m.get(c.oe_playlet_data_report_list,a);if(k.value=!1,t&&"0"==t.errNo){let e=t.rst.data.list,a=t.rst.data?.explain,s=a.map((e=>e.label)),l=a.map((e=>e.key_value));q({excelDatas:[{tHeader:s,filterVal:l,tableDatas:e,sheetName:""}],name:`数据报表(导出时间:${u(0)})`})}else e.error(t.errMsg)},E=async(a,t)=>{k.value=!0;let s={page:a||U.currentPage,page_size:t||U.pageSize,start_date:_.mainPageInfo.time[0],end_date:_.mainPageInfo.time[1],has_cost:_.mainPageInfo.has_cost,drama_name:_.mainPageInfo.keyword},l=await m.get(c.oe_playlet_data_report_list,s);k.value=!1,l&&"0"==l.errNo?(l.rst?.data?.summary?.length>0&&(U.summary=l.rst?.data?.summary[0]),U.descol=l.rst.data?.explain,U.tableList=l.rst?.data?.list,U.total=l.rst?.pageInfo.total,U.totalPages=l.rst?.pageInfo.total,U.updateKey++):e.error(l.errMsg)},{tableHeaderStyle:H}=B();return p({init:E}),(e,d)=>{const p=a,c=A,u=l,m=N,_=r,y=Y,g=o,E=i,B=n,q=t,ie=s;return h((I(),b("div",J,[j("div",$,[G,j("div",null,[x(p,{class:"lMar10",type:"primary",plain:"",onClick:V},{default:w((()=>[Q])),_:1})])]),x(q,null,{default:w((()=>[h(j("div",null,[(I(),P(E,{ref_key:"tableAccountRef",ref:v,data:U.tableList,"header-cell-style":O(H),style:{width:"100%"},key:U.updateKey,border:"","empty-text":"暂无数据","max-height":"calc(100vh - 280px)"},{default:w((()=>[(I(!0),b(M,null,z(U.descol,(e=>(I(),P(g,{fixed:1==e.disabled,prop:e.key_value,"min-width":"advertiser_status"!=e.key_value&&"advertiser_nick"!=e.key_value&&e.label.length<=4?"120px":e.label.length<=8?"150px":"200px"},{header:w((()=>[j("div",{class:C(["flex",[U.sortKey==e.key_value?"active_css":""]])},[j("span",{style:L({color:U.sortKey==e.key_value?"#3173FF":""})},R(e.label),5),e.tooltip&&e.tooltip!=e.label?(I(),P(u,{key:0,placement:"top",effect:"dark",content:e.tooltip},{default:w((()=>[x(c,{class:"lMar5 c-999 f14 pointer"})])),_:2},1032,["content"])):K("",!0),1==e.if_sort?(I(),b("div",W,[j("div",{class:"sortItem",onClick:a=>D(e.key_value,"asc")},[x(_,{color:"asc"==U.sortType&&U.sortKey==e.key_value?"#3173FF":""},{default:w((()=>[x(m)])),_:2},1032,["color"])],8,X),j("div",{class:"sortItem",onClick:a=>D(e.key_value,"desc")},[x(_,{color:"desc"==U.sortType&&U.sortKey==e.key_value?"#3173FF":""},{default:w((()=>[x(y)])),_:2},1032,["color"])],8,Z)])):K("",!0)],2)])),default:w((a=>["mf_view"==e.key_value?(I(),b("div",ee,[j("img",{src:a.row.pre_oss_url,style:{width:"100px",height:"60px","object-fit":"contain"}},null,8,ae)])):"mf_info"==e.key_value?(I(),b("div",te,[j("p",{class:"hiddenEllipsis",title:a.row.mf_name},R(a.row.mf_name),9,se),j("p",null,"ID: "+R(a.row.mf_id),1)])):(I(),b("div",{key:2,class:C(["cellDiv",U.sortKey==e.key_value?"active_css":""])},[x(u,{disabled:!(a.row[e.key_value]&&a.row[e.key_value].length>30),effect:"dark",content:a.row[e.key_value]+""},{default:w((()=>[j("div",le,[T(R(a.row[e.key_value]||0==a.row[e.key_value]?-1!=e.label.indexOf("ID")||-1!=e.label.indexOf("id")?a.row[e.key_value]:O(f)(a.row[e.key_value],2,!0):"-"),1),-1==e.label.indexOf("率")||!a.row[e.key_value]&&0!=a.row[e.key_value]?K("",!0):(I(),b("span",re,"%"))])])),_:2},1032,["disabled","content"])],2))])),_:2},1032,["fixed","prop","min-width"])))),256))])),_:1},8,["data","header-cell-style"])),Number(U.total)>0?(I(),b("div",oe,[x(B,{currentPage:U.currentPage,"onUpdate:currentPage":d[0]||(d[0]=e=>U.currentPage=e),"page-size":U.pageSize,"onUpdate:page-size":d[1]||(d[1]=e=>U.pageSize=e),background:"",total:U.total,onCurrentChange:F},null,8,["currentPage","page-size","total"])])):K("",!0)],512),[[S,!0]])])),_:1})])),[[ie,k.value]])}}}),[["__scopeId","data-v-cdf78a38"]]),ne=e=>(U("data-v-55c497a2"),e=e(),D(),e),de=ne((()=>j("div",{class:"flex_between"},[j("div",{class:"page_title"},"投手数据")],-1))),pe={class:"screen_box"},ce={class:"flex tMar15"},ue=ne((()=>j("div",{class:"label lMar20 rMar10"},"短剧名称",-1))),me=ne((()=>j("div",{class:"label lMar20 rMar10"},"是否有消耗",-1))),_e={class:"flex"},fe=ne((()=>j("div",{class:"label lMar20 rMar10"},"投放时间",-1))),ve=_(k({__name:"index",setup(t){const s=y(),l=y({list:[{name:"是",value:1}]}),{dataListRef:r,acTrendRef:o,userRef:i,costRef:n,pageInfo:_,getUserList:f}=(()=>{const a=y(),t=y(),s=y(),l=y(),r=g({data_group:"account",time_type:"day",time:[u(-1),u(0)],keyword:"",has_cost:"",acList:[],userList:[],promoter_id:""});return{dataListRef:a,acTrendRef:t,userRef:l,costRef:s,pageInfo:r,getUserList:async()=>{let a=await m.get(c.user_list,{});a&&"0"==a.errNo?r.userList=a.rst:e.error(a.errMsg)}}})(),k=e=>{_.has_cost=n.value?.value,h()},h=()=>{V((()=>{o.value&&o.value.change(),r.value&&r.value.init(1)}))};return F((()=>{s.value=JSON.parse(v("userInfo")),f(),h()})),(e,t)=>{const s=a,o=d,i=p;return I(),b(M,null,[de,j("div",pe,[j("div",ce,[ue,x(o,{modelValue:O(_).keyword,"onUpdate:modelValue":t[0]||(t[0]=e=>O(_).keyword=e),style:{width:"200px"},placeholder:"请输入短剧名称",clearable:"",onClear:h},{append:w((()=>[x(s,{icon:O(H),onClick:h},null,8,["icon"])])),_:1},8,["modelValue"]),me,x(E,{ref_key:"costRef",ref:n,selectWidth:"180px",onChangeEvent:t[1]||(t[1]=e=>k()),onClearEvent:t[2]||(t[2]=e=>k()),filterFlag:!0,optObj:{k:"value",la:"name",val:"value"},options:l.value.list},null,8,["options"]),j("div",_e,[fe,x(i,{modelValue:O(_).time,"onUpdate:modelValue":t[3]||(t[3]=e=>O(_).time=e),type:"daterange","value-format":"YYYY-MM-DD","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期",size:"default",style:{width:"280px"},onChange:h,clearable:!1,class:"lMar10"},null,8,["modelValue"])])])]),x(ie,{ref_key:"dataListRef",ref:r,mainPageInfo:O(_)},null,8,["mainPageInfo"])],64)}}}),[["__scopeId","data-v-55c497a2"]]);export{ve as default};