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 {
method
}
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') {
var paramsArray = []
Object.keys(params.req).forEach(key => paramsArray.push('req.' + key + '=' + params.req[key]))
......
@import './normalize.scss';
@import './sprite.scss';
@font-face {
font-family: 'PingFangSC-Regular';
src: url('../font/PingFang-Regular.ttf');
}
html,
body .app {
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;
-webkit-overflow-scrolling: touch;
height: 100%;
......@@ -74,9 +79,11 @@ img {
background: #1d1c1c;
overflow: hidden;
}
.inline {
display: inline-block;
}
.title {
font-size: 12px;
color: #e8e8e8;
......@@ -85,9 +92,11 @@ img {
padding: 0.5vh 8px;
user-select: none;
}
.title-icon {
display: flex;
align-items: center;
.icon {
display: inline-block;
width: 4px;
......@@ -98,8 +107,9 @@ img {
margin-right: 6px;
}
}
.container{
margin:0 8px;
.container {
margin: 0 8px;
}
.empty {
......@@ -108,6 +118,7 @@ img {
height: calc(100% - 4.1vh);
align-items: center;
justify-content: center;
img {
width: 20vh;
height: 9.5vh;
......
No preview for this file type
......@@ -114,6 +114,20 @@ export default {
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.chartAction()
......@@ -145,8 +159,6 @@ export default {
this.chartAction()
this.getRankList(0)
// this.autoMove()
},
handleRankChange(value) {
......
......@@ -75,6 +75,7 @@ export default {
if (index == 0) {
if (tabIndex == index) return
this.tab = ['广汇集团', '品牌概览']
this.brands.map(e => e.active = false)
} else {
if (!item) return
this.tab[1] = item.brandName
......
......@@ -55,10 +55,17 @@
<div class="tabs-content box">
<div class="tabs-title">客户增长趋势</div>
<div class="tabs-content-chart flex">
<template v-if="isEmpty">
<div class="empty">
<img src="@/assets/images/empty.png" />
</div>
</template>
<template v-else>
<div
class="line"
ref="canvas"
></div>
</template>
<div class="table user-select pointer">
<div class="table-head">
<template v-for="(i,index) in tabHead">
......@@ -136,23 +143,28 @@ export default {
publiccus: {}
},
canvas: null,
req: {}
req: {},
isGroup: true,
isEmpty: true
}
},
mounted () {
},
methods: {
init (params) {
console.log(params)
// params.queryType = params.reportType || 0
// delete params.reportType
// this.req = params
// this.getOverallbase('total')
// this.getOverallbase('wechat')
// this.getOverallbase('wechatGroup')
// this.getOverallbase('applet')
// this.getOverallbase('publiccus')
// this.getOveralltrend('total')
this.isGroup = true
let req = {
queryType: params.reportType || 0
}
if (params.brand) this.isGroup = false
this.req = req
this.isEmpty = true
this.getOverallbase('total')
this.getOverallbase('wechat')
this.getOverallbase('wechatGroup')
this.getOverallbase('applet')
this.getOverallbase('publiccus')
this.getOveralltrend('total')
},
changeType (type) {
this.tabType = type
......@@ -162,17 +174,14 @@ export default {
this.tabIndex = index
},
getOverallbase (queryItem) {
let { req: { queryType }, req } = this
const params = {
queryItem,
queryTime: '2022-06-23',
// queryTime: this.getCurrentDate(),
corporateGroupName: '集团1',
...req
queryTime: this.getCurrentDate(),
}
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) {
let [dataList] = data.dataList
console.log(dataList)
if (dataList) {
dataList.top = this.ObjectToArray(dataList.topList)
dataList.last = this.ObjectToArray(dataList.lastList)
......@@ -191,23 +200,28 @@ export default {
},
ObjectToArray (obj) {
let arr = []
obj = JSON.parse(obj)
Object.keys(obj).map(name => arr.push({ name, num: obj[name] }))
JSON.parse(obj).map(e => {
Object.keys(e).map(name => arr.push({ name, num: e[name] }))
})
return arr
},
getOveralltrend (queryItem) {
let { req: { queryType }, req } = this
let { req: { queryType } } = this
const params = {
queryItem,
querystartTime: queryType == 1 ? this.getNDate(-30) : this.getNMonth(-12),
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 (!data.dataList.map(item => item.totalNum).every(item => item === 0)) {
this.isEmpty = false
this.$nextTick(() => {
this.canvas = echarts.init(this.$refs.canvas)
this.draw(data.dataList, queryType)
})
}
}
})
},
......@@ -393,7 +407,8 @@ export default {
margin-top: auto;
justify-content: space-between;
gap: 0 8px;
.line {
.line,
.empty {
flex: 7;
}
.table {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!