PageSourceSearch

https://portal.urbis.primaria-calimanesti.ro/assets/TriggersPage-e6445988.js

js primaria-calimanesti.ro collected 2026-09-25 02:07:17 UTC 8,147 bytes, 1 lines download raw bytes

1import{c as v,s as z,k as b}from"./primevue-ca313794.js";import{_ as F,u as L,Y as V,Q as A,V as S,aa as N,M as P,a0 as H,N as R}from"./index-cc1a661b.js";import{I as B}from"./ImportNomenclaturePopup-aa11f696.js";import{l as E}from"./layoutDataViewFilters-860124fe.js";import{h as I,i as O,d,e as q,s as a,x as n,l as u,g as p,F as M,j as c,A as f,t as y}from"./vendor-ea0043bb.js";import"./mapbox-v3-eadefc84.js";import"./geo-1391ac6a.js";import"./mapbox-addons-be198bf9.js";import"./editor-b65e0429.js";import"./pdf-7415fc80.js";const Y={name:"Triggers",mixins:[L,E],components:{MultiListInput:V,ListInput:A,ImportNomenclaturePopup:B},computed:{params(){return{skip:this.skip,take:this.take,documentCategoryId:this.filter.documentCategory?this.filter.documentCategory.documentCategoryId:null,documentTypeId:this.filter.documentType?this.filter.documentType.documentTypeId:null,filter:this.filter.filter&&this.filter.filter.length?this.filter.filter:null,organizationIds:this.filter.organizationIds?this.filter.organizationIds:null,orderBy:this.sortField?`${this.sortField} ${this.sortDir}`:null}},documentTypes(){return S(this.common.documentTypes.filter(e=>e.documentCategoryId===N.Trigger).map(e=>({documentTypeId:e.documentTypeId,parentDocumentTypeId:e.parentDocumentTypeId,depth:e.depth,title:e.title})),"documentTypeId","parentDocumentTypeId",void 0,0)}},data(){return{triggers:[],skip:0,take:30,filter:{},emptyFilter:{documentType:null,filter:"",organizationIds:null},organizations:[],totalRecords:0,isLoading:!1,isDownloading:!1,sortField:null,sortDir:"ASC",showImportPopup:!1}},created(){this.getTriggers(),this.getOrganizations()},methods:{createTrigger(){if(!this.userHasAccessTo("add","Trigger")){this.$toast.add({severity:"warn",summary:"Warning",detail:this.$t("You have no rights to access this resource!"),life:5e3});return}this.$router.push("/add-trigger/")},onPageChange(e){this.take=e.rows,this.skip=e.page*this.take,this.getTriggers()},getTriggers(e){e&&(this.skip=0),this.isLoading=!0,this.filter.organizationIds&&this.filter.organizationIds.length===0&&(this.filter.organizationIds=null),this.$store.dispatch("getTriggers",{query:{moduleId:this.$route?.meta?.moduleId},data:this.params}).then(t=>{this.triggers=t,this.totalRecords=t.length?t[0].totalRows:0,this.isLoading=!1}).catch(t=>{this.isLoading=!1,this.$toast.add({severity:"error",summary:"Error",detail:this.$t(t),life:5e3})})},editTrigger(e){if(!this.userHasAccessTo("edit","Trigger")){this.$toast.add({severity:"warn",summary:"Warning",detail:this.$t("You have no rights to access this resource!"),life:5e3});return}this.$router.push(`/edit-trigger/${e.documentId}`)},deleteTrigger(e){if(!this.userHasAccessTo("delete","Trigger")){this.$toast.add({severity:"warn",summary:"Warning",detail:this.$t("You have no rights to access this resource!"),life:5e3});return}this.$confirm.require({message:P(this.$t("Are you sure want to delete %s?"),[e.title]),header:this.$t("Confirm action"),icon:"pi pi-exclamation-triangle",accept:()=>{this.isLoading=!0,this.$store.dispatch("deleteFlow",{query:{moduleId:this.$route?.meta?.moduleId},data:e}).then(t=>{this.getTriggers(),this.isLoading=!1}).catch(t=>{this.isLoading=!1,this.$toast.add({severity:"error",summary:"Error",detail:this.$t(t),life:5e3})})},reject:()=>{}})},resetFilter(){this.filter={...this.emptyFilter},this.filter.organizationIds=[],this.getTriggers(!0)},getOrganizations(){this.$store.dispatch("getUserOrganization",{query:{moduleId:this.$route?.meta?.moduleId},data:{organizationCategoryId:1}}).then(e=>{this.organizations=e.map(t=>({organizationId:t.organizationId,title:t.title,label:`${t.title}`})).sort((t,l)=>t.title>l.title?1:l.title>t.title?-1:0)}).catch(e=>{})},onSort(e){this.sortField=e.sortField,this.sortDir=e.sortOrder===1?"ASC":"DESC",this.getTriggers()},downloadDocument(e){if(!this.userHasAccessTo("add","Trigger")){this.$toast.add({severity:"warn",summary:"Warning",detail:this.$t("You have no rights to access this resource!"),life:5e3});return}this.prepareForDownload(e)},prepareForDownload(e){let t=JSON.parse(JSON.stringify(e));this.isDownloading=t.documentId,this.$store.dispatch("getNestedDocumentTasks",{query:{moduleId:this.$route?.meta?.moduleId},data:{documentId:t.documentId}}).then(l=>{this.isDownloading=!1,t.documentTasks=H(l,null,null,null,["documentId","documentTaskId","parentDocumentTaskId","authorId","referenceDocumentTaskId","relatedDocumentTaskId","entityId","referenceDocumentId","relatedDocumentId"]),delete t.documentId,delete t.parentDocumentId,delete t.referenceDocumentId,delete t.relatedDocumentId,delete t.relatedDocumentTaskId,delete t.organizationId,delete t.organizationId,delete t.entityId,delete t.authorId;const T=new Blob([JSON.stringify(t)],{type:"text/plain;charset=utf-8"});R.saveAs(T,t.title+".json")}
1).catch(l=>{this.isDownloading=!1,this.$toast.add({severity:"error",summary:"Error",detail:this.$t(l),life:5e3})})},openImportPopup(){this.showImportPopup=!0},onImportDone(e){this.showImportPopup=!1,this.$router.push(`/edit-trigger/${e.documentId}`)}}};function U(e,t,l,T,r,i){const m=v,k=I("ListInput"),D=I("MultiListInput"),w=z,h=b,$=I("LayoutDataView"),C=I("ImportNomenclaturePopup"),g=O("tooltip");return d(),q(M,null,[a($,{elements:r.triggers,elementsLoading:r.isLoading,onPage:t[3]||(t[3]=o=>i.onPageChange(o)),onSort:t[4]||(t[4]=o=>i.onSort(o)),onSearch:t[5]||(t[5]=o=>i.getTriggers(!0)),onResetFilters:i.resetFilter,totalRecords:r.totalRecords,take:r.take,skip:r.skip},{headerButtons:n(()=>[e.userHasAccessTo("add","Trigger")?c((d(),u(m,{key:0,icon:"pi pi-plus",class:"p-button-success",onClick:i.createTrigger},null,8,["onClick"])),[[g,e.$t("Create trigger"),void 0,{left:!0}]]):p("",!0),e.userHasAccessTo("add","Trigger")?c((d(),u(m,{key:1,icon:"pi pi-upload",class:"p-button-secondary",onClick:i.openImportPopup},null,8,["onClick"])),[[g,e.$t("Import trigger"),void 0,{left:!0}]]):p("",!0)]),filters:n(()=>[a(k,{placeholder:e.$t("Document type"),modelValue:r.filter.documentType,"onUpdate:modelValue":t[0]||(t[0]=o=>r.filter.documentType=o),options:i.documentTypes,"option-label":"title","id-key":"documentTypeId"},null,8,["placeholder","modelValue","options"]),a(D,{placeholder:e.$t("Department"),modelValue:r.filter.organizationIds,"onUpdate:modelValue":t[1]||(t[1]=o=>r.filter.organizationIds=o),options:r.organizations,"option-label":"label","option-value":"organizationId","id-key":"organizationId"},null,8,["placeholder","modelValue","options"]),a(w,{type:"text",modelValue:r.filter.filter,"onUpdate:modelValue":t[2]||(t[2]=o=>r.filter.filter=o),placeholder:e.$t("Search...")},null,8,["modelValue","placeholder"])]),columns:n(({slotProps:o})=>[a(h,{field:"documentId",header:e.$t("ID"),sortable:!0},{body:n(s=>[f(y(s.data.documentId),1)]),_:2},1032,["header"]),a(h,{field:"title",header:e.$t("Title"),sortable:!0},{body:n(s=>[f(y(s.data.title),1)]),_:2},1032,["header"]),a(h,{field:"documentType",header:e.$t("Type"),sortable:!0},{body:n(s=>[f(y(s.data?.documentType?.title),1)]),_:2},1032,["header"]),a(h,{field:"organization",header:e.$t("Organization"),sortable:!0},{body:n(s=>[f(y(s.data?.organization?.title),1)]),_:2},1032,["header"])]),rowButtons:n(({slotProps:o})=>[e.userHasAccessTo("edit","Trigger")?c((d(),u(m,{key:0,icon:"pi pi-pencil",class:"p-button-success",onClick:s=>i.editTrigger(o.data)},null,8,["onClick"])),[[g,e.$t("Edit"),void 0,{left:!0}]]):p("",!0),e.userHasAccessTo("add","Trigger")?c((d(),u(m,{key:1,icon:"fa fa-download",class:"p-button-secondary",loading:r.isDownloading===o.data.documentId,onClick:s=>i.downloadDocument(o.data)},null,8,["loading","onClick"])),[[g,e.$t("Download"),void 0,{left:!0}]]):p("",!0),e.userHasAccessTo("delete","Trigger")?c((d(),u(m,{key:2,icon:"pi pi-trash",class:"p-button-danger",onClick:s=>i.deleteTrigger(o.data)},null,8,["onClick"])),[[g,e.$t("Download"),void 0,{left:!0}]]):p("",!0)]),_:1},8,["elements","elementsLoading","onResetFilters","totalRecords","take","skip"]),r.showImportPopup?(d(),u(C,{key:0,onImported:i.onImportDone,onClose:t[6]||(t[6]=o=>r.showImportPopup=!1)},null,8,["onImported"])):p("",!0)],64)}const ee=F(Y,[["render",U]]);export{ee as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.