fzq #31

Closed
fanzhiqin wants to merge 215 commits from fzq into test
4 changed files with 49 additions and 15 deletions
Showing only changes of commit 10e454eb2a - Show all commits

View File

@ -24,7 +24,7 @@ export default {
} }
}, },
render: function (h) { render: function (h) {
// console.log(this) // console.log('button content:', this.injectData)
return h('span', null, [h('el-button', { props: { type: 'text' }, style: { paddingLeft: 0 }, on: { click: this.emitClick } }, this.injectData.buttonContent || this.defaultText)]) return h('span', null, [h('el-button', { props: { type: 'text' }, style: { paddingLeft: 0 }, on: { click: this.emitClick } }, this.injectData.head?.buttonContent || this.defaultText)])
} }
} }

View File

@ -241,8 +241,8 @@ t.realtime.goodrate = 'Passed Rate'
t.realtime.runState = '是否运行' t.realtime.runState = '是否运行'
t.realtime.state = '状态' t.realtime.state = '状态'
t.realtime.hasFault = '是否故障' t.realtime.hasFault = '是否故障'
t.realtime.alarmRecords = '报警记录' t.realtime.recentParamValue = '参数近期值'
t.realtime.viewAlarmRecords = '查看报警记录' t.realtime.view = '查看'
t.realtime.input = '投入数' t.realtime.input = '投入数'
t.realtime.output = '产出数' t.realtime.output = '产出数'
t.realtime.eqName = '设备名称' t.realtime.eqName = '设备名称'

View File

@ -246,8 +246,8 @@ t.realtime.goodrate = '良品率'
t.realtime.runState = '是否运行' t.realtime.runState = '是否运行'
t.realtime.state = '状态' t.realtime.state = '状态'
t.realtime.hasFault = '是否故障' t.realtime.hasFault = '是否故障'
t.realtime.alarmRecords = '报警记录' t.realtime.recentParamValue = '参数近期值'
t.realtime.viewAlarmRecords = '查看报警记录' t.realtime.view = '查看'
t.realtime.input = '投入数' t.realtime.input = '投入数'
t.realtime.output = '产出数' t.realtime.output = '产出数'
t.realtime.eqName = '设备名称' t.realtime.eqName = '设备名称'

View File

@ -2,10 +2,14 @@
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <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-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-form-item> <el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button> <el-button @click="getDataList()">{{ $t('query') }}</el-button>
@ -48,12 +52,30 @@ const tableConfigs = [
{ prop: 'equipmentCode', name: i18n.t('realtime.eqCode') }, { prop: 'equipmentCode', name: i18n.t('realtime.eqCode') },
{ prop: 'inputNum', name: i18n.t('realtime.input') }, { prop: 'inputNum', name: i18n.t('realtime.input') },
{ prop: 'outputNum', name: i18n.t('realtime.output') }, { prop: 'outputNum', name: i18n.t('realtime.output') },
{ prop: 'run', name: i18n.t('realtime.runState') }, {
{ prop: 'status', name: i18n.t('realtime.state') }, prop: 'run',
{ prop: 'error', name: i18n.t('realtime.hasFault') }, 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: 'quantityTime', name: i18n.t('realtime.productionSnapshotTime'), filter: timeFilter },
{ prop: 'statusTime', name: i18n.t('realtime.statusSnapshotTime'), 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'] } // { prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
] ]
@ -95,6 +117,7 @@ export default {
}, },
activated() { activated() {
this.getEqList() this.getEqList()
this.getLineList()
this.getDataList() this.getDataList()
}, },
methods: { 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() { getDataList() {
this.addOrUpdateVisible = false this.addOrUpdateVisible = false
@ -123,8 +157,8 @@ export default {
params: this.$http.adornParams({ params: this.$http.adornParams({
page: this.pageIndex, page: this.pageIndex,
limit: this.pageSize, limit: this.pageSize,
equipmentId: this.dataForm.key, equipmentId: this.dataForm.equipmentId,
lineId: this.dataForm.key lineId: this.dataForm.lineId
}) })
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {