Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
idatt2106_2024_02_frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
IDATT2106 - Gruppe 2
idatt2106_2024_02_frontend
Commits
7d55d59e
Commit
7d55d59e
authored
11 months ago
by
Eline Evje
Browse files
Options
Downloads
Patches
Plain Diff
fix: size of box
parent
1447411e
No related branches found
Branches containing commit
No related tags found
3 merge requests
!66
Final merge
,
!36
Enhancement/implement account number to config
,
!4
Pipeline fix
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/views/ConfigSpendingItemsTotalAmountView.vue
+20
-10
20 additions, 10 deletions
src/views/ConfigSpendingItemsTotalAmountView.vue
with
20 additions
and
10 deletions
src/views/ConfigSpendingItemsTotalAmountView.vue
+
20
−
10
View file @
7d55d59e
<
template
>
<div
class=
"flex flex-col items-center justify-center min-h-screen px-4 text-center"
>
<div
class=
"flex flex-col items-center justify-center min-h-screen px-4 text-center
relative
"
>
<h1
class=
"mb-8 lg:mb-12 text-4xl font-bold"
>
Hvor mye bruker du totalt per uke på ...
</h1>
<div
class=
"grid grid-cols-1 md:grid-cols-2 gap-8 mb-6"
>
<div
class=
"flex flex-col items-center bg-white rounded-lg p-8 shadow-lg w-full"
>
<div
v-if=
"showFirstBox"
class=
"flex flex-col items-center bg-white rounded-lg p-8 shadow-lg w-full"
>
<div
v-for=
"(option, index) in
options.slice(0, 6)
"
v-for=
"(option, index) in
firstBoxOptions
"
:key=
"`option-$
{index}`"
class="w-full my-4"
>
...
...
@@ -12,9 +15,8 @@
<p
class=
"text-xl font-bold mr-4"
>
{{
option
.
type
}}
</p>
<div
class=
"flex items-center w-2/3"
>
<input
type=
"text"
v-model=
"amounts[index]"
@
input=
"
($event) =>
filterAmount(index, $event)"
@
input=
"filterAmount(index, $event)"
class=
"h-11 px-3 rounded-md text-lg focus:outline-none border-2 w-full"
:class=
"
{
'border-gray-300': !amounts[index],
...
...
@@ -26,9 +28,12 @@
</div>
</div>
</div>
<div
class=
"flex flex-col items-center bg-white rounded-lg p-8 shadow-lg w-full"
>
<div
v-if=
"showSecondBox"
class=
"flex flex-col items-center bg-white rounded-lg p-8 shadow-lg w-full"
>
<div
v-for=
"(option, index) in
options.slice(6, 12)
"
v-for=
"(option, index) in
secondBoxOptions
"
:key=
"`option-$
{index}`"
class="w-full my-4"
>
...
...
@@ -36,9 +41,8 @@
<p
class=
"text-xl font-bold mr-4"
>
{{
option
.
type
}}
</p>
<div
class=
"flex items-center w-2/3"
>
<input
type=
"text"
v-model=
"amounts[index + 6]"
@
input=
"
($event) =>
filterAmount(index + 6, $event)"
@
input=
"filterAmount(index + 6, $event)"
class=
"h-11 px-3 rounded-md text-lg focus:outline-none border-2 w-full"
:class=
"
{
'border-gray-300': !amounts[index + 6],
...
...
@@ -80,7 +84,7 @@ const onButtonClick = async () => {
parseFloat
(
amounts
.
value
[
index
])
||
0
})
await
userConfigStore
.
postUserConfig
()
userConfigStore
.
postUserConfig
()
await
router
.
push
({
name
:
'
configurations6
'
})
}
...
...
@@ -90,4 +94,10 @@ const filterAmount = (index: number, event: Event) => {
filteredValue
=
filteredValue
.
replace
(
/
(
,.*
?)
,/g
,
'
$1
'
).
replace
(
/,+/g
,
'
,
'
)
amounts
.
value
[
index
]
=
filteredValue
}
const
firstBoxOptions
=
computed
(()
=>
options
.
value
.
slice
(
0
,
6
))
const
secondBoxOptions
=
computed
(()
=>
(
options
.
value
.
length
>
6
?
options
.
value
.
slice
(
6
)
:
[]))
const
showFirstBox
=
computed
(()
=>
options
.
value
.
length
>
0
)
const
showSecondBox
=
computed
(()
=>
options
.
value
.
length
>
6
)
</
script
>
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