Commit 25065fe5 by 胡悦

提交样式

1 parent 300e59d4
...@@ -163,8 +163,9 @@ export default { ...@@ -163,8 +163,9 @@ export default {
}) })
var seriesDate = this.dataList.map(item => +item.num) var seriesDate = this.dataList.map(item => +item.num)
this.lineOptions.series[0].data = seriesDate this.lineOptions.series[0].data = seriesDate
this.lineOptions.yAxis.min = Math.min(...seriesDate) this.lineOptions.yAxis.scale = true
this.lineOptions.yAxis.max = Math.max(...seriesDate) // this.lineOptions.yAxis.min = Math.min(...seriesDate)
// this.lineOptions.yAxis.max = Math.max(...seriesDate)
this[this.domId].setOption(this.lineOptions) this[this.domId].setOption(this.lineOptions)
// 默认展示tooltip // 默认展示tooltip
this.chartAction() this.chartAction()
......
...@@ -102,11 +102,11 @@ import * as echarts from 'echarts' ...@@ -102,11 +102,11 @@ import * as echarts from 'echarts'
export default { export default {
name: 'ViewTabs', name: 'ViewTabs',
mixins: [changeMixin], mixins: [changeMixin],
data () { data() {
return { return {
tabs, tabs,
tabHead: [], tabHead: [],
tabTitle:'客户总数', tabTitle: '客户总数',
tabType: 'total', tabType: 'total',
tabIndex: 0, tabIndex: 0,
delayTimer: 3000, delayTimer: 3000,
...@@ -126,10 +126,9 @@ export default { ...@@ -126,10 +126,9 @@ export default {
updata: Date.now() updata: Date.now()
} }
}, },
mounted () { mounted() {},
},
methods: { methods: {
init (params) { init(params) {
this.isGroup = true this.isGroup = true
let req = { let req = {
queryType: params.reportType || 0 queryType: params.reportType || 0
...@@ -144,20 +143,22 @@ export default { ...@@ -144,20 +143,22 @@ export default {
this.getOverallbase('publiccus') this.getOverallbase('publiccus')
this.getOveralltrend('total') this.getOveralltrend('total')
}, },
changeType (type) { changeType(type) {
let title = { let title = {
'total': '客户总数', total: '客户总数',
'wechat': '企微客户数', wechat: '企微客户数',
'wechatGroup': '企微群数', wechatGroup: '企微群数',
'applet': '小程序客户数', applet: '小程序客户数',
'publiccus': '公众号客户数' publiccus: '公众号客户数'
} }
this.tabTitle = title[type] this.tabTitle = title[type]
this.tabType = type this.tabType = type
this.getOveralltrend(type) this.getOveralltrend(type)
}, },
getOverallbase (queryItem) { getOverallbase(queryItem) {
let { req: { queryType } } = this let {
req: { queryType }
} = this
const params = { const params = {
queryItem, queryItem,
queryType, queryType,
...@@ -192,32 +193,34 @@ export default { ...@@ -192,32 +193,34 @@ export default {
} }
} }
this.pageData[queryItem] = dataList this.pageData[queryItem] = dataList
} }
}) })
}, },
ObjectToArray (obj) { ObjectToArray(obj) {
let arr = [] let arr = []
if (obj && obj !== 'null') { if (obj && obj !== 'null') {
obj = obj.replace('null', '"未知"') obj = obj.replace('null', '"未知"')
let item = JSON.parse(obj) let item = JSON.parse(obj)
if (Array.isArray(item)) item.map(e => { if (Array.isArray(item))
item.map(e => {
Object.keys(e).map(name => arr.push({ name, num: e[name] })) Object.keys(e).map(name => arr.push({ name, num: e[name] }))
}) })
else Object.keys(item).map(name => arr.push({ name, num: item[name] })) else Object.keys(item).map(name => arr.push({ name, num: item[name] }))
} }
return arr return arr
}, },
getOveralltrend (queryItem) { getOveralltrend(queryItem) {
let { req: { queryType } } = this let {
req: { queryType }
} = this
const params = { const params = {
queryItem, queryItem,
queryType, queryType,
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)
} }
this.api.overview[this.isGroup ? 'getBrandOveralltrend' : 'getMerchantOveralltrend'](params).then(({ data, code }) => { this.api.overview[this.isGroup ? 'getBrandOveralltrend' : 'getMerchantOveralltrend'](params)
.then(({ data, code }) => {
this.flag = true this.flag = true
if (code == 0) { if (code == 0) {
if (!data.dataList.map(item => item.totalNum).every(item => item === 0)) { if (!data.dataList.map(item => item.totalNum).every(item => item === 0)) {
...@@ -227,9 +230,9 @@ export default { ...@@ -227,9 +230,9 @@ export default {
this.draw(data.dataList, queryType) this.draw(data.dataList, queryType)
}) })
} }
} }
}).catch(() => { })
.catch(() => {
this.flag = true this.flag = true
}) })
}, },
...@@ -240,16 +243,16 @@ export default { ...@@ -240,16 +243,16 @@ export default {
dataIndex: dataList.length - 1 dataIndex: dataList.length - 1
}) })
}, },
draw (lineData, queryType) { draw(lineData, queryType) {
let data = [], let data = [],
Min=0, Min = 0,
xData = [], xData = [],
title = { title = {
'total': '客户总数', total: '客户总数',
'wechat': '企微客户数', wechat: '企微客户数',
'wechatGroup': '企微群数', wechatGroup: '企微群数',
'applet': '小程序客户数', applet: '小程序客户数',
'publiccus': '公众号客户数' publiccus: '公众号客户数'
}, },
{ tabType } = this { tabType } = this
lineData.map(e => { lineData.map(e => {
...@@ -296,7 +299,8 @@ export default { ...@@ -296,7 +299,8 @@ export default {
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
min: Min, // min: Min,
scale: true,
splitLine: { splitLine: {
lineStyle: { lineStyle: {
color: 'rgba(96,98,102,0.2)' color: 'rgba(96,98,102,0.2)'
......
...@@ -64,8 +64,10 @@ export default { ...@@ -64,8 +64,10 @@ export default {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
type: 'shadow' type: 'shadow',
// color: '#fff' shadowStyle: {
color: 'rgba(235,96,1,0.30'
}
}, },
borderWidth: 0, borderWidth: 0,
backgroundColor: 'rgba(68,68,68,0.80)', backgroundColor: 'rgba(68,68,68,0.80)',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!