mirror of
https://github.com/beak-insights/felicity-lims.git
synced 2025-02-24 08:53:00 +08:00
1 line
3.8 KiB
JavaScript
1 line
3.8 KiB
JavaScript
import{d as k,ab as C,r as c,C as D,D as S,o as i,c as u,b as e,F as h,p as A,t as p,f as a,q as N,G as g,e as f,v as y,w as T,i as E,x as O,j as I,_ as R,bT as F,bU as M,O as V,k as B}from"./index-2a6c9271.js";const G={class:"container w-full my-4"},U=e("hr",null,null,-1),$=e("hr",null,null,-1),j={class:"overflow-x-auto mt-4"},L={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"},P={class:"min-w-full"},q=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"},"Standard"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300 text-left text-sm leading-4 text-gray-800 tracking-wider"},"Description"),e("th",{class:"px-1 py-1 border-b-2 border-gray-300"})])],-1),z={class:"bg-white"},H={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},J={class:"flex items-center"},K={class:"text-sm leading-5 text-gray-800"},Q={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},W={class:"text-sm leading-5 text-sky-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:"block col-span-1 mb-2"},se=e("span",{class:"text-gray-700"},"Stndard Name",-1),oe={class:"block col-span-2 mb-2"},ne=e("span",{class:"text-gray-700"},"Description",-1),ae=e("hr",null,null,-1),re=k({__name:"CodingStandard",setup(de){const v=I(()=>R(()=>import("./SimpleModal-0c0664c5.js"),["assets/SimpleModal-0c0664c5.js","assets/index-2a6c9271.js","assets/index-88806377.css","assets/SimpleModal-f645a074.css"])),d=C(),{withClientMutation:_}=V();let r=c(!1),b=c(""),o=D({});const l=c(!0);d.fetchCodingStandards();const x=S(()=>d.getCodingStandards);function m(n,t={}){l.value=n,r.value=!0,b.value=(n?"CREATE":"EDIT")+" CODING STANDARD",n?Object.assign(o,{}):Object.assign(o,{...t})}function w(){const n={name:o.name,description:o.description};l.value===!0&&_(F,{payload:n},"createCodingStandard").then(t=>d.addCodingStandard(t)),l.value===!1&&_(M,{uid:o.uid,payload:n},"updateCodingStandard").then(t=>d.updateCodingStandard(t)),r.value=!1}return(n,t)=>(i(),u(h,null,[e("div",G,[U,e("button",{onClick:t[0]||(t[0]=s=>m(!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 Coding"),$,e("div",j,[e("div",L,[e("table",P,[q,e("tbody",z,[(i(!0),u(h,null,A(x.value,s=>(i(),u("tr",{key:s?.uid},[e("td",H,[e("div",J,[e("div",null,[e("div",K,p(s?.name),1)])])]),e("td",Q,[e("div",W,p(s?.description),1)]),e("td",X,[e("button",{onClick:ie=>m(!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(r)?(i(),N(a(v),{key:0,onClose:t[4]||(t[4]=s=>E(r)?r.value=!1:r=!1)},{header:g(()=>[e("h3",null,p(a(b)),1)]),body:g(()=>[e("form",Z,[e("div",ee,[e("label",te,[se,f(e("input",{class:"form-input mt-1 block w-full","onUpdate:modelValue":t[1]||(t[1]=s=>a(o).name=s),placeholder:"Name ..."},null,512),[[y,a(o).name]])]),e("label",oe,[ne,f(e("textarea",{cols:"2",class:"form-input mt-1 block w-full","onUpdate:modelValue":t[2]||(t[2]=s=>a(o).description=s),placeholder:"Description ..."},null,512),[[y,a(o).description]])])]),ae,e("button",{type:"button",onClick:t[3]||(t[3]=T(s=>w(),["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))}}),ce=B(re,[["__file","/home/aurthur/Documents/Development/felicity-lims/webapp/views/admin/coding/CodingStandard.vue"]]);export{ce as default};
|