CRMEB/backend/public/admin/system_static/codeStatistic-B9rF0oe0.js
2026-10-22 10:04:43 +08:00

2 lines
3.0 KiB
JavaScript

import{s as C,y as f,z as L,j as v,W as _,B as x,H as w,C as V,l as n,u as N,k as g,A as D}from"./element-plus-D1Ezoxxm.js";import{_ as T,S as j,b as I}from"./index-BzWqH73M.js";import{c as P}from"./cards-CyVkqC6a.js";import{_ as U}from"./index-DDRYNHpl.js";import{wechatQrcodeStatistic as Q}from"./api-6J0vrH4e.js";import{f as b}from"./validate-a11VBqc7.js";import"./echarts-CylxjQLW.js";import"./monaco-editor-uXAv8CL-.js";import"./form-create-C-8Ibman.js";import"./vxe-ot-ELJR6.js";import"./echarts-C6m23LPs.js";const $={class:"table-head"},q=Object.assign({name:"index"},{__name:"codeStatistic",setup(z){const k=I(),S=j.routePre,a=n([]),A={height:"400px"},c=n({time:""}),d=n([{col:6,count:0,name:"昨日新增关注",className:"md-rose"},{col:6,count:0,name:"昨日参与",className:"ios-speedometer-outline"},{col:6,count:0,name:"总关注",className:"ios-speedometer-outline"},{col:6,count:0,name:"参与总人数",className:"md-rose"}]),m=n({}),u=n(!1),B=k.query.id,y=new Date,r=new Date;r.setTime(r.setTime(new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate()-29))),a.value=[r,y],c.value.time=b(r,"yyyy/MM/dd")+"-"+b(y,"yyyy/MM/dd"),h();function h(){Q(B,c.value).then(e=>{let t=["y_follow","y_scan","all_follow","all_scan"];d.value.map((l,s)=>{l.count=e.data[t[s]]}),M(e.data.trend.series,e.data.trend.xAxis)})}function F(e){a.value=e,c.value.time=a.value?a.value.join("-"):"",h()}function M(e,t){u.value=!0;let l=e.map(o=>o.name),s=t,p=["#5B8FF9","#5AD8A6","#FFAB2B","#5D7092"],i=[];e.map((o,Y)=>{i.push({name:o.name,type:"line",data:o.data,itemStyle:{normal:{color:p[Y]}},smooth:0})}),m.value={tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}}},legend:{x:"center",data:l},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},toolbox:{feature:{saveAsImage:{}}},xAxis:{type:"category",boundaryGap:!0,axisLabel:{interval:0,rotate:40,textStyle:{color:"#000000"}},data:s},yAxis:{type:"value",axisLine:{show:!1},axisTick:{show:!1},axisLabel:{textStyle:{color:"#7F8B9C"}},splitLine:{show:!0,lineStyle:{color:"#F5F7F9"}}},series:i},u.value=!1}return(e,t)=>{const l=g("pages-header"),s=g("date-range-picker"),p=g("el-card"),i=N("loading");return C((f(),L("div",null,[v(l,{title:e.$route.meta.title,backUrl:_(S)+"/marketing/channel_code/channelCodeIndex",description:"统计各渠道码关注数据与趋势,评估推广渠道的引流效果。"},null,8,["title","backUrl"]),d.value.length>=0?(f(),x(_(P),{key:0,class:"mt16",cardLists:d.value},null,8,["cardLists"])):w("",!0),v(p,{bordered:!1,shadow:"never",class:"ivu-mt"},{default:V(()=>[D("div",$,[t[1]||(t[1]=D("h3",null,"关注趋势",-1)),v(s,{width:"250px",editable:!1,clearable:"",onChange:F,modelValue:a.value,"onUpdate:modelValue":t[0]||(t[0]=o=>a.value=o),format:"YYYY/MM/DD","value-format":"YYYY/MM/DD","range-separator":"-",class:"mr20"},null,8,["modelValue"])]),m.value?(f(),x(_(U),{key:0,"option-data":m.value,styles:A,height:"100%",width:"100%"},null,8,["option-data"])):w("",!0)]),_:1})])),[[i,u.value]])}}}),te=T(q,[["__scopeId","data-v-3cf26418"]]);export{te as default};