Commit 30ab0579 by 匡雅琴

Merge branch 'v1.0.0' of http://192.168.3.233:8090/h5/glsk-data-view-pd into v1.0.0

2 parents 95c2ae58 a4286ff5
......@@ -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 {
......
......@@ -7,17 +7,17 @@
<div v-if="item.rate" class="statistics-top-rate">占比<span>{{item.rate}}</span></div>
</div>
<div class="statistics-bottom">
<template v-if="bottomType == 'money'">
<span> {{item.moneyName}}</span>
<span>¥{{item.moneyValue}}</span>
<template v-if="item.bottomType == 'money'">
<span> {{item.bottomLabel}}</span>
<span>¥{{item.bottomValue}}</span>
</template>
<template v-else-if="bottomType == 'default'">
<span>{{item.moneyName}}</span>
<span>{{item.moneyValue}}</span>
</template>
<template v-else-if="bottomType == 'slot'">
<template v-else-if="item.bottomType == 'slot'">
<slot name="bottom"></slot>
</template>
<template v-else>
<span>{{item.bottomLabel}}</span>
<span>{{item.bottomValue}}</span>
</template>
</div>
</div>
</div>
......@@ -29,11 +29,11 @@ export default {
props: {
list: {
type: Array
},
bottomType: {
type: String,
default: 'default'
}
// bottomType: {
// type: String,
// default: 'default'
// }
},
data() {
return {
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-05 10:35:43
* @LastEditors: huyue
* @LastEditTime: 2023-07-12 15:45:33
* @LastEditTime: 2023-07-13 17:33:27
-->
<template>
<div class="view-date">统计年份:
......@@ -17,12 +17,15 @@
<div class="year-item" :class="year == item ? 'active' : ''" v-for="(item,index) in dataList" :key="index" @click.s="selectYear(item)">{{item}}</div>
</div> -->
</div>
业务开始时间:2022年6月30日</div>
业务开始时间:{{businessTime}}</div>
</template>
<script type='text/ecmascript-6'>
import datas from '@/utils/data'
export default {
name: 'ViewDate',
props: {
businessTime: String
},
data() {
return {
isShow: false,
......@@ -38,8 +41,8 @@ export default {
this.isShow = !this.isShow
},
selectVal(val) {
console.log(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-07 14:44:25
* @LastEditTime: 2023-07-13 17:43:57
-->
<template>
<div class="view-content">
<ViewDate></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,11 +26,23 @@ export default {
},
props: {
},
computed: {
},
data() {
return {
businessTime: ''
}
},
created() {
this.$bus.$on('businessstarttime', data => {
this.businessTime = data
})
},
methods: {
...mapActions(['setSolarYear']),
yearValue(val) {
this.setSolarYear(val)
}
}
}
</script>
......
......@@ -3,12 +3,11 @@
* @Author: huyue
* @Date: 2023-07-06 10:19:05
* @LastEditors: huyue
* @LastEditTime: 2023-07-06 11:07:11
* @LastEditTime: 2023-07-13 15:57:12
*/
import Vue from 'vue'
const componentsFiles = require.context(`./`, true, /.vue$/)
componentsFiles.keys().forEach(path => {
const component = componentsFiles(path).default
console.log(component.name)
Vue.component(component.name, component)
})
......@@ -3,11 +3,11 @@
* @Author: huyue
* @Date: 2023-07-05 10:35:43
* @LastEditors: huyue
* @LastEditTime: 2023-07-13 15:12:36
* @LastEditTime: 2023-07-13 18:01:02
-->
<template>
<div class="left">
<StatisticsBox :list="solarList" bottomType="money"></StatisticsBox>
<StatisticsBox :list="solarList"></StatisticsBox>
<PurchaseTrends></PurchaseTrends>
<div class="left-bottom">
<MerchantTrends class="bottom-trends"></MerchantTrends>
......@@ -35,35 +35,50 @@ export default {
solarList: [
{
name: '总采购额',
valueName: 'amounttotal',
value: '2,280,708',
moneyName: '本月采购额',
moneyValue: '2,280,708'
bottomLabel: '本月采购额',
bottemName: 'amounttotalThismonth',
bottomValue: '2,280,708',
bottomType: 'money'
},
{
name: '总采购额',
name: '商城采购额',
valueName: 'amountshop',
value: '2,280,708',
moneyName: '本月采购额',
moneyValue: '2,280,708',
rate: '51%'
bottomLabel: '本月采购额',
bottemName: 'amountshopThismonth',
bottomValue: '2,280,708',
rate: '51%',
rateName: 'shopRate',
bottomType: 'money'
},
{
name: '总采购额',
name: '自采采购额',
valueName: 'amountself',
value: '2,280,708',
moneyName: '本月采购额',
moneyValue: '2,280,708',
rate: '49%'
bottomLabel: '本月采购额',
bottemName: 'amountselfThismonth',
bottomValue: '2,280,708',
rate: '49%',
rateName: 'selfRate',
bottomType: 'money'
},
{
name: '总采购额',
name: '开通商户数',
valueName: 'opentotal',
value: '2,280,708',
moneyName: '本月采购额',
moneyValue: '2,280,708'
bottomLabel: '本月开通商户数',
bottemName: 'openThismonth',
bottomValue: '2,280,708'
},
{
name: '总采购额',
name: '采购商户数',
valueName: 'buytotal',
value: '2,280,708',
moneyName: '本月采购额',
moneyValue: '2,280,708'
bottomLabel: '本月采购商户数',
bottemName: 'buyThismonth',
bottomValue: '2,280,708'
}
]
}
......@@ -74,9 +89,16 @@ export default {
init() {
this.getSolarList()
},
getSolarList() {
this.api.solar.getAllPurchase({ req: { year: 2023 }}).then(res => {
console.log(res)
async getSolarList() {
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)
this.solarList.forEach(item => {
item.value = _dataList[item.valueName]
item.bottomValue = _dataList[item.bottemName]
if (item.rateName) item.rate = _dataList[item.rateName]
})
}
}
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-06 16:19:15
* @LastEditors: huyue
* @LastEditTime: 2023-07-12 15:57:01
* @LastEditTime: 2023-07-13 17:55:09
-->
<template>
<div class="merchant-box">
......@@ -44,19 +44,33 @@ export default {
},
methods: {
init() {
const p = new Promise((resolve) => {
for (let i = 0; i < 12; i++) {
this.dataList.push({
month: i + 1 + '月',
data1: +(Math.random() * 20).toFixed(2),
data2: +(Math.random() * 40).toFixed(2)
})
}
resolve()
})
p.then(() => {
this.$refs.merchantTrendsRef.drawBar()
this.getTrendData()
// const p = new Promise((resolve) => {
// for (let i = 0; i < 12; i++) {
// this.dataList.push({
// month: i + 1 + '月',
// data1: +(Math.random() * 20).toFixed(2),
// data2: +(Math.random() * 40).toFixed(2)
// })
// }
// console.log(this.dataList)
// resolve()
// })
// p.then(() => {
// this.$refs.merchantTrendsRef.drawBar()
// })
},
async getTrendData() {
const _data = await this.api.solar.getAllOpenBuyTrend({ year: 2023 })
const _dataList = _data.data.dataList
_dataList.forEach(item => {
this.dataList.push({
month: item.statDate,
data1: item.opennum,
data2: item.buynum
})
})
this.$refs.merchantTrendsRef.drawBar()
}
}
}
......
......@@ -3,11 +3,11 @@
* @Author: huyue
* @Date: 2023-07-06 16:19:15
* @LastEditors: huyue
* @LastEditTime: 2023-07-07 18:08:57
* @LastEditTime: 2023-07-13 17:12:23
-->
<template>
<div class="purchase-box">
<box-title title="采购额排名"></box-title>
<box-title title="近一年采购额趋势"></box-title>
<BarLineChart ref="purchaseRef" height="30.23vh" domId="purchase" :dataList.sync="dataList" :tooltipFormatterObj="tooltipFormatterObj"></BarLineChart>
<div class="legend">
<div class="legend-item shop">
......@@ -56,20 +56,34 @@ export default {
},
methods: {
init() {
const p = new Promise((resolve) => {
for (let i = 0; i < 12; i++) {
this.dataList.push({
month: i + 1 + '月',
data1: +(Math.random() * 2000).toFixed(2),
data2: +(Math.random() * 5000).toFixed(2),
data3: +(Math.random() * 50).toFixed(2)
})
}
resolve()
})
p.then(() => {
this.$refs.purchaseRef.drawBarLine()
this.getDataList()
// const p = new Promise((resolve) => {
// for (let i = 0; i < 12; i++) {
// this.dataList.push({
// month: i + 1 + '月',
// data1: +(Math.random() * 2000).toFixed(2),
// data2: +(Math.random() * 5000).toFixed(2),
// data3: +(Math.random() * 50).toFixed(2)
// })
// }
// resolve()
// })
// p.then(() => {
// this.$refs.purchaseRef.drawBarLine()
// })
},
async getDataList() {
const _data = await this.api.solar.getAllPurchaseTrend({ year: 2023 })
const _dataList = _data.data.dataList
_dataList.forEach(item => {
this.dataList.push({
month: item.statDate,
data1: item.shopamount,
data2: item.selfamount,
data3: item.shopratio
})
})
this.$refs.purchaseRef.drawBarLine()
}
}
}
......
......@@ -6,8 +6,8 @@
</template>
<template #content>
<div class="solar-detail-content">
<view-date></view-date>
<StatisticsBox class="statistic-box" :list="solarDetailList" bottomType="money"></StatisticsBox>
<view-date></view-date>z
<StatisticsBox class="statistic-box" :list="solarDetailList"></StatisticsBox>
<!-- 采购趋势 -->
<div class="tendency-box">
<box-title title="近一年采购额趋势"></box-title>
......@@ -82,32 +82,32 @@ export default {
{
name: '总采购额',
value: '2,280,708',
moneyName: '本月采购额',
moneyValue: '2,280,708'
bottomLabel: '本月采购额',
bottomValue: '2,280,708'
},
{
name: '总采购额',
value: '2,280,708',
moneyName: '本月采购额',
moneyValue: '2,280,708'
bottomLabel: '本月采购额',
bottomValue: '2,280,708'
},
{
name: '总采购额',
value: '2,280,708',
moneyName: '本月采购额',
moneyValue: '2,280,708'
bottomLabel: '本月采购额',
bottomValue: '2,280,708'
},
// {
// name: '总采购额',
// value: '2,280,708',
// moneyName: '本月采购额',
// moneyValue: '2,280,708'
// bottomLabel: '本月采购额',
// bottomValue: '2,280,708'
// },
// {
// name: '总采购额',
// value: '2,280,708',
// moneyName: '本月采购额',
// moneyValue: '2,280,708'
// bottomLabel: '本月采购额',
// bottomValue: '2,280,708'
// }
],
// 商城采购饼图结构
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!