更新
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<!--
|
||||
<!--
|
||||
filename: pieChart.vue
|
||||
author: liubin
|
||||
date: 2023-09-06 15:02:49
|
||||
@@ -10,7 +10,7 @@
|
||||
<div
|
||||
class="pie-chart"
|
||||
ref="pieChart"
|
||||
style="overflow: inherit;"
|
||||
style="overflow: inherit"
|
||||
:data-eqname="value.equipmentName || 'Default'"></div>
|
||||
<div class="data-view">
|
||||
<div class="data-view__item">
|
||||
@@ -64,7 +64,7 @@ export default {
|
||||
},
|
||||
subtext: '设备', //<=========
|
||||
subtextStyle: {
|
||||
fontSize: 14,
|
||||
fontSize: 13,
|
||||
},
|
||||
},
|
||||
color: ['#3da8fd', '#8ef0ab', '#6b5cfd', '#FFC72A', 'transparent'],
|
||||
@@ -194,22 +194,31 @@ export default {
|
||||
mttr,
|
||||
} = item;
|
||||
this.config.title.text = lineName;
|
||||
this.config.title.subtext = equipmentName;
|
||||
// 找到第一个 '-' 的位置
|
||||
let firstDashIndex = equipmentName.indexOf('-');
|
||||
// 找到第二个 '-' 的位置
|
||||
let secondDashIndex = equipmentName.indexOf('-', firstDashIndex + 1);
|
||||
// 截取第二个 '-' 后面的字符串
|
||||
let result = equipmentName.substring(secondDashIndex + 1);
|
||||
this.config.title.subtext = result ? result : '-';
|
||||
|
||||
this.config.series[0].data = [
|
||||
{ name: '工作时长', value: workTime },
|
||||
{ name: '停机时长', value: stopTime },
|
||||
{ name: '故障时长', value: downTime },
|
||||
{ name: '工作时长', value: workTime ? workTime.toFixed(2) : '0.00' },
|
||||
{ name: '停机时长', value: stopTime ? stopTime.toFixed(2) : '0.00' },
|
||||
{ name: '故障时长', value: downTime ? downTime.toFixed(2) : '0.00' },
|
||||
];
|
||||
this.config.series[1].data = [
|
||||
{ name: '速度开动率', value: peEfficiency },
|
||||
{
|
||||
name: '速度开动率',
|
||||
value: peEfficiency ? peEfficiency.toFixed(2) : '0.00',
|
||||
},
|
||||
{ name: '', value: Math.ceil(peEfficiency) - peEfficiency },
|
||||
];
|
||||
//
|
||||
this.textData = {
|
||||
workTime: +workTime.toFixed(2),
|
||||
stopTime: +stopTime.toFixed(2),
|
||||
downTime: +downTime.toFixed(2),
|
||||
peEfficiency: +peEfficiency.toFixed(2),
|
||||
workTime: workTime ? workTime.toFixed(2) : '0.00',
|
||||
stopTime: stopTime ? stopTime.toFixed(2) : '0.00',
|
||||
downTime: downTime ? downTime.toFixed(2) : '0.00',
|
||||
peEfficiency: peEfficiency ? peEfficiency.toFixed(2) : '0.00',
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
@@ -91,10 +91,11 @@
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
import PieChart from './components/pieChart.vue';
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
|
||||
export default {
|
||||
name: 'EfficiencyAnalysis',
|
||||
mixins: [basicPageMixin,tableHeightMixin],
|
||||
mixins: [basicPageMixin, tableHeightMixin],
|
||||
components: { PieChart },
|
||||
props: {},
|
||||
data() {
|
||||
@@ -120,8 +121,18 @@ export default {
|
||||
tableProps: [
|
||||
{ prop: 'factoryName', label: '工厂' },
|
||||
{ prop: 'lineName', label: '产线' },
|
||||
{ prop: 'sectionName', width:120,showOverflowtooltip :true,label: '工段' },
|
||||
{ prop: 'equipmentName',width:150,showOverflowtooltip :true, label: '设备' },
|
||||
{
|
||||
prop: 'sectionName',
|
||||
width: 120,
|
||||
showOverflowtooltip: true,
|
||||
label: '工段',
|
||||
},
|
||||
{
|
||||
prop: 'equipmentName',
|
||||
width: 150,
|
||||
showOverflowtooltip: true,
|
||||
label: '设备',
|
||||
},
|
||||
{
|
||||
label: '有效时间',
|
||||
children: [
|
||||
@@ -148,9 +159,12 @@ export default {
|
||||
label: '停机时长[h]',
|
||||
filter: (val) => (val != null ? val.toFixed(2) : '-'),
|
||||
},
|
||||
{ width: 128, prop: 'stopRate', label: '百分比[%]',
|
||||
filter: (val) => (val != null ? val.toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
width: 128,
|
||||
prop: 'stopRate',
|
||||
label: '百分比[%]',
|
||||
filter: (val) => (val != null ? val.toFixed(2) : '-'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -162,9 +176,12 @@ export default {
|
||||
label: '故障时长[h]',
|
||||
filter: (val) => (val != null ? val.toFixed(2) : '-'),
|
||||
},
|
||||
{ width: 128, prop: 'downRate', label: '百分比[%]' ,
|
||||
filter: (val) => (val != null ? val.toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
width: 128,
|
||||
prop: 'downRate',
|
||||
label: '百分比[%]',
|
||||
filter: (val) => (val != null ? val.toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
width: 128,
|
||||
prop: 'timeEfficiency',
|
||||
@@ -180,13 +197,13 @@ export default {
|
||||
width: 128,
|
||||
prop: 'realProcSpeed',
|
||||
label: '实际加工速度',
|
||||
filter: (val) => (val != null ? val.toFixed(2) : '-'),
|
||||
filter: (val) => (val != null ? val.toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
width: 128,
|
||||
prop: 'designProcSpeed',
|
||||
label: '理论加工速度',
|
||||
filter: (val) => (val != null ? val.toFixed(2) : '-'),
|
||||
filter: (val) => (val != null ? val.toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
width: 128,
|
||||
@@ -334,6 +351,20 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
|
||||
this.queryParams.recordTime[0] =
|
||||
parseTime(start).substr(0, 10) + ' 00:00:00';
|
||||
this.queryParams.recordTime[1] = parseTime(end).substr(0, 10) + ' 00:00:00';
|
||||
this.$nextTick(() => {
|
||||
this.searchBarFormConfig[2].extraOptions[0].startPlaceholder = parseTime(
|
||||
start
|
||||
).substr(0, 10);
|
||||
this.searchBarFormConfig[2].extraOptions[0].endPlaceholder = parseTime(
|
||||
end
|
||||
).substr(0, 10);
|
||||
});
|
||||
this.getFactory();
|
||||
this.getLine();
|
||||
this.getList();
|
||||
@@ -384,6 +415,7 @@ export default {
|
||||
/** 查询列表 */
|
||||
async getList() {
|
||||
this.loading = true;
|
||||
this.list = [];
|
||||
const { code, data } = await this.$axios({
|
||||
url: '/analysis/equipment-analysis/efficiency',
|
||||
method: 'get',
|
||||
@@ -395,7 +427,6 @@ export default {
|
||||
},
|
||||
|
||||
handleSearchBarBtnClick({ btnName, ...payload }) {
|
||||
console.log('handleSearchBarBtnClick', btnName, payload);
|
||||
if (btnName == 'visualization') {
|
||||
// 可视化
|
||||
this.visualizationOpen = true;
|
||||
@@ -405,12 +436,26 @@ export default {
|
||||
this.queryParams.factoryId = payload.factoryId || null;
|
||||
this.queryParams.lineId = payload.lineId || null;
|
||||
if (0 == payload.dateFilterType) {
|
||||
this.queryParams.recordTime = payload.timerange;
|
||||
if (payload.timerange) {
|
||||
this.searchBarFormConfig[2].extraOptions[0].startPlaceholder =
|
||||
'开始时间';
|
||||
this.searchBarFormConfig[2].extraOptions[0].endPlaceholder =
|
||||
'结束时间';
|
||||
this.queryParams.recordTime = payload.timerange;
|
||||
}
|
||||
} else if (1 == payload.dateFilterType) {
|
||||
this.queryParams.recordTime = [
|
||||
`${payload.timeday} 00:00:00`,
|
||||
`${payload.timeday} 23:59:59`,
|
||||
];
|
||||
this.searchBarFormConfig[2].extraOptions[0].startPlaceholder =
|
||||
'开始时间';
|
||||
this.searchBarFormConfig[2].extraOptions[0].endPlaceholder =
|
||||
'结束时间';
|
||||
if (payload.timeday) {
|
||||
this.queryParams.recordTime = [
|
||||
`${payload.timeday} 00:00:00`,
|
||||
`${payload.timeday} 23:59:59`,
|
||||
];
|
||||
} else {
|
||||
this.queryParams.recordTime = null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.queryParams.recordTime = null;
|
||||
|
||||
Reference in New Issue
Block a user