fix:主要设备单位产品电耗图标时间搜索
This commit is contained in:
parent
bad6efb816
commit
6999a172cd
|
@ -83,13 +83,45 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<div class="radioWrap">
|
||||
<el-radio-group v-model="typeRadio">
|
||||
<el-radio-group
|
||||
v-model="typeRadio"
|
||||
@change="typeRadioChange"
|
||||
>
|
||||
<el-radio-button label="day">本日</el-radio-button>
|
||||
<el-radio-button label="month"
|
||||
>本月</el-radio-button
|
||||
>
|
||||
<el-radio-button label="year">本年</el-radio-button>
|
||||
</el-radio-group>
|
||||
<div style="position: absolute; right: 20px">
|
||||
<el-date-picker
|
||||
v-model="searchDate"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
formatter="YYYY-MM-DD"
|
||||
placeholder="选择日期"
|
||||
v-if="typeRadio == 'day'"
|
||||
@change="dateChange"
|
||||
></el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="searchDate"
|
||||
type="month"
|
||||
value-format="YYYY-MM"
|
||||
formatter="YYYY-MM"
|
||||
placeholder="选择月"
|
||||
v-if="typeRadio == 'month'"
|
||||
@change="dateChange"
|
||||
></el-date-picker>
|
||||
<el-date-picker
|
||||
v-if="typeRadio == 'year'"
|
||||
v-model="searchDate"
|
||||
type="year"
|
||||
value-format="YYYY"
|
||||
formatter="YYYY"
|
||||
placeholder="选择年"
|
||||
@change="dateChange"
|
||||
></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chartWrap" v-show="typeRadio == 'day'">
|
||||
<div class="chartTitle">小时生产参数统计图</div>
|
||||
|
@ -220,8 +252,8 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
searchDate: "",
|
||||
typeRadio: "day",
|
||||
chartShow: false,
|
||||
myOption: null,
|
||||
optionHour: {},
|
||||
optionDay: {},
|
||||
|
@ -597,20 +629,38 @@ export default {
|
|||
}
|
||||
});
|
||||
});
|
||||
that.getHourData();
|
||||
that.getDayData();
|
||||
that.getMonthData();
|
||||
that.getHourData(that.year, that.month, that.days);
|
||||
that.getDayData(that.year, that.month);
|
||||
that.getMonthData(that.year);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
typeRadioChange() {
|
||||
this.searchDate = "";
|
||||
},
|
||||
dateChange(val) {
|
||||
console.log(val);
|
||||
if (this.typeRadio == "day") {
|
||||
let year = val.split("-")[0];
|
||||
let month = val.split("-")[1];
|
||||
let days = val.split("-")[2];
|
||||
this.getHourData(year, month, days);
|
||||
} else if (this.typeRadio == "month") {
|
||||
let year = val.split("-")[0];
|
||||
let month = val.split("-")[1];
|
||||
this.getDayData(year, month);
|
||||
} else {
|
||||
this.getMonthData(val);
|
||||
}
|
||||
},
|
||||
//获取小时数据
|
||||
getHourData() {
|
||||
getHourData(year, month, days) {
|
||||
let that = this;
|
||||
let query = {};
|
||||
query.page = 0;
|
||||
query.year_s = that.year;
|
||||
query.month_s = that.month;
|
||||
query.day_s = that.days;
|
||||
query.year_s = year;
|
||||
query.month_s = month;
|
||||
query.day_s = days;
|
||||
query.type = "hour_s";
|
||||
query.mgroup = that.query.mgroup;
|
||||
this.$API.enm.enstat.req(query).then((response) => {
|
||||
|
@ -632,7 +682,7 @@ export default {
|
|||
options.series[2].data = seriesData2;
|
||||
options.series[3].data = seriesData3;
|
||||
let hourXAxis = [];
|
||||
for (let i = 1; i <= that.hours; i++) {
|
||||
for (let i = 0; i < 24; i++) {
|
||||
let item = i + "时";
|
||||
hourXAxis.push(item);
|
||||
}
|
||||
|
@ -641,12 +691,12 @@ export default {
|
|||
});
|
||||
},
|
||||
//获取天数据
|
||||
getDayData() {
|
||||
getDayData(year, month) {
|
||||
let that = this;
|
||||
let query1 = {};
|
||||
query1.page = 0;
|
||||
query1.year_s = that.year;
|
||||
query1.month_s = that.month;
|
||||
query1.year_s = year;
|
||||
query1.month_s = month;
|
||||
query1.type = "day_s";
|
||||
query1.mgroup = this.query.mgroup;
|
||||
this.$API.enm.enstat.req(query1).then((response) => {
|
||||
|
@ -668,7 +718,8 @@ export default {
|
|||
options.series[2].data = seriesData2;
|
||||
options.series[3].data = seriesData3;
|
||||
let dayXAxis = [];
|
||||
for (let i = 1; i <= that.days; i++) {
|
||||
let dayss = new Date(year, month, 0).getDate();
|
||||
for (let i = 1; i <= dayss; i++) {
|
||||
let item = i + "日";
|
||||
dayXAxis.push(item);
|
||||
}
|
||||
|
@ -677,11 +728,11 @@ export default {
|
|||
});
|
||||
},
|
||||
//获取月数据
|
||||
getMonthData() {
|
||||
getMonthData(year) {
|
||||
let that = this;
|
||||
let query2 = {};
|
||||
query2.page = 0;
|
||||
query2.year_s = that.year;
|
||||
query2.year_s = year;
|
||||
query2.type = "month_s";
|
||||
query2.mgroup = that.query.mgroup;
|
||||
this.$API.enm.enstat.req(query2).then((response) => {
|
||||
|
@ -704,7 +755,7 @@ export default {
|
|||
options.series[2].data = seriesData2;
|
||||
options.series[3].data = seriesData3;
|
||||
let monthXAxis = [];
|
||||
for (let i = 1; i <= that.month; i++) {
|
||||
for (let i = 1; i < 13; i++) {
|
||||
let item = i + "月";
|
||||
monthXAxis.push(item);
|
||||
}
|
||||
|
@ -717,15 +768,6 @@ export default {
|
|||
this.cate = item[1];
|
||||
this.asynDialog = true;
|
||||
},
|
||||
itemClick1(type, item) {
|
||||
this.chartShow = false;
|
||||
this.$API.bi.dataset.exec.req("3322567213885833216").then((res) => {
|
||||
this.myOption = JSON.parse(res.echart_options);
|
||||
debugger;
|
||||
console.log(this.myOption);
|
||||
this.chartShow = true;
|
||||
});
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT("#myReport");
|
||||
},
|
||||
|
@ -745,5 +787,6 @@ export default {
|
|||
display: flex;
|
||||
justify-content: center;
|
||||
padding-top: 10px;
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -96,13 +96,45 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<div class="radioWrap">
|
||||
<el-radio-group v-model="typeRadio">
|
||||
<el-radio-group
|
||||
v-model="typeRadio"
|
||||
@change="typeRadioChange"
|
||||
>
|
||||
<el-radio-button label="day">本日</el-radio-button>
|
||||
<el-radio-button label="month"
|
||||
>本月</el-radio-button
|
||||
>
|
||||
<el-radio-button label="year">本年</el-radio-button>
|
||||
</el-radio-group>
|
||||
<div style="position: absolute; right: 20px">
|
||||
<el-date-picker
|
||||
v-model="searchDate"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
formatter="YYYY-MM-DD"
|
||||
placeholder="选择日期"
|
||||
v-if="typeRadio == 'day'"
|
||||
@change="dateChange"
|
||||
></el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="searchDate"
|
||||
type="month"
|
||||
value-format="YYYY-MM"
|
||||
formatter="YYYY-MM"
|
||||
placeholder="选择月"
|
||||
v-if="typeRadio == 'month'"
|
||||
@change="dateChange"
|
||||
></el-date-picker>
|
||||
<el-date-picker
|
||||
v-if="typeRadio == 'year'"
|
||||
v-model="searchDate"
|
||||
type="year"
|
||||
value-format="YYYY"
|
||||
formatter="YYYY"
|
||||
placeholder="选择年"
|
||||
@change="dateChange"
|
||||
></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chartWrap" v-show="typeRadio == 'day'">
|
||||
<div class="chartTitle">小时生产参数统计图</div>
|
||||
|
@ -344,6 +376,7 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
searchDate: "",
|
||||
typeRadio: "day",
|
||||
timeStamp: null,
|
||||
chartShow: false,
|
||||
|
@ -404,18 +437,18 @@ export default {
|
|||
yAxisIndex: 0,
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "运转率",
|
||||
type: "line",
|
||||
yAxisIndex: 1,
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "运转时间",
|
||||
type: "bar",
|
||||
yAxisIndex: 2,
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "运转率",
|
||||
type: "line",
|
||||
yAxisIndex: 1,
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "用电量",
|
||||
type: "bar",
|
||||
|
@ -466,18 +499,18 @@ export default {
|
|||
yAxisIndex: 0,
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "运转率",
|
||||
type: "line",
|
||||
yAxisIndex: 1,
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "运转时间",
|
||||
type: "bar",
|
||||
yAxisIndex: 2,
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "运转率",
|
||||
type: "line",
|
||||
yAxisIndex: 1,
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "用电量",
|
||||
type: "bar",
|
||||
|
@ -514,18 +547,18 @@ export default {
|
|||
yAxisIndex: 0,
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "运转率",
|
||||
type: "line",
|
||||
yAxisIndex: 1,
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "运转时间",
|
||||
type: "bar",
|
||||
yAxisIndex: 2,
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "运转率",
|
||||
type: "line",
|
||||
yAxisIndex: 1,
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "用电量",
|
||||
type: "bar",
|
||||
|
@ -612,7 +645,7 @@ export default {
|
|||
if (res4.length > 0) {
|
||||
let data4 = res4[0];
|
||||
that.tableDatas[0][2] = data4.total_production;
|
||||
that.tableDatas[1][2] = data4.production_hour; //发电功率
|
||||
that.tableDatas[1][2] = "/"; //发电功率
|
||||
that.tableDatas[2][2] = data4.production_elec_unit; //吨熟料发电量
|
||||
that.tableDatas[3][2] = "/";
|
||||
that.tableDatas[4][2] = "/";
|
||||
|
@ -750,20 +783,38 @@ export default {
|
|||
}
|
||||
});
|
||||
});
|
||||
that.getHourData();
|
||||
that.getDayData();
|
||||
that.getMonthData();
|
||||
that.getHourData(that.year, that.month, that.days);
|
||||
that.getDayData(that.year, that.month);
|
||||
that.getMonthData(that.year);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
typeRadioChange() {
|
||||
this.searchDate = "";
|
||||
},
|
||||
dateChange(val) {
|
||||
console.log(val);
|
||||
if (this.typeRadio == "day") {
|
||||
let year = val.split("-")[0];
|
||||
let month = val.split("-")[1];
|
||||
let days = val.split("-")[2];
|
||||
this.getHourData(year, month, days);
|
||||
} else if (this.typeRadio == "month") {
|
||||
let year = val.split("-")[0];
|
||||
let month = val.split("-")[1];
|
||||
this.getDayData(year, month);
|
||||
} else {
|
||||
this.getMonthData(val);
|
||||
}
|
||||
},
|
||||
//获取小时数据
|
||||
getHourData() {
|
||||
getHourData(year, month, days) {
|
||||
let that = this;
|
||||
let query = {};
|
||||
query.page = 0;
|
||||
query.year_s = that.year;
|
||||
query.month_s = that.month;
|
||||
query.day_s = that.days;
|
||||
query.year_s = year;
|
||||
query.month_s = month;
|
||||
query.day_s = days;
|
||||
query.type = "hour_s";
|
||||
query.mgroup = that.query.mgroup;
|
||||
this.$API.enm.enstat.req(query).then((response) => {
|
||||
|
@ -788,7 +839,7 @@ export default {
|
|||
options.series[3].data = seriesData3;
|
||||
options.series[4].data = seriesData4;
|
||||
let hourXAxis = [];
|
||||
for (let i = 1; i <= that.hours; i++) {
|
||||
for (let i = 0; i < 24; i++) {
|
||||
let item = i + "时";
|
||||
hourXAxis.push(item);
|
||||
}
|
||||
|
@ -796,13 +847,14 @@ export default {
|
|||
that.optionHour = options;
|
||||
});
|
||||
},
|
||||
|
||||
//获取天数据
|
||||
getDayData() {
|
||||
getDayData(year, month) {
|
||||
let that = this;
|
||||
let query1 = {};
|
||||
query1.page = 0;
|
||||
query1.year_s = that.year;
|
||||
query1.month_s = that.month;
|
||||
query1.year_s = year;
|
||||
query1.month_s = month;
|
||||
query1.type = "day_s";
|
||||
query1.mgroup = this.query.mgroup;
|
||||
this.$API.enm.enstat.req(query1).then((response) => {
|
||||
|
@ -827,7 +879,8 @@ export default {
|
|||
options.series[3].data = seriesData3;
|
||||
options.series[4].data = seriesData4;
|
||||
let dayXAxis = [];
|
||||
for (let i = 1; i <= that.days; i++) {
|
||||
let dayss = new Date(year, month, 0).getDate();
|
||||
for (let i = 1; i <= dayss; i++) {
|
||||
let item = i + "日";
|
||||
dayXAxis.push(item);
|
||||
}
|
||||
|
@ -836,11 +889,11 @@ export default {
|
|||
});
|
||||
},
|
||||
//获取月数据
|
||||
getMonthData() {
|
||||
getMonthData(year) {
|
||||
let that = this;
|
||||
let query2 = {};
|
||||
query2.page = 0;
|
||||
query2.year_s = that.year;
|
||||
query2.year_s = year;
|
||||
query2.type = "month_s";
|
||||
query2.mgroup = that.query.mgroup;
|
||||
this.$API.enm.enstat.req(query2).then((response) => {
|
||||
|
@ -865,7 +918,7 @@ export default {
|
|||
options.series[3].data = seriesData3;
|
||||
options.series[4].data = seriesData4;
|
||||
let monthXAxis = [];
|
||||
for (let i = 1; i <= that.month; i++) {
|
||||
for (let i = 1; i < 13; i++) {
|
||||
let item = i + "月";
|
||||
monthXAxis.push(item);
|
||||
}
|
||||
|
@ -906,5 +959,6 @@ export default {
|
|||
display: flex;
|
||||
justify-content: center;
|
||||
padding-top: 10px;
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -93,13 +93,45 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<div class="radioWrap">
|
||||
<el-radio-group v-model="typeRadio">
|
||||
<el-radio-group
|
||||
v-model="typeRadio"
|
||||
@change="typeRadioChange"
|
||||
>
|
||||
<el-radio-button label="day">本日</el-radio-button>
|
||||
<el-radio-button label="month"
|
||||
>本月</el-radio-button
|
||||
>
|
||||
<el-radio-button label="year">本年</el-radio-button>
|
||||
</el-radio-group>
|
||||
<div style="position: absolute; right: 20px">
|
||||
<el-date-picker
|
||||
v-model="searchDate"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
formatter="YYYY-MM-DD"
|
||||
placeholder="选择日期"
|
||||
v-if="typeRadio == 'day'"
|
||||
@change="dateChange"
|
||||
></el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="searchDate"
|
||||
type="month"
|
||||
value-format="YYYY-MM"
|
||||
formatter="YYYY-MM"
|
||||
placeholder="选择月"
|
||||
v-if="typeRadio == 'month'"
|
||||
@change="dateChange"
|
||||
></el-date-picker>
|
||||
<el-date-picker
|
||||
v-if="typeRadio == 'year'"
|
||||
v-model="searchDate"
|
||||
type="year"
|
||||
value-format="YYYY"
|
||||
formatter="YYYY"
|
||||
placeholder="选择年"
|
||||
@change="dateChange"
|
||||
></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chartWrap" v-show="typeRadio == 'day'">
|
||||
<div class="chartTitle">小时生产参数统计图</div>
|
||||
|
@ -350,6 +382,7 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
searchDate: "",
|
||||
typeRadio: "day",
|
||||
exportLoading: false,
|
||||
chartShow: false,
|
||||
|
@ -791,20 +824,38 @@ export default {
|
|||
}
|
||||
});
|
||||
});
|
||||
that.getHourData();
|
||||
that.getDayData();
|
||||
that.getMonthData();
|
||||
that.getHourData(that.year, that.month, that.days);
|
||||
that.getDayData(that.year, that.month);
|
||||
that.getMonthData(that.year);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
typeRadioChange() {
|
||||
this.searchDate = "";
|
||||
},
|
||||
dateChange(val) {
|
||||
console.log(val);
|
||||
if (this.typeRadio == "day") {
|
||||
let year = val.split("-")[0];
|
||||
let month = val.split("-")[1];
|
||||
let days = val.split("-")[2];
|
||||
this.getHourData(year, month, days);
|
||||
} else if (this.typeRadio == "month") {
|
||||
let year = val.split("-")[0];
|
||||
let month = val.split("-")[1];
|
||||
this.getDayData(year, month);
|
||||
} else {
|
||||
this.getMonthData(val);
|
||||
}
|
||||
},
|
||||
//获取小时数据
|
||||
getHourData() {
|
||||
getHourData(year, month, days) {
|
||||
let that = this;
|
||||
let query = {};
|
||||
query.page = 0;
|
||||
query.year_s = that.year;
|
||||
query.month_s = that.month;
|
||||
query.day_s = that.days;
|
||||
query.year_s = year;
|
||||
query.month_s = month;
|
||||
query.day_s = days;
|
||||
query.type = "hour_s";
|
||||
query.mgroup = that.query.mgroup;
|
||||
this.$API.enm.enstat.req(query).then((response) => {
|
||||
|
@ -829,7 +880,7 @@ export default {
|
|||
options.series[3].data = seriesData3;
|
||||
options.series[4].data = seriesData4;
|
||||
let hourXAxis = [];
|
||||
for (let i = 1; i <= that.hours; i++) {
|
||||
for (let i = 0; i < 24; i++) {
|
||||
let item = i + "时";
|
||||
hourXAxis.push(item);
|
||||
}
|
||||
|
@ -838,12 +889,12 @@ export default {
|
|||
});
|
||||
},
|
||||
//获取天数据
|
||||
getDayData() {
|
||||
getDayData(year, month) {
|
||||
let that = this;
|
||||
let query1 = {};
|
||||
query1.page = 0;
|
||||
query1.year_s = that.year;
|
||||
query1.month_s = that.month;
|
||||
query1.year_s = year;
|
||||
query1.month_s = month;
|
||||
query1.type = "day_s";
|
||||
query1.mgroup = this.query.mgroup;
|
||||
this.$API.enm.enstat.req(query1).then((response) => {
|
||||
|
@ -868,7 +919,8 @@ export default {
|
|||
options.series[3].data = seriesData3;
|
||||
options.series[4].data = seriesData4;
|
||||
let dayXAxis = [];
|
||||
for (let i = 1; i <= that.days; i++) {
|
||||
let dayss = new Date(year, month, 0).getDate();
|
||||
for (let i = 1; i <= dayss; i++) {
|
||||
let item = i + "日";
|
||||
dayXAxis.push(item);
|
||||
}
|
||||
|
@ -877,11 +929,11 @@ export default {
|
|||
});
|
||||
},
|
||||
//获取月数据
|
||||
getMonthData() {
|
||||
getMonthData(year) {
|
||||
let that = this;
|
||||
let query2 = {};
|
||||
query2.page = 0;
|
||||
query2.year_s = that.year;
|
||||
query2.year_s = year;
|
||||
query2.type = "month_s";
|
||||
query2.mgroup = that.query.mgroup;
|
||||
this.$API.enm.enstat.req(query2).then((response) => {
|
||||
|
@ -906,7 +958,7 @@ export default {
|
|||
options.series[3].data = seriesData3;
|
||||
options.series[4].data = seriesData4;
|
||||
let monthXAxis = [];
|
||||
for (let i = 1; i <= that.month; i++) {
|
||||
for (let i = 1; i < 13; i++) {
|
||||
let item = i + "月";
|
||||
monthXAxis.push(item);
|
||||
}
|
||||
|
@ -947,5 +999,6 @@ export default {
|
|||
display: flex;
|
||||
justify-content: center;
|
||||
padding-top: 10px;
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -85,12 +85,35 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<div class="radioWrap">
|
||||
<el-radio-group v-model="typeRadio">
|
||||
<el-radio-group
|
||||
v-model="typeRadio"
|
||||
@change="typeRadioChange"
|
||||
>
|
||||
<el-radio-button label="month"
|
||||
>本月</el-radio-button
|
||||
>
|
||||
<el-radio-button label="year">本年</el-radio-button>
|
||||
</el-radio-group>
|
||||
<div style="position: absolute; right: 20px">
|
||||
<el-date-picker
|
||||
v-model="searchDate"
|
||||
type="month"
|
||||
value-format="YYYY-MM"
|
||||
formatter="YYYY-MM"
|
||||
placeholder="选择月"
|
||||
v-if="typeRadio == 'month'"
|
||||
@change="dateChange"
|
||||
></el-date-picker>
|
||||
<el-date-picker
|
||||
v-if="typeRadio == 'year'"
|
||||
v-model="searchDate"
|
||||
type="year"
|
||||
value-format="YYYY"
|
||||
formatter="YYYY"
|
||||
placeholder="选择年"
|
||||
@change="dateChange"
|
||||
></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="chartWrap" v-show="typeRadio == 'month'">
|
||||
|
@ -324,6 +347,7 @@ export default {
|
|||
["产量", "总产量(t)", 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
["能耗", "单位产品分布电耗(KW·h/t)", 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
],
|
||||
searchDate: "",
|
||||
tableName: "生产报告",
|
||||
modelValue: true,
|
||||
type: "hours",
|
||||
|
@ -615,19 +639,32 @@ export default {
|
|||
});
|
||||
});
|
||||
// that.getHourData();
|
||||
that.getDayData();
|
||||
that.getMonthData();
|
||||
that.getDayData(that.year, that.month);
|
||||
that.getMonthData(that.year);
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
typeRadioChange() {
|
||||
this.searchDate = "";
|
||||
},
|
||||
dateChange(val) {
|
||||
console.log(val);
|
||||
if (this.typeRadio == "month") {
|
||||
let year = val.split("-")[0];
|
||||
let month = val.split("-")[1];
|
||||
this.getDayData(year, month);
|
||||
} else {
|
||||
this.getMonthData(val);
|
||||
}
|
||||
},
|
||||
//获取天数据
|
||||
getDayData() {
|
||||
getDayData(year, month) {
|
||||
let that = this;
|
||||
let query1 = {};
|
||||
query1.page = 0;
|
||||
query1.year_s = that.year;
|
||||
query1.month_s = that.month;
|
||||
query1.year_s = year;
|
||||
query1.month_s = month;
|
||||
query1.type = "day_s";
|
||||
query1.mgroup = this.query.mgroup;
|
||||
this.$API.enm.enstat.req(query1).then((response) => {
|
||||
|
@ -644,7 +681,8 @@ export default {
|
|||
options.series[0].data = seriesData0;
|
||||
options.series[1].data = seriesData1;
|
||||
let dayXAxis = [];
|
||||
for (let i = 1; i <= that.days; i++) {
|
||||
let dayss = new Date(year, month, 0).getDate();
|
||||
for (let i = 1; i <= dayss; i++) {
|
||||
let item = i + "日";
|
||||
dayXAxis.push(item);
|
||||
}
|
||||
|
@ -653,11 +691,11 @@ export default {
|
|||
});
|
||||
},
|
||||
//获取月数据
|
||||
getMonthData() {
|
||||
getMonthData(year) {
|
||||
let that = this;
|
||||
let query2 = {};
|
||||
query2.page = 0;
|
||||
query2.year_s = that.year;
|
||||
query2.year_s = year;
|
||||
query2.type = "month_s";
|
||||
query2.mgroup = that.query.mgroup;
|
||||
this.$API.enm.enstat.req(query2).then((response) => {
|
||||
|
@ -674,7 +712,7 @@ export default {
|
|||
options.series[0].data = seriesData0;
|
||||
options.series[1].data = seriesData1;
|
||||
let monthXAxis = [];
|
||||
for (let i = 1; i <= that.month; i++) {
|
||||
for (let i = 1; i < 13; i++) {
|
||||
let item = i + "月";
|
||||
monthXAxis.push(item);
|
||||
}
|
||||
|
@ -716,5 +754,6 @@ export default {
|
|||
display: flex;
|
||||
justify-content: center;
|
||||
padding-top: 10px;
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -71,8 +71,11 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="radioWrap" @change="typeRadioChange">
|
||||
<el-radio-group v-model="typeRadio">
|
||||
<div class="radioWrap">
|
||||
<el-radio-group
|
||||
v-model="typeRadio"
|
||||
@change="typeRadioChange"
|
||||
>
|
||||
<el-radio-button label="day">本日</el-radio-button>
|
||||
<el-radio-button label="month"
|
||||
>本月</el-radio-button
|
||||
|
@ -366,7 +369,6 @@ export default {
|
|||
} else {
|
||||
this.getMonthData(val);
|
||||
}
|
||||
this.searchDate;
|
||||
},
|
||||
getTableHourData() {
|
||||
let that = this;
|
||||
|
|
|
@ -86,13 +86,45 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<div class="radioWrap">
|
||||
<el-radio-group v-model="typeRadio">
|
||||
<el-radio-group
|
||||
v-model="typeRadio"
|
||||
@change="typeRadioChange"
|
||||
>
|
||||
<el-radio-button label="day">本日</el-radio-button>
|
||||
<el-radio-button label="month"
|
||||
>本月</el-radio-button
|
||||
>
|
||||
<el-radio-button label="year">本年</el-radio-button>
|
||||
</el-radio-group>
|
||||
<div style="position: absolute; right: 20px">
|
||||
<el-date-picker
|
||||
v-model="searchDate"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
formatter="YYYY-MM-DD"
|
||||
placeholder="选择日期"
|
||||
v-if="typeRadio == 'day'"
|
||||
@change="dateChange"
|
||||
></el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="searchDate"
|
||||
type="month"
|
||||
value-format="YYYY-MM"
|
||||
formatter="YYYY-MM"
|
||||
placeholder="选择月"
|
||||
v-if="typeRadio == 'month'"
|
||||
@change="dateChange"
|
||||
></el-date-picker>
|
||||
<el-date-picker
|
||||
v-if="typeRadio == 'year'"
|
||||
v-model="searchDate"
|
||||
type="year"
|
||||
value-format="YYYY"
|
||||
formatter="YYYY"
|
||||
placeholder="选择年"
|
||||
@change="dateChange"
|
||||
></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chartWrap" v-show="typeRadio == 'day'">
|
||||
<div class="chartTitle">小时生产参数统计图</div>
|
||||
|
@ -346,6 +378,7 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
searchDate: "",
|
||||
typeRadio: "day",
|
||||
exportLoading: false,
|
||||
chartShow: false,
|
||||
|
@ -732,21 +765,39 @@ export default {
|
|||
}
|
||||
});
|
||||
});
|
||||
that.getHourData();
|
||||
that.getDayData();
|
||||
that.getMonthData();
|
||||
that.getHourData(that.year, that.month, that.days);
|
||||
that.getDayData(that.year, that.month);
|
||||
that.getMonthData(that.year);
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
typeRadioChange() {
|
||||
this.searchDate = "";
|
||||
},
|
||||
dateChange(val) {
|
||||
console.log(val);
|
||||
if (this.typeRadio == "day") {
|
||||
let year = val.split("-")[0];
|
||||
let month = val.split("-")[1];
|
||||
let days = val.split("-")[2];
|
||||
this.getHourData(year, month, days);
|
||||
} else if (this.typeRadio == "month") {
|
||||
let year = val.split("-")[0];
|
||||
let month = val.split("-")[1];
|
||||
this.getDayData(year, month);
|
||||
} else {
|
||||
this.getMonthData(val);
|
||||
}
|
||||
},
|
||||
//获取小时数据
|
||||
getHourData() {
|
||||
getHourData(year, month, days) {
|
||||
let that = this;
|
||||
let query = {};
|
||||
query.page = 0;
|
||||
query.year_s = that.year;
|
||||
query.month_s = that.month;
|
||||
query.day_s = that.days;
|
||||
query.year_s = year;
|
||||
query.month_s = month;
|
||||
query.day_s = days;
|
||||
query.type = "hour_s";
|
||||
query.mgroup = that.query.mgroup;
|
||||
this.$API.enm.enstat.req(query).then((response) => {
|
||||
|
@ -768,7 +819,7 @@ export default {
|
|||
options.series[2].data = seriesData2;
|
||||
options.series[3].data = seriesData3;
|
||||
let hourXAxis = [];
|
||||
for (let i = 1; i <= that.hours; i++) {
|
||||
for (let i = 0; i < 24; i++) {
|
||||
let item = i + "时";
|
||||
hourXAxis.push(item);
|
||||
}
|
||||
|
@ -777,12 +828,12 @@ export default {
|
|||
});
|
||||
},
|
||||
//获取天数据
|
||||
getDayData() {
|
||||
getDayData(year, month) {
|
||||
let that = this;
|
||||
let query1 = {};
|
||||
query1.page = 0;
|
||||
query1.year_s = that.year;
|
||||
query1.month_s = that.month;
|
||||
query1.year_s = year;
|
||||
query1.month_s = month;
|
||||
query1.type = "day_s";
|
||||
query1.mgroup = this.query.mgroup;
|
||||
this.$API.enm.enstat.req(query1).then((response) => {
|
||||
|
@ -804,7 +855,8 @@ export default {
|
|||
options.series[2].data = seriesData2;
|
||||
options.series[3].data = seriesData3;
|
||||
let dayXAxis = [];
|
||||
for (let i = 1; i <= that.days; i++) {
|
||||
let dayss = new Date(year, month, 0).getDate();
|
||||
for (let i = 1; i <= dayss; i++) {
|
||||
let item = i + "日";
|
||||
dayXAxis.push(item);
|
||||
}
|
||||
|
@ -813,11 +865,11 @@ export default {
|
|||
});
|
||||
},
|
||||
//获取月数据
|
||||
getMonthData() {
|
||||
getMonthData(year) {
|
||||
let that = this;
|
||||
let query2 = {};
|
||||
query2.page = 0;
|
||||
query2.year_s = that.year;
|
||||
query2.year_s = year;
|
||||
query2.type = "month_s";
|
||||
query2.mgroup = that.query.mgroup;
|
||||
this.$API.enm.enstat.req(query2).then((response) => {
|
||||
|
@ -839,7 +891,7 @@ export default {
|
|||
options.series[2].data = seriesData2;
|
||||
options.series[3].data = seriesData3;
|
||||
let monthXAxis = [];
|
||||
for (let i = 1; i <= that.month; i++) {
|
||||
for (let i = 1; i < 13; i++) {
|
||||
let item = i + "月";
|
||||
monthXAxis.push(item);
|
||||
}
|
||||
|
@ -881,5 +933,6 @@ export default {
|
|||
display: flex;
|
||||
justify-content: center;
|
||||
padding-top: 10px;
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue