This commit is contained in:
Fanzink 2023-02-03 16:44:47 +08:00
parent 8ec42773cd
commit f9d40b3790
30 changed files with 311 additions and 122 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 24 KiB

BIN
public/favicon2.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -32,7 +32,8 @@
:placeholder="getPlaceholder(n, c)"
v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]"
clearable
:disabled="isDetail"
:disabled="isDetail || configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].isDisabled"
@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-select>
@ -49,6 +50,7 @@
v-if="getType(n, c) === 'date'"
v-bind="configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].props"
:placeholder="getPlaceholder(n, c)"
value-format='yyyy-MM-ddTHH:mm:ss'
v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]"
:disabled="isDetail" />
</el-form-item>
@ -97,6 +99,7 @@
color: btnColor[operate.name]
}"
@click="handleClick(operate)"
:disabled='isDisabled'
>{{ btnName[operate.name] }}</el-button
>
</template>
@ -120,7 +123,7 @@ const title = {
//
const btnType = {
add :'#0b58ff',
add: '#0b58ff',
save: '#000',
update: '#0b58ff',
reset: ''
@ -179,6 +182,8 @@ export default {
// },
data() {
return {
//
isDisabled: false,
COLUMN_PER_ROW,
title,
/** 按钮相关属性 */
@ -456,6 +461,7 @@ export default {
},
emitSelectChange(name, id) {
// console.log(id)
const currentField = this.configs.fields.find((item) => item.name === name)
if (currentField.relatedField) {
this.dataForm[currentField.relatedField] = null
@ -476,7 +482,16 @@ export default {
/** 操作 */
switch (btn.name) {
case 'save':
this.isDisabled = true
setTimeout(() => {
this.isDisabled = false
}, 3000)
case 'update':
this.isDisabled = true
setTimeout(() => {
this.isDisabled = false
}, 3000)
/** 需要验证表单的操作 */
this.$refs['dataForm'].validate((valid) => {
if (valid) {

View File

@ -1,8 +1,18 @@
<!--
* @Descripttion:
* @version:
* @Author: fzq
* @Date: 2022-11-25 09:51:46
* @LastEditors: fzq
* @LastEditTime: 2023-02-03 14:30:23
-->
<template>
<!-- 数字代表多级表头最小列宽 -->
<!-- :width="opt.width || null" -->
<el-table-column
:label="opt.label ? opt.label : opt.name"
:prop="opt.prop || null"
:width="opt.width || null"
:width="flexColumnWidth(opt.prop || null)"
:min-width="opt.minWidth || null"
:fixed="opt.fixed || null"
:show-overflow-tooltip="opt.showOverflowTooltip || false"
@ -35,6 +45,33 @@ export default {
type: Object,
default: () => ({})
}
},
methods: {
//
flexColumnWidth(str) {
let flexWidth = 0
for (const char of str) {
if ((char >= 'A' && char <= 'Z') || (char >= 'a' && char <= 'z')) {
// 8
flexWidth += 8
} else if (char >= '\u4e00' && char <= '\u9fa5') {
// 20
flexWidth += 20
} else {
// 5
flexWidth += 5
}
}
// if (flexWidth < 50) {
// //
// flexWidth = 50
// }
if (flexWidth > 250) {
//
flexWidth = 250
}
return flexWidth + 'px'
},
}
}
</script>

View File

@ -109,7 +109,9 @@ export default {
maxHeight: {
type: Number,
// default: window.innerHeight - 325
default: 500
// el-table
default: window.innerHeight - 100
// default: 500
},
spanMethod: {
type: Function,

View File

@ -26,9 +26,9 @@ t.routes['设备'] = 'Equipment'
t.routes['字典管理'] = 'Dict Management'
t.routes['PLC信息'] = 'PLC'
t.routes['设备与PLC关联配置'] = 'Relations between plc & equipments'
t.routes['设备生产实时数据'] = 'Realtime Equipment Data'
t.routes['产线生产实时数据'] = 'Realtime Productline Data'
t.routes['质量检查实时数据'] = 'Realtime Quality Inspection Data'
t.routes['近24小时设备生产数据'] = 'Realtime Equipment Data(24h)'
t.routes['近24小时产线生产数据'] = 'Realtime Productline Data(24h)'
t.routes['近24小时质量检查数据'] = 'Realtime Quality Inspection Data(24h)'
t.routes['报表总览'] = 'Report Overview'
t.routes['报表分类'] = 'Report Types'
t.routes['报表详情'] = 'Report Detail'
@ -152,6 +152,9 @@ t.ti = 'Time'
t.plcCode = 'PLC Code'
t.equName = 'Equipment Name'
t.equCode = 'Equipment Code'
t.yAxisTime = 'Time (h)'
t.yAxisRate = 'Percentage (%)'
t.hourTime = '(h)'
t.graph = 'Graph'
@ -182,6 +185,8 @@ t.timetype = 'Time Type'
t.reftimerange = 'By time range'
t.refdate = 'By date'
t.hour = 'Hour(s)'
t.yes = 'yes'
t.no = 'no'
t.errors = {}
t.errors.nosection = 'There is no sections on this product line.'
@ -266,15 +271,15 @@ t.inspect.typeCount = 'Data of inspection types'
t.realtime = {}
t.realtime.eq = 'Realtime data of equipments'
t.realtime.pl = 'Realtime data of product lines'
t.realtime.inspect = 'Realtime data of quality inspections'
t.realtime.eq = 'Realtime data of equipments(24h)'
t.realtime.pl = 'Realtime data of product lines(24h)'
t.realtime.inspect = 'Realtime data of quality inspections(24h)'
t.realtime.in = 'in'
t.realtime.out = 'out'
t.realtime.data = 'scrap'
t.realtime.num = 'scrap quantity'
t.realtime.rate = 'scrap rate'
t.realtime.total = 'total production'
t.realtime.total = 'Equipment total production'
t.realtime.goodrate = 'Passed Rate'
t.realtime.runState = 'running state'
t.realtime.state = 'status'
@ -387,6 +392,7 @@ t.pl.tvalue = 'TT Value'
t.pl.factoryHints = 'Please select a factory'
t.pl.process = 'Working procedure'
t.pl.add = 'Add Euipment'
t.pl.add2 = 'Add Comparison Euipment'
t.pl.queryFirst = 'Please Query First'
t.pl.choose = 'Please select equipment'
t.pl.confirm = 'Confirm'

View File

@ -27,9 +27,9 @@ t.routes['设备'] = '设备'
t.routes['字典管理'] = '字典管理'
t.routes['PLC信息'] = 'PLC信息'
t.routes['设备与PLC关联配置'] = '设备与PLC关联配置' // ?
t.routes['设备生产实时数据'] = '设备生产实时数据'
t.routes['产线生产实时数据'] = '产线生产实时数据'
t.routes['质量检查实时数据'] = '质量检查实时数据'
t.routes['近24小时设备生产数据'] = '近24小时设备生产数据'
t.routes['近24小时产线生产数据'] = '近24小时产线生产数据'
t.routes['近24小时质量检查数据'] = '近24小时质量检查数据'
t.routes['报表总览'] = '报表总览'
t.routes['报表分类'] = '报表分类'
t.routes['报表详情'] = '报表详情'
@ -153,6 +153,9 @@ t.ti = '时间'
t.plcCode = 'PLC 编码'
t.equName = '设备名称'
t.equCode = '设备编码'
t.yAxisTime = '时间 (h)'
t.yAxisRate = '百分比 (%)'
t.hourTime = '(时)'
t.graph = '图形'
t.category = '分类'
@ -182,6 +185,9 @@ t.timetype = '时间类型'
t.reftimerange = '按时间段'
t.refdate = '按日期'
t.hour = '小时'
t.yes = '是'
t.no = '否'
t.errors = {}
t.errors.nosection = '该产线没有工段'
@ -266,15 +272,15 @@ t.inspect.typeCount = '检测类型统计数据'
t.realtime = {}
t.realtime.eq = '设备生产实时数据'
t.realtime.pl = '产线生产实时数据'
t.realtime.inspect = '质量检查实时数据'
t.realtime.eq = '近24小时产线生产数据'
t.realtime.pl = '近24小时产线生产数据'
t.realtime.inspect = '近24小时质量检查数据'
t.realtime.in = '进数据'
t.realtime.out = '出数据'
t.realtime.data = '报废数据'
t.realtime.num = '报废数量'
t.realtime.rate = '报废比例'
t.realtime.total = '总产量'
t.realtime.total = '设备总产量'
t.realtime.goodrate = '良品率'
t.realtime.runState = '是否运行'
t.realtime.state = '状态'
@ -386,6 +392,7 @@ t.pl.tvalue = '产线TT值(每小时下片数量)'
t.pl.factoryHints = '请选择所属工厂'
t.pl.process = '工序'
t.pl.add = '添加设备'
t.pl.add2 = '添加对比设备'
t.pl.queryFirst = '请先查询数据'
t.pl.success = '新设备数据获取成功'
t.pl.choose = '请选择设备'

View File

@ -4,7 +4,7 @@
* @Author: fzq
* @Date: 2022-11-25 09:51:46
* @LastEditors: fzq
* @LastEditTime: 2023-01-11 20:52:35
* @LastEditTime: 2023-02-01 09:39:37
*/
/** filters */
import moment from 'moment'
@ -16,7 +16,7 @@ export const dictFilter = dictTypeId => {
}
export const timeFilter = (val) => {
return moment(val).format('YYYY-MM-DD HH:mm:ss')
return val ? moment(val).format('YYYY-MM-DD HH:mm:ss') : '-'
}
export const pick = (obj, paths) => {

View File

@ -46,7 +46,7 @@ export default {
},
mounted() {
this.$nextTick(() => {
// ref
// ref
this.$store.state.contentTabs.splice(0, 1)
// home$children
if (this.$route.meta.hiddenSiderbar !== true) {
@ -56,6 +56,16 @@ export default {
// console.log('11',this.$refs.tabs.$children[0].$refs.tabs[0])
// console.log('22',this.$store.state.contentTabs)
})
// setTimeout(function() {
// //
// // .bind(this) 使function() thisthisundefined
// this.$store.state.contentTabs.splice(0, 1)
// // home$children
// if (this.$route.meta.hiddenSiderbar !== true) {
// this.$refs.tabs.$children[0].$refs.tabs[0].style.display = 'none'
// }
// }.bind(this),0)
},
methods: {
// tabs, iframe

View File

@ -217,7 +217,7 @@ import moment from 'moment'
// let logoutInterval = null
// const timeInterval = null
export default {
inject: ['refresh'],
// inject: ['refresh'],
data() {
return {
// logoutTime: 1800000,
@ -307,6 +307,9 @@ export default {
getLang() {
return Cookies.get('language')
},
refresh() {
this.$router.go(0)
},
//
handleCommand(command) {
//

View File

@ -29,7 +29,7 @@ export default {
mounted() {
// this.$store.state.sidebarMenuList = window.SITE_CONFIG['menuList']
this.$nextTick(() => {
console.log(`window.SITE_CONFIG['menuList']`, window.SITE_CONFIG['menuList'])
// console.log(`window.SITE_CONFIG['menuList']`, window.SITE_CONFIG['menuList'])
this.unhiddenMenuList = this.getUnhiddenRoutesListFrom(window.SITE_CONFIG['menuList'])
/** 本地保存一份store保存一份感觉 store 都不需要保存... */
this.$store.state.sidebarMenuList = this.unhiddenMenuList

View File

@ -411,7 +411,7 @@ export default {
if (data && data.code === 0) {
this.dataList = data.data.list
// this.dataList = new Array(20).fill('1')
// console.log('data list', this.dataList)
console.log('data list', this.dataList)
this.totalPage = data.data.total
} else {
this.dataList = []

View File

@ -23,7 +23,14 @@
</el-form-item>
</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
:page="pageIndex"
:size="pageSize"
:data="dataList"
:table-head-configs="tableConfigs"
:max-height="calcMaxHeight(8)"
@operate-event="handleOperations"
@refreshDataList="getDataList" />
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
@ -31,8 +38,7 @@
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
>
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :configs="addOrUpdateConfigs" @refreshDataList="getDataList" @destory-dialog="handleDestroyDialog" />
@ -56,27 +62,41 @@ const tableConfigs = [
},
{ prop: 'equipmentName', name: i18n.t('realtime.eqName') },
{ prop: 'equipmentCode', name: i18n.t('realtime.eqCode') },
{ prop: 'inputNum', name: i18n.t('realtime.input') },
{ prop: 'outputNum', name: i18n.t('realtime.output') },
{
prop: 'inputNum',
name: i18n.t('realtime.input'),
filter: (val) => {
if (val !== null && val !== undefined) return val ? val : '-'
else return '-'
}
},
{
prop: 'outputNum',
name: i18n.t('realtime.output'),
filter: (val) => {
if (val !== null && val !== undefined) return val ? val : '-'
else return '-'
}
},
{
prop: 'run',
name: i18n.t('realtime.runState'),
filter: val => {
if (val !== null && val !== undefined) return val ? '是' : '否'
filter: (val) => {
if (val !== null && val !== undefined) return val ? i18n.t('yes') : i18n.t('no')
}
},
{
prop: 'status',
name: i18n.t('realtime.state'),
filter: val => {
if (val !== null && val !== undefined) return ['正常', '计划停机', '故障'][+val]
filter: (val) => {
if (val !== null && val !== undefined) return [i18n.t('normal'), i18n.t('planStop'), i18n.t('malfunction')][+val]
}
},
{
prop: 'error',
name: i18n.t('realtime.hasFault'),
filter: val => {
if (val !== null && val !== undefined) return val ? '是' : '否'
filter: (val) => {
if (val !== null && val !== undefined) return val ? i18n.t('yes') : i18n.t('no')
}
},
{ prop: 'quantityTime', name: i18n.t('realtime.productionSnapshotTime'), filter: timeFilter },
@ -137,8 +157,8 @@ export default {
// destroy dialog
handleDestroyDialog() {
setTimeout(() => {
this.addOrUpdateVisible= false
}, /** after dialog animated */ 200);
this.addOrUpdateVisible = false
}, /** after dialog animated */ 200)
},
//
getEqList() {
@ -231,7 +251,7 @@ export default {
deleteHandle(id) {
var ids = id
? [id]
: this.dataListSelections.map(item => {
: this.dataListSelections.map((item) => {
return item.id
})
this.$confirm(`${i18n.t('prompt.info', { handle: id ? i18n.t('delete').toLowerCase() : i18n.t('deleteBatch').toLowerCase() })}`, i18n.t('prompt.title'), {

View File

@ -8,7 +8,7 @@
</el-form-item>
<el-form-item>
<!-- <el-select v-model="dataForm.factoryId" :placeholder="$t('eq.name') + ' / ' + $t('eq.code')" clearable></el-select> -->
<el-select v-model="dataForm.ftId" :placeholder="$t('factory.title')" clearable>
<el-select v-model="dataForm.ftId" :placeholder="$t('factory.title')" @change="handleftIdChange" clearable>
<el-option v-for="factory in factoryList" :key="factory.id" :value="factory.id" :label="factory.name" />
</el-select>
</el-form-item>
@ -124,8 +124,8 @@ const tableConfigs = [
{
name: i18n.t('eq.speedlost'),
children: [
{ prop: 'realYield', name: i18n.t('eq.realyield'), width: 120, filter: val => `${val} `+i18n.t('hour') },
{ prop: 'designYield', name: i18n.t('eq.designyield'), width: 120, filter: val => `${val} `+i18n.t('hour') },
{ prop: 'realYield', name: i18n.t('eq.realyield'), width: 120, filter: val => `${val} `+'/'+i18n.t('hour') },
{ prop: 'designYield', name: i18n.t('eq.designyield'), width: 120, filter: val => `${val} `+'/'+i18n.t('hour') },
{ prop: 'peEfficiency', name: i18n.t('eq.speedefficiency'), width: 120, filter: val => (val * 100).toFixed(2) + '%' }
]
},
@ -242,7 +242,9 @@ export default {
}
})
},
handleftIdChange() {
this.getProductLineList()
},
//
getTimeRange() {
let startTime

View File

@ -2,15 +2,15 @@
/*
* @Author: lb
* @Date: 2022-07-24 13:30:00
* @LastEditTime: 2022-07-28 09:30:00
* @LastEditors: lb
* @LastEditTime: 2023-02-02 15:02:52
* @LastEditors: fzq
* @Description: 设备效率分析-echarts图
*/
-->
<template>
<div class="graph-area">
<span class="close-btn" @click="close">
<svg xmlns="http://www.w3.org/2000/svg" style="height: 100%; width: 100%;" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<svg xmlns="http://www.w3.org/2000/svg" style="height: 100%; width: 100%" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
</svg>
</span>
@ -21,12 +21,12 @@
<el-radio-button :label="$t('eq.time')" />
</el-radio-group>
<el-radio-group v-if="1" v-model="searchType" class="head-radio-group" style="margin-left: 8px;" size="small" @change="handleRadioGroupChanged">
<el-radio-group v-if="1" v-model="searchType" class="head-radio-group" style="margin-left: 8px" size="small" @change="handleRadioGroupChanged">
<el-radio-button v-for="(opt, index) in searchRadioOptions" :key="index" :label="opt" />
</el-radio-group>
</div>
<div id="trend-graph" class="real-graph" style="width: 100%; height: 500px;" />
<div id="trend-graph" class="real-graph" style="width: 100%; height: 500px" />
</div>
</template>
@ -131,6 +131,7 @@ export default {
this.config.setTitle(this.injectData.equipmentName + i18n.t('eq.timetrend'))
await this.getList()
this.setLegend()
// console.log('this.dataType',this.dataType);
},
init(data) {
@ -181,14 +182,14 @@ export default {
getList() {
const params = this.makeQuerys()
//
return this.getOEE(params).then(datalist => {
return this.getOEE(params).then((datalist) => {
console.log('getOEE res:', datalist)
this.timeList.splice(0)
this.rateList.splice(0)
this.xAxis.splice(0)
if (datalist.length) {
//
datalist.map(item => {
datalist.map((item) => {
const time = moment(item.time)
if (this.searchType === i18n.t('eq.monthgap')) {
this.xAxis.push(`${time.year()}${i18n.t('eq.year')}${time.month() + 1}${i18n.t('eq.month')}`)
@ -241,7 +242,7 @@ export default {
const workTimeList = []
const stopTimeList = []
const downTimeList = []
this.timeList.map(item => {
this.timeList.map((item) => {
workTimeList.push(item.workTime)
stopTimeList.push(item.stopTime)
downTimeList.push(item.downTime)
@ -260,7 +261,7 @@ export default {
const timeEfficiencyList = []
const oeeList = []
const teepList = []
this.rateList.map(item => {
this.rateList.map((item) => {
workRateList.push(item.workRate)
stopRateList.push(item.stopRate)
downRateList.push(item.downRate)
@ -283,6 +284,18 @@ export default {
//
renderGraph() {
if (this.dataType === i18n.t('eq.time')) {
this.config.yAxis = {
type: 'value',
name: i18n.t('yAxisTime')
}
} else {
this.config.yAxis = {
type: 'value',
name: i18n.t('yAxisRate')
}
}
console.log('this.dataType', this.dataType)
console.log('latest config: ', JSON.stringify(this.config))
this.$nextTick(() => {
// this.chart.setOption(this.config)

View File

@ -70,7 +70,7 @@ const tableConfigs = [
const addOrUpdateConfigs = {
type: 'dialog',
infoUrl: '/monitoring/equipmentGroup',
fields: [{ name: 'name', required: true, label: i18n.t('eq.groupname') }, { name: 'code', required: true, label: i18n.t('eq.groupcode') }, 'remark'],
fields: [{ name: 'name', required: true, label: i18n.t('eq.groupname') }, { name: 'code', required: true, label: i18n.t('eq.groupcode'),api: '/monitoring/equipmentGroupAlarm/getCode' }, 'remark'],
operations: [
{ name: 'cancel', showAlways: true },
{ name: 'save', url: '/monitoring/equipmentGroup', permission: 'monitoring:equipmentgroup:save', showOnEdit: false },

View File

@ -1,16 +1,27 @@
<template>
<div class="mod-config">
<el-form :inline="true" class="blueTip" size="small">
<el-form-item :label="$t('eqId')">
<strong>{{ $route.params.id }}</strong></el-form-item
>
<el-form :inline="true" class="blueTip" size="small">
<!-- <el-form-item>
{{ $t('eq.plcname') }}
</el-form-item>
<el-form-item>
<el-select v-model="dataForm.lineId" :placeholder="$t('eq.plcname')" 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 :label="$t('eqId')">
<strong>{{ $route.params.id }}</strong>
</el-form-item> -->
<el-form-item :label="$t('equName')">
<strong>{{ equipmentName }}</strong>
</el-form-item>
<el-form-item :label="$t('equCode')">
<strong>{{ equipmentCode }}</strong>
</el-form-item>
</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)" />
</div>
</template>
@ -21,11 +32,14 @@ import AddOrUpdate from '@/components/base-dialog/addOrUpdate'
import i18n from '@/i18n'
import BaseTable from '@/components/base-table'
import { pick } from 'lodash/object'
import equipmentVue from './equipment.vue'
export default {
data() {
return {
calcMaxHeight,
equipmentName: null,
equipmentCode: null,
tableConfigs: [],
dataList: [],
dataListLoading: false,
@ -42,12 +56,15 @@ export default {
mouted() {
this.getDataList()
},
created(){
// console.log('params',this.$route.params)
},
methods: {
// destroy dialog
handleDestroyDialog() {
setTimeout(() => {
this.addOrUpdateVisible= false
}, /** after dialog animated */ 200);
this.addOrUpdateVisible = false
}, /** after dialog animated */ 200)
},
//
getDataList() {
@ -56,6 +73,7 @@ export default {
url: this.$http.adornUrl(`/monitoring/equipmentValueMonitor/runLog/${this.$route.params.id}`),
method: 'get'
}).then(({ data: res }) => {
console.log('res',res)
if (
res &&
res.code === 0 &&
@ -66,6 +84,9 @@ export default {
res.data[0].data &&
res.data[0].data.length > 0
) {
this.equipmentName = res.data[0].data[0].equName
this.equipmentCode = res.data[0].data[0].equCode
console.log(this.equipmentName)
this.setTableProps(res.data[0].nameData)
this.setTableData(res.data[0].data)
} else {
@ -82,19 +103,19 @@ export default {
},
{ 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') },
// { 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 }))
...Array.from(new Set(nameData.map((item) => item.name))).map((name) => ({ prop: name, name }))
]
},
setTableData(data) {
this.dataList = data.map(item => {
this.dataList = data.map((item) => {
const rowItem = pick(item, ['time', 'plcCode', 'equName', 'equCode'])
if (item.data && item.data.length > 0) {
item.data.forEach(param => {
item.data.forEach((param) => {
rowItem[param.dynamicName] = param.dynamicValue
})
}

View File

@ -35,7 +35,7 @@
<!-- <el-button v-if="$hasPermission('monitoring:equipmentEffiency:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> -->
</el-form-item>
<el-form-item>
<el-button type="success" @click="addEq()">{{ $t('pl.add') }}</el-button>
<el-button type="success" @click="addEq()">{{ $t('pl.add2') }}</el-button>
</el-form-item>
</el-form>
@ -489,8 +489,8 @@ export default {
const condition = {
startTime,
endTime,
productlines: [this.dataForm.productlines],
wsId: this.dataForm.wsId,
// productlines: [this.dataForm.productlines],
// wsId: this.dataForm.wsId,
eqId: this.eqId
}

View File

@ -72,7 +72,7 @@ const addOrUpdateConfigs = {
fields: [
{ name: 'name', required: true, label: i18n.t('eq.type') },
{ name: 'code', required: true, label: i18n.t('eq.typecode'), api: '/monitoring/equipmentType/getCode' },
{ name: 'parentId', label: i18n.t('eq.parent'), type: 'cascader', props: { label: 'name', value: 'id', checkStrictly: true, emitPath: false }, options: [] },
// { name: 'parentId', label: i18n.t('eq.parent'), type: 'cascader', props: { label: 'name', value: 'id', checkStrictly: true, emitPath: false }, options: [] },
'remark'
],
operations: [
@ -133,16 +133,16 @@ export default {
},
//
getTreeEquipmentType() {
this.$http({
url: this.$http.adornUrl('/monitoring/equipmentType/getTree'),
method: 'post'
}).then(({ data: res }) => {
if (res && res.code === 0 && res.data.length) {
this.addOrUpdateConfigs.fields.find(item => item.name === 'parentId').options = res.data
} else {
this.addOrUpdateConfigs.fields.find(item => item.name === 'parentId').options.splice(0)
}
})
// this.$http({
// url: this.$http.adornUrl('/monitoring/equipmentType/getTree'),
// method: 'post'
// }).then(({ data: res }) => {
// if (res && res.code === 0 && res.data.length) {
// this.addOrUpdateConfigs.fields.find(item => item.name === 'parentId').options = res.data
// } else {
// this.addOrUpdateConfigs.fields.find(item => item.name === 'parentId').options.splice(0)
// }
// })
},
//
getDataList() {

View File

@ -143,7 +143,9 @@ const addOrUpdateConfigs = {
relatedField: 'productId',
tableConfigs: [
{ type: 'index', width: 100, name: i18n.t('index') },
{ prop: 'createTime', name: i18n.t('createTime'), filter: (val) => (val ? moment(val).format('YYYY-MM-DD hh:mm:ss') : '-') },
// 12
// { prop: 'createTime', name: i18n.t('createTime'), filter: (val) => (val ? moment(val).format('YYYY-MM-DD hh:mm:ss') : '-') },
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
{ prop: 'name', name: i18n.t('attrName'), formField: true, rules: [{ required: true, message: i18n.t('required'), trigger: 'blur' }] },
{ prop: 'code', name: i18n.t('attrValue'), formField: true },
{ prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }

View File

@ -38,7 +38,7 @@
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:configs="addOrUpdateConfigs"
@refreshDataList="getDataList"
@refreshDataList="addSuccess"
@select-change="handleDialogSelectChange"
@destory-dialog="handleDestroyDialog" />
</div>
@ -92,7 +92,7 @@ const addOrUpdateConfigs = {
fields: [
// { name: 'productionId', label: i18n.t('eq.name'), required: true },
{ name: 'productionId', label: i18n.t('pl.title'), required: true, type: 'select', options: [], relatedField: 'sectionId' },
{ name: 'sectionId', label: i18n.t('ws.title'), required: true, type: 'select', options: [] },
{ name: 'sectionId', label: i18n.t('ws.title'), required: true, type: 'select', options: [], isDisabled: true },
{ name: 'model', label: i18n.t('andeng.btnBoxModel') },
{
// name: 'keyValue',
@ -215,6 +215,7 @@ export default {
methods: {
// destroy dialog
handleDestroyDialog() {
this.$set(this.addOrUpdateConfigs.fields[1], 'isDisabled', true)
setTimeout(() => {
this.addOrUpdateVisible = false
}, /** after dialog animated */ 200)
@ -332,8 +333,7 @@ export default {
this.addOrUpdateConfigs.fields.forEach((item) => {
// console.log('item',item)
// console.log('res',res)
if (item.name === 'inspectionDetContent')
item.options = res.data.list.map((item) => ({ label: item.content, value: item.content, inspectionDetId: item.code }))
if (item.name === 'inspectionDetContent') item.options = res.data.list.map((item) => ({ label: item.content, value: item.content, inspectionDetId: item.code }))
// console.log('item',item)
})
} else {
@ -359,10 +359,19 @@ export default {
this.dataListSelections = val
},
//
handleDialogSelectChange({ name, id }) {
async handleDialogSelectChange({ name, id }) {
switch (name) {
case 'productionId':
this.getWsList(id)
// this.getWsList(id)
if (name === 'productionId') {
// 线
if (id) {
this.$set(this.addOrUpdateConfigs.fields[1], 'isDisabled', false)
} else {
this.$set(this.addOrUpdateConfigs.fields[1], 'isDisabled', true)
}
await this.getWsList(id)
}
case 'inspectionDetContent':
// this.dataForm.inspectionDetId = id
// console.log(id)
@ -377,6 +386,11 @@ export default {
console.log('addOrUpdateConfigs', this.addOrUpdateConfigs.fields)
}
},
addSuccess() {
this.getDataList()
this.$set(this.addOrUpdateConfigs.fields[1], 'options', [])
this.$set(this.addOrUpdateConfigs.fields[1], 'isDisabled', true)
},
handleOperations({ type, data: id }) {
switch (type) {
case 'view-detail':

View File

@ -3,7 +3,7 @@
<el-form :inline="true" :model="dataForm" @keyup.enter.native="currentChangeHandle(1)" class="blueTip" size="small">
<el-form-item>
{{ $t('pl.title') }}
</el-form-item>
</el-form-item>
<el-form-item>
<el-select v-model="dataForm.lineId" :placeholder="$t('pl.title')" clearable filterable>
<el-option v-for="pl in plList" :key="pl.value" :value="pl.value" :label="pl.label" />
@ -11,7 +11,7 @@
</el-form-item>
<el-form-item>
{{ $t('inspect.det') }}
</el-form-item>
</el-form-item>
<el-form-item>
<el-input v-model="dataForm.key" :placeholder="$t('inspect.det')" clearable></el-input>
</el-form-item>
@ -22,7 +22,7 @@
</el-form>
<base-table
:top-btn-config="topBtnConfig"
:top-btn-config="topBtnConfig"
:page="pageIndex"
:size="pageSize"
:data="dataList"
@ -30,8 +30,7 @@
:max-height="calcMaxHeight(8)"
@operate-event="handleOperations"
@refreshDataList="getDataList"
@clickTopBtn="clickTopBtn"
/>
@clickTopBtn="clickTopBtn" />
<el-pagination
@size-change="sizeChangeHandle"
@ -40,8 +39,7 @@
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
>
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
@ -49,10 +47,9 @@
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:configs="addOrUpdateConfigs"
@refreshDataList="getDataList"
@refreshDataList="addSuccess"
@destory-dialog="handleDestroyDialog"
@select-change="handleSelectChange"
/>
@select-change="handleSelectChange" />
</div>
</template>
@ -87,7 +84,7 @@ const tableConfigs = [
// { prop: 'productionId', name: i18n.t('pl.id') },
// { prop: 'sectionId', name: i18n.t('ws.id') },
{ prop: 'checkPerson', name: i18n.t('inspect.people') },
{ prop: 'source', name: i18n.t('source'), filter: val => ({ 1: i18n.t('manual'), 2: i18n.t('auto') }[val]) },
{ prop: 'source', name: i18n.t('source'), filter: (val) => ({ 1: i18n.t('manual'), 2: i18n.t('auto') }[val]) },
{ prop: 'explainText', 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'] }
@ -98,8 +95,23 @@ const addOrUpdateConfigs = {
infoUrl: '/monitoring/qualityInspectionRecord',
fields: [
{ name: 'checkTime', required: true, label: i18n.t('inspect.time'), type: 'date', props: { style: 'width: 100%', type: 'datetime' }, placeholder: i18n.t('hints.checktime') },
// {
// name: 'checkTime',
// required: true,
// label: i18n.t('inspect.time'),
// type: 'date',
// props: {
// 'type': 'date', // element-ui
// 'placeholder': i18n.t('hints.date'),
// 'value-format': 'yyyy-MM-ddTHH:mm:ss',
// 'style': {
// width: '100%'
// }
// },
// 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: [] },
{ name: 'sectionId', required: true, label: i18n.t('ws.title'), type: 'select', options: [] , isDisabled: true },
{
name: 'source',
label: i18n.t('source'),
@ -155,15 +167,29 @@ export default {
methods: {
// destroy dialog
handleDestroyDialog() {
this.$set(this.addOrUpdateConfigs.fields[2], 'isDisabled', true)
setTimeout(() => {
this.addOrUpdateVisible = false
}, /** after dialog animated */ 200)
},
// handle
async handleSelectChange({ name, id }) {
// console.log('this',this)
if (name === 'productionId') {
// 线
if (id) {
this.$set(this.addOrUpdateConfigs.fields[2], 'isDisabled', false)
} else {
this.$set(this.addOrUpdateConfigs.fields[2], 'isDisabled', true)
}
await this.getWorkSections(id)
}
if (name === 'sectionId') {
// 线
// console.log('nihao',id);
// console.log('nihao2',this.addOrUpdateConfigs.fields[1].options == []);
// console.log('nihao2',this.addOrUpdateConfigs.fields[1].options );
}
},
//
@ -178,9 +204,9 @@ export default {
})
}).then(({ data: res }) => {
console.log('insdet:', res)
const insDetOpt = this.addOrUpdateConfigs.fields.find(item => item.name === 'inspectionDetId')
const insDetOpt = this.addOrUpdateConfigs.fields.find((item) => item.name === 'inspectionDetId')
if (insDetOpt) {
insDetOpt.options = res.data.list.map(item => ({ value: item.id, label: item.content })) || []
insDetOpt.options = res.data.list.map((item) => ({ value: item.id, label: item.content })) || []
}
})
},
@ -190,11 +216,11 @@ export default {
url: this.$http.adornUrl('/monitoring/productionLine/list'),
method: 'get'
}).then(({ data: res }) => {
const plOpt = this.addOrUpdateConfigs.fields.find(item => item.name === 'productionId')
const plOpt = this.addOrUpdateConfigs.fields.find((item) => item.name === 'productionId')
if (plOpt) {
plOpt.options = res.data.map(item => ({ value: item.id, label: item.name })) || []
plOpt.options = res.data.map((item) => ({ value: item.id, label: item.name })) || []
}
this.plList = res.data.map(item => ({ value: item.id, label: item.name })) || []
this.plList = res.data.map((item) => ({ value: item.id, label: item.name })) || []
})
},
//
@ -215,15 +241,23 @@ export default {
if (res.data.total === 0) {
this.$message.error(i18n.t('errors.nosection'))
} else {
// console.log('da',this.dataForm);
this.$message.success(i18n.t('errors.numsection', { num: res.data.total }))
}
}
const wsOpt = this.addOrUpdateConfigs.fields.find(item => item.name === 'sectionId')
const wsOpt = this.addOrUpdateConfigs.fields.find((item) => item.name === 'sectionId')
// const wsOpt2 = this.addOrUpdateConfigs.fields.find((item) => item.name === 'productionId')
// console.log('wsOpt',wsOpt);
if (wsOpt) {
wsOpt.options = res.data.list.map(item => ({ value: item.id, label: item.name })) || []
wsOpt.options = res.data.list.map((item) => ({ value: item.id, label: item.name })) || []
}
})
},
addSuccess() {
this.getDataList()
this.$set(this.addOrUpdateConfigs.fields[2], 'options', [])
this.$set(this.addOrUpdateConfigs.fields[2], 'isDisabled', true)
},
//
getDataList() {
this.addOrUpdateVisible = false
@ -245,6 +279,7 @@ export default {
method: 'get',
params: this.$http.adornParams(queryParams)
}).then(({ data }) => {
// console.log('data', data)
if (data && data.code === 0) {
this.dataList = data.data.list
this.totalPage = data.data.total
@ -295,7 +330,7 @@ export default {
deleteHandle(id) {
var ids = id
? [id]
: this.dataListSelections.map(item => {
: this.dataListSelections.map((item) => {
return item.id
})
this.$confirm(`${i18n.t('prompt.info', { handle: id ? i18n.t('delete').toLowerCase() : i18n.t('deleteBatch').toLowerCase() })}`, i18n.t('prompt.title'), {

View File

@ -2,7 +2,7 @@
* @Author: lb
* @Date: 2022-06-22 14:00:17
* @LastEditors: fzq
* @LastEditTime: 2023-01-03 10:18:14
* @LastEditTime: 2023-02-02 17:19:10
* @Description: 设备生产实时数据
-->
<template>
@ -130,7 +130,7 @@ export default {
if (obj.recordTime) {
// obj.recordTime
this.tableProps.push({
label: moment(obj.recordTime).format('YYYY-MM-DD HH:mm:ss'),
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') },

View File

@ -1,8 +1,8 @@
<!--
* @Author: lb
* @Date: 2022-06-22 14:00:17
* @LastEditors: lb
* @LastEditTime: 2022-06-22 14:00:17
* @LastEditors: fzq
* @LastEditTime: 2023-02-02 17:17:45
* @Description: 产线生产实时数据
-->
<template>
@ -109,7 +109,7 @@ export default {
// Step2: props
if (!this.dynamicPropSet) {
this.tableProps.push({
label: moment(obj.recordTime).format('YYYY-MM-DD HH:mm:ss'),
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') },

View File

@ -138,14 +138,14 @@ export default {
// props
for (const key of sortedTime) {
// const prop = { label: key, children: [] }
const prop = { label: moment(key).format('YYYY-MM-DD HH:mm:ss'), children: [] }
const prop = { label: moment(key).format('YYYY-MM-DD HH')+ moment(key).add(1,'hours').format('-HH')+i18n.t('hourTime'), children: [] }
for (const subKey in timeMap[key]) {
prop.children.push({ label: subKey, prop: key + subKey })
}
dynamicPropNames.push(prop)
}
return [{ prop: 'checkType', label: i18n.t('inspect.type'), isFixed: true }, ...dynamicPropNames]
return [{ prop: 'checkType', label: i18n.t('inspect.det'), isFixed: true }, ...dynamicPropNames]
}
}
}

View File

@ -75,7 +75,7 @@ const addOrUpdateConfigs = {
fields: [
{ name: 'name', required: true, label: i18n.t('ws.name') },
{ name: 'code', required: true, label: i18n.t('ws.code'), api: '/monitoring/workshopSection/getCode' },
{ name: 'productionLineId', label: i18n.t('ws.belong'), type: 'select', options: [] },
{ name: 'productionLineId', required: true, label: i18n.t('ws.belong'), type: 'select', options: [] },
'description',
'remark'
],

View File

@ -124,7 +124,8 @@ export default {
},
dataFormRules: {
name: [{ required: true, message: i18n.t('validate.required'), trigger: 'blur' }],
code: [{ required: true, message: i18n.t('validate.required'), trigger: 'blur' }]
code: [{ required: true, message: i18n.t('validate.required'), trigger: 'blur' }],
productionLineId: [{ required: true, message: i18n.t('validate.required'), trigger: 'blur' }]
},
limit: 5,
page: 1,

View File

@ -17,9 +17,9 @@
<el-form-item>
<el-button class="buttonColor" @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<!-- <el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:dict:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item> -->
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('sys:dict:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>

View File

@ -105,7 +105,8 @@ export default {
confirmPassword: [{ validator: validateConfirmPassword, trigger: 'blur' }],
realName: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
email: [{ validator: validateEmail, trigger: 'blur' }],
mobile: [{ validator: validateMobile, trigger: 'blur' }],
//
// mobile: [{ validator: validateMobile, trigger: 'blur' }],
roleIdList: [{ required: true, message: '至少选择一个角色', trigger: 'change' }]
}
}

View File

@ -4,7 +4,7 @@
* @Author: fzq
* @Date: 2022-11-25 09:51:46
* @LastEditors: fzq
* @LastEditTime: 2023-01-13 09:06:52
* @LastEditTime: 2023-02-02 15:36:55
-->
<template>
<el-card shadow="never" class="aui-card--fill">
@ -58,7 +58,7 @@
<el-tag v-else size="small" type="success">{{ $t('user.status1') }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="createDate" :label="$t('user.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
<!-- <el-table-column prop="createDate" :label="$t('user.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column> -->
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('sys:user:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>