bug 2
This commit is contained in:
@@ -35,20 +35,20 @@ import {
|
||||
} from '@/api/equipment/analysis/statistics';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'recordTime',
|
||||
label: '时间段',
|
||||
filter: (val) => {
|
||||
if (val && val.length > 0) {
|
||||
return (
|
||||
moment(val[0]).format('YYYY-MM-DD HH:mm:ss') +
|
||||
' ~ ' +
|
||||
moment(val[1]).format('YYYY-MM-DD HH:mm:ss')
|
||||
);
|
||||
}
|
||||
return '-';
|
||||
},
|
||||
},
|
||||
// {
|
||||
// prop: 'recordTime',
|
||||
// label: '时间段',
|
||||
// filter: (val) => {
|
||||
// if (val && val.length > 0) {
|
||||
// return (
|
||||
// moment(val[0]).format('YYYY-MM-DD HH:mm:ss') +
|
||||
// ' ~ ' +
|
||||
// moment(val[1]).format('YYYY-MM-DD HH:mm:ss')
|
||||
// );
|
||||
// }
|
||||
// return '-';
|
||||
// },
|
||||
// },
|
||||
{
|
||||
prop: 'lineName',
|
||||
label: '产线',
|
||||
@@ -158,7 +158,7 @@ export default {
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'warning',
|
||||
color: 'primary',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
max-height="600"
|
||||
@emitFun="handleEmitFun">
|
||||
<!-- <method-btn
|
||||
v-if="tableBtn.length"
|
||||
@@ -93,17 +94,29 @@ export default {
|
||||
{ prop: 'downCount', label: '故障次数' },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
// {
|
||||
// type: 'select',
|
||||
// label: '请选择月份',
|
||||
// placeholder: '请选择月份',
|
||||
// param: 'month',
|
||||
// selectOptions: Array(12)
|
||||
// .fill(0)
|
||||
// .map((v, i) => ({
|
||||
// id: i + 1,
|
||||
// name: `${i + 1}月`,
|
||||
// })),
|
||||
// },
|
||||
{
|
||||
type: 'select',
|
||||
label: '请选择月份',
|
||||
placeholder: '请选择月份',
|
||||
type: 'datePicker',
|
||||
label: '时间',
|
||||
dateType: 'month',
|
||||
format: 'yyyy-MM',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
width: 240,
|
||||
param: 'month',
|
||||
selectOptions: Array(12)
|
||||
.fill(0)
|
||||
.map((v, i) => ({
|
||||
id: i + 1,
|
||||
name: `${i + 1}月`,
|
||||
})),
|
||||
},
|
||||
{
|
||||
__index: 'line',
|
||||
@@ -111,6 +124,7 @@ export default {
|
||||
label: '产线',
|
||||
placeholder: '请选择产线',
|
||||
param: 'lineId',
|
||||
filterable: true
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -164,7 +178,13 @@ export default {
|
||||
},
|
||||
});
|
||||
if (code === 0) {
|
||||
this.list = data;
|
||||
this.list = data.map(item => {
|
||||
item.mtbf = item.mtbf?.toFixed(2)
|
||||
item.mttr = item.mttr?.toFixed(2)
|
||||
item.workTime = item.workTime?.toFixed(2)
|
||||
item.downTime = item.downTime?.toFixed(2)
|
||||
return item
|
||||
});
|
||||
} else {
|
||||
this.list.splice(0);
|
||||
}
|
||||
@@ -174,12 +194,14 @@ export default {
|
||||
switch (btn.btnName) {
|
||||
case 'search':
|
||||
if (btn.month) {
|
||||
this.queryParams.recordTime = [
|
||||
moment()
|
||||
.month(btn.month - 1)
|
||||
.format('YYYY-MM') + '-01 00:00:00',
|
||||
moment().month(btn.month).format('YYYY-MM') + '-01 00:00:00',
|
||||
];
|
||||
// this.queryParams.recordTime = [
|
||||
// moment()
|
||||
// .month(btn.month - 1)
|
||||
// .format('YYYY-MM') + '-01 00:00:00',
|
||||
// moment().month(btn.month).format('YYYY-MM') + '-01 00:00:00',
|
||||
// ];
|
||||
this.queryParams.recordTime = [btn.month, moment().month(new Date(btn.month).getMonth() + 1).format('YYYY-MM') + '-01 00:00:00']
|
||||
console.log(btn.month, moment().month(new Date(btn.month).getMonth() + 1).format('YYYY-MM') + '-01 00:00:00')
|
||||
} else {
|
||||
this.queryParams.recordTime = null;
|
||||
}
|
||||
|
||||
@@ -464,7 +464,9 @@ export default {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = '添加设备采集配置';
|
||||
this.$refs.addOrUpdate.init()
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init()
|
||||
})
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-03-13 16:47:02
|
||||
* @LastEditTime: 2024-03-15 18:54:23
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
<el-option
|
||||
v-for="plc in plcList"
|
||||
:key="plc.id"
|
||||
:label="plc.name"
|
||||
:label="plc.plcTableName"
|
||||
:value="plc.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -404,9 +404,9 @@ export default {
|
||||
this.eqList = data;
|
||||
});
|
||||
this.$axios({
|
||||
url: '/base/equipment-plc/page',
|
||||
url: '/base/equipment-plc/listAll',
|
||||
}).then(({ code, data }) => {
|
||||
this.plcList = data.list;
|
||||
this.plcList = data;
|
||||
});
|
||||
}
|
||||
for (const section of this.sections) {
|
||||
|
||||
@@ -2,14 +2,15 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-03-04 11:14:28
|
||||
* @LastEditTime: 2024-03-18 15:47:20
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="isdetail"
|
||||
:wrapper-closable="true"
|
||||
:before-close="beforeClose"
|
||||
class="drawer"
|
||||
size="60%">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
@@ -269,6 +270,17 @@ export default {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
beforeClose(done) {
|
||||
if (!this.isdetail) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done();
|
||||
})
|
||||
.catch(_ => {});
|
||||
} else {
|
||||
done()
|
||||
}
|
||||
},
|
||||
async getDict() {
|
||||
// 班次列表
|
||||
const res = await groupClassesListAll();
|
||||
@@ -372,6 +384,7 @@ export default {
|
||||
if (id) {
|
||||
this.idAttrShow = true
|
||||
} else {
|
||||
this.dataForm.checkPerson = [this.$store.getters.nickname]
|
||||
this.idAttrShow = false
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-03-01 19:44:59
|
||||
* @LastEditTime: 2024-03-15 18:38:52
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -27,7 +27,7 @@
|
||||
<el-form-item
|
||||
label="部门"
|
||||
prop="departmentId"
|
||||
:rules="[{ required: true, message: '请选择部门', trigger: 'blur' }]">
|
||||
:rules="[{ required: false, message: '请选择部门', trigger: 'blur' }]">
|
||||
<el-select
|
||||
v-model="dataForm.departmentId"
|
||||
:placeholder="`请选择部门`"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:width="180"
|
||||
:width="120"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
@@ -52,6 +52,7 @@ import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import addOrUpdata from './add-or-updata.vue';
|
||||
import add from './add.vue';
|
||||
import { parseTime } from '../../../../core/mixins/code-filter';
|
||||
import { groupClassesListAll } from '@/api/monitoring/teamProduction';
|
||||
// import { publicFormatter } from '@/utils/dict';
|
||||
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
@@ -111,6 +112,12 @@ export default {
|
||||
width: 150,
|
||||
filter: parseTime,
|
||||
},
|
||||
{
|
||||
prop: 'checkPeriod',
|
||||
label: '巡检频率(天/次)',
|
||||
width: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'confirmTimeLimit',
|
||||
label: '确认时限',
|
||||
|
||||
@@ -220,7 +220,7 @@
|
||||
label="维修工"
|
||||
prop="repairman"
|
||||
:rules="[
|
||||
{ required: true, message: '维修工不能为空', trigger: 'blur' },
|
||||
{ required: false, message: '维修工不能为空', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.repairman"
|
||||
@@ -262,7 +262,7 @@
|
||||
prop="repairMode"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
required: false,
|
||||
message: '维修方式不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
|
||||
@@ -83,33 +83,41 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
tableProps: [
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{ prop: 'equipmentCode', label: '设备编码' },
|
||||
{ prop: 'inQuantity', label: '投入数' },
|
||||
{ prop: 'outQuantity', label: '产出数' },
|
||||
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'equipmentCode', label: '设备编码', minWidth: 150, showOverflowtooltip: true },
|
||||
{ prop: 'inQuantity', label: '投入数', minWidth: 80, showOverflowtooltip: true },
|
||||
{ prop: 'outQuantity', label: '产出数', minWidth: 80, showOverflowtooltip: true },
|
||||
{
|
||||
prop: 'run',
|
||||
label: '是否运行',
|
||||
filter: (val) => (val != null ? (val ? '是' : '否') : ''),
|
||||
minWidth: 100,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '状态',
|
||||
filter: (val) =>
|
||||
val != null ? ['正常', '计划停机', '故障'][val] : '',
|
||||
minWidth: 90,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'error',
|
||||
label: '是否故障',
|
||||
filter: (val) => (val != null ? (val ? '是' : '否') : ''),
|
||||
minWidth: 100,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'quantityRecordTime',
|
||||
label: '生产量记录时间',
|
||||
filter: parseTime,
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{ prop: 'statusRecordTime', label: '状态记录时间', filter: parseTime },
|
||||
{ prop: 'opt1', label: '状态可视化', name: '查看', subcomponent: btn },
|
||||
{ prop: 'statusRecordTime', label: '状态记录时间', filter: parseTime, minWidth: 150, showOverflowtooltip: true },
|
||||
// { prop: 'opt1', label: '状态可视化', name: '查看', subcomponent: btn },
|
||||
{ prop: 'opt2', label: '参数监控', name: '查看', subcomponent: btn },
|
||||
],
|
||||
searchBarForm: {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
padding: 16px 16px 0;
|
||||
border-radius: 8px;
|
||||
">
|
||||
<div class="blue-title">生产节拍时序图</div>
|
||||
<!-- <div class="blue-title">生产节拍时序图</div> -->
|
||||
<!-- <h1>设备状态时序图</h1> -->
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
@@ -76,6 +76,7 @@
|
||||
|
||||
<script>
|
||||
import LineChart from './components/lineChart.vue';
|
||||
import moment from 'moment';
|
||||
// import response from './response.json';
|
||||
|
||||
export default {
|
||||
@@ -84,6 +85,7 @@ export default {
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
moment,
|
||||
startTime: null, // new Date(2023, 8, 26, 0, 0, 0, 0).getTime(),
|
||||
accumulators: new Map(),
|
||||
searchBarFormConfig: [
|
||||
@@ -94,6 +96,7 @@ export default {
|
||||
selectOptions: [],
|
||||
param: 'lineId',
|
||||
onchange: true,
|
||||
filterable: true
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
@@ -101,11 +104,12 @@ export default {
|
||||
placeholder: '请选择工段',
|
||||
selectOptions: [],
|
||||
param: 'sectionId',
|
||||
filterable: true
|
||||
},
|
||||
// 时间段
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
label: '日期',
|
||||
dateType: 'date', // datetimerange
|
||||
// format: 'yyyy-MM-dd HH:mm:ss',
|
||||
format: 'yyyy-MM-dd',
|
||||
@@ -263,7 +267,11 @@ export default {
|
||||
this.initProductline();
|
||||
this.initWorksection();
|
||||
this.initEquipment();
|
||||
// this.getList();
|
||||
let end = moment().format('YYYY-MM-DD 23:59:59')
|
||||
let start = moment().format('YYYY-MM-DD 00:00:00')
|
||||
this.searchBarFormConfig[2].defaultSelect = start
|
||||
this.queryParams.recordTime = [start, end]
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
handleSearchBarBtnClick({ btnName, ...payload }) {
|
||||
@@ -293,8 +301,10 @@ export default {
|
||||
},
|
||||
|
||||
handleSearchBarChanged({ param, value }) {
|
||||
this.searchBarFormConfig[1].defaultSelect = null
|
||||
if (!value) {
|
||||
this.searchBarFormConfig[1].selectOptions = [];
|
||||
// this.searchBarFormConfig[1].defaultSelect = null
|
||||
return;
|
||||
}
|
||||
switch (param) {
|
||||
@@ -486,7 +496,10 @@ export default {
|
||||
const { code, data } = await this.$axios({
|
||||
url: '/monitoring/equipment-monitor/quantity-series',
|
||||
method: 'get',
|
||||
params: this.queryParams,
|
||||
params: {
|
||||
equipmentId: this.queryParams.equipmentId,
|
||||
recordTime: this.queryParams.recordTime
|
||||
}
|
||||
});
|
||||
|
||||
this.queryParams.equipmentId = null; // 清空一下
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
padding: 16px 16px 0;
|
||||
border-radius: 8px;
|
||||
">
|
||||
<div class="blue-title">生产节拍时序图</div>
|
||||
<!-- <div class="blue-title">生产节拍时序图</div> -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@@ -119,6 +119,7 @@ export default {
|
||||
selectOptions: [],
|
||||
param: 'lineId',
|
||||
onchange: true,
|
||||
filterable: true
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
@@ -126,6 +127,7 @@ export default {
|
||||
placeholder: '请选择工段',
|
||||
selectOptions: [],
|
||||
param: 'sectionId',
|
||||
filterable: true
|
||||
},
|
||||
// 时间段
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user