Commit a4286ff5 by 胡悦

修改

1 parent d4a62abc
......@@ -3,20 +3,20 @@
* @Author: huyue
* @Date: 2023-07-04 11:40:34
* @LastEditors: huyue
* @LastEditTime: 2023-07-04 11:40:40
* @LastEditTime: 2023-07-13 17:55:25
*/
class Request {
DOMAIN = '/dev'
constructor(_request_) {
this.DOMAIN = _request_ ? _request_.baseURL : this.DOMAIN
}
get (url, params, returnAll) {
get(url, params, returnAll) {
return this.request('GET', url, params, returnAll)
}
post (url, params, returnAll) {
post(url, params, returnAll) {
return this.request('POST', url, params, returnAll)
}
request (method, url, params, returnAll) {
request(method, url, params, returnAll) {
var requestConfig = {
headers: {
// 'Content-Type': method == 'GET' ? 'application/json' : 'application/x-www-form-urlencoded; charset=UTF-8'
......@@ -26,7 +26,7 @@ class Request {
}
if (method === 'GET') {
var paramsArray = []
params&&Object.keys(params.req).forEach(key => paramsArray.push('req.' + key + '=' + params.req[key]))
params && Object.keys(params).forEach(key => paramsArray.push(key + '=' + params[key]))
if (url.search(/\?/) === -1) {
url += '?' + paramsArray.join('&')
} else {
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-05 10:35:43
* @LastEditors: huyue
* @LastEditTime: 2023-07-13 15:56:27
* @LastEditTime: 2023-07-13 17:33:27
-->
<template>
<div class="view-date">统计年份:
......@@ -42,6 +42,7 @@ export default {
},
selectVal(val) {
this.year = val
this.$emit('yearValue', val)
this.switchYear()
},
clickOutside() {
......
......@@ -4,23 +4,30 @@
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: huyue
* @LastEditTime: 2023-07-04 11:46:21
* @LastEditTime: 2023-07-13 17:31:56
*/
const state = {
reportParams: {
reportType: 0 //月表0,日表1
}
reportType: 0 // 月表0,日表1
},
solarYear: '2023'
}
const mutations = {
SET_PAGE_META (state, meta) {
SET_PAGE_META(state, meta) {
state.pageMeta = meta
},
SET_SOLAR_YEAR(state, meta) {
state.solarYear = meta
}
}
const actions = {
// 设置name
setUserInfo ({ commit }, user) {
setUserInfo({ commit }, user) {
commit('SET_USER_INFO', user)
},
setSolarYear({ commit }, year) {
commit('SET_SOLAR_YEAR', year)
}
}
export default {
......
......@@ -3,11 +3,11 @@
* @Author: huyue
* @Date: 2023-07-04 13:56:33
* @LastEditors: huyue
* @LastEditTime: 2023-07-13 15:47:43
* @LastEditTime: 2023-07-13 17:43:57
-->
<template>
<div class="view-content">
<ViewDate :businessTime="businessTime"></ViewDate>
<ViewDate :businessTime="businessTime" @yearValue="yearValue"></ViewDate>
<div class="content">
<ContentLeft></ContentLeft>
<ContentRight></ContentRight>
......@@ -17,6 +17,7 @@
<script>
import ContentLeft from '../solar/ContentLeft'
import ContentRight from '../solar/ContentRight.vue'
import { mapActions } from 'vuex'
export default {
name: 'ViewSolar',
components: {
......@@ -25,6 +26,8 @@ export default {
},
props: {
},
computed: {
},
data() {
return {
businessTime: ''
......@@ -36,6 +39,10 @@ export default {
})
},
methods: {
...mapActions(['setSolarYear']),
yearValue(val) {
this.setSolarYear(val)
}
}
}
</script>
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-05 10:35:43
* @LastEditors: huyue
* @LastEditTime: 2023-07-13 16:38:26
* @LastEditTime: 2023-07-13 18:01:02
-->
<template>
<div class="left">
......@@ -90,7 +90,8 @@ export default {
this.getSolarList()
},
async getSolarList() {
const _data = await this.api.solar.getAllPurchase({ req: { year: 2023 }})
console.log(this.$store.state)
const _data = await this.api.solar.getAllPurchase({ year: 2023 })
const _dataList = _data.data.dataList[0]
console.log(_dataList)
this.$bus.$emit('businessstarttime', _dataList.businessstarttime)
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-06 16:19:15
* @LastEditors: huyue
* @LastEditTime: 2023-07-13 16:39:55
* @LastEditTime: 2023-07-13 17:55:09
-->
<template>
<div class="merchant-box">
......@@ -61,7 +61,7 @@ export default {
// })
},
async getTrendData() {
const _data = await this.api.solar.getAllOpenBuyTrend({ req: { year: 2023 }})
const _data = await this.api.solar.getAllOpenBuyTrend({ year: 2023 })
const _dataList = _data.data.dataList
_dataList.forEach(item => {
this.dataList.push({
......
......@@ -73,7 +73,7 @@ export default {
// })
},
async getDataList() {
const _data = await this.api.solar.getAllPurchaseTrend({ req: { year: 2023 }})
const _data = await this.api.solar.getAllPurchaseTrend({ year: 2023 })
const _dataList = _data.data.dataList
_dataList.forEach(item => {
this.dataList.push({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!