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)" :placeholder="getPlaceholder(n, c)"
v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]" v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]"
clearable 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)"> @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 + Math.random()" :label="opt.label" :value="opt.value" />
</el-select> </el-select>
@ -49,6 +50,7 @@
v-if="getType(n, c) === 'date'" v-if="getType(n, c) === 'date'"
v-bind="configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].props" v-bind="configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].props"
:placeholder="getPlaceholder(n, c)" :placeholder="getPlaceholder(n, c)"
value-format='yyyy-MM-ddTHH:mm:ss'
v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]" v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]"
:disabled="isDetail" /> :disabled="isDetail" />
</el-form-item> </el-form-item>
@ -97,6 +99,7 @@
color: btnColor[operate.name] color: btnColor[operate.name]
}" }"
@click="handleClick(operate)" @click="handleClick(operate)"
:disabled='isDisabled'
>{{ btnName[operate.name] }}</el-button >{{ btnName[operate.name] }}</el-button
> >
</template> </template>
@ -120,7 +123,7 @@ const title = {
// //
const btnType = { const btnType = {
add :'#0b58ff', add: '#0b58ff',
save: '#000', save: '#000',
update: '#0b58ff', update: '#0b58ff',
reset: '' reset: ''
@ -179,6 +182,8 @@ export default {
// }, // },
data() { data() {
return { return {
//
isDisabled: false,
COLUMN_PER_ROW, COLUMN_PER_ROW,
title, title,
/** 按钮相关属性 */ /** 按钮相关属性 */
@ -456,6 +461,7 @@ export default {
}, },
emitSelectChange(name, id) { emitSelectChange(name, id) {
// console.log(id)
const currentField = this.configs.fields.find((item) => item.name === name) const currentField = this.configs.fields.find((item) => item.name === name)
if (currentField.relatedField) { if (currentField.relatedField) {
this.dataForm[currentField.relatedField] = null this.dataForm[currentField.relatedField] = null
@ -476,7 +482,16 @@ export default {
/** 操作 */ /** 操作 */
switch (btn.name) { switch (btn.name) {
case 'save': case 'save':
this.isDisabled = true
setTimeout(() => {
this.isDisabled = false
}, 3000)
case 'update': case 'update':
this.isDisabled = true
setTimeout(() => {
this.isDisabled = false
}, 3000)
/** 需要验证表单的操作 */ /** 需要验证表单的操作 */
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (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> <template>
<!-- 数字代表多级表头最小列宽 -->
<!-- :width="opt.width || null" -->
<el-table-column <el-table-column
:label="opt.label ? opt.label : opt.name" :label="opt.label ? opt.label : opt.name"
:prop="opt.prop || null" :prop="opt.prop || null"
:width="opt.width || null" :width="flexColumnWidth(opt.prop || null)"
:min-width="opt.minWidth || null" :min-width="opt.minWidth || null"
:fixed="opt.fixed || null" :fixed="opt.fixed || null"
:show-overflow-tooltip="opt.showOverflowTooltip || false" :show-overflow-tooltip="opt.showOverflowTooltip || false"
@ -35,6 +45,33 @@ export default {
type: Object, type: Object,
default: () => ({}) 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> </script>

View File

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

View File

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

View File

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

View File

@ -4,7 +4,7 @@
* @Author: fzq * @Author: fzq
* @Date: 2022-11-25 09:51:46 * @Date: 2022-11-25 09:51:46
* @LastEditors: fzq * @LastEditors: fzq
* @LastEditTime: 2023-01-11 20:52:35 * @LastEditTime: 2023-02-01 09:39:37
*/ */
/** filters */ /** filters */
import moment from 'moment' import moment from 'moment'
@ -16,7 +16,7 @@ export const dictFilter = dictTypeId => {
} }
export const timeFilter = (val) => { 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) => { export const pick = (obj, paths) => {

View File

@ -46,7 +46,7 @@ export default {
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
// ref // ref
this.$store.state.contentTabs.splice(0, 1) this.$store.state.contentTabs.splice(0, 1)
// home$children // home$children
if (this.$route.meta.hiddenSiderbar !== true) { 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('11',this.$refs.tabs.$children[0].$refs.tabs[0])
// console.log('22',this.$store.state.contentTabs) // 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: { methods: {
// tabs, iframe // tabs, iframe

View File

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

View File

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

View File

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

View File

@ -23,7 +23,14 @@
</el-form-item> </el-form-item>
</el-form> </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 <el-pagination
@size-change="sizeChangeHandle" @size-change="sizeChangeHandle"
@current-change="currentChangeHandle" @current-change="currentChangeHandle"
@ -31,8 +38,7 @@
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
:page-size="pageSize" :page-size="pageSize"
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper">
>
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :configs="addOrUpdateConfigs" @refreshDataList="getDataList" @destory-dialog="handleDestroyDialog" /> <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: 'equipmentName', name: i18n.t('realtime.eqName') },
{ prop: 'equipmentCode', name: i18n.t('realtime.eqCode') }, { 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', prop: 'run',
name: i18n.t('realtime.runState'), name: i18n.t('realtime.runState'),
filter: val => { filter: (val) => {
if (val !== null && val !== undefined) return val ? '是' : '否' if (val !== null && val !== undefined) return val ? i18n.t('yes') : i18n.t('no')
} }
}, },
{ {
prop: 'status', prop: 'status',
name: i18n.t('realtime.state'), name: i18n.t('realtime.state'),
filter: val => { filter: (val) => {
if (val !== null && val !== undefined) return ['正常', '计划停机', '故障'][+val] if (val !== null && val !== undefined) return [i18n.t('normal'), i18n.t('planStop'), i18n.t('malfunction')][+val]
} }
}, },
{ {
prop: 'error', prop: 'error',
name: i18n.t('realtime.hasFault'), name: i18n.t('realtime.hasFault'),
filter: val => { filter: (val) => {
if (val !== null && val !== undefined) return val ? '是' : '否' if (val !== null && val !== undefined) return val ? i18n.t('yes') : i18n.t('no')
} }
}, },
{ prop: 'quantityTime', name: i18n.t('realtime.productionSnapshotTime'), filter: timeFilter }, { prop: 'quantityTime', name: i18n.t('realtime.productionSnapshotTime'), filter: timeFilter },
@ -137,8 +157,8 @@ export default {
// destroy dialog // destroy dialog
handleDestroyDialog() { handleDestroyDialog() {
setTimeout(() => { setTimeout(() => {
this.addOrUpdateVisible= false this.addOrUpdateVisible = false
}, /** after dialog animated */ 200); }, /** after dialog animated */ 200)
}, },
// //
getEqList() { getEqList() {
@ -231,7 +251,7 @@ export default {
deleteHandle(id) { deleteHandle(id) {
var ids = id var ids = id
? [id] ? [id]
: this.dataListSelections.map(item => { : this.dataListSelections.map((item) => {
return item.id return item.id
}) })
this.$confirm(`${i18n.t('prompt.info', { handle: id ? i18n.t('delete').toLowerCase() : i18n.t('deleteBatch').toLowerCase() })}`, i18n.t('prompt.title'), { 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-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.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-option v-for="factory in factoryList" :key="factory.id" :value="factory.id" :label="factory.name" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -124,8 +124,8 @@ const tableConfigs = [
{ {
name: i18n.t('eq.speedlost'), name: i18n.t('eq.speedlost'),
children: [ children: [
{ prop: 'realYield', name: i18n.t('eq.realyield'), 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: '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) + '%' } { 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() { getTimeRange() {
let startTime let startTime

View File

@ -2,15 +2,15 @@
/* /*
* @Author: lb * @Author: lb
* @Date: 2022-07-24 13:30:00 * @Date: 2022-07-24 13:30:00
* @LastEditTime: 2022-07-28 09:30:00 * @LastEditTime: 2023-02-02 15:02:52
* @LastEditors: lb * @LastEditors: fzq
* @Description: 设备效率分析-echarts图 * @Description: 设备效率分析-echarts图
*/ */
--> -->
<template> <template>
<div class="graph-area"> <div class="graph-area">
<span class="close-btn" @click="close"> <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" /> <path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
</svg> </svg>
</span> </span>
@ -21,12 +21,12 @@
<el-radio-button :label="$t('eq.time')" /> <el-radio-button :label="$t('eq.time')" />
</el-radio-group> </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-button v-for="(opt, index) in searchRadioOptions" :key="index" :label="opt" />
</el-radio-group> </el-radio-group>
</div> </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> </div>
</template> </template>
@ -131,6 +131,7 @@ export default {
this.config.setTitle(this.injectData.equipmentName + i18n.t('eq.timetrend')) this.config.setTitle(this.injectData.equipmentName + i18n.t('eq.timetrend'))
await this.getList() await this.getList()
this.setLegend() this.setLegend()
// console.log('this.dataType',this.dataType);
}, },
init(data) { init(data) {
@ -181,14 +182,14 @@ export default {
getList() { getList() {
const params = this.makeQuerys() const params = this.makeQuerys()
// //
return this.getOEE(params).then(datalist => { return this.getOEE(params).then((datalist) => {
console.log('getOEE res:', datalist) console.log('getOEE res:', datalist)
this.timeList.splice(0) this.timeList.splice(0)
this.rateList.splice(0) this.rateList.splice(0)
this.xAxis.splice(0) this.xAxis.splice(0)
if (datalist.length) { if (datalist.length) {
// //
datalist.map(item => { datalist.map((item) => {
const time = moment(item.time) const time = moment(item.time)
if (this.searchType === i18n.t('eq.monthgap')) { if (this.searchType === i18n.t('eq.monthgap')) {
this.xAxis.push(`${time.year()}${i18n.t('eq.year')}${time.month() + 1}${i18n.t('eq.month')}`) 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 workTimeList = []
const stopTimeList = [] const stopTimeList = []
const downTimeList = [] const downTimeList = []
this.timeList.map(item => { this.timeList.map((item) => {
workTimeList.push(item.workTime) workTimeList.push(item.workTime)
stopTimeList.push(item.stopTime) stopTimeList.push(item.stopTime)
downTimeList.push(item.downTime) downTimeList.push(item.downTime)
@ -260,7 +261,7 @@ export default {
const timeEfficiencyList = [] const timeEfficiencyList = []
const oeeList = [] const oeeList = []
const teepList = [] const teepList = []
this.rateList.map(item => { this.rateList.map((item) => {
workRateList.push(item.workRate) workRateList.push(item.workRate)
stopRateList.push(item.stopRate) stopRateList.push(item.stopRate)
downRateList.push(item.downRate) downRateList.push(item.downRate)
@ -283,6 +284,18 @@ export default {
// //
renderGraph() { 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)) console.log('latest config: ', JSON.stringify(this.config))
this.$nextTick(() => { this.$nextTick(() => {
// this.chart.setOption(this.config) // this.chart.setOption(this.config)

View File

@ -70,7 +70,7 @@ const tableConfigs = [
const addOrUpdateConfigs = { const addOrUpdateConfigs = {
type: 'dialog', type: 'dialog',
infoUrl: '/monitoring/equipmentGroup', 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: [ operations: [
{ name: 'cancel', showAlways: true }, { name: 'cancel', showAlways: true },
{ name: 'save', url: '/monitoring/equipmentGroup', permission: 'monitoring:equipmentgroup:save', showOnEdit: false }, { name: 'save', url: '/monitoring/equipmentGroup', permission: 'monitoring:equipmentgroup:save', showOnEdit: false },

View File

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

View File

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

View File

@ -143,7 +143,9 @@ const addOrUpdateConfigs = {
relatedField: 'productId', relatedField: 'productId',
tableConfigs: [ tableConfigs: [
{ type: 'index', width: 100, name: i18n.t('index') }, { 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: '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: 'code', name: i18n.t('attrValue'), formField: true },
{ 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'] }

View File

@ -38,7 +38,7 @@
v-if="addOrUpdateVisible" v-if="addOrUpdateVisible"
ref="addOrUpdate" ref="addOrUpdate"
:configs="addOrUpdateConfigs" :configs="addOrUpdateConfigs"
@refreshDataList="getDataList" @refreshDataList="addSuccess"
@select-change="handleDialogSelectChange" @select-change="handleDialogSelectChange"
@destory-dialog="handleDestroyDialog" /> @destory-dialog="handleDestroyDialog" />
</div> </div>
@ -92,7 +92,7 @@ const addOrUpdateConfigs = {
fields: [ fields: [
// { name: 'productionId', label: i18n.t('eq.name'), required: true }, // { name: 'productionId', label: i18n.t('eq.name'), required: true },
{ name: 'productionId', label: i18n.t('pl.title'), required: true, type: 'select', options: [], relatedField: 'sectionId' }, { 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: 'model', label: i18n.t('andeng.btnBoxModel') },
{ {
// name: 'keyValue', // name: 'keyValue',
@ -215,6 +215,7 @@ export default {
methods: { methods: {
// destroy dialog // destroy dialog
handleDestroyDialog() { handleDestroyDialog() {
this.$set(this.addOrUpdateConfigs.fields[1], 'isDisabled', true)
setTimeout(() => { setTimeout(() => {
this.addOrUpdateVisible = false this.addOrUpdateVisible = false
}, /** after dialog animated */ 200) }, /** after dialog animated */ 200)
@ -332,8 +333,7 @@ export default {
this.addOrUpdateConfigs.fields.forEach((item) => { this.addOrUpdateConfigs.fields.forEach((item) => {
// console.log('item',item) // console.log('item',item)
// console.log('res',res) // console.log('res',res)
if (item.name === 'inspectionDetContent') if (item.name === 'inspectionDetContent') item.options = res.data.list.map((item) => ({ label: item.content, value: item.content, inspectionDetId: item.code }))
item.options = res.data.list.map((item) => ({ label: item.content, value: item.content, inspectionDetId: item.code }))
// console.log('item',item) // console.log('item',item)
}) })
} else { } else {
@ -359,10 +359,19 @@ export default {
this.dataListSelections = val this.dataListSelections = val
}, },
// //
handleDialogSelectChange({ name, id }) { async handleDialogSelectChange({ name, id }) {
switch (name) { switch (name) {
case 'productionId': 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': case 'inspectionDetContent':
// this.dataForm.inspectionDetId = id // this.dataForm.inspectionDetId = id
// console.log(id) // console.log(id)
@ -377,6 +386,11 @@ export default {
console.log('addOrUpdateConfigs', this.addOrUpdateConfigs.fields) 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 }) { handleOperations({ type, data: id }) {
switch (type) { switch (type) {
case 'view-detail': 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 :inline="true" :model="dataForm" @keyup.enter.native="currentChangeHandle(1)" class="blueTip" size="small">
<el-form-item> <el-form-item>
{{ $t('pl.title') }} {{ $t('pl.title') }}
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-select v-model="dataForm.lineId" :placeholder="$t('pl.title')" clearable filterable> <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" /> <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>
<el-form-item> <el-form-item>
{{ $t('inspect.det') }} {{ $t('inspect.det') }}
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" :placeholder="$t('inspect.det')" clearable></el-input> <el-input v-model="dataForm.key" :placeholder="$t('inspect.det')" clearable></el-input>
</el-form-item> </el-form-item>
@ -22,7 +22,7 @@
</el-form> </el-form>
<base-table <base-table
:top-btn-config="topBtnConfig" :top-btn-config="topBtnConfig"
:page="pageIndex" :page="pageIndex"
:size="pageSize" :size="pageSize"
:data="dataList" :data="dataList"
@ -30,8 +30,7 @@
:max-height="calcMaxHeight(8)" :max-height="calcMaxHeight(8)"
@operate-event="handleOperations" @operate-event="handleOperations"
@refreshDataList="getDataList" @refreshDataList="getDataList"
@clickTopBtn="clickTopBtn" @clickTopBtn="clickTopBtn" />
/>
<el-pagination <el-pagination
@size-change="sizeChangeHandle" @size-change="sizeChangeHandle"
@ -40,8 +39,7 @@
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
:page-size="pageSize" :page-size="pageSize"
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper">
>
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
@ -49,10 +47,9 @@
v-if="addOrUpdateVisible" v-if="addOrUpdateVisible"
ref="addOrUpdate" ref="addOrUpdate"
:configs="addOrUpdateConfigs" :configs="addOrUpdateConfigs"
@refreshDataList="getDataList" @refreshDataList="addSuccess"
@destory-dialog="handleDestroyDialog" @destory-dialog="handleDestroyDialog"
@select-change="handleSelectChange" @select-change="handleSelectChange" />
/>
</div> </div>
</template> </template>
@ -87,7 +84,7 @@ const tableConfigs = [
// { prop: 'productionId', name: i18n.t('pl.id') }, // { prop: 'productionId', name: i18n.t('pl.id') },
// { prop: 'sectionId', name: i18n.t('ws.id') }, // { prop: 'sectionId', name: i18n.t('ws.id') },
{ prop: 'checkPerson', name: i18n.t('inspect.people') }, { 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: 'explainText', name: i18n.t('desc') },
{ prop: 'remark', name: i18n.t('remark') }, { prop: 'remark', name: i18n.t('remark') },
{ 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'] }
@ -98,8 +95,23 @@ const addOrUpdateConfigs = {
infoUrl: '/monitoring/qualityInspectionRecord', infoUrl: '/monitoring/qualityInspectionRecord',
fields: [ 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: { 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: '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', name: 'source',
label: i18n.t('source'), label: i18n.t('source'),
@ -155,15 +167,29 @@ export default {
methods: { methods: {
// destroy dialog // destroy dialog
handleDestroyDialog() { handleDestroyDialog() {
this.$set(this.addOrUpdateConfigs.fields[2], 'isDisabled', true)
setTimeout(() => { setTimeout(() => {
this.addOrUpdateVisible = false this.addOrUpdateVisible = false
}, /** after dialog animated */ 200) }, /** after dialog animated */ 200)
}, },
// handle // handle
async handleSelectChange({ name, id }) { async handleSelectChange({ name, id }) {
// console.log('this',this)
if (name === 'productionId') { 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) 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 }) => { }).then(({ data: res }) => {
console.log('insdet:', 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) { 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'), url: this.$http.adornUrl('/monitoring/productionLine/list'),
method: 'get' method: 'get'
}).then(({ data: res }) => { }).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) { 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) { if (res.data.total === 0) {
this.$message.error(i18n.t('errors.nosection')) this.$message.error(i18n.t('errors.nosection'))
} else { } else {
// console.log('da',this.dataForm);
this.$message.success(i18n.t('errors.numsection', { num: res.data.total })) 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) { 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() { getDataList() {
this.addOrUpdateVisible = false this.addOrUpdateVisible = false
@ -245,6 +279,7 @@ export default {
method: 'get', method: 'get',
params: this.$http.adornParams(queryParams) params: this.$http.adornParams(queryParams)
}).then(({ data }) => { }).then(({ data }) => {
// console.log('data', data)
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
@ -295,7 +330,7 @@ export default {
deleteHandle(id) { deleteHandle(id) {
var ids = id var ids = id
? [id] ? [id]
: this.dataListSelections.map(item => { : this.dataListSelections.map((item) => {
return item.id return item.id
}) })
this.$confirm(`${i18n.t('prompt.info', { handle: id ? i18n.t('delete').toLowerCase() : i18n.t('deleteBatch').toLowerCase() })}`, i18n.t('prompt.title'), { 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 * @Author: lb
* @Date: 2022-06-22 14:00:17 * @Date: 2022-06-22 14:00:17
* @LastEditors: fzq * @LastEditors: fzq
* @LastEditTime: 2023-01-03 10:18:14 * @LastEditTime: 2023-02-02 17:19:10
* @Description: 设备生产实时数据 * @Description: 设备生产实时数据
--> -->
<template> <template>
@ -130,7 +130,7 @@ export default {
if (obj.recordTime) { if (obj.recordTime) {
// obj.recordTime // obj.recordTime
this.tableProps.push({ 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: [ children: [
{ prop: obj.recordTime + '-inputNum', label: i18n.t('realtime.in') }, { 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') },

View File

@ -1,8 +1,8 @@
<!-- <!--
* @Author: lb * @Author: lb
* @Date: 2022-06-22 14:00:17 * @Date: 2022-06-22 14:00:17
* @LastEditors: lb * @LastEditors: fzq
* @LastEditTime: 2022-06-22 14:00:17 * @LastEditTime: 2023-02-02 17:17:45
* @Description: 产线生产实时数据 * @Description: 产线生产实时数据
--> -->
<template> <template>
@ -109,7 +109,7 @@ export default {
// Step2: props // Step2: props
if (!this.dynamicPropSet) { if (!this.dynamicPropSet) {
this.tableProps.push({ 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: [ children: [
{ prop: obj.recordTime + '-inputNum', label: i18n.t('realtime.in') }, { 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') },

View File

@ -138,14 +138,14 @@ export default {
// props // props
for (const key of sortedTime) { for (const key of sortedTime) {
// const prop = { label: key, children: [] } // 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]) { for (const subKey in timeMap[key]) {
prop.children.push({ label: subKey, prop: key + subKey }) prop.children.push({ label: subKey, prop: key + subKey })
} }
dynamicPropNames.push(prop) 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: [ fields: [
{ name: 'name', required: true, label: i18n.t('ws.name') }, { name: 'name', required: true, label: i18n.t('ws.name') },
{ name: 'code', required: true, label: i18n.t('ws.code'), api: '/monitoring/workshopSection/getCode' }, { 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', 'description',
'remark' 'remark'
], ],

View File

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

View File

@ -17,9 +17,9 @@
<el-form-item> <el-form-item>
<el-button class="buttonColor" @click="getDataList()">{{ $t('query') }}</el-button> <el-button class="buttonColor" @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item> </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-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-form-item>
<el-button v-if="$hasPermission('sys:dict:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> <el-button v-if="$hasPermission('sys:dict:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item> </el-form-item>

View File

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

View File

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