PageSourceSearch

https://painel.rmdcompliance.com.br/assets/index-DHNB32zb.js

js rmdcompliance.com.br collected 2026-10-09 22:26:11 UTC 9,233 bytes, 1 lines download raw bytes

1import{n as r,v as l}from"./index-ytIs-52l.js";const c={components:{vueDropzone:l},data(){return{route:"titulares",list:[],selecionados:[],page:1,perPage:10,busca:"",total:0,query:{page:1,limit:10,skip:0},dropzoneOptions:this.$http.getDropzoneConfig("v1/titulares/importar","post",{maxFiles:1,addRemoveLinks:!0,capture:!0,acceptedFiles:".xlsx",dictDefaultMessage:"Clique ou arraste seu arquivo aqui",dictRemoveFile:"Remover"})}},computed:{cardStyle(){return this.isDarkMode?{backgroundColor:"#1c1d20",borderColor:"#3c4043"}:{backgroundColor:"#FFFFFF",borderColor:"#E5E7EB"}}},methods:{rowStyle(s){return s%2===1?{backgroundColor:this.isDarkMode?"rgba(255,255,255,0.025)":"#FAFAFA"}:{}},async start(){const s=await this.$http.post(`/v1/${this.route}/list`,{busca:this.busca,skip:this.query.skip,limit:this.query.limit});this.list=s.data.data,this.total=s.data.total},async excluirTodosDaBase(){this.$confirm({title:"Excluir tudo?",message:`Tem certeza que quer excluir os ${this.total} titulares da base? (Essa ação é irreversível)`,button:{no:"Não",yes:"Sim"},callback:async s=>{s&&(await this.$http.delete(`/v1/${this.route}/all/base`),this.$toast.success("Base limpa com sucesso!"),this.start())}})},async excluirSelecionadas(){this.$confirm({title:"Remover selecionados",message:"Deseja remover itens selecionados ?",button:{no:"Não",yes:"Sim"},callback:async s=>{s&&(await this.$http.post(`/v1/${this.route}/selecionados/deletar`,{selecionados:this.selecionados}),this.selecionados=[],this.$toast.success("Removido com sucesso!"),this.start())}})},async selecionarTodos(){if(this.selecionados.length)this.selecionados=[];else{const s=await this.$http.post(`/v1/${this.route}/list`,{all:!0,busca:this.busca});this.selecionados=s.data.data}},selecionadosControl(s,t){this.selecionados.map(e=>e._id).indexOf(s._id)>-1&&!t.target.checked?this.selecionados.splice(this.selecionados.map(e=>e._id).indexOf(s._id),1):this.selecionados.push(s)},async remove(s){this.$confirm({title:"Confirmação",message:"Tem certeza que deseja arquivar esse titular?",button:{no:"Não",yes:"Sim"},callback:async t=>{t&&(await this.$http.delete(`/v1/${this.route}/${s}`),this.$toast.success("Removido com sucesso!"),this.page=1,this.start())}})},update(s,t){t.success?this.$toast.success("Importando! Quando finalizado você será alertado no email."):this.$toast.error(t.err),this.$modal.hide("importarModal"),this.start()},send(s,t,e){e.append("empresa",this.$store.state.empresa&&this.$store.state.empresa._id?this.$store.state.empresa._id:null)},updateFiltro(){this.query.page=1,this.query.limit=this.perPage,this.query.skip=0,this.query={page:this.query.page,limit:this.query.limit,skip:this.query.skip,busca:this.busca},this.$router.push({path:`/cadastros/${this.route}`,query:this.query})},async setPage(s){const t=(s-1)*this.perPage,e=this.perPage;this.query.page=s,this.query.skip=t,this.query.limit=e,this.query.busca=this.busca,this.$router.push({path:`/cadastros/${this.route}`,query:this.query})}},async beforeRouteUpdate(s,t,e){e(),this.$route.query.busca&&(this.busca=this.$route.query.busca),this.$route.query.page&&(this.query.page=parseInt(this.$route.query.page)),this.$route.query.limit&&(this.query.limit=parseInt(this.$route.query.limit)),this.$route.query.skip&&(this.query.skip=parseInt(this.$route.query.skip)),this.start()},async beforeMount(){this.$route.query.busca&&(this.busca=this.$route.query.busca),this.$route.query.page&&(this.query.page=parseInt(this.$route.query.page)),this.$route.query.limit&&(this.query.limit=parseInt(this.$route.query.limit)),this.$route.query.skip&&(this.query.skip=parseInt(this.$route.query.skip)),this.start()}};var n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"min-h-app",style:{backgroundColor:t.isDarkMode?"#151618":"#ffffff",color:t.isDarkMode?"#e8eaed":"#111827"}},[e("Navbar",{attrs:{page:"Titulares",link:"/requisicao",nameLink:"Requisição"}}),e("div",{staticClass:"mx-4 my-4 md:mx-8 md:my-8"},[t.$store.state.empresa?e("div",{staticClass:"flex flex-wrap gap-2 mb-4"},[e("Button",{attrs:{label:"Novo titular","icon-left":"plus-circle",size:"sm"},on:{click:function(a){return t.$router.push(`/cadastros/${t.route}/form`)}}}),e("a",{attrs:{href:`${t.url_api}/v1/${t.route}/exportar/${t.$store.state.empresa._id}?token=${t.$store.state.token}`,target:"_blank",rel:"noreferrer"}},[e("Button",{attrs:{label:"Exportar base",variant:"secondary","icon-left":"download-simple",size:"sm"}})],1),e("Button",{attrs:{label:"Importar base",variant:"secondary","icon-left":"upload-simple",size:"sm"}
1,on:{click:function(a){return t.$modal.show("importarModal")}}}),e("Button",{attrs:{label:"Excluir todos da base",variant:"danger","icon-left":"trash",size:"sm"},on:{click:t.excluirTodosDaBase}}),t.selecionados.length?e("Button",{attrs:{label:"Excluir selecionadas",variant:"danger","icon-left":"trash",size:"sm"},on:{click:t.excluirSelecionadas}}):t._e()],1):t._e(),e("div",{staticClass:"rounded-xl border p-4 mb-4",style:t.cardStyle},[e("div",{staticClass:"flex items-center gap-2 mb-3"},[e("Icon",{attrs:{name:"funnel",size:14}}),e("h3",{staticClass:"text-xs font-semibold uppercase tracking-wide",style:{color:t.isDarkMode?"#9aa0a6":"#535862"}},[t._v("Filtros")])],1),e("div",{staticClass:"grid grid-cols-1 md:grid-cols-12 gap-3 items-end"},[e("div",{staticClass:"md:col-span-10"},[e("TextInput",{attrs:{name:"busca",label:"Buscar",placeholder:"Filtrando Nome","icon-left":"magnifying-glass",size:"sm","custom-style":t.inputStyle},model:{value:t.busca,callback:function(a){t.busca=a},expression:"busca"}})],1),e("div",{staticClass:"md:col-span-2"},[e("Button",{attrs:{label:"Buscar","icon-left":"magnifying-glass",size:"sm","full-width":""},on:{click:t.updateFiltro}})],1)])]),e("div",{staticClass:"shadow overflow-x-auto sm:rounded-lg",style:{borderColor:t.isDarkMode?"#5f6368":"#e5e7eb"}},[e("table",{staticClass:"min-w-full divide-y",style:{borderColor:t.isDarkMode?"#5f6368":"#e5e7eb"}},[e("thead",{staticClass:"border-b",style:t.tableHeaderStyle},[e("tr",{staticClass:"text-left text-xs tracking-wider"},[e("th",{staticClass:"px-2 py-3 w-10"},[e("span",{staticClass:"inline-flex items-center justify-center w-6 h-6 rounded hover:bg-black/5 cursor-pointer",attrs:{title:"Selecionar todos"},on:{click:t.selecionarTodos}},[e("Icon",{attrs:{name:"check-square",size:16}})],1)]),e("th",{staticClass:"px-3 py-3"},[t._v("Primeiro e último nome")]),e("th",{staticClass:"px-3 py-3"},[t._v("3 últimos dígitos do CPF")]),t.$store.state.empresa?t._e():e("th",{staticClass:"px-3 py-3"},[t._v("Empresa")]),e("th",{staticClass:"px-3 py-3 text-right"},[t._v("Ações")])])]),e("tbody",{staticClass:"divide-y text-sm_2 text-left",style:{...t.tableBodyStyle,borderColor:t.tableBodyStyle.borderColor}},[t._l(t.list,function(a,o){return e("tr",{key:a._id,style:t.rowStyle(o)},[e("td",{staticClass:"px-2 py-3 align-top w-10"},[e("input",{staticClass:"rounded-sm",attrs:{type:"checkbox"},domProps:{checked:t.selecionados.map(i=>i._id).indexOf(a._id)>-1},on:{change:i=>t.selecionadosControl(a,i)}})]),e("td",{staticClass:"px-3 py-3 align-top text-sm font-medium",style:{color:t.isDarkMode?"#e8eaed":"#181D27"}},[t._v(" "+t._s(a.nome||"—")+" ")]),e("td",{staticClass:"px-3 py-3 align-top text-sm",style:{color:t.isDarkMode?"#9aa0a6":"#535862"}},[t._v(" "+t._s(a.cpf_cnpj||"—")+" ")]),t.$store.state.empresa?t._e():e("td",{staticClass:"px-3 py-3 align-top text-sm",style:{color:t.isDarkMode?"#9aa0a6":"#535862"}},[t._v(" "+t._s(a.empresa?a.empresa.nome:"—")+" ")]),e("td",{staticClass:"px-3 py-3 align-top"},[e("div",{staticClass:"flex gap-1 justify-end"},[e("Button",{staticClass:"w-[90px]",attrs:{label:"Editar","icon-left":"pencil-simple",size:"xs"},on:{click:function(i){return t.$router.push(`/cadastros/${t.route}/form/${a._id}`)}}}),e("Button",{staticClass:"w-[90px]",attrs:{label:"Excluir",variant:"danger","icon-left":"trash",size:"xs"},on:{click:function(i){return t.remove(a._id)}}})],1)])])}),t.list.length?t._e():e("tr",[e("td",{staticClass:"px-4 py-8 text-center text-sm",style:{color:t.isDarkMode?"#9aa0a6":"#A4A7AE"},attrs:{colspan:t.$store.state.empresa?4:5}},[t._v(" Nenhum titular encontrado. ")])])],2)])]),e("TablePagination",{attrs:{page:t.query.page,total:t.total},on:{"update:page":function(a){return t.$set(t.query,"page",a)},"change-per-page":t.updateFiltro,paginate:t.setPage},model:{value:t.perPage,callback:function(a){t.perPage=a},expression:"perPage"}}),e("modal",{attrs:{name:"importarModal",adaptive:!0,height:"auto"}},[e("div",{staticClass:"px-5 py-5",style:t.modalStyle},[e("h2",{staticClass:"text-xl font-bold mb-2",style:{color:t.modalStyle.color}},[t._v("Importar base")]),e("div",{staticClass:"grid grid-cols-12 gap-4"},[e("div",{staticClass:"col-span-12",style:{color:t.modalStyle.color}},[e("a",{staticClass:"text-sm underline",attrs:{target:"_blank",rel:"noreferrer",href:"/arquivo-modelo-titulares.xlsx"}},[t._v("Exemplo arquivo modelo importação")])]),e("div",{staticClass:"col-span-12"},[e("vue-dropzone",{ref:"doc",staticClass:"w-full",attrs:{id:"doc",options:t.dropzoneOptions},on:{"vdropzone-sending":t.send,"vdropzone-success":t.update}}
1)],1)])])])],1)],1)},u=[],d=r(c,n,u,!1,null,null);const h=d.exports;export{h 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.