Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
glsk-data-view-pd
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 10524e1e
authored
Aug 14, 2023
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复年份默认值
1 parent
03c41311
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
12 deletions
src/components/SelectBox.vue
src/views/crowdfunding/components/MainTab.vue
src/components/SelectBox.vue
View file @
10524e1
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* @Author: huyue
* @Author: huyue
* @Date: 2023-07-05 15:11:53
* @Date: 2023-07-05 15:11:53
* @LastEditors: huyue
* @LastEditors: huyue
* @LastEditTime: 2023-0
7-17 18:18:37
* @LastEditTime: 2023-0
8-14 11:10:30
-->
-->
<
template
>
<
template
>
<div
v-click-outside=
"handleClickOutside"
@
mouseleave=
"handleMouseLeave"
v-show=
"isShow"
class=
"select-box"
:style=
"
{'width': boxWidth}">
<div
v-click-outside=
"handleClickOutside"
@
mouseleave=
"handleMouseLeave"
v-show=
"isShow"
class=
"select-box"
:style=
"
{'width': boxWidth}">
...
@@ -46,7 +46,7 @@ export default {
...
@@ -46,7 +46,7 @@ export default {
type
:
String
type
:
String
},
},
defaultValue
:
{
defaultValue
:
{
type
:
[
String
,
Number
]
type
:
[
String
,
Number
,
Object
]
}
}
},
},
directives
:
{
directives
:
{
...
@@ -73,9 +73,9 @@ export default {
...
@@ -73,9 +73,9 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
console
.
log
(
this
.
defaultValue
,
this
.
dataList
,
'00000000'
);
console
.
log
(
this
.
defaultValue
,
this
.
dataList
,
'00000000'
)
const
{
value
Name
,
isObject
,
dataList
,
defaultValue
}
=
this
const
{
label
Name
,
isObject
,
dataList
,
defaultValue
}
=
this
this
.
value
=
defaultValue
||
(
isObject
?
dataList
[
0
][
value
Name
]
:
dataList
[
0
])
this
.
value
=
defaultValue
||
(
isObject
?
dataList
[
0
][
label
Name
]
:
dataList
[
0
])
},
},
methods
:
{
methods
:
{
select
(
item
)
{
select
(
item
)
{
...
...
src/views/crowdfunding/components/MainTab.vue
View file @
10524e1
...
@@ -18,7 +18,6 @@
...
@@ -18,7 +18,6 @@
:dataList
.
sync=
"dataList"
:dataList
.
sync=
"dataList"
:boxWidth=
"'8.61vw'"
:boxWidth=
"'8.61vw'"
@
selectVal=
"selectVal"
@
selectVal=
"selectVal"
:labelName=
"'statMonth'"
:valueName=
"'statMonth'"
:valueName=
"'statMonth'"
></SelectBox>
></SelectBox>
</div>
</div>
...
@@ -39,7 +38,9 @@ export default {
...
@@ -39,7 +38,9 @@ export default {
return
{
return
{
tabActive
:
0
,
tabActive
:
0
,
isShow
:
false
,
isShow
:
false
,
defaultMonth
:
''
,
defaultMonth
:
{
label
:
new
Date
().
format
(
'yyyy年MM月'
)
},
dataList
:
[],
dataList
:
[],
month
:
''
month
:
''
}
}
...
@@ -53,9 +54,15 @@ export default {
...
@@ -53,9 +54,15 @@ export default {
methods
:
{
methods
:
{
async
getMonth
()
{
async
getMonth
()
{
const
_result
=
await
this
.
api
.
crowdFunding
.
getMonth
()
const
_result
=
await
this
.
api
.
crowdFunding
.
getMonth
()
this
.
dataList
=
_result
.
data
.
dataList
const
_dataList
=
_result
.
data
.
dataList
this
.
defaultMonth
=
this
.
month
=
this
.
dataList
[
0
].
statMonth
_dataList
.
forEach
(
item
=>
{
this
.
$bus
.
$emit
(
'crowdFundingMonth'
,
this
.
defaultMonth
)
this
.
dataList
.
push
({
label
:
new
Date
(
item
.
statMonth
).
format
(
'yyyy年MM月'
),
statMonth
:
item
.
statMonth
})
})
this
.
defaultMonth
=
this
.
month
=
this
.
dataList
[
0
].
label
// this.$bus.$emit('crowdFundingMonth', this.defaultMonth)
},
},
// tab切换
// tab切换
changeTab
(
index
)
{
changeTab
(
index
)
{
...
@@ -66,8 +73,8 @@ export default {
...
@@ -66,8 +73,8 @@ export default {
this
.
isShow
=
!
this
.
isShow
this
.
isShow
=
!
this
.
isShow
},
},
selectVal
(
val
)
{
selectVal
(
val
)
{
this
.
defaultMonth
=
this
.
month
=
val
.
statMonth
this
.
defaultMonth
=
this
.
month
=
val
.
label
this
.
$bus
.
$emit
(
'crowdFundingMonth'
,
this
.
defaul
tMonth
)
this
.
$bus
.
$emit
(
'crowdFundingMonth'
,
val
.
sta
tMonth
)
this
.
switchMonth
()
this
.
switchMonth
()
},
},
clickOutside
()
{
clickOutside
()
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment