Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pierre-Yves Gicquel
albiziapp
Commits
575734d0
Commit
575734d0
authored
Aug 20, 2019
by
gick
Browse files
changed sort order for species and vernac
parent
29c230e8
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/main.js
View file @
575734d0
...
...
@@ -26,6 +26,10 @@ import vSelect from 'vue-select'
// import VueOnsen from 'vue-onsenui/esm'; // For ESM
// import * as OnsenComponents from './onsen-components'; // For ESM
import
storeLike
from
'
./store/routeStore
'
;
import
floreData
from
'
./store/modules/floreData
'
;
import
commonData
from
'
./store/modules/commonData
'
;
storeLike
.
modules
.
floreData
=
floreData
storeLike
.
modules
.
commonData
=
commonData
import
CustomToolbar
from
'
./partials/CustomToolbar.vue
'
;
import
AppNavigator
from
'
./AppNavigator.vue
'
;
import
'
vue-select/dist/vue-select.css
'
;
...
...
src/pages/Releve.vue
View file @
575734d0
...
...
@@ -8,7 +8,7 @@
<ons-list>
<ons-list-header>
{{
$t
(
'
information
'
)
}}
</ons-list-header>
<ons-list-item
v-show=
"releve.authorName"
>
{{
$t
(
'
recordAuthor
'
)
}}
:
{{
releve
.
authorName
}}
</ons-list-item>
<ons-list-item
v-show=
"releve.specie
s
"
>
{{
$t
(
'
specie
'
)
}}
:
{{
releve
.
specie
s
}}
</ons-list-item>
<ons-list-item
v-show=
"releve.specie"
>
{{
$t
(
'
specie
'
)
}}
:
{{
releve
.
specie
}}
</ons-list-item>
<ons-list-item
v-show=
"releve.genus"
>
{{
$t
(
'
genus
'
)
}}
:
{{
releve
.
genus
}}
</ons-list-item>
<ons-list-item
v-show=
"releve.commonGenus"
>
Genre vernac. :
{{
releve
.
commonGenus
}}
</ons-list-item>
<ons-list-item
v-show=
"releve.common"
>
{{
$t
(
'
common
'
)
}}
:
{{
releve
.
common
}}
</ons-list-item>
...
...
src/pages/SimplePage.vue
View file @
575734d0
...
...
@@ -19,7 +19,7 @@
<v-ons-button
modifier=
"large"
@
click=
"viewItem"
v-if=
"releve.specie
s
.length>0"
v-if=
"releve.specie.length>0"
style=
"margin: 6px 0"
>
Fiche espèce
</v-ons-button>
</div>
...
...
@@ -35,7 +35,7 @@
v-model=
"releve"
ref=
"species"
:options=
"speciesList"
label=
"specie
s
"
label=
"specie"
v-on:input=
"setTaxon"
:placeholder=
"placeholder.specieName"
style=
"width: -webkit-fill-available;"
...
...
@@ -53,7 +53,7 @@
v-model=
"releve.commonGenus"
ref=
"genus"
v-on:input=
"setGenus"
:disabled=
"releve.specie
s
.length>0"
:disabled=
"releve.specie.length>0"
:options=
"commonGenus"
:placeholder=
"placeholder.genusName"
style=
"width: -webkit-fill-available;"
...
...
@@ -70,7 +70,7 @@
<v-select
class=
"selector"
v-model=
"releve.genus"
:disabled=
"releve.specie
s
.length>0"
:disabled=
"releve.specie.length>0"
ref=
"genus"
v-on:input=
"setGenus"
:options=
"genusList"
...
...
@@ -88,6 +88,7 @@
class=
"selector"
v-model=
"releve"
v-on:input=
"setTaxon"
:filterBy=
"filterBy"
label=
"common"
ref=
"common"
style=
"width: -webkit-fill-available;"
...
...
@@ -191,7 +192,7 @@ export default {
data
()
{
return
{
releve
:
{
specie
s
:
""
,
specie
:
""
,
genus
:
""
,
commonGenus
:
""
,
_id
:
""
,
...
...
@@ -199,8 +200,8 @@ export default {
telaBotanicaTaxon
:
""
,
confidence
:
"
Non renseignée
"
//this.$t('unspecified')
},
species
:
null
,
noTree
:
false
,
image
:
null
,
selectedHeight
:
0
,
selectedConfidence
:
"
Non renseignée
"
,
//this.$t('unspecified')
selectedCrown
:
0
,
...
...
@@ -238,10 +239,10 @@ export default {
this
.
treeList
.
map
(
v
=>
{
return
{
commonGenus
:
v
.
common
G
enus
,
commonGenus
:
v
.
common
_g
enus
,
common
:
v
.
common
,
genus
:
v
.
genus
,
specie
s
:
v
.
species
,
specie
:
v
.
species
,
telaBotanicaTaxon
:
v
.
telaBotanicaTaxon
};
})
...
...
@@ -255,14 +256,16 @@ export default {
this
.
treeList
.
map
(
v
=>
{
return
{
commonGenus
:
v
.
common
G
enus
,
commonGenus
:
v
.
common
_g
enus
,
common
:
v
.
common
,
genus
:
v
.
genus
,
specie
s
:
v
.
species
,
specie
:
v
.
species
,
telaBotanicaTaxon
:
v
.
telaBotanicaTaxon
};
})
.
sort
()
.
sort
(
function
(
a
,
b
){
return
a
.
common
.
toString
().
localeCompare
(
b
.
common
.
toString
())
})
)
];
},
...
...
@@ -271,7 +274,11 @@ export default {
return
[...
new
Set
(
this
.
treeList
.
map
(
v
=>
v
.
genus
).
sort
())];
},
commonGenus
()
{
return
[...
new
Set
(
this
.
treeList
.
map
(
v
=>
v
.
common_genus
))];
return
[...
new
Set
(
this
.
treeList
.
map
(
v
=>
v
.
common_genus
))].
sort
(
function
(
a
,
b
)
{
return
a
.
toString
().
localeCompare
(
b
.
toString
())
});
},
confidenceValues
()
{
...
...
@@ -307,11 +314,21 @@ export default {
}.
bind
(
this
)
});
},
filterBy
(
option
,
label
,
search
)
{
let
x
=
this
.
normalize
(
label
)
||
""
return
x
.
indexOf
(
this
.
normalize
(
search
))
>
-
1
;
},
normalize
(
string
)
{
return
string
.
toLowerCase
()
.
normalize
(
"
NFD
"
)
.
replace
(
/
[\u
0300-
\u
036f
]
/g
,
""
);
},
setTaxon
(
e
)
{
if
(
!
e
)
{
this
.
releve
=
{
specie
s
:
""
,
specie
:
""
,
genus
:
""
,
commonGenus
:
""
,
common
:
""
,
...
...
@@ -326,7 +343,7 @@ export default {
confidence
:
"
Non renseignée
"
,
commonGenus
:
tree
.
common_genus
,
genus
:
tree
.
genus
,
specie
s
:
tree
.
species
,
specie
:
tree
.
species
,
common
:
tree
.
common
,
telaBotanicaTaxon
:
tree
.
telaBotanicaTaxon
};
...
...
@@ -334,7 +351,7 @@ export default {
setGenus
(
e
)
{
if
(
!
e
)
{
this
.
releve
=
{
specie
s
:
""
,
specie
:
""
,
genus
:
""
,
commonGenus
:
""
,
common
:
""
,
...
...
@@ -383,8 +400,7 @@ export default {
);
// smaller than maxSizeMB
imageCompression
.
getDataUrlFromFile
(
compressedFile
).
then
(
function
(
compressedDataURI
)
{
this
.
releve
.
image
=
compressedDataURI
;
console
.
log
(
this
.
releve
);
this
.
image
=
compressedDataURI
;
}.
bind
(
this
)
);
//return uploadToServer(compressedFile); // write your own logic
...
...
@@ -396,6 +412,7 @@ export default {
},
complete
()
{
let
releve
=
this
.
releve
;
this
.
releve
.
image
=
this
.
image
if
(
!
this
.
modify
)
{
this
.
releve
.
coordinates
=
this
.
coordinates
;
this
.
$store
.
dispatch
(
"
releve/setObservation
"
,
releve
);
...
...
src/store/modules/commonData.js
0 → 100644
View file @
575734d0
export
default
{
strict
:
true
,
namespaced
:
true
,
state
:
{
identification
:
false
,
verification
:
false
,
osmUpdates
:
false
,
showOSM
:
false
,
confidenceValues
:
[
'
Non renseignée
'
,
'
Peu confiant
'
,
'
Confiant
'
/*'unspecified',
'notVeryConfident',
'confident'*/
]
},
mutations
:
{
setVerificationMode
(
state
,
mode
)
{
state
.
verification
=
mode
},
showOSM
(
state
,
mode
){
state
.
showOSM
=
mode
},
setOsmUpdates
(
state
,
mode
)
{
state
.
osmUpdates
=
mode
},
setIdentificationMode
(
state
,
mode
)
{
state
.
identification
=
mode
}
}
}
\ No newline at end of file
src/store/modules/floreData.js
0 → 100644
View file @
575734d0
export
default
{
strict
:
true
,
namespaced
:
true
,
state
:{
treeList
:[]
},
mutations
:{
setFlore
(
state
,
treeList
){
state
.
treeList
=
treeList
}
},
actions
:{
getFlore
({
commit
}){
axios
.
get
(
'
/api/listTrees
'
)
.
then
((
response
)
=>
{
commit
(
'
setFlore
'
,
response
.
data
)
})
}
}
}
\ No newline at end of file
src/store/routeStore.js
View file @
575734d0
...
...
@@ -9,60 +9,6 @@ var addTree = require('../js/osmPost')
export
default
{
modules
:
{
floreData
:{
strict
:
true
,
namespaced
:
true
,
state
:{
treeList
:[]
},
mutations
:{
setFlore
(
state
,
treeList
){
state
.
treeList
=
treeList
}
},
actions
:{
getFlore
({
commit
}){
axios
.
get
(
'
/api/listTrees
'
)
.
then
((
response
)
=>
{
commit
(
'
setFlore
'
,
response
.
data
)
})
}
}
},
commonData
:
{
strict
:
true
,
namespaced
:
true
,
state
:
{
identification
:
false
,
verification
:
false
,
osmUpdates
:
false
,
showOSM
:
false
,
confidenceValues
:
[
'
Non renseignée
'
,
'
Peu confiant
'
,
'
Confiant
'
/*'unspecified',
'notVeryConfident',
'confident'*/
]
},
mutations
:
{
setVerificationMode
(
state
,
mode
)
{
state
.
verification
=
mode
},
showOSM
(
state
,
mode
){
state
.
showOSM
=
mode
},
setOsmUpdates
(
state
,
mode
)
{
state
.
osmUpdates
=
mode
},
setIdentificationMode
(
state
,
mode
)
{
state
.
identification
=
mode
}
}
},
osmData
:
{
strict
:
true
,
namespaced
:
true
,
...
...
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