felicity-lims/felicity/templates/static/assets/PersonIdentification-3a445886.js
2024-11-17 19:39:30 +02:00

1 line
3.3 KiB
JavaScript

import{d as I,n as k,r as c,q as C,x as D,o as r,c as u,b as e,F as _,E,t as h,f as a,A,B as b,e as N,v as T,w as F,i as P,D as O,j as M,_ as B,M as S,k as R}from"./index-e62f5c21.js";import{a as V,b as $}from"./patient.mutations-8b20d6de.js";const j={class:"container w-full my-4"},U=e("hr",null,null,-1),L=e("hr",null,null,-1),q={class:"overflow-x-auto mt-4"},z={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"},G={class:"min-w-full"},H=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"}," Name"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300"})])],-1),J={class:"bg-white"},K={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},Q={class:"flex items-center"},W={class:"text-sm leading-5 text-gray-800"},X={class:"px-1 py-1 whitespace-no-wrap text-right border-b border-gray-500 text-sm leading-5"},Y=["onClick"],Z={action:"post",class:"p-1"},ee={class:"grid grid-cols-2 gap-x-4 mb-4"},te={class:"flex items-center gap-x-4 whitespace-nowrap col-span-2 mb-2"},oe=e("span",{class:"text-gray-700"},"Indentication Name",-1),se=e("hr",null,null,-1),ne=I({__name:"PersonIdentification",setup(ie){const v=M(()=>B(()=>import("./FelModal-44636049.js"),["assets/FelModal-44636049.js","assets/index-e62f5c21.js","assets/index-332ec99e.css","assets/FelModal-780aeea9.css"])),l=k(),{withClientMutation:f}=S();let i=c(!1),m=c(""),n=C({});const d=c(!0);l.fetchIdentifications();function y(){f(V,{name:n.name},"createIdentification").then(o=>l.addIdentification(o))}function x(){f($,{uid:n.uid,name:n.name},"updateIdentification").then(o=>l.updateIdentification(o))}function p(o,t={}){d.value=o,i.value=!0,m.value=(o?"CREATE":"EDIT")+" PERSON IDENTIFICATION",o?Object.assign(n,{}):Object.assign(n,{...t})}function g(){d.value===!0&&y(),d.value===!1&&x(),i.value=!1}const w=D(()=>l.getIdentifications);return(o,t)=>(r(),u(_,null,[e("div",j,[U,e("button",{onClick:t[0]||(t[0]=s=>p(!0)),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"},"Add Identification"),L,e("div",q,[e("div",z,[e("table",G,[H,e("tbody",J,[(r(!0),u(_,null,E(w.value,s=>(r(),u("tr",{key:s?.uid},[e("td",K,[e("div",Q,[e("div",null,[e("div",W,h(s?.name),1)])])]),e("td",X,[e("button",{onClick:ae=>p(!1,s),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,Y)])]))),128))])])])])]),a(i)?(r(),A(a(v),{key:0,onClose:t[3]||(t[3]=s=>P(i)?i.value=!1:i=!1)},{header:b(()=>[e("h3",null,h(a(m)),1)]),body:b(()=>[e("form",Z,[e("div",ee,[e("label",te,[oe,N(e("input",{class:"form-input mt-1 block w-full","onUpdate:modelValue":t[1]||(t[1]=s=>a(n).name=s),placeholder:"Name ..."},null,512),[[T,a(n).name]])])]),se,e("button",{type:"button",onClick:t[2]||(t[2]=F(s=>g(),["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})):O("",!0)],64))}}),de=R(ne,[["__file","/home/aurthurm/Documents/Development/felicity/felicity-lims/webapp/views/admin/patient/PersonIdentification.vue"]]);export{de as default};