Compare commits

..

No commits in common. "aa32e4d3fb453344ec4279ff02bfe15fd2b4eea6" and "ca3965e8cbcc1661625114fa30e120acb601b13c" have entirely different histories.

5 changed files with 57 additions and 88 deletions

View File

@ -17,12 +17,11 @@ import * as echarts from 'echarts';
export default { export default {
name: 'LineChartInEquipmentProcessAmount', name: 'LineChartInEquipmentProcessAmount',
components: {}, components: {},
props: ['equipmentList', 'render'], props: ['equipmentList'],
data() { data() {
return { return {
chart: null, chart: null,
option: { option: {
color: ['#288AFF'],
grid: { grid: {
top: 64, top: 64,
left: 56, left: 56,
@ -90,19 +89,16 @@ export default {
}, },
}; };
}, },
watch: { mounted() {
render: { // console.log('this.eq list', this.equipmentList);
handler: function (newVal, oldVal) { if (!this.chart) this.chart = echarts.init(this.$refs.chart);
if (!this.chart) this.chart = echarts.init(this.$refs.chart);
this.$nextTick(() => { this.$nextTick(() => {
if (this.chart) this.chart.setOption(this.updateConfig(this.option)); this.chart.setOption(this.updateConfig(this.option));
}); });
},
deep: true,
},
}, },
beforeDestroy() { beforeDestroy() {
if (this.chart) this.chart.dispose(); this.chart.dispose();
}, },
methods: { methods: {
updateConfig(config) { updateConfig(config) {
@ -130,6 +126,5 @@ export default {
.chart { .chart {
height: 100%; height: 100%;
width: 100%; width: 100%;
// background: lightcoral;
} }
</style> </style>

View File

@ -89,12 +89,9 @@
<el-tab-pane :label="'\u3000柱状图\u3000'" name="graph"> <el-tab-pane :label="'\u3000柱状图\u3000'" name="graph">
<div class="graph" style="height: 56vh"> <div class="graph" style="height: 56vh">
<!-- graph --> <!-- graph -->
<Graph <Graph v-if="list.length" :equipment-list="list" />
v-if="list.length"
:equipment-list="list"
:render="renderKey" />
<div <div
v-if="list.length == 0" v-else
style=" style="
color: #c7c7c7; color: #c7c7c7;
text-align: center; text-align: center;
@ -123,7 +120,6 @@ export default {
props: {}, props: {},
data() { data() {
return { return {
renderKey: Math.random(),
factoryListOpen: false, factoryListOpen: false,
currentFactory: null, currentFactory: null,
factoryList: [ factoryList: [
@ -331,12 +327,13 @@ export default {
}, },
handleTabClick(tab, event) { handleTabClick(tab, event) {
if (tab.name == 'graph') this.renderKey = Math.random(); console.log('handle tab click: ', tab, event);
}, },
factoryChangeHandler(event) { factoryChangeHandler(event) {
this.factoryListOpen = false; this.factoryListOpen = false;
const fcId = event.target.dataset.value; const fcId = event.target.dataset.value;
console.log('fc id', fcId);
this.handleSidebarItemClick({ id: fcId, type: '工厂' }); this.handleSidebarItemClick({ id: fcId, type: '工厂' });
this.currentFactory = this.sidebarContent.find((item) => item.id == fcId); this.currentFactory = this.sidebarContent.find((item) => item.id == fcId);
}, },
@ -401,7 +398,7 @@ export default {
padding: 0; padding: 0;
color: #111; color: #111;
/* background: #f2f4f7; */ /* background: #f2f4f7; */
background: #e3efff !important; background: #E3EFFF !important;
} }
.vvv-enter, .vvv-enter,
@ -530,17 +527,14 @@ li {
padding: 8px 12px !important; padding: 8px 12px !important;
} }
.custom-tree-class >>> .el-tree-node__content:hover { .custom-tree-class >>> .el-tree-node__content:hover {
background: #e3efff; background: #E3EFFF;
} }
.custom-tree-class >>> .el-tree-node__children .el-tree-node__content { .custom-tree-class >>> .el-tree-node__children .el-tree-node__content {
padding: 8px 18px !important; padding: 8px 18px !important;
} }
.custom-tree-class .custom-tree-class >>> .el-tree-node__children .el-tree-node__children .el-tree-node__content {
>>> .el-tree-node__children
.el-tree-node__children
.el-tree-node__content {
padding: 8px 24px !important; padding: 8px 24px !important;
} }
</style> </style>

View File

@ -54,7 +54,6 @@
label="按钮盒识别码" label="按钮盒识别码"
prop="buttonId" prop="buttonId"
:rules="[ :rules="[
{ required: true, message: '不能为空', trigger: 'blur' },
{ {
type: 'number', type: 'number',
message: '请输入整数', message: '请输入整数',
@ -99,16 +98,12 @@
label="按钮值" label="按钮值"
prop="keyValue" prop="keyValue"
:rules="[ :rules="[
{ required: true, message: '不能为空', trigger: 'blur' },
{ {
type: 'number', type: 'number',
message: '请输入100以内的整数', message: '请输入100以内的整数',
trigger: 'blur', trigger: 'blur',
transform: (val) => transform: (val) =>
Number.isInteger(+val) && Number(val) <= 100 && Number.isInteger(+val) && Number(val),
Number(val) >= 0 &&
Number(val) <= 100 &&
Number(val),
}, },
]"> ]">
<el-input <el-input
@ -170,10 +165,10 @@ export default {
watch: { watch: {
'dataForm.productionId': { 'dataForm.productionId': {
handler(id) { handler(id) {
if (id != null) this.getWorksectionList(id); this.getWorksectionList(id);
}, },
immediate: true, immediate: true
}, }
}, },
methods: { methods: {
/** 模拟透传 ref */ /** 模拟透传 ref */

View File

@ -236,8 +236,7 @@ export default {
// width: 160, // width: 160,
prop: 'checkTime', prop: 'checkTime',
label: '检测时间', label: '检测时间',
filter: (val) => filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
val != null ? moment(val).format('yyyy-MM-DD HH:mm:ss') : '-',
}, },
{ {
width: 90, width: 90,

View File

@ -332,51 +332,33 @@ export default {
}, },
mounted() { mounted() {
if (this.$route.params.startTime && this.$route.params.endTime) { if (this.$route.params.startTime && this.$route.params.endTime) {
this.searchBarFormConfig[0].defaultSelect = [ this.searchBarFormConfig[0].defaultSelect = [this.$route.params.startTime, this.$route.params.endTime]
this.$route.params.startTime,
this.$route.params.endTime,
];
this.queryParams.param = {}; this.queryParams.param = {};
this.$set( this.$set(this.queryParams.param, 'startTime', this.$route.params.startTime);
this.queryParams.param,
'startTime',
this.$route.params.startTime
);
this.$set(this.queryParams.param, 'endTime', this.$route.params.endTime); this.$set(this.queryParams.param, 'endTime', this.$route.params.endTime);
} else { } else {
this.searchBarFormConfig[0].defaultSelect = []; this.searchBarFormConfig[0].defaultSelect = []
} }
this.getList(); this.getList();
}, },
watch: { watch: {
$route: 'initData', $route: 'initData'
}, },
methods: { methods: {
initData(to) { initData(to) {
// console.log(to) // console.log(to)
if (to.name === 'QualityStatistics') { if (to.name === 'QualityStatistics') {
if (this.$route.params.startTime && this.$route.params.endTime) { if (this.$route.params.startTime && this.$route.params.endTime) {
this.searchBarFormConfig[0].defaultSelect = [ this.searchBarFormConfig[0].defaultSelect = [this.$route.params.startTime, this.$route.params.endTime]
this.$route.params.startTime,
this.$route.params.endTime,
];
this.queryParams.param = {}; this.queryParams.param = {};
this.$set( this.$set(this.queryParams.param, 'startTime', this.$route.params.startTime);
this.queryParams.param, this.$set(this.queryParams.param, 'endTime', this.$route.params.endTime);
'startTime',
this.$route.params.startTime
);
this.$set(
this.queryParams.param,
'endTime',
this.$route.params.endTime
);
} else { } else {
this.searchBarFormConfig[0].defaultSelect = []; this.searchBarFormConfig[0].defaultSelect = []
} }
this.getList(); this.getList();
} }
}, },
getList() { getList() {
this.getSummaryList(); this.getSummaryList();
this.getDetailedList(); this.getDetailedList();
@ -385,17 +367,20 @@ export default {
async getSummaryList() { async getSummaryList() {
const response = await this.$axios({ const response = await this.$axios({
url: '/monitoring/statistical-data/getUpPart', url: '/monitoring/statistical-data/getUpPart',
method: 'post', method: 'get',
data: this.queryParams.param params: this.queryParams.param
? { ? {
// startTime: new Date(2022, 6, 1, 0, 0, 0).getTime(), // '2023-07-01 00:00:00', param: {
// endTime: new Date(2023, 7, 10, 0, 0, 0).getTime(), // '2023-08-10 00:00:00', // startTime: new Date(2022, 6, 1, 0, 0, 0).getTime(), // '2023-07-01 00:00:00',
startTime: this.queryParams.param.startTime, // endTime: new Date(2023, 7, 10, 0, 0, 0).getTime(), // '2023-08-10 00:00:00',
endTime: this.queryParams.param.endTime, startTime: this.queryParams.param.startTime,
endTime: this.queryParams.param.endTime,
},
} }
: {}, : null,
}); });
this.summaryList = response.data; this.summaryList = response.data;
console.log('summaryList', this.summaryList);
}, },
/** 获取 检测内容和产线关联 列表 */ /** 获取 检测内容和产线关联 列表 */
async getDetailedList() { async getDetailedList() {
@ -403,21 +388,22 @@ export default {
data: { data, otherList, otherMap, nameData }, data: { data, otherList, otherMap, nameData },
} = await this.$axios({ } = await this.$axios({
url: '/monitoring/statistical-data/getDownPart', url: '/monitoring/statistical-data/getDownPart',
method: 'post', params: this.queryParams.param
data: this.queryParams.param
? { ? {
// startTime: new Date(2023, 6, 1).getTime(), // '2023-07-01 00:00:00', param: {
// endTime: new Date(2023, 7, 22).getTime(), // '2023-08-10 00:00:00', // startTime: new Date(2023, 6, 1).getTime(), // '2023-07-01 00:00:00',
startTime: this.queryParams.param.startTime, // endTime: new Date(2023, 7, 22).getTime(), // '2023-08-10 00:00:00',
endTime: this.queryParams.param.endTime, startTime: this.queryParams.param.startTime,
endTime: this.queryParams.param.endTime,
},
} }
: {}, : null,
}); });
// this.list = response.data; // this.list = response.data;
// console.log('data', data); console.log('data', data);
// console.log('otherList', otherList); console.log('otherList', otherList);
// console.log('otherMap', otherMap); console.log('otherMap', otherMap);
// console.log('nameData', nameData); console.log('nameData', nameData);
this.dynamicProps = this.filterNameData(nameData); this.dynamicProps = this.filterNameData(nameData);
this.list = this.filterData(data); this.list = this.filterData(data);