Doleancer.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  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 vSelect from 'vue-select';
  8. // import 'vue-select/dist/vue-select.css';
  9. export default {
  10. props: ['cid'],
  11. data(){
  12. return {
  13. doleance: null,
  14. doleance_selected: null
  15. }
  16. },
  17. computed: {
  18. ...mapState(ConcernementsStore,['map_mode',
  19. 'opened_concernement',
  20. 'concernements_loaded',
  21. 'ct_concernement',
  22. 'ct_cercle_politique',
  23. 'p_groupes_interets',
  24. 'p_reception_et_traitement',
  25. 'p_mise_en_oeuvre_decision',
  26. 'p_reception_application_decision'
  27. ]),
  28. ...mapState(CommonStore,['hover_elmt']),
  29. // doleances_select_options () {
  30. // let os = [];
  31. // this.opened_concernement.doleances.forEach((doleance, index) => {
  32. // let o = {
  33. // label: doleance.leprobleme,
  34. // id: doleance.id
  35. // }
  36. // if (doleance.id === this.opened_concernement.opened_doleance.id) {
  37. // this.doleance_selected = o;
  38. // }
  39. // os.push(o);
  40. // })
  41. // return os;
  42. // },
  43. // doleances_select_value () {
  44. // let value;
  45. // this.opened_concernement.doleances.forEach((doleance, index) => {
  46. // if (doleance.id === this.opened_concernement.opened_doleance.id) {
  47. // value = {
  48. // label: doleance.leprobleme,
  49. // id: doleance.id
  50. // }
  51. // }
  52. // });
  53. // return value;
  54. // }
  55. },
  56. created () {
  57. console.log(`Doleancer content created, id: ${this.id}, opened_concernement:`,this.opened_concernement);
  58. this.opened_concernement.doleances.forEach((doleance, index) => {
  59. if (doleance.id === this.opened_concernement.opened_doleance.id) {
  60. this.doleance = doleance;
  61. }
  62. });
  63. },
  64. methods: {
  65. ...mapActions(ConcernementsStore,['setOpenedDoleance']),
  66. onDoleanceSelected(option){
  67. console.log('openDoleance', option);
  68. this.setOpenedDoleance(parseInt(this.id), option.id)
  69. this.opened_concernement.doleances.forEach((doleance, index) => {
  70. if (option.id === this.opened_concernement.opened_doleance.id) {
  71. this.doleance = doleance;
  72. }
  73. });
  74. }
  75. },
  76. components: {
  77. CartoucheLayout,
  78. // vSelect
  79. }
  80. }
  81. </script>
  82. <template>
  83. <CartoucheLayout :cid="cid">
  84. <template v-slot:header>
  85. <div class="pre-header">
  86. </div>
  87. </template>
  88. <template v-slot:main>
  89. <section
  90. class="content-doleances">
  91. <!-- <label for="leprobleme">{{ ct_cercle_politique.field_le_probleme.label }}</label>
  92. <v-select
  93. :options="doleances_select_options"
  94. item-value="id"
  95. v-model="doleance_selected"
  96. :clearable="false"
  97. :searchable="false"
  98. @option:selected="onDoleanceSelected"
  99. >
  100. </v-select> -->
  101. <main v-if="opened_concernement.opened_doleance.id === doleance.id && opened_concernement.opened_doleance.field">
  102. <section
  103. v-if="opened_concernement.opened_doleance.field === 'leprobleme'">
  104. <h5>{{ ct_cercle_politique.field_le_probleme.label }}</h5>
  105. <h4 name="leprobleme">{{ doleance.leprobleme }}</h4>
  106. </section>
  107. <section
  108. v-if="opened_concernement.opened_doleance.field === 'lenquete'"
  109. class="lenquete">
  110. <h5>{{ ct_cercle_politique.field_enquete_terraindevie.label }}</h5>
  111. <!-- <label for="lenquete">{{ ct_cercle_politique.field_enquete_terraindevie.label }}</label> -->
  112. <h4 name="lenquete">{{ doleance.lenquete }}</h4>
  113. </section>
  114. <section
  115. v-if="opened_concernement.opened_doleance.field === 'groupesinterets'"
  116. class="groupesinterets">
  117. <h5>Construction de groupes d'intérets avec qui composer la doléance</h5>
  118. <section>
  119. <label for="groupe">{{ p_groupes_interets.field_groupe_interets.label }}</label>
  120. <p
  121. name="groupe"
  122. v-html="doleance.groupesinterets[opened_concernement.opened_doleance.field_index].groupe_interets" />
  123. <label for="accorder">{{ p_groupes_interets.field_accorder_interets.label }}</label>
  124. <p
  125. name="accorder"
  126. v-html="doleance.groupesinterets[opened_concernement.opened_doleance.field_index].accorder_interets" />
  127. <label for="formuler">{{ p_groupes_interets.field_formuler.label }}</label>
  128. <p
  129. name="formuler"
  130. v-html="doleance.groupesinterets[opened_concernement.opened_doleance.field_index].formuler" />
  131. </section>
  132. </section>
  133. <section
  134. v-if="opened_concernement.opened_doleance.field === 'adresse_de_la_doleance'"
  135. class="adresse">
  136. <h5>Adresse de la doléance</h5>
  137. <label for="entite_addresse_doleance">{{ ct_cercle_politique.field_entite_adresse_doleance.label }}</label>
  138. <p
  139. name="entite_addresse_doleance"
  140. v-html="doleance.entite_addresse_doleance" />
  141. <label for="comment_ennonce_doleance">{{ ct_cercle_politique.field_comment_enonce_doleance.label }}</label>
  142. <p
  143. name="comment_ennonce_doleance"
  144. v-html="doleance.comment_ennonce_doleance" />
  145. <label for="aqui_addresse_doleance">{{ ct_cercle_politique.field_a_qui_adresse_doleance.label }}</label>
  146. <p
  147. name="aqui_addresse_doleance"
  148. v-html="doleance.aqui_addresse_doleance" />
  149. </section>
  150. <section
  151. v-if="opened_concernement.opened_doleance.field === 'reception_traitement'"
  152. class="reception_traitement">
  153. <h5>Reception et traitement de la doléance</h5>
  154. <label for="entite_adressee">{{ p_reception_et_traitement.field_entite_adressee.label }}</label>
  155. <p
  156. name="entite_adressee"
  157. v-html="doleance.reception_traitement[opened_concernement.opened_doleance.field_index].entite_adressee" />
  158. <label for="doleance_formulee">{{ p_reception_et_traitement.field_doleance_formulee.label }}</label>
  159. <p
  160. name="doleance_formulee"
  161. v-html="doleance.reception_traitement[opened_concernement.opened_doleance.field_index].doleance_formulee" />
  162. <label for="traite_doleance">{{ p_reception_et_traitement.field_traite_doleance.label }}</label>
  163. <p
  164. name="traite_doleance"
  165. v-html="doleance.reception_traitement[opened_concernement.opened_doleance.field_index].traite_doleance" />
  166. <label for="entite_recoit_doleance">{{ p_reception_et_traitement.field_entite_recoit_doleance.label }}</label>
  167. <p
  168. name="entite_recoit_doleance"
  169. v-html="doleance.reception_traitement[opened_concernement.opened_doleance.field_index].entite_recoit_doleance" />
  170. </section>
  171. <section
  172. v-if="opened_concernement.opened_doleance.field === 'decision'"
  173. class="decision">
  174. <h5>Décision</h5>
  175. <label for="entites_decisionnaires">{{ ct_cercle_politique.field_entites_decisionnaires.label }}</label>
  176. <p name="entites_decisionnaires" v-html="doleance.entites_decisionnaires" />
  177. <label for="decision_formule">{{ ct_cercle_politique.field_decision_formulee.label }}</label>
  178. <p name="decision_formule" v-html="doleance.decision_formule" />
  179. </section>
  180. <section
  181. v-if="opened_concernement.opened_doleance.field === 'mise_en_oeuvre_decision'"
  182. class="mise_en_oeuvre_decision">
  183. <h5>{{ ct_cercle_politique.field_mise_en_oeuvre_decision.label }}</h5>
  184. <label for="entite_adresse_decision">{{ p_mise_en_oeuvre_decision.field_entite_adresse_decision.label }}</label>
  185. <p
  186. name="entite_adresse_decision"
  187. v-html="doleance.mise_en_oeuvre_decision[opened_concernement.opened_doleance.field_index].entite_adresse_decision" />
  188. <label for="formule_decision">{{ p_mise_en_oeuvre_decision.field_formule_decision.label }}</label>
  189. <p
  190. name="formule_decision"
  191. v-html="doleance.mise_en_oeuvre_decision[opened_concernement.opened_doleance.field_index].formule_decision" />
  192. <label for="entite_metenoeuvre_decisio">{{ p_mise_en_oeuvre_decision.field_entite_metenoeuvre_decisio.label }}</label>
  193. <p
  194. name="entite_metenoeuvre_decisio"
  195. v-html="doleance.mise_en_oeuvre_decision[opened_concernement.opened_doleance.field_index].entite_metenoeuvre_decisio" />
  196. </section>
  197. <section
  198. v-if="opened_concernement.opened_doleance.field === 'adresse_de_la_decision'"
  199. class="adresse_de_la_decision">
  200. <h5>Adresse de la decision à appliquer</h5>
  201. <label for="entite_adresse_application">{{ ct_cercle_politique.field_entite_adresse_application.label }}</label>
  202. <p name="entite_adresse_application" v-html="doleance.entite_adresse_application" />
  203. <label for="aqui_adresse_decision">{{ ct_cercle_politique.field_aqui_adresse_decision.label }}</label>
  204. <p name="aqui_adresse_decision" v-html="doleance.aqui_adresse_decision" />
  205. <label for="comment_formule_decision">{{ ct_cercle_politique.field_comment_formule_decision.label }}</label>
  206. <p name="comment_formule_decision" v-html="doleance.comment_formule_decision" />
  207. </section>
  208. <section
  209. v-if="opened_concernement.opened_doleance.field === 'receptions_et_applications'"
  210. class="receptions_et_applications">
  211. <h5>{{ ct_cercle_politique.field_receptions_et_applications.label }}</h5>
  212. <label for="applique_decision">{{ p_reception_application_decision.field_applique_decision.label }}</label>
  213. <p
  214. name="applique_decision"
  215. v-html="doleance.receptions_et_applications[opened_concernement.opened_doleance.field_index].applique_decision" />
  216. <label for="formule_decision_applic">{{ p_reception_application_decision.field_formule_decision_applic.label }}</label>
  217. <p
  218. name="formule_decision_applic"
  219. v-html="doleance.receptions_et_applications[opened_concernement.opened_doleance.field_index].formule_decision_applic" />
  220. <label for="entite_recoit_decision">{{ p_reception_application_decision.field_entite_recoit_decision.label }}</label>
  221. <p
  222. name="entite_recoit_decision"
  223. v-html="doleance.receptions_et_applications[opened_concernement.opened_doleance.field_index].entite_recoit_decision" />
  224. </section>
  225. <section
  226. v-if="opened_concernement.opened_doleance.field === 'probleme_initial_resolu'"
  227. class="probleme_initial_resolu">
  228. <h5>Réussite / échec / reprise du cercle politique</h5>
  229. <label for="probleme_initial_resolu">{{ ct_cercle_politique.field_probleme_initial_resolu.label }}</label>
  230. <p
  231. name="probleme_initial_resolu"
  232. v-html="doleance.probleme_initial_resolu" />
  233. <label for="oui_nouvelle_situation">{{ ct_cercle_politique.field_oui_nouvelle_situation.label }}</label>
  234. <p
  235. name="oui_nouvelle_situation"
  236. v-html="doleance.oui_nouvelle_situation" />
  237. <label for="non_adresse_doleance">{{ ct_cercle_politique.field_non_adresse_doleance.label }}</label>
  238. <p
  239. name="non_adresse_doleance"
  240. v-html="doleance.non_adresse_doleance" />
  241. </section>
  242. </main>
  243. </section>
  244. </template>
  245. <template v-slot:footer>
  246. <!-- <vue-plyr>
  247. <div class="plyr__video-embed"> -->
  248. <iframe
  249. 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"
  250. allowfullscreen
  251. allowtransparency
  252. frameborder="0"
  253. ></iframe>
  254. <!-- </div>
  255. </vue-plyr> -->
  256. </template>
  257. </CartoucheLayout>
  258. </template>
  259. <style lang="css">
  260. iframe{
  261. width:100%;
  262. /* height:calc() */
  263. aspect-ratio: 16/9;
  264. }
  265. </style>