Commit d616df2a by 胡悦

提交

1 parent def267c7
...@@ -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-08-14 11:20:44 * @LastEditTime: 2023-08-14 14:06:17
--> -->
<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}">
...@@ -73,9 +73,9 @@ export default { ...@@ -73,9 +73,9 @@ export default {
} }
}, },
mounted() { mounted() {
console.log(this.defaultValue, this.dataList, '00000000')
const { valueName, isObject, dataList, defaultValue } = this const { valueName, isObject, dataList, defaultValue } = this
this.value = defaultValue || (isObject ? dataList[0][valueName] : dataList[0]) const isDefaultObject = (defaultValue instanceof Object)
this.value = isDefaultObject ? defaultValue[valueName] : defaultValue || (isObject ? dataList[0][valueName] : dataList[0])
}, },
methods: { methods: {
select(item) { select(item) {
......
...@@ -39,7 +39,8 @@ export default { ...@@ -39,7 +39,8 @@ export default {
tabActive: 0, tabActive: 0,
isShow: false, isShow: false,
defaultMonth: { defaultMonth: {
label: new Date().format('yyyy年MM月') label: new Date().format('yyyy-MM'),
statMonth: new Date().format('yyyy-MM')
}, },
dataList: [], dataList: [],
month: '' month: ''
...@@ -57,11 +58,11 @@ export default { ...@@ -57,11 +58,11 @@ export default {
const _dataList = _result.data.dataList const _dataList = _result.data.dataList
_dataList.forEach(item => { _dataList.forEach(item => {
this.dataList.push({ this.dataList.push({
label: new Date(item.statMonth).format('yyyy年MM月'), label: item.statMonth,
statMonth: item.statMonth statMonth: item.statMonth
}) })
}) })
this.defaultMonth = this.month = this.dataList[0].label this.defaultMonth = this.month = this.dataList[0].statMonth
this.$bus.$emit('crowdFundingMonth', this.dataList[0].statMonth) this.$bus.$emit('crowdFundingMonth', this.dataList[0].statMonth)
}, },
// tab切换 // tab切换
...@@ -73,7 +74,7 @@ export default { ...@@ -73,7 +74,7 @@ export default {
this.isShow = !this.isShow this.isShow = !this.isShow
}, },
selectVal(val) { selectVal(val) {
this.defaultMonth = this.month = val.label this.defaultMonth = this.month = val.statMonth
this.$bus.$emit('crowdFundingMonth', val.statMonth) this.$bus.$emit('crowdFundingMonth', val.statMonth)
this.switchMonth() this.switchMonth()
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!