import{C as _}from"./index.bb5f1b0a.js";import{f as r}from"./index.70d38b82.js";import{A as l}from"./index.51e15757.js";import{n as o}from"./vueComponentNormalizer.9ef17bb1.js";import{T as v}from"./TableLayout.05a39499.js";/* empty css                                                    */const y={mounted(){this.fetch()},methods:{async fetch(){const t=await r("res-quantity");let i=0;const n=t.map(e=>(i+=e.count*=1,{name:l[e.type].name,value:e.count}));this.draw({total:i,data:n})},draw({total:t,data:i}){var n,e;(e=(n=this.chart)==null?void 0:n.destroy)==null||e.call(n),this.chart=new _({padding:[30,0],container:this.$el,autoFit:!0,height:300}),this.chart.scale("value",{formatter:a=>a*100+"%"}),this.chart.coordinate("theta",{radius:.75,innerRadius:.6}),this.chart.tooltip({showTitle:!1,showMarkers:!1,itemTpl:`
        <ul class="g2-tooltip-list">
          <li class="g2-tooltip-list-item">{name}: {value}\u4E2A</li>
          <li class="g2-tooltip-list-item"><span style="background-color:{color};" class="g2-tooltip-marker"></span>\u5360\u6BD4: {percent}%</li>
        </ul>`}),this.chart.interval().adjust("stack").position("value").color("name").label("value",a=>({content:()=>`${(a/t*100).toFixed(2)}%`})).tooltip("name*value",(a,s)=>({name:a,value:s,percent:(s/t*100).toFixed(2)})),this.chart.interaction("element-active"),this.chart.data(i),this.chart.annotation().html({position:["50%","50%"],html:`<div style="color:#8c8c8c;font-size: 14px;text-align: center;width: 10em;">\u6D4F\u89C8\u8D44\u6E90\u603B\u6570<br><span style="color:#8c8c8c;font-size:20px">${t}</span>\u4E2A</div>`,alignX:"middle",alignY:"middle"}),this.chart.render()}},render(t){return t("div",{class:"chart",style:"width:38%",attrs:{"data-title":"\u6D4F\u89C8\u8D44\u6E90\u6587\u4EF6\u5360\u6BD4\u7EDF\u8BA1"}})}};let w,$;const u={};var g=o(y,w,$,!1,x,null,null,null);function x(t){for(let i in u)this[i]=u[i]}const b=function(){return g.exports}(),z={mounted(){this.fetch()},methods:{async fetch(){const t=await r("res-size");let i=0;const n=t.map(e=>(i+=e.size*=1,{name:l[e.type].name,...e,...e.size.formatFileSize(2,"object")}));this.draw({data:n,total:i})},draw({total:t=0,data:i}){var e,a;(a=(e=this.chart)==null?void 0:e.destroy)==null||a.call(e),this.chart=new _({padding:[30,0],container:this.$el,autoFit:!0,height:300}),this.chart.scale("value",{formatter:s=>s*100+"%"}),this.chart.coordinate("theta",{radius:.75,innerRadius:.6}),this.chart.tooltip({showTitle:!1,showMarkers:!1,itemTpl:`
        <ul class="g2-tooltip-list">
          <li class="g2-tooltip-list-item">{name}: {value}{unit}</li>
          <li class="g2-tooltip-list-item"><span style="background-color:{color};" class="g2-tooltip-marker"></span>\u5360\u6BD4: {percent}%</li>
        </ul>`}),this.chart.interval().adjust("stack").position("size").color("name").label("size",s=>({content:()=>`${(s/t*100).toFixed(2)}%`})).tooltip("name*value*size*unit",(s,m,c,f)=>({name:s,size:c,value:m,unit:f,percent:(c/t*100).toFixed(2)}));const n=t.formatFileSize(2,"object");this.chart.interaction("element-active"),this.chart.data(i),this.chart.annotation().html({position:["50%","50%"],html:`<div style="color:#8c8c8c;font-size: 14px;text-align: center;width: 10em;">\u8D44\u6E90\u5171\u8BA1<br><span style="color:#8c8c8c;font-size:20px">${n.value}</span>${n.unit}</div>`,alignX:"middle",alignY:"middle"}),this.chart.render()}},render(t){return t("div",{class:"chart",style:"width:38%",attrs:{"data-title":"\u6D4F\u89C8\u8D44\u6E90\u5927\u5C0F\u5360\u6BD4\u7EDF\u8BA1"}})}};let T,k;const h={};var F=o(z,T,k,!1,M,null,null,null);function M(t){for(let i in h)this[i]=h[i]}const S=function(){return F.exports}();var R=function(){var t=this,i=t.$createElement,n=t._self._c||i;return n("TableLayout",{staticClass:"flex-1",staticStyle:{width:"50%"},attrs:{height:"300px",column:t.column,data:t.list,pageInfo:t.pageInfo},on:{"page-info-change":t.fetch},scopedSlots:t._u([{key:"createTime",fn:function(e){var a=e.row;return[t._v(t._s(new Date(a.createTime).format("yyyy-MM-dd hh:mm")))]}},{key:"type",fn:function(e){var a=e.row;return[t._v(t._s(t.acceptMap[a.type].name))]}},{key:"size",fn:function(e){var a,s=e.row;return[t._v(t._s((a=s.size)===null||a===void 0?void 0:a.formatFileSize()))]}},{key:"viewTime",fn:function(e){var a=e.row;return[t._v(t._s(t.handlerViewTime(+a.viewTime)))]}},{key:"action",fn:function(e){var a=e.row;return[n("el-button",{attrs:{type:"text"},on:{click:function(s){return t.toPreview(a)}}},[t._v("\u67E5\u770B")])]}}])})},j=[];const I={components:{TableLayout:v},data:()=>({list:[],pageInfo:{current:1,size:10,total:0}}),watch:{"$parent.activeType":{immediate:!0,handler(t){this.type=t,this.pageInfo.current=1,this.fetch()}}},created(){this.acceptMap=l,this.column=[{prop:"createTime",label:"\u6D4F\u89C8\u65F6\u95F4",width:"120"},{prop:"name",label:"\u8D44\u6E90\u540D\u79F0"},{prop:"type",label:"\u8D44\u6E90\u7C7B\u578B"},{prop:"size",label:"\u6587\u4EF6\u5927\u5C0F"},{prop:"viewTime",label:"\u6D4F\u89C8\u7528\u65F6"},{prop:"action",label:"\u64CD\u4F5C",width:"100"}]},methods:{async fetch(){const{list:t,total:i}=await r("res-details-table",{type:this.type,pageInfo:this.pageInfo});this.list=t,this.pageInfo.total=i},async toPreview(t){this.$store.showResourcePreviewDialog(t.resourceId)},handlerViewTime(t){return t<60?"\u4E0D\u8DB31\u5206\u949F":t<60*60?`${~~(t/60)}\u5206\u949F`:`${~~(t/60/60)}\u5C0F\u65F6${~~(t/60%60)}\u5206\u949F`}}},p={};var C=o(I,R,j,!1,D,null,null,null);function D(t){for(let i in p)this[i]=p[i]}const P=function(){return C.exports}(),A={data:()=>({activeType:""}),render(t){return t("div",[[b,S],[P]][this.$store.statistic_tab_active].map(t))}};let E,L;const d={};var V=o(A,E,L,!1,X,null,null,null);function X(t){for(let i in d)this[i]=d[i]}const J=function(){return V.exports}();export{J as default};
