Commit e34ef0d6 by 胡悦

Merge branch 'dev_v1.0.0' of http://192.168.3.233:8090/gh/data-view into dev_v1.0.0

2 parents aed25409 7bc0cdd9
...@@ -18,6 +18,11 @@ class Request { ...@@ -18,6 +18,11 @@ class Request {
method method
} }
params.req.corporateGroupName = '广汇' params.req.corporateGroupName = '广汇'
const { reportParams } = window.vm.$store.state.app
if (reportParams) {
params.req.queryType = reportParams.reportType || 0
if (reportParams.brand) params.req.brandName = reportParams.brand.name
}
if (method === 'GET') { if (method === 'GET') {
var paramsArray = [] var paramsArray = []
Object.keys(params.req).forEach(key => paramsArray.push('req.' + key + '=' + params.req[key])) Object.keys(params.req).forEach(key => paramsArray.push('req.' + key + '=' + params.req[key]))
......
@import './normalize.scss'; @import './normalize.scss';
@import './sprite.scss'; @import './sprite.scss';
@font-face {
font-family: 'PingFangSC-Regular';
src: url('../font/PingFang-Regular.ttf');
}
html, html,
body .app { body .app {
color: #333333; color: #333333;
font-family: Arial, Helvetica, 'STHeiti STXihei', 'Microsoft YaHei', Tohoma, sans-serif; font-family:'PingFangSC-Regular', Arial, Helvetica, 'STHeiti STXihei', 'Microsoft YaHei', Tohoma, sans-serif;
background-color: #fff; background-color: #fff;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
height: 100%; height: 100%;
...@@ -74,9 +79,11 @@ img { ...@@ -74,9 +79,11 @@ img {
background: #1d1c1c; background: #1d1c1c;
overflow: hidden; overflow: hidden;
} }
.inline { .inline {
display: inline-block; display: inline-block;
} }
.title { .title {
font-size: 12px; font-size: 12px;
color: #e8e8e8; color: #e8e8e8;
...@@ -85,9 +92,11 @@ img { ...@@ -85,9 +92,11 @@ img {
padding: 0.5vh 8px; padding: 0.5vh 8px;
user-select: none; user-select: none;
} }
.title-icon { .title-icon {
display: flex; display: flex;
align-items: center; align-items: center;
.icon { .icon {
display: inline-block; display: inline-block;
width: 4px; width: 4px;
...@@ -98,8 +107,9 @@ img { ...@@ -98,8 +107,9 @@ img {
margin-right: 6px; margin-right: 6px;
} }
} }
.container{
margin:0 8px; .container {
margin: 0 8px;
} }
.empty { .empty {
...@@ -108,6 +118,7 @@ img { ...@@ -108,6 +118,7 @@ img {
height: calc(100% - 4.1vh); height: calc(100% - 4.1vh);
align-items: center; align-items: center;
justify-content: center; justify-content: center;
img { img {
width: 20vh; width: 20vh;
height: 9.5vh; height: 9.5vh;
......
No preview for this file type
...@@ -114,6 +114,20 @@ export default { ...@@ -114,6 +114,20 @@ export default {
this.getRankList(this.moveAttr.dataIndex, this.rankFlag + 'List') this.getRankList(this.moveAttr.dataIndex, this.rankFlag + 'List')
}) })
// 绑定点击事件
this[this.domId].getZr().on('mouseover', (params) => {
const pointInPixel = [params.offsetX, params.offsetY]
if (this[this.domId].containPixel('grid', pointInPixel)) {
var xIndex = this[this.domId].convertFromPixel({ seriesIndex: 0 }, [
params.offsetX,
params.offsetY
])[0]
/* 事件处理代码书写位置 */
this.moveAttr.dataIndex = xIndex
this.getRankList(this.moveAttr.dataIndex, this.rankFlag + 'List')
}
})
// 移除图表 // 移除图表
this[this.domId].on('globalout', () => { this[this.domId].on('globalout', () => {
this.chartAction() this.chartAction()
...@@ -145,8 +159,6 @@ export default { ...@@ -145,8 +159,6 @@ export default {
this.chartAction() this.chartAction()
this.getRankList(0) this.getRankList(0)
// this.autoMove()
}, },
handleRankChange(value) { handleRankChange(value) {
......
...@@ -75,6 +75,7 @@ export default { ...@@ -75,6 +75,7 @@ export default {
if (index == 0) { if (index == 0) {
if (tabIndex == index) return if (tabIndex == index) return
this.tab = ['广汇集团', '品牌概览'] this.tab = ['广汇集团', '品牌概览']
this.brands.map(e => e.active = false)
} else { } else {
if (!item) return if (!item) return
this.tab[1] = item.brandName this.tab[1] = item.brandName
......
...@@ -55,10 +55,17 @@ ...@@ -55,10 +55,17 @@
<div class="tabs-content box"> <div class="tabs-content box">
<div class="tabs-title">客户增长趋势</div> <div class="tabs-title">客户增长趋势</div>
<div class="tabs-content-chart flex"> <div class="tabs-content-chart flex">
<div <template v-if="isEmpty">
class="line" <div class="empty">
ref="canvas" <img src="@/assets/images/empty.png" />
></div> </div>
</template>
<template v-else>
<div
class="line"
ref="canvas"
></div>
</template>
<div class="table user-select pointer"> <div class="table user-select pointer">
<div class="table-head"> <div class="table-head">
<template v-for="(i,index) in tabHead"> <template v-for="(i,index) in tabHead">
...@@ -136,23 +143,28 @@ export default { ...@@ -136,23 +143,28 @@ export default {
publiccus: {} publiccus: {}
}, },
canvas: null, canvas: null,
req: {} req: {},
isGroup: true,
isEmpty: true
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
init (params) { init (params) {
console.log(params) this.isGroup = true
// params.queryType = params.reportType || 0 let req = {
// delete params.reportType queryType: params.reportType || 0
// this.req = params }
// this.getOverallbase('total') if (params.brand) this.isGroup = false
// this.getOverallbase('wechat') this.req = req
// this.getOverallbase('wechatGroup') this.isEmpty = true
// this.getOverallbase('applet') this.getOverallbase('total')
// this.getOverallbase('publiccus') this.getOverallbase('wechat')
// this.getOveralltrend('total') this.getOverallbase('wechatGroup')
this.getOverallbase('applet')
this.getOverallbase('publiccus')
this.getOveralltrend('total')
}, },
changeType (type) { changeType (type) {
this.tabType = type this.tabType = type
...@@ -162,17 +174,14 @@ export default { ...@@ -162,17 +174,14 @@ export default {
this.tabIndex = index this.tabIndex = index
}, },
getOverallbase (queryItem) { getOverallbase (queryItem) {
let { req: { queryType }, req } = this
const params = { const params = {
queryItem, queryItem,
queryTime: '2022-06-23', queryTime: this.getCurrentDate(),
// queryTime: this.getCurrentDate(),
corporateGroupName: '集团1',
...req
} }
this.api.overview[queryType == 0 ? 'getBrandOverallbase' : 'getMerchantOverallbase'](params).then(({ code, data }) => { this.api.overview[this.isGroup ? 'getBrandOverallbase' : 'getMerchantOverallbase'](params).then(({ code, data }) => {
if (code == 0) { if (code == 0) {
let [dataList] = data.dataList let [dataList] = data.dataList
console.log(dataList)
if (dataList) { if (dataList) {
dataList.top = this.ObjectToArray(dataList.topList) dataList.top = this.ObjectToArray(dataList.topList)
dataList.last = this.ObjectToArray(dataList.lastList) dataList.last = this.ObjectToArray(dataList.lastList)
...@@ -191,23 +200,28 @@ export default { ...@@ -191,23 +200,28 @@ export default {
}, },
ObjectToArray (obj) { ObjectToArray (obj) {
let arr = [] let arr = []
obj = JSON.parse(obj) JSON.parse(obj).map(e => {
Object.keys(obj).map(name => arr.push({ name, num: obj[name] })) Object.keys(e).map(name => arr.push({ name, num: e[name] }))
})
return arr return arr
}, },
getOveralltrend (queryItem) { getOveralltrend (queryItem) {
let { req: { queryType }, req } = this let { req: { queryType } } = this
const params = { const params = {
queryItem, queryItem,
querystartTime: queryType == 1 ? this.getNDate(-30) : this.getNMonth(-12), querystartTime: queryType == 1 ? this.getNDate(-30) : this.getNMonth(-12),
queryendTime: queryType == 1 ? this.getNDate(-1) : this.getNMonth(-1), queryendTime: queryType == 1 ? this.getNDate(-1) : this.getNMonth(-1),
corporateGroupName: '集团1',
...req
} }
this.api.overview[queryType == 0 ? 'getBrandOveralltrend' : 'getMerchantOveralltrend'](params).then(({ data, code }) => { this.api.overview[this.isGroup ? 'getBrandOveralltrend' : 'getMerchantOveralltrend'](params).then(({ data, code }) => {
if (code == 0) { if (code == 0) {
this.canvas = echarts.init(this.$refs.canvas) if (!data.dataList.map(item => item.totalNum).every(item => item === 0)) {
this.draw(data.dataList, queryType) this.isEmpty = false
this.$nextTick(() => {
this.canvas = echarts.init(this.$refs.canvas)
this.draw(data.dataList, queryType)
})
}
} }
}) })
}, },
...@@ -393,7 +407,8 @@ export default { ...@@ -393,7 +407,8 @@ export default {
margin-top: auto; margin-top: auto;
justify-content: space-between; justify-content: space-between;
gap: 0 8px; gap: 0 8px;
.line { .line,
.empty {
flex: 7; flex: 7;
} }
.table { .table {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!