1 line
18 KiB
JavaScript
1 line
18 KiB
JavaScript
import{i as Ue,r as p,o as qe,c as Fe,w as te,n as Ge,a as u,b as c,d as r,e as E,v as ze,u as s,f as U,F as q,g as F,t as G,h as xe,j as x,k as D,l as j,m as N,p as Ke,q as Qe,s as We,Y as Xe,x as Ye,y as je,V as $e}from"./vendor.38f224e0.js";(function(){const g=document.createElement("link").relList;if(g&&g.supports&&g.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))b(n);new MutationObserver(n=>{for(const h of n)if(h.type==="childList")for(const T of h.addedNodes)T.tagName==="LINK"&&T.rel==="modulepreload"&&b(T)}).observe(document,{childList:!0,subtree:!0});function o(n){const h={};return n.integrity&&(h.integrity=n.integrity),n.referrerpolicy&&(h.referrerPolicy=n.referrerpolicy),n.crossorigin==="use-credentials"?h.credentials="include":n.crossorigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function b(n){if(n.ep)return;n.ep=!0;const h=o(n);fetch(n.href,h)}})();function re(d,g){let o=-1;return d.forEach((b,n)=>{b.html.id===parseInt(g)&&(o=n)}),o}function Ie(d){try{return JSON.parse(d)}catch(g){return console.log("erreur recupJson ",g),!1}}function Ze(d,g){let o=document.createElement("a");o.href=d,g&&o.setAttribute("target","_blank"),o.click()}function et(d,g){if((Number.isInteger(d)||parseInt(d)==d)&&(Number.isInteger(g)||parseInt(g)==g))return parseInt(d)-parseInt(g);{let o=toString(d).toLowerCase(),b=toString(g).toLowerCase();return o<b?-1:o>b?1:0}}const Oe=(d,g,o,b)=>d.sort((n,h)=>g.reduce((T,w,A)=>{if(T===0){let[_,C]=o&&o[A]==="desc"?[h[b][w],n[b][w]]:[n[b][w],h[b][w]];_=typeof _=="string"?_.toLowerCase():_,C=typeof C=="string"?C.toLowerCase():C;let P=/^(\d{2})\/(\d{2})\/(\d{2,4})$/;if(typeof _!="number"){let I=_.match(P);Array.isArray(I)&&(_=I[3]+I[2]+I[1]);let m=C.match(P);Array.isArray(m)&&(C=m[3]+m[2]+m[1])}T=_>C?1:_<C?-1:0}return T},0)),tt={class:"gamutable"},lt={class:"gamutable--surTable"},at=r("i",{class:"fa fas fa-eraser rouge"},null,-1),st=r("i",{class:"fa fa-filter fas"},null,-1),nt=[at,st],ot=r("i",{class:"fa fa-refresh fas fa-sync"},null,-1),rt=[ot],it=r("i",{class:"fas fa fa-table"},null,-1),ut=[it],ct=r("i",{class:"fas fa fa-th-large"},null,-1),ft=[ct],dt=r("i",{class:"fa fa-file-excel-o fas fa-file-csv","aria-hidden":"true"},null,-1),pt=[dt],vt=r("i",{class:"fas fa-file-pdf rouge","aria-hidden":"true",alt:"pdf"},null,-1),ht=[vt],gt=r("i",{class:"fas fas fa-file-excel","aria-hidden":"true",alt:"csv"},null,-1),mt=[gt],bt=r("i",{class:"far fa-file-pdf rouge","aria-hidden":"true",alt:"pdf"},null,-1),_t=[bt],yt={class:"rouge"},Ct=r("i",{class:"fa fa-refresh fa-spin fa-fw rouge fas fa-sync fa-spin"},null,-1),kt=r("span",{class:"texteMajBDD"}," Mise \xE0 jour de la base de donn\xE9e ",-1),St=[Ct,kt],xt={class:"btn verte",style:{cursor:"auto"},title:"Base de donn\xE9e synchronis\xE9e !"},jt=r("i",{class:"fa fas fa-database"},null,-1),$t=[jt],It=["data-nbrmax"],Ot=["innerHTML"],Lt={key:0,class:"vueBlocs"},Tt=["innerHTML"],Vt={key:1,class:"table table--zebra"},Et={class:"gt_labels"},wt=["innerHTML"],Pt={class:"iconeTri"},Mt=["onClick"],Jt=["onClick"],At={key:0,class:"filtreColonne"},Bt=["id"],Dt=["onClick"],Nt=["onClick"],Rt=r("i",{class:"fas fa-share-square"},null,-1),Ht=[Rt],Ut=["id"],qt={class:"tag--un"},Ft=["onClick"],Gt=["onUpdate:modelValue"],zt=["onClick"],Kt=["onClick"],Qt={key:0},Wt={key:0,class:"text-center"},Xt=["onUpdate:modelValue","value"],Yt=["innerHTML"],Zt=["innerHTML"],el={class:"gamutable--sousTable"},tl={class:"gamutable-nbrMax"},ll={class:"gamutable--pagination"},al={class:"page-item"},sl={class:"page-item"},nl=["onClick"],ol={class:"page-item"},rl={__name:"gamuTable",props:{tparpage:{type:Array,default:function(){return[10,20,50,"Tous"]}},afficher:{type:Number},trier:{type:String},apiuri:{type:String,required:!0},pdfuri:{type:String},namepdf:{type:String},fichierpdf:{type:String},argpdf:{type:String},champcsv:{type:String},delimitercsv:{type:String},namecsv:{type:String},url_sort_asc:{type:String},url_sort_desc:{type:String},urlvuebloc:{type:String},vueblocdefaut:{type:String,default:"tableau"},filtrecolmulti:{type:String},nomblocajaxreload:{type:String},stockage:{type:String},includespip:{type:String},filtrer:{type:String},_id:{type:Number},filtreselect:{type:String}},setup(d,{expose:g}){const o=d,b=Ue("$papa");let n=p([]),h=p([]),T=p([]),w=p([]),A=p([]),_=p([]),C=p([]),P=p([]),I=p([]),m=p({}),ie=p(0),ue=p({}),z=p(o.filtrer),v=p(1),B=p(sessionStorage.getItem("nbItems")?sessionStorage.getItem("nbItems"):o.tparpage[0]),R=p(sessionStorage.getItem("nbItemsChaine")?sessionStorage.getItem("nbItemsChaine"):o.tparpage[0]),H=p([]),K=p([]),W=p([]),le=p([]),V=p("html"),ae=p(!0),X=p(o.vueblocdefaut),se=p(!1),ne=p(!0),ce=p(!1),oe=p(""),fe=o.afficher,de=o.trier,O=Pe();qe(()=>{localforage.setDriver(localforage[o.stockage.toUpperCase()]),Y("maj"),o.urlvuebloc&&fetch(o.urlvuebloc).then(l=>l.text()).then(l=>{se.value=l})});const J=Fe(()=>{if(Ne(),!z.value&&!ie.value)return Se(n.value);let l=n.value.filter(t=>{let e=!(Object.values(t[V.value]).toString().toLowerCase().indexOf(z.value.toLowerCase())<0);return e?(Object.keys(m.value).forEach(a=>{if(e){let i=m.value[a];if(i!==null){Array.isArray(i)||(i=[i]);let f=[];i.forEach(k=>{Number.isInteger(k)&&f.push(k),k.length>0&&f.push(k.toLowerCase())}),f.length&&(I.value[a]==="select"?f.some(L=>{if(Number.isInteger(L)){if(parseInt(t[V.value][a])===L)return!0}else if(t[V.value][a]!==void 0&&!(L.indexOf(t[V.value][a].toString().toLowerCase().toString())===-1||!t[V.value][a].toString().toLowerCase()))return!0})||(e=!1):t[V.value][a].toString().toLowerCase().indexOf(f.toString())===-1&&(e=!1))}}}),e):!1});return Se(l)});te(m,()=>{Z()}),te(R,l=>{parseInt(l)?B.value=l:B.value=n.value.length,sessionStorage.setItem("nbItems",B.value),sessionStorage.setItem("nbItemsChaine",R.value)}),te(n,()=>{Z(),localforage.setItem(O,JSON.stringify(n.value))}),te(J,()=>{o.filtrecolmulti==="non"&&P.value.forEach(l=>{let t=[];J.value.forEach(e=>{let a=e[V.value][l];t.indexOf(a)===-1&&(t.push(a),filtreColValOk.value=!0)}),ue.value[l]=t})}),te(m,()=>{if(!ne.value){let l=[];m.value&&Object.entries(m.value).forEach(([t,e])=>{Array.isArray(e)||(e=[e]),l.push({champ:t,valeurs:e})}),ce||localStorage.setItem("filtreselect_"+O,JSON.stringify(l))}});function ge(l){h.value=l.header,l.crayons!==void 0&&(T.value=l.crayons),l.maj!==void 0&&(oe.value=l.maj),l.classes!==void 0&&(w.value=l.classes),l.checkbox!==void 0&&(A.value=l.checkbox,Object.keys(A.value).forEach(e=>{_.value[e]=[]})),l.ordreCol!==void 0&&(C.value=l.ordreCol);let t=[];return l.filtreCol!==void 0&&(t=l.filtreCol),Z(),t}function Te(l,t=null){if(parseInt(t)>0)if(l.length>0){let e=re(n.value,t);n.value[e]=l[0]}else{let e=re(n.value,t);n.value.splice(e,1)}else t==="maj"?l.length&&(l[0]&&l[0].search&&(V.value="search"),l.length>0&&l.forEach((e,a)=>{let i=re(n.value,e.html.id);i>=0?n.value[i]=l[a]:n.value.unshift(l[a])})):(n.value=l,l[0]&&l[0].search&&(V.value="search"));localforage.setItem(O,JSON.stringify(n.value))}function me(l){l!==void 0&&(I.value=l,P.value=[],Object.keys(I.value).forEach(t=>{let e=[];n.value.forEach(a=>{let i=a[V.value][t];i&&e.indexOf(i)===-1&&e.push(i)}),P.value.push(t),ue.value[t]=e.sort(),m.value[t]=[]}))}function Ve(l){l.a_supprimer&&l.a_supprimer.forEach(t=>{let e=re(n.value,t);e!==-1&&n.value.splice(e,1)})}function Y(l){console.log("chargerJson pour ",l),ae.value=!0;let t=o.apiuri;if(parseInt(l)>0)t+="&id="+l;else{let e=localStorage.getItem("header_"+O);e=Ie(e),e&&e.header!==void 0&&n.value.length===0&&(console.log("charge LS"),localforage.getItem(O).then(function(a){a=Ie(a);let i=ge(e);n.value=a,me(i),o.nomblocajaxreload&&ajaxReload(o.nomblocajaxreload)}).catch(function(a){console.log(a)})),l==="maj"&&(oe.value?t+="&maj="+oe.value:e&&e.maj?t+="&maj="+e.maj:l=null)}fetch(t).then(e=>e.json()).then(e=>{let a=e.shift();Ve(a);let i=ge(a);Te(e,l),me(i),Ge(()=>{ae.value=!1;const f=localStorage.getItem("filtreselect_"+O),k=localStorage.getItem("triCol_"+O);let L=[];if(o.filtreselect?(o.filtreselect.split(",").forEach(y=>{const[S,...M]=y.split("|"),Q=L.findIndex(ve=>ve.champ===S);Q===-1?L.push({champ:S,valeurs:M}):L[Q].valeurs.push(M[0])}),localStorage.setItem("filtreselect_"+O,JSON.stringify(L))):f&&(L=JSON.parse(f)),L.forEach(y=>{P.value.includes(y.champ)&&(m.value[y.champ]=[...m.value[y.champ],...y.valeurs])}),ie.value++,ce=!1,fe&&o.tparpage.includes(fe)&&(R.value=fe),de?(de.split(",").forEach(y=>{const[S,M]=y.split("|");P.value.includes(S)&&ee(S,M)}),localStorage.setItem("triCol_"+O,de)):k&&k.split(",").forEach(y=>{const[S,M]=y.split("|");P.value.includes(S)&&ee(S,M)}),parseInt(o._id)>0){let y=parseInt(o._id),S=parseInt(B.value);if(parseInt(S)){let M=0;if(Object.values(n.value).forEach((Q,ve)=>{y===Q.html.id&&(M=ve+1)}),M>S){let Q=parseInt(M/S)+1;v.value=Q}}_e(y,"id")}o.nomblocajaxreload&&ajaxReload(o.nomblocajaxreload),C.value&&Object.entries(C.value).forEach(([y,S])=>{ee(y,S)}),$("td.crayon-init").removeClass("crayon-init")})}).catch(e=>console.log(e))}function Z(){let l={header:h.value,crayons:T.value,classes:w.value,filtreCol:I.value,ordreCol:C.value,maj:oe.value};localStorage.setItem("header_"+O,JSON.stringify(l))}function Ee(l){ne.value=!1,m.value[l]=[],Z()}function we(){ie.value++}function pe(){ne.value=!1}function Pe(){return o.apiuri?o.apiuri.match(/.*page=(.*)/)[1]:""}function Me(l,t){let e=t.crayons!==void 0&&t.crayons[l]!==void 0?t.crayons[l]:t.html.id;if(Object.keys(T.value).indexOf(l)!==-1)return`crayon ${T.value[l]}-${l}-${e}`}function ee(l,t=!1){const e=W.value.indexOf(l);e!==-1?(t||(t="asc",K.value[e]==="asc"&&(t="desc")),K.value[e]=t):(t||(t="asc"),W.value.push(l),K.value.push(t)),n.value=Oe(n.value,W.value,K.value,V.value),C.value[l]=t,Z()}function be(l,t){const e=W.value.indexOf(l);if(e!==-1&&K.value[e]===t)return"active"}function Je(){ne.value=!1,n.value=Oe(n.value,["id"],"",V.value),K.value=[],W.value=[],C.value=[],Object.keys(I.value).forEach(l=>{m.value[l]=[]}),localStorage.removeItem("filtreselect_"+O),localStorage.removeItem("filtreCol_"+O),localStorage.removeItem("triCol_"+O)}function _e(l,t){if(t==="id"&&parseInt(l)){let e=le.value.indexOf(l);e!==-1?le.value.splice(e,1):le.value.push(l)}}function ye(l="tableau"){let t=[],e=J.value;l==="table"&&(e=n.value),Object.values(e).forEach(f=>{t.push(f.html)});const a={fichierpdf:o.fichierpdf,namepdf:o.namepdf,header:h.value,arg:o.argpdf,Tdata:t};$.ajax({url:o.pdfuri,type:"POST",dataType:"text",data:a}).done(function(f){f&&Ze(f,!0)})}function Ce(l="tableau"){let t=[],e=[],a=[],i=J.value;l==="table"&&(i=n.value),Object.keys(h.value).forEach(f=>e.push(f)),a=i.reduce((f,k)=>{let L=[];return Object.values(k[o.champcsv]).forEach(y=>L.push(y)),[...f,[...L]]},[]),t=[[...e],...a],Re(t,o.delimitercsv,o.namecsv)}function Ae(l){let t=se.value;return Object.keys(l).forEach(e=>{t=t.replace(`@@${e}@@`,l[e])}),t}function ke(l){X.value=l}function Be(l){_.value[l]!==void 0&&_.value[l].length?_.value[l]=[]:(_.value[l]=[],J.value.forEach(t=>{_.value[l].push(t.html.id)}))}function De(l,t){let e="page";if(t.includes("action=")&&(e="action"),e==="action")$.ajax({url:t,data:{data:_.value[l]},type:"POST"}).done(function(){Y("maj")});else{const a=encodeURIComponent(JSON.stringify(_.value[l]));t+="&data="+a,t+="&var_zajax=content";const i={};i.onClose=()=>{Y("maj")},$.modalbox(t,i)}}function Se(l){let t=v.value*B.value-B.value,e=v.value*B.value;return l.slice(t,e)}function Ne(){let l=Math.ceil(n.value.length/B.value);H.value=[];for(let t=1;t<=l;t++)H.value.push(t)}function Re(l,t,e){e.includes(".csv")&&(e=e.split(".")[0]);let a="";t?a=b.unparse(l,{delimiter:t}):a=b.unparse(l),b.download(a,e)}function He(l,t=!0){console.log("rechargerJson"),ce=t,Y(l)}return g({rechargerJson:He}),(l,t)=>(u(),c("div",tt,[r("div",lt,[E(r("select",{id:"parPage","onUpdate:modelValue":t[0]||(t[0]=e=>U(R)?R.value=e:R=e)},[(u(!0),c(q,null,F(d.tparpage,e=>(u(),c("option",{key:e},G(e),1))),128))],512),[[ze,s(R)]]),E(r("input",{class:"gamutable--rechercher",type:"text","onUpdate:modelValue":t[1]||(t[1]=e=>U(z)?z.value=e:z=e),placeholder:"Rechercher"},null,512),[[xe,s(z)]]),r("button",{class:"btn gamutable--resetOrderBy",type:"button",onClick:t[2]||(t[2]=x(e=>Je(),["stop"])),title:"R\xE9initialiser les tris des colonnes"},nt),r("button",{class:"btn var_gamutable",type:"button",onClick:t[3]||(t[3]=x(e=>Y(),["stop"])),title:"Forcer le rechargement"},rt),s(se)?E((u(),c("button",{key:0,class:"btn gamutable--vueTable",title:"Switcher en Vue tableau",onClick:t[4]||(t[4]=x(e=>ke("tableau"),["stop"]))},ut,512)),[[D,s(X)==="bloc"]]):j("",!0),s(se)?E((u(),c("button",{key:1,class:"btn gamutable--vueBloc",title:"Switcher en Vue Bloc",onClick:t[5]||(t[5]=x(e=>ke("bloc"),["stop"]))},ft,512)),[[D,s(X)==="tableau"]]):j("",!0),E(r("button",{class:"btn gamutable--exportCSV",type:"button",onClick:t[6]||(t[6]=x(e=>Ce(),["stop"])),title:"Exporter le tableau affich\xE9 en csv"},pt,512),[[D,d.namecsv]]),E(r("button",{class:"btn",type:"button",onClick:t[7]||(t[7]=x(e=>ye(),["stop"])),title:"G\xE9n\xE9rer le PDF du tableau affich\xE9"},ht,512),[[D,d.fichierpdf]]),E(r("button",{class:"btn gamutable--exportCSV",type:"button",onClick:t[8]||(t[8]=x(e=>Ce("table"),["stop"])),title:"Exporter le tableau complet en csv"},mt,512),[[D,d.namecsv]]),E(r("button",{class:"btn",type:"button",onClick:t[9]||(t[9]=x(e=>ye("table"),["stop"])),title:"G\xE9n\xE9rer le PDF du tableau complet"},_t,512),[[D,d.fichierpdf]]),E(r("span",yt,St,512),[[D,s(ae)]]),E(r("span",xt,$t,512),[[D,!s(ae)]]),r("span",{class:"gamutable-nbrMax","data-nbrmax":s(n).length},G(s(J).length)+" / "+G(s(n).length)+" \xE9l\xE9ments",9,It),r("span",{class:"includespip",innerHTML:d.includespip},null,8,Ot)]),s(X)==="bloc"?(u(),c("div",Lt,[(u(!0),c(q,null,F(s(J),e=>(u(),c("div",{class:"vueBlocs-unbloc",key:e.id,innerHTML:Ae(e.html)},null,8,Tt))),128))])):j("",!0),s(X)==="tableau"?(u(),c("table",Vt,[r("thead",null,[r("tr",null,[(u(!0),c(q,null,F(s(h),(e,a,i)=>(u(),c("th",{key:"head_"+i,class:N([a,s(w)[a]])},[r("span",Et,[r("span",{innerHTML:e},null,8,wt),r("span",Pt,[r("i",{class:N(["fa fa-sort-asc fa-sort-up",be(a,"asc")]),"aria-hidden":"true",onClick:x(f=>ee(a,"asc"),["stop"])},null,10,Mt),r("i",{class:N(["fa fa-sort-desc fa-sort-down",be(a,"desc")]),"aria-hidden":"true",onClick:x(f=>ee(a,"desc"),["stop"])},null,10,Jt)])])],2))),128))]),s(P).length||Object.keys(s(A)).length?(u(),c("tr",At,[(u(!0),c(q,null,F(s(h),(e,a,i)=>(u(),c("th",{key:"filtreCol_"+i},[s(A)[a]!==void 0?(u(),c("div",{key:0,id:"filtreCol_"+a,class:N([s(w)[a],"flex justify-between"])},[r("input",{class:"ml-2",type:"checkbox",onClick:x(f=>Be(a),["stop"])},null,8,Dt),r("button",{onClick:x(f=>De(a,s(A)[a]),["stop"])},Ht,8,Nt)],10,Bt)):j("",!0),s(P).indexOf(a)!==-1?(u(),c("div",{key:1,id:"filtreCol_"+a,class:N(s(w)[a])},[s(I)[a]==="select"?(u(),Ke(s(Xe),{key:0,modelValue:s(m)[a],"onUpdate:modelValue":f=>s(m)[a]=f,options:s(ue)[a].sort(s(et)),"hide-selected":"",multiple:"",taggable:"","close-on-select":"","clear-on-close":"",searchable:"",onSelected:we,"onSearch:focus":pe,onRemoved:pe},{tag:Qe(({option:f,remove:k})=>[r("div",qt,[We(G(f)+" ",1),r("span",{class:"tag--remove pointer",title:"Cliquer pour supprimer ",onClick:x(k,["stop"])},"x",8,Ft)])]),_:2},1032,["modelValue","onUpdate:modelValue","options"])):j("",!0),s(I)[a]==="input"?E((u(),c("input",{key:1,class:"gamutable__input--filtrer","onUpdate:modelValue":f=>s(m)[a]=f,type:"text",placeholder:"Rechercher",onKeydown:pe},null,40,Gt)),[[xe,s(m)[a]]]):j("",!0),s(I)[a]==="input"&&s(m)[a].length!==0?(u(),c("button",{key:2,onClick:x(f=>Ee(a),["stop"]),title:"Vider ce champ",class:"gamutable__input--filtrer"}," X ",8,zt)):j("",!0)],10,Ut)):j("",!0)]))),128))])):j("",!0)]),r("tbody",null,[(u(!0),c(q,null,F(s(J),e=>(u(),c("tr",{key:e.html.id,class:N(s(le).indexOf(e.html.id)!==-1?"select":"")},[(u(!0),c(q,null,F(e.html,(a,i,f)=>(u(),c("td",{key:"td_"+f,class:N([Me(i,e),i,s(w)[i],e.classes!==void 0?e.classes[i]:""]),onClick:k=>_e(e.html.id,i)},[s(A)[i]!==void 0?(u(),c("div",Qt,[a.split("-")[0]==="dataid"?(u(),c("div",Wt,[r("label",null,[E(r("input",{type:"checkbox","onUpdate:modelValue":k=>s(_)[i]=k,value:a.split("-")[1]},null,8,Xt),[[Ye,s(_)[i]]])])])):(u(),c("div",{key:1,innerHTML:a},null,8,Yt))])):(u(),c("div",{key:1,innerHTML:a},null,8,Zt))],10,Kt))),128))],2))),128))])])):j("",!0),r("div",el,[r("div",tl,G(s(J).length)+" / "+G(s(n).length)+" \xE9l\xE9ments ",1),r("div",ll,[r("div",al,[s(v)!=1?(u(),c("button",{key:0,type:"button",class:"page-link",onClick:t[10]||(t[10]=e=>U(v)?v.value=1:v=1)}," Premier ")):j("",!0),s(v)!=1?(u(),c("button",{key:1,type:"button",class:"page-link",onClick:t[11]||(t[11]=e=>U(v)?v.value--:v--)}," Pr\xE9c\xE9dent ")):j("",!0)]),r("div",sl,[(u(!0),c(q,null,F(s(H).slice(s(v)-4<0?0:s(v)-4,s(v)+3),e=>(u(),c("button",{type:"button",class:N(["page-link",{on:e===s(v)}]),onClick:a=>U(v)?v.value=e:v=e},G(e),11,nl))),256))]),r("div",ol,[s(v)<s(H).length?(u(),c("button",{key:0,type:"button",onClick:t[12]||(t[12]=e=>U(v)?v.value++:v++),class:"page-link"}," Suivant ")):j("",!0),s(v)<s(H).length?(u(),c("button",{key:1,type:"button",onClick:t[13]||(t[13]=e=>U(v)?v.value=s(H).length:v=s(H).length),class:"page-link"}," Dernier ")):j("",!0)])])])]))}},Le={GamuTable:rl};let he=1;for(const d of document.getElementsByClassName("vue-gamutable"))he===1?(window.app=je({components:Le,mounted(){app.rechargerJson=this.$refs.montableau.rechargerJson}}),app.use($e),app.provide("$papa",app.config.globalProperties.$papa),app.mount(d)):he===2&&(window.app_deux=je({components:Le,mounted(){app_deux.rechargerJson=this.$refs.montableau_deux.rechargerJson}}),app_deux.use($e),app_deux.provide("$papa",app_deux.config.globalProperties.$papa),app_deux.mount(d)),he++;$("#vueGamutable").on("click",".url_action",function(d){console.log("coucou"),d.preventDefault(),d.stopPropagation();let g=$(this).data("confirm");if(g!==void 0&&!confirm(g))return;let o=$(this).attr("href"),b=$(this).data("id");$(this).has("i.icon, i.fa")&&$(this).find("i.icon, i.fa").eq(0).replaceWith('<i class="fa fa-refresh fa-spin"></i>');let n=$(this).data("ajaxreload");console.time("Chargement de VueJs APRES Ajax"),$.ajax({url:o,dataType:"json",async:!0}).done(function(h){!$.isEmptyObject(h)&&!$.isEmptyObject(h.message_erreur)?alert(h.message_erreur):(parseInt(b)>0?app.rechargerJson(b):app.rechargerJson("maj"),n!==void 0&&(console.log("depart reload: "+n),ajaxReload(n,{args:{id:b},callback:function(){}})))})});
|