diff --git a/src/components/base-dialog/addOrUpdate/index.vue b/src/components/base-dialog/addOrUpdate/index.vue index 9d8177e..b95c620 100644 --- a/src/components/base-dialog/addOrUpdate/index.vue +++ b/src/components/base-dialog/addOrUpdate/index.vue @@ -47,6 +47,7 @@ :options="configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].options" :props="configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].props" :disabled="isDetail" + clearable /> - + - - + + - - - + + + - + - + @@ -76,39 +82,39 @@ const tableConfigs = [ { // name: i18n.t('createTime'), prop: 'factoryName', - name: '工厂' + name: i18n.t('factory.title') }, - { prop: 'pdName', name: '产线' }, - { prop: 'wsName', name: '工段' }, - { prop: 'eqName', name: '设备' }, + { prop: 'pdName', name: i18n.t('pl.title') }, + { prop: 'wsName', name: i18n.t('ws.title') }, + { prop: 'eqName', name: i18n.t('eq.title') }, { - name: '有效时间(h)', + name: i18n.t('eq.efficienttimeh'), children: [ - { prop: 'workTime', name: '工作时长(h)', width: 120, filter: val => `${val} 小时` }, - { prop: 'workRate', name: '工作时长比率', width: 120, filter: val => (val * 100).toFixed(2) + '%' } + { prop: 'workTime', name: i18n.t('eq.worktimeh'), width: 120, filter: val => `${val} `+i18n.t('hour') }, + { prop: 'workRate', name: i18n.t('eq.workdurationratio'), width: 120, filter: val => (val * 100).toFixed(2) + '%' } ] }, { - name: '关机时间(h)', + name: i18n.t('eq.shutdowntimeh'), children: [ - { prop: 'stopTime', name: '停机时长(h)', width: 120, filter: val => `${val} 小时` }, - { prop: 'stopRate', name: '停机比率', width: 120, filter: val => (val * 100).toFixed(2) + '%' } + { prop: 'stopTime', name: i18n.t('eq.stoptimeh'), width: 120, filter: val => `${val} `+i18n.t('hour') }, + { prop: 'stopRate', name: i18n.t('eq.stopratio'), width: 120, filter: val => (val * 100).toFixed(2) + '%' } ] }, { - name: '中断损失', + name: i18n.t('eq.stoplost'), children: [ - { prop: 'downTime', name: '故障时长(h)', width: 120, filter: val => `${val} 小时` }, - { prop: 'downRate', name: '故障比率', width: 120, filter: val => (val * 100).toFixed(2) + '%' }, - { prop: 'timeEfficiency', name: '时间开动率', width: 120, filter: val => (val * 100).toFixed(2) + '%' } + { prop: 'downTime', name: i18n.t('eq.downtimeh'), width: 120, filter: val => `${val} `+i18n.t('hour') }, + { prop: 'downRate', name: i18n.t('eq.downrate'), width: 120, filter: val => (val * 100).toFixed(2) + '%' }, + { prop: 'timeEfficiency', name: i18n.t('eq.timeefficiency'), width: 120, filter: val => (val * 100).toFixed(2) + '%' } ] }, { - name: '速度损失', + name: i18n.t('eq.speedlost'), children: [ - { prop: 'realYield', name: '实际加工速度', width: 120, filter: val => `${val} 小时` }, - { prop: 'designYield', name: '理论加工速度', width: 120, filter: val => `${val} 小时` }, - { prop: 'peEfficiency', name: '速度开动率', width: 120, filter: val => (val * 100).toFixed(2) + '%' } + { 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) + '%' } ] }, { @@ -129,7 +135,7 @@ const tableConfigs = [ subcomponent: TableTextComponent, // options: ['edit', 'delete'] // options: ['view-trend'] // 查看趋势 - buttonContent: '查看趋势', + buttonContent: i18n.t('eq.viewtrend'), actionName: 'view-trend', emitFullData: true } diff --git a/src/views/modules/monitoring/equipmentEfficiencyGraph.vue b/src/views/modules/monitoring/equipmentEfficiencyGraph.vue index cb2b236..08b6e37 100644 --- a/src/views/modules/monitoring/equipmentEfficiencyGraph.vue +++ b/src/views/modules/monitoring/equipmentEfficiencyGraph.vue @@ -17,8 +17,8 @@
- - + + @@ -34,12 +34,13 @@ import * as echarts from 'echarts' import moment from 'moment' import { pick } from 'lodash/object' +import i18n from '../../../i18n' class EchartConfigs { constructor() { this.color = ['#e91e63', '#4caf50', '#3f51b5', '#ffc107', '#607d8b'] this.title = { - text: '时间区间走势', + text: i18n.t('eq.timetrend'), top: 0, left: 'center', textStyle: { @@ -113,10 +114,10 @@ export default { props: {}, data() { return { - searchType: '无间隔', - searchRadioOptions: ['无间隔', '按月', '按周', '按天'], - dataType: '时间', - dataRadioOptions: ['时间', '百分比'], + searchType: i18n.t('eq.nogap'), + searchRadioOptions: [i18n.t('eq.nogap'), i18n.t('eq.monthgap'), i18n.t('eq.weekgap'), i18n.t('eq.daygap')], + dataType: i18n.t('eq.time'), + dataRadioOptions: [i18n.t('eq.time'), i18n.t('eq.ratio')], config: new EchartConfigs(), chart: null, rateList: [], // 对请求来的数据分流 @@ -127,7 +128,7 @@ export default { }, methods: { async initChart() { - this.config.setTitle(this.injectData.equipmentName + '时间区间走势') + this.config.setTitle(this.injectData.equipmentName + i18n.t('eq.timetrend')) await this.getList() this.setLegend() }, @@ -146,11 +147,11 @@ export default { makeQuerys() { const searchTypeMap = { - 无间隔: 1, - 按月: 2, - 按周: 3, - 按天: 4, - 按小时: 5 + [i18n.t('eq.nogap')]: 1, + [i18n.t('eq.monthgap')]: 2, + [i18n.t('eq.weekgap')]: 3, + [i18n.t('eq.daygap')]: 4, + [i18n.t('eq.hourgap')]: 5 } return { @@ -189,11 +190,11 @@ export default { // 分流 datalist.map(item => { const time = moment(item.time) - if (this.searchType === '按月') { - this.xAxis.push(`${time.year()}年${time.month() + 1}月`) - } else if (this.searchType === '按周') { + if (this.searchType === i18n.t('eq.monthgap')) { + this.xAxis.push(`${time.year()}${i18n.t('eq.year')}${time.month() + 1}${i18n.t('eq.month')}`) + } else if (this.searchType === i18n.t('eq.weekgap')) { this.xAxis.push(`${time.format('YYYY-MM-DD')}`) - } else if (this.searchType === '按天') { + } else if (this.searchType === i18n.t('eq.daygap')) { this.xAxis.push(`${time.format('YY-M-D')}`) } else { this.xAxis.push(`${time.format('YYYY-MM-DD')}`) @@ -218,8 +219,16 @@ export default { setLegend() { // 设置legend const legendMap = { - 百分比: ['工作时长比率', '停机时长比率', '故障时长比率', '速度开动率', '时间开动率', 'OEE', 'TEEP'], - 时间: ['工作时长', '停机时长', '故障时长'] + [i18n.t('eq.ratio')]: [ + i18n.t('eq.workdurationratio'), + i18n.t('eq.stopdurationratio'), + i18n.t('eq.downdurationratio'), + i18n.t('eq.speedefficiency'), + i18n.t('eq.timeefficiency'), + 'OEE', + 'TEEP' + ], + [i18n.t('eq.time')]: [i18n.t('eq.worktime'), i18n.t('eq.stoptime'), i18n.t('eq.downtime')] } this.config.setLegend(legendMap[this.dataType]) this.setData() @@ -228,7 +237,7 @@ export default { }, setData() { - if (this.dataType === '时间') { + if (this.dataType === i18n.t('eq.time')) { const workTimeList = [] const stopTimeList = [] const downTimeList = [] @@ -238,9 +247,9 @@ export default { downTimeList.push(item.downTime) }) this.config.setSeries([ - { name: '工作时长', type: 'bar', data: workTimeList }, - { name: '停机时长', type: 'bar', data: stopTimeList }, - { name: '故障时长', type: 'bar', data: downTimeList } + { name: i18n.t('eq.worktime'), type: 'bar', data: workTimeList }, + { name: i18n.t('eq.stoptime'), type: 'bar', data: stopTimeList }, + { name: i18n.t('eq.downtime'), type: 'bar', data: downTimeList } ]) } else { // 百分比 @@ -261,11 +270,11 @@ export default { teepList.push(item.teep) }) this.config.setSeries([ - { name: '工作时长比率', type: 'bar', data: workRateList }, - { name: '停机时长比率', type: 'bar', data: stopRateList }, - { name: '故障时长比率', type: 'bar', data: downRateList }, - { name: '速度开动率', type: 'bar', data: peEfficiencyList }, - { name: '时间开动率', type: 'bar', data: timeEfficiencyList }, + { name: i18n.t('eq.workdurationratio'), type: 'bar', data: workRateList }, + { name: i18n.t('eq.stopdurationratio'), type: 'bar', data: stopRateList }, + { name: i18n.t('eq.downdurationratio'), type: 'bar', data: downRateList }, + { name: i18n.t('eq.speedefficiency'), type: 'bar', data: peEfficiencyList }, + { name: i18n.t('eq.timeefficiency'), type: 'bar', data: timeEfficiencyList }, { name: 'OEE', type: 'bar', data: oeeList }, { name: 'TEEP', type: 'bar', data: teepList } ]) @@ -278,8 +287,8 @@ export default { this.$nextTick(() => { // this.chart.setOption(this.config) this.chart.setOption(this.config, { - notMerge: true - }) + notMerge: true + }) }) } } diff --git a/src/views/modules/monitoring/equipmentException.vue b/src/views/modules/monitoring/equipmentException.vue index 5461f18..e557cd4 100644 --- a/src/views/modules/monitoring/equipmentException.vue +++ b/src/views/modules/monitoring/equipmentException.vue @@ -4,11 +4,11 @@ - + - + @@ -49,14 +49,14 @@ const tableConfigs = [ name: i18n.t('index') }, // { prop: 'time', name: '时间', filter: timeFilter }, - { prop: 'pdName', name: '产线名称' }, - { prop: 'wsName', name: '工序' }, - { prop: 'eqName', name: '设备' }, - { prop: 'mtbf', name: '平均故障间隔时间[MTBF] (h)', width: 220 }, - { prop: 'mttr', name: '平均维修时间[MTTR] (h)', width: 190 }, - { prop: 'workTime', name: '工作时长 (h)' }, - { prop: 'downTime', name: '故障时长 (h)' }, - { prop: 'downCount', name: '故障次数' }, + { prop: 'pdName', name: i18n.t('pl.name') }, + { prop: 'wsName', name: i18n.t('ws.title') }, + { prop: 'eqName', name: i18n.t('eq.title') }, + { prop: 'mtbf', name: i18n.t('eq.mtbf'), width: 220 }, + { prop: 'mttr', name: i18n.t('eq.mttr'), width: 190 }, + { prop: 'workTime', name: i18n.t('eq.worktimeh') }, + { prop: 'downTime', name: i18n.t('eq.downtimeh') }, + { prop: 'downCount', name: i18n.t('eq.downcount') } // { // prop: 'operations', // name: i18n.t('handle'), diff --git a/src/views/modules/monitoring/equipmentGroupAlarm.vue b/src/views/modules/monitoring/equipmentGroupAlarm.vue index 3ced25a..7fef725 100644 --- a/src/views/modules/monitoring/equipmentGroupAlarm.vue +++ b/src/views/modules/monitoring/equipmentGroupAlarm.vue @@ -76,7 +76,9 @@ const tableConfigs = [ { prop: 'typeDictValue', name: i18n.t('alarm.type'), filter: dictFilter(dictEntries.alarmType.value) }, { prop: 'gradeDictValue', name: i18n.t('alarm.level'), filter: dictFilter(dictEntries.alarmLevel.value) }, { prop: 'alarmContent', name: i18n.t('alarm.content') }, - { prop: 'externalCode', name: i18n.t('alarm.externalCode') }, + // { prop: 'externalCode', name: i18n.t('alarm.externalCode') }, + { prop: 'description', name: i18n.t('alarm.description') }, + { prop: 'remark', name: i18n.t('alarm.remark') }, { prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] } ] @@ -88,7 +90,9 @@ const addOrUpdateConfigs = { { name: 'typeDictValue', label: i18n.t('alarm.type'), type: 'select', options: [] }, { name: 'gradeDictValue', label: i18n.t('alarm.level'), type: 'select', options: [] }, { name: 'alarmContent', label: i18n.t('alarm.content'), required: true }, - { name: 'externalCode', label: i18n.t('alarm.externalCode') } + { name: 'description', label: i18n.t('alarm.description') }, + { name: 'remark', label: i18n.t('alarm.remark') } + // { name: 'externalCode', label: i18n.t('alarm.externalCode') } ], operations: [ { name: 'cancel', showAlways: true }, diff --git a/src/views/modules/monitoring/productionLine.vue b/src/views/modules/monitoring/productionLine.vue index a35a31d..3f1c42f 100644 --- a/src/views/modules/monitoring/productionLine.vue +++ b/src/views/modules/monitoring/productionLine.vue @@ -52,7 +52,7 @@ const tableConfigs = [ { prop: 'factoryName', name: i18n.t('factory.title') }, { prop: 'name', name: i18n.t('pl.name') }, { prop: 'code', name: i18n.t('pl.code') }, - { prop: 'status', name: i18n.t('pl.status') }, + { prop: 'status', name: i18n.t('pl.status'), filter: val => (val === 0 || val === 1 || val === 2) && ['停止', '运行', '未知'][val] }, { prop: 'description', name: i18n.t('desc') }, { prop: 'remark', name: i18n.t('remark') }, { prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] } diff --git a/src/views/modules/monitoring/qualityInspectionBoxBtn.vue b/src/views/modules/monitoring/qualityInspectionBoxBtn.vue new file mode 100644 index 0000000..33674ce --- /dev/null +++ b/src/views/modules/monitoring/qualityInspectionBoxBtn.vue @@ -0,0 +1,368 @@ + + +