| 1 |
import{R as t}from"./reportHelpers.js?ver=2.0.15";import{c as e,E as r,t as o}from"./chartPalette.js?ver=2.0.15";import{_ as a}from"./descriptionToPlainText.js?ver=2.0.15";import{aO as i,S as s,T as l,$ as n,a0 as p,_ as m,a9 as d,Z as u,H as h,ax as c,a1 as f}from"./vendor.js?ver=2.0.15";const b={name:"PriorityDistribution",components:{ReportPanel:t,EChart:r},mixins:[e],props:{items:{type:Array,default:()=>[]},total:{type:Number,default:0},loading:{type:Boolean,default:!1}},computed:{palette(){return this.themedChartPalette()},formattedTotal(){return(new Intl.NumberFormat).format(this.total)},option(){const t=this.palette;return{tooltip:{trigger:"item",...o(t)},series:[{type:"pie",radius:["66%","92%"],center:["50%","50%"],avoidLabelOverlap:!1,padAngle:1,itemStyle:{borderRadius:2},label:{show:!0,position:"center",formatter:`{label|${this.$t("tasks")}}\n{total|${this.formattedTotal}}`,rich:{label:{color:t.subText,fontSize:12,lineHeight:18},total:{color:t.text,fontSize:28,fontWeight:500,lineHeight:34}}},emphasis:{label:{show:!0}},data:this.items.map(t=>({name:this.$t(t.label),value:t.value,itemStyle:{color:this.colorFor(t.key)}}))}]}}},methods:{colorFor(t){return{high:this.palette.error,medium:this.palette.medium,low:this.palette.neutral,custom:this.palette.custom}[t]||this.palette.primary}}},y={class:"fbs_report_priority"},g={class:"fbs_report_priority--legend"},_={class:"fbs_report_priority--legend-title"},v={class:"fbs_report_priority--legend-label"},P={class:"fbs_report_priority--legend-value"};const $=a(b,[["render",function(t,e,r,o,a,b){const $=i("EChart"),k=i("ReportPanel");return s(),l(k,{title:t.$t("Priority Distribution")},{default:n(()=>[p("div",y,[m($,{option:b.option,height:200,loading:r.loading},null,8,["option","loading"]),p("div",g,[p("p",_,d(t.$t("Priorities")),1),(s(!0),u(h,null,c(r.items,e=>(s(),u("div",{key:e.key,class:"fbs_report_priority--legend-row"},[p("span",{class:"fbs_report_priority--dot",style:f({background:b.colorFor(e.key)})},null,4),p("span",v,d(t.$t(e.label)),1),p("span",P,d(e.value),1)]))),128))])])]),_:1},8,["title"])}]]);export{$ as P}; |