Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Géocontrib Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GéoContrib
Géocontrib Frontend
Commits
89c02b96
Commit
89c02b96
authored
2 years ago
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
restore previous prerecorded values search system
parent
1b86ba84
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!536
REDMINE_ISSUE-15851| Liste de valeurs pré-enregistrées - Pouvoir rechercher des caractères à l'intérieur de la chaîne
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/Feature/Edit/FeatureExtraForm.vue
+26
-14
26 additions, 14 deletions
src/components/Feature/Edit/FeatureExtraForm.vue
with
26 additions
and
14 deletions
src/components/Feature/Edit/FeatureExtraForm.vue
+
26
−
14
View file @
89c02b96
...
...
@@ -63,7 +63,10 @@
</label>
<Multiselect
v-model=
"selectedPrerecordedValue"
:options=
"prerecordedOptions"
:options=
"
selectedPrerecordedListValues[field.options[0]] ? selectedPrerecordedListValues[field.options[0]] : []
"
:options-limit=
"10"
:allow-empty=
"!field.is_mandatory"
track-by=
"label"
label=
"label"
...
...
@@ -77,14 +80,14 @@
:loading=
"loadingPrerecordedListValues"
:clear-on-select=
"false"
:preserve-search=
"false"
@
search-change=
"search
PrerecordedValue
"
@
search-change=
"search"
@
select=
"selectPrerecordedValue"
>
<template
slot=
"clear"
>
<div
v-if=
"selectedPrerecordedValue"
class=
"multiselect__clear"
@
click.prevent.stop=
"clear
PrerecordedValue
"
@
click.prevent.stop=
"clear"
>
<i
class=
"close icon"
...
...
@@ -156,8 +159,7 @@
{{ field.label }}
</label>
<div
class=
"ui input"
>
<!-- //* si l'utilisateur clique sur fléche dans champ input, il n'y pas d'événement focus déclenché, -->
<!-- //* donc pas de blur à la sortie, on doit donc écouter l'événement onChange avec @change -->
<!-- //* si click sur fléche dans champ input, pas de focus, donc pas de blur, donc utilisation de @change -->
<input
:id=
"field.name"
:value=
"field.value"
...
...
@@ -301,10 +303,9 @@ export default {
data
()
{
return
{
error
:
null
,
prerecorded
Options
:
[]
,
prerecorded
ListSearchQuery
:
null
,
loadingPrerecordedListValues
:
false
,
selectedPrerecordedValue
:
null
,
limit
:
10
,
selectedMultipleCheckbox
:
[],
};
},
...
...
@@ -337,6 +338,19 @@ export default {
this
.
error
=
null
;
}
},
prerecordedListSearchQuery
(
newValue
)
{
this
.
loadingPrerecordedListValues
=
true
;
this
.
GET_SELECTED_PRERECORDED_LIST_VALUES
({
name
:
this
.
field
.
options
[
0
],
pattern
:
newValue
})
.
then
(()
=>
{
this
.
loadingPrerecordedListValues
=
false
;
})
.
catch
(()
=>
{
this
.
loadingPrerecordedListValues
=
false
;
});
}
},
created
()
{
...
...
@@ -363,7 +377,6 @@ export default {
}
},
methods
:
{
...
mapActions
(
'
feature-type
'
,
[
'
GET_SELECTED_PRERECORDED_LIST_VALUES
'
...
...
@@ -394,20 +407,19 @@ export default {
return
isValid
;
},
searchPrerecordedValue
(
text
)
{
let
options
=
this
.
selectedPrerecordedListValues
[
this
.
field
.
options
[
0
]]
||
[];
this
.
prerecordedOptions
=
options
.
filter
(
item
=>
{
return
item
.
label
.
toLowerCase
().
indexOf
(
text
.
toLowerCase
())
>
-
1
;
}).
slice
(
0
,
this
.
limit
);
search
(
text
)
{
this
.
prerecordedListSearchQuery
=
text
;
},
selectPrerecordedValue
(
e
)
{
this
.
selectedPrerecordedValue
=
e
.
label
;
this
.
prerecordedListSearchQuery
=
null
;
this
.
updateStore_extra_form
({
target
:
{
value
:
this
.
selectedPrerecordedValue
}
});
},
clear
PrerecordedValue
()
{
clear
()
{
this
.
selectedPrerecordedValue
=
null
;
this
.
prerecordedListSearchQuery
=
null
;
},
selectMultipleCheckbox
(
e
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment