mirror of
https://github.com/beak-insights/felicity-lims.git
synced 2025-02-24 00:42:59 +08:00
1 line
5.9 KiB
JavaScript
1 line
5.9 KiB
JavaScript
import{d as S,a8 as A,r as h,A as M,U as C,o as n,g as p,h as e,F as x,z as $,t as u,j as a,y,D as g,E as T,i as b,v,G as I,ai as V,w as F,k as E,I as U,a_ as L,a$ as N,a5 as j,a6 as B,ak as Y,_ as w,H as z}from"./index-cd9e6ac8.js";const i=c=>(j("data-v-f73ce93d"),c=c(),B(),c),O={class:"container w-full my-4"},R=i(()=>e("hr",null,null,-1)),G=i(()=>e("hr",null,null,-1)),H={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"},J={class:"min-w-full"},K=i(()=>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-gray-800 tracking-wider"},"Sample Type"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-gray-800 tracking-wider"},"Prefix"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-gray-800 tracking-wider"},"Active"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300"})])],-1)),Q={class:"bg-white"},W={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},X={class:"flex items-center"},Z={class:"text-sm leading-5 text-gray-800"},ee={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},te={class:"text-sm leading-5 text-sky-800"},se={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},oe={class:"text-sm leading-5 text-sky-800"},ae={class:"px-1 py-1 whitespace-no-wrap text-right border-b border-gray-500 text-sm leading-5"},le=["onClick"],ne={action:"post",class:"p-1"},ie={class:"grid grid-cols-2 gap-x-4 mb-4"},re={class:"block col-span-1 mb-2"},de=i(()=>e("span",{class:"text-gray-700"},"Sample Type Name",-1)),ce={class:"block col-span-1 mb-2"},pe=i(()=>e("span",{class:"text-gray-700"},"Prefix",-1)),ue={class:"block col-span-2 mb-2"},me=i(()=>e("span",{class:"text-gray-700"},"Description",-1)),_e={for:"toggle",class:"text-xs text-gray-700 mr-4"},be={class:"relative inline-block w-10 mr-2 align-middle select-none transition duration-200 ease-in"},he=i(()=>e("label",{for:"toggle",class:"toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"},null,-1)),ye=i(()=>e("hr",null,null,-1)),fe=S({__name:"SampleTypes",setup(c){const l=A(),{withClientMutation:m}=Y();let r=h(!1),f=h(""),t=M({});const _=h(!0);l.fetchSampleTypes();const D=C(()=>l.getSampleTypes);function k(d,s={}){_.value=d,r.value=!0,f.value=(d?"CREATE":"EDIT")+" SAMPLE TYPE",d?Object.assign(t,{}):Object.assign(t,{...s})}function P(){const d={name:t.name,abbr:t.abbr,description:t.description,active:t.active};_.value===!0&&m(L,{payload:d},"createSampleType").then(s=>l.addSampleType(s)),_.value===!1&&m(N,{uid:t.uid,payload:d},"updateSampleType").then(s=>l.updateSampleType(s)),r.value=!1}return(d,s)=>(n(),p(x,null,[e("div",O,[R,e("button",{onClick:s[0]||(s[0]=o=>k(!0)),class:"px-2 py-1 border-sky-800 border text-sky-800rounded-smtransition duration-300 hover:bg-sky-800 hover:text-white focus:outline-none"},"Add Sample Type"),G,e("div",H,[e("div",q,[e("table",J,[K,e("tbody",Q,[(n(!0),p(x,null,$(a(D),o=>(n(),p("tr",{key:o?.uid},[e("td",W,[e("div",X,[e("div",null,[e("div",Z,u(o?.name),1)])])]),e("td",ee,[e("div",te,u(o?.abbr),1)]),e("td",se,[e("div",oe,u(o?.active),1)]),e("td",ae,[e("button",{onClick:Me=>k(!1,o),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,le)])]))),128))])])])])]),y(" Location Edit Form Modal "),a(r)?(n(),g(U,{key:0,onClose:s[6]||(s[6]=o=>E(r)?r.value=!1:r=!1)},{header:T(()=>[e("h3",null,u(a(f)),1)]),body:T(()=>[e("form",ne,[e("div",ie,[e("label",re,[de,b(e("input",{class:"form-input mt-1 block w-full","onUpdate:modelValue":s[1]||(s[1]=o=>a(t).name=o),placeholder:"Name ..."},null,512),[[v,a(t).name]])]),e("label",ce,[pe,b(e("input",{class:"form-input mt-1 block w-full","onUpdate:modelValue":s[2]||(s[2]=o=>a(t).abbr=o),placeholder:"Prefix ..."},null,512),[[v,a(t).abbr]])]),e("label",ue,[me,b(e("textarea",{cols:"2",class:"form-input mt-1 block w-full","onUpdate:modelValue":s[3]||(s[3]=o=>a(t).description=o),placeholder:"Description ..."},null,512),[[v,a(t).description]])]),e("label",_e,[I("Active "),e("div",be,[b(e("input",{type:"checkbox",name:"toggle",id:"toggle","onUpdate:modelValue":s[4]||(s[4]=o=>a(t).active=o),class:"toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer outline-none"},null,512),[[V,a(t).active]]),he])])]),ye,e("button",{type:"button",onClick:s[5]||(s[5]=F(o=>P(),["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})):y("v-if",!0)],64))}});const ve=w(fe,[["__scopeId","data-v-f73ce93d"],["__file","/home/aurthur/Development/Python/felicity/felicity-lims/webapp/views/admin/sample/SampleTypes.vue"]]),xe={},ge={class:"container w-full my-4"},we=e("h5",null,"Container Types",-1),ke=e("hr",null,null,-1),Te=[we,ke];function Se(c,l){return n(),p("div",ge,Te)}const Ce=w(xe,[["render",Se],["__file","/home/aurthur/Development/Python/felicity/felicity-lims/webapp/views/admin/sample/ContainerTypes.vue"]]),$e={class:"mt-4"},Ee={class:"bg-white shadow-md mt-2"},De={class:"-mb-px flex justify-start"},Pe=["onClick"],Ae=S({__name:"index",setup(c){let l=h("sample-types");const m=["sample-types"];return C(()=>"tab-"+l.value),(r,f)=>(n(),p("div",$e,[e("nav",Ee,[e("div",De,[(n(),p(x,null,$(m,t=>e("a",{key:t,class:z(["no-underline text-gray-500 uppercase tracking-wide font-bold text-xs py-1 px-4 tab hover:bg-sky-600 hover:text-gray-200",{"tab-active":a(l)===t}]),onClick:_=>E(l)?l.value=t:l=t,href:"#"},u(t),11,Pe)),64))])]),a(l)==="sample-types"?(n(),g(ve,{key:0})):y("v-if",!0),a(l)==="container-types"?(n(),g(Ce,{key:1})):y("v-if",!0)]))}}),Ve=w(Ae,[["__file","/home/aurthur/Development/Python/felicity/felicity-lims/webapp/views/admin/sample/index.vue"]]);export{Ve as default};
|