yekonga-server
Version:
Yekonga Server
2 lines (1 loc) • 10.5 kB
JavaScript
import{g as e,o as t,c as o,h as i,j as r,k as a,t as l,n as s,v as n,H as u,aa as d,q as p,x as c,B as h,m as f}from"./vendor.38a5f540.js";import{_ as m}from"./Form.94295666.js";import P from"./View.83802a28.js";import"./index.esm.ef3672ff.js";const G={name:"AuthProfileGroupDataItemComponent",props:{index:{type:Number,default:0},data:{type:Object,default:()=>{}},selectedItems:{type:Array,default:()=>[]},parentComp:{type:Object,default:()=>{}},paginatorComp:{type:Object,default:()=>{}}},methods:{toggleItem(e,t){var o=!this.paginatorComp.selectedListIDs.includes(t.uuid);this.paginatorComp.onSelect(t,o)}}},w={class:"col-12 mb-3"},g={class:"d-flex flex-grow-1 min-width-zero ps-2"},y={class:"card-body d-flex flex-column flex-md-row align-self-center align-items-lg-center justify-content-between min-width-zero py-3"},I={class:"w-30 w-sm-100"},x={class:"d-block"},$={class:"w-70 w-sm-100"},A={class:"row flex-column flex-md-row align-items-lg-center"},v={class:"col"},b={class:"d-inline-block align-self-center me-4"},C=i("i",{class:"ye ye-eye"},null,-1),k=[i("i",{class:"ye ye-trash"},null,-1)],D=["checked"];G.render=function(u,d,p,c,h,f){const m=e("router-link");return t(),o("div",w,[i("div",{class:n(["card d-flex",{active:p.paginatorComp.selectedListIDs.includes(p.data.uuid)}]),"no-body":""},[i("div",g,[i("div",y,[i("div",I,[r(m,{to:{path:"/app/permissions/profile-groups/edit/"+p.data.authProfileGroupId},class:"d-block"},{default:a((()=>[i("span",x,l(p.data.name),1)])),_:1},8,["to"])]),i("div",$,[i("div",A,[i("span",v,l(p.data.description),1)])])]),i("div",b,[r(m,{to:{path:"/app/permissions/profile-groups/edit/"+p.data.authProfileGroupId},class:"badge badge-outline-dark rounded pointer"},{default:a((()=>[C])),_:1},8,["to"]),i("div",{onClick:d[0]||(d[0]=e=>p.parentComp.onContextMenuAction("delete",p.data)),class:"badge badge-outline-danger rounded pointer ms-1"},k)]),i("div",{onClick:d[1]||(d[1]=s((e=>f.toggleItem(e,p.data)),["prevent"])),class:"custom-control custom-checkbox ps-1 align-self-center pe-4"},[i("input",{type:"checkbox",checked:p.paginatorComp.selectedListIDs.includes(p.data.uuid),disabled:!0,class:"form-check-input"},null,8,D)])])],2)])};const M={name:"AuthProfileGroupListComponent",computed:u({currentUser:"user"}),components:{DataItem:G,AuthProfileGroupForm:m,AuthProfileGroupView:P},props:{showHeader:{type:Boolean,default:!0},profileId:String},watch:{showAuthProfileGroupFormModal:function(e,t){0==e&&(this.authProfileGroupId=null)},showAuthProfileGroupViewModal:function(e,t){0==e&&(this.authProfileGroupId=null)},"$route.params.profileId":function(e,t){this.profileId=e,this.listOptions.args.profileId=[this.profileId]}},data(){return{displayMode:"list",authProfileGroupId:null,singleSelectedData:null,showHeaderSection:!0,queryLimit:10,querySearch:"",currentComp:null,showAuthProfileGroupFormModal:!1,showAuthProfileGroupViewModal:!1,showAuthProfileGroupImportModal:!1,listOptions:{name:"authProfileGroupPaginate",listName:"authProfileGroup",paginateName:"authProfileGroupPaginate",downloadName:"downloadAuthProfileGroups",orderOptions:{name:this.$t("authProfileGroup.name"),description:this.$t("authProfileGroup.description")},query:"{uuid:authProfileGroupId,authProfileGroupId,name,description}",downloadQuery:"{uuid:authProfileGroupId,authProfileGroupId,name,description}",downloadOrientation:"PORTRAIT",args:{},loadingMode:"paginate",noResultMessage:this.$t("authProfileGroup.noData"),modeOptions:["list"],showToolbar:!0,showHeader:!0,showFooter:!0,tableMode:!1,padding:"0px",height:"300px",searchFields:["profileId","authProfileGroupId","name","description"],columns:{name:this.$t("authProfileGroup.name"),description:this.$t("authProfileGroup.description")},filters:[],actions:[{label:this.$t("authProfileGroup.delete"),callback:this.onDeleteAuthProfileGroups}]}}},created(){this.loading=!0,this.currentComp=this,this.$route.meta&&void 0!==this.$route.meta.showHeader?this.showHeaderSection=this.$route.meta.showHeader:this.showHeaderSection=this.showHeader,this.$route.params.profileId&&(this.listOptions.args.profileId=[this.$route.params.profileId])},mounted(){var e=this;window.jQuery("#modelViewAuthProfileGroup").on("hidden.bs.modal",(function(t){e.authProfileGroupId=null})),window.jQuery("#modelFormAuthProfileGroup").on("hidden.bs.modal",(function(t){e.authProfileGroupId=null}))},methods:{updateList:function(e){this.loading=!1,this.processing=!1,this.authProfileGroupList=e},changeDisplayMode:function(e){this.displayMode=e},onLoading:function(e){e||(this.loading=e),this.processing=e},reloadData:function(e){e&&e.authProfileGroupId&&(this.authProfileGroupId=e.authProfileGroupId),this.$refs.paginator.reload()},onShow:function(e){this.authProfileGroupId=e,this.showAuthProfileGroupViewModal=!0},onEdit:function(e){this.authProfileGroupId=e,this.showAuthProfileGroupFormModal=!0},handleContextMenu(e){var t=e?e.componentOptions.propsData.data:null;this.singleSeletedData=t},onContextMenuAction(e,t=null){let o=this.singleSeletedData?this.singleSeletedData:t,i=o?o.uuid:null;"show"==e?this.onShow(i):"edit"==e?this.onEdit(i):"delete"==e&&this.onDelete(i)},onDelete:async function(e,t="Auth Profile Group"){if(await window.customConfirm(this.$t("authProfileGroup.alertSingleDelete",{title:t}))){this.processing=!0;var o=`mutation { delete:deleteAuthProfileGroup(where:{authProfileGroupId:{equalTo:"${e}"}}){status,message} }`,i=await window.ajaxGraphql(o,{});i.delete&&i.delete.status?(this.reloadData(),window.customAlert(this.$t("authProfileGroup.alertDeleteSuccess"),"success")):window.customAlert(this.$t("authProfileGroup.alertDeleteFail"),"danger"),this.processing=!1}},onDeleteAuthProfileGroups:async function(e,t="Auth Profile Groups"){if(await window.customConfirm(this.$t("authProfileGroup.alertMultipleDelete"))){this.processing=!0;var o=e.map((e=>e.uuid)),i=`mutation { delete:deleteAuthProfileGroup(where:{authProfileGroupId:{in:${JSON.stringify(o)}}}){status,message} }`,r=await window.ajaxGraphql(i,{});r.delete&&r.delete.status?(this.reloadData(),window.customAlert(this.$t("authProfileGroup.actionDeleteSuccess"),"success")):window.customAlert(this.$t("authProfileGroup.actionDeleteFail"),"danger"),this.processing=!1}return!1}}},j={class:"main-container-middle p-4"},S={key:0,class:"container-header container-customer",style:{overflow:"visible"}},F={class:"row align-items-center justify-content-between py-3 mx-0"},V={class:"col d-flex align-items-center justify-content-between mb-2 mb-md-0 px-0"},O={class:"h5 m-0"},L=[i("i",{class:"ye ye-plus-circle"},null,-1)],H={class:"col-4 d-none d-lg-block px-0"},_={key:0,class:"col text-end d-none d-md-block px-0"},q=i("i",{class:"ye ye-plus-circle me-1"},null,-1),N=i("div",{class:"separator"},null,-1),U={class:"container-detail"},T={class:"container-customer rounded"},Q={class:"text-center py-5"},R=i("div",{class:"d-inline-block"},[i("span",{class:"d-flex rounded border border-primary px-4 py-3"},[i("i",{class:"ye ye-file-plus ye-2x text-muted"})])],-1),z={class:"my-4"},B=i("i",{class:"ye ye-plus-circle me-0"},null,-1),E=i("i",{class:"simple-icon-doc"},null,-1),J=i("i",{class:"iconsminds-file-edit"},null,-1),K=i("i",{class:"simple-icon-trash"},null,-1);M.render=function(s,n,u,m,P,G){const w=e("DataItem"),g=e("paginator"),y=e("v-contextmenu-item"),I=e("v-contextmenu"),x=e("AuthProfileGroupForm"),$=e("modal-pro"),A=e("AuthProfileGroupView"),v=d("contextmenu");return t(),o("div",j,[P.showHeaderSection?(t(),o("div",S,[i("div",F,[i("div",V,[i("span",O,l(s.$t("authProfileGroup.authProfileGroup")),1),s.$isPermitted("authProfileGroup.create")?(t(),o("a",{key:0,onClick:n[0]||(n[0]=e=>P.showAuthProfileGroupFormModal=!0),href:"javascript:;",class:"btn btn-primary d-inline-block d-md-none"},L)):p("",!0)]),i("div",H,[p("",!0)]),(s.$refs.paginator&&s.$refs.paginator.emptyCollection,t(),o("div",_,[s.$isPermitted("authProfileGroup.create")?(t(),o("a",{key:0,href:"javascript:;",onClick:n[2]||(n[2]=e=>P.showAuthProfileGroupFormModal=!0),class:"btn btn-primary"},[q,c(" "+l(s.$t("general.addNew")),1)])):p("",!0)]))])])):p("",!0),N,i("div",U,[i("div",T,[r(g,{ref:"paginator",limit:P.queryLimit,search:P.querySearch,options:P.listOptions},{default:a((({item:e,index:t})=>[h(r(w,{data:e,index:t,selectedItems:s.$refs.paginator.selectedList,paginatorComp:s.$refs.paginator,parentComp:P.currentComp},null,8,["data","index","selectedItems","paginatorComp","parentComp"]),[[v,void 0,"contextmenu"]])])),noData:a((()=>[i("div",Q,[R,i("div",z,l(s.$t("authProfileGroup.noData")),1),i("div",null,[s.$isPermitted("authProfileGroup.create")?(t(),o("a",{key:0,href:"javascript:;",onClick:n[3]||(n[3]=e=>P.showAuthProfileGroupFormModal=!0),class:"btn btn-outline-primary me-2"},[B,c(" "+l(s.$t("general.addNew")),1)])):p("",!0)])])])),_:1},8,["limit","search","options"]),r(I,{onContextmenu:G.handleContextMenu,ref:"contextmenu"},{default:a((()=>[s.$isPermitted("authProfileGroup.information")?(t(),f(y,{key:0,onClick:n[4]||(n[4]=e=>G.onContextMenuAction("show"))},{default:a((()=>[E,i("span",null,l(s.$t("general.information")),1)])),_:1})):p("",!0),s.$isPermitted("authProfileGroup.edit")?(t(),f(y,{key:1,onClick:n[5]||(n[5]=e=>G.onContextMenuAction("edit"))},{default:a((()=>[J,i("span",null,l(s.$t("general.edit")),1)])),_:1})):p("",!0),s.$isPermitted("authProfileGroup.delete")?(t(),f(y,{key:2,onClick:n[6]||(n[6]=e=>G.onContextMenuAction("delete"))},{default:a((()=>[K,i("span",null,l(s.$t("general.delete")),1)])),_:1})):p("",!0)])),_:1},8,["onContextmenu"])])]),s.$isPermitted("authProfileGroup.create")||s.$isPermitted("authProfileGroup.edit")?(t(),f($,{key:1,title:P.authProfileGroupId?s.$t("authProfileGroup.editAuthProfileGroup"):s.$t("authProfileGroup.createAuthProfileGroup"),modelValue:P.showAuthProfileGroupFormModal,"onUpdate:modelValue":n[7]||(n[7]=e=>P.showAuthProfileGroupFormModal=e)},{default:a((()=>[r(x,{onUpdate:G.reloadData,oneLine:!1,authProfileGroupId:P.authProfileGroupId,ref:"authProfileGroupForm"},null,8,["onUpdate","authProfileGroupId"])])),_:1},8,["title","modelValue"])):p("",!0),s.$isPermitted("authProfileGroup.information")?(t(),f($,{key:2,title:s.$t("authProfileGroup.viewAuthProfileGroup"),modelValue:P.showAuthProfileGroupViewModal,"onUpdate:modelValue":n[8]||(n[8]=e=>P.showAuthProfileGroupViewModal=e)},{default:a((()=>[r(A,{oneLine:!0,authProfileGroupId:P.authProfileGroupId,ref:"authProfileGroupView"},null,8,["authProfileGroupId"])])),_:1},8,["title","modelValue"])):p("",!0)])};export{M as default};