lw-cdp-ui 1.4.34 → 1.4.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lw-cdp-ui.esm.js
CHANGED
|
@@ -22428,7 +22428,8 @@ function WA(e, t, n, r, a, o) {
|
|
|
22428
22428
|
ref: (W) => {
|
|
22429
22429
|
W && (a.chartPageRefs[F] = W);
|
|
22430
22430
|
},
|
|
22431
|
-
chartId: x.id
|
|
22431
|
+
chartId: x.id,
|
|
22432
|
+
isDashboard: !0
|
|
22432
22433
|
}, null, 8, ["chartId"])
|
|
22433
22434
|
])) : j("", !0),
|
|
22434
22435
|
C(d, {
|
|
@@ -22461,7 +22462,7 @@ function WA(e, t, n, r, a, o) {
|
|
|
22461
22462
|
])) : j("", !0)
|
|
22462
22463
|
]);
|
|
22463
22464
|
}
|
|
22464
|
-
const JA = /* @__PURE__ */ ae(GA, [["render", WA], ["__scopeId", "data-v-
|
|
22465
|
+
const JA = /* @__PURE__ */ ae(GA, [["render", WA], ["__scopeId", "data-v-5485f51b"]]);
|
|
22465
22466
|
/*!
|
|
22466
22467
|
* vue-router v4.5.0
|
|
22467
22468
|
* (c) 2024 Eduardo San Martin Morote
|
package/dist/lw-cdp-ui.umd.js
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<span style="display:inline-block;width:10px;height:10px;border-radius:50%;background:${n.color};margin-right:5px;"></span>
|
|
22
22
|
${n.seriesName}: ${n.value}
|
|
23
23
|
</div>
|
|
24
|
-
`).join("")},getLegendOption(t,n){var o,a,r,l,i,s,c,h,p,f;return{show:((o=t.legend)==null?void 0:o.show)!==!1,type:((a=t.legend)==null?void 0:a.type)||"scroll",orient:((r=t.legend)==null?void 0:r.orient)||"horizontal",left:((l=t.legend)==null?void 0:l.left)||"left",top:((i=t.legend)==null?void 0:i.top)||"top",padding:((s=t.legend)==null?void 0:s.padding)||[5,5,5,5],itemGap:((c=t.legend)==null?void 0:c.itemGap)||10,itemWidth:((h=t.legend)==null?void 0:h.itemWidth)||14,itemHeight:((p=t.legend)==null?void 0:p.itemHeight)||14,textStyle:{fontSize:12,...(f=t.legend)==null?void 0:f.textStyle}}},getGridOption(t){if(t.grid)return{containLabel:!0,...t.grid}},getToolboxOption(t){var n,o,a,r;if(!(!t.toolbox||t.toolbox.show===!1))return{...t.toolbox,feature:{...t.toolbox.feature||{},saveAsImage:(o=(n=t.toolbox.feature)==null?void 0:n.saveAsImage)!=null&&o.show?{type:"png",pixelRatio:2,...t.toolbox.feature.saveAsImage}:void 0,dataView:(r=(a=t.toolbox.feature)==null?void 0:a.dataView)!=null&&r.show?{readOnly:!0,...t.toolbox.feature.dataView}:void 0}}},getXAxisOption(t){return{type:"category",boundaryGap:!1,data:t[0].headers,axisLabel:{rotate:30,interval:0}}},getYAxisOption(t){var n;return{type:"value",axisLabel:{formatter:((n=t.yAxis)==null?void 0:n.formatter)||this.defaultYAxisFormatter},...t.yAxis}},defaultYAxisFormatter(t){return t>=1e4?(t/1e4).toFixed(1)+"万":t>=1e3?(t/1e3).toFixed(1)+"k":t},getSeriesData(t,n){let o=[];return n.map((a,r)=>{a.rows.map(l=>{var i,s,c,h,p,f,y,b,w,E,V,F,S,B,q,v,_,P,L,G,N,Q,H,Z,M,K,g;o.push({name:l.name,type:"line",stack:((i=t.series)==null?void 0:i.stack)||"total",areaStyle:{opacity:((c=(s=t.series)==null?void 0:s.areaStyle)==null?void 0:c.opacity)||.8,color:(p=(h=t.series)==null?void 0:h.areaStyle)==null?void 0:p.color,...((f=t.series)==null?void 0:f.areaStyle)||{}},emphasis:{focus:((b=(y=t.series)==null?void 0:y.emphasis)==null?void 0:b.focus)||"series"},smooth:((w=t.series)==null?void 0:w.smooth)!==!1,symbol:((E=t.series)==null?void 0:E.symbol)||"circle",symbolSize:((V=t.series)==null?void 0:V.symbolSize)||6,lineStyle:{width:((S=(F=t.series)==null?void 0:F.lineStyle)==null?void 0:S.width)||2,type:(q=(B=t.series)==null?void 0:B.lineStyle)==null?void 0:q.type,color:(_=(v=t.series)==null?void 0:v.lineStyle)==null?void 0:_.color,...((P=t.series)==null?void 0:P.lineStyle)||{}},data:l.values,label:{show:((G=(L=t.series)==null?void 0:L.label)==null?void 0:G.show)||!1,position:((Q=(N=t.series)==null?void 0:N.label)==null?void 0:Q.position)||"top",formatter:((Z=(H=t.series)==null?void 0:H.label)==null?void 0:Z.formatter)||"{@value}",fontSize:((K=(M=t.series)==null?void 0:M.label)==null?void 0:K.fontSize)||12,...((g=t.series)==null?void 0:g.label)||{}},...t.series||{}})})}),o}}};function Ag(t,n,o,a,r,l){return e.openBlock(),e.createElementBlock("div",{ref:"chartRef",class:e.normalizeClass({chart:o.isBi}),style:e.normalizeStyle({height:o.height})},null,6)}const Dd=j(yg,[["render",Ag],["__scopeId","data-v-7818b7b4"]]),bg={name:"MetricCard",data(){return{cardHeight:0}},props:{rawData:{type:Object,required:!0,default:()=>({})},height:{type:String,default:""},subtitle:{type:String,default:"同比变化"},tooltip:{type:String,default:""}},computed:{parsedData(){var r;const{setting:t,dataSet:n}=this.rawData,{tables:o}=n,a=(r=t==null?void 0:t.displayMetrics)==null?void 0:r.map(l=>{const[i,s]=l.split(".");return o.find(c=>c.name===i&&c.metricId===s)}).filter(Boolean);return this.height?this.cardHeight=this.height:this.cardHeight=200+(a.length-2)*10+"px",this.transformData(a,t)},columns(){var t,n;return((t=this.parsedData)==null?void 0:t.length)<this.rawData.setting.columnCount?(n=this.parsedData)==null?void 0:n.length:this.rawData.setting.columnCount},paddingDefault(){var t,n,o,a,r,l,i,s;return[`${(n=(t=this.rawData.setting)==null?void 0:t.grid)==null?void 0:n.top}px`||0,`${(a=(o=this.rawData.setting)==null?void 0:o.grid)==null?void 0:a.right}px`||0,`${(l=(r=this.rawData.setting)==null?void 0:r.grid)==null?void 0:l.bottom}px`||0,`${(s=(i=this.rawData.setting)==null?void 0:i.grid)==null?void 0:s.left}px`||0]},titleLeftRight(){var o;let{left:t}=((o=this.rawData.setting)==null?void 0:o.title)||{},n={};return t=="left"?n.left=0:t=="center"?(n.left="50%",n.transform="translateX(-50%)"):(n.left="auto",n.right=0),n},legendLeftRight(){var a;let{left:t,top:n}=((a=this.rawData.setting)==null?void 0:a.legend)||{},o={};return t=="left"?o["justify-content"]="flex-start":t=="center"?o["justify-content"]="center":o["justify-content"]="flex-end",n=="top"?o["align-items"]="flex-start":n=="bottom"?o["align-items"]="flex-end":n=="middle"&&(o["align-items"]="center"),o}},methods:{transformData(t,n){const o=[],a=Math.max(...t.map(r=>r.headers.length));for(let r=0;r<a;r++){const l=[];t.forEach(i=>{if(r<i.headers.length){const s=i.headers[r],c=i.metricName,h=i.rows[0].values[r];l.push({name:s!=c?`${s}-${c}`:c,unit:i.unit,unitName:i.unitName,unit:i.unit,setting:n,value:h})}}),l.length>0&&o.push(l)}return o}}},wg={key:0},Bg={key:2,class:"statistic-item"},Eg={class:"number"};function kg(t,n,o,a,r,l){const i=e.resolveComponent("el-icon-warning"),s=e.resolveComponent("el-icon"),c=e.resolveComponent("el-tooltip"),h=e.resolveComponent("el-icon-top"),p=e.resolveComponent("el-icon-bottom");return e.openBlock(),e.createElementBlock("div",{class:"chart-title-card-list",style:e.normalizeStyle({gridTemplateColumns:`repeat(${l.columns||1}, 1fr)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.parsedData,(f,y)=>(e.openBlock(),e.createElementBlock("div",{key:y,class:"chart-title-card",style:e.normalizeStyle({height:r.cardHeight,padding:l.paddingDefault})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f,(b,w)=>{var E,V,F,S,B,q,v,_,P,L,G,N,Q,H,Z,M,K,g,R,z,me,be,we,W,le,Ne,Be,ge;return e.openBlock(),e.createElementBlock(e.Fragment,{key:b.name},[w===0?(e.openBlock(),e.createElementBlock("div",wg,[(E=b.setting.title)!=null&&E.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"title-top",style:e.normalizeStyle({textAlign:((F=(V=b.setting)==null?void 0:V.title)==null?void 0:F.left)||"left",padding:((q=(B=(S=b.setting)==null?void 0:S.title)==null?void 0:B.padding)==null?void 0:q.map(ke=>ke+"px").join(" "))||0})},[e.createElementVNode("span",{style:e.normalizeStyle({color:((_=(v=b.setting.title)==null?void 0:v.textStyle)==null?void 0:_.color)||b.color,fontWeight:((L=(P=b.setting.title)==null?void 0:P.textStyle)==null?void 0:L.fontWeight)||"normal",fontSize:((N=(G=b.setting.title)==null?void 0:G.textStyle)==null?void 0:N.fontSize)+"px"||"17px"})},e.toDisplayString(b.name),5),b.tooltip?(e.openBlock(),e.createBlock(c,{key:0,effect:"dark",content:b.tooltip,placement:"top"},{default:e.withCtx(()=>[e.createVNode(s,{class:"icon-tooltip"},{default:e.withCtx(()=>[e.createVNode(i)]),_:1})]),_:2},1032,["content"])):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"statistic-current",style:e.normalizeStyle({...l.legendLeftRight,color:((H=(Q=b.setting.legend)==null?void 0:Q.textStyle)==null?void 0:H.color)||b.color,padding:((K=(M=(Z=b.setting)==null?void 0:Z.legend)==null?void 0:M.padding)==null?void 0:K.map(ke=>ke+"px").join(" "))||0,fontWeight:((R=(g=b.setting.legend)==null?void 0:g.textStyle)==null?void 0:R.fontWeight)||"bold",fontSize:((me=(z=b.setting.legend)==null?void 0:z.textStyle)==null?void 0:me.fontSize)+"px"||"17px"})},e.toDisplayString((be=b.value)==null?void 0:be.toLocaleString("en-US")),5)])):w==f.length-1?(e.openBlock(),e.createElementBlock("div",{key:1,class:"statistic-footer",style:e.normalizeStyle({left:((W=(we=o.rawData.setting)==null?void 0:we.grid)==null?void 0:W.left)+"px",bottom:((Ne=(le=o.rawData.setting)==null?void 0:le.grid)==null?void 0:Ne.bottom)+"px",right:((ge=(Be=o.rawData.setting)==null?void 0:Be.grid)==null?void 0:ge.right)+"px"})},[e.createElementVNode("span",null,e.toDisplayString(b.name),1),e.createElementVNode("div",{style:e.normalizeStyle({color:b.value>=0?"#BF1220":"#00B78B"})},[b.value>=0?(e.openBlock(),e.createBlock(s,{key:0,class:"icon-up"},{default:e.withCtx(()=>[e.createVNode(h)]),_:1})):(e.openBlock(),e.createBlock(s,{key:1,class:"icon-down"},{default:e.withCtx(()=>[e.createVNode(p)]),_:1})),e.createTextVNode(" "+e.toDisplayString(Math.abs(b.value))+" "+e.toDisplayString(b.unitName),1)],4)],4)):(e.openBlock(),e.createElementBlock("div",Bg,[e.createElementVNode("span",null,e.toDisplayString(b.name),1),e.createElementVNode("div",Eg,e.toDisplayString(Math.abs(b.value))+" "+e.toDisplayString(b.unitName),1)]))],64)}),128))],4))),128))],4)}const Md=j(bg,[["render",kg],["__scopeId","data-v-51540e67"]]),xg={name:"GaugeChart",props:{rawData:{type:Object,required:!0},height:{type:String,default:"300px"},isBi:{type:Boolean,default:!0}},data(){return{option:{},echarts:e.inject("echarts"),chart:null}},watch:{rawData:{handler:"updateChart",deep:!0,immediate:!0}},mounted(){this.$nextTick(()=>{this.initChart()})},beforeDestroy(){this.chart&&(this.chart.dispose(),this.chart=null)},methods:{initChart(){this.chart&&this.chart.dispose(),this.chart=e.markRaw(this.echarts.init(this.$refs.chartRef)),this.updateChart(),window.addEventListener("resize",()=>{this.chart&&this.chart.resize()})},updateChart(){if(!this.chart||!this.rawData)return;const{setting:t,dataSet:n,option:o}=this.rawData,{tables:a}=n||{};this.isBi?this.option={title:this.getTitleOption(t),tooltip:this.getTooltipOption(t),series:this.getSeriesData(t,a)}:this.option=o,this.option&&this.chart.setOption(this.option,!0),setTimeout(()=>{this.chart.resize()},10)},getTitleOption(t){var n,o,a,r,l,i;return{show:((n=t.title)==null?void 0:n.show)!==!1,text:((o=t.title)==null?void 0:o.text)||"",textStyle:{fontSize:16,fontWeight:"bold",color:"#333",...(a=t.title)==null?void 0:a.textStyle},left:((r=t.title)==null?void 0:r.left)||"center",top:((l=t.title)==null?void 0:l.top)||"top",padding:((i=t.title)==null?void 0:i.padding)||[5,5,5,5]}},getTooltipOption(t){var n;return{formatter:((n=t.tooltip)==null?void 0:n.formatter)||"{a} <br/>{b}: {c}"}},getMinMaxValues(t){const n=t.flatMap(r=>r.rows.flatMap(l=>l.values)),o=Math.min(...n),a=Math.max(...n);return{min:o,max:a}},getGridCenters(t){const n=t.length,o=Math.ceil(Math.sqrt(n)),a=Math.round(Math.sqrt(n)),r=[];for(let l=0;l<n;l++){const i=Math.floor(l/a),c=((l%a+.5)*(100/a)).toFixed(2)+"%",h=((i+.5)*(100/o)).toFixed(2)+"%";r.push([h,c])}return r},getSeriesData(t,n){let o=this.getGridCenters(n),a=[];return n.forEach((r,l)=>{a.push({type:"gauge",...this.getMinMaxValues(n),name:r.metricName,radius:`${90/n.length}%`,center:o[l],detail:{valueAnimation:!0,formatter:t.formatter||"{value}",color:"inherit",fontSize:14},data:this.parseGaugeData(r)})}),a},parseGaugeData(t){let n=[];return t.headers.forEach((o,a)=>{n.push({name:o,value:t.rows[0].values[a],title:{show:!1},detail:{show:!1}})}),n}}};function Vg(t,n,o,a,r,l){return e.openBlock(),e.createElementBlock("div",{ref:"chartRef",class:e.normalizeClass({chart:o.isBi}),style:e.normalizeStyle({height:o.height})},null,6)}const Rd=j(xg,[["render",Vg],["__scopeId","data-v-6b008f06"]]),_g={name:"FunnelChart",props:{rawData:{type:Object,required:!0},height:{type:String,default:"300px"},isBi:{type:Boolean,default:!0}},data(){return{option:{},echarts:e.inject("echarts"),chart:null}},watch:{rawData:{handler:"updateChart",deep:!0,immediate:!0}},mounted(){this.$nextTick(()=>{this.initChart()})},beforeDestroy(){this.chart&&(this.chart.dispose(),this.chart=null)},methods:{initChart(){this.chart&&this.chart.dispose(),this.chart=e.markRaw(this.echarts.init(this.$refs.chartRef)),this.updateChart(),window.addEventListener("resize",()=>{this.chart&&this.chart.resize()})},updateChart(){if(!this.chart||!this.rawData)return;const{setting:t,dataSet:n,option:o}=this.rawData,{tables:a}=n||{};this.isBi?this.option={title:t.title?this.getTitleOption(t):void 0,tooltip:t.tooltip?this.getTooltipOption(t):void 0,legend:t.legend?this.getLegendOption(t,a):void 0,grid:t.grid?this.getGridOption(t):void 0,series:this.getSeriesData(t,a),color:t.color}:this.option=o,this.option&&this.chart.setOption(this.option,!0),setTimeout(()=>{this.chart.resize()},10)},getTitleOption(t){var n,o,a,r,l,i;return{show:((n=t.title)==null?void 0:n.show)!==!1,text:((o=t.title)==null?void 0:o.text)||"",textStyle:{fontSize:16,fontWeight:"bold",color:"#333",...(a=t.title)==null?void 0:a.textStyle},left:((r=t.title)==null?void 0:r.left)||"center",top:((l=t.title)==null?void 0:l.top)||"top",padding:((i=t.title)==null?void 0:i.padding)||[5,5,5,5]}},getTooltipOption(t){const n=t.tooltip||{};return{show:n.show,trigger:"item",formatter:n.formatter||"{a} <br/>{b}: {c}"}},getLegendOption(t,n){var o,a,r,l,i,s,c,h,p,f;return{show:((o=t.legend)==null?void 0:o.show)!==!1,type:((a=t.legend)==null?void 0:a.type)||"scroll",orient:((r=t.legend)==null?void 0:r.orient)||"horizontal",left:((l=t.legend)==null?void 0:l.left)||"left",top:((i=t.legend)==null?void 0:i.top)||"top",padding:((s=t.legend)==null?void 0:s.padding)||[5,5,5,5],itemGap:((c=t.legend)==null?void 0:c.itemGap)||10,itemWidth:((h=t.legend)==null?void 0:h.itemWidth)||14,itemHeight:((p=t.legend)==null?void 0:p.itemHeight)||14,textStyle:{fontSize:12,...(f=t.legend)==null?void 0:f.textStyle}}},getGridOption(t){const n=t.grid||{};return{top:n.top,left:n.left,right:n.right,bottom:n.bottom,containLabel:n.containLabel}},getGridCenters(t,n={top:8,right:5,bottom:5,left:5}){const o=Math.ceil(Math.sqrt(t)),a=Math.round(Math.sqrt(t)),r=[];for(let l=0;l<t;l++){const i=Math.floor(l/a),c=(l%a*(100/a)+parseInt(n.top)).toFixed(2)+"%",h=(i*(90/o)+parseInt(n.left)).toFixed(2)+"%",p=((90-parseInt(n.right))/o).toFixed(2)+"%",f=((100-parseInt(n.bottom))/a).toFixed(2)+"%";r.push({left:h,top:c,width:p,height:f})}return r},getSeriesData(t,n){const o=n.reduce((s,c)=>s+c.rows.length,0),a=this.getGridCenters(o,t.grid),r=t.series||{},l=t.label||{};let i=[];return n.forEach((s,c)=>{s.rows.forEach((h,p)=>{var y,b;const f=c+p;i.push({name:s.metricName,type:"funnel",...a[f],label:{position:l.position||"inside",formatter:l.formatter||"{b}: {c}",color:l.color,fontSize:l.fontSize},labelLine:{length:l.length,lineStyle:{width:l.lineWidth,type:l.lineType}},itemStyle:{borderColor:r.borderColor||"#fff",borderWidth:r.borderWidth||1,borderRadius:r.borderRadius},emphasis:{label:{show:!0,fontSize:((b=(y=r.emphasis)==null?void 0:y.label)==null?void 0:b.fontSize)||16}},data:h.values.map((w,E)=>({value:w,name:s.headers[E]}))})})}),i}}};function Ig(t,n,o,a,r,l){return e.openBlock(),e.createElementBlock("div",{ref:"chartRef",class:e.normalizeClass({chart:o.isBi}),style:e.normalizeStyle({height:o.height})},null,6)}const Od=j(_g,[["render",Ig],["__scopeId","data-v-3708b699"]]),Sg={name:"ScatterChart",props:{rawData:{type:Object,required:!0},height:{type:String,default:"300px"},isBi:{type:Boolean,default:!0}},data(){return{option:{},echarts:e.inject("echarts"),chart:null}},watch:{rawData:{handler:"updateChart",deep:!0,immediate:!0}},mounted(){this.$nextTick(()=>{this.initChart()})},beforeDestroy(){this.chart&&(this.chart.dispose(),this.chart=null)},methods:{initChart(){this.chart&&this.chart.dispose(),this.chart=e.markRaw(this.echarts.init(this.$refs.chartRef)),this.updateChart(),window.addEventListener("resize",()=>{this.chart&&this.chart.resize()})},updateChart(){if(!this.chart||!this.rawData)return;const{setting:t,dataSet:n,option:o}=this.rawData,{tables:a}=n||{};this.isBi?this.option={title:this.getTitleOption(t),tooltip:this.getTooltipOption(t),legend:this.getLegendOption(t,a),grid:this.getGridOption(t),xAxis:this.getXAxisOption(t,a),yAxis:this.getYAxisOption(t),visualMap:this.getVisualMapOption(t,a),series:this.getSeriesData(t,a),color:t.useThemeColor?void 0:t.color||this.getDefaultColors(),toolbox:this.getToolboxOption(t)}:this.option=o,this.option&&this.chart.setOption(this.option,!0),setTimeout(()=>{this.chart.resize()},10)},getTitleOption(t){var n,o,a,r,l,i;return{show:((n=t.title)==null?void 0:n.show)!==!1,text:((o=t.title)==null?void 0:o.text)||"",textStyle:{fontSize:16,fontWeight:"bold",color:"#333",...(a=t.title)==null?void 0:a.textStyle},left:((r=t.title)==null?void 0:r.left)||"center",top:((l=t.title)==null?void 0:l.top)||"top",padding:((i=t.title)==null?void 0:i.padding)||[5,5,5,5]}},getTooltipOption(t){var n,o;return{show:((n=t.tooltip)==null?void 0:n.show)!==!1,trigger:"item",formatter:((o=t.tooltip)==null?void 0:o.formatter)||(a=>{const r=a.data;return`${a.seriesName}<br/>${a.name}: (${r[1]})`})}},getLegendOption(t,n){var o,a,r,l,i,s,c,h,p,f;return{show:((o=t.legend)==null?void 0:o.show)!==!1,type:((a=t.legend)==null?void 0:a.type)||"scroll",orient:((r=t.legend)==null?void 0:r.orient)||"horizontal",left:((l=t.legend)==null?void 0:l.left)||"left",top:((i=t.legend)==null?void 0:i.top)||"top",padding:((s=t.legend)==null?void 0:s.padding)||[5,5,5,5],itemGap:((c=t.legend)==null?void 0:c.itemGap)||10,itemWidth:((h=t.legend)==null?void 0:h.itemWidth)||14,itemHeight:((p=t.legend)==null?void 0:p.itemHeight)||14,textStyle:{fontSize:12,...(f=t.legend)==null?void 0:f.textStyle}}},getGridOption(t){var n,o,a,r,l;return{left:((n=t.grid)==null?void 0:n.left)||"20",right:((o=t.grid)==null?void 0:o.right)||"20",top:((a=t.grid)==null?void 0:a.top)||"50",bottom:((r=t.grid)==null?void 0:r.bottom)||"20",containLabel:((l=t.grid)==null?void 0:l.containLabel)!==!1}},getXAxisOption(t,n){var o,a,r;return{type:"category",name:((o=t.xAxis)==null?void 0:o.name)||"",data:((a=n[0])==null?void 0:a.headers)||[],axisLabel:((r=t.xAxis)==null?void 0:r.axisLabel)||{},splitLine:{lineStyle:{type:"dashed"}}}},getYAxisOption(t){var n,o;return{type:"value",name:((n=t.yAxis)==null?void 0:n.name)||"",axisLabel:((o=t.yAxis)==null?void 0:o.axisLabel)||{},splitLine:{lineStyle:{type:"dashed"}}}},getVisualMapOption(t,n){var l,i,s,c,h,p,f,y,b;if(!t.visualMap||t.visualMap.top==="-10000")return null;const o=n.flatMap(w=>w.rows.flatMap(E=>E.values.filter(V=>typeof V=="number"&&isFinite(V)))),a=o.length?Math.max(...o):100,r=o.length?Math.min(...o):0;return{left:((l=t.visualMap)==null?void 0:l.left)||"right",top:((i=t.visualMap)==null?void 0:i.top)||"bottom",dimension:((s=t.visualMap)==null?void 0:s.dimension)||2,min:((c=t.visualMap)==null?void 0:c.min)??r,max:((h=t.visualMap)==null?void 0:h.max)??a,itemWidth:((p=t.visualMap)==null?void 0:p.itemWidth)||20,itemHeight:((f=t.visualMap)==null?void 0:f.itemHeight)||120,calculable:((y=t.visualMap)==null?void 0:y.calculable)||!1,inRange:((b=t.visualMap)==null?void 0:b.inRange)||{symbolSize:[0,50]},text:["高","低"]}},getSeriesData(t,n){let o=[];return n.map((a,r)=>{a.rows.map((l,i)=>{var s,c;o.push({name:n.length>1?a.metricName:a.metricName+"-"+l.name,type:"scatter",symbolSize:t.symbolSize||10,data:a.headers.map((h,p)=>{const f=a.rows[i].values[p];return[h,typeof f=="number"&&isFinite(f)?f:0,typeof f=="number"&&isFinite(f)?f:0]}),label:{show:((s=t.label)==null?void 0:s.show)||!1,formatter:((c=t.label)==null?void 0:c.formatter)||"{b}"}})})}),o},getToolboxOption(t){var n,o,a,r,l;if((n=t.toolbox)!=null&&n.show)return{show:!0,feature:{saveAsImage:{show:((a=(o=t.toolbox.feature)==null?void 0:o.saveAsImage)==null?void 0:a.show)||!1},dataView:{show:((l=(r=t.toolbox.feature)==null?void 0:r.dataView)==null?void 0:l.show)||!1}}}},getItemStyleOption(t){return t.itemStyle||{opacity:.8,shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}},getDefaultColors(){return["#5E9CC5","#FF7300","#14C566","#FF5E50","#BB83C0","#B77366","#FF8FC0","#A4A69C","#CFD162"]}}};function Fg(t,n,o,a,r,l){return e.openBlock(),e.createElementBlock("div",{ref:"chartRef",class:e.normalizeClass({chart:o.isBi}),style:e.normalizeStyle({height:o.height})},null,6)}const Pd=j(Sg,[["render",Fg],["__scopeId","data-v-f1780bc1"]]),Lg={name:"RadarChart",props:{rawData:{type:Object,required:!0},height:{type:String,default:"300px"},isBi:{type:Boolean,default:!0}},data(){return{option:{},echarts:e.inject("echarts"),chart:null}},watch:{rawData:{handler:"updateChart",deep:!0,immediate:!0}},mounted(){this.$nextTick(()=>{this.initChart()})},beforeDestroy(){this.chart&&(this.chart.dispose(),this.chart=null)},methods:{initChart(){this.chart&&this.chart.dispose(),this.chart=e.markRaw(this.echarts.init(this.$refs.chartRef)),this.updateChart(),window.addEventListener("resize",()=>{this.chart&&this.chart.resize()})},updateChart(){if(!this.chart||!this.rawData)return;const{setting:t,dataSet:n,option:o}=this.rawData,{tables:a}=n||{};this.isBi?this.option={title:this.getTitleOption(t),tooltip:this.getTooltipOption(t),legend:this.getLegendOption(t,a),radar:this.getRadarOption(t,a),series:this.getSeriesData(t,a),color:t.color||this.getDefaultColors()}:this.option=o,this.option&&this.chart.setOption(this.option,!0),setTimeout(()=>{this.chart.resize()},10)},getTitleOption(t){var n,o,a,r,l,i;return{show:((n=t.title)==null?void 0:n.show)!==!1,text:((o=t.title)==null?void 0:o.text)||"",textStyle:{fontSize:16,fontWeight:"bold",color:"#333",...(a=t.title)==null?void 0:a.textStyle},left:((r=t.title)==null?void 0:r.left)||"center",top:((l=t.title)==null?void 0:l.top)||"top",padding:((i=t.title)==null?void 0:i.padding)||[5,5,5,5]}},getTooltipOption(t){var n;return{trigger:"item",formatter:((n=t.tooltip)==null?void 0:n.formatter)||"{a} <br/>{b}: {c}"}},getLegendOption(t,n){var o,a;return{show:((o=t.legend)==null?void 0:o.show)!==!1,textStyle:((a=t.legend)==null?void 0:a.textStyle)||{fontSize:12}}},getRadarOption(t,n){return{indicator:n[0].headers.map((o,a)=>({name:o,max:t.maxValue||Math.max(...n.flatMap(r=>r.rows.flatMap(l=>l.values)))*1.2})),radius:t.radius||"65%",splitNumber:t.splitNumber||5,axisName:{color:t.axisNameColor||"#333"},splitArea:{show:t.showSplitArea!==!1},splitLine:{lineStyle:{color:t.splitLineColor||["rgba(0, 0, 0, 0.1)"]}},axisLine:{lineStyle:{color:t.axisLineColor||"rgba(0, 0, 0, 0.2)"}}}},getSeriesData(t,n){return n.map(o=>{var a,r;return{name:o.metricName,type:"radar",data:[{value:o.rows[0].values,name:o.metricName,areaStyle:t.showArea!==!1?{opacity:.4}:void 0,lineStyle:{width:t.lineWidth||2},symbol:t.symbol||"circle",symbolSize:t.symbolSize||6,label:{show:((a=t.label)==null?void 0:a.show)||!1,formatter:((r=t.label)==null?void 0:r.formatter)||"{c}"}}]}})},getDefaultColors(){return["#3A4DE9","#4BC0C0","#FF9F43","#ED5565","#A0A7E6","#67C23A","#E6A23C","#F56C6C","#909399"]}}};function Ng(t,n,o,a,r,l){return e.openBlock(),e.createElementBlock("div",{ref:"chartRef",class:e.normalizeClass({chart:o.isBi}),style:e.normalizeStyle({height:o.height})},null,6)}const qd=j(Lg,[["render",Ng],["__scopeId","data-v-88abf5da"]]),Tg={name:"MapChart",props:{rawData:{type:Object,required:!0},height:{type:String,default:"300px"},isBi:{type:Boolean,default:!0}},data(){return{option:{},echarts:e.inject("echarts"),chart:null}},watch:{rawData:{handler:"updateChart",deep:!0,immediate:!0}},mounted(){this.$nextTick(()=>{this.initChart()})},beforeDestroy(){this.chart&&(this.chart.dispose(),this.chart=null)},methods:{async initChart(){this.chart&&this.chart.dispose(),this.chart=e.markRaw(this.echarts.init(this.$refs.chartRef)),this.updateChart(),window.addEventListener("resize",()=>{this.chart&&this.chart.resize()})},async updateChart(){var l,i,s,c;if(!this.chart||!this.rawData)return;const{setting:t,dataSet:n,option:o}=this.rawData,{tables:a}=n||{};this.isBi?this.option={title:this.getTitleOption(t),tooltip:this.getTooltipOption(),legend:this.getLegendOption(t,a),visualMap:this.getVisualMapOption(t,a),series:this.getSeriesData(t,a)}:this.option=o;const r=await this.$http.get(`/${this.$config.APP_NAME.toLowerCase()}/map/${((i=(l=this.rawData)==null?void 0:l.setting)==null?void 0:i.mapName)||"china"}.json`);this.echarts.registerMap(((c=(s=this.rawData)==null?void 0:s.setting)==null?void 0:c.mapName)||"china",r),this.option&&this.chart.setOption(this.option,!0),setTimeout(()=>{this.chart.resize()},10)},getTitleOption(t){var n,o,a,r,l,i;return{show:((n=t.title)==null?void 0:n.show)!==!1,text:((o=t.title)==null?void 0:o.text)||"",textStyle:{fontSize:16,fontWeight:"bold",color:"#333",...(a=t.title)==null?void 0:a.textStyle},left:((r=t.title)==null?void 0:r.left)||"center",top:((l=t.title)==null?void 0:l.top)||"top",padding:((i=t.title)==null?void 0:i.padding)||[5,5,5,5]}},getTooltipOption(){return{trigger:"item",showDelay:0,transitionDuration:.2}},getLegendOption(t,n){var o,a,r,l,i,s,c,h,p,f;return{show:((o=t.legend)==null?void 0:o.show)!==!1,type:((a=t.legend)==null?void 0:a.type)||"scroll",orient:((r=t.legend)==null?void 0:r.orient)||"horizontal",left:((l=t.legend)==null?void 0:l.left)||"left",top:((i=t.legend)==null?void 0:i.top)||"top",padding:((s=t.legend)==null?void 0:s.padding)||[5,5,5,5],itemGap:((c=t.legend)==null?void 0:c.itemGap)||10,itemWidth:((h=t.legend)==null?void 0:h.itemWidth)||14,itemHeight:((p=t.legend)==null?void 0:p.itemHeight)||14,textStyle:{fontSize:12,...(f=t.legend)==null?void 0:f.textStyle}}},getVisualMapOption(t,n){const o=n.flatMap(l=>l.rows.flatMap(i=>i.values)),a=Math.max(...o);return{min:Math.min(...o),max:a,text:["高","低"],realtime:!1,calculable:!0,inRange:{color:t.visualMapColors||["#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]},textStyle:{color:t.visualMapTextColor||"#333"}}},getSeriesData(t,n){const o=n.filter(r=>{var l;return(l=t==null?void 0:t.displayMetrics)==null?void 0:l.includes(`${r.name}.${r.metricId}`)});let a=[];return o.forEach(r=>{r.rows.forEach(l=>{var i;a.push({name:l.name,type:"map",map:t.mapName||"china",roam:t.roam!==!1,label:{show:((i=t.label)==null?void 0:i.show)||!1,fontSize:10},emphasis:{label:{show:!0}},data:r.headers.map((s,c)=>{var h;return{name:s,value:((h=l.values)==null?void 0:h[c])||0}})})})}),a}}};function Dg(t,n,o,a,r,l){return e.openBlock(),e.createElementBlock("div",{ref:"chartRef",class:e.normalizeClass({chart:o.isBi}),style:e.normalizeStyle({height:o.height})},null,6)}const vd=j(Tg,[["render",Dg],["__scopeId","data-v-37b2533e"]]),Mg={name:"ReportTable",props:{rawData:{type:Object,required:!0},height:{type:String,default:"100%"},maxHeight:{type:String,default:null},border:{type:Boolean,default:!0},stripe:{type:Boolean,default:!0},size:{type:String,default:"default"},showPagination:{type:Boolean,default:!0},pageSizes:{type:Array,default:()=>[10,20,50,100]},pageSize:{type:Number,default:10}},data(){return{currentPage:1,total:0,tableData:[],metrics:[]}},computed:{pagedTableData(){const t=(this.currentPage-1)*this.pageSize,n=t+this.pageSize;return this.tableData.slice(t,n)}},watch:{rawData:{handler:"updateTable",deep:!0,immediate:!0}},methods:{updateTable(){const{dataSet:t}=this.rawData,n=t.tables;if(!n||n.length===0)return;const o=n[0].originalHeaders.map(a=>a.split(" ")[0]);this.metrics=n.map((a,r)=>({prop:`metric_${r}`,label:a.metricName})),this.tableData=o.map((a,r)=>{let l={time:a};return n.forEach((i,s)=>{l[`metric_${s}`]=i.rows[0].values[r]||0}),l}),this.total=this.tableData.length},handleSortChange({column:t,prop:n,order:o}){this.$emit("sort-change",{column:t,prop:n,order:o})},handleSizeChange(t){this.pageSize=t,this.currentPage=1},handleCurrentChange(t){this.currentPage=t}}},Rg={key:0,class:"pagination-container"};function Og(t,n,o,a,r,l){const i=e.resolveComponent("el-table-column"),s=e.resolveComponent("el-table"),c=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",{class:"report-table-container",style:e.normalizeStyle({height:o.height})},[e.createVNode(s,{data:l.pagedTableData,border:o.border,stripe:o.stripe,size:o.size,"max-height":o.maxHeight,style:{width:"100%"},onSortChange:l.handleSortChange},{default:e.withCtx(()=>[e.createVNode(i,{prop:"time",label:"交易时间",sortable:"",align:"center",width:"180"}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.metrics,(h,p)=>(e.openBlock(),e.createBlock(i,{key:p,prop:h.prop,label:h.label,sortable:"",align:"center"},null,8,["prop","label"]))),128))]),_:1},8,["data","border","stripe","size","max-height","onSortChange"]),o.showPagination?(e.openBlock(),e.createElementBlock("div",Rg,[e.createVNode(c,{"current-page":r.currentPage,"page-sizes":o.pageSizes,"page-size":o.pageSize,size:"small",layout:"total, sizes, prev, pager, next, jumper",total:r.total,onSizeChange:l.handleSizeChange,onCurrentChange:l.handleCurrentChange},null,8,["current-page","page-sizes","page-size","total","onSizeChange","onCurrentChange"])])):e.createCommentVNode("",!0)],4)}const Qd=j(Mg,[["render",Og],["__scopeId","data-v-81083195"]]),Pg={name:"ChartTitle",props:{title:{type:String,default:""},subtitle:{type:String,default:""},align:{type:String,default:"center",validator:t=>["left","center","right"].includes(t)},titleStyle:{type:Object,default:()=>({color:"#333",fontSize:"18px",fontWeight:"bold",marginBottom:"10px"})},subtitleStyle:{type:Object,default:()=>({color:"#666",fontSize:"14px",marginTop:"4px"})},showDivider:{type:Boolean,default:!1},dividerColor:{type:String,default:"#eee"}},computed:{titleText(){return this.title||"图表标题"},textStyle(){return{textAlign:this.align,...this.titleStyle}},containerStyle(){return{borderBottom:this.showDivider?`1px solid ${this.dividerColor}`:"none",paddingBottom:this.showDivider?"10px":"0"}}}};function qg(t,n,o,a,r,l){return e.openBlock(),e.createElementBlock("div",{class:"chart-title-container",style:e.normalizeStyle(o.titleStyle)},[e.createElementVNode("div",{class:"title-text",style:e.normalizeStyle(l.textStyle)},e.toDisplayString(l.titleText),5),o.subtitle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"subtitle-text",style:e.normalizeStyle(o.subtitleStyle)},e.toDisplayString(o.subtitle),5)):e.createCommentVNode("",!0)],4)}const zd=j(Pg,[["render",qg],["__scopeId","data-v-2679bda5"]]),vg={Bar:qa,Line:Nd,Pie:Td,Area:Dd,Metric:Md,Gauge:Rd,Funnel:Od,Scatter:Pd,Radar:qd,Map:vd,ReportTable:Qd,ChartTitle:zd},Qg={name:"lwBiChartItem",components:{BarChart:qa,LineChart:Nd,PieChart:Td,AreaChart:Dd,MetricCard:Md,GaugeChart:Rd,FunnelChart:Od,ScatterChart:Pd,RadarChart:qd,MapChart:vd,ReportTable:Qd,ChartTitle:zd},provide(){return{echarts:e4}},props:{rawData:{type:Object,default:null},height:{type:String,default:"300px"},isBi:{type:Boolean,default:!0}},computed:{isShow(){var t,n,o;return this.rawData&&(((t=this.rawData)==null?void 0:t.setting)&&((n=this.rawData)==null?void 0:n.dataSet)||((o=this.rawData)==null?void 0:o.option))},chartType(){var t;return((t=this.rawData)==null?void 0:t.type)||"Bar"},chartComponent(){return vg[this.chartType]||qa}}};function zg(t,n,o,a,r,l){return l.isShow?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.chartComponent),{key:0,rawData:o.rawData,height:o.height,isBi:o.isBi},null,8,["rawData","height","isBi"])):e.createCommentVNode("",!0)}const Ud=j(Qg,[["render",zg]]),Ug={components:{GridLayout:za.GridLayout,GridItem:za.GridItem},data(){return{id:"",searchOptions:[],chartPageRefs:[],chartList:[],globalFilter:{values:{},ranges:{}},searchParams:{}}},props:{chartId:{type:String,default:""},designMode:{type:Boolean,default:!1},isDashboard:{type:Boolean,default:!1}},watch:{chartId:{handler(t){this.id=t||this.$route.query.id,this.getDataList()},deep:!0,immediate:!0}},methods:{async getDataList(){let t=await this.$http.get(`${this.$config.API_URL}/bi-manage/{tenantId}/{buCode}/dashboard_render/${this.id}`);this.chartList=(t==null?void 0:t.charts)||[],this.getFilter(t.filterControls)},async changeTimeUnit(t,n){let{data:o,...a}=t,r=await this.$http.get(`${this.$config.API_URL}/bi-manage/{tenantId}/{buCode}/visualize/${a.id}`);r==null||r.models.forEach(c=>{c==null||c.dimensions.forEach(h=>{h.timeSetting.timeUnit=t.timeUnit})});let l=this.unflattenObject(this.searchParams);l.ranges&&Object.entries(l.ranges).map(([c,h])=>{this.globalFilter.ranges[c].timeRange={from:h[0],to:h[1]}}),this.globalFilter.values=l.values;let i={charts:[a],globalFilter:this.globalFilter,visualizes:[r]},s=await this.$http.post(`${this.$config.API_URL}/bi-manage/{tenantId}/{buCode}/dashboard_render/${this.id}/partial_refresh`,i);this.chartList[n].data=(s==null?void 0:s[n].data)||[],this.chartList[n].timeUnit=t.timeUnit},unflattenObject(t){const n={};for(const o in t){const a=o.split(".");let r=n;a.forEach((l,i)=>{i===a.length-1?r[l]=t[o]:((!r[l]||typeof r[l]!="object")&&(r[l]={}),r=r[l])})}return n},search(){let t=JSON.parse(JSON.stringify(this.globalFilter)),n=this.unflattenObject(this.searchParams);n.ranges&&Object.entries(n.ranges).map(([o,a])=>{t.ranges[o].timeRange={from:(a==null?void 0:a[0])||this.globalFilter.ranges[o].timeRange.from,to:(a==null?void 0:a[1])||this.globalFilter.ranges[o].timeRange.to},t.ranges[o].type="ABSOLUTE"}),t.values=n.values,this.getChartList(t),this.chartPageRefs.length>0&&this.chartPageRefs.forEach(o=>{o.searchParams=this.searchParams,o.globalFilter=t,o.search()})},reset(){this.getChartList(this.globalFilter),this.chartPageRefs.length>0&&this.chartPageRefs.forEach(t=>{t.getChartList(this.globalFilter)})},async getChartList(t={}){let n={charts:this.chartList.map(({data:o,...a})=>a),globalFilter:t};this.chartList=await this.$http.post(`${this.$config.API_URL}/bi-manage/{tenantId}/{buCode}/dashboard/design_mode/render`,n)},removeChart(t){this.modelValue.splice(t,1)},listToTree(t){const n=[],o={};return t.forEach(a=>{o[a.id]={value:a.id,label:a.name,children:[]}}),t.forEach(a=>{const r=o[a.parent];r?r.children.push(o[a.id]):n.push(o[a.id])}),n},async getFilter(t){var n,o;for(const a of t){const{type:r}=a,l=async s=>{const{type:c,dict:h,dataInterfaceUri:p,dimensionTableId:f}=s.options;return c==="DICT"?Object.entries(h).map(([y,b])=>({value:y,label:b})):c==="DATA_INTERFACE"?(await this.$http.get(p)).map(b=>({value:b.id,label:b.name})):(await this.$api.dimensionChild.list({},f)).map(b=>({value:b.id,label:b.name}))},i=async s=>{const{type:c,dict:h,dataInterfaceUri:p,dimensionTableId:f}=s.options;if(c==="DICT")return Object.entries(h).map(([y,b])=>({value:y,label:b}));if(c==="DATA_INTERFACE"){const y=await this.$http.get(p);return this.listToTree(y)}else{const y=await this.$api.dimensionChild.list({},f);return this.listToTree(y)}};switch(r){case"DATA_PICKER":{const s=a.dataPickerSetting,c=await l(s);this.searchParams[`values.${s.code}`]=(s==null?void 0:s.value)||"",this.searchOptions.push({label:a.name,prop:`values.${s.code}`,renderType:"select",options:c,value:(s==null?void 0:s.value)||"",valueKey:"value",labelKey:"label"});break}case"DATA_CASCADE":{const s=a.dataPickerSetting,c=await i(s);this.searchParams[`values.${s.code}`]=(s==null?void 0:s.value)||"",this.searchOptions.push({label:a.name,name:`values.${s.code}`,value:(s==null?void 0:s.value)||"",component:"treeSelect",options:{items:c,placeholder:"请选择"+a.name,checkStrictly:!0}});break}case"DATA_INPUT":{this.searchParams[`values.${a.dataInputSetting.code}`]=((n=a.dataInputSetting)==null?void 0:n.value)||"",this.searchOptions.push({label:a.name,prop:`values.${a.dataInputSetting.code}`,value:((o=a.dataInputSetting)==null?void 0:o.value)||"",renderType:"input"});break}case"DATE_PICKER":{const s=a.datePickerSetting;let c=[];switch(a.datePickerSetting.type){case"TODAY":c=[ae().format("YYYY-MM-DDTHH:mm:ss.SSSZ"),ae().format("YYYY-MM-DDTHH:mm:ss.SSSZ")];break;case"THIS_MONTH":c=[ae().startOf("month").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),ae().endOf("month").format("YYYY-MM-DDTHH:mm:ss.SSSZ")];break;case"THIS_YEAR":c=[ae().startOf("year").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),ae().endOf("year").format("YYYY-MM-DDTHH:mm:ss.SSSZ")];break;case"LAST_10_DAYS":c=[ae().subtract(10,"day").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),ae().format("YYYY-MM-DDTHH:mm:ss.SSSZ")];break;case"LAST_30_DAYS":c=[ae().subtract(30,"day").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),ae().format("YYYY-MM-DDTHH:mm:ss.SSSZ")];break;case"LAST_12_MONTH":c=[ae().subtract(12,"month").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),ae().format("YYYY-MM-DDTHH:mm:ss.SSSZ")];break;case"LAST_5_YEAR":c=[ae().subtract(5,"year").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),ae().format("YYYY-MM-DDTHH:mm:ss.SSSZ")];break;case"LAST_60_SECONDS":c=[ae().subtract(60,"second").toISOString(),ae().toISOString()];break;case"LAST_30_MINUTES":c=[ae().subtract(30,"minute").toISOString(),ae().toISOString()];break;case"LAST_24_HOURS":c=[ae().subtract(24,"hour").toISOString(),ae().toISOString()];break;case"CURRENT_MONDAY_TO_TODAY":c=[ae().startOf("week").add(1,"day").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),ae().format("YYYY-MM-DDTHH:mm:ss.SSSZ")];break;case"YESTERDAY":c=[ae().subtract(1,"day").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),ae().subtract(1,"day").format("YYYY-MM-DDTHH:mm:ss.SSSZ")];break;case"LAST_YEAR":c=[ae().subtract(1,"year").startOf("year").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),ae().subtract(1,"year").endOf("year").format("YYYY-MM-DDTHH:mm:ss.SSSZ")];break;case"ABSOLUTE":c=[a.datePickerSetting.timeRange.from,a.datePickerSetting.timeRange.to];break;default:c=[];break}this.searchParams[`ranges.${s.code}`]=c,this.searchOptions.push({label:a.name,prop:`ranges.${s.code}`,renderType:"dateRange",value:c,valueFormat:"YYYY-MM-DDTHH:mm:ss.SSSZ"}),this.globalFilter.ranges[s.code]={timeRange:{from:(c==null?void 0:c[0])||"",to:(c==null?void 0:c[1])||""},type:s.type};break}}}}}},Gg={class:"lw-bi-chart-global-layout"},Hg={key:0,class:"filter-top"},jg={key:1,class:"grid-item-dashboard"},Zg=["onClick"],Yg={key:1,class:"no-record-panel e-unselect"};function Kg(t,n,o,a,r,l){const i=e.resolveComponent("lw-search"),s=e.resolveComponent("el-radio-button"),c=e.resolveComponent("el-radio-group"),h=e.resolveComponent("lwBiChartPage"),p=e.resolveComponent("lwBiChartItem"),f=e.resolveComponent("el-button"),y=e.resolveComponent("GridItem"),b=e.resolveComponent("GridLayout"),w=e.resolveComponent("el-empty");return e.openBlock(),e.createElementBlock("div",Gg,[r.searchOptions.length>0&&!o.isDashboard?(e.openBlock(),e.createBlock(i,{key:0,class:"search-body",options:r.searchOptions,modelValue:r.searchParams,"onUpdate:modelValue":n[0]||(n[0]=E=>r.searchParams=E),hideLabel:!0,onSearch:l.search,onReset:l.reset},null,8,["options","modelValue","onSearch","onReset"])):e.createCommentVNode("",!0),e.createVNode(b,{layout:r.chartList,"onUpdate:layout":n[1]||(n[1]=E=>r.chartList=E),"col-num":12,"row-height":30,"is-draggable":o.designMode,"is-resizable":o.designMode,"use-css-transforms":!1,"vertical-compact":""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.chartList,(E,V)=>(e.openBlock(),e.createBlock(y,{key:E.i,x:E.x,y:E.y,w:E.w,h:E.h,i:E.i},{default:e.withCtx(()=>{var F,S,B,q;return[e.createElementVNode("div",{class:e.normalizeClass(["lw-bi-chart-global-layout-item",{edit:o.designMode}])},[(S=(F=E.data)==null?void 0:F.setting)!=null&&S.activeDateUnitFilter?(e.openBlock(),e.createElementBlock("div",Hg,[e.createVNode(c,{modelValue:E.timeUnit,"onUpdate:modelValue":v=>E.timeUnit=v,onChange:v=>l.changeTimeUnit(E,V)},{default:e.withCtx(()=>{var v,_,P,L;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((_=(v=E.data)==null?void 0:v.setting)==null?void 0:_.optionalDateUnitRanges,(G,N)=>(e.openBlock(),e.createBlock(s,{label:N,value:G,key:N},null,8,["label","value"]))),128)),Object.keys((L=(P=E.data)==null?void 0:P.setting)==null?void 0:L.optionalDateUnitRanges).length==0?(e.openBlock(),e.createBlock(s,{key:0,disabled:""},{default:e.withCtx(()=>n[2]||(n[2]=[e.createTextVNode(" 未选择周期列表 未选择周期列表 ")])),_:1})):e.createCommentVNode("",!0)]}),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])])):e.createCommentVNode("",!0),(E==null?void 0:E.type)=="Dashboard"?(e.openBlock(),e.createElementBlock("div",jg,[e.createVNode(h,{ref_for:!0,ref:v=>{v&&(r.chartPageRefs[V]=v)},chartId:E.id},null,8,["chartId"])])):e.createCommentVNode("",!0),e.createVNode(p,{rawData:E.data,height:(q=(B=E.data)==null?void 0:B.setting)!=null&&q.activeDateUnitFilter?"calc(100% - 36px)":"100%"},null,8,["rawData","height"]),o.designMode?(e.openBlock(),e.createElementBlock("div",{key:2,class:"remove",onClick:v=>l.removeChart(V)},[e.createVNode(f,{type:"primary",link:"",icon:"el-icon-delete"})],8,Zg)):e.createCommentVNode("",!0)],2)]}),_:2},1032,["x","y","w","h","i"]))),128))]),_:1},8,["layout","is-draggable","is-resizable"]),r.chartList.length===0?(e.openBlock(),e.createElementBlock("div",Yg,[e.createVNode(w,{description:o.designMode?"点击上方工具栏中的按钮,添加图表至当前仪表板":"仪表板中还没有添加任何图表"},null,8,["description"])])):e.createCommentVNode("",!0)])}const Gd=j(Ug,[["render",Kg],["__scopeId","data-v-f58afdb9"]]);/*!
|
|
24
|
+
`).join("")},getLegendOption(t,n){var o,a,r,l,i,s,c,h,p,f;return{show:((o=t.legend)==null?void 0:o.show)!==!1,type:((a=t.legend)==null?void 0:a.type)||"scroll",orient:((r=t.legend)==null?void 0:r.orient)||"horizontal",left:((l=t.legend)==null?void 0:l.left)||"left",top:((i=t.legend)==null?void 0:i.top)||"top",padding:((s=t.legend)==null?void 0:s.padding)||[5,5,5,5],itemGap:((c=t.legend)==null?void 0:c.itemGap)||10,itemWidth:((h=t.legend)==null?void 0:h.itemWidth)||14,itemHeight:((p=t.legend)==null?void 0:p.itemHeight)||14,textStyle:{fontSize:12,...(f=t.legend)==null?void 0:f.textStyle}}},getGridOption(t){if(t.grid)return{containLabel:!0,...t.grid}},getToolboxOption(t){var n,o,a,r;if(!(!t.toolbox||t.toolbox.show===!1))return{...t.toolbox,feature:{...t.toolbox.feature||{},saveAsImage:(o=(n=t.toolbox.feature)==null?void 0:n.saveAsImage)!=null&&o.show?{type:"png",pixelRatio:2,...t.toolbox.feature.saveAsImage}:void 0,dataView:(r=(a=t.toolbox.feature)==null?void 0:a.dataView)!=null&&r.show?{readOnly:!0,...t.toolbox.feature.dataView}:void 0}}},getXAxisOption(t){return{type:"category",boundaryGap:!1,data:t[0].headers,axisLabel:{rotate:30,interval:0}}},getYAxisOption(t){var n;return{type:"value",axisLabel:{formatter:((n=t.yAxis)==null?void 0:n.formatter)||this.defaultYAxisFormatter},...t.yAxis}},defaultYAxisFormatter(t){return t>=1e4?(t/1e4).toFixed(1)+"万":t>=1e3?(t/1e3).toFixed(1)+"k":t},getSeriesData(t,n){let o=[];return n.map((a,r)=>{a.rows.map(l=>{var i,s,c,h,p,f,y,b,w,E,V,F,S,B,q,v,_,P,L,G,N,Q,H,Z,M,K,g;o.push({name:l.name,type:"line",stack:((i=t.series)==null?void 0:i.stack)||"total",areaStyle:{opacity:((c=(s=t.series)==null?void 0:s.areaStyle)==null?void 0:c.opacity)||.8,color:(p=(h=t.series)==null?void 0:h.areaStyle)==null?void 0:p.color,...((f=t.series)==null?void 0:f.areaStyle)||{}},emphasis:{focus:((b=(y=t.series)==null?void 0:y.emphasis)==null?void 0:b.focus)||"series"},smooth:((w=t.series)==null?void 0:w.smooth)!==!1,symbol:((E=t.series)==null?void 0:E.symbol)||"circle",symbolSize:((V=t.series)==null?void 0:V.symbolSize)||6,lineStyle:{width:((S=(F=t.series)==null?void 0:F.lineStyle)==null?void 0:S.width)||2,type:(q=(B=t.series)==null?void 0:B.lineStyle)==null?void 0:q.type,color:(_=(v=t.series)==null?void 0:v.lineStyle)==null?void 0:_.color,...((P=t.series)==null?void 0:P.lineStyle)||{}},data:l.values,label:{show:((G=(L=t.series)==null?void 0:L.label)==null?void 0:G.show)||!1,position:((Q=(N=t.series)==null?void 0:N.label)==null?void 0:Q.position)||"top",formatter:((Z=(H=t.series)==null?void 0:H.label)==null?void 0:Z.formatter)||"{@value}",fontSize:((K=(M=t.series)==null?void 0:M.label)==null?void 0:K.fontSize)||12,...((g=t.series)==null?void 0:g.label)||{}},...t.series||{}})})}),o}}};function Ag(t,n,o,a,r,l){return e.openBlock(),e.createElementBlock("div",{ref:"chartRef",class:e.normalizeClass({chart:o.isBi}),style:e.normalizeStyle({height:o.height})},null,6)}const Dd=j(yg,[["render",Ag],["__scopeId","data-v-7818b7b4"]]),bg={name:"MetricCard",data(){return{cardHeight:0}},props:{rawData:{type:Object,required:!0,default:()=>({})},height:{type:String,default:""},subtitle:{type:String,default:"同比变化"},tooltip:{type:String,default:""}},computed:{parsedData(){var r;const{setting:t,dataSet:n}=this.rawData,{tables:o}=n,a=(r=t==null?void 0:t.displayMetrics)==null?void 0:r.map(l=>{const[i,s]=l.split(".");return o.find(c=>c.name===i&&c.metricId===s)}).filter(Boolean);return this.height?this.cardHeight=this.height:this.cardHeight=200+(a.length-2)*10+"px",this.transformData(a,t)},columns(){var t,n;return((t=this.parsedData)==null?void 0:t.length)<this.rawData.setting.columnCount?(n=this.parsedData)==null?void 0:n.length:this.rawData.setting.columnCount},paddingDefault(){var t,n,o,a,r,l,i,s;return[`${(n=(t=this.rawData.setting)==null?void 0:t.grid)==null?void 0:n.top}px`||0,`${(a=(o=this.rawData.setting)==null?void 0:o.grid)==null?void 0:a.right}px`||0,`${(l=(r=this.rawData.setting)==null?void 0:r.grid)==null?void 0:l.bottom}px`||0,`${(s=(i=this.rawData.setting)==null?void 0:i.grid)==null?void 0:s.left}px`||0]},titleLeftRight(){var o;let{left:t}=((o=this.rawData.setting)==null?void 0:o.title)||{},n={};return t=="left"?n.left=0:t=="center"?(n.left="50%",n.transform="translateX(-50%)"):(n.left="auto",n.right=0),n},legendLeftRight(){var a;let{left:t,top:n}=((a=this.rawData.setting)==null?void 0:a.legend)||{},o={};return t=="left"?o["justify-content"]="flex-start":t=="center"?o["justify-content"]="center":o["justify-content"]="flex-end",n=="top"?o["align-items"]="flex-start":n=="bottom"?o["align-items"]="flex-end":n=="middle"&&(o["align-items"]="center"),o}},methods:{transformData(t,n){const o=[],a=Math.max(...t.map(r=>r.headers.length));for(let r=0;r<a;r++){const l=[];t.forEach(i=>{if(r<i.headers.length){const s=i.headers[r],c=i.metricName,h=i.rows[0].values[r];l.push({name:s!=c?`${s}-${c}`:c,unit:i.unit,unitName:i.unitName,unit:i.unit,setting:n,value:h})}}),l.length>0&&o.push(l)}return o}}},wg={key:0},Bg={key:2,class:"statistic-item"},Eg={class:"number"};function kg(t,n,o,a,r,l){const i=e.resolveComponent("el-icon-warning"),s=e.resolveComponent("el-icon"),c=e.resolveComponent("el-tooltip"),h=e.resolveComponent("el-icon-top"),p=e.resolveComponent("el-icon-bottom");return e.openBlock(),e.createElementBlock("div",{class:"chart-title-card-list",style:e.normalizeStyle({gridTemplateColumns:`repeat(${l.columns||1}, 1fr)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.parsedData,(f,y)=>(e.openBlock(),e.createElementBlock("div",{key:y,class:"chart-title-card",style:e.normalizeStyle({height:r.cardHeight,padding:l.paddingDefault})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f,(b,w)=>{var E,V,F,S,B,q,v,_,P,L,G,N,Q,H,Z,M,K,g,R,z,me,be,we,W,le,Ne,Be,ge;return e.openBlock(),e.createElementBlock(e.Fragment,{key:b.name},[w===0?(e.openBlock(),e.createElementBlock("div",wg,[(E=b.setting.title)!=null&&E.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"title-top",style:e.normalizeStyle({textAlign:((F=(V=b.setting)==null?void 0:V.title)==null?void 0:F.left)||"left",padding:((q=(B=(S=b.setting)==null?void 0:S.title)==null?void 0:B.padding)==null?void 0:q.map(ke=>ke+"px").join(" "))||0})},[e.createElementVNode("span",{style:e.normalizeStyle({color:((_=(v=b.setting.title)==null?void 0:v.textStyle)==null?void 0:_.color)||b.color,fontWeight:((L=(P=b.setting.title)==null?void 0:P.textStyle)==null?void 0:L.fontWeight)||"normal",fontSize:((N=(G=b.setting.title)==null?void 0:G.textStyle)==null?void 0:N.fontSize)+"px"||"17px"})},e.toDisplayString(b.name),5),b.tooltip?(e.openBlock(),e.createBlock(c,{key:0,effect:"dark",content:b.tooltip,placement:"top"},{default:e.withCtx(()=>[e.createVNode(s,{class:"icon-tooltip"},{default:e.withCtx(()=>[e.createVNode(i)]),_:1})]),_:2},1032,["content"])):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"statistic-current",style:e.normalizeStyle({...l.legendLeftRight,color:((H=(Q=b.setting.legend)==null?void 0:Q.textStyle)==null?void 0:H.color)||b.color,padding:((K=(M=(Z=b.setting)==null?void 0:Z.legend)==null?void 0:M.padding)==null?void 0:K.map(ke=>ke+"px").join(" "))||0,fontWeight:((R=(g=b.setting.legend)==null?void 0:g.textStyle)==null?void 0:R.fontWeight)||"bold",fontSize:((me=(z=b.setting.legend)==null?void 0:z.textStyle)==null?void 0:me.fontSize)+"px"||"17px"})},e.toDisplayString((be=b.value)==null?void 0:be.toLocaleString("en-US")),5)])):w==f.length-1?(e.openBlock(),e.createElementBlock("div",{key:1,class:"statistic-footer",style:e.normalizeStyle({left:((W=(we=o.rawData.setting)==null?void 0:we.grid)==null?void 0:W.left)+"px",bottom:((Ne=(le=o.rawData.setting)==null?void 0:le.grid)==null?void 0:Ne.bottom)+"px",right:((ge=(Be=o.rawData.setting)==null?void 0:Be.grid)==null?void 0:ge.right)+"px"})},[e.createElementVNode("span",null,e.toDisplayString(b.name),1),e.createElementVNode("div",{style:e.normalizeStyle({color:b.value>=0?"#BF1220":"#00B78B"})},[b.value>=0?(e.openBlock(),e.createBlock(s,{key:0,class:"icon-up"},{default:e.withCtx(()=>[e.createVNode(h)]),_:1})):(e.openBlock(),e.createBlock(s,{key:1,class:"icon-down"},{default:e.withCtx(()=>[e.createVNode(p)]),_:1})),e.createTextVNode(" "+e.toDisplayString(Math.abs(b.value))+" "+e.toDisplayString(b.unitName),1)],4)],4)):(e.openBlock(),e.createElementBlock("div",Bg,[e.createElementVNode("span",null,e.toDisplayString(b.name),1),e.createElementVNode("div",Eg,e.toDisplayString(Math.abs(b.value))+" "+e.toDisplayString(b.unitName),1)]))],64)}),128))],4))),128))],4)}const Md=j(bg,[["render",kg],["__scopeId","data-v-51540e67"]]),xg={name:"GaugeChart",props:{rawData:{type:Object,required:!0},height:{type:String,default:"300px"},isBi:{type:Boolean,default:!0}},data(){return{option:{},echarts:e.inject("echarts"),chart:null}},watch:{rawData:{handler:"updateChart",deep:!0,immediate:!0}},mounted(){this.$nextTick(()=>{this.initChart()})},beforeDestroy(){this.chart&&(this.chart.dispose(),this.chart=null)},methods:{initChart(){this.chart&&this.chart.dispose(),this.chart=e.markRaw(this.echarts.init(this.$refs.chartRef)),this.updateChart(),window.addEventListener("resize",()=>{this.chart&&this.chart.resize()})},updateChart(){if(!this.chart||!this.rawData)return;const{setting:t,dataSet:n,option:o}=this.rawData,{tables:a}=n||{};this.isBi?this.option={title:this.getTitleOption(t),tooltip:this.getTooltipOption(t),series:this.getSeriesData(t,a)}:this.option=o,this.option&&this.chart.setOption(this.option,!0),setTimeout(()=>{this.chart.resize()},10)},getTitleOption(t){var n,o,a,r,l,i;return{show:((n=t.title)==null?void 0:n.show)!==!1,text:((o=t.title)==null?void 0:o.text)||"",textStyle:{fontSize:16,fontWeight:"bold",color:"#333",...(a=t.title)==null?void 0:a.textStyle},left:((r=t.title)==null?void 0:r.left)||"center",top:((l=t.title)==null?void 0:l.top)||"top",padding:((i=t.title)==null?void 0:i.padding)||[5,5,5,5]}},getTooltipOption(t){var n;return{formatter:((n=t.tooltip)==null?void 0:n.formatter)||"{a} <br/>{b}: {c}"}},getMinMaxValues(t){const n=t.flatMap(r=>r.rows.flatMap(l=>l.values)),o=Math.min(...n),a=Math.max(...n);return{min:o,max:a}},getGridCenters(t){const n=t.length,o=Math.ceil(Math.sqrt(n)),a=Math.round(Math.sqrt(n)),r=[];for(let l=0;l<n;l++){const i=Math.floor(l/a),c=((l%a+.5)*(100/a)).toFixed(2)+"%",h=((i+.5)*(100/o)).toFixed(2)+"%";r.push([h,c])}return r},getSeriesData(t,n){let o=this.getGridCenters(n),a=[];return n.forEach((r,l)=>{a.push({type:"gauge",...this.getMinMaxValues(n),name:r.metricName,radius:`${90/n.length}%`,center:o[l],detail:{valueAnimation:!0,formatter:t.formatter||"{value}",color:"inherit",fontSize:14},data:this.parseGaugeData(r)})}),a},parseGaugeData(t){let n=[];return t.headers.forEach((o,a)=>{n.push({name:o,value:t.rows[0].values[a],title:{show:!1},detail:{show:!1}})}),n}}};function Vg(t,n,o,a,r,l){return e.openBlock(),e.createElementBlock("div",{ref:"chartRef",class:e.normalizeClass({chart:o.isBi}),style:e.normalizeStyle({height:o.height})},null,6)}const Rd=j(xg,[["render",Vg],["__scopeId","data-v-6b008f06"]]),_g={name:"FunnelChart",props:{rawData:{type:Object,required:!0},height:{type:String,default:"300px"},isBi:{type:Boolean,default:!0}},data(){return{option:{},echarts:e.inject("echarts"),chart:null}},watch:{rawData:{handler:"updateChart",deep:!0,immediate:!0}},mounted(){this.$nextTick(()=>{this.initChart()})},beforeDestroy(){this.chart&&(this.chart.dispose(),this.chart=null)},methods:{initChart(){this.chart&&this.chart.dispose(),this.chart=e.markRaw(this.echarts.init(this.$refs.chartRef)),this.updateChart(),window.addEventListener("resize",()=>{this.chart&&this.chart.resize()})},updateChart(){if(!this.chart||!this.rawData)return;const{setting:t,dataSet:n,option:o}=this.rawData,{tables:a}=n||{};this.isBi?this.option={title:t.title?this.getTitleOption(t):void 0,tooltip:t.tooltip?this.getTooltipOption(t):void 0,legend:t.legend?this.getLegendOption(t,a):void 0,grid:t.grid?this.getGridOption(t):void 0,series:this.getSeriesData(t,a),color:t.color}:this.option=o,this.option&&this.chart.setOption(this.option,!0),setTimeout(()=>{this.chart.resize()},10)},getTitleOption(t){var n,o,a,r,l,i;return{show:((n=t.title)==null?void 0:n.show)!==!1,text:((o=t.title)==null?void 0:o.text)||"",textStyle:{fontSize:16,fontWeight:"bold",color:"#333",...(a=t.title)==null?void 0:a.textStyle},left:((r=t.title)==null?void 0:r.left)||"center",top:((l=t.title)==null?void 0:l.top)||"top",padding:((i=t.title)==null?void 0:i.padding)||[5,5,5,5]}},getTooltipOption(t){const n=t.tooltip||{};return{show:n.show,trigger:"item",formatter:n.formatter||"{a} <br/>{b}: {c}"}},getLegendOption(t,n){var o,a,r,l,i,s,c,h,p,f;return{show:((o=t.legend)==null?void 0:o.show)!==!1,type:((a=t.legend)==null?void 0:a.type)||"scroll",orient:((r=t.legend)==null?void 0:r.orient)||"horizontal",left:((l=t.legend)==null?void 0:l.left)||"left",top:((i=t.legend)==null?void 0:i.top)||"top",padding:((s=t.legend)==null?void 0:s.padding)||[5,5,5,5],itemGap:((c=t.legend)==null?void 0:c.itemGap)||10,itemWidth:((h=t.legend)==null?void 0:h.itemWidth)||14,itemHeight:((p=t.legend)==null?void 0:p.itemHeight)||14,textStyle:{fontSize:12,...(f=t.legend)==null?void 0:f.textStyle}}},getGridOption(t){const n=t.grid||{};return{top:n.top,left:n.left,right:n.right,bottom:n.bottom,containLabel:n.containLabel}},getGridCenters(t,n={top:8,right:5,bottom:5,left:5}){const o=Math.ceil(Math.sqrt(t)),a=Math.round(Math.sqrt(t)),r=[];for(let l=0;l<t;l++){const i=Math.floor(l/a),c=(l%a*(100/a)+parseInt(n.top)).toFixed(2)+"%",h=(i*(90/o)+parseInt(n.left)).toFixed(2)+"%",p=((90-parseInt(n.right))/o).toFixed(2)+"%",f=((100-parseInt(n.bottom))/a).toFixed(2)+"%";r.push({left:h,top:c,width:p,height:f})}return r},getSeriesData(t,n){const o=n.reduce((s,c)=>s+c.rows.length,0),a=this.getGridCenters(o,t.grid),r=t.series||{},l=t.label||{};let i=[];return n.forEach((s,c)=>{s.rows.forEach((h,p)=>{var y,b;const f=c+p;i.push({name:s.metricName,type:"funnel",...a[f],label:{position:l.position||"inside",formatter:l.formatter||"{b}: {c}",color:l.color,fontSize:l.fontSize},labelLine:{length:l.length,lineStyle:{width:l.lineWidth,type:l.lineType}},itemStyle:{borderColor:r.borderColor||"#fff",borderWidth:r.borderWidth||1,borderRadius:r.borderRadius},emphasis:{label:{show:!0,fontSize:((b=(y=r.emphasis)==null?void 0:y.label)==null?void 0:b.fontSize)||16}},data:h.values.map((w,E)=>({value:w,name:s.headers[E]}))})})}),i}}};function Ig(t,n,o,a,r,l){return e.openBlock(),e.createElementBlock("div",{ref:"chartRef",class:e.normalizeClass({chart:o.isBi}),style:e.normalizeStyle({height:o.height})},null,6)}const Od=j(_g,[["render",Ig],["__scopeId","data-v-3708b699"]]),Sg={name:"ScatterChart",props:{rawData:{type:Object,required:!0},height:{type:String,default:"300px"},isBi:{type:Boolean,default:!0}},data(){return{option:{},echarts:e.inject("echarts"),chart:null}},watch:{rawData:{handler:"updateChart",deep:!0,immediate:!0}},mounted(){this.$nextTick(()=>{this.initChart()})},beforeDestroy(){this.chart&&(this.chart.dispose(),this.chart=null)},methods:{initChart(){this.chart&&this.chart.dispose(),this.chart=e.markRaw(this.echarts.init(this.$refs.chartRef)),this.updateChart(),window.addEventListener("resize",()=>{this.chart&&this.chart.resize()})},updateChart(){if(!this.chart||!this.rawData)return;const{setting:t,dataSet:n,option:o}=this.rawData,{tables:a}=n||{};this.isBi?this.option={title:this.getTitleOption(t),tooltip:this.getTooltipOption(t),legend:this.getLegendOption(t,a),grid:this.getGridOption(t),xAxis:this.getXAxisOption(t,a),yAxis:this.getYAxisOption(t),visualMap:this.getVisualMapOption(t,a),series:this.getSeriesData(t,a),color:t.useThemeColor?void 0:t.color||this.getDefaultColors(),toolbox:this.getToolboxOption(t)}:this.option=o,this.option&&this.chart.setOption(this.option,!0),setTimeout(()=>{this.chart.resize()},10)},getTitleOption(t){var n,o,a,r,l,i;return{show:((n=t.title)==null?void 0:n.show)!==!1,text:((o=t.title)==null?void 0:o.text)||"",textStyle:{fontSize:16,fontWeight:"bold",color:"#333",...(a=t.title)==null?void 0:a.textStyle},left:((r=t.title)==null?void 0:r.left)||"center",top:((l=t.title)==null?void 0:l.top)||"top",padding:((i=t.title)==null?void 0:i.padding)||[5,5,5,5]}},getTooltipOption(t){var n,o;return{show:((n=t.tooltip)==null?void 0:n.show)!==!1,trigger:"item",formatter:((o=t.tooltip)==null?void 0:o.formatter)||(a=>{const r=a.data;return`${a.seriesName}<br/>${a.name}: (${r[1]})`})}},getLegendOption(t,n){var o,a,r,l,i,s,c,h,p,f;return{show:((o=t.legend)==null?void 0:o.show)!==!1,type:((a=t.legend)==null?void 0:a.type)||"scroll",orient:((r=t.legend)==null?void 0:r.orient)||"horizontal",left:((l=t.legend)==null?void 0:l.left)||"left",top:((i=t.legend)==null?void 0:i.top)||"top",padding:((s=t.legend)==null?void 0:s.padding)||[5,5,5,5],itemGap:((c=t.legend)==null?void 0:c.itemGap)||10,itemWidth:((h=t.legend)==null?void 0:h.itemWidth)||14,itemHeight:((p=t.legend)==null?void 0:p.itemHeight)||14,textStyle:{fontSize:12,...(f=t.legend)==null?void 0:f.textStyle}}},getGridOption(t){var n,o,a,r,l;return{left:((n=t.grid)==null?void 0:n.left)||"20",right:((o=t.grid)==null?void 0:o.right)||"20",top:((a=t.grid)==null?void 0:a.top)||"50",bottom:((r=t.grid)==null?void 0:r.bottom)||"20",containLabel:((l=t.grid)==null?void 0:l.containLabel)!==!1}},getXAxisOption(t,n){var o,a,r;return{type:"category",name:((o=t.xAxis)==null?void 0:o.name)||"",data:((a=n[0])==null?void 0:a.headers)||[],axisLabel:((r=t.xAxis)==null?void 0:r.axisLabel)||{},splitLine:{lineStyle:{type:"dashed"}}}},getYAxisOption(t){var n,o;return{type:"value",name:((n=t.yAxis)==null?void 0:n.name)||"",axisLabel:((o=t.yAxis)==null?void 0:o.axisLabel)||{},splitLine:{lineStyle:{type:"dashed"}}}},getVisualMapOption(t,n){var l,i,s,c,h,p,f,y,b;if(!t.visualMap||t.visualMap.top==="-10000")return null;const o=n.flatMap(w=>w.rows.flatMap(E=>E.values.filter(V=>typeof V=="number"&&isFinite(V)))),a=o.length?Math.max(...o):100,r=o.length?Math.min(...o):0;return{left:((l=t.visualMap)==null?void 0:l.left)||"right",top:((i=t.visualMap)==null?void 0:i.top)||"bottom",dimension:((s=t.visualMap)==null?void 0:s.dimension)||2,min:((c=t.visualMap)==null?void 0:c.min)??r,max:((h=t.visualMap)==null?void 0:h.max)??a,itemWidth:((p=t.visualMap)==null?void 0:p.itemWidth)||20,itemHeight:((f=t.visualMap)==null?void 0:f.itemHeight)||120,calculable:((y=t.visualMap)==null?void 0:y.calculable)||!1,inRange:((b=t.visualMap)==null?void 0:b.inRange)||{symbolSize:[0,50]},text:["高","低"]}},getSeriesData(t,n){let o=[];return n.map((a,r)=>{a.rows.map((l,i)=>{var s,c;o.push({name:n.length>1?a.metricName:a.metricName+"-"+l.name,type:"scatter",symbolSize:t.symbolSize||10,data:a.headers.map((h,p)=>{const f=a.rows[i].values[p];return[h,typeof f=="number"&&isFinite(f)?f:0,typeof f=="number"&&isFinite(f)?f:0]}),label:{show:((s=t.label)==null?void 0:s.show)||!1,formatter:((c=t.label)==null?void 0:c.formatter)||"{b}"}})})}),o},getToolboxOption(t){var n,o,a,r,l;if((n=t.toolbox)!=null&&n.show)return{show:!0,feature:{saveAsImage:{show:((a=(o=t.toolbox.feature)==null?void 0:o.saveAsImage)==null?void 0:a.show)||!1},dataView:{show:((l=(r=t.toolbox.feature)==null?void 0:r.dataView)==null?void 0:l.show)||!1}}}},getItemStyleOption(t){return t.itemStyle||{opacity:.8,shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}},getDefaultColors(){return["#5E9CC5","#FF7300","#14C566","#FF5E50","#BB83C0","#B77366","#FF8FC0","#A4A69C","#CFD162"]}}};function Fg(t,n,o,a,r,l){return e.openBlock(),e.createElementBlock("div",{ref:"chartRef",class:e.normalizeClass({chart:o.isBi}),style:e.normalizeStyle({height:o.height})},null,6)}const Pd=j(Sg,[["render",Fg],["__scopeId","data-v-f1780bc1"]]),Lg={name:"RadarChart",props:{rawData:{type:Object,required:!0},height:{type:String,default:"300px"},isBi:{type:Boolean,default:!0}},data(){return{option:{},echarts:e.inject("echarts"),chart:null}},watch:{rawData:{handler:"updateChart",deep:!0,immediate:!0}},mounted(){this.$nextTick(()=>{this.initChart()})},beforeDestroy(){this.chart&&(this.chart.dispose(),this.chart=null)},methods:{initChart(){this.chart&&this.chart.dispose(),this.chart=e.markRaw(this.echarts.init(this.$refs.chartRef)),this.updateChart(),window.addEventListener("resize",()=>{this.chart&&this.chart.resize()})},updateChart(){if(!this.chart||!this.rawData)return;const{setting:t,dataSet:n,option:o}=this.rawData,{tables:a}=n||{};this.isBi?this.option={title:this.getTitleOption(t),tooltip:this.getTooltipOption(t),legend:this.getLegendOption(t,a),radar:this.getRadarOption(t,a),series:this.getSeriesData(t,a),color:t.color||this.getDefaultColors()}:this.option=o,this.option&&this.chart.setOption(this.option,!0),setTimeout(()=>{this.chart.resize()},10)},getTitleOption(t){var n,o,a,r,l,i;return{show:((n=t.title)==null?void 0:n.show)!==!1,text:((o=t.title)==null?void 0:o.text)||"",textStyle:{fontSize:16,fontWeight:"bold",color:"#333",...(a=t.title)==null?void 0:a.textStyle},left:((r=t.title)==null?void 0:r.left)||"center",top:((l=t.title)==null?void 0:l.top)||"top",padding:((i=t.title)==null?void 0:i.padding)||[5,5,5,5]}},getTooltipOption(t){var n;return{trigger:"item",formatter:((n=t.tooltip)==null?void 0:n.formatter)||"{a} <br/>{b}: {c}"}},getLegendOption(t,n){var o,a;return{show:((o=t.legend)==null?void 0:o.show)!==!1,textStyle:((a=t.legend)==null?void 0:a.textStyle)||{fontSize:12}}},getRadarOption(t,n){return{indicator:n[0].headers.map((o,a)=>({name:o,max:t.maxValue||Math.max(...n.flatMap(r=>r.rows.flatMap(l=>l.values)))*1.2})),radius:t.radius||"65%",splitNumber:t.splitNumber||5,axisName:{color:t.axisNameColor||"#333"},splitArea:{show:t.showSplitArea!==!1},splitLine:{lineStyle:{color:t.splitLineColor||["rgba(0, 0, 0, 0.1)"]}},axisLine:{lineStyle:{color:t.axisLineColor||"rgba(0, 0, 0, 0.2)"}}}},getSeriesData(t,n){return n.map(o=>{var a,r;return{name:o.metricName,type:"radar",data:[{value:o.rows[0].values,name:o.metricName,areaStyle:t.showArea!==!1?{opacity:.4}:void 0,lineStyle:{width:t.lineWidth||2},symbol:t.symbol||"circle",symbolSize:t.symbolSize||6,label:{show:((a=t.label)==null?void 0:a.show)||!1,formatter:((r=t.label)==null?void 0:r.formatter)||"{c}"}}]}})},getDefaultColors(){return["#3A4DE9","#4BC0C0","#FF9F43","#ED5565","#A0A7E6","#67C23A","#E6A23C","#F56C6C","#909399"]}}};function Ng(t,n,o,a,r,l){return e.openBlock(),e.createElementBlock("div",{ref:"chartRef",class:e.normalizeClass({chart:o.isBi}),style:e.normalizeStyle({height:o.height})},null,6)}const qd=j(Lg,[["render",Ng],["__scopeId","data-v-88abf5da"]]),Tg={name:"MapChart",props:{rawData:{type:Object,required:!0},height:{type:String,default:"300px"},isBi:{type:Boolean,default:!0}},data(){return{option:{},echarts:e.inject("echarts"),chart:null}},watch:{rawData:{handler:"updateChart",deep:!0,immediate:!0}},mounted(){this.$nextTick(()=>{this.initChart()})},beforeDestroy(){this.chart&&(this.chart.dispose(),this.chart=null)},methods:{async initChart(){this.chart&&this.chart.dispose(),this.chart=e.markRaw(this.echarts.init(this.$refs.chartRef)),this.updateChart(),window.addEventListener("resize",()=>{this.chart&&this.chart.resize()})},async updateChart(){var l,i,s,c;if(!this.chart||!this.rawData)return;const{setting:t,dataSet:n,option:o}=this.rawData,{tables:a}=n||{};this.isBi?this.option={title:this.getTitleOption(t),tooltip:this.getTooltipOption(),legend:this.getLegendOption(t,a),visualMap:this.getVisualMapOption(t,a),series:this.getSeriesData(t,a)}:this.option=o;const r=await this.$http.get(`/${this.$config.APP_NAME.toLowerCase()}/map/${((i=(l=this.rawData)==null?void 0:l.setting)==null?void 0:i.mapName)||"china"}.json`);this.echarts.registerMap(((c=(s=this.rawData)==null?void 0:s.setting)==null?void 0:c.mapName)||"china",r),this.option&&this.chart.setOption(this.option,!0),setTimeout(()=>{this.chart.resize()},10)},getTitleOption(t){var n,o,a,r,l,i;return{show:((n=t.title)==null?void 0:n.show)!==!1,text:((o=t.title)==null?void 0:o.text)||"",textStyle:{fontSize:16,fontWeight:"bold",color:"#333",...(a=t.title)==null?void 0:a.textStyle},left:((r=t.title)==null?void 0:r.left)||"center",top:((l=t.title)==null?void 0:l.top)||"top",padding:((i=t.title)==null?void 0:i.padding)||[5,5,5,5]}},getTooltipOption(){return{trigger:"item",showDelay:0,transitionDuration:.2}},getLegendOption(t,n){var o,a,r,l,i,s,c,h,p,f;return{show:((o=t.legend)==null?void 0:o.show)!==!1,type:((a=t.legend)==null?void 0:a.type)||"scroll",orient:((r=t.legend)==null?void 0:r.orient)||"horizontal",left:((l=t.legend)==null?void 0:l.left)||"left",top:((i=t.legend)==null?void 0:i.top)||"top",padding:((s=t.legend)==null?void 0:s.padding)||[5,5,5,5],itemGap:((c=t.legend)==null?void 0:c.itemGap)||10,itemWidth:((h=t.legend)==null?void 0:h.itemWidth)||14,itemHeight:((p=t.legend)==null?void 0:p.itemHeight)||14,textStyle:{fontSize:12,...(f=t.legend)==null?void 0:f.textStyle}}},getVisualMapOption(t,n){const o=n.flatMap(l=>l.rows.flatMap(i=>i.values)),a=Math.max(...o);return{min:Math.min(...o),max:a,text:["高","低"],realtime:!1,calculable:!0,inRange:{color:t.visualMapColors||["#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]},textStyle:{color:t.visualMapTextColor||"#333"}}},getSeriesData(t,n){const o=n.filter(r=>{var l;return(l=t==null?void 0:t.displayMetrics)==null?void 0:l.includes(`${r.name}.${r.metricId}`)});let a=[];return o.forEach(r=>{r.rows.forEach(l=>{var i;a.push({name:l.name,type:"map",map:t.mapName||"china",roam:t.roam!==!1,label:{show:((i=t.label)==null?void 0:i.show)||!1,fontSize:10},emphasis:{label:{show:!0}},data:r.headers.map((s,c)=>{var h;return{name:s,value:((h=l.values)==null?void 0:h[c])||0}})})})}),a}}};function Dg(t,n,o,a,r,l){return e.openBlock(),e.createElementBlock("div",{ref:"chartRef",class:e.normalizeClass({chart:o.isBi}),style:e.normalizeStyle({height:o.height})},null,6)}const vd=j(Tg,[["render",Dg],["__scopeId","data-v-37b2533e"]]),Mg={name:"ReportTable",props:{rawData:{type:Object,required:!0},height:{type:String,default:"100%"},maxHeight:{type:String,default:null},border:{type:Boolean,default:!0},stripe:{type:Boolean,default:!0},size:{type:String,default:"default"},showPagination:{type:Boolean,default:!0},pageSizes:{type:Array,default:()=>[10,20,50,100]},pageSize:{type:Number,default:10}},data(){return{currentPage:1,total:0,tableData:[],metrics:[]}},computed:{pagedTableData(){const t=(this.currentPage-1)*this.pageSize,n=t+this.pageSize;return this.tableData.slice(t,n)}},watch:{rawData:{handler:"updateTable",deep:!0,immediate:!0}},methods:{updateTable(){const{dataSet:t}=this.rawData,n=t.tables;if(!n||n.length===0)return;const o=n[0].originalHeaders.map(a=>a.split(" ")[0]);this.metrics=n.map((a,r)=>({prop:`metric_${r}`,label:a.metricName})),this.tableData=o.map((a,r)=>{let l={time:a};return n.forEach((i,s)=>{l[`metric_${s}`]=i.rows[0].values[r]||0}),l}),this.total=this.tableData.length},handleSortChange({column:t,prop:n,order:o}){this.$emit("sort-change",{column:t,prop:n,order:o})},handleSizeChange(t){this.pageSize=t,this.currentPage=1},handleCurrentChange(t){this.currentPage=t}}},Rg={key:0,class:"pagination-container"};function Og(t,n,o,a,r,l){const i=e.resolveComponent("el-table-column"),s=e.resolveComponent("el-table"),c=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",{class:"report-table-container",style:e.normalizeStyle({height:o.height})},[e.createVNode(s,{data:l.pagedTableData,border:o.border,stripe:o.stripe,size:o.size,"max-height":o.maxHeight,style:{width:"100%"},onSortChange:l.handleSortChange},{default:e.withCtx(()=>[e.createVNode(i,{prop:"time",label:"交易时间",sortable:"",align:"center",width:"180"}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.metrics,(h,p)=>(e.openBlock(),e.createBlock(i,{key:p,prop:h.prop,label:h.label,sortable:"",align:"center"},null,8,["prop","label"]))),128))]),_:1},8,["data","border","stripe","size","max-height","onSortChange"]),o.showPagination?(e.openBlock(),e.createElementBlock("div",Rg,[e.createVNode(c,{"current-page":r.currentPage,"page-sizes":o.pageSizes,"page-size":o.pageSize,size:"small",layout:"total, sizes, prev, pager, next, jumper",total:r.total,onSizeChange:l.handleSizeChange,onCurrentChange:l.handleCurrentChange},null,8,["current-page","page-sizes","page-size","total","onSizeChange","onCurrentChange"])])):e.createCommentVNode("",!0)],4)}const Qd=j(Mg,[["render",Og],["__scopeId","data-v-81083195"]]),Pg={name:"ChartTitle",props:{title:{type:String,default:""},subtitle:{type:String,default:""},align:{type:String,default:"center",validator:t=>["left","center","right"].includes(t)},titleStyle:{type:Object,default:()=>({color:"#333",fontSize:"18px",fontWeight:"bold",marginBottom:"10px"})},subtitleStyle:{type:Object,default:()=>({color:"#666",fontSize:"14px",marginTop:"4px"})},showDivider:{type:Boolean,default:!1},dividerColor:{type:String,default:"#eee"}},computed:{titleText(){return this.title||"图表标题"},textStyle(){return{textAlign:this.align,...this.titleStyle}},containerStyle(){return{borderBottom:this.showDivider?`1px solid ${this.dividerColor}`:"none",paddingBottom:this.showDivider?"10px":"0"}}}};function qg(t,n,o,a,r,l){return e.openBlock(),e.createElementBlock("div",{class:"chart-title-container",style:e.normalizeStyle(o.titleStyle)},[e.createElementVNode("div",{class:"title-text",style:e.normalizeStyle(l.textStyle)},e.toDisplayString(l.titleText),5),o.subtitle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"subtitle-text",style:e.normalizeStyle(o.subtitleStyle)},e.toDisplayString(o.subtitle),5)):e.createCommentVNode("",!0)],4)}const zd=j(Pg,[["render",qg],["__scopeId","data-v-2679bda5"]]),vg={Bar:qa,Line:Nd,Pie:Td,Area:Dd,Metric:Md,Gauge:Rd,Funnel:Od,Scatter:Pd,Radar:qd,Map:vd,ReportTable:Qd,ChartTitle:zd},Qg={name:"lwBiChartItem",components:{BarChart:qa,LineChart:Nd,PieChart:Td,AreaChart:Dd,MetricCard:Md,GaugeChart:Rd,FunnelChart:Od,ScatterChart:Pd,RadarChart:qd,MapChart:vd,ReportTable:Qd,ChartTitle:zd},provide(){return{echarts:e4}},props:{rawData:{type:Object,default:null},height:{type:String,default:"300px"},isBi:{type:Boolean,default:!0}},computed:{isShow(){var t,n,o;return this.rawData&&(((t=this.rawData)==null?void 0:t.setting)&&((n=this.rawData)==null?void 0:n.dataSet)||((o=this.rawData)==null?void 0:o.option))},chartType(){var t;return((t=this.rawData)==null?void 0:t.type)||"Bar"},chartComponent(){return vg[this.chartType]||qa}}};function zg(t,n,o,a,r,l){return l.isShow?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.chartComponent),{key:0,rawData:o.rawData,height:o.height,isBi:o.isBi},null,8,["rawData","height","isBi"])):e.createCommentVNode("",!0)}const Ud=j(Qg,[["render",zg]]),Ug={components:{GridLayout:za.GridLayout,GridItem:za.GridItem},data(){return{id:"",searchOptions:[],chartPageRefs:[],chartList:[],globalFilter:{values:{},ranges:{}},searchParams:{}}},props:{chartId:{type:String,default:""},designMode:{type:Boolean,default:!1},isDashboard:{type:Boolean,default:!1}},watch:{chartId:{handler(t){this.id=t||this.$route.query.id,this.getDataList()},deep:!0,immediate:!0}},methods:{async getDataList(){let t=await this.$http.get(`${this.$config.API_URL}/bi-manage/{tenantId}/{buCode}/dashboard_render/${this.id}`);this.chartList=(t==null?void 0:t.charts)||[],this.getFilter(t.filterControls)},async changeTimeUnit(t,n){let{data:o,...a}=t,r=await this.$http.get(`${this.$config.API_URL}/bi-manage/{tenantId}/{buCode}/visualize/${a.id}`);r==null||r.models.forEach(c=>{c==null||c.dimensions.forEach(h=>{h.timeSetting.timeUnit=t.timeUnit})});let l=this.unflattenObject(this.searchParams);l.ranges&&Object.entries(l.ranges).map(([c,h])=>{this.globalFilter.ranges[c].timeRange={from:h[0],to:h[1]}}),this.globalFilter.values=l.values;let i={charts:[a],globalFilter:this.globalFilter,visualizes:[r]},s=await this.$http.post(`${this.$config.API_URL}/bi-manage/{tenantId}/{buCode}/dashboard_render/${this.id}/partial_refresh`,i);this.chartList[n].data=(s==null?void 0:s[n].data)||[],this.chartList[n].timeUnit=t.timeUnit},unflattenObject(t){const n={};for(const o in t){const a=o.split(".");let r=n;a.forEach((l,i)=>{i===a.length-1?r[l]=t[o]:((!r[l]||typeof r[l]!="object")&&(r[l]={}),r=r[l])})}return n},search(){let t=JSON.parse(JSON.stringify(this.globalFilter)),n=this.unflattenObject(this.searchParams);n.ranges&&Object.entries(n.ranges).map(([o,a])=>{t.ranges[o].timeRange={from:(a==null?void 0:a[0])||this.globalFilter.ranges[o].timeRange.from,to:(a==null?void 0:a[1])||this.globalFilter.ranges[o].timeRange.to},t.ranges[o].type="ABSOLUTE"}),t.values=n.values,this.getChartList(t),this.chartPageRefs.length>0&&this.chartPageRefs.forEach(o=>{o.searchParams=this.searchParams,o.globalFilter=t,o.search()})},reset(){this.getChartList(this.globalFilter),this.chartPageRefs.length>0&&this.chartPageRefs.forEach(t=>{t.getChartList(this.globalFilter)})},async getChartList(t={}){let n={charts:this.chartList.map(({data:o,...a})=>a),globalFilter:t};this.chartList=await this.$http.post(`${this.$config.API_URL}/bi-manage/{tenantId}/{buCode}/dashboard/design_mode/render`,n)},removeChart(t){this.modelValue.splice(t,1)},listToTree(t){const n=[],o={};return t.forEach(a=>{o[a.id]={value:a.id,label:a.name,children:[]}}),t.forEach(a=>{const r=o[a.parent];r?r.children.push(o[a.id]):n.push(o[a.id])}),n},async getFilter(t){var n,o;for(const a of t){const{type:r}=a,l=async s=>{const{type:c,dict:h,dataInterfaceUri:p,dimensionTableId:f}=s.options;return c==="DICT"?Object.entries(h).map(([y,b])=>({value:y,label:b})):c==="DATA_INTERFACE"?(await this.$http.get(p)).map(b=>({value:b.id,label:b.name})):(await this.$api.dimensionChild.list({},f)).map(b=>({value:b.id,label:b.name}))},i=async s=>{const{type:c,dict:h,dataInterfaceUri:p,dimensionTableId:f}=s.options;if(c==="DICT")return Object.entries(h).map(([y,b])=>({value:y,label:b}));if(c==="DATA_INTERFACE"){const y=await this.$http.get(p);return this.listToTree(y)}else{const y=await this.$api.dimensionChild.list({},f);return this.listToTree(y)}};switch(r){case"DATA_PICKER":{const s=a.dataPickerSetting,c=await l(s);this.searchParams[`values.${s.code}`]=(s==null?void 0:s.value)||"",this.searchOptions.push({label:a.name,prop:`values.${s.code}`,renderType:"select",options:c,value:(s==null?void 0:s.value)||"",valueKey:"value",labelKey:"label"});break}case"DATA_CASCADE":{const s=a.dataPickerSetting,c=await i(s);this.searchParams[`values.${s.code}`]=(s==null?void 0:s.value)||"",this.searchOptions.push({label:a.name,name:`values.${s.code}`,value:(s==null?void 0:s.value)||"",component:"treeSelect",options:{items:c,placeholder:"请选择"+a.name,checkStrictly:!0}});break}case"DATA_INPUT":{this.searchParams[`values.${a.dataInputSetting.code}`]=((n=a.dataInputSetting)==null?void 0:n.value)||"",this.searchOptions.push({label:a.name,prop:`values.${a.dataInputSetting.code}`,value:((o=a.dataInputSetting)==null?void 0:o.value)||"",renderType:"input"});break}case"DATE_PICKER":{const s=a.datePickerSetting;let c=[];switch(a.datePickerSetting.type){case"TODAY":c=[ae().format("YYYY-MM-DDTHH:mm:ss.SSSZ"),ae().format("YYYY-MM-DDTHH:mm:ss.SSSZ")];break;case"THIS_MONTH":c=[ae().startOf("month").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),ae().endOf("month").format("YYYY-MM-DDTHH:mm:ss.SSSZ")];break;case"THIS_YEAR":c=[ae().startOf("year").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),ae().endOf("year").format("YYYY-MM-DDTHH:mm:ss.SSSZ")];break;case"LAST_10_DAYS":c=[ae().subtract(10,"day").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),ae().format("YYYY-MM-DDTHH:mm:ss.SSSZ")];break;case"LAST_30_DAYS":c=[ae().subtract(30,"day").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),ae().format("YYYY-MM-DDTHH:mm:ss.SSSZ")];break;case"LAST_12_MONTH":c=[ae().subtract(12,"month").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),ae().format("YYYY-MM-DDTHH:mm:ss.SSSZ")];break;case"LAST_5_YEAR":c=[ae().subtract(5,"year").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),ae().format("YYYY-MM-DDTHH:mm:ss.SSSZ")];break;case"LAST_60_SECONDS":c=[ae().subtract(60,"second").toISOString(),ae().toISOString()];break;case"LAST_30_MINUTES":c=[ae().subtract(30,"minute").toISOString(),ae().toISOString()];break;case"LAST_24_HOURS":c=[ae().subtract(24,"hour").toISOString(),ae().toISOString()];break;case"CURRENT_MONDAY_TO_TODAY":c=[ae().startOf("week").add(1,"day").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),ae().format("YYYY-MM-DDTHH:mm:ss.SSSZ")];break;case"YESTERDAY":c=[ae().subtract(1,"day").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),ae().subtract(1,"day").format("YYYY-MM-DDTHH:mm:ss.SSSZ")];break;case"LAST_YEAR":c=[ae().subtract(1,"year").startOf("year").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),ae().subtract(1,"year").endOf("year").format("YYYY-MM-DDTHH:mm:ss.SSSZ")];break;case"ABSOLUTE":c=[a.datePickerSetting.timeRange.from,a.datePickerSetting.timeRange.to];break;default:c=[];break}this.searchParams[`ranges.${s.code}`]=c,this.searchOptions.push({label:a.name,prop:`ranges.${s.code}`,renderType:"dateRange",value:c,valueFormat:"YYYY-MM-DDTHH:mm:ss.SSSZ"}),this.globalFilter.ranges[s.code]={timeRange:{from:(c==null?void 0:c[0])||"",to:(c==null?void 0:c[1])||""},type:s.type};break}}}}}},Gg={class:"lw-bi-chart-global-layout"},Hg={key:0,class:"filter-top"},jg={key:1,class:"grid-item-dashboard"},Zg=["onClick"],Yg={key:1,class:"no-record-panel e-unselect"};function Kg(t,n,o,a,r,l){const i=e.resolveComponent("lw-search"),s=e.resolveComponent("el-radio-button"),c=e.resolveComponent("el-radio-group"),h=e.resolveComponent("lwBiChartPage"),p=e.resolveComponent("lwBiChartItem"),f=e.resolveComponent("el-button"),y=e.resolveComponent("GridItem"),b=e.resolveComponent("GridLayout"),w=e.resolveComponent("el-empty");return e.openBlock(),e.createElementBlock("div",Gg,[r.searchOptions.length>0&&!o.isDashboard?(e.openBlock(),e.createBlock(i,{key:0,class:"search-body",options:r.searchOptions,modelValue:r.searchParams,"onUpdate:modelValue":n[0]||(n[0]=E=>r.searchParams=E),hideLabel:!0,onSearch:l.search,onReset:l.reset},null,8,["options","modelValue","onSearch","onReset"])):e.createCommentVNode("",!0),e.createVNode(b,{layout:r.chartList,"onUpdate:layout":n[1]||(n[1]=E=>r.chartList=E),"col-num":12,"row-height":30,"is-draggable":o.designMode,"is-resizable":o.designMode,"use-css-transforms":!1,"vertical-compact":""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.chartList,(E,V)=>(e.openBlock(),e.createBlock(y,{key:E.i,x:E.x,y:E.y,w:E.w,h:E.h,i:E.i},{default:e.withCtx(()=>{var F,S,B,q;return[e.createElementVNode("div",{class:e.normalizeClass(["lw-bi-chart-global-layout-item",{edit:o.designMode}])},[(S=(F=E.data)==null?void 0:F.setting)!=null&&S.activeDateUnitFilter?(e.openBlock(),e.createElementBlock("div",Hg,[e.createVNode(c,{modelValue:E.timeUnit,"onUpdate:modelValue":v=>E.timeUnit=v,onChange:v=>l.changeTimeUnit(E,V)},{default:e.withCtx(()=>{var v,_,P,L;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((_=(v=E.data)==null?void 0:v.setting)==null?void 0:_.optionalDateUnitRanges,(G,N)=>(e.openBlock(),e.createBlock(s,{label:N,value:G,key:N},null,8,["label","value"]))),128)),Object.keys((L=(P=E.data)==null?void 0:P.setting)==null?void 0:L.optionalDateUnitRanges).length==0?(e.openBlock(),e.createBlock(s,{key:0,disabled:""},{default:e.withCtx(()=>n[2]||(n[2]=[e.createTextVNode(" 未选择周期列表 未选择周期列表 ")])),_:1})):e.createCommentVNode("",!0)]}),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])])):e.createCommentVNode("",!0),(E==null?void 0:E.type)=="Dashboard"?(e.openBlock(),e.createElementBlock("div",jg,[e.createVNode(h,{ref_for:!0,ref:v=>{v&&(r.chartPageRefs[V]=v)},chartId:E.id,isDashboard:!0},null,8,["chartId"])])):e.createCommentVNode("",!0),e.createVNode(p,{rawData:E.data,height:(q=(B=E.data)==null?void 0:B.setting)!=null&&q.activeDateUnitFilter?"calc(100% - 36px)":"100%"},null,8,["rawData","height"]),o.designMode?(e.openBlock(),e.createElementBlock("div",{key:2,class:"remove",onClick:v=>l.removeChart(V)},[e.createVNode(f,{type:"primary",link:"",icon:"el-icon-delete"})],8,Zg)):e.createCommentVNode("",!0)],2)]}),_:2},1032,["x","y","w","h","i"]))),128))]),_:1},8,["layout","is-draggable","is-resizable"]),r.chartList.length===0?(e.openBlock(),e.createElementBlock("div",Yg,[e.createVNode(w,{description:o.designMode?"点击上方工具栏中的按钮,添加图表至当前仪表板":"仪表板中还没有添加任何图表"},null,8,["description"])])):e.createCommentVNode("",!0)])}const Gd=j(Ug,[["render",Kg],["__scopeId","data-v-5485f51b"]]);/*!
|
|
25
25
|
* vue-router v4.5.0
|
|
26
26
|
* (c) 2024 Eduardo San Martin Morote
|
|
27
27
|
* @license MIT
|