mirror of
https://github.com/beak-insights/felicity-lims.git
synced 2025-02-24 00:42:59 +08:00
1 line
10 KiB
JavaScript
1 line
10 KiB
JavaScript
import{d as W,ab as T,L as E,at as D,r as m,C as N,V as F,D as O,o as c,c as p,b as e,F as x,p as v,t as n,f as o,q as L,G as M,e as r,v as d,ac as V,w as P,i as j,x as B,j as $,_ as q,cb as G,cc as Y,O as z,k as H}from"./index-2a6c9271.js";const J=e("hr",{class:"mt-2"},null,-1),K={class:"overflow-x-auto mt-4"},Q={class:"align-middle inline-block min-w-full shadow overflow-hidden bg-white shadow-dashboard px-2 pt-1 rounded-bl-lg rounded-br-lg"},X={class:"min-w-full"},Z=e("thead",null,[e("tr",null,[e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-orange-600 tracking-wider"},"Min Report"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-amber-500 tracking-wider"},"Min Warn"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-sky-800 tracking-wider"},"Min"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-sky-800 tracking-wider"},"Max"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-amber-500 tracking-wider"},"Max Warn"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-orange-600 tracking-wider"},"Max Report"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-sky-800 tracking-wider"},"Warn Texts"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-sky-800 tracking-wider"},"Text Report"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-black tracking-wider"},"Method"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-black tracking-wider"},"Gender"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-black tracking-wider"},"Age Min"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-black tracking-wider"},"Age Max"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300"})])],-1),ee={class:"bg-white"},te={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},se={class:"text-sm leading-5 text-orange-600"},le={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},oe={class:"text-sm leading-5 text-amber-500"},ae={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},ne={class:"text-sm leading-5 text-sky-800"},re={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},de={class:"text-sm leading-5 text-sky-800"},ie={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},ce={class:"text-sm leading-5 text-amber-500"},pe={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},ue={class:"text-sm leading-5 text-orange-600"},be={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},me={class:"text-sm leading-5 text-sky-800"},xe={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},_e={class:"text-sm leading-5 text-sky-800"},he={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},ye={class:"text-sm leading-5 text-black"},ge={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},we={class:"text-sm leading-5 text-black"},fe={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},ke={class:"text-sm leading-5 text-black"},ve={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},Me={class:"text-sm leading-5 text-black"},Ve={class:"px-1 py-1 whitespace-no-wrap text-right border-b border-gray-500 text-sm leading-5"},Ae=["onClick"],Se={action:"post",class:"p-1"},Re=e("h4",{class:"font-semibold"},"Numerical Results",-1),Ue=e("hr",{class:"mb-4"},null,-1),Ce={class:"grid grid-cols-6 gap-x-4 mb-4"},Ie={class:"block col-span-1 mb-2"},We=e("span",{class:"text-orange-600"},"Min Report",-1),Te={class:"block col-span-1 mb-2"},Ee=e("span",{class:"text-amber-500"},"Min Warn",-1),De={class:"block col-span-1 mb-2"},Ne=e("span",{class:"text-sky-800"},"Min",-1),Fe={class:"block col-span-1 mb-2"},Oe=e("span",{class:"text-sky-800"},"Max",-1),Le={class:"block col-span-1 mb-2"},Pe=e("span",{class:"text-amber-500"},"Max Warn",-1),je={class:"block col-span-1 mb-2"},Be=e("span",{class:"text-orange-600"},"Max Report",-1),$e=e("h4",{class:"font-semibold"},"Textual Results",-1),qe=e("hr",{class:"mb-4"},null,-1),Ge={class:"grid grid-cols-2 gap-x-4 mb-4"},Ye={class:"block col-span-1 mb-2"},ze=e("span",{class:"text-sky-800 w-4/12"},"Textual Results (comma seperated)",-1),He={class:"w-full"},Je={class:"block col-span-1 mb-2"},Ke=e("span",{class:"text-sky-800 w-4/12"},"Report Message",-1),Qe={class:"w-full"},Xe=e("h4",{class:"font-semibold"},"Conditions if Any",-1),Ze=e("hr",{class:"mb-4"},null,-1),et={class:"grid grid-cols-4 gap-x-4 mb-4"},tt={class:"block col-span-1 mb-2"},st=e("span",{class:"text-black w-4/12"},"Method",-1),lt={class:"w-full"},ot=e("option",null,null,-1),at=["value"],nt={class:"block col-span-1 mb-2"},rt=e("span",{class:"text-black w-4/12"},"Gender",-1),dt={class:"w-full"},it=e("option",{value:"all",selected:""},"All",-1),ct=e("option",{value:"male"},"Male",-1),pt=e("option",{value:"male"},"Female",-1),ut=[it,ct,pt],bt={class:"block col-span-1 mb-2"},mt=e("span",{class:"text-black"},"Age Min",-1),xt={class:"block col-span-1 mb-2"},_t=e("span",{class:"text-black"},"Age Max",-1),ht=e("hr",null,null,-1),yt=W({__name:"Specifications",props:{analysis:{type:Object,required:!0,default:()=>({})},analysisUid:{type:String,required:!0,default:0}},setup(A){const S=$(()=>q(()=>import("./SimpleModal-0c0664c5.js"),["assets/SimpleModal-0c0664c5.js","assets/index-2a6c9271.js","assets/index-88806377.css","assets/SimpleModal-f645a074.css"])),_=T(),h=E(),{withClientMutation:y}=z(),g=A,{analysis:w}=D(g);let i=m(!1),f=m(""),l=N({});const u=m(!0);F(()=>g.analysisUid,(a,s)=>{}),h.fetchMethods();const b=O(()=>h.getMethods);function R(){const a={...l,analysisUid:w?.value?.uid};y(G,{payload:a},"createAnalysisSpecification").then(s=>_.addAnalysisSpecification(s))}function U(){const a={...l};delete a.uid,delete a.__typename,delete a.unit,y(Y,{uid:l.uid,payload:a},"updateAnalysisSpecification").then(s=>_.updateAnalysisSpecification(s))}function k(a,s={}){u.value=a,i.value=!0,f.value=(a?"CREATE":"EDIT")+" ANALYSIS SPECIFICATION",a?Object.assign(l,{analysisUid:null,min:null,max:null,minWarn:null,maxWarn:null,minReport:null,maxReport:null,warnValues:null,warnReport:null,gender:null,ageMin:null,ageMax:null,methodUid:null}):Object.assign(l,{...s})}function C(){u.value===!0&&R(),u.value===!1&&U(),i.value=!1}const I=a=>{const s=b?.value?.findIndex(t=>t.uid===a);return b?.value[s]?.name};return(a,s)=>(c(),p(x,null,[e("button",{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",onClick:s[0]||(s[0]=t=>k(!0))},"Add Specification"),J,e("div",K,[e("div",Q,[e("table",X,[Z,e("tbody",ee,[(c(!0),p(x,null,v(o(w)?.specifications,t=>(c(),p("tr",{key:t?.uid},[e("td",te,[e("div",se,n(t.minReport),1)]),e("td",le,[e("div",oe,n(t.minWarn),1)]),e("td",ae,[e("div",ne,n(t.min),1)]),e("td",re,[e("div",de,n(t.max),1)]),e("td",ie,[e("div",ce,n(t.maxWarn),1)]),e("td",pe,[e("div",ue,n(t.maxReport),1)]),e("td",be,[e("div",me,n(t.warnValues),1)]),e("td",xe,[e("div",_e,n(t.warnReport),1)]),e("td",he,[e("div",ye,n(I(t?.methodUid)),1)]),e("td",ge,[e("div",we,n(t.gender),1)]),e("td",fe,[e("div",ke,n(t.ageMin),1)]),e("td",ve,[e("div",Me,n(t.ageMax),1)]),e("td",Ve,[e("button",{onClick:gt=>k(!1,t),class:"px-2 py-1 mr-2 border-sky-800 border text-sky-800 rounded-sm transition duration-300 hover:bg-sky-800 hover:text-white focus:outline-none"},"Edit",8,Ae)])]))),128))])])])]),o(i)?(c(),L(o(S),{key:0,onClose:s[14]||(s[14]=t=>j(i)?i.value=!1:i=!1),contentWidth:"w-3/4"},{header:M(()=>[e("h3",null,n(o(f)),1)]),body:M(()=>[e("form",Se,[Re,Ue,e("div",Ce,[e("label",Ie,[We,r(e("input",{type:"text",class:"form-input mt-1 block w-full","onUpdate:modelValue":s[1]||(s[1]=t=>o(l).minReport=t),placeholder:"Value ..."},null,512),[[d,o(l).minReport]])]),e("label",Te,[Ee,r(e("input",{type:"number",class:"form-input mt-1 block w-full","onUpdate:modelValue":s[2]||(s[2]=t=>o(l).minWarn=t),placeholder:"Value ..."},null,512),[[d,o(l).minWarn]])]),e("label",De,[Ne,r(e("input",{type:"number",class:"form-input mt-1 block w-full","onUpdate:modelValue":s[3]||(s[3]=t=>o(l).min=t),placeholder:"Value ..."},null,512),[[d,o(l).min]])]),e("label",Fe,[Oe,r(e("input",{type:"number",class:"form-input mt-1 block w-full","onUpdate:modelValue":s[4]||(s[4]=t=>o(l).max=t),placeholder:"Value ..."},null,512),[[d,o(l).max]])]),e("label",Le,[Pe,r(e("input",{type:"number",class:"form-input mt-1 block w-full","onUpdate:modelValue":s[5]||(s[5]=t=>o(l).maxWarn=t),placeholder:"Value ..."},null,512),[[d,o(l).maxWarn]])]),e("label",je,[Be,r(e("input",{type:"text",class:"form-input mt-1 block w-full","onUpdate:modelValue":s[6]||(s[6]=t=>o(l).maxReport=t),placeholder:"Value ..."},null,512),[[d,o(l).maxReport]])])]),$e,qe,e("div",Ge,[e("label",Ye,[ze,e("div",He,[r(e("input",{type:"text",class:"form-input mt-1 block w-full","onUpdate:modelValue":s[7]||(s[7]=t=>o(l).warnValues=t),placeholder:"Value ..."},null,512),[[d,o(l).warnValues]])])]),e("label",Je,[Ke,e("div",Qe,[r(e("input",{type:"text",class:"form-input mt-1 block w-full","onUpdate:modelValue":s[8]||(s[8]=t=>o(l).warnReport=t),placeholder:"Value ..."},null,512),[[d,o(l).warnReport]])])])]),Xe,Ze,e("div",et,[e("label",tt,[st,e("div",lt,[r(e("select",{class:"form-select mt-1 w-full","onUpdate:modelValue":s[9]||(s[9]=t=>o(l).methodUid=t)},[ot,(c(!0),p(x,null,v(b.value,t=>(c(),p("option",{key:t?.uid,value:t.uid},n(t?.name),9,at))),128))],512),[[V,o(l).methodUid]])])]),e("label",nt,[rt,e("div",dt,[r(e("select",{class:"form-select mt-1 w-full","onUpdate:modelValue":s[10]||(s[10]=t=>o(l).gender=t)},[...ut],512),[[V,o(l).gender]])])]),e("label",bt,[mt,r(e("input",{type:"number",class:"form-input mt-1 block w-full","onUpdate:modelValue":s[11]||(s[11]=t=>o(l).ageMin=t),placeholder:"Value ..."},null,512),[[d,o(l).ageMin]])]),e("label",xt,[_t,r(e("input",{type:"number",class:"form-input mt-1 block w-full","onUpdate:modelValue":s[12]||(s[12]=t=>o(l).ageMax=t),placeholder:"Value ..."},null,512),[[d,o(l).ageMax]])])]),ht,e("button",{type:"button",onClick:s[13]||(s[13]=P(t=>C(),["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})):B("",!0)],64))}}),ft=H(yt,[["__file","/home/aurthur/Documents/Development/felicity-lims/webapp/views/admin/analyses/services/Specifications.vue"]]);export{ft as default};
|