2025-09-26 16:29:36 +08:00
|
|
|
import{_ as e}from"./index.1758875307304Drnfzvd7.js";import{b2 as a,bt as t,r as o,ag as r,db as s,b4 as l,c as n,e as p,N as m,w as c,an as d,O as u,t as i,g as _}from"./index.1758875307304Bqu9OSaU.js";import{g}from"./payee-count.1758875307304BJeZVbOG.js";import{p as b}from"./common.1758875307304CCwWzMi9.js";/* empty css */import"./el-col.1758875307304DQSijX35.js";const f=a({__name:"channel-ranking",setup(a){t({legacy:!0});const f=o("create_time"),h=o("DESC"),y=r({columns:[{prop:"api_code",label:"渠道编号",align:"center"},{prop:"api_name",label:"渠道名称",align:"center"},{prop:"flow_money",label:"流水金额",align:"center",sortable:"custom",formatter:b,needCount:!0},{prop:"sum_money",label:"跑量金额",align:"center",sortable:"custom",formatter:b,needCount:!0},{prop:"sum_three_money",label:"实际入金额",align:"center",sortable:"custom",formatter:b,needCount:!0},{prop:"sum_three_fee_rate",label:"成本费率",align:"center",slot:"fee_slot"},{prop:"sum_three_fee",label:"成本",align:"center",sortable:"custom",formatter:b,needCount:!0},{prop:"num",label:"交易总笔数",align:"center",sortable:"custom",needCount:!0},{prop:"succ_num",label:"成功总笔数",align:"center",sortable:"custom",needCount:!0},{prop:"succ_pr",label:"总成功率",align:"center",slot:"succ_pr_slot"}],tableData:[],searchFields:[{prop:"api_query",label:"渠道编号/名称",type:"input",value:""},{prop:"create_time",label:"时间范围",type:"date",dateType:"datetimerange",value:[s().startOf("day").format("YYYY-MM-DD HH:mm:ss"),s().endOf("day").format("YYYY-MM-DD HH:mm:ss")]}],total:0,page:1,per_page:50,loading:!1,sum_data:[]}),Y=()=>{y.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),v()};l(()=>{v()});const v=()=>{y.searchFields.forEach(e=>{"datetimerange"!=e.dateType||e.value||(e.value=[s().startOf("day").format("YYYY-MM-DD HH:mm:ss"),s().endOf("day").format("YYYY-MM-DD HH:mm:ss")])}),y.loading=!0;let e={limit:y.per_page,page:y.page,orderBy:f.value,orderType:h.value,type:"3"},a=function(e){const a={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(a[e.prop]=e.value)}),a}(y.searchFields);g(Object.assign(e,a)).then(e=>{y.tableData=e.data,y.total=e.total,y.loading=!1,y.sum_data=e.sum}).catch(()=>{y.loading=!1})},D=e=>{f.value=e.prop,h.value="descending"==e.order?"DESC":"ASC",v()};return(a,t)=>{const o=d,r=e;return p(),n("div",null,[m(r,{type:"export",columns:_(y).columns,searchFields:_(y).searchFields,"onUpdate:searchFields":t[0]||(t[0]=e=>_(y).searchFields=e),data:_(y).tableData,per_page:_(y).per_page,"onUpdate:per_page":t[1]||(t[1]=e=>_(y).per_page=e),page:_(y).page,"onUpdate:page":t[2]||(t[2]=e=>_(y).page=e),total:_(y).total,onGetTableData:v,onResetForm:Y,loading:_(y).loading,showSelection:!1,showRightRefreshSlot:!1,onSortChange:D,showSummary:!0,sum_data:_(y).sum_data},{succ_pr_slot:c(({row:e})=>[u(i(_(b)(e.succ_pr))+"% ",1)]),fee_slot:c(({row:e})=>[u(i(_(b)((e.sum_three_fee/e.sum_money).toFixed(4))||0),1)]),"search-btns":c(()=>[m(o,{type:"danger"},{default:c(()=>t[3]||(t[3]=[u("导出数据")])),_:1,__:[3]})]),_:1},8,["columns","searchFields","data","per_page","page","total","loading","sum_data"])])}}},[["__scopeId","data-v-5027d398"]]);export{f as default};
|