Commit 33947b75 authored by 华国豪's avatar 华国豪 🙄

1

parent 1092afe5
......@@ -651,9 +651,6 @@ export default {
} else {
slineId = regionIdArr[1]
}
if (this.prolineId == lineId) {
return
}
this.prolineId = lineId
this.slineId = slineId
this.init()
......@@ -678,6 +675,7 @@ export default {
init(){
this.loding = false;
this.chartShow = false;
this.chartShow2 = false;
let url='http://47.96.23.199:5001/api/order/get_single_data'
let url2 = "http://47.96.23.199:5001/api/order/get_single_data_v2"
let msg={
......
......@@ -33,7 +33,7 @@
function calculateMA(dayCount, data) {
var result = [];
for (var i = 0, len = data.length; i < len; i++) {
result.push(data[i].value[4]);
result.push(data[i].value[dayCount]);
}
return result;
}
......@@ -54,7 +54,7 @@ export default {
},mounted() {
let data = this.lineChartKData.map(function (item) {
return [+item.StartPrice, +item.MaxPrice, +item.EndPrice, +item.MinPrice, +item.ClickCount];
return [item.StartPrice, item.MaxPrice, item.EndPrice, item.MinPrice, item.ClickCount, item.FiveAvg, item.TenAvg];
});
var dates = this.lineChartKData.map(function (item) {
return item.CreateDate;
......@@ -89,7 +89,7 @@ export default {
let option = {
backgroundColor: '#21202D',
legend: {
data: ['成交单价', '产品点击'],
data: ['成交单价', '产品点击', '5日平均', '10日平均'],
inactiveColor: '#777',
textStyle: {
color: '#fff'
......@@ -110,6 +110,8 @@ export default {
low: params[0].value[3],
height: params[0].value[4],
click: params[0].value[5],
FiveAvg: params[0].value[6],
TenAvg: params[0].value[7],
}
} else {
obj = {
......@@ -120,6 +122,8 @@ export default {
low: params[1].value[3],
height: params[1].value[4],
click: params[1].value[5],
FiveAvg: params[0].value[6],
TenAvg: params[0].value[7],
}
}
var res = obj.sName + ' ' + obj.name
......@@ -128,6 +132,8 @@ export default {
res += '<br/> 结束值: ' + obj.close
res += '<br/> 最低值: ' + obj.low
res += '<br/> 点击: ' + obj.click
res += '<br/> 5日平均: ' + obj.FiveAvg
res += '<br/> 10日平均: ' + obj.TenAvg
return res
},
axisPointer: {
......@@ -192,14 +198,37 @@ export default {
{
name: '产品点击',
type: 'line',
data: calculateMA(4, _this.dataList),
smooth: true,
showSymbol: false,
lineStyle: {
width: 3,
color: '#F5AF19',
opacity: 0.5
}
},
{
name: '5日平均',
type: 'line',
data: calculateMA(5, _this.dataList),
smooth: true,
showSymbol: false,
lineStyle: {
normal: {
width: 1,
color: "#F5AF19",
}
width: 3,
color: '#3FD2F3',
opacity: 0.5
}
},
{
name: '10日平均',
type: 'line',
data: calculateMA(6, _this.dataList),
smooth: true,
showSymbol: false,
lineStyle: {
width: 3,
color: '#EE4454',
opacity: 0.5
}
},
// {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment