|
|
|
@ -137,10 +137,31 @@
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-s-data"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleAnalysis"
|
|
|
|
|
>图标分析</el-button
|
|
|
|
|
@click="handleAnalysis1"
|
|
|
|
|
>柱状图表分析</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-s-data"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleAnalysis2"
|
|
|
|
|
>折线图表分析</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!--
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-s-data"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleAnalysis3"
|
|
|
|
|
>综合图表分析</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-col>-->
|
|
|
|
|
<right-toolbar
|
|
|
|
|
:showSearch.sync="showSearch"
|
|
|
|
|
@queryTable="getList"
|
|
|
|
@ -201,13 +222,13 @@
|
|
|
|
|
<el-dialog
|
|
|
|
|
:title="title"
|
|
|
|
|
:visible.sync="open"
|
|
|
|
|
width="1880px"
|
|
|
|
|
width="1300px"
|
|
|
|
|
append-to-body
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
class="echartbox"
|
|
|
|
|
id="echart1"
|
|
|
|
|
style="margin: auto; margin-top: 20px; width: 1820px; height: 545px"
|
|
|
|
|
style="margin: auto; margin-top: 20px; width: 1220px; height: 545px"
|
|
|
|
|
></div>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
@ -398,7 +419,7 @@ export default {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
getanalyzeList() {
|
|
|
|
|
getanalyzeList1() {
|
|
|
|
|
if (this.queryParams.incomeTimeArray.length > 0) {
|
|
|
|
|
this.queryParams.ymArrayStart = moment(
|
|
|
|
|
this.queryParams.incomeTimeArray[0]
|
|
|
|
@ -598,21 +619,14 @@ export default {
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
// 图表分析
|
|
|
|
|
handleAnalysis() {
|
|
|
|
|
this.title = "图表分析";
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
handleAnalysis1() {
|
|
|
|
|
this.title = "柱状图表分析";
|
|
|
|
|
if (
|
|
|
|
|
this.queryParams.projectNoArray.length > 0 &&
|
|
|
|
|
this.queryParams.projectNoArray.length < 2
|
|
|
|
|
) {
|
|
|
|
|
// this.projectNoOptions.forEach((item) => {
|
|
|
|
|
// if (item.recordId == this.queryParams.projectNoArray) {
|
|
|
|
|
// console.log(item);
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.getanalyzeList();
|
|
|
|
|
this.getanalyzeList1();
|
|
|
|
|
} else if (this.queryParams.projectNoArray.length < 0) {
|
|
|
|
|
this.$modal.msgError("请选择定量检测项");
|
|
|
|
|
} else {
|
|
|
|
@ -621,6 +635,12 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
// 取消
|
|
|
|
|
cancel() {
|
|
|
|
|
var chartDom = document.getElementById("echart1");
|
|
|
|
|
// 检查是否已经初始化了 ECharts 实例
|
|
|
|
|
if (echarts.getInstanceByDom(chartDom)) {
|
|
|
|
|
// 销毁已有的实例
|
|
|
|
|
echarts.dispose(chartDom);
|
|
|
|
|
}
|
|
|
|
|
this.open = false;
|
|
|
|
|
},
|
|
|
|
|
// 加载图表
|
|
|
|
@ -674,10 +694,379 @@ export default {
|
|
|
|
|
type: "value",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
series: this.seriesdata,
|
|
|
|
|
series: this.seriesdata
|
|
|
|
|
};
|
|
|
|
|
myChart1.setOption(option1);
|
|
|
|
|
},
|
|
|
|
|
// 图表分析
|
|
|
|
|
handleAnalysis2() {
|
|
|
|
|
this.title = "折线图表分析";
|
|
|
|
|
if (
|
|
|
|
|
this.queryParams.projectNoArray.length > 0 &&
|
|
|
|
|
this.queryParams.projectNoArray.length < 2
|
|
|
|
|
) {
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.getanalyzeList2();
|
|
|
|
|
} else if (this.queryParams.projectNoArray.length < 0) {
|
|
|
|
|
this.$modal.msgError("请选择定量检测项");
|
|
|
|
|
} else {
|
|
|
|
|
this.$modal.msgError("请选择一项定量检测项");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getanalyzeList2() {
|
|
|
|
|
if (this.queryParams.incomeTimeArray.length > 0) {
|
|
|
|
|
this.queryParams.ymArrayStart = moment(
|
|
|
|
|
this.queryParams.incomeTimeArray[0]
|
|
|
|
|
).format("YYYY-MM-DD");
|
|
|
|
|
this.queryParams.ymArrayEnd = moment(
|
|
|
|
|
this.queryParams.incomeTimeArray[1]
|
|
|
|
|
).format("YYYY-MM-DD");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getDLTableAvgInfo(this.queryParams).then((response) => {
|
|
|
|
|
this.detailechartslist = [];
|
|
|
|
|
this.seriesdata = [];
|
|
|
|
|
this.legenddata = [];
|
|
|
|
|
this.xAxisdata = [];
|
|
|
|
|
let col1 = response.titleCol1;
|
|
|
|
|
let col2 = response.titleCol2;
|
|
|
|
|
// mcode0Pcode0
|
|
|
|
|
for (let i = 0; i < col1.length; i++) {
|
|
|
|
|
for (let j = 0; j < col2.length; j++) {
|
|
|
|
|
var detailTitle = {};
|
|
|
|
|
detailTitle.col1Id = "mcode" + i + "Pcode" + j;
|
|
|
|
|
detailTitle.col1Name = col1[i];
|
|
|
|
|
detailTitle.col1xName = col2[j];
|
|
|
|
|
this.detailechartslist.push(detailTitle);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (this.detailechartslist.length > 0) {
|
|
|
|
|
this.analyzeList = response;
|
|
|
|
|
const datalist = this.detailechartslist.map((item) => {
|
|
|
|
|
const xdata = this.analyzeList.dxData.map((d) => {
|
|
|
|
|
return (d.ymdms = moment(d.ymdms, "YYYY-MM-DD AVG").format(
|
|
|
|
|
"YYYY-MM-DD"
|
|
|
|
|
));
|
|
|
|
|
});
|
|
|
|
|
const datalist = this.analyzeList.dxData.map((d) => d[item.col1Id]);
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
xdata,
|
|
|
|
|
datalist,
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
this.xAxisdata = datalist[0].xdata;
|
|
|
|
|
this.titledata = datalist[0].col1xName;
|
|
|
|
|
datalist.forEach((e, index) => {
|
|
|
|
|
this.legenddata.push(e.col1Name);
|
|
|
|
|
if (e.houer) {
|
|
|
|
|
state.xAxisdata = e.col1Name;
|
|
|
|
|
}
|
|
|
|
|
var item = {
|
|
|
|
|
name: e.col1Name,
|
|
|
|
|
type: 'line',
|
|
|
|
|
data: e.datalist,
|
|
|
|
|
markLine: {
|
|
|
|
|
symbolSize: 0,//不展示上下限两边的图标
|
|
|
|
|
data: [
|
|
|
|
|
{
|
|
|
|
|
lineStyle: {
|
|
|
|
|
color: '#ffc000',
|
|
|
|
|
width: 3
|
|
|
|
|
},
|
|
|
|
|
yAxis: response.upperDiff,//控制限制刻度
|
|
|
|
|
label: { show: true, position: 'end', formatter: '上限' }
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
lineStyle: {
|
|
|
|
|
color: '#4f81bd',
|
|
|
|
|
width: 3
|
|
|
|
|
},
|
|
|
|
|
yAxis: response.downDiff,
|
|
|
|
|
label: { show: true, position: 'end', formatter: '下限' }
|
|
|
|
|
},
|
|
|
|
|
{type: 'average', name: '平均值'}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.seriesdata.push(item);
|
|
|
|
|
});
|
|
|
|
|
this.initChart2();
|
|
|
|
|
} else {
|
|
|
|
|
this.$modal.msgError("数据为空");
|
|
|
|
|
this.detailechartslist = [];
|
|
|
|
|
this.seriesdata = [];
|
|
|
|
|
this.legenddata = [];
|
|
|
|
|
this.xAxisdata = [];
|
|
|
|
|
(this.titledata = ""), this.initChart2();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 加载图表
|
|
|
|
|
initChart2() {
|
|
|
|
|
const _this = this;
|
|
|
|
|
var chartDom = document.getElementById("echart1");
|
|
|
|
|
|
|
|
|
|
// 检查是否已经初始化了 ECharts 实例
|
|
|
|
|
if (echarts.getInstanceByDom(chartDom)) {
|
|
|
|
|
// 销毁已有的实例
|
|
|
|
|
echarts.dispose(chartDom);
|
|
|
|
|
}
|
|
|
|
|
var myChart1 = echarts.init(document.querySelector("#echart1"));
|
|
|
|
|
var option1 = {
|
|
|
|
|
title: {
|
|
|
|
|
text: '折线图表分析'
|
|
|
|
|
},
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'axis'
|
|
|
|
|
},
|
|
|
|
|
legend: {
|
|
|
|
|
data: this.legenddata//['Email', 'Union Ads']
|
|
|
|
|
},
|
|
|
|
|
grid: {
|
|
|
|
|
left: '3%',
|
|
|
|
|
right: '4%',
|
|
|
|
|
bottom: '3%',
|
|
|
|
|
containLabel: true
|
|
|
|
|
},
|
|
|
|
|
toolbox: {
|
|
|
|
|
feature: {
|
|
|
|
|
saveAsImage: {}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: 'category',
|
|
|
|
|
boundaryGap: false,
|
|
|
|
|
data: this.xAxisdata//['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
|
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
type: 'value'
|
|
|
|
|
},
|
|
|
|
|
series: this.seriesdata
|
|
|
|
|
/**[
|
|
|
|
|
{
|
|
|
|
|
name: 'Email',
|
|
|
|
|
type: 'line',
|
|
|
|
|
stack: 'Total',
|
|
|
|
|
data: [120, 132, 101, 134, 90, 230, 210],
|
|
|
|
|
markLine: {
|
|
|
|
|
symbolSize: 0,//不展示上下限两边的图标
|
|
|
|
|
data: [
|
|
|
|
|
{
|
|
|
|
|
lineStyle: {
|
|
|
|
|
color: '#ffc000',
|
|
|
|
|
width: 3
|
|
|
|
|
},
|
|
|
|
|
yAxis: 200,//控制限制刻度
|
|
|
|
|
label: { show: true, position: 'end', formatter: '上限' }
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
lineStyle: {
|
|
|
|
|
color: '#4f81bd',
|
|
|
|
|
width: 3
|
|
|
|
|
},
|
|
|
|
|
yAxis: 100,
|
|
|
|
|
label: { show: true, position: 'end', formatter: '下限' }
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Union Ads',
|
|
|
|
|
type: 'line',
|
|
|
|
|
stack: 'Total',
|
|
|
|
|
data: [220, 182, 191, 234, 290, 330, 310]
|
|
|
|
|
}
|
|
|
|
|
]**/
|
|
|
|
|
};
|
|
|
|
|
myChart1.setOption(option1);
|
|
|
|
|
},
|
|
|
|
|
// 图表分析
|
|
|
|
|
handleAnalysis3() {
|
|
|
|
|
this.title = "综合图表分析";
|
|
|
|
|
if (
|
|
|
|
|
this.queryParams.projectNoArray.length > 0 &&
|
|
|
|
|
this.queryParams.projectNoArray.length < 2
|
|
|
|
|
) {
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.getanalyzeList3();
|
|
|
|
|
} else if (this.queryParams.projectNoArray.length < 0) {
|
|
|
|
|
this.$modal.msgError("请选择定量检测项");
|
|
|
|
|
} else {
|
|
|
|
|
this.$modal.msgError("请选择一项定量检测项");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getanalyzeList3() {
|
|
|
|
|
if (this.queryParams.incomeTimeArray.length > 0) {
|
|
|
|
|
this.queryParams.ymArrayStart = moment(
|
|
|
|
|
this.queryParams.incomeTimeArray[0]
|
|
|
|
|
).format("YYYY-MM-DD");
|
|
|
|
|
this.queryParams.ymArrayEnd = moment(
|
|
|
|
|
this.queryParams.incomeTimeArray[1]
|
|
|
|
|
).format("YYYY-MM-DD");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getDLTableAvgInfo(this.queryParams).then((response) => {
|
|
|
|
|
this.detailechartslist = [];
|
|
|
|
|
this.seriesdata = [];
|
|
|
|
|
this.legenddata = [];
|
|
|
|
|
this.xAxisdata = [];
|
|
|
|
|
let col1 = response.titleCol1;
|
|
|
|
|
let col2 = response.titleCol2;
|
|
|
|
|
// mcode0Pcode0
|
|
|
|
|
for (let i = 0; i < col1.length; i++) {
|
|
|
|
|
for (let j = 0; j < col2.length; j++) {
|
|
|
|
|
var detailTitle = {};
|
|
|
|
|
detailTitle.col1Id = "mcode" + i + "Pcode" + j;
|
|
|
|
|
detailTitle.col1Name = col1[i];
|
|
|
|
|
detailTitle.col1xName = col2[j];
|
|
|
|
|
this.detailechartslist.push(detailTitle);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (this.detailechartslist.length > 0) {
|
|
|
|
|
this.analyzeList = response;
|
|
|
|
|
const datalist = this.detailechartslist.map((item) => {
|
|
|
|
|
const xdata = this.analyzeList.dxData.map((d) => {
|
|
|
|
|
return (d.ymdms = moment(d.ymdms, "YYYY-MM-DD AVG").format(
|
|
|
|
|
"YYYY-MM-DD"
|
|
|
|
|
));
|
|
|
|
|
});
|
|
|
|
|
const datalist = this.analyzeList.dxData.map((d) => d[item.col1Id]);
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
xdata,
|
|
|
|
|
datalist,
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
this.xAxisdata = datalist[0].xdata;
|
|
|
|
|
this.titledata = datalist[0].col1xName;
|
|
|
|
|
datalist.forEach((e, index) => {
|
|
|
|
|
this.legenddata.push(e.col1Name);
|
|
|
|
|
if (e.houer) {
|
|
|
|
|
state.xAxisdata = e.col1Name;
|
|
|
|
|
}
|
|
|
|
|
var item = {
|
|
|
|
|
name: e.col1Name,
|
|
|
|
|
type: 'line',
|
|
|
|
|
data: e.datalist,
|
|
|
|
|
markLine: {
|
|
|
|
|
symbolSize: 0,//不展示上下限两边的图标
|
|
|
|
|
data: [
|
|
|
|
|
{
|
|
|
|
|
lineStyle: {
|
|
|
|
|
color: '#ffc000',
|
|
|
|
|
width: 3
|
|
|
|
|
},
|
|
|
|
|
yAxis: response.upperDiff,//控制限制刻度
|
|
|
|
|
label: { show: true, position: 'end', formatter: '上限' }
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
lineStyle: {
|
|
|
|
|
color: '#4f81bd',
|
|
|
|
|
width: 3
|
|
|
|
|
},
|
|
|
|
|
yAxis: response.downDiff,
|
|
|
|
|
label: { show: true, position: 'end', formatter: '下限' }
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.seriesdata.push(item);
|
|
|
|
|
});
|
|
|
|
|
this.initChart3();
|
|
|
|
|
} else {
|
|
|
|
|
this.$modal.msgError("数据为空");
|
|
|
|
|
this.detailechartslist = [];
|
|
|
|
|
this.seriesdata = [];
|
|
|
|
|
this.legenddata = [];
|
|
|
|
|
this.xAxisdata = [];
|
|
|
|
|
(this.titledata = ""), this.initChart3();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 加载图表
|
|
|
|
|
initChart3() {
|
|
|
|
|
const _this = this;
|
|
|
|
|
var chartDom = document.getElementById("echart1");
|
|
|
|
|
|
|
|
|
|
// 检查是否已经初始化了 ECharts 实例
|
|
|
|
|
if (echarts.getInstanceByDom(chartDom)) {
|
|
|
|
|
// 销毁已有的实例
|
|
|
|
|
echarts.dispose(chartDom);
|
|
|
|
|
}
|
|
|
|
|
var myChart1 = echarts.init(document.querySelector("#echart1"));
|
|
|
|
|
var option3 = {
|
|
|
|
|
title: {
|
|
|
|
|
text: '综合图表分析'
|
|
|
|
|
},
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'axis'
|
|
|
|
|
},
|
|
|
|
|
legend: {
|
|
|
|
|
data: this.legenddata//['Email', 'Union Ads']
|
|
|
|
|
},
|
|
|
|
|
grid: {
|
|
|
|
|
left: '3%',
|
|
|
|
|
right: '4%',
|
|
|
|
|
bottom: '3%',
|
|
|
|
|
containLabel: true
|
|
|
|
|
},
|
|
|
|
|
toolbox: {
|
|
|
|
|
feature: {
|
|
|
|
|
saveAsImage: {}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: 'category',
|
|
|
|
|
boundaryGap: false,
|
|
|
|
|
data: this.xAxisdata//['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
|
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
type: 'value'
|
|
|
|
|
},
|
|
|
|
|
series: this.seriesdata
|
|
|
|
|
/**[
|
|
|
|
|
{
|
|
|
|
|
name: 'Email',
|
|
|
|
|
type: 'line',
|
|
|
|
|
stack: 'Total',
|
|
|
|
|
data: [120, 132, 101, 134, 90, 230, 210],
|
|
|
|
|
markLine: {
|
|
|
|
|
symbolSize: 0,//不展示上下限两边的图标
|
|
|
|
|
data: [
|
|
|
|
|
{
|
|
|
|
|
lineStyle: {
|
|
|
|
|
color: '#ffc000',
|
|
|
|
|
width: 3
|
|
|
|
|
},
|
|
|
|
|
yAxis: 200,//控制限制刻度
|
|
|
|
|
label: { show: true, position: 'end', formatter: '上限' }
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
lineStyle: {
|
|
|
|
|
color: '#4f81bd',
|
|
|
|
|
width: 3
|
|
|
|
|
},
|
|
|
|
|
yAxis: 100,
|
|
|
|
|
label: { show: true, position: 'end', formatter: '下限' }
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Union Ads',
|
|
|
|
|
type: 'line',
|
|
|
|
|
stack: 'Total',
|
|
|
|
|
data: [220, 182, 191, 234, 290, 330, 310]
|
|
|
|
|
}
|
|
|
|
|
]**/
|
|
|
|
|
};
|
|
|
|
|
myChart1.setOption(option3);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|