Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenQuizz
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
10
Issues
10
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Weber Rodolphe
OpenQuizz
Commits
e053b284
Commit
e053b284
authored
3 years ago
by
Jérémie Passerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajout d'un composant pour charger des fichiers
parent
940e5248
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
23 deletions
+60
-23
Contenu.vue
src/Contenu.vue
+2
-2
ImporterFichier.vue
src/ImporterFichier.vue
+21
-2
Index.vue
src/Index.vue
+11
-2
Maj.vue
src/Maj.vue
+8
-12
Volet_Base.vue
src/components/Volet_Base.vue
+10
-5
Service.js
src/service/Service.js
+8
-0
No files found.
src/Contenu.vue
View file @
e053b284
...
...
@@ -28,9 +28,9 @@ export default {
* @vuese
* Transmission de l'information concernant la création d'un nouveau contenu
*/
newContenu
:
function
()
{
newContenu
:
function
(
event
)
{
// Evenement à destination de Volet_Base
this
.
$emit
(
"newContenu"
)
this
.
$emit
(
"newContenu"
,
{
source
:
event
.
source
}
)
},
/**
...
...
This diff is collapsed.
Click to expand it.
src/ImporterFichier.vue
View file @
e053b284
<
template
>
$END$
<div
style=
"text-align: center"
>
Je suis la page pour charger un contenu
<br>
<input
type=
"file"
name=
"fichier"
@
change=
"onUploadFiles"
>
</div>
</
template
>
<
script
>
import
Service
from
"./service/Service"
;
export
default
{
name
:
"ImporterFichier"
name
:
"ImporterFichier"
,
methods
:
{
onUploadFiles
:
function
(
event
)
{
const
file
=
event
.
target
.
files
.
item
(
0
)
let
formData
=
new
FormData
();
formData
.
append
(
'file'
,
file
);
Service
.
uploaderContenuPerso
(
formData
)
}
}
}
</
script
>
...
...
This diff is collapsed.
Click to expand it.
src/Index.vue
View file @
e053b284
...
...
@@ -16,6 +16,7 @@
<Tags
v-show=
"etat === 'Tags'"
></Tags>
<p
style=
"text-align: center"
v-show=
"errorLogin"
>
{{
errorMessage
}}
</p>
<NewContenu
v-show=
"etat === 'newContenu'"
v-bind:auteur=
"auteur"
@
contenuAjoute=
"ajouterUnContenu"
@
retourArriere=
"retourArriere"
></NewContenu>
<ImporterFichier
v-show=
"etat === 'importContenu'"
></ImporterFichier>
</div>
</
template
>
...
...
@@ -27,6 +28,7 @@ import Maj from "./Maj";
import
Profil
from
"./Profil"
;
import
Tags
from
"./Tags"
;
import
NewContenu
from
"./NewContenu"
;
import
ImporterFichier
from
"./ImporterFichier"
;
// import Service from "./service/Service";
// import showdown from "showdown"
...
...
@@ -93,8 +95,14 @@ export default {
* @vuese
* Changement de l'affichage pour passer en mode de création de contenu
*/
newContenu
:
function
()
{
newContenu
:
function
(
event
)
{
if
(
event
.
source
===
'1'
)
{
// alert("event.source : " + event.source)
this
.
etat
=
"newContenu"
}
else
if
(
event
.
source
===
'2'
)
{
this
.
etat
=
"importContenu"
}
},
/**
* @vuese
...
...
@@ -127,6 +135,7 @@ export default {
},
components
:{
ImporterFichier
,
NewContenu
,
Login
,
Contenu
,
...
...
This diff is collapsed.
Click to expand it.
src/Maj.vue
View file @
e053b284
...
...
@@ -16,21 +16,21 @@
<tr>
<th>
Titre
</th>
<th>
Auteur
</th>
<th>
Version
actuell
e
</th>
<th>
Date
Version actuelle
</th>
<th>
Version
courant
e
</th>
<th>
Date
Maj
</th>
<th>
Accepter
</th>
<th>
Refuser
</th>
</tr>
<tbody>
<tr
v-for=
"(item, index) in contenusRecu"
:key=
"index"
>
<td
:id=
"JSON.stringify(item._id)"
v-on:click=
"consulterContenuMaj(item)"
>
Contenu1
</td>
<td
:id=
"JSON.stringify(item._id)"
v-on:click=
"consulterContenuMaj(item)"
>
{{
item
.
titre
}}
</td>
<b-popover
:target=
"JSON.stringify(item._id)"
v-on:show=
"rechercherTexte(item.idContenuEnCours)"
triggers=
"hover"
placement=
"bottom"
>
<p
id=
"beautiful"
v-html=
"texteDuContenu"
></p>
</b-popover>
<td>
{{
item
.
auteurDemande
}}
</td>
<td>
prout :
{{
contenusRecu
.
length
}}
</td>
<td>
{{
item
.
version_en_cours
}}
</td>
<td>
01/06/2021
</td>
<td
id=
"valider"
v-on:click=
"gererPublication(item, 'o')"
><img
v-bind:src=
"imageCoche"
alt=
''
height=
20
width=
20
></td>
<td
id=
"refuser"
v-on:click=
"gererPublication(item, 'n')"
><img
v-bind:src=
"imageCroix"
alt=
''
height=
20
width=
20
></td>
...
...
@@ -54,7 +54,7 @@
<th>
Titre
</th>
<th>
Auteur
</th>
<th>
Version
proposé
e
</th>
<th>
Version
courant
e
</th>
<th>
Date Version proposée
</th>
<th>
Etat
</th>
<th>
Conserver
</th>
...
...
@@ -65,8 +65,8 @@
<tbody>
<tr
v-for=
"(item, index) in contenusPropose"
:key=
"index"
>
<td
:id=
"JSON.stringify(item._id)"
v-on:click=
"consulterContenuMaj(item)"
>
Contenu1
</td>
<b-popover
:target=
"JSON.stringify(item._id)"
v-on:show=
"rechercherTexte(item.
_id, 'banque'
)"
triggers=
"hover"
placement=
"bottom"
>
<td
:id=
"JSON.stringify(item._id)"
v-on:click=
"consulterContenuMaj(item)"
>
{{
item
.
titre
}}
</td>
<b-popover
:target=
"JSON.stringify(item._id)"
v-on:show=
"rechercherTexte(item.
idContenuEnCours
)"
triggers=
"hover"
placement=
"bottom"
>
<p
v-html=
"texteDuContenu"
></p>
</b-popover>
<td>
{{
item
.
auteurContenu
}}
</td>
...
...
@@ -169,10 +169,7 @@ export default {
// auteurContenu -> undefined == nous sommes sur une maj tiers. Le cas contraire = maj d'un contenu perso à faire
if
(
item
.
auteurContenu
===
undefined
)
{
let
test
=
item
.
_id
console
.
log
(
"id item"
)
console
.
log
(
test
)
data
=
{
id_tiers
:
JSON
.
stringify
(
item
.
_id
),
reponse
:
reponse
,
auteur
:
this
.
auteur
}
data
=
{
id_tiers
:
JSON
.
stringify
(
item
.
_id
),
reponse
:
reponse
,
auteur
:
this
.
auteur
,
titre
:
item
.
titre
}
Service
.
gererMajTiers
(
data
).
then
(
function
()
{
that
.
contenusRecu
=
that
.
contenusRecu
.
filter
(
contenu
=>
contenu
.
_id
!==
item
.
_id
)
if
(
that
.
isContenuMajVide
()
)
...
...
@@ -211,7 +208,6 @@ export default {
let
reception
=
response
.
data
that
.
contenusRecu
=
[]
for
(
let
i
=
0
;
i
<
reception
.
length
;
i
++
)
{
if
(
reception
[
i
].
etat
===
"enCours"
)
{
that
.
contenusRecu
.
push
(
reception
[
i
])
...
...
This diff is collapsed.
Click to expand it.
src/components/Volet_Base.vue
View file @
e053b284
...
...
@@ -86,8 +86,8 @@
</b-popover>
<td>
{{ item.auteur }}
</td>
<td>
{{item.versionEnCours.numero}}
</td>
<td>
{{item.versionEnCours}}
</td>
<td
class=
"prout"
>
{{item.versionEnCours}}
</td>
<td>
{{item.versionEnCours
.date
}}
</td>
<td
class=
"prout"
>
{{item.versionEnCours
.popularite
}}
</td>
<td>
{{item.note}}
</td>
<td
v-b-popover
.
hover
.
bottom=
"item.tags_banque_fixes.toString()"
>
{{item.tags_banque_fixes.toString()}}
</td>
...
...
@@ -107,7 +107,12 @@
<Modifier
_Contenu
v-bind:auteur=
"auteur"
v-bind:texteDuContenu =
"texteDuContenu"
v-bind:contenuCliqueProvenance =
"contenuCliqueProvenance"
v-show=
"!modeConsultation && modeModification"
@
choixModif=
"choixModif"
v-bind:titreContenu=
"titreContenu"
/>
<div
v-show=
"panierChoisi && !modeConsultation"
class=
"circle"
v-on:click=
"ajouterContenu"
v-bind:style=
"{'margin-left': '95%'}"
>
<div
id=
"ajouterContenu"
v-show=
"panierChoisi && !modeConsultation"
class=
"circle"
v-bind:style=
"{'margin-left': '95%'}"
>
<b-popover
target=
"ajouterContenu"
triggers=
"click"
placement=
"lefttop"
>
<
template
#
title
>
Choix :
</
template
>
<button
v-on:click=
"ajouterContenu('1')"
v-bind:style=
"'height: auto; width: auto'"
>
1. Créer un markdown
</button>
<button
v-on:click=
"ajouterContenu('2')"
v-bind:style=
"'height: auto; width: auto'"
>
2. Importer un xml moodle
</button>
</b-popover>
</div>
</div>
</template>
...
...
@@ -338,9 +343,9 @@ export default {
* @vuese
* Evenement pour lancer le composant de création de contenu
*/
ajouterContenu
:
function
()
{
ajouterContenu
:
function
(
nombre
)
{
// Evenement pour lancer le composant de création de contenu
this
.
$emit
(
"newContenu"
)
this
.
$emit
(
"newContenu"
,
{
source
:
nombre
}
)
},
/**
* @vuese
...
...
This diff is collapsed.
Click to expand it.
src/service/Service.js
View file @
e053b284
...
...
@@ -44,6 +44,14 @@ export default {
creerContenuPerso
(
data
)
{
return
axios
.
post
(
urlBase
+
contenus
+
"addContenu"
,
data
,
this
.
getHeader
(
localStorage
.
token
))
},
uploaderContenuPerso
(
data
){
return
axios
.
post
(
urlBase
+
contenus
+
"uploadContenu"
,
data
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
,
Authorization
:
"Bearer "
+
localStorage
.
token
,
}
})
},
creerContenuTiers
(
data
)
{
return
axios
.
patch
(
urlBase
+
contenus
+
"ajouterTiers"
,
data
,
this
.
getHeader
(
localStorage
.
token
))
},
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment