mirror of
https://github.com/beak-insights/felicity-lims.git
synced 2025-02-24 17:02:55 +08:00
1 line
7.7 KiB
JavaScript
1 line
7.7 KiB
JavaScript
import{_ as S,W as F,aG as z,aH as H,aI as W,q}from"./billing-356772f3.js";import{f as K,G as T,d as M,r as v,c as Q,h as a,k as r,x as e,F as u,ak as h,s as x,u as o,D as d,y as f,i as D,B as Y,A as b,al as O,ag as y,j as J,_ as X}from"./_plugin-vue_export-helper-3f67fb71.js";import{p as c}from"./index-3189f120.js";import{a as A,e as N,v as Z,d as ee}from"./runtime-dom.esm-bundler-6e07ef74.js";const se={class:""},te={class:"container w-full my-4"},oe=e("hr",null,null,-1),le=e("hr",null,null,-1),ne=e("hr",null,null,-1),ie={class:"grid grid-cols-12 gap-4 mt-2"},ae={class:"col-span-3 overflow-y-scroll overscroll-contain patient-scrol"},re=["onClick"],ce={class:"cursor-pointer"},de={class:"flex-grow p-1"},ue={class:"font-medium text-gray-800 hover:text-gray-600 flex justify-between"},_e=e("span",{class:"text-sm text-gray-500"},null,-1),pe={key:0,class:"col-span-9"},he={class:"bg-white rounded-sm shadow-sm hover:shadow-lg duration-500 px-4 sm:px-6 md:px-2 py-4"},me={class:"grid grid-cols-12 gap-3"},ge={class:"col-span-12 px-3 sm:px-0"},fe={class:"flex justify-between"},ve={class:"sm:text-sm md:text-md lg:text-lg text-gray-700 font-bold"},be=e("hr",null,null,-1),ye={div:"",class:"flex justify-start mt-2"},xe=e("h3",{class:"mr-2 text-gray-600 font-semibold"},"Pages: ",-1),ke=e("svg",{class:"w-4 h-4 fill-current",viewBox:"0 0 20 20"},[e("path",{d:"M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"})],-1),we=[ke],Ae={class:"bg-white shadow-md mt-2"},Ce={class:"-mb-px flex justify-start"},Ee=["onClick"],Pe={class:"mt-2 p-2 bg-white"},Ge={key:0},Se={class:"col-span-4 overflow-y-scroll overscroll-contain analyses-scroll bg-white p-1"},Te={class:"grid grid-cols-4 gap-2 w-full"},Me=["onClick"],De={class:"flex-grow p-1"},Oe={class:x(["font-medium text-gray-500 hover:text-gray-700 flex justify-start",{"text-gray-700 font-medium":!1}])},Ne=["onClick"],Ue={class:"inline-block w-10 mr-2 align-middle transition duration-200 ease-in"},Re=["onUpdate:modelValue"],je=e("hr",null,null,-1),Ie={key:1},Le=e("h3",null,"Error",-1),Ve=e("hr",null,null,-1),$e={action:"post",class:"p-1"},Be={class:"grid grid-cols-2 gap-x-4 mb-4"},Fe={class:"block col-span-2 mb-2"},ze=e("span",{class:"text-gray-700"},"Group Name",-1),He={class:"block col-span-2 mb-2"},We=e("span",{class:"text-gray-700"},"Pages",-1),qe=["size"],Ke=["value"],Qe={for:"toggle",class:"text-xs text-gray-700 mr-4"},Ye={class:"relative inline-block w-10 mr-2 align-middle select-none transition duration-200 ease-in"},Je=e("label",{for:"toggle",class:"toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"},null,-1),Xe=e("hr",null,null,-1),Ze=K({__name:"Groups",setup(es){const U=T(()=>S(()=>import("./SimpleModal-1f91868a.js"),["assets/SimpleModal-1f91868a.js","assets/_plugin-vue_export-helper-3f67fb71.js","assets/runtime-dom.esm-bundler-6e07ef74.js","assets/SimpleModal-f645a074.css"])),R=T(()=>S(()=>import("./Accordion-dc7be4da.js"),["assets/Accordion-dc7be4da.js","assets/_plugin-vue_export-helper-3f67fb71.js","assets/runtime-dom.esm-bundler-6e07ef74.js"])),C=[c.ADMINISTRATION,c.DASHBOARD,c.CLIENTS,c.PATIENTS,c.PATIENTS_COMPACT,c.SAMPLES,c.QC_SAMPLES,c.WORKSHEETS,c.NOTICE_MANAGER];let _=F();const{withClientMutation:k}=q();_.fetchGroupsAndPermissions();const j=M(()=>_.getGroups);let m=v("permissions");const I=["permissions"];let p=v(!1),E=v("");const w=v(!0);let l=Q({});function L(n){const t=n.pages;Object.assign(l,{...n,pages:t?.split(",")||[]}),G.value?.forEach(s=>{s[1].forEach(i=>{i.checked=!1,l.permissions?.some(g=>g?.uid==i?.uid||!1)&&(i.checked=!0)})})}function P(n,t={}){w.value=n,p.value=!0,E.value=(n?"CREATE":"EDIT")+" ANALYSES PROFILE",n?Object.assign(l,{name:"",pages:[]}):Object.assign(l,{...t})}function V(){const n={...l},t=n.pages;n.pages=t.join(","),w.value===!0&&k(z,{payload:n},"createGroup").then(s=>_.addGroup(s)),w.value===!1&&k(H,{uid:l?.uid,payload:{name:n.name,pages:n.pages}},"updateGroup").then(s=>_.updateGroup(s)),p.value=!1}const $=(n,t)=>n?.reduce(function(s,i){return(s[i[t]]=s[i[t]]||[]).push(i),s},{}),G=M(()=>Array.from(Object.entries($(_.getPermissions,"target"))));function B(n,t){k(W,{groupUid:n?.uid,permissionUid:t?.uid},"updateGroupPermissions").then(s=>_.updateGroupsAndPermissions(s))}return(n,t)=>(a(),r(u,null,[e("div",se,[e("div",te,[oe,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:t[0]||(t[0]=s=>P(!0))},"Add Group"),le]),ne,e("div",ie,[e("section",ae,[e("ul",null,[(a(!0),r(u,null,h(o(j),s=>(a(),r("li",{key:s?.uid,onClick:A(i=>L(s),["prevent","stop"]),class:x(["bg-white shadow w-full p-1 mb-1 rounded-sm",{"border border-sky-800 bg-emerald-200":s?.uid===o(l)?.uid}])},[e("a",ce,[e("div",de,[e("div",ue,[e("span",null,d(s?.name),1),_e])])])],10,re))),128))])]),o(l)?.uid!==void 0?(a(),r("section",pe,[e("div",he,[e("div",me,[e("div",ge,[e("div",fe,[e("section",null,[e("h2",ve,d(o(l)?.name),1),be,e("div",ye,[xe,(a(!0),r(u,null,h(o(l)?.pages,s=>(a(),r("span",{key:s,class:"mr-2"},d(s?.toLowerCase()),1))),128))])]),e("div",null,[e("button",{onClick:t[1]||(t[1]=s=>P(!1)),class:"ml-4 inline-flex items-center justify-center w-8 h-8 mr-2 border-sky-800 border text-gray-900 transition-colors duration-150 bg-white rounded-full focus:outline-none hover:bg-gray-200"},we)])])])])]),f(" Sample and Case Data "),e("nav",Ae,[e("div",Ce,[(a(),r(u,null,h(I,s=>e("a",{key:s,class:x(["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":o(m)===s}]),onClick:i=>D(m)?m.value=s:m=s},d(s),11,Ee)),64))])]),e("section",Pe,[o(m)==="permissions"?(a(),r("div",Ge,[e("section",Se,[e("div",Te,[(a(!0),r(u,null,h(o(G),s=>(a(),r("div",{class:"col-span-1",key:s[0]},[Y(o(R),null,{title:b(()=>[O(d(s[0]),1)]),body:b(()=>[e("div",null,[e("ul",null,[(a(!0),r(u,null,h(s[1],i=>(a(),r("li",{key:i?.uid,class:x(["cursor-pointer",[{"border-sky-800 bg-gray-200 underline pl-3":!1}]]),onClick:A(g=>i.checked=!i?.checked,["prevent"])},[e("div",De,[e("div",Oe,[e("label",{for:"toggle",class:"text-xs text-gray-700 mr-2",onClick:g=>B(o(l),i)},[e("div",Ue,[y(e("input",{type:"checkbox","onUpdate:modelValue":g=>i.checked=g,class:""},null,8,Re),[[N,i.checked]])]),e("span",null,d(i?.action),1)],8,Ne)])]),je],8,Me))),128))])])]),_:2},1024)]))),128))])])])):(a(),r("div",Ie,[f(" fiancials "),Le,Ve]))])])):f("v-if",!0)])]),f(" AnaltsisProfile Form Modal "),o(p)?(a(),J(o(U),{key:0,onClose:t[6]||(t[6]=s=>D(p)?p.value=!1:p=!1)},{header:b(()=>[e("h3",null,d(o(E)),1)]),body:b(()=>[e("form",$e,[e("div",Be,[e("label",Fe,[ze,y(e("input",{class:"form-input mt-1 block w-full","onUpdate:modelValue":t[2]||(t[2]=s=>o(l).name=s),placeholder:"Name ..."},null,512),[[Z,o(l).name]])]),e("label",He,[We,y(e("select",{name:"controlLevels",id:"controlLevels","onUpdate:modelValue":t[3]||(t[3]=s=>o(l).pages=s),class:"form-input mt-1 block w-full",multiple:"",size:C.length},[(a(),r(u,null,h(C,s=>e("option",{key:s,value:s},d(s),9,Ke)),64))],8,qe),[[ee,o(l).pages]])]),e("label",Qe,[O("Active "),e("div",Ye,[y(e("input",{type:"checkbox",name:"toggle",id:"toggle","onUpdate:modelValue":t[4]||(t[4]=s=>o(l).active=s),class:"toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer outline-none"},null,512),[[N,o(l).active]]),Je])])]),Xe,e("button",{type:"button",onClick:t[5]||(t[5]=A(s=>V(),["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})):f("v-if",!0)],64))}}),ns=X(Ze,[["__file","/home/aurthurm/Development/felicity-lims/webapp/views/admin/users/Groups.vue"]]);export{ns as default};
|