mirror of
https://github.com/beak-insights/felicity-lims.git
synced 2025-02-24 17:02:55 +08:00
19 lines
6 KiB
JavaScript
19 lines
6 KiB
JavaScript
import{_ as b,i as L,j as A,ao as x}from"./billing-356772f3.js";import{f as N,G as w,c as j,r as $,M as I,w as k,v as U,h as i,k as u,x as e,ag as f,u as o,F as y,ak as R,i as C,D as p,y as h,B as P,j as S,A as g,ah as H,al as O,s as W,_ as z}from"./_plugin-vue_export-helper-3f67fb71.js";import{C as G}from"./index-abaedc7c.js";import{b as M,v as T,a as q}from"./runtime-dom.esm-bundler-6e07ef74.js";const J={class:"flex justify-between"},K={class:"flex justify-end align-items-center mt-4 mb-8"},Q=["onClick"],X={key:0,class:"text-start my-4 w-100"},Y=e("h1",{class:"text-xl text-gray-700 font-semibold"},"Instrument Matrix / Load",-1),Z=e("hr",{class:"my-2"},null,-1),tt={key:0},et={key:1,class:"flex justify-start"},st={class:"mr-4 font-bold text-gray-600 text-xl"},ot={class:"font-semibold text-gray-400 text-l"},rt=H('<h1 class="mt-8 text-xl text-gray-700 font-semibold">User Matrix / Load</h1><hr class="my-2"><div class="flex flex-wrap justify-start" id="user-matrix"><div><div id="registration"></div></div><div><div id="submission"></div></div><div><div id="verification"></div></div><div><div id="publication"></div></div></div>',3),nt=e("h3",null,"Custom Filter Date Range",-1),at={action:"post",class:"p-1"},it={class:"grid grid-cols-2 gap-x-4 mb-4"},lt={class:"block col-span-2 mb-2"},dt=e("span",{class:"text-gray-700"},"Date From",-1),ct={class:"block col-span-2 mb-2"},ut=e("span",{class:"text-gray-700"},"Date To",-1),mt=e("hr",null,null,-1),pt=N({__name:"Resource",setup(vt){const F=w(()=>b(()=>import("./SimpleModal-1f91868a.js"),["assets/SimpleModal-1f91868a.js","assets/_plugin-vue_export-helper-3f67fb71.js","assets/runtime-dom.esm-bundler-6e07ef74.js","assets/SimpleModal-f645a074.css"])),D=w(()=>b(()=>import("./LoadingMessage-83976fce.js"),["assets/LoadingMessage-83976fce.js","assets/_plugin-vue_export-helper-3f67fb71.js"])),c=L(),{dashboard:r}=A(c),m=j({range:{from:"",to:""}});let l=$(!1);const V=()=>{c.setFilterRange(x(m.range.from),x(m.range.to)),l.value=!1};I(async()=>{_(),c.setShowFilters(!0),c.getResourceStats()}),k(()=>r.value.filterRange.from,(d,s)=>{_(),c.getResourceStats()}),k(()=>r.value.resourceStats?.samples,(d,s)=>{r.value.resourceStats?.samples?.forEach(a=>{let t=[],v=0;a.counts?.forEach(n=>v+=n.count),a.counts?.forEach(n=>{t.push({item:n.group,count:n.count,percent:n.count/v})}),B(t,a.group,a.group)})});const E=d=>{let s=0;return r.value.resourceStats?.instruments?.forEach(t=>s+=t.count),(d/s*100).toFixed(2)+" %"},B=(d,s,a)=>{const t=new G({container:s,autoFit:!0,height:250,width:500,localRefresh:!1});t.coordinate("theta",{radius:.75,innerRadius:.5}),t.data(d),t.scale("percent",{formatter:n=>(n=(n*100).toFixed(2)+"%",n)}),t.tooltip({showTitle:!1,showMarkers:!1}),t.legend(!1),t.interval().position("percent").color("item").label("percent",{layout:[{type:"pie-spider"},{type:"hide-overlap"}],offset:8,labelHeight:38,content:n=>`${n.item} (${n.count})`,labelLine:{style:{lineWidth:.5}}}).adjust("stack"),t.createView().annotation().text({position:["50%","50%"],content:a,style:{fill:"#262626",textAlign:"center"}}),t.interaction("element-active"),t.render()},_=()=>{document.getElementById("user-matrix").innerHTML="";const d=`
|
|
<div>
|
|
<div id="registration"></div>
|
|
</div>
|
|
<div>
|
|
<div id="submission"></div>
|
|
</div>
|
|
<div>
|
|
<div id="verification"></div>
|
|
</div>
|
|
<div>
|
|
<div id="publication"></div>
|
|
</div>
|
|
`;document.getElementById("user-matrix").innerHTML=d};return(d,s)=>{const a=U("VTooltip");return i(),u(y,null,[e("section",J,[f(e("div",K,[(i(!0),u(y,null,R(o(r).filters,(t,v)=>f((i(),S(a,{key:v,placements:["right-start"]},{popper:g(()=>[O(p(o(c).filterToolTip(t)),1)]),default:g(()=>[e("button",{onClick:n=>o(c).setCurrentFilter(t),type:"button",class:W(["px-2 py-1 mr-2 border-gray-800 border text-gray-800 rounded-sm transition duration-300 hover:bg-sky-800 hover:text-white focus:outline-none",{"bg-sky-800 text-white":o(r).currentFilter===t}])},p(t),11,Q)]),_:2},1024)),[[M,t!==o(r).filters[o(r).filters.length]]])),128)),e("button",{onClick:s[0]||(s[0]=t=>C(l)?l.value=!0:l=!0),class:"ml-4 mr-1 px-2 py-1 border-gray-500 border text-gray-500 rounded-sm transition duration-300 hover:bg-gray-700 hover:text-white focus:outline-none"},p(o(r).filterRange.from)+" - "+p(o(r).filterRange.to),1),h(` <button\r
|
|
type="button"\r
|
|
class="px-2 py-1 border-sky-800 border text-sky-800 rounded-sm transition duration-300 hover:bg-sky-800 hover:text-white focus:outline-none"\r
|
|
>\r
|
|
Apply\r
|
|
</button> `)],512),[[M,o(r).showFilters]])]),o(r).fetchingResourceStats?(i(),u("div",X,[P(o(D),{message:"fetching resource stats ..."})])):h("v-if",!0),e("section",null,[Y,Z,o(r).resourceStats?.instruments?.length===0?(i(),u("div",tt,"NO DATA")):(i(),u("div",et,[(i(!0),u(y,null,R(o(r).resourceStats?.instruments,t=>(i(),u("div",{key:t.group,class:"flex items-center bg-white shadow rounded-sm px-6 pt-3 pb-5 border border-white mr-8"},[e("span",st,p(E(t?.count)),1),e("span",ot,p(t.group),1)]))),128))])),rt]),h(" Custome Dat Range Modal "),o(l)?(i(),S(o(F),{key:1,onClose:s[4]||(s[4]=t=>C(l)?l.value=!1:l=!1),contentWidth:"w-1/4"},{header:g(()=>[nt]),body:g(()=>[e("form",at,[e("div",it,[e("label",lt,[dt,f(e("input",{type:"datetime-local",class:"form-input mt-1 block w-full",autocomplete:"off","onUpdate:modelValue":s[1]||(s[1]=t=>m.range.from=t),placeholder:"Name ..."},null,512),[[T,m.range.from]])]),e("label",ct,[ut,f(e("input",{type:"datetime-local",class:"form-input mt-1 block w-full","onUpdate:modelValue":s[2]||(s[2]=t=>m.range.to=t),placeholder:"Name ..."},null,512),[[T,m.range.to]])])]),mt,e("button",{type:"button",onClick:s[3]||(s[3]=q(t=>V(),["prevent"])),class:"-mb-4 w-full border border-sky-800 bg-sky-800 text-white rounded-sm px-4 py-2 m-2 transition-colors duration-500 ease select-none hover:bg-sky-800 focus:outline-none focus:shadow-outline"}," Save Form ")])]),_:1})):h("v-if",!0)],64)}}}),_t=z(pt,[["__file","/home/aurthurm/Development/felicity-lims/webapp/views/dashboard/Resource.vue"]]);export{_t as default};
|