Initial commit

This commit is contained in:
gustavooth committed 2026-07-23 22:56:30 -03:00
commit 22a1006598
1816 files changed
+410742

No files matched your search

@@ -0,0 +1 @@
import{ay as t,at as e,j as a,k as s,E as i,h as n,i as o,aC as r,aB as l,aA as c,aD as d,aj as m,a4 as h,ag as _,y as u,aY as f,aJ as p,g}from"../../../vendor-element-plus.js?ver=3.1.8";import{aQ as b,a6 as y,W as v,X as C,ab as w,Y as x,a5 as k,J as L,az as $,Z as T,aa as S,$ as E,a9 as A,a0 as I,a8 as V,ad as D,a7 as H,b2 as M,ax as B,av as R}from"../../../vendor.js?ver=3.1.8";import{E as O}from"../../../_eChart.js?ver=3.1.8";import{f as P,b as q,$ as F,d as j,g as W}from"../../../data_config.js?ver=3.1.8";import{_ as N,a as z,T as Z,I as G}from"../../../fc-bits-ui.js?ver=3.1.8";import{C as U}from"../../../CustomIcon.js?ver=3.1.8";import{C as K}from"../../../CalendarIcon.js?ver=3.1.8";import{B as Y}from"../../../Badge.js?ver=3.1.8";import{B as Q}from"../../../BaseCard.js?ver=3.1.8";import{f as J}from"../../../fluentcrm-logo.js?ver=3.1.8";const X=N({name:"SubscribersGrowth",components:{EChart:O},props:{date_range:{type:[String,Object,Array],required:!0}},data:()=>({fetching:!1,initialLoad:!0,stats:{},maxCumulativeValue:0,freshOptions:null,current_mode:"system"===Z.getCurrentTheme()?Z.getSystemTheme():Z.getCurrentTheme()}),mounted(){this.fetchReport(),this.onThemeChanged=t=>{var e;this.current_mode=(null==(e=t.detail)?void 0:e.effective)||Z.getCurrentTheme(),this.stats&&Object.keys(this.stats).length&&this.setupChartItems()},window.addEventListener(z,this.onThemeChanged)},beforeUnmount(){this.onThemeChanged&&window.removeEventListener(z,this.onThemeChanged)},watch:{date_range(){this.fetchReport()}},methods:{fetchReport(){this.fetching=!0,this.$get("reports/subscribers",{date_range:this.date_range}).then(t=>{var e,a;this.stats=(null==(a=null==(e=t.data_sets)?void 0:e[0])?void 0:a.data)||{},this.setupChartItems()}).finally(()=>{this.fetching=!1,this.initialLoad=!1})},setupChartItems(){const t=[],e={label:this.$t("By Date"),backgroundColor:"#ff7f0e",borderColor:"#ff7f0e",data:[],fill:!1,type:"line"},a={label:this.$t("Cumulative"),backgroundColor:"rgba(111, 66, 193, 0.1)",borderColor:"#6f42c1",data:[],type:"line"};let s=0;this.each(this.stats,(i,n)=>{e.data.push(i),t.push(n),s+=parseInt(i,10),a.data.push(s)});const i=/^[A-Za-z]{3} \d{4}$/;t.every(t=>i.test(t))||t.sort(),this.maxCumulativeValue=s+10;const n=q(t,this.date_range);this.renderChart(n,e,a)},renderChart(t,e,a){const s=this.date_range;this.freshOptions={tooltip:{show:!0,showContent:!0,appendToBody:!0,confine:!1,triggerOn:"mousemove|click",transitionDuration:.1,trigger:"axis",backgroundColor:"light"===this.current_mode?"#ffffff":"#283b56",borderColor:"light"===this.current_mode?"#ffffff":"#283b56",borderWidth:1,color:"#ffffff",formatter:t=>{const e=t[0]&&t[0].axisValue;return P(e,s)+"<br/>"+t.map(t=>`<span style="display:inline-block;margin-right:4px;border-radius:4px;width:10px;height:10px;background-color:${t.color};"></span>`+" "+t.seriesName+": "+t.value).join("<br/>")},axisPointer:{type:"cross",label:{backgroundColor:"#283b56"},crossStyle:{color:"#999"}},extraCssText:"z-index:10000; pointer-events:auto;",textStyle:{color:"light"===this.current_mode?"#0E121B":"#ffffff"}},legend:{top:10,left:"center",data:[e.label,a.label],icon:"roundRect",itemWidth:12,itemHeight:12,itemGap:20,textStyle:{color:"light"===this.current_mode?"#0E121B":"#ffffff"}},grid:{top:40,left:40,right:40,bottom:40,containLabel:!0},xAxis:{type:"category",data:t,axisPointer:{type:"shadow"},splitLine:{show:!1},axisLabel:{color:"light"===this.current_mode?"#0E121B":"#9CA3AF"}},yAxis:[{type:"value",min:0,name:e.label,minInterval:1,axisLabel:{formatter:t=>Number.isInteger(t)?t:""},splitLine:{lineStyle:{color:"light"===this.current_mode?"#E1E4EA":"#2c3c4e",type:"dashed"}}},{type:"value",min:0,name:a.label,max:this.maxCumulativeValue||null,minInterval:1,axisLabel:{formatter:t=>Number.isInteger(t)?t:""},splitLine:{lineStyle:{color:"light"===this.current_mode?"#E1E4EA":"#2c3c4e",type:"dashed"}}}],series:[{name:e.label,type:"line",data:e.data,yAxisIndex:0,itemStyle:{color:e.backgroundColor},emphasis:{focus:"series"}},{name:a.label,type:"line",data:a.data,yAxisIndex:1,smooth:!1,symbol:"circle",symbolSize:6,itemStyle:{color:a.borderColor},lineStyle:{color:a.borderColor,width:2}}]}}}},[["render",function(e,a,s,i,n,o){const r=b("EChart"),l=t;return y((v(),C("div",null,[w(r,{options:n.freshOptions},null,8,["options"])])),[[l,n.fetching&&!n.initialLoad]])}]]);const tt=N({name:"email-sent-growth",props:["date_range"],components:{EChart:O},data:()=>({fetching:!1,initialLoad:!0,stats:{},maxCumulativeValue:0,freshOptions:null,current_mode:"system"===Z.getCurrentTheme()?Z.getSystemTheme():Z.getCurrentTheme()}),computed:{},methods:{fetchReport(){this.fetching=!0,this.$get("reports/email-sents",{date_range:this.date_range}).then(t=>{this.stats=t.stats,this.setupChartItems()}).finally(()=>{this.fetching=!1,this.initialLoad=!1})},setupChartItems(){const t=[],e={label:this.$t("By Date"),borderColor:"#ff7f0e",data:[]},a={label:this.$t("Cumulative"),borderColor:"#6f42c1",data:[]};let s=0;this.each(this.stats,Line truncated
@@ -0,0 +1 @@
import{W as s,X as e,Z as r,aa as t}from"../../../vendor.js?ver=3.1.8";import{_ as n}from"../../../fc-bits-ui.js?ver=3.1.8";import"../../../vendor-element-plus.js?ver=3.1.8";const i={class:"fcrm_no_permission text-align-center"};const o=n({},[["render",function(n,o){return s(),e("div",i,[r("h3",null,t(n.$t("permission.title")),1),r("p",null,t(n.$t("permission.desc")),1)])}]]);export{o as default};