Commit 86e88337 by 胡悦

修复

1 parent 4e8daedc
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-05 15:11:53
* @LastEditors: huyue
* @LastEditTime: 2023-07-14 16:34:42
* @LastEditTime: 2023-07-14 17:03:43
-->
<template>
<div v-click-outside="handleClickOutside" @mouseleave="handleMouseLeave" v-show="isShow" class="select-box" :style="{'width': boxWidth}">
......@@ -73,10 +73,17 @@ export default {
}
},
watch: {
'defaultValue': {
handler(newVal) {
console.log(newVal)
}
}
},
mounted() {
const { valueName, isObject, dataList, defaultValue } = this
console.log(defaultValue)
this.value = defaultValue || (isObject ? dataList[0][valueName] : dataList[0])
console.log(this.value)
},
methods: {
select(item) {
......
......@@ -3,16 +3,16 @@
* @Author: huyue
* @Date: 2023-07-05 10:35:43
* @LastEditors: huyue
* @LastEditTime: 2023-07-14 10:57:28
* @LastEditTime: 2023-07-14 17:07:42
-->
<template>
<div class="view-date">统计年份:
<div class="year-plugin">
<div class="year" @click.stop="switchYear">
{{year}}
{{$store.state.app.solarYear}}
<img class="arrow-down" src="@/assets/images/arrow-down.png" alt="">
</div>
<SelectBox :isShow="isShow" @clickOutside="clickOutside" :dataList="dataList" :boxWidth="'8.61vw'" @selectVal="selectVal"></SelectBox>
<SelectBox :isShow="isShow" :defaultValue="$store.state.app.solarYear" @clickOutside="clickOutside" :dataList="dataList" :boxWidth="'8.61vw'" @selectVal="selectVal"></SelectBox>
<!-- <div v-show="isShow" class="select-year">
<div class="year-item" :class="year == item ? 'active' : ''" v-for="(item,index) in dataList" :key="index" @click.s="selectYear(item)">{{item}}</div>
</div> -->
......@@ -21,6 +21,7 @@
</template>
<script type='text/ecmascript-6'>
import datas from '@/utils/data'
import { mapActions } from 'vuex'
export default {
name: 'ViewDate',
props: {
......@@ -34,15 +35,17 @@ export default {
}
},
mounted() {
this.year = this.dataList[0]
// this.year = this.$store.state.app.solarYear
},
methods: {
...mapActions(['setSolarYear']),
switchYear() {
this.isShow = !this.isShow
},
selectVal(val) {
this.year = val
this.$emit('yearValue', val)
// this.year = val
// this.$emit('yearValue', val)
this.setSolarYear(val)
this.switchYear()
},
clickOutside() {
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-04 13:56:33
* @LastEditors: huyue
* @LastEditTime: 2023-07-13 17:43:57
* @LastEditTime: 2023-07-14 17:08:05
-->
<template>
<div class="view-content">
......@@ -17,7 +17,6 @@
<script>
import ContentLeft from '../solar/ContentLeft'
import ContentRight from '../solar/ContentRight.vue'
import { mapActions } from 'vuex'
export default {
name: 'ViewSolar',
components: {
......@@ -39,10 +38,6 @@ export default {
})
},
methods: {
...mapActions(['setSolarYear']),
yearValue(val) {
this.setSolarYear(val)
}
}
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!