Doleancer.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  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 === 'lenquete'"
  104. class="lenquete">
  105. <h5>{{ ct_cercle_politique.field_enquete_terraindevie.label }}</h5>
  106. <!-- <label for="lenquete">{{ ct_cercle_politique.field_enquete_terraindevie.label }}</label> -->
  107. <h4 name="lenquete">{{ doleance.lenquete }}</h4>
  108. </section>
  109. <section
  110. v-if="opened_concernement.opened_doleance.field === 'groupesinterets'"
  111. class="groupesinterets">
  112. <h5>Construction de groupes d'intérets avec qui composer la doléance</h5>
  113. <section>
  114. <label for="groupe">{{ p_groupes_interets.field_groupe_interets.label }}</label>
  115. <p
  116. name="groupe"
  117. v-html="doleance.groupesinterets[opened_concernement.opened_doleance.field_index].groupe_interets" />
  118. <label for="accorder">{{ p_groupes_interets.field_accorder_interets.label }}</label>
  119. <p
  120. name="accorder"
  121. v-html="doleance.groupesinterets[opened_concernement.opened_doleance.field_index].accorder_interets" />
  122. <label for="formuler">{{ p_groupes_interets.field_formuler.label }}</label>
  123. <p
  124. name="formuler"
  125. v-html="doleance.groupesinterets[opened_concernement.opened_doleance.field_index].formuler" />
  126. </section>
  127. </section>
  128. <section
  129. v-if="opened_concernement.opened_doleance.field === 'adresse_de_la_doleance'"
  130. class="adresse">
  131. <h5>Adresse de la doléance</h5>
  132. <label for="entite_addresse_doleance">{{ ct_cercle_politique.field_entite_adresse_doleance.label }}</label>
  133. <p
  134. name="entite_addresse_doleance"
  135. v-html="doleance.entite_addresse_doleance" />
  136. <label for="comment_ennonce_doleance">{{ ct_cercle_politique.field_comment_enonce_doleance.label }}</label>
  137. <p
  138. name="comment_ennonce_doleance"
  139. v-html="doleance.comment_ennonce_doleance" />
  140. <label for="aqui_addresse_doleance">{{ ct_cercle_politique.field_a_qui_adresse_doleance.label }}</label>
  141. <p
  142. name="aqui_addresse_doleance"
  143. v-html="doleance.aqui_addresse_doleance" />
  144. </section>
  145. <section
  146. v-if="opened_concernement.opened_doleance.field === 'reception_traitement'"
  147. class="reception_traitement">
  148. <h5>Reception et traitement de la doléance</h5>
  149. <label for="entite_adressee">{{ p_reception_et_traitement.field_entite_adressee.label }}</label>
  150. <p
  151. name="entite_adressee"
  152. v-html="doleance.reception_traitement[opened_concernement.opened_doleance.field_index].entite_adressee" />
  153. <label for="doleance_formulee">{{ p_reception_et_traitement.field_doleance_formulee.label }}</label>
  154. <p
  155. name="doleance_formulee"
  156. v-html="doleance.reception_traitement[opened_concernement.opened_doleance.field_index].doleance_formulee" />
  157. <label for="traite_doleance">{{ p_reception_et_traitement.field_traite_doleance.label }}</label>
  158. <p
  159. name="traite_doleance"
  160. v-html="doleance.reception_traitement[opened_concernement.opened_doleance.field_index].traite_doleance" />
  161. <label for="entite_recoit_doleance">{{ p_reception_et_traitement.field_entite_recoit_doleance.label }}</label>
  162. <p
  163. name="entite_recoit_doleance"
  164. v-html="doleance.reception_traitement[opened_concernement.opened_doleance.field_index].entite_recoit_doleance" />
  165. </section>
  166. <section
  167. v-if="opened_concernement.opened_doleance.field === 'decision'"
  168. class="decision">
  169. <h5>Décision</h5>
  170. <label for="entites_decisionnaires">{{ ct_cercle_politique.field_entites_decisionnaires.label }}</label>
  171. <p name="entites_decisionnaires" v-html="doleance.entites_decisionnaires" />
  172. <label for="decision_formule">{{ ct_cercle_politique.field_decision_formulee.label }}</label>
  173. <p name="decision_formule" v-html="doleance.decision_formule" />
  174. </section>
  175. <section
  176. v-if="opened_concernement.opened_doleance.field === 'mise_en_oeuvre_decision'"
  177. class="mise_en_oeuvre_decision">
  178. <h5>{{ ct_cercle_politique.field_mise_en_oeuvre_decision.label }}</h5>
  179. <label for="entite_adresse_decision">{{ p_mise_en_oeuvre_decision.field_entite_adresse_decision.label }}</label>
  180. <p
  181. name="entite_adresse_decision"
  182. v-html="doleance.mise_en_oeuvre_decision[opened_concernement.opened_doleance.field_index].entite_adresse_decision" />
  183. <label for="formule_decision">{{ p_mise_en_oeuvre_decision.field_formule_decision.label }}</label>
  184. <p
  185. name="formule_decision"
  186. v-html="doleance.mise_en_oeuvre_decision[opened_concernement.opened_doleance.field_index].formule_decision" />
  187. <label for="entite_metenoeuvre_decisio">{{ p_mise_en_oeuvre_decision.field_entite_metenoeuvre_decisio.label }}</label>
  188. <p
  189. name="entite_metenoeuvre_decisio"
  190. v-html="doleance.mise_en_oeuvre_decision[opened_concernement.opened_doleance.field_index].entite_metenoeuvre_decisio" />
  191. </section>
  192. <section
  193. v-if="opened_concernement.opened_doleance.field === 'adresse_de_la_decision'"
  194. class="adresse_de_la_decision">
  195. <h5>Adresse de la decision à appliquer</h5>
  196. <label for="entite_adresse_application">{{ ct_cercle_politique.field_entite_adresse_application.label }}</label>
  197. <p name="entite_adresse_application" v-html="doleance.entite_adresse_application" />
  198. <label for="aqui_adresse_decision">{{ ct_cercle_politique.field_aqui_adresse_decision.label }}</label>
  199. <p name="aqui_adresse_decision" v-html="doleance.aqui_adresse_decision" />
  200. <label for="comment_formule_decision">{{ ct_cercle_politique.field_comment_formule_decision.label }}</label>
  201. <p name="comment_formule_decision" v-html="doleance.comment_formule_decision" />
  202. </section>
  203. <section
  204. v-if="opened_concernement.opened_doleance.field === 'receptions_et_applications'"
  205. class="receptions_et_applications">
  206. <h5>{{ ct_cercle_politique.field_receptions_et_applications.label }}</h5>
  207. <label for="applique_decision">{{ p_reception_application_decision.field_applique_decision.label }}</label>
  208. <p
  209. name="applique_decision"
  210. v-html="doleance.receptions_et_applications[opened_concernement.opened_doleance.field_index].applique_decision" />
  211. <label for="formule_decision_applic">{{ p_reception_application_decision.field_formule_decision_applic.label }}</label>
  212. <p
  213. name="formule_decision_applic"
  214. v-html="doleance.receptions_et_applications[opened_concernement.opened_doleance.field_index].formule_decision_applic" />
  215. <label for="entite_recoit_decision">{{ p_reception_application_decision.field_entite_recoit_decision.label }}</label>
  216. <p
  217. name="entite_recoit_decision"
  218. v-html="doleance.receptions_et_applications[opened_concernement.opened_doleance.field_index].entite_recoit_decision" />
  219. </section>
  220. <section
  221. v-if="opened_concernement.opened_doleance.field === 'probleme_initial_resolu'"
  222. class="probleme_initial_resolu">
  223. <h5>Réussite / échec / reprise du cercle politique</h5>
  224. <label for="probleme_initial_resolu">{{ ct_cercle_politique.field_probleme_initial_resolu.label }}</label>
  225. <p
  226. name="probleme_initial_resolu"
  227. v-html="doleance.probleme_initial_resolu" />
  228. <label for="oui_nouvelle_situation">{{ ct_cercle_politique.field_oui_nouvelle_situation.label }}</label>
  229. <p
  230. name="oui_nouvelle_situation"
  231. v-html="doleance.oui_nouvelle_situation" />
  232. <label for="non_adresse_doleance">{{ ct_cercle_politique.field_non_adresse_doleance.label }}</label>
  233. <p
  234. name="non_adresse_doleance"
  235. v-html="doleance.non_adresse_doleance" />
  236. </section>
  237. </main>
  238. </section>
  239. </template>
  240. <template v-slot:footer>
  241. <!-- <vue-plyr>
  242. <div class="plyr__video-embed"> -->
  243. <iframe
  244. 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"
  245. allowfullscreen
  246. allowtransparency
  247. frameborder="0"
  248. ></iframe>
  249. <!-- </div>
  250. </vue-plyr> -->
  251. </template>
  252. </CartoucheLayout>
  253. </template>
  254. <style lang="css">
  255. iframe{
  256. width:100%;
  257. /* height:calc() */
  258. aspect-ratio: 16/9;
  259. }
  260. </style>