This commit is contained in:
Fanzink
2023-02-08 18:13:08 +08:00
parent bbe5e63075
commit 28303e4c5f
37 changed files with 580 additions and 345 deletions

View File

@@ -66,6 +66,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{

View File

@@ -58,6 +58,7 @@ import TableTextComponent from '@/components/base-table/components/detailCompone
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'equipmentName', name: i18n.t('realtime.eqName') },

View File

@@ -89,6 +89,7 @@ import moment from 'moment'
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{

View File

@@ -52,6 +52,7 @@ import moment from 'moment'
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
// { prop: 'time', name: '时间', filter: timeFilter },

View File

@@ -57,6 +57,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },

View File

@@ -76,6 +76,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },

View File

@@ -21,8 +21,8 @@
</el-form>
<!-- <base-table :page="pageIndex" :size="pageSize" :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)" />
<base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="calcMaxHeight(8)" />
<base-table v-for="i in (0,dataLength)" :key="i.name" :data="dataList[i]" :table-head-configs="tableConfigs[i]" :max-height="calcMaxHeight(8)" />
<!-- <base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="calcMaxHeight(8)" /> -->
</div>
</template>
@@ -42,6 +42,7 @@ export default {
equipmentName: null,
equipmentCode: null,
tableConfigs: [],
dataLength: null,
dataList: [],
dataListLoading: false,
dataListSelections: []
@@ -74,46 +75,53 @@ export default {
url: this.$http.adornUrl(`/monitoring/equipmentValueMonitor/runLog/${this.$route.params.id}`),
method: 'get'
}).then(({ data: res }) => {
console.log('res', res)
// console.log('res', res)
this.equipmentName = res.data[0].data[0].equName
this.equipmentCode = res.data[0].data[0].equCode
this.dataLength = res.data.length
for (let i = 0; i < this.dataLength; i++) {
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
res.data[i].nameData &&
res.data[i].nameData.length > 0 &&
res.data[i].data &&
res.data[i].data.length > 0
) {
// console.log(this.equipmentName)
this.setTableProps(res.data[0].nameData)
this.setTableData(res.data[0].data)
this.setTableProps(res.data[i].nameData)
this.setTableData(res.data[i].data)
} else {
this.dataList = []
this.dataList[i] = []
}
this.dataListLoading = false
}
})
},
setTableProps(nameData) {
this.tableConfigs = [
{
type: 'index',
name: i18n.t('index')
},
{ prop: 'time', name: this.$t('ti'), filter: timeFilter },
{ prop: 'plcCode', name: this.$t('plcCode') },
// { prop: 'equName', name: this.$t('equName') },
// { prop: 'equCode', name: this.$t('equCode') },
// ...['数值1', '数值2', '数值3'].map(name => {
// return { prop: name, name }
// })
...Array.from(new Set(nameData.map((item) => item.name))).map((name) => ({ prop: name, name }))
]
for (let i = 0; i < this.dataLength; i++) {
this.tableConfigs[i] = [
{
type: 'index',
name: i18n.t('index')
},
{ prop: 'time', name: this.$t('ti'), filter: timeFilter },
{ prop: 'plcCode', name: this.$t('plcCode') },
// { prop: 'equName', name: this.$t('equName') },
// { prop: 'equCode', name: this.$t('equCode') },
// ...['数值1', '数值2', '数值3'].map(name => {
// return { prop: name, name }
// })
...Array.from(new Set(nameData.map((item) => item.name))).map((name) => ({ prop: name, name }))
]
console.log(this.tableConfigs[i]);
}
},
setTableData(data) {
this.dataList = data.map((item) => {
for (let i = 0; i < this.dataLength; i++) {
this.dataList[i] = data.map((item) => {
const rowItem = pick(item, ['time', 'plcCode', 'equName', 'equCode'])
if (item.data && item.data.length > 0) {
item.data.forEach((param) => {
@@ -122,6 +130,7 @@ export default {
}
return rowItem
})
}
}
}
}

View File

@@ -57,6 +57,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },

View File

@@ -38,6 +38,7 @@ import TableOperateComponent from '@/components/base-table/components/operationC
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },

View File

@@ -56,6 +56,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },

View File

@@ -54,6 +54,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },

View File

@@ -65,6 +65,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{

View File

@@ -47,6 +47,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },

View File

@@ -71,6 +71,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
@@ -111,7 +112,7 @@ const addOrUpdateConfigs = {
// placeholder: i18n.t('hints.checktime')
// },
{ name: 'productionId', required: true, label: i18n.t('pl.title'), type: 'select', options: [] },
{ name: 'sectionId', required: true, label: i18n.t('ws.title'), type: 'select', options: [] , isDisabled: true },
{ name: 'sectionId', required: true, label: i18n.t('ws.title'), type: 'select', options: [], isDisabled: true },
{
name: 'source',
label: i18n.t('source'),
@@ -183,7 +184,6 @@ export default {
this.$set(this.addOrUpdateConfigs.fields[2], 'isDisabled', true)
}
await this.getWorkSections(id)
}
if (name === 'sectionId') {
// 如果选择了产线,就依据此更新工单的选项
@@ -198,9 +198,11 @@ export default {
url: this.$http.adornUrl('/monitoring/qualityInspectionDet/page'),
method: 'get',
params: this.$http.adornParams({
page: this.pageIndex,
limit: this.pageSize,
key: this.dataForm.key
// page: this.pageIndex,
// limit: this.pageSize,
// key: this.dataForm.key
page: 1,
limit: 9999999
})
}).then(({ data: res }) => {
console.log('insdet:', res)

View File

@@ -57,6 +57,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },

View File

@@ -2,14 +2,14 @@
* @Author: lb
* @Date: 2022-06-22 14:00:17
* @LastEditors: fzq
* @LastEditTime: 2023-02-02 17:19:10
* @LastEditTime: 2023-02-08 16:50:05
* @Description: 设备生产实时数据
-->
<template>
<div>
<div class="app-container">
<small-title :size="'md'">{{ $t('realtime.eq') }}</small-title>
<base-table v-if="loadTable" :table-head-configs="tableProps" :data="tableData.length ? tableData : []" :span-method="spanMethod" />
<base-table v-if="loadTable" :table-head-configs="tableProps" :data="tableData.length ? tableData : []" :span-method="spanMethod" align= "center"/>
</div>
</div>
</template>

View File

@@ -2,7 +2,7 @@
* @Author: lb
* @Date: 2022-06-22 14:00:17
* @LastEditors: fzq
* @LastEditTime: 2023-02-02 17:17:45
* @LastEditTime: 2023-02-07 16:23:23
* @Description: 产线生产实时数据
-->
<template>
@@ -38,12 +38,19 @@ export default {
},
mounted() {
console.log('this.$route', this.$route)
this.clearData()
this.fetchList().then(({ data: res }) => {
// console.log('fetchlist:', res)
this.testData = res
this.handleData()
})
// this.fetchList().then(({ data: res }) => {
// // console.log('fetchlist:', res)
// this.testData = res
// this.handleData()
// if (res.code === 200 || this.$route.fullPath !== '/monitoring-realtimeProductLine') {
// // 获取数据显示成功后关闭loading
// loading.close()
// } else {
// this.$message.error(this.$t('err'))
// }
// })
this.intervalId = setInterval(() => {
this.$message({
@@ -66,6 +73,12 @@ export default {
methods: {
fetchList() {
// let loading = this.$loading({
// lock: true, //lock的修改符--默认是false
// text: this.$t('loading'), //显示在加载图标下方的加载文案
// background: 'rgba(0,0,0,0.8)', //遮罩层颜色
// spinner: 'el-icon-loading' //自定义加载图标类名
// })
return this.$http({
url: this.$http.adornUrl('/monitoring/productionMonitoring/lineProductionRealTimeData'),
method: 'post'
@@ -97,7 +110,7 @@ export default {
expandDataStepOne() {
// 扩展服务器返回的数据第一阶段
// console.log('create new one')
this.tableData = this.testData.data.map(item => {
this.tableData = this.testData.data.map((item) => {
const newItem = {
lineName: item.lineName,
orderName: item.orderName,
@@ -105,14 +118,14 @@ export default {
}
if (item.det) {
item.det.forEach(obj => {
item.det.forEach((obj) => {
// Step2: 设置动态props
if (!this.dynamicPropSet) {
this.tableProps.push({
label: moment(obj.recordTime).format('YYYY-MM-DD HH')+ moment(obj.recordTime).add(1,'hours').format('-HH')+i18n.t('hourTime'),
label: moment(obj.recordTime).format('YYYY-MM-DD HH') + moment(obj.recordTime).add(1, 'hours').format('-HH') + i18n.t('hourTime'),
children: [
{ prop: obj.recordTime + '-inputNum', label: i18n.t('realtime.in') },
{ prop: obj.recordTime + '-outputNum', label: i18n.t('realtime.out') },
{ prop: obj.recordTime + '-outputNum', label: i18n.t('realtime.out') }
// { prop: obj.recordTime + '-passArea', label: i18n.t('realtime.goodrate') },
// { prop: obj.recordTime + '-scrapNum', label: i18n.t('realtime.num') },
// { prop: obj.recordTime + '-scrapRate', label: i18n.t('realtime.rate') }

View File

@@ -2,7 +2,8 @@
<div>
<div class="app-container">
<small-title :size="'md'">{{ $t('realtime.inspect') }}</small-title>
<base-table v-if="loadTable" :table-head-configs="tableProps" :data="tableData.length ? tableData : []" />
<!-- fixed -->
<base-table v-if="loadTable" :table-head-configs="tableProps" :data="tableData.length ? tableData : []"/>
</div>
</div>
</template>

View File

@@ -48,6 +48,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },

View File

@@ -58,6 +58,7 @@ const topBtnConfig = [
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },

View File

@@ -83,6 +83,7 @@ import { calcMaxHeight } from '@/utils'
const tableProps = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ name: i18n.t('eq.name'), prop: 'equipmentName' },