Doleancer.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <script>
  2. import { mapActions, mapState } from 'pinia'
  3. import { ConcernementsStore } from '@stores/concernements'
  4. import { UserStore } from '@/stores/user'
  5. import { CommonStore } from '@/stores/common'
  6. import CartoucheLayout from '@components/layout/CartoucheLayout.vue';
  7. import SvgIcon from '@jamescoyle/vue-icon';
  8. import { mdiArrowLeft } from '@mdi/js';
  9. import { mdiArrowRight } from '@mdi/js';
  10. export default {
  11. props: ['cid'],
  12. data(){
  13. return {
  14. doleance: null,
  15. doleance_selected: null,
  16. doleance_index: null,
  17. arrowleft_path: mdiArrowLeft,
  18. arrowright_path: mdiArrowRight
  19. }
  20. },
  21. computed: {
  22. ...mapState(ConcernementsStore,['map_mode',
  23. 'opened_concernement',
  24. 'concernementsByID',
  25. 'concernements_loaded',
  26. 'ct_concernement',
  27. 'ct_cercle_politique',
  28. 'p_groupes_interets',
  29. 'p_reception_et_traitement',
  30. 'p_mise_en_oeuvre_decision',
  31. 'p_reception_application_decision'
  32. ]),
  33. ...mapState(CommonStore,['hover_elmt'])
  34. },
  35. created () {
  36. this.concernement = this.concernementsByID[this.cid];
  37. console.log(`Doleancer content created, id: ${this.cid}, doleances:`,this.concernement.doleances);
  38. this.concernement.doleances.forEach((doleance, index) => {
  39. if (doleance.id === this.concernement.opened_doleance.id) {
  40. this.doleance = doleance;
  41. this.doleance_index = index;
  42. }
  43. });
  44. },
  45. mounted() {
  46. if (this.doleance_index > 0)
  47. this.$refs.prevDoleanceBTN.classList.add('visible');
  48. if (this.doleance_index < this.concernement.doleances.length-1)
  49. this.$refs.nextDoleanceBTN.classList.add('visible');
  50. },
  51. unmounted() {
  52. this.setOpenedDoleance(parseInt(this.cid), this.concernement.doleances[0].id);
  53. },
  54. methods: {
  55. ...mapActions(ConcernementsStore,['setOpenedDoleance']),
  56. nextDoleance(){
  57. this.doleance_index ++;
  58. this.$refs.prevDoleanceBTN.classList.add('animeleft');
  59. this.$refs.nextDoleanceBTN.classList.add('animeleft');
  60. this.openDoleance();
  61. },
  62. prevDoleance(){
  63. this.doleance_index --;
  64. this.$refs.prevDoleanceBTN.classList.add('animeright');
  65. this.$refs.nextDoleanceBTN.classList.add('animeright');
  66. this.openDoleance()
  67. },
  68. openDoleance(){
  69. console.log('openDoleance');
  70. this.doleance = this.concernement.doleances[this.doleance_index];
  71. this.setOpenedDoleance(parseInt(this.cid), this.doleance.id);
  72. setTimeout((function(that){
  73. return function(){
  74. console.log('doleance anime end', that);
  75. that.$refs.prevDoleanceBTN.classList.remove('animeleft', 'animeright');
  76. that.$refs.prevDoleanceBTN.classList.toggle('visible', that.doleance_index > 0);
  77. that.$refs.nextDoleanceBTN.classList.remove('animeleft', 'animeright');
  78. that.$refs.nextDoleanceBTN.classList.toggle('visible', that.doleance_index < that.concernement.doleances.length-1);
  79. };
  80. }(this)), 2000)
  81. }
  82. },
  83. components: {
  84. CartoucheLayout,
  85. SvgIcon
  86. }
  87. }
  88. </script>
  89. <template>
  90. <CartoucheLayout :cid="cid">
  91. <template v-slot:header>
  92. <div class="pre-header">
  93. </div>
  94. </template>
  95. <template v-slot:main>
  96. <section
  97. class="content-doleances">
  98. <template v-if="opened_concernement.opened_doleance.id === doleance.id">
  99. <h3 class="doleance-title">{{ doleance.title }}</h3>
  100. <section
  101. v-if="opened_concernement.opened_doleance.field === 'leprobleme' || !opened_concernement.opened_doleance.field">
  102. <span class="date">{{ doleance.date_leprobleme.start }}</span>
  103. <h5>{{ ct_cercle_politique.field_le_probleme.label }}</h5>
  104. <h4 name="leprobleme">{{ doleance.leprobleme }}</h4>
  105. </section>
  106. <section
  107. v-if="opened_concernement.opened_doleance.field === 'lenquete'"
  108. class="lenquete">
  109. <h5>{{ ct_cercle_politique.field_enquete_terraindevie.label }}</h5>
  110. <!-- <label for="lenquete">{{ ct_cercle_politique.field_enquete_terraindevie.label }}</label> -->
  111. <h4 name="lenquete">{{ doleance.lenquete }}</h4>
  112. </section>
  113. <section
  114. v-if="opened_concernement.opened_doleance.field === 'groupesinterets'"
  115. class="groupesinterets">
  116. <span class="date">
  117. {{ doleance.groupesinterets[opened_concernement.opened_doleance.field_index].date.start }}
  118. &#x2192;
  119. {{ doleance.groupesinterets[opened_concernement.opened_doleance.field_index].date.end }}
  120. </span>
  121. <h5>Construction de groupes d'intérets avec qui composer la doléance</h5>
  122. <section>
  123. <label for="groupe">{{ p_groupes_interets.field_groupe_interets.label }}</label>
  124. <p
  125. name="groupe"
  126. v-html="doleance.groupesinterets[opened_concernement.opened_doleance.field_index].groupe_interets" />
  127. <label for="accorder">{{ p_groupes_interets.field_accorder_interets.label }}</label>
  128. <p
  129. name="accorder"
  130. v-html="doleance.groupesinterets[opened_concernement.opened_doleance.field_index].accorder_interets" />
  131. <label for="formuler">{{ p_groupes_interets.field_formuler.label }}</label>
  132. <p
  133. name="formuler"
  134. v-html="doleance.groupesinterets[opened_concernement.opened_doleance.field_index].formuler" />
  135. </section>
  136. </section>
  137. <section
  138. v-if="opened_concernement.opened_doleance.field === 'adresse_de_la_doleance'"
  139. class="adresse">
  140. <span class="date">{{ doleance.date_adresse.start }}</span>
  141. <h5>Adresse de la doléance</h5>
  142. <label for="entite_addresse_doleance">{{ ct_cercle_politique.field_entite_adresse_doleance.label }}</label>
  143. <p
  144. name="entite_addresse_doleance"
  145. v-html="doleance.entite_addresse_doleance" />
  146. <label for="comment_ennonce_doleance">{{ ct_cercle_politique.field_comment_enonce_doleance.label }}</label>
  147. <p
  148. name="comment_ennonce_doleance"
  149. v-html="doleance.comment_ennonce_doleance" />
  150. <label for="aqui_addresse_doleance">{{ ct_cercle_politique.field_a_qui_adresse_doleance.label }}</label>
  151. <p
  152. name="aqui_addresse_doleance"
  153. v-html="doleance.aqui_addresse_doleance" />
  154. </section>
  155. <section
  156. v-if="opened_concernement.opened_doleance.field === 'reception_traitement'"
  157. class="reception_traitement">
  158. <span class="date">
  159. {{ doleance.reception_traitement[opened_concernement.opened_doleance.field_index].date.start }}
  160. &#x2192;
  161. {{ doleance.reception_traitement[opened_concernement.opened_doleance.field_index].date.end }}
  162. </span>
  163. <h5>Reception et traitement de la doléance</h5>
  164. <label for="entite_adressee">{{ p_reception_et_traitement.field_entite_adressee.label }}</label>
  165. <p
  166. name="entite_adressee"
  167. v-html="doleance.reception_traitement[opened_concernement.opened_doleance.field_index].entite_adressee" />
  168. <label for="doleance_formulee">{{ p_reception_et_traitement.field_doleance_formulee.label }}</label>
  169. <p
  170. name="doleance_formulee"
  171. v-html="doleance.reception_traitement[opened_concernement.opened_doleance.field_index].doleance_formulee" />
  172. <label for="traite_doleance">{{ p_reception_et_traitement.field_traite_doleance.label }}</label>
  173. <p
  174. name="traite_doleance"
  175. v-html="doleance.reception_traitement[opened_concernement.opened_doleance.field_index].traite_doleance" />
  176. <label for="entite_recoit_doleance">{{ p_reception_et_traitement.field_entite_recoit_doleance.label }}</label>
  177. <p
  178. name="entite_recoit_doleance"
  179. v-html="doleance.reception_traitement[opened_concernement.opened_doleance.field_index].entite_recoit_doleance" />
  180. </section>
  181. <section
  182. v-if="opened_concernement.opened_doleance.field === 'decision'"
  183. class="decision">
  184. <span class="date">{{ doleance.date_decision.start }}</span>
  185. <h5>Décision</h5>
  186. <label for="entites_decisionnaires">{{ ct_cercle_politique.field_entites_decisionnaires.label }}</label>
  187. <p name="entites_decisionnaires" v-html="doleance.entites_decisionnaires" />
  188. <label for="decision_formule">{{ ct_cercle_politique.field_decision_formulee.label }}</label>
  189. <p name="decision_formule" v-html="doleance.decision_formule" />
  190. </section>
  191. <section
  192. v-if="opened_concernement.opened_doleance.field === 'mise_en_oeuvre_decision'"
  193. class="mise_en_oeuvre_decision">
  194. <span class="date">
  195. {{ doleance.mise_en_oeuvre_decision[opened_concernement.opened_doleance.field_index].date.start }}
  196. &#x2192;
  197. {{ doleance.mise_en_oeuvre_decision[opened_concernement.opened_doleance.field_index].date.end }}
  198. </span>
  199. <h5>{{ ct_cercle_politique.field_mise_en_oeuvre_decision.label }}</h5>
  200. <label for="entite_adresse_decision">{{ p_mise_en_oeuvre_decision.field_entite_adresse_decision.label }}</label>
  201. <p
  202. name="entite_adresse_decision"
  203. v-html="doleance.mise_en_oeuvre_decision[opened_concernement.opened_doleance.field_index].entite_adresse_decision" />
  204. <label for="formule_decision">{{ p_mise_en_oeuvre_decision.field_formule_decision.label }}</label>
  205. <p
  206. name="formule_decision"
  207. v-html="doleance.mise_en_oeuvre_decision[opened_concernement.opened_doleance.field_index].formule_decision" />
  208. <label for="entite_metenoeuvre_decisio">{{ p_mise_en_oeuvre_decision.field_entite_metenoeuvre_decisio.label }}</label>
  209. <p
  210. name="entite_metenoeuvre_decisio"
  211. v-html="doleance.mise_en_oeuvre_decision[opened_concernement.opened_doleance.field_index].entite_metenoeuvre_decisio" />
  212. </section>
  213. <section
  214. v-if="opened_concernement.opened_doleance.field === 'adresse_de_la_decision'"
  215. class="adresse_de_la_decision">
  216. <span class="date">{{ doleance.date_adresse.start }}</span>
  217. <h5>Adresse de la decision à appliquer</h5>
  218. <label for="entite_adresse_application">{{ ct_cercle_politique.field_entite_adresse_application.label }}</label>
  219. <p name="entite_adresse_application" v-html="doleance.entite_adresse_application" />
  220. <label for="aqui_adresse_decision">{{ ct_cercle_politique.field_aqui_adresse_decision.label }}</label>
  221. <p name="aqui_adresse_decision" v-html="doleance.aqui_adresse_decision" />
  222. <label for="comment_formule_decision">{{ ct_cercle_politique.field_comment_formule_decision.label }}</label>
  223. <p name="comment_formule_decision" v-html="doleance.comment_formule_decision" />
  224. </section>
  225. <section
  226. v-if="opened_concernement.opened_doleance.field === 'receptions_et_applications'"
  227. class="receptions_et_applications">
  228. <span class="date">
  229. {{ doleance.receptions_et_applications[opened_concernement.opened_doleance.field_index].date.start }}
  230. &#x2192;
  231. {{ doleance.receptions_et_applications[opened_concernement.opened_doleance.field_index].date.end }}
  232. </span>
  233. <h5>{{ ct_cercle_politique.field_receptions_et_applications.label }}</h5>
  234. <label for="applique_decision">{{ p_reception_application_decision.field_applique_decision.label }}</label>
  235. <p
  236. name="applique_decision"
  237. v-html="doleance.receptions_et_applications[opened_concernement.opened_doleance.field_index].applique_decision" />
  238. <label for="formule_decision_applic">{{ p_reception_application_decision.field_formule_decision_applic.label }}</label>
  239. <p
  240. name="formule_decision_applic"
  241. v-html="doleance.receptions_et_applications[opened_concernement.opened_doleance.field_index].formule_decision_applic" />
  242. <label for="entite_recoit_decision">{{ p_reception_application_decision.field_entite_recoit_decision.label }}</label>
  243. <p
  244. name="entite_recoit_decision"
  245. v-html="doleance.receptions_et_applications[opened_concernement.opened_doleance.field_index].entite_recoit_decision" />
  246. </section>
  247. <section
  248. v-if="opened_concernement.opened_doleance.field === 'probleme_initial_resolu'"
  249. class="probleme_initial_resolu">
  250. <h5>Réussite / échec / reprise du cercle politique</h5>
  251. <label for="probleme_initial_resolu">{{ ct_cercle_politique.field_probleme_initial_resolu.label }}</label>
  252. <p
  253. name="probleme_initial_resolu"
  254. v-html="doleance.probleme_initial_resolu" />
  255. <label for="oui_nouvelle_situation">{{ ct_cercle_politique.field_oui_nouvelle_situation.label }}</label>
  256. <p
  257. name="oui_nouvelle_situation"
  258. v-html="doleance.oui_nouvelle_situation" />
  259. <label for="non_adresse_doleance">{{ ct_cercle_politique.field_non_adresse_doleance.label }}</label>
  260. <p
  261. name="non_adresse_doleance"
  262. v-html="doleance.non_adresse_doleance" />
  263. </section>
  264. </template>
  265. </section>
  266. </template>
  267. <template v-slot:footer>
  268. <!-- <vue-plyr>
  269. <div class="plyr__video-embed"> -->
  270. <iframe
  271. src="https://www.youtube.com/embed/_Uogb4tJ9c4?amp;iv_load_policy=3&amp;modestbranding=1&amp;playsinline=1&amp;showinfo=0&amp;rel=0&amp;enablejsapi=1"
  272. allowfullscreen
  273. allowtransparency
  274. frameborder="0"
  275. ></iframe>
  276. <!-- </div>
  277. </vue-plyr> -->
  278. </template>
  279. </CartoucheLayout>
  280. <nav v-if="map_mode === 'doleancer'" class="doleance-switch">
  281. <div
  282. @click="prevDoleance"
  283. class="prev"
  284. ref="prevDoleanceBTN" />
  285. <div
  286. @click="nextDoleance"
  287. class="next"
  288. ref="nextDoleanceBTN" />
  289. </nav>
  290. </template>
  291. <style lang="css">
  292. iframe{
  293. width:100%;
  294. /* height:calc() */
  295. aspect-ratio: 16/9;
  296. }
  297. </style>