@tekkare/romulus 0.1.348 → 0.1.350
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/runtime/components/Drawer.vue +10 -3
- package/dist/runtime/components/PageHeader.vue +95 -3
- package/dist/runtime/components/ProjectCreateDialog.vue +1 -1
- package/dist/runtime/components/ProjectResources.vue +63 -3
- package/dist/runtime/utils/projects.d.ts +9 -0
- package/dist/runtime/utils/projects.js +2 -1
- package/layer/app/assets/oip-frame.css +5 -2
- package/layer/app/components/oip-science/resources/Phrc.vue +161 -8
- package/layer/app/components/project/Guided.vue +1475 -0
- package/layer/app/components/project/NewButton.vue +21 -17
- package/layer/app/oip-defaults/projects.ts +13 -3
- package/layer/app/oip-drugs/esIndices.ts +5 -0
- package/layer/app/oip-drugs/kinds.ts +12 -0
- package/layer/app/oip-guided/families.ts +984 -0
- package/layer/app/oip-guided/shared.ts +179 -0
- package/layer/app/oip-guided/subjects.ts +384 -0
- package/layer/app/utils/oipResources.ts +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,1475 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Creation guidee d'un projet, dans un tiroir. Pas d'IA : un formulaire en
|
|
3
|
+
quatre etapes.
|
|
4
|
+
|
|
5
|
+
1. Sujets : une barre, des suggestions groupees (maladies CIM-10 et rares,
|
|
6
|
+
molecules, marques), plusieurs de chaque.
|
|
7
|
+
2. Sources : trois blocs (Drugs, Reglementaire, Augmented Science). La
|
|
8
|
+
recherche part des que les sujets sont poses : chaque famille annonce
|
|
9
|
+
son nombre de fiches, et les sources d'un bloc se trient par ce nombre.
|
|
10
|
+
3. Description : un nom et un texte proposes, a reprendre.
|
|
11
|
+
4. Revue : les fiches trouvees, famille par famille, a cocher. Le projet
|
|
12
|
+
se cree a la fin, avec ce qui est coche : rien n'est cree a moitie.
|
|
13
|
+
|
|
14
|
+
Les recherches vivent dans oip-guided/ (portage des assistants de
|
|
15
|
+
fr_drugs_app et de France Augmented Science).
|
|
16
|
+
-->
|
|
17
|
+
<template>
|
|
18
|
+
<RmDrawer
|
|
19
|
+
:model-value="modelValue"
|
|
20
|
+
size="xl"
|
|
21
|
+
:offset="railOffset"
|
|
22
|
+
:inset="railInset"
|
|
23
|
+
:label="tr('Création guidée', 'Guided creation')"
|
|
24
|
+
@update:model-value="requestClose"
|
|
25
|
+
>
|
|
26
|
+
<template #header>
|
|
27
|
+
<div class="prj_gd_head">
|
|
28
|
+
<p class="prj_gd_title">{{ tr("Création guidée", "Guided creation") }}</p>
|
|
29
|
+
<ol v-if="step !== 'done'" class="prj_gd_steps">
|
|
30
|
+
<li
|
|
31
|
+
v-for="(entry, index) in STEPS"
|
|
32
|
+
:key="entry.key"
|
|
33
|
+
:class="{ 'is-current': entry.key === step, 'is-done': index < stepIndex }"
|
|
34
|
+
>
|
|
35
|
+
<button
|
|
36
|
+
type="button"
|
|
37
|
+
class="prj_gd_step"
|
|
38
|
+
:disabled="!canGoTo(index)"
|
|
39
|
+
:aria-current="entry.key === step ? 'step' : undefined"
|
|
40
|
+
@click="goTo(index)"
|
|
41
|
+
>
|
|
42
|
+
<span class="prj_gd_step_num">{{ index + 1 }}</span>
|
|
43
|
+
{{ tr(entry.fr, entry.en) }}
|
|
44
|
+
</button>
|
|
45
|
+
</li>
|
|
46
|
+
</ol>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<!-- 1. Sujets -->
|
|
51
|
+
<section v-if="step === 'subjects'" class="prj_gd_body">
|
|
52
|
+
<p class="prj_gd_lead">
|
|
53
|
+
{{
|
|
54
|
+
tr(
|
|
55
|
+
"Sur quoi porte le projet ? Ajoutez une ou plusieurs maladies, molécules ou marques.",
|
|
56
|
+
"What is the project about? Add one or more diseases, molecules or brands.",
|
|
57
|
+
)
|
|
58
|
+
}}
|
|
59
|
+
</p>
|
|
60
|
+
|
|
61
|
+
<div ref="searchRoot" class="prj_gd_search">
|
|
62
|
+
<div class="prj_gd_search_box">
|
|
63
|
+
<RmIcon name="MagnifyingGlass" :size="16" />
|
|
64
|
+
<input
|
|
65
|
+
ref="searchInput"
|
|
66
|
+
v-model="query"
|
|
67
|
+
type="text"
|
|
68
|
+
role="combobox"
|
|
69
|
+
:aria-expanded="showSuggestions"
|
|
70
|
+
aria-autocomplete="list"
|
|
71
|
+
:placeholder="tr('Une maladie, une molécule, une marque', 'A disease, a molecule, a brand')"
|
|
72
|
+
@focus="searchOpen = true"
|
|
73
|
+
@keydown.down.prevent="move(1)"
|
|
74
|
+
@keydown.up.prevent="move(-1)"
|
|
75
|
+
@keydown.enter.prevent="pickHighlighted"
|
|
76
|
+
/>
|
|
77
|
+
<span v-if="suggesting" class="prj_gd_spin" role="status" :aria-label="tr('Chargement', 'Loading')" />
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<div v-if="showSuggestions" class="prj_gd_suggest" role="listbox">
|
|
81
|
+
<p v-if="!flat.length && !suggesting" class="prj_gd_empty">
|
|
82
|
+
{{ tr("Aucune suggestion pour", "No suggestion for") }} <strong>{{ query }}</strong>
|
|
83
|
+
</p>
|
|
84
|
+
<template v-for="group in suggestionGroups" :key="group.key">
|
|
85
|
+
<div v-if="group.items.length" class="prj_gd_group">
|
|
86
|
+
<span class="prj_gd_group_label">{{ group.label }}</span>
|
|
87
|
+
<span class="prj_gd_group_count">{{ group.items.length }}</span>
|
|
88
|
+
</div>
|
|
89
|
+
<button
|
|
90
|
+
v-for="item in group.items"
|
|
91
|
+
:key="item.key"
|
|
92
|
+
type="button"
|
|
93
|
+
role="option"
|
|
94
|
+
class="prj_gd_option"
|
|
95
|
+
:class="{ 'is-active': flat.indexOf(item) === highlighted, 'is-picked': picked(item) }"
|
|
96
|
+
:aria-selected="flat.indexOf(item) === highlighted"
|
|
97
|
+
@mouseenter="highlighted = flat.indexOf(item)"
|
|
98
|
+
@mousedown.prevent
|
|
99
|
+
@click="pick(item)"
|
|
100
|
+
>
|
|
101
|
+
<span class="prj_gd_option_icon"><RmIcon :name="FOCUS_ICON[item.focus]" :size="16" /></span>
|
|
102
|
+
<span class="prj_gd_option_text">
|
|
103
|
+
<span class="prj_gd_option_title">{{ item.label }}</span>
|
|
104
|
+
<span v-if="item.hint" class="prj_gd_option_hint">{{ item.hint }}</span>
|
|
105
|
+
</span>
|
|
106
|
+
<RmIcon v-if="picked(item)" name="Check" :size="14" />
|
|
107
|
+
</button>
|
|
108
|
+
</template>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
<div v-if="subjects.length" class="prj_gd_chips">
|
|
113
|
+
<RmTag v-for="subject in subjects" :key="subject.key" closable @close="unpick(subject)">
|
|
114
|
+
<RmIcon :name="FOCUS_ICON[subject.focus]" :size="12" />
|
|
115
|
+
{{ subject.label }}
|
|
116
|
+
<span v-if="subject.code" class="prj_gd_chip_code">{{ subject.hint }}</span>
|
|
117
|
+
</RmTag>
|
|
118
|
+
</div>
|
|
119
|
+
<p v-else class="prj_gd_hint">
|
|
120
|
+
{{ tr("Aucun sujet pour l'instant.", "No subject yet.") }}
|
|
121
|
+
</p>
|
|
122
|
+
</section>
|
|
123
|
+
|
|
124
|
+
<!-- 2. Sources -->
|
|
125
|
+
<section v-else-if="step === 'sources'" class="prj_gd_body">
|
|
126
|
+
<p class="prj_gd_lead">
|
|
127
|
+
{{
|
|
128
|
+
tr(
|
|
129
|
+
"Choisissez les blocs depuis lesquels nous vous ferons des suggestions. Si, dans le détail d'un bloc, une source est grisée, c'est que nous n'avons pas trouvé de résultat pour votre sujet exact. Vous pourrez tout de même y ajouter des ressources vous-même, depuis les applications concernées.",
|
|
130
|
+
"Choose the blocks we will make suggestions from. If a source is greyed out in a block's details, we found no result for your exact subject. You can still add resources from it yourself, from the apps concerned.",
|
|
131
|
+
)
|
|
132
|
+
}}
|
|
133
|
+
</p>
|
|
134
|
+
<div class="prj_gd_blocks">
|
|
135
|
+
<article
|
|
136
|
+
v-for="block in blocks"
|
|
137
|
+
:key="block.key"
|
|
138
|
+
class="prj_gd_block"
|
|
139
|
+
:class="{ 'is-on': blockOn(block.key) }"
|
|
140
|
+
>
|
|
141
|
+
<button type="button" class="prj_gd_block_main" :aria-pressed="blockOn(block.key)" @click="toggleBlock(block.key)">
|
|
142
|
+
<span class="prj_gd_block_icon"><RmIcon :name="block.icon" :size="20" /></span>
|
|
143
|
+
<span class="prj_gd_block_head">
|
|
144
|
+
<span class="prj_gd_block_title">{{ block.label[lang] }}</span>
|
|
145
|
+
<span class="prj_gd_block_check"><RmIcon :name="blockOn(block.key) ? 'CheckSquare' : 'Square'" :size="20" /></span>
|
|
146
|
+
</span>
|
|
147
|
+
<span class="prj_gd_block_desc">{{ block.description[lang] }}</span>
|
|
148
|
+
<span class="prj_gd_block_count">
|
|
149
|
+
<span v-if="blockLoading(block.key)" class="prj_gd_spin" role="status" :aria-label="tr('Recherche en cours', 'Searching')" />
|
|
150
|
+
<template v-else>{{ countLabel(blockCount(block.key)) }}</template>
|
|
151
|
+
</span>
|
|
152
|
+
</button>
|
|
153
|
+
<button
|
|
154
|
+
type="button"
|
|
155
|
+
class="prj_gd_block_more"
|
|
156
|
+
:aria-expanded="expanded[block.key]"
|
|
157
|
+
@click="expanded[block.key] = !expanded[block.key]"
|
|
158
|
+
>
|
|
159
|
+
{{ tr("Préciser les sources", "Specify the sources") }}
|
|
160
|
+
<RmIcon :name="expanded[block.key] ? 'CaretUp' : 'CaretDown'" :size="14" />
|
|
161
|
+
</button>
|
|
162
|
+
<ul v-if="expanded[block.key]" class="prj_gd_families">
|
|
163
|
+
<li v-for="type in sortedTypes(block)" :key="type" class="prj_gd_family">
|
|
164
|
+
<RmCheckbox
|
|
165
|
+
:model-value="families[type] === true"
|
|
166
|
+
:label="familyLabel(type)"
|
|
167
|
+
:disabled="!familyCount(type) && !familyState(type).loading"
|
|
168
|
+
@update:model-value="families[type] = $event"
|
|
169
|
+
/>
|
|
170
|
+
<span class="prj_gd_family_count">
|
|
171
|
+
<span v-if="familyState(type).loading" class="prj_gd_spin" role="status" :aria-label="tr('Recherche en cours', 'Searching')" />
|
|
172
|
+
<template v-else-if="familyState(type).failed">{{ tr("indisponible", "unavailable") }}</template>
|
|
173
|
+
<template v-else>{{ familyCount(type) }}</template>
|
|
174
|
+
</span>
|
|
175
|
+
</li>
|
|
176
|
+
</ul>
|
|
177
|
+
</article>
|
|
178
|
+
</div>
|
|
179
|
+
</section>
|
|
180
|
+
|
|
181
|
+
<!-- 3. Description -->
|
|
182
|
+
<section v-else-if="step === 'describe'" class="prj_gd_body">
|
|
183
|
+
<RmInput
|
|
184
|
+
v-model="title"
|
|
185
|
+
:label="tr('Nom du projet', 'Project name')"
|
|
186
|
+
:error="titleError"
|
|
187
|
+
required
|
|
188
|
+
/>
|
|
189
|
+
<RmTextarea
|
|
190
|
+
v-model="description"
|
|
191
|
+
:label="tr('Description', 'Description')"
|
|
192
|
+
:rows="8"
|
|
193
|
+
/>
|
|
194
|
+
<p class="prj_gd_hint">
|
|
195
|
+
{{ tr("Proposée à partir des sujets et des sources choisis, à reprendre librement.", "Drafted from the chosen subjects and sources, edit it freely.") }}
|
|
196
|
+
</p>
|
|
197
|
+
</section>
|
|
198
|
+
|
|
199
|
+
<!-- 4. Revue -->
|
|
200
|
+
<section v-else-if="step === 'review'" class="prj_gd_body">
|
|
201
|
+
<p class="prj_gd_lead">
|
|
202
|
+
{{
|
|
203
|
+
tr(
|
|
204
|
+
"Les fiches trouvées pour vos sujets, bloc par bloc. Gardez celles qui comptent, le projet se crée avec elles à la fin.",
|
|
205
|
+
"The records found for your subjects, block by block. Keep those that matter, the project is created with them at the end.",
|
|
206
|
+
)
|
|
207
|
+
}}
|
|
208
|
+
</p>
|
|
209
|
+
<nav v-if="reviewBlocks.length > 1" class="prj_gd_phases" :aria-label="tr('Blocs à relire', 'Blocks to review')">
|
|
210
|
+
<button
|
|
211
|
+
v-for="(block, index) in reviewBlocks"
|
|
212
|
+
:key="block.key"
|
|
213
|
+
type="button"
|
|
214
|
+
class="prj_gd_phase"
|
|
215
|
+
:class="{ 'is-current': index === reviewPhase }"
|
|
216
|
+
:aria-current="index === reviewPhase ? 'step' : undefined"
|
|
217
|
+
@click="reviewPhase = index"
|
|
218
|
+
>
|
|
219
|
+
<RmIcon :name="block.icon" :size="14" />
|
|
220
|
+
{{ block.label[lang] }}
|
|
221
|
+
<span class="prj_gd_phase_count">{{ blockKept(block) }}</span>
|
|
222
|
+
</button>
|
|
223
|
+
</nav>
|
|
224
|
+
<div class="prj_gd_legend">
|
|
225
|
+
<span v-for="(meta, kind) in KIND_META" :key="kind" class="prj_gd_legend_item">
|
|
226
|
+
<RmBadge :variant="meta.variant">{{ meta.label[lang] }}</RmBadge>
|
|
227
|
+
{{ meta.help[lang] }}
|
|
228
|
+
</span>
|
|
229
|
+
</div>
|
|
230
|
+
|
|
231
|
+
<p v-if="!phaseTypes.length" class="prj_gd_empty">
|
|
232
|
+
{{ tr("Aucune source choisie : le projet sera créé vide.", "No source chosen: the project will be created empty.") }}
|
|
233
|
+
</p>
|
|
234
|
+
|
|
235
|
+
<details v-for="type in phaseTypes" :key="type" class="prj_gd_review" open>
|
|
236
|
+
<summary class="prj_gd_review_head">
|
|
237
|
+
<span class="prj_gd_review_title">{{ familyLabel(type) }}</span>
|
|
238
|
+
<span class="prj_gd_review_count">
|
|
239
|
+
<span v-if="familyState(type).loading" class="prj_gd_spin" role="status" :aria-label="tr('Recherche en cours', 'Searching')" />
|
|
240
|
+
<template v-else>{{ keptCount(type) }} / {{ familyCount(type) }}</template>
|
|
241
|
+
</span>
|
|
242
|
+
<button
|
|
243
|
+
v-if="familyCount(type)"
|
|
244
|
+
type="button"
|
|
245
|
+
class="prj_gd_link"
|
|
246
|
+
@click.prevent="toggleAll(type)"
|
|
247
|
+
>
|
|
248
|
+
{{ allKept(type) ? tr("Tout décocher", "Untick all") : tr("Tout cocher", "Tick all") }}
|
|
249
|
+
</button>
|
|
250
|
+
</summary>
|
|
251
|
+
<ul class="prj_gd_rows">
|
|
252
|
+
<li v-for="entry in entriesOf(type)" :key="entry.key" class="prj_gd_row">
|
|
253
|
+
<!-- Une marque : une case pour toutes ses fiches, le detail se deplie. -->
|
|
254
|
+
<template v-if="entry.rows.length > 1 || entry.grouped">
|
|
255
|
+
<div class="prj_gd_row_main">
|
|
256
|
+
<RmCheckbox
|
|
257
|
+
:model-value="groupKept(type, entry.rows) > 0"
|
|
258
|
+
:label="`${entry.title} (${groupKept(type, entry.rows)}/${entry.rows.length})`"
|
|
259
|
+
:description="entry.subtitle"
|
|
260
|
+
@update:model-value="setGroupKept(type, entry.rows, $event)"
|
|
261
|
+
/>
|
|
262
|
+
<RmBadge :variant="KIND_META[entry.kind].variant">{{ KIND_META[entry.kind].label[lang] }}</RmBadge>
|
|
263
|
+
<button
|
|
264
|
+
type="button"
|
|
265
|
+
class="prj_gd_link"
|
|
266
|
+
:aria-expanded="!!openGroups[`${type}:${entry.key}`]"
|
|
267
|
+
@click="openGroups[`${type}:${entry.key}`] = !openGroups[`${type}:${entry.key}`]"
|
|
268
|
+
>
|
|
269
|
+
{{ openGroups[`${type}:${entry.key}`] ? tr("Replier", "Collapse") : tr("Détail", "Details") }}
|
|
270
|
+
</button>
|
|
271
|
+
<button
|
|
272
|
+
v-if="entry.rows[0]!.evidence.length"
|
|
273
|
+
type="button"
|
|
274
|
+
class="prj_gd_link"
|
|
275
|
+
:aria-expanded="why === `${type}:${entry.key}`"
|
|
276
|
+
@click="why = why === `${type}:${entry.key}` ? '' : `${type}:${entry.key}`"
|
|
277
|
+
>
|
|
278
|
+
{{ tr("Pourquoi", "Why") }}
|
|
279
|
+
</button>
|
|
280
|
+
</div>
|
|
281
|
+
<ul v-if="openGroups[`${type}:${entry.key}`]" class="prj_gd_rows prj_gd_rows--nested">
|
|
282
|
+
<li v-for="row in entry.rows" :key="row.id" class="prj_gd_row">
|
|
283
|
+
<div class="prj_gd_row_main">
|
|
284
|
+
<RmCheckbox
|
|
285
|
+
:model-value="isKept(type, row.id)"
|
|
286
|
+
:label="row.title"
|
|
287
|
+
:description="row.subtitle"
|
|
288
|
+
@update:model-value="setKept(type, row.id, $event)"
|
|
289
|
+
/>
|
|
290
|
+
</div>
|
|
291
|
+
</li>
|
|
292
|
+
</ul>
|
|
293
|
+
<dl v-if="why === `${type}:${entry.key}`" class="prj_gd_why">
|
|
294
|
+
<template v-for="(group, index) in entry.rows[0]!.evidence" :key="index">
|
|
295
|
+
<dt>{{ group.label }}</dt>
|
|
296
|
+
<dd v-for="(value, rank) in group.values" :key="rank" v-html="marked(value)" />
|
|
297
|
+
</template>
|
|
298
|
+
</dl>
|
|
299
|
+
</template>
|
|
300
|
+
|
|
301
|
+
<template v-else>
|
|
302
|
+
<div class="prj_gd_row_main">
|
|
303
|
+
<RmCheckbox
|
|
304
|
+
:model-value="isKept(type, entry.rows[0]!.id)"
|
|
305
|
+
:label="entry.rows[0]!.title"
|
|
306
|
+
:description="entry.rows[0]!.subtitle"
|
|
307
|
+
@update:model-value="setKept(type, entry.rows[0]!.id, $event)"
|
|
308
|
+
/>
|
|
309
|
+
<RmBadge :variant="KIND_META[entry.kind].variant">{{ KIND_META[entry.kind].label[lang] }}</RmBadge>
|
|
310
|
+
<button
|
|
311
|
+
v-if="entry.rows[0]!.evidence.length"
|
|
312
|
+
type="button"
|
|
313
|
+
class="prj_gd_link"
|
|
314
|
+
:aria-expanded="why === `${type}:${entry.key}`"
|
|
315
|
+
@click="why = why === `${type}:${entry.key}` ? '' : `${type}:${entry.key}`"
|
|
316
|
+
>
|
|
317
|
+
{{ tr("Pourquoi", "Why") }}
|
|
318
|
+
</button>
|
|
319
|
+
</div>
|
|
320
|
+
<dl v-if="why === `${type}:${entry.key}`" class="prj_gd_why">
|
|
321
|
+
<template v-for="(group, index) in entry.rows[0]!.evidence" :key="index">
|
|
322
|
+
<dt>{{ group.label }}</dt>
|
|
323
|
+
<!-- Extraits surlignes par Elasticsearch : tout est echappe, sauf <mark>. -->
|
|
324
|
+
<dd v-for="(value, rank) in group.values" :key="rank" v-html="marked(value)" />
|
|
325
|
+
</template>
|
|
326
|
+
</dl>
|
|
327
|
+
</template>
|
|
328
|
+
</li>
|
|
329
|
+
</ul>
|
|
330
|
+
</details>
|
|
331
|
+
<p v-if="createError" class="prj_gd_error" role="alert">{{ createError }}</p>
|
|
332
|
+
</section>
|
|
333
|
+
|
|
334
|
+
<!-- Fin -->
|
|
335
|
+
<section v-else class="prj_gd_body prj_gd_done">
|
|
336
|
+
<RmIcon name="CheckCircle" :size="40" />
|
|
337
|
+
<p class="prj_gd_title">
|
|
338
|
+
{{
|
|
339
|
+
addedTotal
|
|
340
|
+
? tr(`Le projet est créé, avec ${addedTotal} éléments.`, `The project is created, with ${addedTotal} items.`)
|
|
341
|
+
: tr("Le projet est créé.", "The project is created.")
|
|
342
|
+
}}
|
|
343
|
+
</p>
|
|
344
|
+
<p v-if="failedTypes.length" class="prj_gd_hint">
|
|
345
|
+
{{ tr("Non ajoutés :", "Not added:") }} {{ failedTypes.map(familyLabel).join(", ") }}
|
|
346
|
+
</p>
|
|
347
|
+
</section>
|
|
348
|
+
|
|
349
|
+
<template #footer>
|
|
350
|
+
<div class="prj_gd_footer">
|
|
351
|
+
<template v-if="step === 'done'">
|
|
352
|
+
<RmButton variant="tertiary" @click="close">{{ tr("Fermer", "Close") }}</RmButton>
|
|
353
|
+
<RmButton variant="primary" @click="openProject">{{ tr("Ouvrir le projet", "Open the project") }}</RmButton>
|
|
354
|
+
</template>
|
|
355
|
+
<template v-else>
|
|
356
|
+
<RmButton v-if="stepIndex > 0" variant="tertiary" :disabled="creating" @click="back">
|
|
357
|
+
{{ tr("Retour", "Back") }}
|
|
358
|
+
</RmButton>
|
|
359
|
+
<span class="prj_gd_footer_gap" />
|
|
360
|
+
<RmButton v-if="step !== 'review' || reviewPhase < reviewBlocks.length - 1" variant="primary" :disabled="!canNext" @click="next">
|
|
361
|
+
{{ tr("Continuer", "Continue") }}
|
|
362
|
+
</RmButton>
|
|
363
|
+
<RmButton v-else variant="primary" :loading="creating" :disabled="searching" @click="create">
|
|
364
|
+
{{
|
|
365
|
+
keptTotal
|
|
366
|
+
? tr(`Créer le projet (${keptTotal})`, `Create the project (${keptTotal})`)
|
|
367
|
+
: tr("Créer le projet", "Create the project")
|
|
368
|
+
}}
|
|
369
|
+
</RmButton>
|
|
370
|
+
</template>
|
|
371
|
+
</div>
|
|
372
|
+
</template>
|
|
373
|
+
</RmDrawer>
|
|
374
|
+
|
|
375
|
+
<ProjectDiscardConfirm v-model="confirmingClose" @discard="close" />
|
|
376
|
+
</template>
|
|
377
|
+
|
|
378
|
+
<script setup lang="ts">
|
|
379
|
+
import { rmPanelRegister } from "@tekkare/romulus/utils/panels";
|
|
380
|
+
import { PROJECT_GUIDED_BLOCKS } from "#oip-projects";
|
|
381
|
+
import {
|
|
382
|
+
GUIDED_BLOCKS,
|
|
383
|
+
GUIDED_GROUPED_TYPES,
|
|
384
|
+
collectGuided,
|
|
385
|
+
guidedFamilyLabel,
|
|
386
|
+
type GuidedBlock,
|
|
387
|
+
type GuidedBlockKey,
|
|
388
|
+
type GuidedFamilyState,
|
|
389
|
+
} from "../../oip-guided/families";
|
|
390
|
+
import { preloadGuidedSubjects, suggestGuidedSubjects, type GuidedSubjectSuggestion } from "../../oip-guided/subjects";
|
|
391
|
+
import type { GuidedFocus, GuidedMatchKind, GuidedRow } from "../../oip-guided/shared";
|
|
392
|
+
|
|
393
|
+
const props = defineProps<{ modelValue: boolean }>();
|
|
394
|
+
const emit = defineEmits<{ "update:modelValue": [value: boolean]; created: [projectId: string] }>();
|
|
395
|
+
|
|
396
|
+
const { locale } = useI18n();
|
|
397
|
+
const lang = computed(() => (locale.value === "en" ? "en" : "fr"));
|
|
398
|
+
const tr = (fr: string, en: string) => (lang.value === "en" ? en : fr);
|
|
399
|
+
const projects = useProjects();
|
|
400
|
+
const router = useRouter();
|
|
401
|
+
|
|
402
|
+
type Step = "subjects" | "sources" | "describe" | "review" | "done";
|
|
403
|
+
const STEPS: { key: Step; fr: string; en: string }[] = [
|
|
404
|
+
{ key: "subjects", fr: "Sujets", en: "Subjects" },
|
|
405
|
+
{ key: "sources", fr: "Sources", en: "Sources" },
|
|
406
|
+
{ key: "describe", fr: "Description", en: "Description" },
|
|
407
|
+
{ key: "review", fr: "Revue", en: "Review" },
|
|
408
|
+
];
|
|
409
|
+
|
|
410
|
+
const FOCUS_ICON: Record<GuidedFocus, string> = { disease: "Heartbeat", molecule: "Atom", brand: "Pill" };
|
|
411
|
+
|
|
412
|
+
const KIND_META: Record<GuidedMatchKind, { label: { fr: string; en: string }; help: { fr: string; en: string }; variant: "active" | "pending" | "info" }> = {
|
|
413
|
+
direct: { label: { fr: "Direct", en: "Direct" }, help: { fr: "le sujet est dans la fiche", en: "the subject is in the record" }, variant: "active" },
|
|
414
|
+
mention: { label: { fr: "Mention", en: "Mention" }, help: { fr: "cité en passant", en: "mentioned in passing" }, variant: "pending" },
|
|
415
|
+
deduced: { label: { fr: "Déduction", en: "Deduced" }, help: { fr: "par une marque ou un essai retenu", en: "through a kept brand or trial" }, variant: "info" },
|
|
416
|
+
};
|
|
417
|
+
|
|
418
|
+
/** Les blocs que l'app propose (`PROJECT_GUIDED_BLOCKS`), dans l'ordre du layer. */
|
|
419
|
+
const blocks = computed<GuidedBlock[]>(() => GUIDED_BLOCKS.filter((block) => (PROJECT_GUIDED_BLOCKS ?? []).includes(block.key)));
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Le tiroir se pose a gauche du rail de droite (z-index 402) plutot que
|
|
423
|
+
* dessous : sinon le rail masque le bouton « Continuer ». Passer au-dessus
|
|
424
|
+
* ferait passer le tiroir devant la confirmation de sortie (modale, 100).
|
|
425
|
+
*/
|
|
426
|
+
const railOffset = ref("0px");
|
|
427
|
+
/** Meme marge haute et basse que le rail : les deux panneaux s'alignent. */
|
|
428
|
+
const railInset = ref<string | undefined>(undefined);
|
|
429
|
+
function measureRail() {
|
|
430
|
+
const rail = document.querySelector(".rm-sb--right")?.getBoundingClientRect();
|
|
431
|
+
railOffset.value = rail ? `${Math.max(0, window.innerWidth - rail.left)}px` : "0px";
|
|
432
|
+
railInset.value = rail && rail.top > 0 ? `${Math.round(rail.top)}px` : undefined;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
const step = ref<Step>("subjects");
|
|
436
|
+
const stepIndex = computed(() => STEPS.findIndex((entry) => entry.key === step.value));
|
|
437
|
+
|
|
438
|
+
// --- 1. Sujets ------------------------------------------------------------
|
|
439
|
+
|
|
440
|
+
const query = ref("");
|
|
441
|
+
const searchOpen = ref(false);
|
|
442
|
+
const suggesting = ref(false);
|
|
443
|
+
const highlighted = ref(0);
|
|
444
|
+
const searchRoot = ref<HTMLElement | null>(null);
|
|
445
|
+
const searchInput = ref<HTMLInputElement | null>(null);
|
|
446
|
+
const suggestions = ref({ diseases: [] as GuidedSubjectSuggestion[], molecules: [] as GuidedSubjectSuggestion[], brands: [] as GuidedSubjectSuggestion[] });
|
|
447
|
+
const subjects = ref<GuidedSubjectSuggestion[]>([]);
|
|
448
|
+
|
|
449
|
+
const suggestionGroups = computed(() => [
|
|
450
|
+
{ key: "diseases", label: tr("Maladies", "Diseases"), items: suggestions.value.diseases },
|
|
451
|
+
{ key: "molecules", label: tr("Molécules", "Molecules"), items: suggestions.value.molecules },
|
|
452
|
+
{ key: "brands", label: tr("Marques", "Brands"), items: suggestions.value.brands },
|
|
453
|
+
]);
|
|
454
|
+
const flat = computed(() => suggestionGroups.value.flatMap((group) => group.items));
|
|
455
|
+
const showSuggestions = computed(() => searchOpen.value && query.value.trim().length >= 2);
|
|
456
|
+
|
|
457
|
+
let ticket = 0;
|
|
458
|
+
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
459
|
+
watch(query, (value) => {
|
|
460
|
+
clearTimeout(timer);
|
|
461
|
+
highlighted.value = 0;
|
|
462
|
+
if (value.trim().length < 2) {
|
|
463
|
+
suggestions.value = { diseases: [], molecules: [], brands: [] };
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
timer = setTimeout(async () => {
|
|
467
|
+
const mine = ++ticket;
|
|
468
|
+
suggesting.value = true;
|
|
469
|
+
try {
|
|
470
|
+
const result = await suggestGuidedSubjects(value, lang.value);
|
|
471
|
+
if (mine === ticket) suggestions.value = result;
|
|
472
|
+
} finally {
|
|
473
|
+
if (mine === ticket) suggesting.value = false;
|
|
474
|
+
}
|
|
475
|
+
}, 250);
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
const picked = (item: GuidedSubjectSuggestion) => subjects.value.some((subject) => subject.key === item.key);
|
|
479
|
+
|
|
480
|
+
function pick(item: GuidedSubjectSuggestion) {
|
|
481
|
+
if (picked(item)) unpick(item);
|
|
482
|
+
else subjects.value = [...subjects.value, item];
|
|
483
|
+
query.value = "";
|
|
484
|
+
searchInput.value?.focus();
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
function unpick(item: GuidedSubjectSuggestion) {
|
|
488
|
+
subjects.value = subjects.value.filter((subject) => subject.key !== item.key);
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
function move(delta: number) {
|
|
492
|
+
if (!flat.value.length) return;
|
|
493
|
+
highlighted.value = (highlighted.value + delta + flat.value.length) % flat.value.length;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
function pickHighlighted() {
|
|
497
|
+
const item = flat.value[highlighted.value];
|
|
498
|
+
if (item) pick(item);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
function onOutside(event: MouseEvent) {
|
|
502
|
+
if (searchRoot.value && !searchRoot.value.contains(event.target as Node)) searchOpen.value = false;
|
|
503
|
+
}
|
|
504
|
+
// La liste s'inscrit comme panneau Romulus : Echap (ecoute en capture par le
|
|
505
|
+
// tiroir) la referme d'abord, sans fermer le tiroir ni perdre les sujets.
|
|
506
|
+
let unregister: (() => void) | undefined;
|
|
507
|
+
onMounted(() => {
|
|
508
|
+
document.addEventListener("mousedown", onOutside);
|
|
509
|
+
unregister = rmPanelRegister(
|
|
510
|
+
() => (searchOpen.value = false),
|
|
511
|
+
() => showSuggestions.value,
|
|
512
|
+
);
|
|
513
|
+
});
|
|
514
|
+
onBeforeUnmount(() => {
|
|
515
|
+
document.removeEventListener("mousedown", onOutside);
|
|
516
|
+
unregister?.();
|
|
517
|
+
});
|
|
518
|
+
|
|
519
|
+
// --- 2. Sources -------------------------------------------------------------
|
|
520
|
+
|
|
521
|
+
const states = ref<Record<string, GuidedFamilyState>>({});
|
|
522
|
+
/** Familles cochees : vrai, faux, ou absent tant que leur nombre n'est pas connu. */
|
|
523
|
+
const families = reactive<Record<string, boolean>>({});
|
|
524
|
+
const blockChoice = reactive<Record<string, boolean | undefined>>({});
|
|
525
|
+
const expanded = reactive<Record<string, boolean>>({});
|
|
526
|
+
const searching = ref(false);
|
|
527
|
+
/** Les sujets de la derniere recherche : une nouvelle part quand ils changent. */
|
|
528
|
+
let searchedKey = "";
|
|
529
|
+
|
|
530
|
+
const familyState = (type: string): GuidedFamilyState => states.value[type] ?? { loading: true, failed: false, rows: [] };
|
|
531
|
+
const familyCount = (type: string) => familyState(type).rows.length;
|
|
532
|
+
const familyLabel = (type: string) => guidedFamilyLabel(type, lang.value);
|
|
533
|
+
|
|
534
|
+
const blockOf = (key: GuidedBlockKey) => blocks.value.find((block) => block.key === key)!;
|
|
535
|
+
const blockCount = (key: GuidedBlockKey) => blockOf(key).types.reduce((sum, type) => sum + familyCount(type), 0);
|
|
536
|
+
const blockLoading = (key: GuidedBlockKey) => blockOf(key).types.some((type) => familyState(type).loading);
|
|
537
|
+
/** Un bloc se coche de lui-meme quand il a des fiches, tant qu'on n'a rien choisi. */
|
|
538
|
+
const blockOn = (key: GuidedBlockKey) => blockChoice[key] ?? blockCount(key) > 0;
|
|
539
|
+
const toggleBlock = (key: GuidedBlockKey) => {
|
|
540
|
+
blockChoice[key] = !blockOn(key);
|
|
541
|
+
};
|
|
542
|
+
|
|
543
|
+
/** Les familles du bloc, celles qui ont le plus de fiches en tete. */
|
|
544
|
+
const sortedTypes = (block: GuidedBlock) =>
|
|
545
|
+
[...block.types].sort((a, b) => familyCount(b) - familyCount(a) || block.types.indexOf(a) - block.types.indexOf(b));
|
|
546
|
+
|
|
547
|
+
const countLabel = (count: number) => (count ? tr(`${count} fiches`, `${count} records`) : tr("rien trouvé", "nothing found"));
|
|
548
|
+
|
|
549
|
+
function startSearch() {
|
|
550
|
+
const key = subjects.value.map((subject) => subject.key).sort().join("|");
|
|
551
|
+
if (key === searchedKey) return;
|
|
552
|
+
searchedKey = key;
|
|
553
|
+
states.value = {};
|
|
554
|
+
for (const type of Object.keys(families)) delete families[type];
|
|
555
|
+
searching.value = true;
|
|
556
|
+
const mine = key;
|
|
557
|
+
collectGuided(subjects.value, lang.value, (type, state) => {
|
|
558
|
+
if (searchedKey !== mine) return;
|
|
559
|
+
states.value = { ...states.value, [type]: state };
|
|
560
|
+
// Une famille qui repond se coche si elle a des fiches, sauf choix deja fait.
|
|
561
|
+
if (!state.loading && families[type] === undefined) families[type] = state.rows.length > 0;
|
|
562
|
+
}).finally(() => {
|
|
563
|
+
if (searchedKey === mine) searching.value = false;
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
// --- 3. Description -------------------------------------------------------
|
|
568
|
+
|
|
569
|
+
const title = ref("");
|
|
570
|
+
const description = ref("");
|
|
571
|
+
const titleError = ref("");
|
|
572
|
+
/** Le texte propose la derniere fois : il ne remplace pas ce qu'on a ecrit soi-meme. */
|
|
573
|
+
let proposedTitle = "";
|
|
574
|
+
let proposedDescription = "";
|
|
575
|
+
|
|
576
|
+
const chosenTypes = computed(() =>
|
|
577
|
+
blocks.value.filter((block) => blockOn(block.key)).flatMap((block) => sortedTypes(block).filter((type) => families[type])),
|
|
578
|
+
);
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* Le nom d'usage d'une maladie : les dictionnaires CIM-10 disent « Tumeur
|
|
582
|
+
* maligne du sein » / « Malignant neoplasm of breast », on dit « Cancer du
|
|
583
|
+
* sein » / « Breast cancer ». Le cadrage (`scope`) garde le libelle exact.
|
|
584
|
+
*/
|
|
585
|
+
function diseaseName(label: string) {
|
|
586
|
+
if (lang.value === "en") {
|
|
587
|
+
const match = label.match(/^malignant neoplasm of (?:the )?(.+)$/i);
|
|
588
|
+
return match ? `${match[1]!.charAt(0).toUpperCase()}${match[1]!.slice(1).toLowerCase()} cancer` : label;
|
|
589
|
+
}
|
|
590
|
+
return label.replace(/^tumeur maligne\s+/i, "Cancer ");
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
/** « 3 Avis HAS » se lit mal : « Avis HAS (31) », et « 100+ » quand la liste est coupee. */
|
|
594
|
+
const familyCountLabel = (type: string) => {
|
|
595
|
+
const count = familyCount(type);
|
|
596
|
+
return `${familyLabel(type)} (${count >= 100 ? "100+" : count})`;
|
|
597
|
+
};
|
|
598
|
+
|
|
599
|
+
function propose() {
|
|
600
|
+
const diseases = subjects.value.filter((subject) => subject.focus === "disease");
|
|
601
|
+
const drugs = subjects.value.filter((subject) => subject.focus !== "disease");
|
|
602
|
+
const diseaseNames = diseases.map((subject) => diseaseName(subject.label));
|
|
603
|
+
const drugNames = drugs.map((subject) => subject.label);
|
|
604
|
+
|
|
605
|
+
// Le nom : le medicament et la maladie quand il y a les deux, sinon les
|
|
606
|
+
// deux premiers sujets ; le reste se compte.
|
|
607
|
+
const lead = drugNames.length && diseaseNames.length ? [drugNames[0]!, diseaseNames[0]!] : [...drugNames, ...diseaseNames].slice(0, 2);
|
|
608
|
+
const rest = subjects.value.length - lead.length;
|
|
609
|
+
const nextTitle = lead.join(drugNames.length && diseaseNames.length ? " · " : ", ") + (rest > 0 ? ` +${rest}` : "");
|
|
610
|
+
|
|
611
|
+
const withHint = (name: string, hint: string, code?: boolean) => (hint ? `${name} (${code && !/^(CIM|ORPHA)/.test(hint) ? `ATC ${hint}` : hint})` : name);
|
|
612
|
+
const chosen = blocks.value.filter((block) => blockOn(block.key));
|
|
613
|
+
const keptOf = (block: GuidedBlock) => sortedTypes(block).filter((type) => families[type]);
|
|
614
|
+
// Les blocs et leur nombre de sources : la liste des familles est deja dans le projet.
|
|
615
|
+
const followed = chosen
|
|
616
|
+
.filter((block) => keptOf(block).length)
|
|
617
|
+
.map((block) => `${block.label[lang.value]} (${keptOf(block).length} ${tr("sources", "sources")})`);
|
|
618
|
+
// Ce qui a ete trouve : les deux familles les plus fournies de chaque bloc.
|
|
619
|
+
const found = chosen.flatMap((block) => keptOf(block).filter((type) => familyCount(type)).slice(0, 2));
|
|
620
|
+
|
|
621
|
+
// Typographie : espace avant les deux-points en francais seulement.
|
|
622
|
+
const sep = lang.value === "en" ? ": " : " : ";
|
|
623
|
+
const lines = [
|
|
624
|
+
diseases.length
|
|
625
|
+
? `${tr("Maladies", "Diseases")}${sep}${diseases.map((subject, index) => withHint(diseaseNames[index]!, subject.hint)).join(", ")}.`
|
|
626
|
+
: "",
|
|
627
|
+
drugs.length
|
|
628
|
+
? `${tr("Médicaments", "Drugs")}${sep}${drugs.map((subject) => withHint(subject.label, subject.focus === "brand" ? subject.hint.toLowerCase() : subject.hint, subject.focus === "molecule")).join(", ")}.`
|
|
629
|
+
: "",
|
|
630
|
+
tr("Périmètre : France.", "Scope: France."),
|
|
631
|
+
followed.length ? `${tr("Sources suivies", "Followed sources")}${sep}${followed.join(", ")}.` : "",
|
|
632
|
+
found.length ? `${tr("À la création", "At creation")}${sep}${found.map(familyCountLabel).join(", ")}.` : "",
|
|
633
|
+
].filter(Boolean);
|
|
634
|
+
const nextDescription = lines.join("\n");
|
|
635
|
+
if (!title.value || title.value === proposedTitle) title.value = nextTitle;
|
|
636
|
+
if (!description.value || description.value === proposedDescription) description.value = nextDescription;
|
|
637
|
+
proposedTitle = nextTitle;
|
|
638
|
+
proposedDescription = nextDescription;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
// --- 4. Revue --------------------------------------------------------------
|
|
642
|
+
|
|
643
|
+
/** Les avis HAS d'abord : les autres familles se deduisent de leurs marques. */
|
|
644
|
+
const reviewTypes = computed(() => [...chosenTypes.value].sort((a, b) => Number(b === "FrHasBrand") - Number(a === "FrHasBrand")));
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* La revue se fait bloc par bloc, dans l'ordre ou les fiches se deduisent :
|
|
648
|
+
* le reglementaire (les avis HAS donnent les marques), puis les ventes et
|
|
649
|
+
* les prix, puis la science. Un bloc non choisi ne s'affiche pas.
|
|
650
|
+
*/
|
|
651
|
+
const REVIEW_ORDER: GuidedBlockKey[] = ["regulatory", "drugs", "science"];
|
|
652
|
+
const reviewBlocks = computed(() =>
|
|
653
|
+
REVIEW_ORDER.map((key) => blocks.value.find((block) => block.key === key))
|
|
654
|
+
.filter((block): block is GuidedBlock => !!block && blockOn(block.key))
|
|
655
|
+
.filter((block) => reviewTypes.value.some((type) => block.types.includes(type))),
|
|
656
|
+
);
|
|
657
|
+
const reviewPhase = ref(0);
|
|
658
|
+
// Un nouveau bloc se relit depuis son debut.
|
|
659
|
+
watch(reviewPhase, () => nextTick(() => document.querySelector(".rm-drawer__body")?.scrollTo({ top: 0 })));
|
|
660
|
+
|
|
661
|
+
const phaseTypes = computed(() => {
|
|
662
|
+
const block = reviewBlocks.value[reviewPhase.value];
|
|
663
|
+
// Dans l'ordre du bloc, pas par nombre de fiches : ce dont les autres se deduisent passe d'abord.
|
|
664
|
+
return block ? block.types.filter((type) => reviewTypes.value.includes(type)) : reviewTypes.value;
|
|
665
|
+
});
|
|
666
|
+
/** Les fiches decochees, par famille : tout le reste est garde. */
|
|
667
|
+
const unkept = reactive<Record<string, Set<string>>>({});
|
|
668
|
+
/** Une mention est decochee d'office : elle ne cite le sujet qu'en passant. */
|
|
669
|
+
const touched = reactive<Record<string, Set<string>>>({});
|
|
670
|
+
|
|
671
|
+
/** Les avis HAS gardes : les fiches qu'on en a deduites les suivent. */
|
|
672
|
+
const keptHas = computed(() => new Set(familyState("FrHasBrand").rows.filter((row) => isKept("FrHasBrand", row.id)).map((row) => row.id)));
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* Coche d'office : les mentions non, le reste oui. Une fiche deduite d'avis
|
|
676
|
+
* HAS se decoche avec eux quand on les decoche tous, sauf si une marque ou
|
|
677
|
+
* une molecule choisie comme sujet la tient. Une fiche qu'on a cochee ou
|
|
678
|
+
* decochee soi-meme garde ce choix : le tri deja fait ne bouge pas.
|
|
679
|
+
*/
|
|
680
|
+
function isKept(type: string, id: string): boolean {
|
|
681
|
+
if (touched[type]?.has(id)) return !unkept[type]?.has(id);
|
|
682
|
+
const row = familyState(type).rows.find((entry) => entry.id === id);
|
|
683
|
+
if (!row || row.kind === "mention") return false;
|
|
684
|
+
if (type !== "FrHasBrand" && row.viaHas?.length && !row.viaFixed) return row.viaHas.some((has) => keptHas.value.has(has));
|
|
685
|
+
return true;
|
|
686
|
+
}
|
|
687
|
+
function setKept(type: string, id: string, value: boolean) {
|
|
688
|
+
(touched[type] ??= new Set()).add(id);
|
|
689
|
+
const set = (unkept[type] ??= new Set());
|
|
690
|
+
if (value) set.delete(id);
|
|
691
|
+
else set.add(id);
|
|
692
|
+
}
|
|
693
|
+
const keptIds = (type: string) => familyState(type).rows.filter((row) => isKept(type, row.id)).map((row) => row.id);
|
|
694
|
+
const keptCount = (type: string) => keptIds(type).length;
|
|
695
|
+
const allKept = (type: string) => keptCount(type) === familyCount(type);
|
|
696
|
+
function toggleAll(type: string) {
|
|
697
|
+
const value = !allKept(type);
|
|
698
|
+
for (const row of familyState(type).rows) setKept(type, row.id, value);
|
|
699
|
+
}
|
|
700
|
+
/** Ce que dit la date la plus recente d'une marque, famille par famille. */
|
|
701
|
+
const DATE_LABEL: Record<string, { fr: string; en: string }> = {
|
|
702
|
+
FrDrugPrice: { fr: "dernier prix", en: "latest price" },
|
|
703
|
+
FrDrugPriceJo: { fr: "dernière publication", en: "latest publication" },
|
|
704
|
+
FrHasPut: { fr: "dernière autorisation", en: "latest authorisation" },
|
|
705
|
+
default: { fr: "dernière mise à jour", en: "latest update" },
|
|
706
|
+
};
|
|
707
|
+
|
|
708
|
+
/** « 2026-04-03 » en « 3 avr. 2026 » ; le reste passe tel quel. */
|
|
709
|
+
function shortDate(value: string) {
|
|
710
|
+
const day = value.match(/^(\d{4})-(\d{2})-(\d{2})/);
|
|
711
|
+
if (!day) return value;
|
|
712
|
+
return new Date(Number(day[1]), Number(day[2]) - 1, Number(day[3])).toLocaleDateString(lang.value === "en" ? "en-GB" : "fr-FR", {
|
|
713
|
+
day: "numeric",
|
|
714
|
+
month: "short",
|
|
715
|
+
year: "numeric",
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
/** Une entree de la revue : une fiche seule, ou une marque et ses fiches. */
|
|
720
|
+
interface ReviewEntry {
|
|
721
|
+
key: string;
|
|
722
|
+
title: string;
|
|
723
|
+
subtitle: string;
|
|
724
|
+
kind: GuidedMatchKind;
|
|
725
|
+
rows: GuidedRow[];
|
|
726
|
+
grouped: boolean;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
const KIND_RANK: Record<GuidedMatchKind, number> = { direct: 0, mention: 1, deduced: 2 };
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* Les familles que fr_drugs_app montre par marque se relisent par marque :
|
|
733
|
+
* nombre de fiches, molecule ou laboratoire, date la plus recente. Les
|
|
734
|
+
* autres restent fiche par fiche.
|
|
735
|
+
*/
|
|
736
|
+
function entriesOf(type: string): ReviewEntry[] {
|
|
737
|
+
const rows = familyState(type).rows;
|
|
738
|
+
const noun = GUIDED_GROUPED_TYPES[type];
|
|
739
|
+
if (!noun) return rows.map((row) => ({ key: row.id, title: row.title, subtitle: row.subtitle ?? "", kind: row.kind, rows: [row], grouped: false }));
|
|
740
|
+
const byBrand = new Map<string, GuidedRow[]>();
|
|
741
|
+
for (const row of rows) {
|
|
742
|
+
const key = row.group || row.title;
|
|
743
|
+
byBrand.set(key, [...(byBrand.get(key) ?? []), row]);
|
|
744
|
+
}
|
|
745
|
+
return [...byBrand].map(([brand, list]) => {
|
|
746
|
+
const kind = list.reduce<GuidedMatchKind>((best, row) => (KIND_RANK[row.kind] < KIND_RANK[best] ? row.kind : best), "deduced");
|
|
747
|
+
const hint = list.find((row) => row.groupHint)?.groupHint ?? "";
|
|
748
|
+
const latest = shortDate(list.map((row) => row.date ?? "").filter(Boolean).sort().at(-1) ?? "");
|
|
749
|
+
const count = `${list.length} ${noun[lang.value][list.length > 1 ? 1 : 0]}`;
|
|
750
|
+
return {
|
|
751
|
+
key: brand,
|
|
752
|
+
title: brand,
|
|
753
|
+
subtitle: [count, hint, latest ? `${(DATE_LABEL[type] ?? DATE_LABEL.default)![lang.value]} : ${latest}` : ""].filter(Boolean).join(" · "),
|
|
754
|
+
kind,
|
|
755
|
+
rows: list,
|
|
756
|
+
grouped: true,
|
|
757
|
+
};
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
const openGroups = reactive<Record<string, boolean>>({});
|
|
762
|
+
const groupKept = (type: string, rows: GuidedRow[]) => rows.filter((row) => isKept(type, row.id)).length;
|
|
763
|
+
function setGroupKept(type: string, rows: GuidedRow[], value: boolean) {
|
|
764
|
+
for (const row of rows) setKept(type, row.id, value);
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
const keptTotal = computed(() => reviewTypes.value.reduce((sum, type) => sum + keptCount(type), 0));
|
|
768
|
+
const blockKept = (block: GuidedBlock) => reviewTypes.value.filter((type) => block.types.includes(type)).reduce((sum, type) => sum + keptCount(type), 0);
|
|
769
|
+
|
|
770
|
+
const why = ref("");
|
|
771
|
+
|
|
772
|
+
/** Un extrait surligne : tout est echappe, puis les seules balises <mark> reviennent. */
|
|
773
|
+
function marked(value: string) {
|
|
774
|
+
return String(value ?? "")
|
|
775
|
+
.replace(/&/g, "&")
|
|
776
|
+
.replace(/</g, "<")
|
|
777
|
+
.replace(/>/g, ">")
|
|
778
|
+
.replace(/<(\/?)mark>/g, "<$1mark>");
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
// --- Creation --------------------------------------------------------------
|
|
782
|
+
|
|
783
|
+
const creating = ref(false);
|
|
784
|
+
const createError = ref("");
|
|
785
|
+
const createdId = ref("");
|
|
786
|
+
const addedTotal = ref(0);
|
|
787
|
+
const failedTypes = ref<string[]>([]);
|
|
788
|
+
|
|
789
|
+
/** Le cadrage structure (`projects.scope`), relu par la vue d'ensemble. */
|
|
790
|
+
function scope() {
|
|
791
|
+
const of = (focus: GuidedFocus) => subjects.value.filter((subject) => subject.focus === focus);
|
|
792
|
+
const diseases = of("disease").map(({ label, code, system }) => ({ label, ...(code ? { code, system } : {}) }));
|
|
793
|
+
const molecules = of("molecule").map(({ label }) => ({ label }));
|
|
794
|
+
const brands = of("brand").map(({ label }) => label);
|
|
795
|
+
return {
|
|
796
|
+
focus: subjects.value[0]?.focus,
|
|
797
|
+
...(diseases.length ? { diseases } : {}),
|
|
798
|
+
...(molecules.length ? { molecules } : {}),
|
|
799
|
+
...(brands.length ? { brands } : {}),
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
async function create() {
|
|
804
|
+
if (!title.value.trim()) {
|
|
805
|
+
step.value = "describe";
|
|
806
|
+
titleError.value = tr("Un nom est requis", "A name is required");
|
|
807
|
+
return;
|
|
808
|
+
}
|
|
809
|
+
creating.value = true;
|
|
810
|
+
createError.value = "";
|
|
811
|
+
try {
|
|
812
|
+
const project = await projects.create(title.value.trim(), description.value.trim(), scope());
|
|
813
|
+
projects.setActive(project.id);
|
|
814
|
+
createdId.value = project.id;
|
|
815
|
+
failedTypes.value = [];
|
|
816
|
+
let added = 0;
|
|
817
|
+
for (const type of reviewTypes.value) {
|
|
818
|
+
const ids = keptIds(type);
|
|
819
|
+
if (!ids.length) continue;
|
|
820
|
+
try {
|
|
821
|
+
await projects.add(ids, type, project.id, { silent: true });
|
|
822
|
+
added += ids.length;
|
|
823
|
+
} catch {
|
|
824
|
+
failedTypes.value.push(type);
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
addedTotal.value = added;
|
|
828
|
+
step.value = "done";
|
|
829
|
+
emit("created", project.id);
|
|
830
|
+
} catch (error: any) {
|
|
831
|
+
createError.value = error?.data?.error || error?.data?.message || tr("Le projet n'a pas été créé", "The project was not created");
|
|
832
|
+
} finally {
|
|
833
|
+
creating.value = false;
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
function openProject() {
|
|
838
|
+
const id = createdId.value;
|
|
839
|
+
close();
|
|
840
|
+
if (id) router.push(projects.pathOf(id));
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
// --- Navigation ------------------------------------------------------------
|
|
844
|
+
|
|
845
|
+
const canNext = computed(() => {
|
|
846
|
+
if (step.value === "subjects") return subjects.value.length > 0;
|
|
847
|
+
if (step.value === "describe") return !!title.value.trim();
|
|
848
|
+
return true;
|
|
849
|
+
});
|
|
850
|
+
|
|
851
|
+
/** L'etape la plus loin atteinte : on y revient d'un clic, sans repasser par les autres. */
|
|
852
|
+
const reached = ref(0);
|
|
853
|
+
|
|
854
|
+
/** Ce qu'une etape demande en entrant : la recherche des sources, la proposition du texte. */
|
|
855
|
+
function enter(target: Step) {
|
|
856
|
+
if (target !== "subjects") startSearch();
|
|
857
|
+
if (target === "describe" || target === "review") propose();
|
|
858
|
+
if (target === "review") {
|
|
859
|
+
titleError.value = "";
|
|
860
|
+
if (step.value !== "review") reviewPhase.value = 0;
|
|
861
|
+
}
|
|
862
|
+
step.value = target;
|
|
863
|
+
reached.value = Math.max(reached.value, stepIndex.value);
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
/** Une etape deja vue s'ouvre, tant que ce qu'elle suppose est encore la (des sujets, un nom). */
|
|
867
|
+
function canGoTo(index: number) {
|
|
868
|
+
if (creating.value || index === stepIndex.value || index > reached.value) return false;
|
|
869
|
+
if (index >= 1 && !subjects.value.length) return false;
|
|
870
|
+
if (index >= 3 && !title.value.trim()) return false;
|
|
871
|
+
return true;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
function goTo(index: number) {
|
|
875
|
+
if (canGoTo(index)) enter(STEPS[index]!.key);
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
function next() {
|
|
879
|
+
if (step.value === "review") {
|
|
880
|
+
reviewPhase.value = Math.min(reviewPhase.value + 1, reviewBlocks.value.length - 1);
|
|
881
|
+
return;
|
|
882
|
+
}
|
|
883
|
+
const target = STEPS[stepIndex.value + 1];
|
|
884
|
+
if (target && canNext.value) enter(target.key);
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
function back() {
|
|
888
|
+
if (step.value === "review" && reviewPhase.value > 0) {
|
|
889
|
+
reviewPhase.value -= 1;
|
|
890
|
+
return;
|
|
891
|
+
}
|
|
892
|
+
const index = stepIndex.value;
|
|
893
|
+
if (index > 0) step.value = STEPS[index - 1]!.key;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
const confirmingClose = ref(false);
|
|
897
|
+
|
|
898
|
+
/** Fermer apres avoir commence fait demander : ce qui a ete choisi serait perdu. */
|
|
899
|
+
function requestClose(value: boolean) {
|
|
900
|
+
if (value) return;
|
|
901
|
+
if (creating.value) return;
|
|
902
|
+
if (step.value !== "done" && subjects.value.length) confirmingClose.value = true;
|
|
903
|
+
else close();
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
function reset() {
|
|
907
|
+
step.value = "subjects";
|
|
908
|
+
reached.value = 0;
|
|
909
|
+
reviewPhase.value = 0;
|
|
910
|
+
query.value = "";
|
|
911
|
+
subjects.value = [];
|
|
912
|
+
suggestions.value = { diseases: [], molecules: [], brands: [] };
|
|
913
|
+
states.value = {};
|
|
914
|
+
searchedKey = "";
|
|
915
|
+
for (const record of [families, blockChoice, expanded, unkept, touched, openGroups] as Record<string, unknown>[]) {
|
|
916
|
+
for (const key of Object.keys(record)) delete record[key];
|
|
917
|
+
}
|
|
918
|
+
title.value = "";
|
|
919
|
+
description.value = "";
|
|
920
|
+
proposedTitle = "";
|
|
921
|
+
proposedDescription = "";
|
|
922
|
+
titleError.value = "";
|
|
923
|
+
createError.value = "";
|
|
924
|
+
createdId.value = "";
|
|
925
|
+
addedTotal.value = 0;
|
|
926
|
+
failedTypes.value = [];
|
|
927
|
+
why.value = "";
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
function close() {
|
|
931
|
+
confirmingClose.value = false;
|
|
932
|
+
emit("update:modelValue", false);
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
watch(
|
|
936
|
+
() => props.modelValue,
|
|
937
|
+
(open) => {
|
|
938
|
+
if (!open) return;
|
|
939
|
+
reset();
|
|
940
|
+
measureRail();
|
|
941
|
+
preloadGuidedSubjects();
|
|
942
|
+
nextTick(() => searchInput.value?.focus());
|
|
943
|
+
},
|
|
944
|
+
{ immediate: true },
|
|
945
|
+
);
|
|
946
|
+
</script>
|
|
947
|
+
|
|
948
|
+
<style scoped>
|
|
949
|
+
.prj_gd_head {
|
|
950
|
+
display: flex;
|
|
951
|
+
flex-direction: column;
|
|
952
|
+
gap: var(--space-8, 8px);
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
.prj_gd_title {
|
|
956
|
+
margin: 0;
|
|
957
|
+
font-size: var(--font-18, 18px);
|
|
958
|
+
font-weight: var(--weight-semibold, 600);
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
.prj_gd_steps {
|
|
962
|
+
display: flex;
|
|
963
|
+
flex-wrap: wrap;
|
|
964
|
+
gap: 16px;
|
|
965
|
+
margin: 0;
|
|
966
|
+
padding: 0;
|
|
967
|
+
list-style: none;
|
|
968
|
+
color: var(--text-secondary);
|
|
969
|
+
font-size: var(--font-12, 12px);
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
.prj_gd_step {
|
|
973
|
+
display: inline-flex;
|
|
974
|
+
align-items: center;
|
|
975
|
+
gap: 6px;
|
|
976
|
+
padding: 2px 4px;
|
|
977
|
+
border: 0;
|
|
978
|
+
border-radius: 6px;
|
|
979
|
+
background: none;
|
|
980
|
+
color: inherit;
|
|
981
|
+
font: inherit;
|
|
982
|
+
cursor: pointer;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
.prj_gd_step:not(:disabled):hover {
|
|
986
|
+
background: var(--bg-hover);
|
|
987
|
+
color: var(--text-primary);
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
.prj_gd_step:disabled {
|
|
991
|
+
cursor: default;
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
.prj_gd_steps li.is-current {
|
|
995
|
+
color: var(--text-primary);
|
|
996
|
+
font-weight: var(--weight-semibold, 600);
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
.prj_gd_step_num {
|
|
1000
|
+
display: inline-flex;
|
|
1001
|
+
align-items: center;
|
|
1002
|
+
justify-content: center;
|
|
1003
|
+
width: 20px;
|
|
1004
|
+
height: 20px;
|
|
1005
|
+
border: 1px solid var(--border-default);
|
|
1006
|
+
border-radius: 50%;
|
|
1007
|
+
font-size: 11px;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
.prj_gd_steps li.is-current .prj_gd_step_num,
|
|
1011
|
+
.prj_gd_steps li.is-done .prj_gd_step_num {
|
|
1012
|
+
border-color: var(--color-primary);
|
|
1013
|
+
background: var(--color-primary);
|
|
1014
|
+
color: var(--text-on-primary, #fff);
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
.prj_gd_body {
|
|
1018
|
+
display: flex;
|
|
1019
|
+
flex-direction: column;
|
|
1020
|
+
gap: 16px;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
.prj_gd_lead {
|
|
1024
|
+
margin: 0;
|
|
1025
|
+
color: var(--text-secondary);
|
|
1026
|
+
font-size: var(--font-14, 14px);
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
.prj_gd_hint,
|
|
1030
|
+
.prj_gd_empty {
|
|
1031
|
+
margin: 0;
|
|
1032
|
+
color: var(--text-secondary);
|
|
1033
|
+
font-size: var(--font-12, 12px);
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
.prj_gd_empty {
|
|
1037
|
+
padding: 12px;
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
.prj_gd_error {
|
|
1041
|
+
margin: 0;
|
|
1042
|
+
color: var(--color-error, #c0392b);
|
|
1043
|
+
font-size: var(--font-14, 14px);
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
/* Barre de sujets : la recherche d'en-tete d'oip7, groupee par nature. */
|
|
1047
|
+
.prj_gd_search {
|
|
1048
|
+
position: relative;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
.prj_gd_search_box {
|
|
1052
|
+
display: flex;
|
|
1053
|
+
align-items: center;
|
|
1054
|
+
gap: 8px;
|
|
1055
|
+
padding: 8px 12px;
|
|
1056
|
+
border: 1px solid var(--border-default);
|
|
1057
|
+
border-radius: 8px;
|
|
1058
|
+
background: var(--bg-surface);
|
|
1059
|
+
color: var(--text-secondary);
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
.prj_gd_search_box:focus-within {
|
|
1063
|
+
border-color: var(--color-primary);
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
.prj_gd_search_box input {
|
|
1067
|
+
flex: 1;
|
|
1068
|
+
min-width: 0;
|
|
1069
|
+
border: 0;
|
|
1070
|
+
outline: 0;
|
|
1071
|
+
background: transparent;
|
|
1072
|
+
color: var(--text-primary);
|
|
1073
|
+
font: inherit;
|
|
1074
|
+
font-size: var(--font-14, 14px);
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
.prj_gd_suggest {
|
|
1078
|
+
position: absolute;
|
|
1079
|
+
top: calc(100% + 6px);
|
|
1080
|
+
right: 0;
|
|
1081
|
+
left: 0;
|
|
1082
|
+
z-index: 5;
|
|
1083
|
+
max-height: 380px;
|
|
1084
|
+
padding: 6px 0;
|
|
1085
|
+
overflow-y: auto;
|
|
1086
|
+
border: 1px solid var(--border-default);
|
|
1087
|
+
border-radius: 8px;
|
|
1088
|
+
background: var(--bg-surface);
|
|
1089
|
+
box-shadow: var(--shadow-lg, 0 8px 24px rgb(0 0 0 / 12%));
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
.prj_gd_group {
|
|
1093
|
+
display: flex;
|
|
1094
|
+
align-items: center;
|
|
1095
|
+
gap: 8px;
|
|
1096
|
+
padding: 6px 12px 4px;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
.prj_gd_group_label {
|
|
1100
|
+
color: var(--text-secondary);
|
|
1101
|
+
font-size: 11px;
|
|
1102
|
+
font-weight: var(--weight-semibold, 600);
|
|
1103
|
+
letter-spacing: 0.04em;
|
|
1104
|
+
text-transform: uppercase;
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
.prj_gd_group_count {
|
|
1108
|
+
color: var(--text-secondary);
|
|
1109
|
+
font-size: 10px;
|
|
1110
|
+
font-variant-numeric: tabular-nums;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
.prj_gd_option {
|
|
1114
|
+
display: flex;
|
|
1115
|
+
align-items: center;
|
|
1116
|
+
gap: 10px;
|
|
1117
|
+
width: 100%;
|
|
1118
|
+
padding: 8px 12px;
|
|
1119
|
+
border: 0;
|
|
1120
|
+
background: none;
|
|
1121
|
+
color: inherit;
|
|
1122
|
+
font: inherit;
|
|
1123
|
+
text-align: left;
|
|
1124
|
+
cursor: pointer;
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
.prj_gd_option.is-active {
|
|
1128
|
+
background: var(--bg-hover);
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
.prj_gd_option_icon {
|
|
1132
|
+
display: inline-flex;
|
|
1133
|
+
flex-shrink: 0;
|
|
1134
|
+
align-items: center;
|
|
1135
|
+
justify-content: center;
|
|
1136
|
+
width: 28px;
|
|
1137
|
+
height: 28px;
|
|
1138
|
+
border-radius: 6px;
|
|
1139
|
+
background: var(--bg-surface-3, var(--bg-hover));
|
|
1140
|
+
color: var(--color-primary);
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
.prj_gd_option_text {
|
|
1144
|
+
display: flex;
|
|
1145
|
+
flex: 1;
|
|
1146
|
+
flex-direction: column;
|
|
1147
|
+
min-width: 0;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
.prj_gd_option_title {
|
|
1151
|
+
overflow: hidden;
|
|
1152
|
+
font-size: var(--font-14, 14px);
|
|
1153
|
+
font-weight: var(--weight-medium, 500);
|
|
1154
|
+
text-overflow: ellipsis;
|
|
1155
|
+
white-space: nowrap;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
.prj_gd_option_hint {
|
|
1159
|
+
color: var(--text-secondary);
|
|
1160
|
+
font-size: var(--font-12, 12px);
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
.prj_gd_option.is-picked .prj_gd_option_title {
|
|
1164
|
+
color: var(--color-primary);
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
.prj_gd_chips {
|
|
1168
|
+
display: flex;
|
|
1169
|
+
flex-wrap: wrap;
|
|
1170
|
+
gap: 8px;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
.prj_gd_chip_code {
|
|
1174
|
+
opacity: 0.7;
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
/* Blocs de sources : un carre par bloc, ses sources se deplient dessous. */
|
|
1178
|
+
.prj_gd_blocks {
|
|
1179
|
+
display: grid;
|
|
1180
|
+
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
|
|
1181
|
+
gap: 12px;
|
|
1182
|
+
align-items: start;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
.prj_gd_block {
|
|
1186
|
+
display: flex;
|
|
1187
|
+
flex-direction: column;
|
|
1188
|
+
border: 1px solid var(--border-default);
|
|
1189
|
+
border-radius: 10px;
|
|
1190
|
+
background: var(--bg-surface);
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
.prj_gd_block.is-on {
|
|
1194
|
+
border-color: var(--color-primary);
|
|
1195
|
+
box-shadow: 0 0 0 1px var(--color-primary);
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
.prj_gd_block_main {
|
|
1199
|
+
position: relative;
|
|
1200
|
+
display: flex;
|
|
1201
|
+
flex-direction: column;
|
|
1202
|
+
align-items: flex-start;
|
|
1203
|
+
gap: 10px;
|
|
1204
|
+
padding: 14px;
|
|
1205
|
+
border: 0;
|
|
1206
|
+
background: none;
|
|
1207
|
+
color: inherit;
|
|
1208
|
+
font: inherit;
|
|
1209
|
+
text-align: left;
|
|
1210
|
+
cursor: pointer;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
.prj_gd_block_icon {
|
|
1214
|
+
display: inline-flex;
|
|
1215
|
+
align-items: center;
|
|
1216
|
+
justify-content: center;
|
|
1217
|
+
width: 36px;
|
|
1218
|
+
height: 36px;
|
|
1219
|
+
border-radius: 8px;
|
|
1220
|
+
background: var(--bg-surface-3, var(--bg-hover));
|
|
1221
|
+
color: var(--color-primary);
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
.prj_gd_block_head {
|
|
1225
|
+
display: flex;
|
|
1226
|
+
align-items: center;
|
|
1227
|
+
justify-content: space-between;
|
|
1228
|
+
gap: 8px;
|
|
1229
|
+
width: 100%;
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
.prj_gd_block_check {
|
|
1233
|
+
display: inline-flex;
|
|
1234
|
+
flex-shrink: 0;
|
|
1235
|
+
color: var(--color-primary);
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
.prj_gd_block_title {
|
|
1239
|
+
font-size: var(--font-16, 16px);
|
|
1240
|
+
font-weight: var(--weight-semibold, 600);
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
.prj_gd_block_desc {
|
|
1244
|
+
color: var(--text-secondary);
|
|
1245
|
+
font-size: var(--font-12, 12px);
|
|
1246
|
+
line-height: 1.4;
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
.prj_gd_block_count {
|
|
1250
|
+
display: inline-flex;
|
|
1251
|
+
align-items: center;
|
|
1252
|
+
min-height: 20px;
|
|
1253
|
+
color: var(--text-secondary);
|
|
1254
|
+
font-size: var(--font-12, 12px);
|
|
1255
|
+
font-weight: var(--weight-medium, 500);
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
.prj_gd_block_more {
|
|
1259
|
+
display: flex;
|
|
1260
|
+
align-items: center;
|
|
1261
|
+
justify-content: space-between;
|
|
1262
|
+
padding: 10px 14px;
|
|
1263
|
+
border: 0;
|
|
1264
|
+
border-top: 1px solid var(--border-default);
|
|
1265
|
+
background: none;
|
|
1266
|
+
color: var(--color-primary);
|
|
1267
|
+
font: inherit;
|
|
1268
|
+
font-size: var(--font-12, 12px);
|
|
1269
|
+
font-weight: var(--weight-medium, 500);
|
|
1270
|
+
cursor: pointer;
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
.prj_gd_families {
|
|
1274
|
+
display: flex;
|
|
1275
|
+
flex-direction: column;
|
|
1276
|
+
gap: 6px;
|
|
1277
|
+
margin: 0;
|
|
1278
|
+
padding: 4px 14px 14px;
|
|
1279
|
+
list-style: none;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
.prj_gd_family {
|
|
1283
|
+
display: flex;
|
|
1284
|
+
align-items: center;
|
|
1285
|
+
justify-content: space-between;
|
|
1286
|
+
gap: 8px;
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
.prj_gd_family_count,
|
|
1290
|
+
.prj_gd_review_count {
|
|
1291
|
+
flex-shrink: 0;
|
|
1292
|
+
min-width: 24px;
|
|
1293
|
+
color: var(--text-secondary);
|
|
1294
|
+
font-size: var(--font-12, 12px);
|
|
1295
|
+
font-variant-numeric: tabular-nums;
|
|
1296
|
+
text-align: right;
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
/* Revue */
|
|
1300
|
+
.prj_gd_legend {
|
|
1301
|
+
display: flex;
|
|
1302
|
+
flex-wrap: wrap;
|
|
1303
|
+
gap: 12px;
|
|
1304
|
+
color: var(--text-secondary);
|
|
1305
|
+
font-size: var(--font-12, 12px);
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
.prj_gd_legend_item {
|
|
1309
|
+
display: inline-flex;
|
|
1310
|
+
align-items: center;
|
|
1311
|
+
gap: 6px;
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
.prj_gd_phases {
|
|
1315
|
+
display: flex;
|
|
1316
|
+
flex-wrap: wrap;
|
|
1317
|
+
gap: 8px;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
.prj_gd_phase {
|
|
1321
|
+
display: inline-flex;
|
|
1322
|
+
align-items: center;
|
|
1323
|
+
gap: 6px;
|
|
1324
|
+
padding: 6px 12px;
|
|
1325
|
+
border: 1px solid var(--border-default);
|
|
1326
|
+
border-radius: 999px;
|
|
1327
|
+
background: var(--bg-surface);
|
|
1328
|
+
color: var(--text-secondary);
|
|
1329
|
+
font: inherit;
|
|
1330
|
+
font-size: var(--font-12, 12px);
|
|
1331
|
+
font-weight: var(--weight-medium, 500);
|
|
1332
|
+
cursor: pointer;
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
.prj_gd_phase.is-current {
|
|
1336
|
+
border-color: var(--color-primary);
|
|
1337
|
+
color: var(--color-primary);
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
.prj_gd_phase_count {
|
|
1341
|
+
font-variant-numeric: tabular-nums;
|
|
1342
|
+
opacity: 0.8;
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
.prj_gd_review {
|
|
1346
|
+
border: 1px solid var(--border-default);
|
|
1347
|
+
border-radius: 10px;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
.prj_gd_review_head {
|
|
1351
|
+
display: flex;
|
|
1352
|
+
align-items: center;
|
|
1353
|
+
gap: 12px;
|
|
1354
|
+
padding: 10px 14px;
|
|
1355
|
+
cursor: pointer;
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
.prj_gd_review_title {
|
|
1359
|
+
flex: 1;
|
|
1360
|
+
font-size: var(--font-14, 14px);
|
|
1361
|
+
font-weight: var(--weight-semibold, 600);
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
.prj_gd_rows {
|
|
1365
|
+
display: flex;
|
|
1366
|
+
flex-direction: column;
|
|
1367
|
+
margin: 0;
|
|
1368
|
+
padding: 0 14px 10px;
|
|
1369
|
+
list-style: none;
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
.prj_gd_row {
|
|
1373
|
+
padding: 8px 0;
|
|
1374
|
+
border-top: 1px solid var(--border-default);
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
.prj_gd_row_main {
|
|
1378
|
+
display: flex;
|
|
1379
|
+
align-items: flex-start;
|
|
1380
|
+
gap: 10px;
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
.prj_gd_row_main > :first-child {
|
|
1384
|
+
flex: 1;
|
|
1385
|
+
min-width: 0;
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
.prj_gd_rows--nested {
|
|
1389
|
+
margin: 6px 0 0 28px;
|
|
1390
|
+
padding: 0;
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
.prj_gd_rows--nested .prj_gd_row {
|
|
1394
|
+
padding: 4px 0;
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
.prj_gd_link {
|
|
1398
|
+
flex-shrink: 0;
|
|
1399
|
+
padding: 0;
|
|
1400
|
+
border: 0;
|
|
1401
|
+
background: none;
|
|
1402
|
+
color: var(--color-primary);
|
|
1403
|
+
font: inherit;
|
|
1404
|
+
font-size: var(--font-12, 12px);
|
|
1405
|
+
cursor: pointer;
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
.prj_gd_why {
|
|
1409
|
+
margin: 8px 0 0 28px;
|
|
1410
|
+
padding: 10px 12px;
|
|
1411
|
+
border-radius: 8px;
|
|
1412
|
+
background: var(--bg-surface-3, var(--bg-hover));
|
|
1413
|
+
font-size: var(--font-12, 12px);
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
.prj_gd_why dt {
|
|
1417
|
+
margin-top: 6px;
|
|
1418
|
+
color: var(--text-secondary);
|
|
1419
|
+
font-weight: var(--weight-semibold, 600);
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
.prj_gd_why dt:first-child {
|
|
1423
|
+
margin-top: 0;
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
.prj_gd_why dd {
|
|
1427
|
+
margin: 2px 0 0;
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
.prj_gd_why :deep(mark) {
|
|
1431
|
+
border-radius: 2px;
|
|
1432
|
+
background: var(--color-highlight, #fff3b0);
|
|
1433
|
+
color: inherit;
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
.prj_gd_done {
|
|
1437
|
+
align-items: center;
|
|
1438
|
+
padding: 48px 0;
|
|
1439
|
+
color: var(--color-primary);
|
|
1440
|
+
text-align: center;
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
.prj_gd_done .prj_gd_title {
|
|
1444
|
+
color: var(--text-primary);
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
/* Rotative discrete, a la taille du texte : on cherche, sans prendre la place du resultat. */
|
|
1448
|
+
.prj_gd_spin {
|
|
1449
|
+
display: inline-block;
|
|
1450
|
+
flex-shrink: 0;
|
|
1451
|
+
width: 12px;
|
|
1452
|
+
height: 12px;
|
|
1453
|
+
border: 2px solid var(--border-default);
|
|
1454
|
+
border-top-color: var(--color-primary);
|
|
1455
|
+
border-radius: 50%;
|
|
1456
|
+
animation: prj_gd_spin 0.8s linear infinite;
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
@keyframes prj_gd_spin {
|
|
1460
|
+
to {
|
|
1461
|
+
transform: rotate(360deg);
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
.prj_gd_footer {
|
|
1466
|
+
display: flex;
|
|
1467
|
+
align-items: center;
|
|
1468
|
+
gap: 8px;
|
|
1469
|
+
width: 100%;
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
.prj_gd_footer_gap {
|
|
1473
|
+
flex: 1;
|
|
1474
|
+
}
|
|
1475
|
+
</style>
|