mirror of
https://github.com/beak-insights/felicity-lims.git
synced 2025-02-23 16:33:11 +08:00
1 line
4 KiB
JavaScript
1 line
4 KiB
JavaScript
import{d as E,aw as C,r as c,q as D,y as L,m as A,o as r,c as u,b as e,F as x,E as F,g as T,B as p,C as M,t as f,f as n,A as V,e as h,v as y,w as N,i as U,D as B,j as S,_ as $,M as j,k as I}from"./index-e62f5c21.js";import{A as O,E as X}from"./reflex.mutations-ed7eb95e.js";const P=e("h4",null,"Reflex Rules",-1),q={class:"container w-full my-4"},z=e("hr",null,null,-1),G=e("hr",null,null,-1),H={class:"overflow-x-auto mt-4"},J={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"},K={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"}," Title "),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),W={class:"bg-white"},Y={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},Z={class:"px-1 py-1 whitespace-no-wrap border-b border-gray-500"},ee={class:"text-sm leading-5 text-sky-800"},te={class:"px-1 py-1 whitespace-no-wrap text-right border-b border-gray-500 text-sm leading-5"},se=["onClick"],oe={action:"post",class:"p-1"},le={class:"grid grid-cols-2 gap-x-4 mb-4"},ne={class:"block col-span-1 mb-2"},ae=e("span",{class:"text-gray-700"},"Name",-1),ie={class:"block col-span-2 mb-2"},re=e("span",{class:"text-gray-700"},"Description",-1),de=e("hr",null,null,-1),ce=E({__name:"ReflexListing",setup(ue){const g=S(()=>$(()=>import("./FelModal-44636049.js"),["assets/FelModal-44636049.js","assets/index-e62f5c21.js","assets/index-332ec99e.css","assets/FelModal-780aeea9.css"])),{withClientMutation:m}=j(),i=C();let a=c(!1),_=c(""),o=D({});const d=c(!0);L(async()=>{i.fetchAllReflexRules()});function v(){const l={name:o.name,description:o.description};m(O,{payload:l},"createReflexRule").then(t=>i.addReflexRule(t))}function w(){const l={name:o.name,description:o.description};m(X,{uid:o.uid,payload:l},"updateReflexRule").then(t=>i.updateReflexRule(t))}function b(l,t={}){d.value=l,a.value=!0,_.value=(l?"CREATE":"EDIT")+" REFLEX RULE",l?Object.assign(o,{}):Object.assign(o,{...t})}function R(){d.value===!0&&v(),d.value===!1&&w(),a.value=!1}return(l,t)=>{const k=A("router-link");return r(),u(x,null,[P,e("div",q,[z,e("button",{onClick:t[0]||(t[0]=s=>b(!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 Reflex Rule "),G,e("div",H,[e("div",J,[e("table",K,[Q,e("tbody",W,[(r(!0),u(x,null,F(n(i).reflexRules,s=>(r(),u("tr",{key:s?.uid},[e("td",Y,[T(k,{to:{name:"reflex-detail",params:{uid:s?.uid}},class:"text-sm leading-5 text-gray-800"},{default:p(()=>[M(f(s?.name),1)]),_:2},1032,["to"])]),e("td",Z,[e("div",ee,f(s?.description),1)]),e("td",te,[e("button",{onClick:pe=>b(!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,se)])]))),128))])])])])]),n(a)?(r(),V(n(g),{key:0,onClose:t[4]||(t[4]=s=>U(a)?a.value=!1:a=!1)},{header:p(()=>[e("h3",null,f(n(_)),1)]),body:p(()=>[e("form",oe,[e("div",le,[e("label",ne,[ae,h(e("input",{class:"form-input mt-1 block w-full","onUpdate:modelValue":t[1]||(t[1]=s=>n(o).name=s),placeholder:"Name ..."},null,512),[[y,n(o).name]])]),e("label",ie,[re,h(e("textarea",{cols:"2",class:"form-input mt-1 block w-full","onUpdate:modelValue":t[2]||(t[2]=s=>n(o).description=s),placeholder:"Description ..."},null,512),[[y,n(o).description]])])]),de,e("button",{type:"button",onClick:t[3]||(t[3]=N(s=>R(),["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)}}}),_e=I(ce,[["__file","/home/aurthurm/Documents/Development/felicity/felicity-lims/webapp/views/admin/reflex/ReflexListing.vue"]]);export{_e as default};
|