From 1233a8055749d03f5afc1b78529b8da1655cf692 Mon Sep 17 00:00:00 2001
From: lzhe <181968431@qq.com>
Date: 星期六, 27 四月 2024 17:59:57 +0800
Subject: [PATCH] 1
---
src/views/mdc/components/recordChartsByWorkstation.vue | 35 +++++++++++++++++------------------
1 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/src/views/mdc/components/recordChartsByWorkstation.vue b/src/views/mdc/components/recordChartsByWorkstation.vue
index 55c94a6..12753cc 100644
--- a/src/views/mdc/components/recordChartsByWorkstation.vue
+++ b/src/views/mdc/components/recordChartsByWorkstation.vue
@@ -1,6 +1,6 @@
<template>
- <div>
- <div id="recordwork" style="width: 1000px;height:500px;"></div>
+ <div id="recordworkParse">
+ <div id="recordwork" style="height:500px;"></div>
<div class="paginationwork">
<el-pagination layout="prev, pager, next" @current-change="recordChange" :total="total" :default-page-size="6"/>
</div>
@@ -11,13 +11,13 @@
import moment from 'moment';
import * as echarts from 'echarts';
export default {
- props: ['collectionstatus','date','workstationInfoList'],
+ props: ['setWork','collectionstatus',"select"],
watch: {
- date(val) {
+ setWork(val) {
this.current = "1";
this.getCharts();
},
- workstationInfoList(val) {
+ select(val) {
this.current = "1";
this.getCharts();
}
@@ -75,20 +75,15 @@
return color;
},
getCharts() {
- var obj = {
- date: this.date,
- humanFeedback: true,
- machineFeedback: true,
- workstationInfoList: this.workstationInfoList
- }
- this.$HTTP.post(`/api/blade-mdc/status-record/status-record-by-date?current=${this.current}&size=${this.size}`,obj).then(res => {
+ if(!this.setWork) return;
+ this.$HTTP.post(`/api/blade-mdc/status-record/status-record-by-workstation?current=${this.current}&size=${this.size}`,this.setWork).then(res => {
if (res.code === 200) {
var yAxisData = [];
var newData = [];
this.records = res.data.records;
res.data.records.reverse();
res.data.records.forEach((item,index)=> {
- yAxisData.push(item.workstationInfo.name);
+ yAxisData.push(item.date);
//璁$畻寮�濮嬫椂闂达紝鏄剧ず鏃堕棿
item.statusRecordList.forEach(item1=> {
var initstart = item1.startTime.split(" ")[0]; //鏍规嵁鏃ユ湡璁$畻宸��
@@ -98,9 +93,9 @@
var color = this.getColor(item1.wcsDesc);
item1.value = [index,startTime,endTime,diff];
item1.itemStyle = {"normal": {"color": color}};
- item1.code = item.workstationInfo.code;
- item1.name = item.workstationInfo.name;
- item1.id = item.workstationInfo.id;
+ item1.code = item.date;
+ item1.name = item.date;
+ item1.id = item.date;
})
newData.push(...item.statusRecordList);
})
@@ -125,9 +120,9 @@
},
grid: {
top: 10,
- left: 70,
+ left: 100,
bottom: 130,
- right: 0
+ right: 30
},
xAxis: {
min: 0,
@@ -173,7 +168,11 @@
]
};
var recordDom = document.getElementById('recordwork');
+ var recordworkParse = document.getElementById('recordworkParse');
var myChart = echarts.init(recordDom);
+ myChart.resize({
+ width: document.documentElement.clientWidth - 340 + "px"
+ });
myChart.setOption(option);
},
recordChange(current) {
--
Gitblit v1.9.3