Compare commits

..

No commits in common. "747247aed6297f969759ab21527ea65301c14781" and "155456293343b4618eba21f3428bd08021945090" have entirely different histories.

15 changed files with 42 additions and 186 deletions

View File

@ -1,12 +1,5 @@
<template>
<el-dialog
class="super-flexible-dialog"
:title="isDetail ? title.detail : !dataForm.id ? title.add : title.edit"
:visible.sync="visible"
@close="handleClose"
:distory-on-close="true"
:close-on-click-modal="false"
>
<el-dialog class="super-flexible-dialog" :title="isDetail ? title.detail : !dataForm.id ? title.add : title.edit" :visible.sync="visible" @close="handleClose">
<div style="max-height: 60vh; overflow-y: scroll; overflow-x: hidden;">
<el-form ref="dataForm" :model="dataForm" :rules="dataFormRules">
<!-- 如果需要更精细一点的布局可以根据配置项实现地再复杂一点但此处暂时全部采用一行两列布局 -->
@ -38,7 +31,7 @@
:disabled="isDetail"
@change="emitSelectChange(configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name, $event)"
>
<el-option v-for="opt in configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].options" :key="opt.label+Math.random()" :label="opt.label" :value="opt.value" />
<el-option v-for="opt in configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].options" :key="opt.label" :label="opt.label" :value="opt.value" />
</el-select>
<el-switch v-if="getType(n, c) === 'switch'" v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]" :disabled="isDetail" />
<el-cascader

View File

@ -58,7 +58,6 @@ t.routes['设备分组'] = 'Equipment Groups'
t.routes['设备信息'] = 'Equipment Details'
t.routes['设备参数状态监控'] = 'Current Equipment State'
t.routes['设备分组报警信息'] = 'Equipment Group Alarm'
t.routes['设备历史参数'] = 'Equipment Historical Parameters'
t.routes['质量检测类型'] = 'Quality Inpection Types'
t.routes['质量检测信息'] = 'Quality Inpection Details'
@ -185,15 +184,14 @@ t.prod.code = 'Product Code'
t.prod.type = 'Product Type'
t.prod.area = 'Area'
t.prod.spec = 'Product Specification'
t.prod.attr = 'Attributes'
t.prod.attr = 'Dynamic Attributes'
t.prod.attrcode = 'Attribute Code'
t.prod.attrcodeHints = 'Please input attribute code'
t.prod.attrname = 'Attribute Node'
t.prod.attrnameHints = 'Please input attribute name'
t.prod.attrvalueHints = 'Please input attribute value'
t.prod.descHints = 'Please input description'
// t.prod.processTime = 'Processing Time (Hours)'
t.prod.processTime = 'Processing Time (s)'
t.prod.processTime = 'Processing Time (Hours)'
t.prod.processTimeHints = 'Please input processing time'
t.prod.relatedPid = 'Related Product'
@ -257,7 +255,6 @@ t.realtime.eqName = '设备名称'
t.realtime.eqCode = '设备编码'
t.realtime.productionSnapshotTime = '生产量记录时间'
t.realtime.statusSnapshotTime = '状态记录时间'
t.realtime.refresh = 'Refresh data...'
t.ws = {}
@ -266,8 +263,7 @@ t.ws.id = 'Work Section ID'
t.ws.name = 'Work Section Name'
t.ws.code = 'Work Section Code'
t.ws.binded = 'Binded Equipments'
t.ws.unbind = 'Equipment Name'
t.ws.eqbindplaceholder = 'Select an equipment'
t.ws.unbind = 'Please select an equipment to bind.'
t.ws.sort = 'sort'
t.ws.setorder = 'Please input order of equipments in the work section.'
t.ws.bind = 'bind'

View File

@ -59,7 +59,6 @@ t.routes['设备分组'] = '设备分组'
t.routes['设备信息'] = '设备信息'
t.routes['设备参数状态监控'] = '设备参数状态监控'
t.routes['设备分组报警信息'] = '设备分组报警信息'
t.routes['设备历史参数'] = '设备历史参数'
t.routes['质量检测类型'] = '质量检测类型'
t.routes['质量检测信息'] = '质量检测信息'
@ -190,17 +189,15 @@ t.prod.code = '产品编码'
t.prod.type = '产品类型'
t.prod.area = '单位平方数'
t.prod.spec = '规格'
t.prod.attr = '属性'
t.prod.attr = '动态属性'
t.prod.attrcode = '属性编码'
t.prod.attrcodeHints = '请输入属性编码'
t.prod.attrname = '属性名称'
t.prod.attrnameHints = '请输入属性名称'
t.prod.attrvalueHints = '请输入属性值'
t.prod.descHints = '请输入描述'
// t.prod.processTime = '加工时间 (h)'
t.prod.processTime = '产线完成单位产品用时 (s)'
t.prod.processTimeHints = '请输入完成单位产品用时'
// t.prod.processTimeHints = '请输入加工时间'
t.prod.processTime = '加工时间 (h)'
t.prod.processTimeHints = '请输入加工时间'
t.prod.relatedPid = '关联产品'
t.alarm = {}
@ -263,7 +260,6 @@ t.realtime.eqName = '设备名称'
t.realtime.eqCode = '设备编码'
t.realtime.productionSnapshotTime = '生产量记录时间'
t.realtime.statusSnapshotTime = '状态记录时间'
t.realtime.refresh = '刷新数据'
t.ws = {}
@ -272,8 +268,7 @@ t.ws.id = '工段ID'
t.ws.name = '工段名称'
t.ws.code = '工段编码'
t.ws.binded = '已绑定的设备'
t.ws.unbind = '设备名称'
t.ws.eqbindplaceholder = '选择一个设备进行绑定'
t.ws.unbind = '选择一个设备进行绑定'
t.ws.sort = '排序'
t.ws.setorder = '请输入工段中设备的顺序'
t.ws.bind = '绑定'

View File

@ -168,7 +168,7 @@ function fnAddDynamicMenuRoutes(menuList = [], routes = []) {
// 菜单的国际化
menuList[i].name = i18n.t(`routes["${menuList[i].name}"]`)
// console.log('route ===', route.meta.title)
console.log('route ===', route.meta.title)
// eslint-disable-next-line
let URL = (menuList[i].url || '').replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)) // URL支持{{ window.xxx }}占位符变量
if (isURL(URL)) {

View File

@ -75,14 +75,7 @@ const tableConfigs = [
},
{ prop: 'quantityTime', name: i18n.t('realtime.productionSnapshotTime'), filter: timeFilter },
{ prop: 'statusTime', name: i18n.t('realtime.statusSnapshotTime'), filter: timeFilter },
{
prop: 'alarm',
name: i18n.t('realtime.recentParamValue'),
buttonContent: i18n.t('realtime.view'),
subcomponent: TableTextComponent,
emitFullData: true,
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'] }
]
@ -193,19 +186,23 @@ export default {
selectionChangeHandle(val) {
this.dataListSelections = val
},
handleOperations({ type, data }) {
handleOperations({ type, data: id }) {
switch (type) {
case 'view-alarm':
const { equipmentId: id } = data
const { name, code } = this.dataList.find(item => item.id === id)
this.$router.push({
name: 'monitoring-equipmentHistoricalParameters',
params: { id }
name: 'monitoring-equipmentGroupAlarm',
params: {
groupName: name,
groupCode: code,
id
}
})
break
// case 'edit':
// return this.addOrUpdateHandle(id)
// case 'delete':
// return this.deleteHandle(id)
case 'edit':
return this.addOrUpdateHandle(id)
case 'delete':
return this.deleteHandle(id)
}
},
// /

View File

@ -1,97 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" @keyup.enter.native="getDataList()">
<el-form-item :label="'当前设备id'">
<strong>{{ $route.params.id }}</strong></el-form-item
>
</el-form>
<!-- <base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="calcMaxHeight(8)" @operate-event="handleOperations" @refreshDataList="getDataList" /> -->
<base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="calcMaxHeight(8)" />
</div>
</template>
<script>
import { calcMaxHeight } from '@/utils'
import { timeFilter } from '@/utils/filters'
import AddOrUpdate from '@/components/base-dialog/addOrUpdate'
import i18n from '@/i18n'
import BaseTable from '@/components/base-table'
import { pick } from 'lodash/object'
export default {
data() {
return {
calcMaxHeight,
tableConfigs: [],
dataList: [],
dataListLoading: false,
dataListSelections: []
}
},
components: {
AddOrUpdate,
BaseTable
},
activated() {
this.getDataList()
},
mouted() {
this.getDataList()
},
methods: {
//
getDataList() {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl(`/monitoring/equipmentValueMonitor/runLog/${this.$route.params.id}`),
method: 'get'
}).then(({ data: res }) => {
if (
res &&
res.code === 0 &&
res.data &&
res.data.length > 0 &&
res.data[0].nameData &&
res.data[0].nameData.length > 0 &&
res.data[0].data &&
res.data[0].data.length > 0
) {
this.setTableProps(res.data[0].nameData)
this.setTableData(res.data[0].data)
} else {
this.dataList = []
}
this.dataListLoading = false
})
},
setTableProps(nameData) {
this.tableConfigs = [
{
type: 'index',
name: i18n.t('index')
},
{ prop: 'time', name: '时间', filter: timeFilter },
{ prop: 'plcCode', name: 'PLC 编码' },
{ prop: 'equName', name: '设备名称' },
{ prop: 'equCode', name: '设备编码' },
// ...['1', '2', '3'].map(name => {
// return { prop: name, name }
// })
...Array.from(new Set(nameData.map(item => item.name))).map(name => ({ prop: name, name }))
]
},
setTableData(data) {
this.dataList = data.map(item => {
const rowItem = pick(item, ['time', 'plcCode', 'equName', 'equCode'])
if (item.data && item.data.length > 0) {
item.data.forEach(param => {
rowItem[param.dynamicName] = param.dynamicValue
})
}
return rowItem
})
}
}
}
</script>

View File

@ -114,8 +114,7 @@ export default {
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataList = data.data.list
this.totalPage = data.data.total
console.log('total page: ', this.totalPage)
this.totalPage = data.data.totalCount
} else {
this.dataList = []
this.totalPage = 0

View File

@ -25,7 +25,8 @@
></el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> -->
<base-dialog v-if="showbasedialog" ref="basedialog" :configs="addOrUpdateConfigs" @refreshDataList="getDataList" />
<base-dialog v-if="showbasedialog" ref="basedialog" :configs="addOrUpdateConfigs" @refreshDataList="getDataList" @destory-dialog="showbasedialog = false" />
</div>
</template>
@ -51,22 +52,16 @@ const tableConfigs = [
{ prop: 'code', name: i18n.t('prod.code') },
{ prop: 'specifications', name: i18n.t('prod.spec') },
{ prop: 'unitDictValue', name: i18n.t('unit'), filter: dictFilter(UnitDictTypeId) },
{ 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', 'viewAttr', 'delete'] }
{ prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['viewAttr', 'delete'] }
]
const addOrUpdateConfigs = {
type: 'dialog', // dialog | drawer | page
infoUrl: '/monitoring/product',
fields: [
// 'name',
{
name: 'name'
// label: i18n.t('pl.name')
},
'name',
{
name: 'code',
// label: i18n.t('pl.code'),
api: '/monitoring/product/getCode'
},
{
@ -227,8 +222,6 @@ export default {
//
handleOperations({ type, data }) {
switch (type) {
case 'edit': // <== tableConfig
return this.addOrEdit(data)
case 'viewAttr': // <== tableConfig
return this.addOrEdit(data)
case 'delete':

View File

@ -54,12 +54,10 @@ const addOrUpdateConfigs = {
type: 'dialog',
infoUrl: '/monitoring/productionLine',
fields: [
// 'name',
{ name: 'name', label: i18n.t('pl.name') },
{ name: 'code', label: i18n.t('pl.code'), api: '/monitoring/productionLine/getCode' },
'name',
{ name: 'code', api: '/monitoring/productionLine/getCode' },
{
name: 'factoryId',
required: true,
label: i18n.t('factory.title'),
type: 'select',
placeholder: i18n.t('pl.factoryHints'),

View File

@ -47,7 +47,6 @@ export default {
})
this.intervalId = setInterval(() => {
this.$message({
message: this.$t('realtime.refresh'),
type: 'warning',
duration: 1500,
onClose: () => {
@ -60,11 +59,7 @@ export default {
})
}, 1000 * 60 * 5)
},
// beforeDestroy() {
// console.log('before destroyed...')
// if (this.intervalId) clearInterval(this.intervalId)
// },
deactivated() {
beforeDestroy() {
if (this.intervalId) clearInterval(this.intervalId)
},
methods: {
@ -134,7 +129,7 @@ export default {
{ prop: obj.recordTime + '-inputNum', label: i18n.t('realtime.in') },
{ prop: obj.recordTime + '-outputNum', label: i18n.t('realtime.out') },
{ prop: obj.recordTime + '-scrapNum', label: i18n.t('realtime.data') },
{ prop: obj.recordTime + '-scrapRate', label: i18n.t('realtime.rate'), filter: val => (val !== '-' ? `${val.toFixed(2)}%` : '-') }
{ prop: obj.recordTime + '-scrapRate', label: i18n.t('realtime.rate'), filter: val => val !== '-' ? `${val.toFixed(2)}%` : '-' }
]
})
}

View File

@ -47,11 +47,11 @@ export default {
this.intervalId = setInterval(() => {
this.$message({
message: this.$t('realtime.refresh'),
message: this.$t('module.factory.realtime.productLine.refresh'),
type: 'warning',
onClose: () => {
this.clearData()
this.fetchList().then(({ data: res }) => {
this.fetchList().then(res => {
this.testData = res
this.handleData()
})
@ -60,7 +60,7 @@ export default {
}, 1000 * 60 * 5)
},
deactivated() {
beforeDestroy() {
if (this.intervalId) clearInterval(this.intervalId)
},

View File

@ -43,21 +43,15 @@ export default {
})
this.intervalId = setInterval(() => {
this.$message({
message: this.$t('realtime.refresh'),
type: 'warning',
onClose: () => {
this.clearData()
this.fetchList().then(({ data: res }) => {
this.testData = res
this.handleData()
})
}
this.clearData()
this.fetchList().then(res => {
this.testData = res
this.handleData()
})
}, 1000 * 60 * 5)
},
deactivated() {
beforeDestroy() {
if (this.intervalId) clearInterval(this.intervalId)
},

View File

@ -45,7 +45,6 @@ const tableConfigs = [
{ prop: 'name', name: i18n.t('ws.name') },
{ prop: 'code', name: i18n.t('ws.code') },
{ prop: 'productionLineName', name: i18n.t('pl.title') },
{ prop: 'description', name: i18n.t('desc') },
{ prop: 'remark', name: i18n.t('remark') },
{ prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
]

View File

@ -1,11 +1,5 @@
<template>
<el-dialog
class="super-flexible-dialog"
:title="isDetail ? $t('ws.detail') : !dataForm.id ? $t('add') : $t('edit')"
:visible.sync="visible"
:close-on-click-modal="false"
:destroy-on-close="true"
>
<el-dialog class="super-flexible-dialog" :title="isDetail ? $t('ws.detail') : !dataForm.id ? $t('add') : $t('ws.edit')" :visible.sync="visible">
<div style="max-height: 60vh; overflow-y: scroll; overflow-x: hidden;">
<el-form ref="dataForm" :model="dataForm" :rules="dataFormRules">
<el-row :gutter="20">

View File

@ -5,7 +5,7 @@
<el-row :gutter="20">
<el-col :span="12">
<el-form-item :label="edit ? $t('ws.binded') : $t('ws.unbind')" prop="equipmentId">
<el-select v-if="!edit" clearable v-model="dataForm.equipmentId" :placeholder="$t('ws.eqbindplaceholder')">
<el-select v-if="!edit" clearable v-model="dataForm.equipmentId">
<el-option v-for="eq in eqList" :key="eq.id" :label="eq.name" :value="eq.id" />
</el-select>
<el-input v-else disabled v-model="bindedEquipmentName" /> </el-form-item