diff --git a/src/components/Preview.vue b/src/components/Preview.vue index 098aa7c..95749f5 100644 --- a/src/components/Preview.vue +++ b/src/components/Preview.vue @@ -6,7 +6,13 @@ transition="dialog-bottom-transition" scrollable > - +
+ +
+ @@ -221,11 +221,19 @@ v-model="detailsModal" max-width="600px" :fullscreen="$vuetify.breakpoint.mobile"> - +
+ +
+ - Détails et actions sur l'association {{ toSeeItem.adminName }} + Détails sur "{{ toSeeItem.adminName }}" - + @@ -246,16 +254,18 @@ - - - - label - - - {{ toSeeItem._id }} - Identifiant base de donnée - - + @@ -330,6 +340,7 @@ :id="toApproveItem._id" :slug="toApproveItem.slugs[0]" :dialogTitle="approveModalTitle" + :loading="fetchOneLoading" @close="approveModal = false" > @@ -347,7 +358,7 @@
- + Comparaison des deux versions
Indiquez la raison de ce refus - + { - if (data != null) { - this.$router.push({ query: {} }) - this.openApproveModal(data) - } - }) + this.$router.push({ query: {} }) + this.openApproveModal(this.$route.query.approval) + // this.fetchOne(this.$route.query.approval).then((data) => { + // if (data != null) { + // this.$router.push({ query: {} }) + // this.openApproveModal(data) + // } + // }) } }, methods: { fetchOne (id) { + let charged = false + setTimeout(() => { + if (!charged) { + this.fetchOneLoading = true + } + }, 300) return new Promise(resolve => { this.$apitator.get('/admin/organizations/' + id, { withAuth: true }).then(res => { + charged = true + this.fetchOneLoading = false resolve(res.data.data) }) }) }, fetchData () { - this.isLoading = true + this.tableLoading = true let params = {} if (this.options != null) { params = { @@ -542,7 +564,7 @@ export default { }).then(res => { this.organizations = res.data.data.docs this.totalCount = res.data.data.totalDocs - this.isLoading = false + this.tableLoading = false }) }, @@ -572,8 +594,11 @@ export default { }, openDetailsModal (item) { - this.toSeeItem = item this.detailsModal = true + this.toSeeItem = null + this.fetchOne(item._id).then(data => { + this.toSeeItem = data + }) }, close () { @@ -671,15 +696,20 @@ export default { }, openPanel (item) { - const routeData = this.$router.resolve({ name: 'DelegateMain', query: { delegateToken: item.token } }) + const routeData = this.$router.resolve({ + name: 'DelegateMain', + query: { delegateToken: item.token } + }) window.open(routeData.href, '_blank').focus() }, - openApproveModal (item) { - this.$refs.preview.reload() + openApproveModal (itemId) { this.approveModal = true - this.toApproveItem = item - this.approved = false + this.fetchOne(itemId).then((data) => { + this.$refs.preview.reload() + this.toApproveItem = data + this.approved = false + }) }, approve () { @@ -843,6 +873,11 @@ export default {