|
|
|
@ -2,10 +2,14 @@
|
|
|
|
|
<div class="mod-config">
|
|
|
|
|
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-input v-model="dataForm.lineId" :placeholder="'产线'" clearable></el-input>
|
|
|
|
|
<el-select v-model="dataForm.lineId" :placeholder="'产线'" clearable>
|
|
|
|
|
<el-option v-for="line in lineList" :key="line.code" :value="line.id" :label="line.name" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-input v-model="dataForm.equipmentId" :placeholder="'设备名称'" clearable></el-input>
|
|
|
|
|
<el-select v-model="dataForm.equipmentId" :placeholder="'设备名称'" clearable>
|
|
|
|
|
<el-option v-for="eq in eqList" :key="eq.code" :value="eq.id" :label="eq.name" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
|
|
|
|
@ -48,12 +52,30 @@ const tableConfigs = [
|
|
|
|
|
{ prop: 'equipmentCode', name: i18n.t('realtime.eqCode') },
|
|
|
|
|
{ prop: 'inputNum', name: i18n.t('realtime.input') },
|
|
|
|
|
{ prop: 'outputNum', name: i18n.t('realtime.output') },
|
|
|
|
|
{ prop: 'run', name: i18n.t('realtime.runState') },
|
|
|
|
|
{ prop: 'status', name: i18n.t('realtime.state') },
|
|
|
|
|
{ prop: 'error', name: i18n.t('realtime.hasFault') },
|
|
|
|
|
{
|
|
|
|
|
prop: 'run',
|
|
|
|
|
name: i18n.t('realtime.runState'),
|
|
|
|
|
filter: val => {
|
|
|
|
|
if (val !== null && val !== undefined) return val ? '是' : '否'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: 'status',
|
|
|
|
|
name: i18n.t('realtime.state'),
|
|
|
|
|
filter: val => {
|
|
|
|
|
if (val !== null && val !== undefined) return ['正常', '计划停机', '故障'][+val]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: 'error',
|
|
|
|
|
name: i18n.t('realtime.hasFault'),
|
|
|
|
|
filter: val => {
|
|
|
|
|
if (val !== null && val !== undefined) return val ? '是' : '否'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{ prop: 'quantityTime', name: i18n.t('realtime.productionSnapshotTime'), filter: timeFilter },
|
|
|
|
|
{ prop: 'statusTime', name: i18n.t('realtime.statusSnapshotTime'), filter: timeFilter },
|
|
|
|
|
{ prop: 'alarm', name: i18n.t('realtime.alarmRecords'), buttonContent: i18n.t('realtime.viewAlarmRecords'), subcomponent: TableTextComponent, actionName: 'view-alarm' }
|
|
|
|
|
{ prop: 'alarm', name: i18n.t('realtime.recentParamValue'), buttonContent: i18n.t('realtime.view'), subcomponent: TableTextComponent, actionName: 'view-alarm' }
|
|
|
|
|
// { prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
@ -95,6 +117,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
activated() {
|
|
|
|
|
this.getEqList()
|
|
|
|
|
this.getLineList()
|
|
|
|
|
this.getDataList()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
@ -112,7 +135,18 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 产线
|
|
|
|
|
getLineList() {},
|
|
|
|
|
getLineList() {
|
|
|
|
|
this.$http({
|
|
|
|
|
url: this.$http.adornUrl('/monitoring/productionLine/list'),
|
|
|
|
|
method: 'get'
|
|
|
|
|
}).then(({ data }) => {
|
|
|
|
|
if (data && data.code === 0) {
|
|
|
|
|
this.lineList = data.data
|
|
|
|
|
} else {
|
|
|
|
|
this.lineList = []
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 获取数据列表
|
|
|
|
|
getDataList() {
|
|
|
|
|
this.addOrUpdateVisible = false
|
|
|
|
@ -123,8 +157,8 @@ export default {
|
|
|
|
|
params: this.$http.adornParams({
|
|
|
|
|
page: this.pageIndex,
|
|
|
|
|
limit: this.pageSize,
|
|
|
|
|
equipmentId: this.dataForm.key,
|
|
|
|
|
lineId: this.dataForm.key
|
|
|
|
|
equipmentId: this.dataForm.equipmentId,
|
|
|
|
|
lineId: this.dataForm.lineId
|
|
|
|
|
})
|
|
|
|
|
}).then(({ data }) => {
|
|
|
|
|
if (data && data.code === 0) {
|
|
|
|
|