15 Commits

Author SHA1 Message Date
e117388027 24小时设备数据-报废数据删除,质量管理-监测统计数据-按时间查询 2023-09-28 13:48:40 +05:30
5511837e90 更新质量模块 2023-09-28 10:09:45 +05:30
755ad9df30 下片更新 2023-09-22 17:20:53 +05:30
101eac890c 创建厂务管理/下片检测和详情页面 2023-09-21 20:00:05 +05:30
Fanzink
6815ac4cc4 '修改设备与PLC关联-新增-下拉框条数' 2023-09-12 12:44:54 +05:30
Fanzink
4ffbdaef8a '设备与PLC,设备获取所有' 2023-04-22 10:51:10 +05:30
Fanzink
b1ab1962b1 '厂务设备参数修改设备列表size,设备分析状态监控去掉默认产线工厂' 2023-04-18 09:48:13 +05:30
Fanzink
db47bffb18 '修改日期选择器样式文件index.css' 2023-03-30 11:28:14 +05:30
Fanzink
5afadfb1ce '数据分析bug修改2次' 2023-03-24 17:23:26 +05:30
Fanzink
e0d4e5327f '改数据分析bug' 2023-03-23 11:31:59 +05:30
Fanzink
3da95fed21 '修改数据分析/产品质量分析和产量分析' 2023-03-18 13:58:14 +05:30
Fanzink
683fc9169a '数据分析-产量分析,产品质量分析,设备产量时序图' 2023-03-14 15:24:30 +05:30
Fanzink
bc4cfdc990 'update' 2023-02-13 17:09:10 +08:00
Fanzink
0b5740d41c 'update' 2023-02-09 15:06:33 +08:00
Fanzink
41e680b55d 'update'' 2023-02-09 10:31:00 +08:00
62 changed files with 3876 additions and 437 deletions

View File

@@ -3,8 +3,8 @@
* @version:
* @Author: fzq
* @Date: 2022-11-25 09:51:46
* @LastEditors: fzq
* @LastEditTime: 2023-02-07 16:19:50
* @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
* @LastEditTime: 2023-09-20 11:15:04
-->
<!DOCTYPE html>
<html>
@@ -39,25 +39,30 @@
<!-- 开发环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
<script>
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.8';
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.8';
// window.SITE_CONFIG['apiURL'] = 'http://india.mes.picaiba.com/';
window.SITE_CONFIG['apiURL'] = 'http://127.0.0.1:8080/';
</script>
<% } %>
<!-- 集成测试环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod:sit') { %>
<script>
window.SITE_CONFIG['apiURL'] = 'http://india.mes.picaiba.com/';
// window.SITE_CONFIG['apiURL'] = 'http://india.mes.picaiba.com/';
window.SITE_CONFIG['apiURL'] = 'http://127.0.0.1:8080/';
</script>
<% } %>
<!-- 验收测试环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod:uat') { %>
<script>
window.SITE_CONFIG['apiURL'] = 'http://india.mes.picaiba.com/';
// window.SITE_CONFIG['apiURL'] = 'http://india.mes.picaiba.com/';
window.SITE_CONFIG['apiURL'] = 'http://127.0.0.1:8080/';
</script>
<% } %>
<!-- 生产环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod') { %>
<script>
window.SITE_CONFIG['apiURL'] = 'http://india.mes.picaiba.com/';
// window.SITE_CONFIG['apiURL'] = 'http://india.mes.picaiba.com/';
window.SITE_CONFIG['apiURL'] = 'http://127.0.0.1:8080/';
</script>
<% } %>
</head>

View File

@@ -543,7 +543,8 @@ img {
.el-menu-item.is-active,
.el-submenu.is-active > .el-submenu__title {
// color: mix(#fff, $sidebar--text-color-dark, 80%);
color: #409EFF;
// color: #409EFF;
color: #0B58FF;
}
}
}

View File

@@ -359,7 +359,7 @@ export default {
}).then(({ data: res }) => {
if (res && res.code === 0) {
const dataFormKeys = Object.keys(this.dataForm)
console.log('data form keys: ', dataFormKeys, pick(res.data, dataFormKeys))
// console.log('data form keys: ', dataFormKeys, pick(res.data, dataFormKeys))
this.dataForm = pick(res.data, dataFormKeys)
// LABEL: FILE_RELATED

View File

@@ -1,10 +1,12 @@
<template>
<div class="attr-form">
<h3>
{{ title }} <el-button style="margin-left: 8px;" type="text" v-if="!isDetail && !showAddAttr" @click="showAddAttr = true">{{ $t('add') }}</el-button>
<!-- <el-button style="margin-left: 8px" type="text" v-if="!isDetail && !showAddAttr" @click="showAddAttr = true">{{ $t('add') }}</el-button> 跟在{{ title }} 同行后面 -->
{{ title }}
</h3>
<div v-if="!showAddAttr">
<component
:top-btn-config="topBtnConfig"
key="sub-table"
:is="require('../../base-table/index.vue').default"
:table-head-configs="filterTableConfigs()"
@@ -12,8 +14,8 @@
:page="pageIndex"
:size="pageSize"
:max-height="calcMaxHeight(8)"
@operate-event="handleOperations"
/>
@clickTopBtn="clickTopBtn"
@operate-event="handleOperations" />
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
@@ -21,15 +23,14 @@
:page-sizes="[5, 10, 20, 50]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
>
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</div>
<div v-else style="background: #eee; border-radius: 8px; padding: 12px;">
<div v-else style="background: #eee; border-radius: 8px; padding: 12px">
<el-row>
<el-col>
<el-form ref="AttrForm" :model="AttrForm" :rules="AttrFormRules" :inline="true" label-position="top">
<el-row :gutter="20" style="padding: 0 24px;">
<el-row :gutter="20" style="padding: 0 24px">
<el-col :span="attrFormFields.length > 6 ? 6 : 12" v-for="field in attrFormFields" :key="field.prop + 'col'">
<el-form-item :key="field.prop" :prop="field.prop" :label="field.name" style="width: 100%">
<el-input v-if="field.formType === 'input' || !field.formType" v-model="AttrForm[field.prop]" :placeholder="$t('hints.input')" clearable />
@@ -43,7 +44,7 @@
</el-form>
</el-col>
</el-row>
<el-row style="text-align: right;">
<el-row style="text-align: right">
<el-button size="small" @click="handleCloseAttrForm">{{ $t('cancel') }}</el-button>
<el-button type="success" size="small" @click="handleSaveAttrForm">{{ $t('save') }}</el-button>
</el-row>
@@ -56,6 +57,12 @@ import i18n from '@/i18n'
import BaseTable from '@/components/base-table'
import { pick } from 'lodash/object'
import { calcMaxHeight } from '@/utils'
const topBtnConfig = [
{
type: 'add',
btnName: i18n.t('add')
}
]
export default {
name: 'AttrForm',
components: { BaseTable },
@@ -96,6 +103,7 @@ export default {
data() {
return {
calcMaxHeight,
topBtnConfig,
showAddAttr: false,
dataList: [],
pageIndex: 1,
@@ -107,9 +115,9 @@ export default {
},
computed: {
attrFormFields() {
const _ = this.tableConfigs.filter(item => item.formField)
const _ = this.tableConfigs.filter((item) => item.formField)
/** 顺带配置 AttrForm */
_.forEach(item => {
_.forEach((item) => {
this.$set(this.AttrForm, [item.prop], '')
})
@@ -126,11 +134,17 @@ export default {
}
}
},
// 加个created来实现不能在topBtnConfig组件直接使用的? : 判别
created() {
// if(!(!this.isDetail && !this.showAddAttr)) {
// this.topBtnConfig = []
// }
},
methods: {
filterTableConfigs() {
if (this.isDetail) {
/** 如果是查看详情,就屏蔽操作列 */
return this.tableConfigs.filter(opt => opt.prop !== 'operations')
return this.tableConfigs.filter((opt) => opt.prop !== 'operations')
}
return this.tableConfigs
},
@@ -182,7 +196,7 @@ export default {
this.$nextTick(() => {
this.$http.get(this.$http.adornUrl(`${this.url}/${id}`)).then(({ data: res }) => {
if (res && res.code === 0 && res.data) {
const neededFields = [...this.attrFormFields.map(item => item.prop), 'id']
const neededFields = [...this.attrFormFields.map((item) => item.prop), 'id']
const filtered = pick(res.data, neededFields)
for (let field of neededFields) {
this.AttrForm[field] = filtered[field]
@@ -231,7 +245,7 @@ export default {
},
handleSaveAttrForm() {
this.$refs['AttrForm'].validate(valid => {
this.$refs['AttrForm'].validate((valid) => {
if (valid) {
this.$http({
// url: this.$http.adornUrl(`${this.url}/${!this.AttrForm.id ? '' : this.AttrForm.id}`),
@@ -271,6 +285,9 @@ export default {
currentChangeHandle(val) {
this.pageIndex = val
this.getDataList()
},
clickTopBtn() {
this.showAddAttr = true
}
}
}

View File

@@ -126,7 +126,7 @@ const title = {
// 或者也可以改造成自定义颜色:
const btnType = {
add: '#0b58ff',
save: '#000',
save: '#0b58ff',
update: '#0b58ff',
reset: ''
// cancel: 'text'
@@ -184,6 +184,8 @@ export default {
// },
data() {
return {
//按钮盒用
idMark: 1,
// 按钮防重复点击
isDisabled: false,
COLUMN_PER_ROW,
@@ -411,10 +413,10 @@ export default {
}).then(({ data: res }) => {
if (res && res.code === 0) {
const dataFormKeys = Object.keys(this.dataForm)
console.log('keys ===> ', dataFormKeys)
// console.log('keys ===> ', dataFormKeys)
// console.log('data form keys: ', dataFormKeys, pick(res.data, dataFormKeys))
this.dataForm = __pick(res.data, dataFormKeys)
console.log('pick(res.data, dataFormKeys) ===> ', __pick(res.data, dataFormKeys))
// console.log('pick(res.data, dataFormKeys) ===> ', __pick(res.data, dataFormKeys))
// LABEL: FILE_RELATED
/** 对文件下载进行分流 */
this.fileList = {}
@@ -469,6 +471,9 @@ export default {
this.dataForm[currentField.relatedField] = null
}
this.$emit('select-change', { name, id })
//按钮盒页面用
this.idMark = id
},
handleEditorReady(val) {},
@@ -510,9 +515,19 @@ export default {
}
this.$set(this.dataForm, 'fileIds', fileIds)
}
console.log('before send: ', this.dataForm)
// console.log('this.$route',this.$route);
// console.log('before send: ', this.dataForm)
//增加质量模块按钮盒多传参数的判断
if(this.$route.name == 'monitoring-qualityInspectionBoxBtn'){
// console.log('关键',this.configs.fields);
for(let i = 0;i<this.configs.fields[4].options.length;i++){
if (this.configs.fields[4].options[i].label == this.idMark) {
this.dataForm.inspectionDetId = this.configs.fields[4].options[i].inspectionDetId
}
}
}
// console.log('before send: ', this.dataForm)
this.$http({
url: this.$http.adornUrl(urls[btn.name].url),
method: btn.name === 'save' ? 'POST' : 'PUT',

View File

@@ -4,17 +4,18 @@
* @Author: fzq
* @Date: 2022-11-25 09:51:46
* @LastEditors: fzq
* @LastEditTime: 2023-02-08 17:16:47
* @LastEditTime: 2023-02-09 10:17:22
-->
<template>
<!-- 数字代表多级表头最小列宽 -->
<!-- :width="opt.width || null" -->
<!-- :width="flexColumnWidth(opt.prop || null)" -->
<!-- header-align="center" align="center" -->
<!-- :min-width="opt.minWidth || null" -->
<el-table-column
:label="opt.label ? opt.label : opt.name"
:prop="opt.prop || null"
:min-width="opt.minWidth || null"
:min-width="[$route.fullPath == '/monitoring-realtimeQualityInspection' ? 170 : (opt.minWidth || null)]"
:fixed="opt.fixed || null"
:show-overflow-tooltip="opt.showOverflowTooltip || false"
filter-placement="top"

View File

@@ -56,6 +56,7 @@
v-bind="head.more"></el-table-column>
<!-- 普通的表头 -->
<!-- :align="head.align || null" 表头居中 -->
<!-- :min-width="head.minWidth || null" -->
<el-table-column
v-else
:key="idx + 'else'"
@@ -78,7 +79,7 @@
<!-- 多级表头 -->
<template v-if="!head.prop && head.children">
<TableHead v-for="(subhead, subindex) in head.children" :key="'subhead-' + idx + '-subindex-' + subindex" :opt="subhead" fixed/>
<TableHead v-for="(subhead, subindex) in head.children" :key="'subhead-' + idx + '-subindex-' + subindex" :opt="subhead"/>
</template>
</el-table-column>
</template>
@@ -175,7 +176,7 @@ export default {
},
created() {
// console.log(this.selectedBox)
console.log(this.tableHeadConfigs)
// console.log(this.tableHeadConfigs)
},
methods: {
handleSubEmitData(payload) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -27,6 +27,7 @@ t.routes['字典管理'] = 'Dict Management'
t.routes['PLC信息'] = 'PLC'
// Relations between
t.routes['设备与PLC关联配置'] = 'PLC & Equipments'
t.routes['下片监测'] = 'Unload Log'
t.routes['近24小时设备生产数据'] = 'Equipment Data'
t.routes['近24小时产线生产数据'] = 'Productline Data'
t.routes['近24小时质量检查数据'] = 'Quality Inspection Data'
@@ -51,7 +52,11 @@ t.routes['登录日志'] = 'Login Records'
t.routes['操作日志'] = 'Operations Records'
t.routes['设备效率分析'] = 'EQU Efficiency Analysis'
t.routes['设备异常分析'] = 'EQU Exceptions Analysis'
t.routes['设备状态时序图'] = 'EQU Status Timesequence'
t.routes['设备状态时序图'] = 'EQU Status Timeseq'
t.routes['产品质量分析'] = 'Product Quality Analysis'
t.routes['产量分析'] = 'Product Analysis'
t.routes['生产节拍时序图'] = 'Product Beat Timeseq'
t.routes['设备产量时序图'] = 'EQU Product Timeseq'
// 三级
t.routes['工厂'] = 'Factory'
@@ -63,6 +68,7 @@ t.routes['设备信息'] = 'Equipment Details'
t.routes['设备参数状态监控'] = 'Current Equipment State'
t.routes['设备分组报警信息'] = 'Equipment Group Alarm'
t.routes['设备历史参数'] = 'Equipment Historical Parameters'
t.routes['下片详情'] = 'Unload Detail'
t.routes['质量检测类型'] = 'Quality Inpection Types'
t.routes['质量检测信息'] = 'Quality Inpection Details'
t.routes['安灯检测盒'] = 'Andeng inspection box'
@@ -142,7 +148,13 @@ t.status = 'Status'
t.normal = 'Normal'
t.shutdown = 'Shut Down'
t.malfunction = 'Malfunction' // ?
t.stop = 'Stop'
t.run = 'Run'
t.unknown = 'Unknown'
t.buttonId = 'Button Number'
t.boxNo = 'Box Number'
t.diagram = 'Device Status Sequence Diagram'
t.diagram2 = 'Device Product Sequence Diagram'
t.addr = 'Address'
t.planStop = 'Plan to stop'
t.startTime = 'Start Time'
@@ -384,13 +396,26 @@ t.eq.month = 'month'
t.eq.realyield = 'Actual processing speed'
t.eq.designyield = 'Theoretical processing speed'
t.eq.viewtrend = 'View Trends'
t.eq.productQuality = 'Product Quality Analysis'
t.eq.productionAnalysis = 'Production Analysis'
t.eq.productQuantity = 'Product Quantity'
t.eq.line1= 'Line 1'
t.eq.line2= 'Line 2'
t.eq.line3= 'Line 3'
t.eq.line4= 'Line 4'
t.eq.sectionName = 'Section Name'
t.eq.equipmentName = 'Equipment Name'
t.eq.okNum = 'Qualified Quantity'
t.eq.nokNum = 'Unqualified Quantity'
t.eq.passRate = 'Qualified Rate'
t.eq.passRatePercent = 'Qualified Rate(%)'
t.pl = {}
t.pl.title = 'Product Line'
t.pl.id = 'Product Line ID'
t.pl.name = 'Product Line Name'
t.pl.sum = 'Sum'
t.pl.code = 'Product Line Code'
t.pl.status = 'Product Line Status'
t.pl.belong = 'Product Line'
@@ -404,6 +429,13 @@ t.pl.choose = 'Please select equipment'
t.pl.confirm = 'Confirm'
t.pl.cancel = 'Cancel'
t.pl.success = 'The new device data is obtained successfully'
t.pl.paperLaying = 'Paper Laying Machine Number'
t.pl.robotNo = 'Robot Number'
t.pl.glassNumber = 'Pallet Glass Number'
t.pl.glassLength = 'Glass Length'
t.pl.glassWidth = 'Glass Width'
t.pl.thick = 'Glass Thcikness'
t.pl.quantity = 'Pallet Quantity'
t.prompt = {}

View File

@@ -27,6 +27,7 @@ t.routes['设备'] = '设备'
t.routes['字典管理'] = '字典管理'
t.routes['PLC信息'] = 'PLC信息'
t.routes['设备与PLC关联配置'] = '设备与PLC关联配置' // ?
t.routes['下片监测'] = '下片监测'
t.routes['近24小时设备生产数据'] = '近24小时设备生产数据'
t.routes['近24小时产线生产数据'] = '近24小时产线生产数据'
t.routes['近24小时质量检查数据'] = '近24小时质量检查数据'
@@ -51,6 +52,11 @@ t.routes['操作日志'] = '操作日志'
t.routes['设备效率分析'] = '设备效率分析'
t.routes['设备异常分析'] = '设备异常分析'
t.routes['设备状态时序图'] = '设备状态时序图'
t.routes['产品质量分析'] = '产品质量分析'
t.routes['产量分析'] = '产量分析'
t.routes['生产节拍时序图'] = '生产节拍时序图'
t.routes['设备产量时序图'] = '设备产量时序图'
// 三级
t.routes['工厂'] = '工厂'
@@ -62,6 +68,7 @@ t.routes['设备信息'] = '设备信息'
t.routes['设备参数状态监控'] = '设备参数状态监控'
t.routes['设备分组报警信息'] = '设备分组报警信息'
t.routes['设备历史参数'] = '设备历史参数'
t.routes['下片详情'] = '下片详情'
t.routes['质量检测类型'] = '质量检测类型'
t.routes['质量检测信息'] = '质量检测信息'
t.routes['安灯检测盒'] = '安灯检测盒'
@@ -140,9 +147,16 @@ t.status = '状态' // 1
t.normal = '正常' // ?
t.shutdown = '停机' // ?
t.malfunction = '故障' // ?
t.stop = '停止'
t.run = '运行'
t.unknown = '未知'
t.buttonId = '网关号'
t.boxNo = '盒子编号'
t.diagram = '设备状态时序图'
t.diagram2 = '设备产量时序图'
t.addr = '地址' // 1
t.planStop = '计划停机' // ?
t.startTime = '开始时间' // 1
t.endTime = '结束时间' // 1
t.to = '至' // 1
@@ -383,12 +397,27 @@ t.eq.month='月'
t.eq.realyield = '实际加工速度'
t.eq.designyield = '理论加工速度'
t.eq.viewtrend = '查看趋势'
t.eq.productQuality = '产品质量分析'
t.eq.productionAnalysis = '产量分析'
t.eq.productQuantity = '产品数量'
t.eq.line1= '产线1'
t.eq.line2= '产线2'
t.eq.line3= '产线3'
t.eq.line4= '产线4'
t.eq.sectionName = '工序'
t.eq.equipmentName = '设备名称'
t.eq.okNum = '合格数量'
t.eq.nokNum = '不合格数量'
t.eq.passRate = '合格率'
t.eq.passRatePercent = '合格率(%)'
t.pl = {}
t.pl.title = '产线'
t.pl.id = '产线ID'
t.pl.name = '产线名称'
t.pl.sum = '合计'
t.pl.code = '产线编码'
t.pl.status = '产线状态'
t.pl.belong = '所属产线'
@@ -402,6 +431,14 @@ t.pl.success = '新设备数据获取成功'
t.pl.choose = '请选择设备'
t.pl.confirm = '确定'
t.pl.cancel = '取消'
t.pl.paperLaying = '铺纸机名称'
t.pl.robotNo = '下片机名称'
t.pl.glassNumber = '木托玻璃数'
t.pl.glassLength = '玻璃长度'
t.pl.glassWidth = '玻璃宽度'
t.pl.thick = '玻璃厚度'
t.pl.quantity = '木托数量'
t.prompt = {}

View File

@@ -8,8 +8,8 @@ import merge from 'lodash/merge'
const http = axios.create({
// baseURL: window.SITE_CONFIG['apiURL'],
baseURL: '/api',
// baseURL: '/yd-monitor',
// baseURL: '/api',
baseURL: '/yd-monitor',
// baseURL: process.env.NODE_ENV === 'production' ? '/api' : '/yd-monitor',
timeout: 1000 * 180,
withCredentials: true

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :visible.sync="visible" :title="$t('updatePassword.title')" :close-on-click-modal="false" :close-on-press-escape="false" :append-to-body="true">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="170px">
<el-form-item :label="$t('updatePassword.username')">
<span>{{ $store.state.user.name }}</span>
</el-form-item>

View File

@@ -1,23 +1,18 @@
<template>
<div class="choicepart-container">
<!-- <div class="choicepat-navbar">
<div class="choicepart-container">
<!-- <div class="choicepat-navbar">
<navbar :showhome="false" :show-title="true" />
</div> -->
<div class="choicepart-box">
<div
v-for="(item, index) in routeList"
:key="item.path"
class="choicepart-item"
@click="handelClick(item, index)"
>
<!-- :style="{ background: colorArr.colorList[index % 9] }" -->
<div class="choicepart-item-border">
<img :src="require(`../../assets/img/choicepart/${item.name}.png`)" alt="">
</div>
<div class="choicepart-item-title" :title="item.name">{{ item.name }}</div>
</div>
</div>
</div>
<div class="choicepart-box">
<div v-for="(item, index) in routeList" :key="item.path" class="choicepart-item" @click="handelClick(item, index)">
<!-- :style="{ background: colorArr.colorList[index % 9] }" -->
<div class="choicepart-item-border">
<img :src="require(`../../assets/img/choicepart/${item.name}.png`)" alt="" />
</div>
<div class="choicepart-item-title" :title="item.name">{{ item.name }}</div>
</div>
</div>
</div>
</template>
<script>
@@ -32,212 +27,218 @@ const colorList = ['#8080ff', '#ff8080', '#b004fb', '#ff409f', '#00caca', '#8080
const colorList1 = ['#b4b4ff', '#ffb4b4', '#c648fb', '#ff86c2', '#66f6f6', '#a2a2f3', '#ffff9a', '#ffc3a5', '#367cd4']
export default {
name: 'ChoicePart',
// components: { Navbar },
data() {
return {
baseImg: require('../../assets/img/login-back.jpg'),
coverImgUrl: localStorage.getItem('backImg') || '',
rowNum: 1,
colorArr: {
colorList,
colorList1
},
windowWidth: 0,
dbConnect: null
}
},
computed: {
routeList() {
// const cangoList = []
// const permission_routes = store.getters.permission_routes
// console.log(permission_routes)
// permission_routes.map(item => {
// if (!item.hidden && item.meta) {
// cangoList.push(item)
// }
// })
// const formatList = cangoList.map((item, index) => {
// return this.setIndex(item, index)
// })
// console.log(formatList)
return window.SITE_CONFIG['menuList']
},
// ...mapGetters(['language', 'dictList', 'dictObj'])
},
created() {
// 确保小图标点回来依然带字符
this.$store.state.sidebarFold = false
this.windowWidth = window.innerWidth
console.log(this.$route)
// this.dbConnect = db({
// DBName: 'back_img',
// version: '1.0',
// params: [
// { name: 'id', unique: true },
// { name: 'imgUrl', unique: true }
// ]
// })
// const request = this.dbConnect.openDB()
// request.onsuccess = () => {
// // const result = this.dbConnect.search('back_img', 'id', 1)
// }
},
mounted() {
// console.log(this.dictList, this.dictObj)
// this.getPic()
},
methods: {
// getPic() {
// // edit here
// downLoadBGP().then(response => {
// if (response.data.size) {
// blobToBase64(response.data).then(res => {
// this.coverImgUrl = res
// localStorage.setItem('backImg', res)
// console.log(res)
// // const result = this.dbConnect.search('back_img', 'id', 1)
// // if (result.result) {
// // this.dbConnect.update({
// // id: 1,
// // imgUrl: res
// // })
// // } else {
// // this.dbConnect.add({
// // id: 1,
// // imgUrl: res
// // })
// // }
// })
// // this.coverImgUrl = response.data
// // const temp = response.data.split('/')
// // temp.splice(0, 2)
// // this.coverImgUrl = 'http://zzdhg.mes.picaiba.com/' + temp.join('/')
// }
// })
// },
resize() {},
handelClick(item, index) {
// this.$store.dispatch('app/setChoicepart', index)
// if (item.meta.unuse) {
// this.$message.warning(this.$t('choisePart.module'))
// } else {
// this.toRouter(item)
// }
// console.log('item',item)
this.toRouter(item)
},
toRouter(item) {
// console.log(item.children[0].url)
// 加个判断看是否双层children
if ((item.children) && (item.children[0].url == "")){
this.$router.push({name: item.children[0].children[0].url.replace(new RegExp('/','g'),'-')})
}
else {
this.$router.push({name: item.children[0].url.replace(new RegExp('/','g'),'-')})
}
},
setIndex(list, index) {
list.meta.routeIndex = index
if (list.children) {
list.children.map(item => {
this.setIndex(item, index)
})
}
return list
}
}
name: 'ChoicePart',
// components: { Navbar },
data() {
return {
baseImg: require('../../assets/img/login-back.jpg'),
coverImgUrl: localStorage.getItem('backImg') || '',
rowNum: 1,
colorArr: {
colorList,
colorList1
},
windowWidth: 0,
dbConnect: null
}
},
computed: {
routeList() {
// const cangoList = []
// const permission_routes = store.getters.permission_routes
// console.log(permission_routes)
// permission_routes.map(item => {
// if (!item.hidden && item.meta) {
// cangoList.push(item)
// }
// })
// const formatList = cangoList.map((item, index) => {
// return this.setIndex(item, index)
// })
// console.log(formatList)
return window.SITE_CONFIG['menuList']
}
// ...mapGetters(['language', 'dictList', 'dictObj'])
},
created() {
// 确保小图标点回来依然带字符
this.$store.state.sidebarFold = false
this.windowWidth = window.innerWidth
console.log(this.$route)
// this.dbConnect = db({
// DBName: 'back_img',
// version: '1.0',
// params: [
// { name: 'id', unique: true },
// { name: 'imgUrl', unique: true }
// ]
// })
// const request = this.dbConnect.openDB()
// request.onsuccess = () => {
// // const result = this.dbConnect.search('back_img', 'id', 1)
// }
},
mounted() {
// console.log(this.dictList, this.dictObj)
// this.getPic()
},
methods: {
// getPic() {
// // edit here
// downLoadBGP().then(response => {
// if (response.data.size) {
// blobToBase64(response.data).then(res => {
// this.coverImgUrl = res
// localStorage.setItem('backImg', res)
// console.log(res)
// // const result = this.dbConnect.search('back_img', 'id', 1)
// // if (result.result) {
// // this.dbConnect.update({
// // id: 1,
// // imgUrl: res
// // })
// // } else {
// // this.dbConnect.add({
// // id: 1,
// // imgUrl: res
// // })
// // }
// })
// // this.coverImgUrl = response.data
// // const temp = response.data.split('/')
// // temp.splice(0, 2)
// // this.coverImgUrl = 'http://zzdhg.mes.picaiba.com/' + temp.join('/')
// }
// })
// },
resize() {},
handelClick(item, index) {
// this.$store.dispatch('app/setChoicepart', index)
// if (item.meta.unuse) {
// this.$message.warning(this.$t('choisePart.module'))
// } else {
// this.toRouter(item)
// }
// console.log('item',item)
this.toRouter(item)
},
toRouter(item) {
// console.log(item.children[0].url)
// 加个判断看是否双层children
if (item.children && item.children[0].url == '') {
this.$router.push({ name: item.children[0].children[0].url.replace(new RegExp('/', 'g'), '-') })
} else {
this.$router.push({ name: item.children[0].url.replace(new RegExp('/', 'g'), '-') })
}
},
setIndex(list, index) {
list.meta.routeIndex = index
if (list.children) {
list.children.map((item) => {
this.setIndex(item, index)
})
}
return list
}
}
}
</script>
<style lang="scss" scoped>
.choicepart-container{
min-width: 100%;
min-height: 100vh;
// background: linear-gradient(-45deg, rgb(25, 25, 200), rgb(0, 100, 200));
background: url('../../assets/img/choicepart/choicepart-back.png') repeat;
background-size: cover;
overflow-x: scroll;
.choicepart-box{
width: 1440px;
margin: 0 auto;
margin: 0 auto;
padding-top: 16vh;
min-height: 100vh;
.choicepart-item{
display: inline-block;
width: 208px;
height: 258px;
margin: 40px;
background: url('../../assets/img/choicepart/choice-item-back.png') no-repeat;
background-size: 100% 100%;
// border: 1px dashed #fff;
box-shadow: 0 2px 10px rgba(0, 0, 0, .5);
top: 0;
border-radius: 5px;
overflow: hidden;
cursor: pointer;
position: relative;
img {
width: 208px;
height: 258px;
}
.choicepart-item-border{
height: 100%;
border-radius: 5px;
padding: 0 5px;
line-height: 32px;
font-size: 28px;
font-weight: lighter;
color: #2C6BD8;
overflow: hidden;
}
.choicepart-item-title {
overflow:hidden;
padding: 0 10px;
text-overflow:ellipsis;
white-space:nowrap;
position: absolute;
bottom: 0;
left: 0;
right: 0;
text-align: center;
color: #fff;
font-size: 16px;
line-height: 48px;
height: 48px;
letter-spacing: 2px;
background-color: rgba($color: #0B58FF, $alpha: 0.45);
}
}
.choicepart-item:hover {
.choicepart-item-title {
background-color: rgba($color: #0B58FF, $alpha: 1);
}
}
}
.choicepat-navbar{
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 10;
}
.choicepart-container {
min-width: 100%;
min-height: 100vh;
// background: linear-gradient(-45deg, rgb(25, 25, 200), rgb(0, 100, 200));
background: url('../../assets/img/choicepart/choicepart-back.png') repeat;
background-size: cover;
overflow-x: scroll;
// flex布局
.choicepart-box {
display: flex;
flex-flow: row wrap;
justify-content: center;
width: 1440px;
margin: 0 auto;
margin: 0 auto;
padding-top: 16vh;
min-height: 100vh;
.choicepart-item {
display: inline-block;
width: 208px;
height: 258px;
margin: 40px;
background: url('../../assets/img/choicepart/choice-item-back.png') no-repeat;
background-size: 100% 100%;
// border: 1px dashed #fff;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
top: 0;
border-radius: 5px;
overflow: hidden;
cursor: pointer;
position: relative;
img {
width: 208px;
height: 258px;
}
.choicepart-item-border {
height: 100%;
border-radius: 5px;
padding: 0 5px;
line-height: 32px;
font-size: 28px;
font-weight: lighter;
color: #2c6bd8;
overflow: hidden;
}
.choicepart-item-title {
overflow: hidden;
padding: 0 10px;
text-overflow: ellipsis;
white-space: nowrap;
position: absolute;
bottom: 0;
left: 0;
right: 0;
text-align: center;
color: #fff;
font-size: 16px;
line-height: 48px;
height: 48px;
letter-spacing: 2px;
background-color: rgba($color: #0b58ff, $alpha: 0.45);
}
}
.choicepart-item:hover {
.choicepart-item-title {
background-color: rgba($color: #0b58ff, $alpha: 1);
}
}
}
.choicepat-navbar {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 10;
}
}
::-webkit-scrollbar-track-piece { //滚动条凹槽的颜色,还可以设置边框属性
background: rgba(255, 255, 255, .1);
::-webkit-scrollbar-track-piece {
//滚动条凹槽的颜色,还可以设置边框属性
background: rgba(255, 255, 255, 0.1);
}
::-webkit-scrollbar {//滚动条的宽度
width:9px;
height:9px;
::-webkit-scrollbar {
//滚动条的宽度
width: 9px;
height: 9px;
}
::-webkit-scrollbar-thumb {//滚动条的设置
background-color: #dddddd;
background-clip:padding-box;
min-height:28px;
border-radius: 9px;
::-webkit-scrollbar-thumb {
//滚动条的设置
background-color: #dddddd;
background-clip: padding-box;
min-height: 28px;
border-radius: 9px;
}
::-webkit-scrollbar-thumb:hover {
background-color:#bbb;
background-color: #bbb;
}
</style>

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="170px">
<el-form-item prop="beanName" :label="$t('schedule.beanName')">
<el-input v-model="dataForm.beanName" :placeholder="$t('schedule.beanNameTips')"></el-input>
</el-form-item>

View File

@@ -0,0 +1,355 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="currentChangeHandle(1)" class="blueTip" size="small">
<el-form-item>
{{ $t('pl.name') }}
</el-form-item>
<el-form-item>
<!-- @input="getLineEqList($event)" -->
<el-select v-model="dataForm.lineId" :placeholder="$t('pl.name')" clearable filterable >
<el-option v-for="line in lineList" :key="line.code" :value="line.id" :label="line.name" />
</el-select>
</el-form-item>
<!-- <el-form-item>
{{ $t('eq.name') }}
</el-form-item>
<el-form-item>
<el-select v-model="dataForm.equipmentId" :placeholder="$t('eq.name')" clearable filterable>
<el-option v-for="eq in eqList" :key="eq.code" :value="eq.id" :label="eq.name" />
</el-select>
</el-form-item> -->
<el-form-item>
{{ $t('startTime') }}
</el-form-item>
<el-form-item>
<el-date-picker v-model="startTime" type="datetime" :placeholder="$t('hints.date')" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-ddTHH:mm:ss" />
</el-form-item>
<el-form-item>
{{ $t('endTime') }}
</el-form-item>
<el-form-item>
<el-date-picker v-model="endTime" type="datetime" :placeholder="$t('hints.date')" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-ddTHH:mm:ss" />
</el-form-item>
<el-form-item>
{{ $t('pl.thick') }}
</el-form-item>
<el-form-item>
<el-select v-model="glassThick" :placeholder="$t('pl.thick')">
<el-option
v-for="item in glassOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<!-- <el-button class="buttonColor" @click="currentChangeHandle(1)">{{ $t('query') }}</el-button> -->
<el-button class="buttonColor" @click="currentChangeHandle(1)">{{ $t('query') }}</el-button>
<!-- <el-button v-if="$hasPermission('monitoring:equipmentgroup:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> -->
</el-form-item>
</el-form>
<base-table
:data="dataList"
:table-head-configs="tableConfigs"
:max-height="calcMaxHeight(8)"
@operate-event="handleOperations"
@refreshDataList="getDataList" />
<!-- layout="total, sizes, prev, pager, next, jumper" -->
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
>
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :configs="addOrUpdateConfigs" @refreshDataList="getDataList" @destory-dialog="handleDestroyDialog" />
</div>
</template>
<script>
import { calcMaxHeight } from '@/utils'
import { timeFilter } from '@/utils/filters'
import AddOrUpdate from '@/components/base-dialog/addOrUpdate'
// import AddOrUpdate from './equipmentGroup-add-or-update'
import i18n from '@/i18n'
import BaseTable from '@/components/base-table'
// import TableOperateComponent from '@/components/base-table/components/operationComponent'
import TableTextComponent from '@/components/base-table/components/detailComponent'
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'lineName', name: i18n.t('pl.name') },
{ prop: 'location', name: i18n.t('pl.paperLaying') },
{ prop: 'equipmentName', name: i18n.t('pl.robotNo') },
{ prop: 'quantity', name: i18n.t('pl.quantity') },
{ prop: 'glassNumber', name: i18n.t('pl.glassNumber') },
{ prop: 'startTime', name: i18n.t('startTime') },
{ prop: 'endTime', name: i18n.t('endTime') },
{ prop: 'glassLength', name: i18n.t('pl.glassLength') },
{ prop: 'glassWidth', name: i18n.t('pl.glassWidth') },
{ prop: 'glassThickness', name: i18n.t('pl.thick') },
{
prop: 'detail',
name: i18n.t('detail'),
buttonContent: i18n.t('detail'),
subcomponent: TableTextComponent,
emitFullData: true,
actionName: 'view-detail'
}
// { prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
]
const addOrUpdateConfigs = {
type: 'dialog',
infoUrl: '/monitoring/downloadLog/getTimeDet',
fields: [{ name: 'equipmentName', label: i18n.t('eq.groupname') }, { name: 'equipmentName', label: i18n.t('eq.groupname') }],
operations: [
{ name: 'cancel', showAlways: true },
{ name: 'save', url: '/monitoring/equipmentGroup', permission: 'monitoring:equipmentgroup:save', showOnEdit: false },
{ name: 'update', url: '/monitoring/equipmentGroup', permission: 'monitoring:equipmentgroup:update', showOnEdit: true }
]
}
export default {
data() {
return {
addOrUpdateConfigs,
calcMaxHeight,
tableConfigs,
dataForm: {
equipmentId: '',
lineId: ''
},
dataList: [],
eqList: [],
lineList: [],
pageIndex: 1,
pageSize: 20,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false,
startTime: '',
endTime: '',
glassNumber: 95,
glassLength: 2261,
glassWidth: 1128,
glassThick: 3.2,
glassOptions: [{
value: 3.2,
label: '3.2mm'
}, {
value: 2,
label: '2mm'
}],
value: ''
}
},
components: {
AddOrUpdate,
BaseTable
},
activated() {
// this.getEqList()
this.getLineList()
this.getDataList()
},
methods: {
// destroy dialog
handleDestroyDialog() {
setTimeout(() => {
this.addOrUpdateVisible = false
}, /** after dialog animated */ 200)
},
// 产线对应设备
getLineEqList(event) {
// console.log(event)
this.$http({
url: this.$http.adornUrl('/monitoring/equipment/page'),
method: 'get',
params: this.$http.adornParams({
limit: 99999,
page: 1,
lineId: event
})
}).then(({ data }) => {
if (data && data.code === 0) {
let fileterEqList = data.data.list.filter((t) => {
return t.lineId == event
})
this.eqList = fileterEqList
} else {
this.eqList = []
}
})
},
// 产线
getLineList() {
this.$http({
url: this.$http.adornUrl('/monitoring/productionLine/list'),
method: 'get'
}).then(({ data }) => {
if (data && data.code === 0) {
this.lineList = data.data
} else {
this.lineList = []
}
})
},
// 获取数据列表
getDataList() {
this.addOrUpdateVisible = false
this.dataListLoading = true
// this.$http({
// url: this.$http.adornUrl('/monitoring/downloadLog/getTimeCount'),
// method: 'POST',
// params: this.$http.adornParams({
// // page: this.pageIndex,
// // limit: this.pageSize,
// // lineId: this.dataForm.lineId,
// 'startTime': this.startTime,
// 'endTime': this.endTime
// }
// )
this.$http({
url: this.$http.adornUrl('/monitoring/downloadLog/getTimeCount'),
method: 'POST',
data: {
page: this.pageIndex,
limit: this.pageSize,
// lineId: this.dataForm.lineId,
'startTime': this.startTime,
'endTime': this.endTime
}
}).then(({ data }) => {
if ((data && data.code === 0) && (this.dataForm.lineId != '')) {
// console.log('this.dataForm.lineId', this.dataForm.lineId);
let fileterLineList = data.data.filter((t) => {
return t.lineId == this.dataForm.lineId
})
this.dataList = fileterLineList
// this.dataList = data.data
this.totalPage = this.dataList.length
// console.log('this.totalPage',this.totalPage)
} else if (this.dataForm.lineId == '') {
this.dataList = data.data
this.totalPage = data.data.length
}
else {
this.dataList = []
this.totalPage = 0
}
for(let i =0;i<this.dataList.length;i++){
this.dataList[i].glassNumber = ( this.glassThick == 3.2 ) ? 95 :150
this.dataList[i].glassThickness = this.glassThick
this.dataList[i].glassLength = 2261
this.dataList[i].glassWidth = 1128
this.dataList[i].endTime = this.dataList[i].endTime == null ? '-' : this.dataList[i].endTime
this.dataList[i].startTime = this.dataList[i].startTime == null ? '-' : this.dataList[i].startTime
}
// console.log(this.dataList);
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle(val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle(val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle(val) {
this.dataListSelections = val
},
handleOperations({ type, data }) {
switch (type) {
case 'view-detail':
const { equipmentId: id , equipmentName: name} = data
this.$router.push({
name: 'monitoring-unloadDetail',
params: { id, name }
})
break
// case 'edit':
// return this.addOrUpdateHandle(id)
// case 'delete':
// return this.deleteHandle(id)
}
},
// 新增 / 修改
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
// 删除
deleteHandle(id) {
var ids = id
? [id]
: 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'), {
confirmButtonText: i18n.t('confirm'),
cancelButtonText: i18n.t('cancel'),
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/monitoring/equipmentGroup'),
method: 'delete',
data: this.$http.adornData(ids, false, 'raw')
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: i18n.t('prompt.success'),
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>
<style>
.blueTip::before {
display: inline-block;
content: '';
width: 4px;
height: 24px;
background: #0b58ff;
border-radius: 1px;
margin-right: 8px;
margin-top: 4px;
}
.buttonColor {
color: #fff;
background: #0b58ff;
}
</style>

View File

@@ -0,0 +1,788 @@
<template>
<div class="mod-config">
<el-form :inline="true" @keyup.enter.native="getDataList()" class="blueTip" size="small">
<el-form-item>
{{ $t('pl.name') }}
</el-form-item>
<!-- 产线 -->
<el-form-item>
<el-select v-model="lineIds" :placeholder="$t('pl.name')" @change="handleProductLineChange" clearable filterable multiple>
<el-option v-for="line in lineList" :key="line.code" :value="line.id" :label="line.name" />
</el-select>
</el-form-item>
<!-- 工序 -->
<el-form-item>
{{ $t('pl.process') }}
</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="sectionIds" :placeholder="$t('pl.process')" clearable filterable multiple>
<el-option v-for="ws in wsList" :key="ws.id" :value="ws.id" :label="ws.name" />
</el-select>
</el-form-item>
<!-- 时间 -->
<el-form-item>
{{ $t('time') }}
</el-form-item>
<el-form-item>
<!-- type="datetimerange" -->
<!-- <el-date-picker
type="daterange"
v-model="datetime"
value-format="yyyy-MM-ddTHH:mm:ss"
:start-placeholder="$t('startTime')"
:end-placeholder="$t('endTime')"
:range-separator="$t('to')"
:default-time="['00:00:00', '23:59:59']"
:picker-options="quickOptions"
clearable /> -->
<el-date-picker v-model="datetime" type="date" :placeholder="$t('hints.date')" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
</el-form-item>
<!-- 查询 -->
<el-form-item>
<el-button class="buttonColor" @click="getDataList()">{{ $t('query') }}</el-button>
<!-- <el-button v-if="$hasPermission('monitoring:qualityinspectionrecord:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> -->
</el-form-item>
<!-- 添加对比 -->
<el-form-item>
<el-button type="success" @click="addEq()">{{ $t('pl.add2') }}</el-button>
</el-form-item>
</el-form>
<el-dialog :visible.sync="dialogVisible" :title="$t('pl.add')" width="30%">
<el-select v-model="eqId" style="width: 100%" :placeholder="$t('pl.choose')" clearable filterable>
<el-option v-for="eq in dialogEqList" :key="eq.id" :label="eq.name" :value="eq.id" />
</el-select>
<div slot="footer">
<el-button @click="dialogVisible = false">{{ $t('pl.cancel') }}</el-button>
<!-- @click="dialogConfirm" -->
<el-button type="primary" @click="dialogConfirm">{{ $t('pl.confirm') }}</el-button>
</div>
</el-dialog>
<div class="quality-inspection-current base-container">
<!-- <el-row>
<el-col>
<small-title :size="'md'">{{ $t('inspect.ioTotal') }}</small-title>
<el-row style="margin-top: 12px;">
<base-table :data="dataListStatic" :table-head-configs="tableConfigStatic" :max-height="500" @operate-event="handleOperations" @refreshDataList="getDataList" />
</el-row>
</el-col>
</el-row> -->
<!-- style="margin-top: 28px;" -->
<el-row>
<el-col>
<el-row>
<small-title :size="'md'">{{ $t('diagram2'), }}</small-title>
</el-row>
<!-- <el-row style="margin-top: 8px">
<el-radio-group v-model="dataType" size="medium" @change="handleDataTypeChange">
<el-radio-button :label="$t('table2')"></el-radio-button>
<el-radio-button :label="$t('graph')"></el-radio-button>
</el-radio-group>
</el-row> -->
<!-- style="margin-top: 12px" -->
<!-- <el-row>
<base-table
:data="dataList"
:table-head-configs="tableConfigDynamic"
:max-height="500"
@operate-event="handleOperations"
@refreshDataList="getDataList" />
</el-row> -->
<!-- :series-data="echartsData" -->
<!-- v-else -->
<el-row>
<fake-chart :categories="echartCategories" :type-list="echartCheckTypes" :series="series" :keys="keys" />
</el-row>
</el-col>
</el-row>
</div>
</div>
</template>
<script>
import { calcMaxHeight } from '@/utils'
import { timeFilter } from '@/utils/filters'
import moment from 'moment'
import i18n from '@/i18n'
import BaseTable from '@/components/base-table'
import SmallTitle from '@/components/small-title'
import * as echarts from 'echarts'
import { keys } from 'lodash'
// const tableConfigStatic = [
// { type: 'index', width: 100, name: i18n.t('index') },
// { name: i18n.t('pl.title'), prop: 'lineName' },
// { name: i18n.t('inspect.inTotal'), prop: 'sumUp' },
// { name: i18n.t('inspect.outTotal'), prop: 'sumDown' },
// { name: i18n.t('inspect.checkTotal'), prop: 'sumCheck' },
// { name: i18n.t('inspect.rate'), prop: 'scrapRatio', filter: (val) => (val || val === 0 ? `${val}%` : '-') }
// ]
const tableConfigDynamic = [
{ type: 'index', width: 100, name: i18n.t('index') },
{ name: i18n.t('pl.name'), prop: '0' }
]
const FakeChart = {
name: 'FakeChart',
props: {
categories: {
type: Array,
default: () => []
},
typeList: {
type: Array,
default: () => []
},
keys: {
type: Array,
default: () => []
},
series: {
type: Array,
default: () => []
}
},
data() {
return {
calcMaxHeight,
chart: null,
lineIds: [],
// 新加
// keys: [],
values: [],
// finalVal: [],
defaultOpts: {
grid: {
left: '5%',
right: '12%',
top: '20%',
bottom: '10%'
},
title: {
text: i18n.t('eq.productQuantity')
},
tooltip: {
trigger: 'axis', //坐标轴触发,主要在柱状图,折线图等会使用类目轴的图表中使用
axisPointer: {
// 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
legend: {
orient: 'vertical',
type: 'scroll',
top: 10,
right: 0,
width: '12%',
/** 修复文本太长时显示问题 */
// formatter: function (name) {
// return echarts.format.truncateText(name, 120, '14px Microsoft Yahei', '...')
// },
tooltip: {
show: true
},
/** end */
data: []
},
xAxis: {
type: 'category',
data: [
'1:00',
'2:00',
'3:00',
'4:00',
'5:00',
'6:00',
'7:00',
'8:00',
'9:00',
'10:00',
'11:00',
'12:00',
'13:00',
'14:00',
'15:00',
'16:00',
'17:00',
'18:00',
'19:00',
'20:00',
'21:00',
'22:00',
'23:00',
'24:00'
],
// axisLine: {
// show: true,
// lineStyle: {
// color: 'rgba(219,225,255,1)',
// width: 1,
// type: 'solid'
// }
// },
axisLabel: {
//设置x轴的字
show: true,
rotate: 0,
interval: 0 //使x轴横坐标全部显示
// textStyle: {
// //x轴字体样式
// color: 'rgba(219,225,255,1)',
// margin: 15
// }
}
// data: ['下片1', '上片1', '磨边机1', '设备13', '钢化炉2', '磨边机2', '设备15', '清洗机1', '钢化炉3']
},
yAxis: {
type: 'value'
},
series: [
// dynamic
// {
// name: '',
// type: 'line',
// data: [],
// label: {
// normal: {
// show: true,
// position: 'top'
// },
// formatter: '{@value}'
// }
// }
]
}
}
},
watch: {
categories: {
handler: function (val, oldVal) {
if (val && val !== oldVal) {
// this.defaultOpts.xAxis.data.push(...val)
this.defaultOpts.xAxis.data = val
}
},
immediate: true
},
keys: {
handler: function (val, oldVal) {
if (val && val !== oldVal) {
// this.defaultOpts.legend.data.push(...val)
this.defaultOpts.legend.data = val
// this.defaultOpts.series.name = val
}
},
immediate: true
},
series: {
handler: function (val, oldVal) {
if (val && val !== oldVal) {
// this.defaultOpts.legend.data.push(...val)
this.defaultOpts.series = val
}
},
immediate: true
},
defaultOpts: {
handler: function (val) {
// console.log('defaullt options change: ', val)
this.setOptions()
},
immediate: true,
deep: true
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
// console.log('this.defaultOpts.xAxis.data', this.defaultOpts.xAxis.data)
// console.log('this.keys渲染', this.keys)
// console.log('this.series渲染', this.series)
this.setOptions()
window.addEventListener('resize', () => {
//监听浏览器窗口大小
this.chart.resize()
})
})
},
methods: {
initChart() {
if (!this.chart) {
this.chart = echarts.init(document.getElementById('bar-chart'))
this.chart.resize()
}
},
setOptions(opts) {
/** prop options */
if (opts) {
// console.log('this.keys渲染', this.keys)
// console.log('this.finalVal渲染', this.finalVal)
// // 动态添加series
// for (let l = 0; l < this.finalVal.length; l++) {
// this.defaultOpts.series.push({
// name: this.keys[l],
// type: 'line',
// // stack: '总量',
// data: this.finalVal[l]
// })
// }
// console.log('之后的defaultOpts',this.defaultOpts);
}
if (this.chart) this.chart.setOption(this.defaultOpts, true)
}
},
render: function (h) {
return h('div', { attrs: { id: 'bar-chart' }, style: { background: '#eee', width: '100%', height: '300px', padding: '8px' } }, '')
}
}
const dict = [i18n.t('table2'), i18n.t('graph')]
export default {
name: 'QualityInspectionCurrent',
components: { BaseTable, SmallTitle, FakeChart },
data() {
return {
// 新加
values: [],
values2: [],
keys: [], // 设备名动态series
finalVal: [],
series: [],
equipments: {},
wsList: [],
dialogVisible: false,
eqId: null,
dialogEqList: [],
count: 0,
// 产线默认产线1
// lineIds: ['1'],
lineIds: [],
sectionIds: [],
lineList: [],
// tableConfigStatic,
tableConfigDynamic,
datetime: new Date(),
dataListStatic: [],
dataListDynamic: [],
dataList: [],
dict,
dataType: dict[0], // 表格 | 图形
showGraph: false,
// quickOptions: {
// shortcuts: [
// {
// text: i18n.t('today'),
// onClick(picker) {
// const baseTime = moment().set({ hour: 0, minute: 0, second: 0, millisecond: 0 })
// const startTime = baseTime.format('yyyy-MM-DDTHH:mm:ss')
// const endTime = baseTime.set({ hour: 23, minute: 59, second: 59, millisecond: 999 }).format('yyyy-MM-DDTHH:mm:ss')
// picker.$emit('pick', [startTime, endTime])
// }
// }
// ]
// },
echartCategories: null,
echartCheckTypes: [],
interval: null
}
},
computed: {
equipmentCount: function () {
return Object.keys(this.equipments).length
}
},
created() {
this.getEqList()
this.getLineList()
this.getWorksetionList()
this.interval = setInterval(() => {
this.$message.info(i18n.t('refresh'))
// this.dataListStatic.splice(0)
this.series.splice(0)
this.getDataList()
}, 1000 * 5 * 60)
},
// activated() {
// this.getLineList()
// // this.handleProductLineChange(this.lineIds)
// // .then(() => {
// this.getWorksetionList()
// // })
// },
deactivated() {
if (this.interval) {
clearInterval(this.interval)
this.interval = null
}
},
methods: {
// 产线
getLineList() {
this.$http({
url: this.$http.adornUrl('/monitoring/productionLine/list'),
method: 'get'
}).then(({ data }) => {
if (data && data.code === 0) {
this.lineList = data.data
// console.log('产线数组', this.lineList)
/** set default 默认*/
// if (this.lineList.length) {
// this.lineIds = [this.lineList[this.lineList.length - 1].id]
// }
} else {
this.lineList = []
}
// 这样可以出数据
this.getDataList()
})
},
handleOperations() {},
handleDataTypeChange(value) {
this.showGraph = value === dict[0] ? false : true
},
// 获取工序列表
getWorksetionList() {
// 分页列表才有根据产线过滤功能
// this.wsList = []
for (let i = 0; i < this.lineIds.length; i++) {
this.$http({
// url: this.$http.adornUrl('/monitoring/workshopSection/list'),
url: this.$http.adornUrl('/monitoring/workshopSection/page'),
method: 'get',
params: this.$http.adornParams({
limit: 99999,
page: 1,
lineId: this.lineIds[i]
})
}).then(({ data: res }) => {
if (res && res.code === 0) {
// this.wsList = res.data.list
// ES6 解构 数组合并
this.wsList = this.unique([...this.wsList, ...res.data.list])
// console.log('this.wsList',this.wsList);
/** select 默认选项set default */
// if (this.wsList.length) {
// this.sectionIds = this.wsList.map((item) => item.id)
// // console.log('this.wsList',this.wsList)
// } else {
// this.sectionIds = null
// }
} else {
this.wsList.splice(0)
}
})
}
},
handleProductLineChange(val) {
this.wsList = []
this.getWorksetionList()
},
getDataList() {
// for (var z = 0; z < this.defaultOpts.series.length; z++) {
// this.defaultOpts.series[z].data = []
// }
// this.echartCategories = []
// 下面全部要初始化,清空数据
// this.series = []
this.dataList = []
this.finalVal = []
this.keys = []
this.values = []
this.count = 0
this.showGraph = false
this.dataType = i18n.t('table2')
this.echartCategories = null
this.echartCheckTypes.splice(0)
/** 设置默认日期 */
// const startTime = this.datetime[0] || moment().set({ hour: 0, minute: 0, second: 0 }).format('yyyy-MM-DDTHH:mm:ss')
// const endTime = this.datetime[1] || moment().set({ hour: 23, minute: 59, second: 59 }).format('yyyy-MM-DDTHH:mm:ss')
// console.log('this.datatime',this.datatime)
// const startTime = this.datetime ? this.datetime + '-01T00:00:00' : null
const startTime = this.datetime ? moment(this.datetime).format('YYYY-MM-DD') + 'T00:00:00' : null
const endTime = this.datetime ? moment(this.datetime).format('YYYY-MM-DD') + 'T23:59:59' : null
// const endTime = this.datetime ? this.getMonthSE(moment(this.datetime).format('YYYY-MM')) + 'T23:59:59' : null
const condition = {
startTime,
endTime,
// 加个判断防止为空时传参[]报错
lineIds: this.lineIds.length == 0 ? null : this.lineIds,
sectionIds: this.sectionIds.length == 0 ? null : this.sectionIds
}
/** 获取设备产量时序图数据 */
// this.fetchList(startTime, endTime, lineIds).then(({ data: res }) => {
this.$http({
url: this.$http.adornUrl('/monitoring/eqAnalysis/equProductAnalysis'),
method: 'POST',
data: condition
}).then((res) => {
if (res.code === 500) {
this.dataList.splice(0)
this.equipments = {} // 关闭 echarts 的显示
this.$message.error(res.msg)
} else {
/** handle actual data */
this.dataList = res.data.data
// console.log('this.dataList', this.dataList)
//遍历属性
this.keys = Object.keys(this.dataList)
// console.log('keys', this.keys)
this.values = Object.values(this.dataList)
for (let c = 0; c < this.values.length; c++) {
this.finalVal.push(
this.values[c].map((item) => {
return item.outputNum
})
)
}
// console.log('values', this.values)
// console.log('this.finalVal', this.finalVal)
this.buildGraphData()
/** test data */
// this.dataList = [
// {
// eqId: 'eq-001',
// eqName: 'A1预热机',
// startTime: '2022-05-04T00:30:34',
// endTime: '2022-05-04T08:30:34',
// status: 0
// },
// {
// eqId: 'eq-001',
// eqName: 'A1预热机',
// startTime: '2022-05-04T08:30:34',
// endTime: '2022-05-04T09:30:34',
// status: 1
// },
// {
// eqId: 'eq-001',
// eqName: 'A1预热机',
// startTime: '2022-05-04T09:30:34',
// endTime: '2022-05-04T11:30:34',
// status: 2
// },
// {
// eqId: 'eq-001',
// eqName: 'A1预热机',
// startTime: '2022-05-04T11:30:34',
// endTime: '2022-05-04T13:30:34',
// status: 1
// }
// ]
// this.equipments = this.transformDataToEquipments(this.dataList)
// this.chartOption.setYAxis(Object.keys(this.equipments).map((eId) => this.equipments[eId].name))
// console.log('(((set x axis))): ', this.dataList[0].startTime)
// this.chartOption.setXAxis(this.dataList[0].startTime)
// this.chartOption.setData(this.transformEquipmentsToSeries(this.equipments))
// this.$nextTick(() => {
// this.renderChart()
// })
}
}).catch((err) => {
// console.error(err)
})
},
setOptions(opts) {
/** prop options */
if (opts) {
}
if (this.chart) this.chart.setOption(this.defaultOpts, true)
},
// 失效函数
// parseTableProps(nameData) {
// const subProps = []
// const labelNameMap = new Map()
// // if (nameData.length) {
// // /** 处理 nameData */
// // nameData.forEach((item) => {
// // if (!labelNameMap.get(item.name)) {
// // labelNameMap.set(item.name, 1)
// // subProps.push({ name: item.name, prop: item.name })
// // }
// // })
// // }
// this.tableConfigDynamic = [
// { type: 'index', width: 100, name: i18n.t('index') },
// { name: i18n.t('pl.name'), prop: '0' },
// ...Array.from(new Set(res.data.data[0].records.map((item) => moment(item.recordTime).format('MM-DD')))).map((name) => ({ prop: String(++this.count), name }))
// ]
// /** echarts related */
// // this.echartCategories = subProps.map((item) => item.name)
// this.echartCategories = this.dataListDynamic.map((item) => item.name)
// },
// parseDynamicData(data) {
// this.echartCheckTypes.splice(0)
// return data.map((item) => {
// /** echarts related */
// this.echartCheckTypes.push(item.inspectionContent)
// if (item.data.length) {
// /** 解析子数组 */
// item.data.forEach((subitem) => {
// item[subitem.dynamicName] = subitem.dynamicValue
// })
// }
// return item
// })
// },
buildGraphData() {
/** 构造 echart 需要的数据 */
// 动态添加series
this.series = []
// console.log('this.finalVal', this.finalVal)
// console.log('this.keys', this.keys)
for (let l = 0; l < this.finalVal.length; l++) {
this.series.push({
name: this.keys[l],
type: 'line',
// stack: '总量',
data: this.finalVal[l]
})
}
// console.log('第二部分的series', this.series)
},
fetchList(startTime, endTime, lineIds) {
this.$http({
url: this.$http.adornUrl('/monitoring/eqAnalysis/equProductAnalysis'),
method: 'POST',
data: {
startTime,
endTime,
lineIds: this.lineIds
}
}).catch((err) => {
console.error(err)
})
},
/**
* 默认当前月
* date 带月份的日期2021-8
* 返回月初至月末数组,例:[2021-8-1, 2021-8-31]
*/
getMonthSE(date) {
let nowdays = date ? new Date(date) : new Date()
let year = nowdays.getFullYear()
let month = nowdays.getMonth() + 1
if (month < 10) {
month = '0' + month
}
let myDate = new Date(year, month, 0)
let startDate = year + '-' + month + '-01'
let endDate = year + '-' + month + '-' + myDate.getDate()
// return [startDate, endDate]
return endDate
},
// 数组转对象
// toObject(pairs) {
// return Array.from(pairs).reduce((acc, [key, value]) => Object.assign(acc, { [key]: value }), {})
// },
// 获取对话框里的设备列表
getEqList() {
this.$http({
url: this.$http.adornUrl('/monitoring/equipment/page'),
method: 'get',
params: this.$http.adornParams({
page: 1,
limit: 99999
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.dialogEqList = data.data.list
} else {
this.dialogEqList.splice(0)
}
})
},
// 添加设备
addEq() {
// console.log('this.equipments',this.equipments);
if (this.series) {
this.dialogVisible = true
} else {
this.$message.warning(this.$t('pl.queryFirst'))
}
},
// 确认添加设备
dialogConfirm() {
let startTime = this.datetime ? moment(this.datetime).format('YYYY-MM-DD') + 'T00:00:00' : null
let endTime = this.datetime ? moment(this.datetime).format('YYYY-MM-DD') + 'T23:59:59' : null
const condition = {
startTime,
endTime,
// productlines: [this.dataForm.productlines],
// wsId: this.dataForm.wsId,
equId: this.eqId
}
/** fetch data */
this.$http({
url: this.$http.adornUrl('/monitoring/eqAnalysis/equProductAnalysis'),
method: 'post',
data: condition
}).then(({ data: res }) => {
if (res.code === 500) {
this.$message.error(res.msg)
} else {
// console.log('res',res)
//遍历属性
this.keys = [...Object.keys(res.data),...this.keys]
// console.log('this.finalVal', this.finalVal)
console.log('keys', this.keys)
this.values = Object.values(res.data)
// console.log('values', this.values)
// 初始化values2
this.values2 = []
for (let c = 0; c < this.values.length; c++) {
this.values2.push(
this.values[c].map((item) => {
return item.outputNum
})
)
}
console.log('values2', this.values2)
this.finalVal = [...this.values2,...this.finalVal]
console.log('this.finalVal', this.finalVal)
this.$message.success(this.$t('pl.success'))
this.$nextTick(() => {
this.dialogVisible = false
this.buildGraphData()
})
}
})
},
// 数组去重
unique(arr) {
return Array.from(new Set(arr))
}
}
}
</script>
<style scoped>
.base-container {
min-height: 60vh;
background: #fff;
padding: 12px;
}
.buttonColor {
color: #fff;
background: #0b58ff;
}
</style>

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
<el-form-item label="报警信息ID关联T_equipment_group_alarm表" prop="alarmId">
<el-input v-model="dataForm.alarmId" placeholder="报警信息ID关联T_equipment_group_alarm表"></el-input>
</el-form-item>

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
<el-form-item label="设备ID" prop="equipmentId">
<el-input v-model="dataForm.equipmentId" placeholder="设备ID"></el-input>
</el-form-item>

View File

@@ -5,7 +5,7 @@
{{ $t('pl.name') }}
</el-form-item>
<el-form-item>
<el-select v-model="dataForm.lineId" :placeholder="$t('pl.name')" clearable filterable>
<el-select v-model="dataForm.lineId" :placeholder="$t('pl.name')" clearable filterable @input="getLineEqList($event)">
<el-option v-for="line in lineList" :key="line.code" :value="line.id" :label="line.name" />
</el-select>
</el-form-item>
@@ -90,6 +90,7 @@ const tableConfigs = [
prop: 'status',
name: i18n.t('realtime.state'),
filter: (val) => {
if (val == 9) return i18n.t('unknown')
if (val !== null && val !== undefined) return [i18n.t('normal'), i18n.t('planStop'), i18n.t('malfunction')][+val]
}
},
@@ -150,8 +151,9 @@ export default {
BaseTable
},
activated() {
this.getEqList()
// this.getEqList()
this.getLineList()
this.getEqList()
this.getDataList()
},
methods: {
@@ -165,7 +167,11 @@ export default {
getEqList() {
this.$http({
url: this.$http.adornUrl('/monitoring/equipment/page'),
method: 'get'
method: 'get',
params: this.$http.adornParams({
limit: 99999,
page: 1
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.eqList = data.data.list
@@ -174,6 +180,28 @@ export default {
}
})
},
// 产线对应设备
getLineEqList(event) {
console.log(event)
this.$http({
url: this.$http.adornUrl('/monitoring/equipment/page'),
method: 'get',
params: this.$http.adornParams({
limit: 99999,
page: 1,
lineId: event
})
}).then(({ data }) => {
if (data && data.code === 0) {
let fileterEqList = data.data.list.filter((t) => {
return t.lineId == event
})
this.eqList = fileterEqList
} else {
this.eqList = []
}
})
},
// 产线
getLineList() {
this.$http({

View File

@@ -207,7 +207,7 @@ export default {
this.factoryList = res.data
/** set default */
if (this.factoryList.length) {
this.dataForm.ftId = this.factoryList[0].id
// this.dataForm.ftId = this.factoryList[0].id
}
} else {
this.factoryList = []
@@ -236,7 +236,7 @@ export default {
if (res && res.code === 0 && res.data.length) {
this.productLineList = res.data
/** set default */
this.dataForm.productlines = [this.productLineList[0].id]
// this.dataForm.productlines = [this.productLineList[0].id]
} else {
this.productLineList = []
this.dataForm.productlines = []

View File

@@ -2,7 +2,7 @@
/*
* @Author: lb
* @Date: 2022-07-24 13:30:00
* @LastEditTime: 2023-02-02 15:02:52
* @LastEditTime: 2023-02-09 15:25:13
* @LastEditors: fzq
* @Description: 设备效率分析-echarts图
*/
@@ -333,11 +333,14 @@ export default {
}
.close-btn:hover {
color: #409eff;
/* color: #409eff; */
color: #0B58FF;
}
.head-radio-group >>> .el-radio-button__orig-radio:checked + .el-radio-button__inner {
background-color: #409eff;
border-color: #409eff;
/* background-color: #409eff;
border-color: #409eff; */
background-color: #0B58FF;
border-color: #0B58FF;
}
</style>

View File

@@ -135,10 +135,10 @@ export default {
}).then(({ data: res }) => {
if (res && res.code === 0) {
this.productLineList = res.data
/** set default */
if (this.productLineList.length) {
this.dataForm.productlines = [this.productLineList[0].id]
}
/** set default 默认*/
// if (this.productLineList.length) {
// this.dataForm.productlines = [this.productLineList[0].id]
// }
} else {
this.productLineList = []
this.dataForm.productlines = []

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
<el-form-item label="设备ID" prop="equipmentId">
<el-input v-model="dataForm.equipmentId" placeholder="设备ID"></el-input>
</el-form-item>

View File

@@ -21,7 +21,16 @@
</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 v-for="i in (0,dataLength)" :key="i.name" :data="dataList[i]" :table-head-configs="tableConfigs[i]" :max-height="calcMaxHeight(8)" />
<base-table v-if="tableConfigs.length > 3" :data="dataList" :table-head-configs="tableConfigs" :max-height="calcMaxHeight(8)" />
<base-table v-if="tableConfigs2.length > 3" :data="dataList2" :table-head-configs="tableConfigs2" :max-height="calcMaxHeight(8)" />
<base-table v-if="tableConfigs3.length > 3" :data="dataList3" :table-head-configs="tableConfigs3" :max-height="calcMaxHeight(8)" />
<base-table v-if="tableConfigs4.length > 3" :data="dataList4" :table-head-configs="tableConfigs4" :max-height="calcMaxHeight(8)" />
<base-table v-if="tableConfigs5.length > 3" :data="dataList5" :table-head-configs="tableConfigs5" :max-height="calcMaxHeight(8)" />
<base-table v-if="tableConfigs6.length > 3" :data="dataList6" :table-head-configs="tableConfigs6" :max-height="calcMaxHeight(8)" />
<base-table v-if="tableConfigs7.length > 3" :data="dataList7" :table-head-configs="tableConfigs7" :max-height="calcMaxHeight(8)" />
<base-table v-if="tableConfigs8.length > 3" :data="dataList8" :table-head-configs="tableConfigs8" :max-height="calcMaxHeight(8)" />
<base-table v-if="tableConfigs9.length > 3" :data="dataList9" :table-head-configs="tableConfigs9" :max-height="calcMaxHeight(8)" />
<base-table v-if="tableConfigs10.length > 3" :data="dataList10" :table-head-configs="tableConfigs10" :max-height="calcMaxHeight(8)" />
<!-- <base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="calcMaxHeight(8)" /> -->
</div>
</template>
@@ -42,8 +51,26 @@ export default {
equipmentName: null,
equipmentCode: null,
tableConfigs: [],
tableConfigs2: [],
tableConfigs3: [],
tableConfigs4: [],
tableConfigs5: [],
tableConfigs6: [],
tableConfigs7: [],
tableConfigs8: [],
tableConfigs9: [],
tableConfigs10: [],
dataLength: null,
dataList: [],
dataList2: [],
dataList3: [],
dataList4: [],
dataList5: [],
dataList6: [],
dataList7: [],
dataList8: [],
dataList9: [],
dataList10: [],
dataListLoading: false,
dataListSelections: []
}
@@ -75,53 +102,441 @@ export default {
url: this.$http.adornUrl(`/monitoring/equipmentValueMonitor/runLog/${this.$route.params.id}`),
method: 'get'
}).then(({ data: res }) => {
// console.log('res', res)
console.log('/monitoring/equipmentValueMonitor/runLog/', res)
this.equipmentName = res.data[0].data[0].equName
this.equipmentCode = res.data[0].data[0].equCode
this.dataLength = res.data.length
for (let i = 0; i < this.dataLength; i++) {
if (
res &&
res.code === 0 &&
res.data &&
res.data.length > 0 &&
res.data[i].nameData &&
res.data[i].nameData.length > 0 &&
res.data[i].data &&
res.data[i].data.length > 0
res.data[0].nameData &&
res.data[0].nameData.length > 0 &&
res.data[0].data &&
res.data[0].data.length > 0
) {
// console.log(this.equipmentName)
this.setTableProps(res.data[i].nameData)
this.setTableData(res.data[i].data)
} else {
this.dataList[i] = []
this.setTableProps(res.data[0].nameData)
this.setTableData(res.data[0].data)
}
if (
res &&
res.code === 0 &&
res.data &&
res.data.length > 0 &&
res.data[1].nameData &&
res.data[1].nameData.length > 0 &&
res.data[1].data &&
res.data[1].data.length > 0
) {
console.log('res.data[1]',res.data[1])
this.setTableProps2(res.data[1].nameData)
this.setTableData2(res.data[1].data)
}
if (
res &&
res.code === 0 &&
res.data &&
res.data.length > 0 &&
res.data[2].nameData &&
res.data[2].nameData.length > 0 &&
res.data[2].data &&
res.data[2].data.length > 0
) {
// console.log(this.equipmentName)
this.setTableProps3(res.data[2].nameData)
this.setTableData3(res.data[2].data)
}
if (
res &&
res.code === 0 &&
res.data &&
res.data.length > 0 &&
res.data[3].nameData &&
res.data[3].nameData.length > 0 &&
res.data[3].data &&
res.data[3].data.length > 0
) {
// console.log(this.equipmentName)
this.setTableProps4(res.data[3].nameData)
this.setTableData4(res.data[3].data)
}
if (
res &&
res.code === 0 &&
res.data &&
res.data.length > 0 &&
res.data[4].nameData &&
res.data[4].nameData.length > 0 &&
res.data[4].data &&
res.data[4].data.length > 0
) {
// console.log(this.equipmentName)
this.setTableProps5(res.data[4].nameData)
this.setTableData5(res.data[4].data)
}
if (
res &&
res.code === 0 &&
res.data &&
res.data.length > 0 &&
res.data[5].nameData &&
res.data[5].nameData.length > 0 &&
res.data[5].data &&
res.data[5].data.length > 0
) {
// console.log(this.equipmentName)
this.setTableProps6(res.data[5].nameData)
this.setTableData6(res.data[5].data)
}
if (
res &&
res.code === 0 &&
res.data &&
res.data.length > 0 &&
res.data[6].nameData &&
res.data[6].nameData.length > 0 &&
res.data[6].data &&
res.data[6].data.length > 0
) {
// console.log(this.equipmentName)
this.setTableProps7(res.data[6].nameData)
this.setTableData7(res.data[6].data)
}
if (
res &&
res.code === 0 &&
res.data &&
res.data.length > 0 &&
res.data[7].nameData &&
res.data[7].nameData.length > 0 &&
res.data[7].data &&
res.data[7].data.length > 0
) {
// console.log(this.equipmentName)
this.setTableProps8(res.data[7].nameData)
this.setTableData8(res.data[7].data)
}
if (
res &&
res.code === 0 &&
res.data &&
res.data.length > 0 &&
res.data[8].nameData &&
res.data[8].nameData.length > 0 &&
res.data[8].data &&
res.data[8].data.length > 0
) {
// console.log(this.equipmentName)
this.setTableProps9(res.data[8].nameData)
this.setTableData9(res.data[8].data)
}
if (
res &&
res.code === 0 &&
res.data &&
res.data.length > 0 &&
res.data[9].nameData &&
res.data[9].nameData.length > 0 &&
res.data[9].data &&
res.data[9].data.length > 0
) {
// console.log(this.equipmentName)
this.setTableProps10(res.data[9].nameData)
this.setTableData10(res.data[9].data)
}
this.dataListLoading = false
}
})
}).catch(()=>{}) //---去除无效报错---
},
setTableProps(nameData) {
for (let i = 0; i < this.dataLength; i++) {
this.tableConfigs[i] = [
{
type: 'index',
name: i18n.t('index')
},
{ prop: 'time', name: this.$t('ti'), filter: timeFilter },
{ prop: 'plcCode', name: this.$t('plcCode') },
// { prop: 'equName', name: this.$t('equName') },
// { prop: 'equCode', name: this.$t('equCode') },
// ...['数值1', '数值2', '数值3'].map(name => {
// return { prop: name, name }
// })
...Array.from(new Set(nameData.map((item) => item.name))).map((name) => ({ prop: name, name }))
]
console.log(this.tableConfigs[i]);
}
this.tableConfigs = [
{
type: 'index',
name: i18n.t('index')
},
{ prop: 'time', name: this.$t('ti'), filter: timeFilter },
{ prop: 'plcCode', name: this.$t('plcCode') },
// { prop: 'equName', name: this.$t('equName') },
// { prop: 'equCode', name: this.$t('equCode') },
// ...['数值1', '数值2', '数值3'].map(name => {
// return { prop: name, name }
// })
...Array.from(new Set(nameData.map((item) => item.name))).map((name) => ({ prop: name, name }))
]
// console.log(this.tableConfigs[i]);
},
setTableProps2(nameData) {
this.tableConfigs2 = [
{
type: 'index',
name: i18n.t('index')
},
{ prop: 'time', name: this.$t('ti'), filter: timeFilter },
{ prop: 'plcCode', name: this.$t('plcCode') },
// { prop: 'equName', name: this.$t('equName') },
// { prop: 'equCode', name: this.$t('equCode') },
// ...['数值1', '数值2', '数值3'].map(name => {
// return { prop: name, name }
// })
...Array.from(new Set(nameData.map((item) => item.name))).map((name) => ({ prop: name, name }))
]
// console.log(this.tableConfigs[i]);
},
setTableProps3(nameData) {
this.tableConfigs3 = [
{
type: 'index',
name: i18n.t('index')
},
{ prop: 'time', name: this.$t('ti'), filter: timeFilter },
{ prop: 'plcCode', name: this.$t('plcCode') },
// { prop: 'equName', name: this.$t('equName') },
// { prop: 'equCode', name: this.$t('equCode') },
// ...['数值1', '数值2', '数值3'].map(name => {
// return { prop: name, name }
// })
...Array.from(new Set(nameData.map((item) => item.name))).map((name) => ({ prop: name, name }))
]
// console.log(this.tableConfigs[i]);
},
setTableProps3(nameData) {
this.tableConfigs3 = [
{
type: 'index',
name: i18n.t('index')
},
{ prop: 'time', name: this.$t('ti'), filter: timeFilter },
{ prop: 'plcCode', name: this.$t('plcCode') },
// { prop: 'equName', name: this.$t('equName') },
// { prop: 'equCode', name: this.$t('equCode') },
// ...['数值1', '数值2', '数值3'].map(name => {
// return { prop: name, name }
// })
...Array.from(new Set(nameData.map((item) => item.name))).map((name) => ({ prop: name, name }))
]
// console.log(this.tableConfigs[i]);
},
setTableProps4(nameData) {
this.tableConfigs4 = [
{
type: 'index',
name: i18n.t('index')
},
{ prop: 'time', name: this.$t('ti'), filter: timeFilter },
{ prop: 'plcCode', name: this.$t('plcCode') },
// { prop: 'equName', name: this.$t('equName') },
// { prop: 'equCode', name: this.$t('equCode') },
// ...['数值1', '数值2', '数值3'].map(name => {
// return { prop: name, name }
// })
...Array.from(new Set(nameData.map((item) => item.name))).map((name) => ({ prop: name, name }))
]
// console.log(this.tableConfigs[i]);
},
setTableProps5(nameData) {
this.tableConfigs5 = [
{
type: 'index',
name: i18n.t('index')
},
{ prop: 'time', name: this.$t('ti'), filter: timeFilter },
{ prop: 'plcCode', name: this.$t('plcCode') },
// { prop: 'equName', name: this.$t('equName') },
// { prop: 'equCode', name: this.$t('equCode') },
// ...['数值1', '数值2', '数值3'].map(name => {
// return { prop: name, name }
// })
...Array.from(new Set(nameData.map((item) => item.name))).map((name) => ({ prop: name, name }))
]
// console.log(this.tableConfigs[i]);
},
setTableProps6(nameData) {
this.tableConfigs6 = [
{
type: 'index',
name: i18n.t('index')
},
{ prop: 'time', name: this.$t('ti'), filter: timeFilter },
{ prop: 'plcCode', name: this.$t('plcCode') },
// { prop: 'equName', name: this.$t('equName') },
// { prop: 'equCode', name: this.$t('equCode') },
// ...['数值1', '数值2', '数值3'].map(name => {
// return { prop: name, name }
// })
...Array.from(new Set(nameData.map((item) => item.name))).map((name) => ({ prop: name, name }))
]
// console.log(this.tableConfigs[i]);
},
setTableProps7(nameData) {
this.tableConfigs7 = [
{
type: 'index',
name: i18n.t('index')
},
{ prop: 'time', name: this.$t('ti'), filter: timeFilter },
{ prop: 'plcCode', name: this.$t('plcCode') },
// { prop: 'equName', name: this.$t('equName') },
// { prop: 'equCode', name: this.$t('equCode') },
// ...['数值1', '数值2', '数值3'].map(name => {
// return { prop: name, name }
// })
...Array.from(new Set(nameData.map((item) => item.name))).map((name) => ({ prop: name, name }))
]
// console.log(this.tableConfigs[i]);
},
setTableProps8(nameData) {
this.tableConfigs8 = [
{
type: 'index',
name: i18n.t('index')
},
{ prop: 'time', name: this.$t('ti'), filter: timeFilter },
{ prop: 'plcCode', name: this.$t('plcCode') },
// { prop: 'equName', name: this.$t('equName') },
// { prop: 'equCode', name: this.$t('equCode') },
// ...['数值1', '数值2', '数值3'].map(name => {
// return { prop: name, name }
// })
...Array.from(new Set(nameData.map((item) => item.name))).map((name) => ({ prop: name, name }))
]
// console.log(this.tableConfigs[i]);
},
setTableProps9(nameData) {
this.tableConfigs9 = [
{
type: 'index',
name: i18n.t('index')
},
{ prop: 'time', name: this.$t('ti'), filter: timeFilter },
{ prop: 'plcCode', name: this.$t('plcCode') },
// { prop: 'equName', name: this.$t('equName') },
// { prop: 'equCode', name: this.$t('equCode') },
// ...['数值1', '数值2', '数值3'].map(name => {
// return { prop: name, name }
// })
...Array.from(new Set(nameData.map((item) => item.name))).map((name) => ({ prop: name, name }))
]
// console.log(this.tableConfigs[i]);
},
setTableProps10(nameData) {
this.tableConfigs10 = [
{
type: 'index',
name: i18n.t('index')
},
{ prop: 'time', name: this.$t('ti'), filter: timeFilter },
{ prop: 'plcCode', name: this.$t('plcCode') },
// { prop: 'equName', name: this.$t('equName') },
// { prop: 'equCode', name: this.$t('equCode') },
// ...['数值1', '数值2', '数值3'].map(name => {
// return { prop: name, name }
// })
...Array.from(new Set(nameData.map((item) => item.name))).map((name) => ({ prop: name, name }))
]
// console.log(this.tableConfigs[i]);
},
setTableData(data) {
for (let i = 0; i < this.dataLength; i++) {
this.dataList[i] = 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) => {
rowItem[param.dynamicName] = param.dynamicValue
})
}
return rowItem
})
},
setTableData2(data) {
this.dataList2 = data.map((item) => {
const rowItem = pick(item, ['time', 'plcCode', 'equName', 'equCode'])
if (item.data && item.data.length > 0) {
item.data.forEach((param) => {
rowItem[param.dynamicName] = param.dynamicValue
})
}
return rowItem
})
},
setTableData3(data) {
this.dataList3 = data.map((item) => {
const rowItem = pick(item, ['time', 'plcCode', 'equName', 'equCode'])
if (item.data && item.data.length > 0) {
item.data.forEach((param) => {
rowItem[param.dynamicName] = param.dynamicValue
})
}
return rowItem
})
},
setTableData4(data) {
this.dataList4 = data.map((item) => {
const rowItem = pick(item, ['time', 'plcCode', 'equName', 'equCode'])
if (item.data && item.data.length > 0) {
item.data.forEach((param) => {
rowItem[param.dynamicName] = param.dynamicValue
})
}
return rowItem
})
},
setTableData5(data) {
this.dataList5 = data.map((item) => {
const rowItem = pick(item, ['time', 'plcCode', 'equName', 'equCode'])
if (item.data && item.data.length > 0) {
item.data.forEach((param) => {
rowItem[param.dynamicName] = param.dynamicValue
})
}
return rowItem
})
},
setTableData6(data) {
this.dataList6 = data.map((item) => {
const rowItem = pick(item, ['time', 'plcCode', 'equName', 'equCode'])
if (item.data && item.data.length > 0) {
item.data.forEach((param) => {
rowItem[param.dynamicName] = param.dynamicValue
})
}
return rowItem
})
},
setTableData7(data) {
this.dataList7 = data.map((item) => {
const rowItem = pick(item, ['time', 'plcCode', 'equName', 'equCode'])
if (item.data && item.data.length > 0) {
item.data.forEach((param) => {
rowItem[param.dynamicName] = param.dynamicValue
})
}
return rowItem
})
},
setTableData8(data) {
this.dataList8 = data.map((item) => {
const rowItem = pick(item, ['time', 'plcCode', 'equName', 'equCode'])
if (item.data && item.data.length > 0) {
item.data.forEach((param) => {
rowItem[param.dynamicName] = param.dynamicValue
})
}
return rowItem
})
},
setTableData9(data) {
this.dataList9 = data.map((item) => {
const rowItem = pick(item, ['time', 'plcCode', 'equName', 'equCode'])
if (item.data && item.data.length > 0) {
item.data.forEach((param) => {
rowItem[param.dynamicName] = param.dynamicValue
})
}
return rowItem
})
},
setTableData10(data) {
this.dataList10 = data.map((item) => {
const rowItem = pick(item, ['time', 'plcCode', 'equName', 'equCode'])
if (item.data && item.data.length > 0) {
item.data.forEach((param) => {
@@ -130,7 +545,6 @@ export default {
}
return rowItem
})
}
}
}
}

View File

@@ -165,6 +165,8 @@ export default {
// page: this.pageIndex,
// limit: this.pageSize,
// key: this.dataForm.key
limit: 99999,
page: 1
})
}).then(({ data }) => {
const eqConfig = this.addOrUpdateConfigs.fields.find(item => item.name === 'equipmentId')
@@ -180,6 +182,8 @@ export default {
// page: this.pageIndex,
// limit: this.pageSize,
// key: this.dataForm.key
limit: 99999,
page: 1
})
}).then(({ data }) => {
const plcConfig = this.addOrUpdateConfigs.fields.find(item => item.name === 'plcId')

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
<el-form-item label="plc连接表ID" prop="plcConId">
<el-input v-model="dataForm.plcConId" placeholder="plc连接表ID"></el-input>
</el-form-item>

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
<el-form-item label="设备外部编码" prop="externalCode">
<el-input v-model="dataForm.externalCode" placeholder="设备外部编码"></el-input>
</el-form-item>

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
<el-form-item label="设备外部代码" prop="externalCode">
<el-input v-model="dataForm.externalCode" placeholder="设备外部代码"></el-input>
</el-form-item>

View File

@@ -270,10 +270,10 @@ export default {
}).then(({ data: res }) => {
if (res && res.code === 0) {
this.productLineList = res.data
/** set default */
if (this.productLineList.length) {
this.dataForm.productlines = this.productLineList[0].id
}
/** set default 默认*/
// if (this.productLineList.length) {
// this.dataForm.productlines = this.productLineList[0].id
// }
} else {
this.productLineList = []
}

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
<el-form-item label="设备类型ID" prop="equipmentTypeId">
<el-input v-model="dataForm.equipmentTypeId" placeholder="设备类型ID"></el-input>
</el-form-item>

View File

@@ -0,0 +1,729 @@
<template>
<div class="mod-config">
<el-form :inline="true" @keyup.enter.native="getDataList()" class="blueTip" size="small">
<el-form-item>
{{ $t('pl.name') }}
</el-form-item>
<el-form-item>
<el-select v-model="lineIds" :placeholder="$t('pl.name')" clearable filterable multiple>
<el-option v-for="line in lineList" :key="line.code" :value="line.id" :label="line.name" />
</el-select>
</el-form-item>
<el-form-item>
{{ $t('time') }}
</el-form-item>
<el-form-item>
<!-- type="datetimerange" -->
<!-- <el-date-picker
type="daterange"
v-model="datetime"
value-format="yyyy-MM-ddTHH:mm:ss"
:start-placeholder="$t('startTime')"
:end-placeholder="$t('endTime')"
:range-separator="$t('to')"
:default-time="['00:00:00', '23:59:59']"
:picker-options="quickOptions"
clearable /> -->
<el-date-picker v-model="datetime" type="month" :placeholder="$t('hints.date')" format="yyyy-MM" value-format="yyyy-MM" />
</el-form-item>
<el-form-item>
<el-button class="buttonColor" @click="getDataList()">{{ $t('query') }}</el-button>
<!-- <el-button v-if="$hasPermission('monitoring:qualityinspectionrecord:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> -->
</el-form-item>
</el-form>
<div class="quality-inspection-current base-container">
<!-- <el-row>
<el-col>
<small-title :size="'md'">{{ $t('inspect.ioTotal') }}</small-title>
<el-row style="margin-top: 12px;">
<base-table :data="dataListStatic" :table-head-configs="tableConfigStatic" :max-height="500" @operate-event="handleOperations" @refreshDataList="getDataList" />
</el-row>
</el-col>
</el-row> -->
<!-- style="margin-top: 28px;" -->
<el-row>
<el-col>
<el-row>
<small-title :size="'md'">{{ $t('eq.productionAnalysis') }}</small-title>
</el-row>
<!-- <el-row style="margin-top: 8px">
<el-radio-group v-model="dataType" size="medium" @change="handleDataTypeChange">
<el-radio-button :label="$t('table2')"></el-radio-button>
<el-radio-button :label="$t('graph')"></el-radio-button>
</el-radio-group>
</el-row> -->
<!-- style="margin-top: 12px" -->
<el-row>
<!-- v-if="!showGraph" -->
<base-table :data="dataList" :table-head-configs="tableConfigDynamic" :max-height="500" @operate-event="handleOperations" @refreshDataList="getDataList" />
</el-row>
<!-- :series-data="echartsData" -->
<!-- v-else -->
<el-row style="margin-top: 8px">
<fake-chart
:categories="echartCategories"
:type-list="echartCheckTypes"
:series-data1="echartsData1"
:series-data2="echartsData2"
:series-data3="echartsData3"
:series-data4="echartsData4" />
</el-row>
</el-col>
</el-row>
</div>
</div>
</template>
<script>
import { calcMaxHeight } from '@/utils'
import { timeFilter } from '@/utils/filters'
import moment from 'moment'
import i18n from '@/i18n'
import BaseTable from '@/components/base-table'
import SmallTitle from '@/components/small-title'
import * as echarts from 'echarts'
// const tableConfigStatic = [
// { type: 'index', width: 100, name: i18n.t('index') },
// { name: i18n.t('pl.title'), prop: 'lineName' },
// { name: i18n.t('inspect.inTotal'), prop: 'sumUp' },
// { name: i18n.t('inspect.outTotal'), prop: 'sumDown' },
// { name: i18n.t('inspect.checkTotal'), prop: 'sumCheck' },
// { name: i18n.t('inspect.rate'), prop: 'scrapRatio', filter: (val) => (val || val === 0 ? `${val}%` : '-') }
// ]
const tableConfigDynamic = [
{ type: 'index', width: 100, name: i18n.t('index') },
{ name: i18n.t('pl.name'), prop: '0' }
]
const FakeChart = {
name: 'FakeChart',
props: {
categories: {
type: Array,
default: () => []
},
typeList: {
type: Array,
default: () => []
},
seriesData1: {
type: Array,
default: () => []
},
seriesData2: {
type: Array,
default: () => []
},
seriesData3: {
type: Array,
default: () => []
},
seriesData4: {
type: Array,
default: () => []
}
},
data() {
return {
calcMaxHeight,
chart: null,
// 新加
echartsData1: [],
echartsData2: [],
echartsData3: [],
echartsData4: [],
pass: [],
defaultOpts: {
grid: {
left: '5%',
right: '12%',
top: '20%',
bottom: '10%'
},
title: {
text: i18n.t('eq.productQuantity')
},
tooltip: {
trigger: 'axis', //坐标轴触发,主要在柱状图,折线图等会使用类目轴的图表中使用
axisPointer: {
// 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
legend: {
orient: 'vertical',
type: 'scroll',
top: 10,
right: 0,
width: '12%',
/** 修复文本太长时显示问题 */
// formatter: function (name) {
// return echarts.format.truncateText(name, 120, '14px Microsoft Yahei', '...')
// },
tooltip: {
show: true
},
/** end */
data: []
// selected:{'产线1':(this.echartsData1 === [] ? false : true) , 'Line 1':(this.echartsData1 === [] ? false : true) ,
// '产线2':(this.echartsData2 === [] ? false : true) , 'Line 2':(this.echartsData2 === [] ? false : true) }
},
xAxis: {
type: 'category',
data: [],
// axisLine: {
// show: true,
// lineStyle: {
// color: 'rgba(219,225,255,1)',
// width: 1,
// type: 'solid'
// }
// },
axisLabel: {
//设置x轴的字
show: true,
rotate: 0,
interval: 0 //使x轴横坐标全部显示
// textStyle: {
// //x轴字体样式
// color: 'rgba(219,225,255,1)',
// margin: 15
// }
}
// data: ['下片1', '上片1', '磨边机1', '设备13', '钢化炉2', '磨边机2', '设备15', '清洗机1', '钢化炉3']
},
yAxis: {
type: 'value'
},
series: [
// dynamic
{
name: this.$t('eq.line1'),
type: 'line',
data: [],
label: {
normal: {
show: true,
position: 'top'
},
formatter: '{@value}'
}
},
{
name: this.$t('eq.line2'),
type: 'line',
data: [],
label: {
normal: {
show: true,
position: 'top'
},
formatter: '{@value}'
}
},
{
name: this.$t('eq.line3'),
type: 'line',
data: [],
label: {
normal: {
show: true,
position: 'top'
},
formatter: '{@value}'
}
},
{
name: this.$t('eq.line4'),
type: 'line',
data: [],
label: {
normal: {
show: true,
position: 'top'
},
formatter: '{@value}'
}
}
// {
// data: [120, 200, 150, 80, 70, 110, 130],
// type: 'bar'
// }
]
}
}
},
watch: {
categories: {
handler: function (val, oldVal) {
if (val && val !== oldVal) {
// this.defaultOpts.xAxis.data.push(...val)
this.defaultOpts.xAxis.data = val
}
},
immediate: true
},
typeList: {
handler: function (val, oldVal) {
if (val && val !== oldVal) {
// this.defaultOpts.legend.data.push(...val)
this.defaultOpts.legend.data = val
}
},
immediate: true
},
seriesData1: {
// this.defaultOpts.series[0].data.push 会循环增加横坐标和数据,改成 =
handler: function (val, oldVal) {
if (val && val !== oldVal) {
// this.defaultOpts.series[0].data.push(...val)
this.defaultOpts.series[0].data = val
}
},
immediate: true
},
seriesData2: {
handler: function (val, oldVal) {
if (val && val !== oldVal) {
// this.defaultOpts.series[1].data.push(...val)
this.defaultOpts.series[1].data = val
}
},
immediate: true
},
seriesData3: {
// this.defaultOpts.series[0].data.push 注意
handler: function (val, oldVal) {
if (val && val !== oldVal) {
// this.defaultOpts.series[2].data.push(...val)
this.defaultOpts.series[2].data = val
}
},
immediate: true
},
seriesData4: {
handler: function (val, oldVal) {
if (val && val !== oldVal) {
// this.defaultOpts.series[3].data.push(...val)
this.defaultOpts.series[3].data = val
}
},
immediate: true
},
defaultOpts: {
handler: function (val) {
// console.log('defaullt opts change: ', val)
this.setOptions()
},
immediate: true,
deep: true
}
},
mounted() {
this.$nextTick(() => {
// console.log('echarts data1: ', this.echartsData1)
// console.log('echarts data2: ', this.echartsData2)
// console.log('echarts data3: ', this.echartsData3)
// console.log('echarts data4: ', this.echartsData4)
this.initChart()
// console.log('this.defaultOpts.xAxis.data', this.defaultOpts.xAxis.data)
this.setOptions()
window.addEventListener('resize', () => {
//监听浏览器窗口大小
this.chart.resize()
})
})
},
methods: {
initChart() {
if (!this.chart) {
this.chart = echarts.init(document.getElementById('bar-chart'))
this.chart.resize()
}
},
setOptions(opts) {
/** prop options */
if (opts) {
}
if (this.chart) this.chart.setOption(this.defaultOpts, true)
}
},
render: function (h) {
return h('div', { attrs: { id: 'bar-chart' }, style: { background: '#eee', width: '100%', height: '300px', padding: '8px' } }, '')
}
}
const dict = [i18n.t('table2'), i18n.t('graph')]
export default {
name: 'QualityInspectionCurrent',
components: { BaseTable, SmallTitle, FakeChart },
data() {
return {
echartsData1: [],
echartsData2: [],
echartsData3: [],
echartsData4: [],
count: 0,
lineIds: [],
lineList: [],
// tableConfigStatic,
tableConfigDynamic,
datetime: new Date(),
dataListStatic: [],
dataListDynamic: [],
dataList: [],
dict,
dataType: dict[0], // 表格 | 图形
showGraph: false,
// quickOptions: {
// shortcuts: [
// {
// text: i18n.t('today'),
// onClick(picker) {
// const baseTime = moment().set({ hour: 0, minute: 0, second: 0, millisecond: 0 })
// const startTime = baseTime.format('yyyy-MM-DDTHH:mm:ss')
// const endTime = baseTime.set({ hour: 23, minute: 59, second: 59, millisecond: 999 }).format('yyyy-MM-DDTHH:mm:ss')
// picker.$emit('pick', [startTime, endTime])
// }
// }
// ]
// },
echartCategories: null,
echartCheckTypes: [],
interval: null
}
},
created() {
this.getLineList()
// this.getDataList()
this.interval = setInterval(() => {
this.$message.info(i18n.t('refresh'))
// this.dataListStatic.splice(0)
this.dataListDynamic.splice(0)
this.getDataList()
}, 1000 * 5 * 60)
},
deactivated() {
if (this.interval) {
clearInterval(this.interval)
this.interval = null
}
},
methods: {
// 产线
getLineList() {
this.$http({
url: this.$http.adornUrl('/monitoring/productionLine/list'),
method: 'get'
}).then(({ data }) => {
if (data && data.code === 0) {
this.lineList = data.data
// console.log('产线数组', this.lineList)
/** set default 默认 */
// if (this.lineList.length) {
// this.lineIds = [this.lineList[this.lineList.length - 1].id]
// }
} else {
this.lineList = []
}
// 这样可以出数据
this.getDataList()
})
},
handleOperations() {},
handleDataTypeChange(value) {
this.showGraph = value === dict[0] ? false : true
},
getDataList() {
// for (var z = 0; z < this.defaultOpts.series.length; z++) {
// this.defaultOpts.series[z].data = []
// }
// this.echartCategories = []
// 下面全部要初始化,清空数据
this.echartsData1 = []
this.echartsData2 = []
this.echartsData3 = []
this.echartsData4 = []
this.dataListDynamic = []
this.dataList = []
this.count = 0
this.showGraph = false
this.dataType = i18n.t('table2')
this.echartCategories = null
this.echartCheckTypes.splice(0)
/** 设置默认日期 */
// const startTime = this.datetime[0] || moment().set({ hour: 0, minute: 0, second: 0 }).format('yyyy-MM-DDTHH:mm:ss')
// const endTime = this.datetime[1] || moment().set({ hour: 23, minute: 59, second: 59 }).format('yyyy-MM-DDTHH:mm:ss')
// console.log('this.datatime',this.datatime)
// const startTime = this.datetime ? this.datetime + '-01T00:00:00' : null
const startTime = this.datetime ? moment(this.datetime).format('YYYY-MM') + '-01T00:00:00' : null
// const endTime = this.datetime ? moment(this.datetime).format('YYYY-MM-DD') + 'T23:59:59' : null
const endTime = this.datetime ? this.getMonthSE(moment(this.datetime).format('YYYY-MM')) + 'T23:59:59' : null
/** 获取产品质量分析数据 */
// this.fetchList(startTime, endTime, lineIds).then(({ data: res }) => {
this.$http({
url: this.$http.adornUrl('/monitoring/eqAnalysis/productAnalysis'),
method: 'POST',
data: {
startTime,
endTime,
// 加个判断防止为空时传参[]报错
lineIds: this.lineIds.length == 0 ? null : this.lineIds
// lineIds: this.lineIds.length == 0 ? ["1"] : this.lineIds
}
})
.then((res) => {
// console.log('res: ', res)
/** TODO: 解析 nameData */
// 新加
this.tableConfigDynamic = [
{ type: 'index', width: 100, name: i18n.t('index') },
{ name: i18n.t('pl.name'), prop: '0' },
{ name: i18n.t('pl.sum'), prop: '1' },
...Array.from(new Set(res.data.data[0].records.map((item) => moment(item.recordTime).format('MM-DD')))).map((name) => ({ prop: String(++this.count + 1), name }))
/**
这一行无敌的,记一下:
1. '...'是扩展运算符是ES6的语法用于取出参数对象的所有可遍历属性然后拷贝到当前对象之中。例如
let foo = { ...['a', 'b', 'c'] };
foo
// {0: "a", 1: "b", 2: "c"}
2.Array.from(new Set())是JS的数组去重
3.map() 方法定义在JavaScript的Array中它返回一个新的数组数组中的元素为原始数组调用函数处理后的值。
4.moment(time).format()时间格式化
5.String(),因为prop只能接收String,需要把数字转化
6.++this.count是定义了个从0开始自增的常量count用来标注一个月每天的下标this.count++会从每个月2号开始因此是 ++this.count
7.要在getDataList() 中
this.dataList = []
this.count = 0
初始化一下,否则连续按按钮会空一个
8.因为后期加了个"合计"字段,所以++this.count + 1右移一位
*/
]
// console.log('this.tableConfigDynamic', this.tableConfigDynamic)
// this.dataListDynamic = this.parseDynamicData(res.data.data) || []
for (let i = 0; i < res.data.data.length; i++) {
this.dataListDynamic[i] = res.data.data[i].records.map((item) => item.outputNum) || []
this.dataListDynamic[i].unshift(res.data.data[i].sum)
this.dataListDynamic[i].unshift(res.data.data[i].records[i].lineName)
var json = {}
for (var j = 0; j < this.dataListDynamic[i].length; j++) {
json[j] = this.dataListDynamic[i][j]
}
this.dataList.push(json)
// console.log('this.dataList', this.dataList)
// this.dataListDynamic[i] =JSON.stringify(this.dataListDynamic[i])
}
/** echarts related */
// this.echartCategories = subProps.map((item) => item.name)
// console.log('res.data.data[0].records.map((item) => moment(item.recordTime)',res.data.data[0].records.map((item) => moment(item.recordTime).format('MM-DD')));
// 创建横坐标
this.echartCategories = res.data.data[0].records.map((item) => moment(item.recordTime).format('MM-DD'))
// this.parseTableProps(res.data.nameData)
// console.log('this.echartCategories', this.echartCategories)
// console.log('this.dataListDynamic', this.dataListDynamic)
// console.log('this.dataList', this.dataList)
this.buildGraphData()
})
.catch((err) => {
// 忽略掉0报错
// console.error(err)
})
},
setOptions(opts) {
/** prop options */
if (opts) {
}
if (this.chart) this.chart.setOption(this.defaultOpts, true)
},
// 失效函数
parseTableProps(nameData) {
const subProps = []
const labelNameMap = new Map()
// if (nameData.length) {
// /** 处理 nameData */
// nameData.forEach((item) => {
// if (!labelNameMap.get(item.name)) {
// labelNameMap.set(item.name, 1)
// subProps.push({ name: item.name, prop: item.name })
// }
// })
// }
this.tableConfigDynamic = [
{ type: 'index', width: 100, name: i18n.t('index') },
{ name: i18n.t('pl.name'), prop: '0' },
...Array.from(new Set(res.data.data[0].records.map((item) => moment(item.recordTime).format('MM-DD')))).map((name) => ({ prop: String(++this.count), name }))
]
/** echarts related */
// this.echartCategories = subProps.map((item) => item.name)
this.echartCategories = this.dataListDynamic.map((item) => item.name)
},
// parseDynamicData(data) {
// this.echartCheckTypes.splice(0)
// return data.map((item) => {
// /** echarts related */
// this.echartCheckTypes.push(item.inspectionContent)
// if (item.data.length) {
// /** 解析子数组 */
// item.data.forEach((subitem) => {
// item[subitem.dynamicName] = subitem.dynamicValue
// })
// }
// return item
// })
// },
buildGraphData() {
/** 构造 echart 需要的数据 */
const result = []
// this.echartCheckTypes.forEach((ect) => {
// result.push({ name: ect, type: 'bar', data: [] })
// })
// console.log('echartCheckTypes', this.echartCheckTypes)
// console.log('this.echartCategories', this.echartCategories)
// console.log('this.dataListDynamic', this.dataListDynamic)
// this.dataListDynamic.forEach((inspection, index) => {
// // console.log('inspection: ', inspection)
// this.echartCategories.forEach((cate) => {
// if (cate in inspection) {
// result[index].data.push(inspection[cate])
// } else {
// result[index].data.push('0')
// }
// })
// })
// this.dataListDynamic[0].shift()
// this.dataListDynamic[1].shift()
// this.dataListDynamic[2].shift()
// this.dataListDynamic[3].shift()
for (var key = 0; key < this.dataListDynamic.length; key++) {
if (this.dataListDynamic[key][0].indexOf('1') != -1) {
this.echartsData1 = this.dataListDynamic[key]
} else if (this.dataListDynamic[key][0].indexOf('2') != -1) {
this.echartsData2 = this.dataListDynamic[key]
} else if (this.dataListDynamic[key][0].indexOf('3') != -1) {
this.echartsData3 = this.dataListDynamic[key]
} else if (this.dataListDynamic[key][0].indexOf('4') != -1) {
this.echartsData4 = this.dataListDynamic[key]
}
}
// this.echartsData1 = this.dataListDynamic[0]
// this.echartsData2 = this.dataListDynamic[1]
// this.echartsData3 = this.dataListDynamic[2]
// this.echartsData4 = this.dataListDynamic[3]
// 不抛出老是报shift错误
try {
// 因为又加了“合计”字段,所以再多删除一次
this.echartsData1.shift()
this.echartsData2.shift()
this.echartsData3.shift()
this.echartsData4.shift()
this.echartsData1.shift()
this.echartsData2.shift()
this.echartsData3.shift()
this.echartsData4.shift()
} catch (error) {}
// this.echartsData = result
// console.log('this.echartsData1', this.echartsData1)
// [
// { name: '11', type: 'bar', data: [/**产线1*/ 2, /**产线2*/ 3] },
// { name: '222', type: 'bar', data: [1, 2, 3] }
// ]
// 没有数据的产线legend隐藏
if (this.echartsData1.length !== 0) {
this.echartCheckTypes.push(this.$t('eq.line1'))
}
if (this.echartsData2.length !== 0) {
this.echartCheckTypes.push(this.$t('eq.line2'))
}
if (this.echartsData3.length !== 0) {
this.echartCheckTypes.push(this.$t('eq.line3'))
}
if (this.echartsData4.length !== 0) {
this.echartCheckTypes.push(this.$t('eq.line4'))
}
// console.log('this.echartCheckTypes', this.echartCheckTypes)
// console.log(this.echartsData1.length)
// console.log(this.echartsData2.length)
// console.log(this.echartsData3)
// console.log(this.echartsData4)
},
fetchList(startTime, endTime, lineIds) {
this.$http({
url: this.$http.adornUrl('/monitoring/eqAnalysis/productQualityAnalysis'),
method: 'POST',
data: {
startTime,
endTime,
lineIds: this.lineIds
}
}).catch((err) => {
console.error(err)
})
},
/**
* 默认当前月
* date 带月份的日期2021-8
* 返回月初至月末数组,例:[2021-8-1, 2021-8-31]
*/
getMonthSE(date) {
let nowdays = date ? new Date(date) : new Date()
let year = nowdays.getFullYear()
let month = nowdays.getMonth() + 1
if (month < 10) {
month = '0' + month
}
let myDate = new Date(year, month, 0)
let startDate = year + '-' + month + '-01'
let endDate = year + '-' + month + '-' + myDate.getDate()
// return [startDate, endDate]
return endDate
}
// 数组转对象
// toObject(pairs) {
// return Array.from(pairs).reduce((acc, [key, value]) => Object.assign(acc, { [key]: value }), {})
// }
}
}
</script>
<style scoped>
.base-container {
min-height: 60vh;
background: #fff;
padding: 12px;
}
.buttonColor {
color: #fff;
background: #0b58ff;
}
.el-month-table td.today .cell {
font-weight: normal;
color: #000 !important;
}
.el-month-table td.current:not(.disabled) .cell{
color: #ffffff;
font-weight: bold !important;
background-color: var(--el-datepicker-active-color);
border-radius: 100px;
}
</style>

View File

@@ -0,0 +1,744 @@
<template>
<div class="mod-config">
<el-form :inline="true" @keyup.enter.native="getDataList()" class="blueTip" size="small">
<el-form-item>
{{ $t('pl.name') }}
</el-form-item>
<el-form-item>
<el-select v-model="lineIds" :placeholder="$t('pl.name')" clearable filterable multiple>
<el-option v-for="line in lineList" :key="line.code" :value="line.id" :label="line.name" />
</el-select>
</el-form-item>
<el-form-item>
{{ $t('time') }}
</el-form-item>
<el-form-item>
<!-- type="datetimerange" -->
<!-- <el-date-picker
type="daterange"
v-model="datetime"
value-format="yyyy-MM-ddTHH:mm:ss"
:start-placeholder="$t('startTime')"
:end-placeholder="$t('endTime')"
:range-separator="$t('to')"
:default-time="['00:00:00', '23:59:59']"
:picker-options="quickOptions"
clearable /> -->
<el-date-picker v-model="datetime" type="date" :placeholder="$t('hints.date')" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
</el-form-item>
<el-form-item>
<el-button class="buttonColor" @click="getDataList()">{{ $t('query') }}</el-button>
<!-- <el-button v-if="$hasPermission('monitoring:qualityinspectionrecord:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> -->
</el-form-item>
</el-form>
<div class="quality-inspection-current base-container">
<!-- <el-row>
<el-col>
<small-title :size="'md'">{{ $t('inspect.ioTotal') }}</small-title>
<el-row style="margin-top: 12px;">
<base-table :data="dataListStatic" :table-head-configs="tableConfigStatic" :max-height="500" @operate-event="handleOperations" @refreshDataList="getDataList" />
</el-row>
</el-col>
</el-row> -->
<!-- style="margin-top: 28px;" -->
<el-row>
<el-col>
<el-row>
<small-title :size="'md'">{{ $t('eq.productQuality') }}</small-title>
</el-row>
<el-row style="margin-top: 8px">
<el-radio-group v-model="dataType" size="medium" @change="handleDataTypeChange">
<el-radio-button :label="$t('table2')"></el-radio-button>
<el-radio-button :label="$t('graph')"></el-radio-button>
</el-radio-group>
</el-row>
<el-row style="margin-top: 12px">
<div style="text-align: right">
<!-- 设置设备名称小齿轮table列的图标 -->
<el-popover width="200" trigger="click" v-if="showGraph">
<div class="box">
<!-- :label="item.name ? item.name : item.label" 三元判别就可以让厂务的实时数据可以显示 -->
<el-checkbox
v-for="(item, index) in echartCategories"
:key="'cb' + index"
v-model="selectedBox[index]"
:label="item"
@change="checkboxChange(echartCategories)" />
</div>
<i slot="reference" class="el-icon-s-tools" style="color: #0b58ff">{{ $t('pl.choose') }}</i>
</el-popover>
</div>
<base-table
v-if="!showGraph"
:data="dataListDynamic"
:table-head-configs="tableConfigDynamic"
:max-height="500"
@operate-event="handleOperations"
@refreshDataList="getDataList" />
<!-- :series-data="echartsData" -->
<fake-chart v-else :categories="echartRealtime" :type-list="echartCheckTypes" :series-data1="echartsData1" :series-data2="echartsData2" :pass-rate="pass" />
</el-row>
</el-col>
</el-row>
</div>
</div>
</template>
<script>
import { calcMaxHeight } from '@/utils'
import { timeFilter } from '@/utils/filters'
import moment from 'moment'
import i18n from '@/i18n'
import BaseTable from '@/components/base-table'
import SmallTitle from '@/components/small-title'
import * as echarts from 'echarts'
// const tableConfigStatic = [
// { type: 'index', width: 100, name: i18n.t('index') },
// { name: i18n.t('pl.title'), prop: 'lineName' },
// { name: i18n.t('inspect.inTotal'), prop: 'sumUp' },
// { name: i18n.t('inspect.outTotal'), prop: 'sumDown' },
// { name: i18n.t('inspect.checkTotal'), prop: 'sumCheck' },
// { name: i18n.t('inspect.rate'), prop: 'scrapRatio', filter: (val) => (val || val === 0 ? `${val}%` : '-') }
// ]
const tableConfigDynamic = [
{ type: 'index', width: 100, name: i18n.t('index') },
{ name: i18n.t('eq.sectionName'), prop: 'sectionName' },
// ...subProps,
{ name: i18n.t('eq.equipmentName'), prop: 'equipmentName' },
{ name: i18n.t('eq.okNum'), prop: 'okNum' },
{ name: i18n.t('eq.nokNum'), prop: 'nokNum' },
{ name: i18n.t('eq.passRate'), prop: 'passRate', filter: (val) => (val || val === 0 ? `${val}%` : '-') }
]
const FakeChart = {
name: 'FakeChart',
props: {
categories: {
type: Array,
default: () => []
},
typeList: {
type: Array,
default: () => []
},
seriesData1: {
type: Array,
default: () => []
},
seriesData2: {
type: Array,
default: () => []
},
passRate: {
type: Array,
default: () => []
}
},
data() {
return {
// selectedBox: new Array(100).fill(true),
calcMaxHeight,
chart: null,
// 新加
echartsData1: [],
echartsData2: [],
pass: [],
defaultOpts: {
grid: {
left: '5%',
right: '12%',
top: '20%',
bottom: '22%'
},
title: {
text: i18n.t('eq.productQuality')
},
tooltip: {
trigger: 'axis', //坐标轴触发,主要在柱状图,折线图等会使用类目轴的图表中使用
axisPointer: {
// 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
toolbox: {
feature: {
dataView: {
show: true,
readOnly: true,
optionToContent: function (opt) {
var axisData = opt.xAxis[0].data
var series = opt.series
//验证是否是中文
var pattern = new RegExp('[\u4E00-\u9FA5]+')
if (pattern.test(series[0].name)) {
var table =
'<table class="layui-table" style="width:100%;text-align:center"><tbody><tr>' +
'<td>设备名称</td>' +
'<td>' +
series[0].name +
'</td>' +
'<td>' +
series[1].name +
'</td>' +
'<td>' +
series[2].name +
'</td>' +
'</tr>'
} else {
var table =
'<table class="layui-table" style="width:100%;text-align:center"><tbody><tr>' +
'<td>Equipment Name</td>' +
'<td>' +
series[0].name +
'</td>' +
'<td>' +
series[1].name +
'</td>' +
'<td>' +
series[2].name +
'</td>' +
'</tr>'
}
for (var i = 0, l = axisData.length; i < l; i++) {
table +=
'<tr>' +
'<td>' +
axisData[i] +
'</td>' +
'<td>' +
series[0].data[i] +
'</td>' +
'<td>' +
series[1].data[i] +
'</td>' +
'<td>' +
series[2].data[i] +
'</td>' +
'</tr>'
}
table += '</tbody></table>'
return table
}
},
restore: { show: true },
saveAsImage: { show: true }
}
},
legend: {
// orient: 'vertical',
// type: 'scroll',
// top: 10,
// right: 0,
// width: '12%',
/** 修复文本太长时显示问题 */
// formatter: function (name) {
// return echarts.format.truncateText(name, 120, '14px Microsoft Yahei', '...')
// },
tooltip: {
show: true
},
/** end */
data: [i18n.t('eq.okNum'), i18n.t('eq.nokNum'), i18n.t('eq.passRatePercent')]
},
xAxis: {
type: 'category',
axisTick: {
alignWithLabel: true
},
data: [],
// axisLine: {
// show: true,
// lineStyle: {
// color: 'rgba(219,225,255,1)',
// width: 1,
// type: 'solid'
// }
// },
axisLabel: {
//设置x轴的字
show: true,
interval: 0 //使x轴横坐标全部显示
// textStyle: {
// //x轴字体样式
// color: 'rgba(219,225,255,1)',
// margin: 15
// }
}
// data: ['下片1', '上片1', '磨边机1', '设备13', '钢化炉2', '磨边机2', '设备15', '清洗机1', '钢化炉3']
},
yAxis: [
{
type: 'value',
name: i18n.t('eq.okNum'),
position: 'left',
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: '#5470C6'
}
},
axisLabel: {
// formatter: '{value} pcs'
}
},
{
type: 'value',
name: i18n.t('eq.nokNum'),
position: 'right',
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: '#91CC75'
}
},
axisLabel: {
// formatter: '{value} pcs'
}
},
{
type: 'value',
name: i18n.t('eq.passRatePercent'),
position: 'right',
offset: 80,
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: '#FAC857'
}
},
axisLabel: {
formatter: '{value} %'
}
}
],
dataZoom: [
{
type: 'slider',
start: 0,
end: 100,
// 最大的放大是图形的2%
// maxSpan: 2
},
{
start: 0,
end: 10
}
],
series: [
// dynamic
{
name: i18n.t('eq.okNum'),
type: 'bar',
data: [],
label: {
normal: {
show: true,
position: 'top'
},
formatter: '{@value}'
}
// data: ['314', '1813', '136', '2202', '9895', '0', '411', '0', '2050']
},
{
name: i18n.t('eq.nokNum'),
type: 'bar',
yAxisIndex: 1,
data: [],
label: {
normal: {
show: true,
position: 'top'
},
formatter: '{@value}'
}
// data: ['62', '39', '21', '23', '40', '0', '3', '0', '4']
},
{
name: i18n.t('eq.passRatePercent'),
type: 'line',
yAxisIndex: 2,
data: [],
label: {
normal: {
show: true,
position: 'top'
},
formatter: '{@value}'
}
// data: ['62', '39', '21', '23', '40', '0', '3', '0', '4']
}
// {
// data: [120, 200, 150, 80, 70, 110, 130],
// type: 'bar'
// }
]
}
}
},
watch: {
categories: {
handler: function (val, oldVal) {
if (val && val !== oldVal) {
// this.defaultOpts.xAxis.data.push(...val)
this.defaultOpts.xAxis.data = val
}
},
immediate: true
},
typeList: {
handler: function (val, oldVal) {
if (val && val !== oldVal) {
this.defaultOpts.legend.data.push(...val)
}
},
immediate: true
},
seriesData1: {
// this.defaultOpts.series[0].data.push 注意
handler: function (val, oldVal) {
if (val && val !== oldVal) {
// this.defaultOpts.series[0].data.push(...val)
this.defaultOpts.series[0].data = val
}
},
immediate: true
},
seriesData2: {
handler: function (val, oldVal) {
if (val && val !== oldVal) {
this.defaultOpts.series[1].data = val
}
},
immediate: true
},
passRate: {
handler: function (val, oldVal) {
if (val && val !== oldVal) {
this.defaultOpts.series[2].data = val
}
},
immediate: true
},
defaultOpts: {
handler: function (val) {
// console.log('defaullt opts change: ', val)
this.setOptions()
},
immediate: true,
deep: true
}
},
mounted() {
this.$nextTick(() => {
// console.log('echarts data1: ', this.echartsData1)
// console.log('echarts data2: ', this.echartsData2)
// console.log('passRate', this.pass)
this.initChart()
// console.log('this.defaultOpts.xAxis.data', this.defaultOpts.xAxis.data)
this.setOptions()
window.addEventListener('resize', () => {
//监听浏览器窗口大小
this.chart.resize()
})
})
},
methods: {
initChart() {
if (!this.chart) {
this.chart = echarts.init(document.getElementById('bar-chart'))
}
},
setOptions(opts) {
/** prop options */
if (opts) {
}
if (this.chart) this.chart.setOption(this.defaultOpts)
}
},
render: function (h) {
return h('div', { attrs: { id: 'bar-chart' }, style: { background: '#eee', width: '100%', height: '300px', padding: '8px' } }, '')
}
}
const dict = [i18n.t('table2'), i18n.t('graph')]
export default {
name: 'QualityInspectionCurrent',
components: { BaseTable, SmallTitle, FakeChart },
data() {
return {
selectedBox: new Array(100).fill(true),
lineIds: [],
lineList: [],
// tableConfigStatic,
tableConfigDynamic,
dataListStatic: [],
dataListDynamic: [],
dict,
dataType: dict[0], // 表格 | 图形
showGraph: false,
// datetime: [],
datetime: new Date(),
// quickOptions: {
// shortcuts: [
// {
// text: i18n.t('today'),
// onClick(picker) {
// const baseTime = moment().set({ hour: 0, minute: 0, second: 0, millisecond: 0 })
// const startTime = baseTime.format('yyyy-MM-DDTHH:mm:ss')
// const endTime = baseTime.set({ hour: 23, minute: 59, second: 59, millisecond: 999 }).format('yyyy-MM-DDTHH:mm:ss')
// picker.$emit('pick', [startTime, endTime])
// }
// }
// ]
// },
echartCategories: null,
echartRealtime: [],
echartCheckTypes: [],
interval: null
}
},
created() {
this.getLineList()
this.getDataList()
this.interval = setInterval(() => {
this.$message.info(i18n.t('refresh'))
// this.dataListStatic.splice(0)
this.dataListDynamic.splice(0)
this.getDataList()
}, 1000 * 5 * 60)
},
beforeMount() {
this.selectedBox = new Array(100).fill(true)
},
deactivated() {
if (this.interval) {
clearInterval(this.interval)
this.interval = null
}
},
methods: {
// 产线
getLineList() {
this.$http({
url: this.$http.adornUrl('/monitoring/productionLine/list'),
method: 'get'
}).then(({ data }) => {
if (data && data.code === 0) {
this.lineList = data.data
// console.log('产线数组',this.lineList);
} else {
this.lineList = []
}
})
},
handleOperations() {},
handleDataTypeChange(value) {
this.showGraph = value === dict[0] ? false : true
},
getDataList() {
// this.echartsData1 = []
// this.echartsData2 = []
// this.pass = []
this.showGraph = false
this.dataType = i18n.t('table2')
this.echartCategories = null
this.echartCheckTypes.splice(0)
this.echartRealtime = []
// 更新下checkbox全选
this.selectedBox = new Array(100).fill(true)
/** 设置默认日期 */
// const startTime = this.datetime[0] || moment().set({ hour: 0, minute: 0, second: 0 }).format('yyyy-MM-DDTHH:mm:ss')
// const endTime = this.datetime[1] || moment().set({ hour: 23, minute: 59, second: 59 }).format('yyyy-MM-DDTHH:mm:ss')
// console.log('this.datatime',this.datatime)
// const startTime = this.datetime ? this.datetime + 'T00:00:00' : null
const startTime = this.datetime ? moment(this.datetime).format('YYYY-MM-DD') + 'T00:00:00' : null
// const endTime = this.datetime ? this.datetime + 'T23:59:59' : null
const endTime = this.datetime ? moment(this.datetime).format('YYYY-MM-DD') + 'T23:59:59' : null
const lineIds = this.lineIds
/** 获取产品质量分析数据 */
// this.fetchList(startTime, endTime, lineIds).then(({ data: res }) => {
this.$http({
url: this.$http.adornUrl('/monitoring/eqAnalysis/productQualityAnalysis'),
method: 'POST',
data: {
startTime,
endTime,
lineIds: this.lineIds.length == 0 ? null : this.lineIds
}
})
.then((res) => {
// console.log('res: ', res)
/** TODO: 解析 nameData */
// 新加
this.tableConfigDynamic = [
{ type: 'index', width: 100, name: i18n.t('index') },
{ name: i18n.t('eq.sectionName'), prop: 'sectionName' },
// ...subProps,
{ name: i18n.t('eq.equipmentName'), prop: 'equipmentName' },
{ name: i18n.t('eq.okNum'), prop: 'okNum' },
{ name: i18n.t('eq.nokNum'), prop: 'nokNum' },
{ name: i18n.t('eq.passRate'), prop: 'passRate', filter: (val) => (val || val === 0 ? `${val}%` : '-') }
]
// this.dataListDynamic = this.parseDynamicData(res.data.data) || []
this.dataListDynamic = res.data.data || []
/** echarts related */
// this.echartCategories = subProps.map((item) => item.name)
this.echartCategories = this.dataListDynamic.map((item) => {
return item.equipmentName
})
this.echartRealtime = this.echartCategories
// this.parseTableProps(res.data.nameData)
console.log('this.dataListDynamic', this.dataListDynamic)
this.buildGraphData()
})
.catch((err) => {
console.error(err)
})
},
// parseTableProps(nameData) {
// const subProps = []
// const labelNameMap = new Map()
// // if (nameData.length) {
// // /** 处理 nameData */
// // nameData.forEach((item) => {
// // if (!labelNameMap.get(item.name)) {
// // labelNameMap.set(item.name, 1)
// // subProps.push({ name: item.name, prop: item.name })
// // }
// // })
// // }
// this.tableConfigDynamic = [
// { type: 'index', width: 100, name: i18n.t('index') },
// { name: i18n.t('eq.sectionName'), prop: 'sectionName' },
// // ...subProps,
// { name: i18n.t('eq.equipmentName'), prop: 'equipmentName' },
// { name: i18n.t('eq.okNum'), prop: 'okNum' },
// { name: i18n.t('eq.nokNum'), prop: 'nokNum' },
// { name: i18n.t('eq.passRate'), prop: 'passRate', filter: (val) => (val || val === 0 ? `${val}%` : '-') }
// ]
// /** echarts related */
// // this.echartCategories = subProps.map((item) => item.name)
// this.echartCategories = this.dataListDynamic.map((item) => item.name)
// },
// parseDynamicData(data) {
// this.echartCheckTypes.splice(0)
// return data.map((item) => {
// /** echarts related */
// this.echartCheckTypes.push(item.inspectionContent)
// if (item.data.length) {
// /** 解析子数组 */
// item.data.forEach((subitem) => {
// item[subitem.dynamicName] = subitem.dynamicValue
// })
// }
// return item
// })
// },
buildGraphData() {
/** 构造 echart 需要的数据 */
const result = []
// this.echartCheckTypes.forEach((ect) => {
// result.push({ name: ect, type: 'bar', data: [] })
// })
// console.log('echartCheckTypes', this.echartCheckTypes)
// console.log('this.echartCategories', this.echartCategories)
// this.dataListDynamic.forEach((inspection, index) => {
// // console.log('inspection: ', inspection)
// this.echartCategories.forEach((cate) => {
// if (cate in inspection) {
// result[index].data.push(inspection[cate])
// } else {
// result[index].data.push('0')
// }
// })
// })
// 新建一个echartRealtime来保存修改checkbox后实时的横坐标数据
// this.echartRealtime = this.echartCategories
this.echartsData1 = []
this.echartsData2 = []
this.pass = []
// 尝试写个改变checkbox时触发改变this.echartCategories
// console.log('this.echartRealtime1', this.echartRealtime)
// 初始化
this.echartRealtime = []
// 根据selectedBox的真假动态生成横坐标和数值运用了数组与元素合并
for (let i = 0; i < this.echartCategories.length; i++) {
if (this.selectedBox[i] == true) {
// console.log('this.echartCategories.slice(i)',this.echartCategories.slice(i))
// console.log(
// 'this.dataListDynamic.map((item) => item.okNum)',
// this.dataListDynamic.map((item) => item.okNum)
// )
this.echartRealtime = [...this.echartRealtime, ...this.echartCategories.slice(i, i + 1)]
this.echartsData1 = [...this.echartsData1, this.dataListDynamic.map((item) => item.okNum)[i]]
this.echartsData2 = [...this.echartsData2, this.dataListDynamic.map((item) => item.nokNum)[i]]
this.pass = [...this.pass, this.dataListDynamic.map((item) => item.passRate)[i]]
}
}
// console.log('this.echartRealtime2', this.echartRealtime)
// console.log('this.echartsData1', this.echartsData1)
// this.echartsData = result
// console.log('result', result)
// [
// { name: '11', type: 'bar', data: [/**产线1*/ 2, /**产线2*/ 3] },
// { name: '222', type: 'bar', data: [1, 2, 3] }
// ]
},
fetchList(startTime, endTime, lineIds) {
this.$http({
url: this.$http.adornUrl('/monitoring/eqAnalysis/productQualityAnalysis'),
method: 'POST',
data: {
startTime,
endTime,
lineIds: this.lineIds
}
}).catch((err) => {
console.error(err)
})
},
checkboxChange(val) {
// console.log('val', val)
// console.log('this.selectedBox', this.selectedBox)
this.buildGraphData()
// console.log('this.echartCategories', this.echartCategories)
// console.log('val',val)
}
}
}
</script>
<style scoped>
.base-container {
min-height: 60vh;
background: #fff;
padding: 12px;
}
.buttonColor {
color: #fff;
background: #0b58ff;
}
</style>

View File

@@ -61,7 +61,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'), filter: (val) => (val === 0 || val === 1 || val === 2) && ['停止', '运行', '未知'][val] },
{ prop: 'status', name: i18n.t('pl.status'), filter: (val) => (val === 0 || val === 1 || val === 2) && [i18n.t('stop'), i18n.t('run'), i18n.t('unknown')][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'] }

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
<el-form-item label="产线id" prop="productionLineId">
<el-input v-model="dataForm.productionLineId" placeholder="产线id"></el-input>
</el-form-item>

View File

@@ -75,7 +75,7 @@ const tableConfigs = [
},
{ prop: 'inspectionDetContent', name: i18n.t('andeng.inspectContent') }, // name: '检测内容' },
{ prop: 'keyValue', name: i18n.t('andeng.btnVal') }, // name: '按钮值' },
{ prop: 'model', name: i18n.t('andeng.btnBoxModel') }, // name: '按钮盒模式' },
{ prop: 'buttonId', name: i18n.t('buttonId') }, // name: '网关号' },
{
prop: 'operations',
@@ -145,7 +145,9 @@ const addOrUpdateConfigs = {
required: true,
type: 'select',
options: []
}
},
{ name: 'buttonId', label: i18n.t('buttonId') },
{ name: 'boxNo', label: i18n.t('boxNo') }
],
operations: [
{ name: 'cancel', showAlways: true },
@@ -334,14 +336,15 @@ 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 }))
// console.log('item',item)
if (item.name === 'inspectionDetContent') item.options = res.data.list.map((item) => ({ label: item.content, value: item.content, inspectionDetId: item.id }))
// console.log('this.addOrUpdateConfigs.fields[4].options', this.addOrUpdateConfigs.fields[4].options)
})
} else {
this.addOrUpdateConfigs.fields.forEach((item) => {
if (item.name === 'inspectionDetContent') item.options.splice(0)
})
}
// console.log('this.addOrUpdateConfigs.fields[4]检测内容',this.addOrUpdateConfigs)
})
},
// 每页数
@@ -375,16 +378,20 @@ export default {
}
case 'inspectionDetContent':
// this.dataForm.inspectionDetId = id
// console.log(id)
// console.log('name',name)
// console.log('id',id)
// console.log(this.addOrUpdateConfigs.fields[4].options)
for (var i = 0; i < this.addOrUpdateConfigs.fields[4].options.length; i++) {
if (this.addOrUpdateConfigs.fields[4].options[i].label == id) {
this.dataForm.inspectionDetId = this.addOrUpdateConfigs.fields[4].options[i].inspectionDetId
this.addOrUpdateConfigs.fields.inspectionDetId = this.addOrUpdateConfigs.fields[4].options[i].inspectionDetId
// this.addOrUpdateConfigs.fields[6].inspectionDetId = this.addOrUpdateConfigs.fields[4].options[i].inspectionDetId
// console.log('this.addOrUpdateConfigs.fields.inspectionDetId', this.addOrUpdateConfigs.fields)
// this.addOrUpdateConfigs.fields.push({name:'inspectionDetId'})
}
}
console.log('dataForm', this.dataForm)
console.log('addOrUpdateConfigs', this.addOrUpdateConfigs.fields)
// console.log('dataForm', this.dataForm)
// console.log('addOrUpdateConfigs', this.addOrUpdateConfigs.fields)
}
},
addSuccess() {

View File

@@ -1,22 +1,34 @@
<template>
<div class="mod-config">
<el-form :inline="true" @keyup.enter.native="getDataList()" class="blueTip" size="small">
<el-form-item>
{{ $t('time')}}
<!-- <el-form-item>
{{ $t('time') }}
</el-form-item>
<el-form-item>
<!-- type="datetimerange" -->
type="datetimerange"
:default-time="['00:00:00', '23:59:59']"
<el-date-picker
type="daterange"
v-model="datetime"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-ddTHH:mm:ss"
:start-placeholder="$t('startTime')"
:end-placeholder="$t('endTime')"
:range-separator="$t('to')"
:default-time="['00:00:00', '23:59:59']"
:picker-options="quickOptions"
clearable
/>
clearable />
</el-form-item> -->
<el-form-item>
{{ $t('startTime') }}
</el-form-item>
<el-form-item>
<el-date-picker v-model="startTime" type="datetime" :placeholder="$t('hints.date')" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-ddTHH:mm:ss" />
</el-form-item>
<el-form-item>
{{ $t('endTime') }}
</el-form-item>
<el-form-item>
<el-date-picker v-model="endTime" type="datetime" :placeholder="$t('hints.date')" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-ddTHH:mm:ss" />
</el-form-item>
<el-form-item>
<el-button class="buttonColor" @click="getDataList()">{{ $t('query') }}</el-button>
@@ -28,32 +40,31 @@
<el-row>
<el-col>
<small-title :size="'md'">{{ $t('inspect.ioTotal') }}</small-title>
<el-row style="margin-top: 12px;">
<el-row style="margin-top: 12px">
<base-table :data="dataListStatic" :table-head-configs="tableConfigStatic" :max-height="500" @operate-event="handleOperations" @refreshDataList="getDataList" />
</el-row>
</el-col>
</el-row>
<el-row style="margin-top: 28px;">
<el-row style="margin-top: 28px">
<el-col>
<el-row>
<small-title :size="'md'">{{ $t('inspect.plTotal') }}</small-title>
</el-row>
<el-row style="margin-top: 8px;">
<el-row style="margin-top: 8px">
<el-radio-group v-model="dataType" size="medium" @change="handleDataTypeChange">
<el-radio-button :label="$t('table2')"></el-radio-button>
<el-radio-button :label="$t('graph')"></el-radio-button>
</el-radio-group>
</el-row>
<el-row style="margin-top: 12px;">
<el-row style="margin-top: 12px">
<base-table
v-if="!showGraph"
:data="dataListDynamic"
:table-head-configs="tableConfigDynamic"
:max-height="500"
@operate-event="handleOperations"
@refreshDataList="getDataList"
/>
@refreshDataList="getDataList" />
<fake-chart v-else :categories="echartCategories" :type-list="echartCheckTypes" :series-data="echartsData" />
</el-row>
</el-col>
@@ -77,7 +88,7 @@ const tableConfigStatic = [
{ name: i18n.t('inspect.inTotal'), prop: 'sumUp' },
{ name: i18n.t('inspect.outTotal'), prop: 'sumDown' },
{ name: i18n.t('inspect.checkTotal'), prop: 'sumCheck' },
{ name: i18n.t('inspect.rate'), prop: 'scrapRatio', filter: val => (val || val === 0 ? `${val}%` : '-') }
{ name: i18n.t('inspect.rate'), prop: 'scrapRatio', filter: (val) => (val || val === 0 ? `${val}%` : '-') }
]
const tableConfigDynamic = [
{ type: 'index', width: 100, name: i18n.t('index') },
@@ -125,7 +136,7 @@ const FakeChart = {
right: 0,
width: '12%',
/** 修复文本太长时显示问题 */
formatter: function(name) {
formatter: function (name) {
return echarts.format.truncateText(name, 120, '14px Microsoft Yahei', '...')
},
tooltip: {
@@ -153,7 +164,7 @@ const FakeChart = {
},
watch: {
categories: {
handler: function(val, oldVal) {
handler: function (val, oldVal) {
if (val && val !== oldVal) {
this.defaultOpts.xAxis.data.push(...val)
}
@@ -161,7 +172,7 @@ const FakeChart = {
immediate: true
},
typeList: {
handler: function(val, oldVal) {
handler: function (val, oldVal) {
if (val && val !== oldVal) {
this.defaultOpts.legend.data.push(...val)
}
@@ -169,7 +180,7 @@ const FakeChart = {
immediate: true
},
seriesData: {
handler: function(val, oldVal) {
handler: function (val, oldVal) {
if (val && val !== oldVal) {
this.defaultOpts.series.push(...val)
}
@@ -177,8 +188,8 @@ const FakeChart = {
immediate: true
},
defaultOpts: {
handler: function(val) {
console.log('defaullt opts change: ', val)
handler: function (val) {
// console.log('defaullt opts change: ', val)
this.setOptions()
},
immediate: true,
@@ -205,7 +216,7 @@ const FakeChart = {
if (this.chart) this.chart.setOption(this.defaultOpts)
}
},
render: function(h) {
render: function (h) {
return h('div', { attrs: { id: 'bar-chart' }, style: { background: '#eee', width: '100%', height: '300px', padding: '8px' } }, '')
}
}
@@ -224,6 +235,8 @@ export default {
dataType: dict[0], // 表格 | 图形
showGraph: false,
datetime: [],
startTime: '',
endTime: '',
quickOptions: {
shortcuts: [
{
@@ -269,16 +282,10 @@ export default {
this.echartCategories = null
this.echartCheckTypes.splice(0)
/** 设置默认日期 */
const startTime =
this.datetime[0] ||
moment()
.set({ hour: 0, minute: 0, second: 0 })
.format('yyyy-MM-DDTHH:mm:ss')
const endTime =
this.datetime[1] ||
moment()
.set({ hour: 23, minute: 59, second: 59 })
.format('yyyy-MM-DDTHH:mm:ss')
// const startTime = this.datetime[0] || moment().set({ hour: 0, minute: 0, second: 0 }).format('yyyy-MM-DDTHH:mm:ss')
// const endTime = this.datetime[1] || moment().set({ hour: 23, minute: 59, second: 59 }).format('yyyy-MM-DDTHH:mm:ss')
const startTime = this.startTime
const endTime = this.endTime
/** [1] 获取上下片数据 */
this.fetchList('sx', startTime, endTime).then(({ data: res }) => {
@@ -287,11 +294,12 @@ export default {
})
/** [2] 获取产线检测类型 */
this.fetchList('pl', startTime, endTime).then(({ data: res }) => {
// console.log('pl: ', res)
// console.log('res: ', res)
/** TODO: 解析 nameData */
this.parseTableProps(res.data.nameData)
this.dataListDynamic = this.parseDynamicData(res.data.data) || []
// console.log('this.dataListDynamic', this.dataListDynamic)
this.buildGraphData()
})
@@ -303,7 +311,7 @@ export default {
if (nameData.length) {
/** 处理 nameData */
nameData.forEach(item => {
nameData.forEach((item) => {
if (!labelNameMap.get(item.name)) {
labelNameMap.set(item.name, 1)
subProps.push({ name: item.name, prop: item.name })
@@ -316,21 +324,22 @@ export default {
{ name: i18n.t('inspect.det'), prop: 'inspectionContent' },
...subProps,
{ name: i18n.t('inspect.typetotal'), prop: 'sumInput' },
{ name: i18n.t('inspect.rate'), prop: 'scrapRatio', filter: val => (val || val === 0 ? `${val}%` : '-') }
{ name: i18n.t('inspect.rate'), prop: 'scrapRatio', filter: (val) => (val || val === 0 ? `${val}%` : '-') }
]
/** echarts related */
this.echartCategories = subProps.map(item => item.name)
this.echartCategories = subProps.map((item) => item.name)
// console.log('this.echartCategories',this.echartCategories)
},
parseDynamicData(data) {
this.echartCheckTypes.splice(0)
return data.map(item => {
return data.map((item) => {
/** echarts related */
this.echartCheckTypes.push(item.inspectionContent)
if (item.data.length) {
/** 解析子数组 */
item.data.forEach(subitem => {
item.data.forEach((subitem) => {
item[subitem.dynamicName] = subitem.dynamicValue
})
}
@@ -342,13 +351,15 @@ export default {
/** 构造 echart 需要的数据 */
const result = []
this.echartCheckTypes.forEach(ect => {
this.echartCheckTypes.forEach((ect) => {
result.push({ name: ect, type: 'bar', data: [] })
})
// console.log('result', result)
// console.log('echartCheckTypes',this.echartCheckTypes);
// console.log('this.echartCategories',this.echartCategories);
this.dataListDynamic.forEach((inspection, index) => {
console.log('inspection: ', inspection)
this.echartCategories.forEach(cate => {
// console.log('inspection: ', inspection)
this.echartCategories.forEach((cate) => {
if (cate in inspection) {
result[index].data.push(inspection[cate])
} else {
@@ -363,7 +374,7 @@ export default {
// { name: '222', type: 'bar', data: [1, 2, 3] }
// ]
console.log('echarts data: ', this.echartsData)
// console.log('echarts data: ', this.echartsData)
},
fetchList(type, startTime, endTime) {
@@ -376,7 +387,7 @@ export default {
startTime,
endTime
}
}).catch(err => {
}).catch((err) => {
console.error(err)
})
case 'pl':
@@ -387,7 +398,7 @@ export default {
startTime,
endTime
}
}).catch(err => {
}).catch((err) => {
console.error(err)
})
}

View File

@@ -205,7 +205,7 @@ export default {
limit: 9999999
})
}).then(({ data: res }) => {
console.log('insdet:', res)
// console.log('insdet:', res)
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 })) || []

View File

@@ -2,14 +2,14 @@
* @Author: lb
* @Date: 2022-06-22 14:00:17
* @LastEditors: fzq
* @LastEditTime: 2023-02-08 16:50:05
* @LastEditTime: 2023-02-09 09:36:38
* @Description: 设备生产实时数据
-->
<template>
<div>
<div class="app-container">
<small-title :size="'md'">{{ $t('realtime.eq') }}</small-title>
<base-table v-if="loadTable" :table-head-configs="tableProps" :data="tableData.length ? tableData : []" :span-method="spanMethod" align= "center"/>
<base-table v-if="loadTable" :table-head-configs="tableProps" :data="tableData.length ? tableData : []" :span-method="spanMethod"/>
</div>
</div>
</template>
@@ -59,7 +59,7 @@ export default {
}
})
}, 1000 * 60 * 5)
console.log(this.tableProps)
// console.log(this.tableProps)
},
// beforeDestroy() {
// console.log('before destroyed...')
@@ -134,8 +134,8 @@ export default {
children: [
{ prop: obj.recordTime + '-inputNum', label: i18n.t('realtime.in') },
{ prop: obj.recordTime + '-outputNum', label: i18n.t('realtime.out') },
{ prop: obj.recordTime + '-scrapNum', label: i18n.t('realtime.data') },
{ prop: obj.recordTime + '-scrapRate', label: i18n.t('realtime.rate'), filter: val => (val !== '-' ? `${val.toFixed(2)}%` : '-') }
// { prop: obj.recordTime + '-scrapNum', label: i18n.t('realtime.data') },
// { prop: obj.recordTime + '-scrapRate', label: i18n.t('realtime.rate'), filter: val => (val !== '-' ? `${val.toFixed(2)}%` : '-') }
]
})
}

View File

@@ -2,7 +2,7 @@
* @Author: lb
* @Date: 2022-06-22 14:00:17
* @LastEditors: fzq
* @LastEditTime: 2023-02-07 16:23:23
* @LastEditTime: 2023-02-09 09:53:57
* @Description: 产线生产实时数据
-->
<template>
@@ -38,20 +38,26 @@ export default {
},
mounted() {
console.log('this.$route', this.$route)
// console.log('this.$route', this.$route)
this.clearData()
// this.fetchList().then(({ data: res }) => {
// // console.log('fetchlist:', res)
// this.testData = res
// this.handleData()
// if (res.code === 200 || this.$route.fullPath !== '/monitoring-realtimeProductLine') {
// // 获取数据显示成功后关闭loading
// loading.close()
// } else {
// this.$message.error(this.$t('err'))
// }
// })
this.fetchList().then(({ data: res }) => {
this.testData = res
this.handleData()
console.log('res', res)
let loading = this.$loading({
lock: true, //lock的修改符--默认是false
text: this.$t('loading'), //显示在加载图标下方的加载文案
background: 'rgba(0,0,0,0.8)', //遮罩层颜色
spinner: 'el-icon-loading' //自定义加载图标类名
})
console.log('testData:', this.testData)
if (this.testData || this.$route.fullPath !== '/monitoring-realtimeProductLine') {
// 获取数据显示成功后关闭loading
loading.close()
} else {
this.$message.error(this.$t('err'))
}
})
this.intervalId = setInterval(() => {
this.$message({
message: this.$t('realtime.refresh'),
@@ -70,15 +76,12 @@ export default {
deactivated() {
if (this.intervalId) clearInterval(this.intervalId)
},
created() {
// console.log('this.tableData', this.tableData)
},
methods: {
fetchList() {
// let loading = this.$loading({
// lock: true, //lock的修改符--默认是false
// text: this.$t('loading'), //显示在加载图标下方的加载文案
// background: 'rgba(0,0,0,0.8)', //遮罩层颜色
// spinner: 'el-icon-loading' //自定义加载图标类名
// })
return this.$http({
url: this.$http.adornUrl('/monitoring/productionMonitoring/lineProductionRealTimeData'),
method: 'post'

View File

@@ -3,7 +3,7 @@
<div class="app-container">
<small-title :size="'md'">{{ $t('realtime.inspect') }}</small-title>
<!-- fixed -->
<base-table v-if="loadTable" :table-head-configs="tableProps" :data="tableData.length ? tableData : []"/>
<base-table v-if="loadTable" fixed: true :table-head-configs="tableProps" :data="tableData.length ? tableData : []"/>
</div>
</div>
</template>
@@ -83,7 +83,7 @@ export default {
this.initProps()
// console.log('props ===> ', this.tableProps)
this.initData()
// console.log('datas ===> ', this.tableData)
console.log('datas ===> ', this.tableData)
this.loadTable = true
},
@@ -145,8 +145,8 @@ export default {
}
dynamicPropNames.push(prop)
}
return [{ prop: 'checkType', label: i18n.t('inspect.det'), isFixed: true }, ...dynamicPropNames]
// isFixed: true
return [{ prop: 'checkType', label: i18n.t('inspect.det'), fixed: true }, ...dynamicPropNames]
}
}
}

View File

@@ -14,7 +14,8 @@ export default {
// url: window.SITE_CONFIG['apiURL'] + this.$http.adornUrl('/ureport/designer')
// url: this.$http.adornUrl('/ureport/designer')
// url: (process.env.NODE_ENV === 'production' ? '/api' : '/yd-monitor') + '/ureport/designer'
url: '/api/ureport/designer'
// url: '/api/ureport/designer'
url: '/yd-monitor/ureport/designer'
}
},
mounted() {

View File

@@ -1,8 +1,8 @@
<!--
* @Author: gtz
* @Date: 2021-03-07 18:39:03
* @LastEditors: gtz
* @LastEditTime: 2022-02-24 16:35:51
* @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
* @LastEditTime: 2023-09-20 11:14:33
* @Description: file content
-->
<template>
@@ -24,7 +24,8 @@ export default {
// url: process.env.VUE_APP_REPORT_VIEW_URL
// url: window.SITE_CONFIG['apiURL'] + this.$http.adornUrl('/ureport/preview')
// url: (process.env.NODE_ENV === 'production' ? '/api' : '/yd-monitor') + '/ureport/preview'
url: '/api/ureport/preview'
// url: '/api/ureport/preview'
url: '/yd-monitor/ureport/preview'
}
},
mounted() {

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
<el-form-item label="分类关联report_sheet_category" prop="category">
<el-input v-model="dataForm.category" placeholder="分类关联report_sheet_category"></el-input>
</el-form-item>

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
<el-form-item label="编码" prop="code">
<el-input v-model="dataForm.code" placeholder="编码"></el-input>
</el-form-item>

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
<el-form-item label="文件类型编号" prop="typeCode">
<el-input v-model="dataForm.typeCode" placeholder="文件类型编号"></el-input>
</el-form-item>

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
<el-form-item label="文件类型编号" prop="typeCode">
<el-input v-model="dataForm.typeCode" placeholder="文件类型编号"></el-input>
</el-form-item>

View File

@@ -0,0 +1,210 @@
<template>
<el-form :model="dataForm" :inline="true" class="blueTip" size="small">
<el-form-item>
{{ $t('pl.robotNo') }}
</el-form-item>
<!-- <el-form-item :label="$t('equCode')">
<strong>{{ equipmentCode }}</strong>
</el-form-item> -->
<el-form-item >
{{ equipmentName }}
</el-form-item>
<el-form-item>
{{ $t('startTime') }}
</el-form-item>
<el-form-item>
<el-date-picker v-model="startTime" type="datetime" :placeholder="$t('hints.date')" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-ddTHH:mm:ss" />
</el-form-item>
<el-form-item>
{{ $t('endTime') }}
</el-form-item>
<el-form-item>
<el-date-picker v-model="endTime" type="datetime" :placeholder="$t('hints.date')" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-ddTHH:mm:ss" />
</el-form-item>
<el-form-item>
{{ $t('pl.thick') }}
</el-form-item>
<el-form-item>
<el-select v-model="glassThick" :placeholder="$t('pl.thick')">
<el-option
v-for="item in glassOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<!-- <el-button class="buttonColor" @click="currentChangeHandle(1)">{{ $t('query') }}</el-button> -->
<el-button class="buttonColor" @click="currentChangeHandle(1)">{{ $t('query') }}</el-button>
<!-- <el-button v-if="$hasPermission('monitoring:equipmentgroup:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> -->
</el-form-item>
<base-table
:page="pageIndex"
:size="pageSize"
:data="dataList"
:table-head-configs="tableConfigs"
:max-height="calcMaxHeight(8)"
@refreshDataList="getDataList" />
<!-- layout="total, sizes, prev, pager, next, jumper" -->
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
>
</el-pagination>
</el-form>
</template>
<script>
import { calcMaxHeight } from '@/utils'
import { timeFilter } from '@/utils/filters'
import AddOrUpdate from '@/components/base-dialog/addOrUpdate'
import i18n from '@/i18n'
import BaseTable from '@/components/base-table'
import { pick } from 'lodash/object'
import equipmentVue from './equipment.vue'
const tableConfigs = [
{
type: 'index',
width: 100,
name: i18n.t('index')
},
{ prop: 'lineName', name: i18n.t('pl.name') },
{ prop: 'location', name: i18n.t('pl.paperLaying') },
{ prop: 'equipmentName', name: i18n.t('pl.robotNo') },
{ prop: 'glassNumber', name: i18n.t('pl.glassNumber') },
{ prop: 'startTime', name: i18n.t('startTime') },
{ prop: 'endTime', name: i18n.t('endTime') },
{ prop: 'glassLength', name: i18n.t('pl.glassLength') },
{ prop: 'glassWidth', name: i18n.t('pl.glassWidth') },
{ prop: 'glassThickness', name: i18n.t('pl.thick') },
// { prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
]
export default {
data() {
return {
calcMaxHeight,
tableConfigs,
dataForm: {
equipmentId: '',
lineId: ''
},
dataList: [],
eqList: [],
lineList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
equId: null,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false,
startTime: '',
endTime: '',
glassNumber: 95,
glassLength: 2261,
glassWidth: 1128,
glassThick: 3.2,
glassOptions: [{
value: 3.2,
label: '3.2mm'
}, {
value: 2,
label: '2mm'
}],
value: '',
equipmentName: this.$route.params.name
}
},
components: {
AddOrUpdate,
BaseTable
},
activated() {
this.getDataList()
},
mouted() {
this.getDataList()
},
created() {
// console.log('params',this.$route.params)
},
methods: {
// destroy dialog
handleDestroyDialog() {
setTimeout(() => {
this.addOrUpdateVisible = false
}, /** after dialog animated */ 200)
},
// 获取数据列表
getDataList() {
// console.log('this.$route.params.name',this.$route.params.name);
this.equipmentName = this.$route.params.name
this.dataListLoading = true
this.$http({
// url: this.$http.adornUrl(`/monitoring/downloadLog/getTimeDet/${this.$route.params.id}`),
url: this.$http.adornUrl('/monitoring/downloadLog/getTimeDet'),
method: 'POST',
data: {
page: this.pageIndex,
limit: this.pageSize,
// lineId: this.dataForm.lineId,
equId: this.$route.params.id,
'startTime': this.startTime,
'endTime': this.endTime
}
}).then(({ data }) => {
if (data && data.code === 0) {
// let fileterLineList = data.data.filter((t) => {
// return t.lineId == this.dataForm.lineId
// })
// this.dataList = fileterLineList
this.dataList = data.data.list
// this.totalPage = this.dataList.length
this.totalPage = data.data.total
console.log('data',data)
} else if (this.dataForm.lineId == '') {
this.dataList = data.data.list
this.totalPage = data.data.total
// console.log('this.dataList',this.dataList);
}
else {
this.dataList = []
this.totalPage = 0
}
for(let i =0;i<this.dataList.length;i++){
this.dataList[i].glassNumber = ( this.glassThick == 3.2 ) ? 95 :150
this.dataList[i].glassThickness = this.glassThick
this.dataList[i].glassLength = 2261
this.dataList[i].glassWidth = 1128
this.dataList[i].endTime = this.dataList[i].endTime == null ? '-' : this.dataList[i].endTime
this.dataList[i].startTime = this.dataList[i].startTime == null ? '-' : this.dataList[i].startTime
}
// console.log(this.dataList);
this.dataListLoading = false
}).catch(()=>{}) //---去除无效报错---
},
// 每页数
sizeChangeHandle(val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle(val) {
this.pageIndex = val
this.getDataList()
}
}
}
</script>

View File

@@ -4,9 +4,8 @@
:title="isDetail ? $t('ws.detail') : !dataForm.id ? $t('add') : $t('edit')"
:visible.sync="visible"
:close-on-click-modal="false"
:destroy-on-close="true"
>
<div style="max-height: 60vh; overflow-y: scroll; overflow-x: hidden;">
:destroy-on-close="true">
<div style="max-height: 60vh; overflow-y: scroll; overflow-x: hidden">
<el-form ref="dataForm" :model="dataForm" :rules="dataFormRules">
<el-row :gutter="20">
<el-col :span="12"
@@ -49,8 +48,7 @@
:table-head-configs="tableProps"
:max-height="calcMaxHeight(8)"
@operate-event="handleOperations"
@refreshDataList="getDataList"
/>
@refreshDataList="getDataList" />
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
@@ -58,16 +56,31 @@
:page-sizes="[5, 10, 15, 20]"
:page-size="limit"
:total="eqTotal"
layout="total, sizes, prev, pager, next, jumper"
/>
layout="total, sizes, prev, pager, next, jumper" />
</div>
<attr-form v-else ref="AttrFrom" :workshop-section-id="dataForm.id" @close-attr-form="showAttrForm = false" @refresh-list="handleRefreshList" />
</section>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClick({ name: 'cancel' })">{{ $t('cancel') }}</el-button>
<el-button type="primary" v-if="dataForm.id" @click="handleClick({ name: 'update' })">{{ $t('update') }}</el-button>
<el-button type="success" v-else @click="handleClick({ name: 'save' })">{{ $t('save') }}</el-button>
<el-button
:style="{
backgroundColor: '#0b58ff',
color: '#fff'
}"
v-if="dataForm.id"
@click="handleClick({ name: 'update' })"
>{{ $t('update') }}</el-button
>
<el-button
:style="{
backgroundColor: '#0b58ff',
color: '#fff'
}"
v-else
@click="handleClick({ name: 'save' })"
>{{ $t('save') }}</el-button
>
</span>
</el-dialog>
</template>
@@ -292,7 +305,7 @@ export default {
}
},
handleCreateOrUpdate() {
this.$refs['dataForm'].validate(valid => {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl('/monitoring/workshopSection'),

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
<el-form-item label="工段ID" prop="workshopSectionId">
<el-input v-model="dataForm.workshopSectionId" placeholder="工段ID"></el-input>
</el-form-item>

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :visible.sync="visible" :title="$t('oss.config')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="170px">
<el-form-item :label="$t('oss.type')" size="mini">
<el-radio-group v-model="dataForm.type">
<el-radio :label="1">{{ $t('oss.type1') }}</el-radio>

View File

@@ -30,7 +30,8 @@ export default {
this.visible = true
// this.url = `${window.SITE_CONFIG['apiURL']}/sys/oss/upload?token=${Cookies.get('token')}`
// this.url = (process.env.NODE_ENV === 'production' ? '/api' : '/yd-monitor') + `/sys/oss/upload?token=${Cookies.get('token')}`
this.url = `/api/sys/oss/upload?token=${Cookies.get('token')}`
// this.url = `/api/sys/oss/upload?token=${Cookies.get('token')}`
this.url = `/yd-monitor/sys/oss/upload?token=${Cookies.get('token')}`
this.num = 0
this.fileList = []
},

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="170px">
<el-form-item prop="name" :label="$t('dept.name')">
<el-input v-model="dataForm.name" :placeholder="$t('dept.name')"></el-input>
</el-form-item>

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="170px">
<el-form-item prop="dictValue" :label="$t('dict.dictValue')">
<el-input v-model="dataForm.dictValue" :placeholder="$t('dict.dictValue')"></el-input>
</el-form-item>

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="130px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="170px">
<el-form-item prop="dictName" :label="$t('dict.dictName')">
<el-input v-model="dataForm.dictName" :placeholder="$t('dict.dictName')"></el-input>
</el-form-item>

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="170px">
<el-form-item prop="type" :label="$t('menu.type')" size="mini">
<el-radio-group v-model="dataForm.type" :disabled="!!dataForm.id">
<el-radio :label="0">{{ $t('menu.type0') }}</el-radio>

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="170px">
<el-form-item prop="paramCode" :label="$t('params.paramCode')">
<el-input v-model="dataForm.paramCode" :placeholder="$t('params.paramCode')"></el-input>
</el-form-item>

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="170px">
<el-form-item prop="name" :label="$t('role.name')">
<el-input v-model="dataForm.name" :placeholder="$t('role.name')"></el-input>
</el-form-item>
@@ -11,7 +11,10 @@
<el-col :span="12">
<el-form-item size="mini" :label="$t('role.menuList')">
<!-- 这里改了nameEn -->
<el-tree :data="menuList" :props="{ label: 'nameEn', children: 'children' }" node-key="id" ref="menuListTree" accordion show-checkbox> </el-tree>
<el-tree v-if="$i18n.locale == 'zh-CN'" :data="menuList" :props="{ label: 'name', children: 'children' }" node-key="id" ref="menuListTree" accordion show-checkbox>
</el-tree>
<el-tree v-if="$i18n.locale == 'en'" :data="menuList" :props="{ label: 'nameEn', children: 'children' }" node-key="id" ref="menuListTree" accordion show-checkbox>
</el-tree>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -56,8 +59,8 @@ export default {
// destroy dialog
handleDestroyDialog() {
setTimeout(() => {
this.addOrUpdateVisible= false
}, /** after dialog animated */ 200);
this.addOrUpdateVisible = false
}, /** after dialog animated */ 200)
},
init() {
this.visible = true
@@ -80,8 +83,9 @@ export default {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
console.log('res.data', res.data)
this.menuList = res.data
console.log('this.menuList',this.menuList);
console.log('this.menuList', this.menuList)
})
.catch(() => {})
},
@@ -94,6 +98,7 @@ export default {
return this.$message.error(res.msg)
}
this.deptList = res.data
console.log('this.deptList', this.deptList)
})
.catch(() => {})
},
@@ -109,15 +114,15 @@ export default {
...this.dataForm,
...res.data
}
this.dataForm.menuIdList.forEach(item => this.$refs.menuListTree.setChecked(item, true))
this.dataForm.menuIdList.forEach((item) => this.$refs.menuListTree.setChecked(item, true))
this.$refs.deptListTree.setCheckedKeys(this.dataForm.deptIdList)
})
.catch(() => {})
},
// 表单提交
dataFormSubmitHandle: debounce(
function() {
this.$refs['dataForm'].validate(valid => {
function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="170px">
<el-form-item prop="username" :label="$t('user.username')">
<el-input v-model="dataForm.username" :placeholder="$t('user.username')"></el-input>
</el-form-item>
@@ -17,12 +17,12 @@
<el-input v-model="dataForm.realName" :placeholder="$t('user.realName')"></el-input>
</el-form-item>
<el-form-item prop="gender" :label="$t('user.gender')">
<!-- <ren-radio-group v-model="dataForm.gender" dict-type="gender"></ren-radio-group> -->
<el-radio-group v-model="dataForm.gender">
<ren-radio-group v-model="dataForm.gender" dict-type="gender"></ren-radio-group>
<!-- <el-radio-group v-model="dataForm.gender">
<el-radio :label="0">{{ $t('user.gender0') }}</el-radio>
<el-radio :label="1">{{ $t('user.gender1') }}</el-radio>
<el-radio :label="2">{{ $t('user.gender2') }}</el-radio>
</el-radio-group>
</el-radio-group> -->
</el-form-item>
<el-form-item prop="email" :label="$t('user.email')">
<el-input v-model="dataForm.email" :placeholder="$t('user.email')"></el-input>

View File

@@ -4,7 +4,7 @@
* @Author: fzq
* @Date: 2022-11-25 09:51:46
* @LastEditors: fzq
* @LastEditTime: 2023-02-07 15:29:45
* @LastEditTime: 2023-02-13 16:29:14
-->
<template>
<el-card shadow="never" class="aui-card--fill">
@@ -134,8 +134,10 @@ export default {
let fileName = ''
const contentDisposition = response.headers['content-disposition']
if (contentDisposition) {
fileName = contentDisposition.slice(contentDisposition.indexOf('filename=') + 9).replace('.xls', this.$t('user.userTable')) + '.xls'
// fileName = contentDisposition.slice(contentDisposition.indexOf('filename=') + 9).replace('.xls', this.$t('user.userTable')) + '.xls'
fileName = contentDisposition.slice(contentDisposition.indexOf('filename=') + 9)
}
fileName = decodeURIComponent(fileName)
const blob = new Blob([response.data])
const reader = new FileReader()
reader.readAsDataURL(blob)

View File

@@ -166,7 +166,8 @@ export default {
this.dataForm.uuid = getUUID()
// this.captchaPath = `${window.SITE_CONFIG['apiURL']}/captcha?uuid=${this.dataForm.uuid}`
// this.captchaPath = (process.env.NODE_ENV === 'production' ? '/api' : '/yd-monitor') + `/captcha?uuid=${this.dataForm.uuid}`
this.captchaPath = `/api/captcha?uuid=${this.dataForm.uuid}`
// this.captchaPath = `/api/captcha?uuid=${this.dataForm.uuid}`
this.captchaPath = `/yd-monitor/captcha?uuid=${this.dataForm.uuid}`
},
// 表单提交
dataFormSubmitHandle: debounce(

View File

@@ -29,13 +29,16 @@ module.exports = {
},
proxy: {
'/api': {
target: 'http://india.mes.picaiba.com/'
// target: 'http://india.mes.picaiba.com/'
target: 'http://127.0.0.1:8080/'
},
'/yd-monitor': {
target: 'http://192.168.1.18:8080/' // 开发地址
// target: 'http://192.168.1.18:8080/' // 开发地址
target: 'http://127.0.0.1:8080/'
},
'/ureport': {
target: 'http://india.mes.picaiba.com/' // ureporter
// target: 'http://india.mes.picaiba.com/' // ureporter
target: 'http://127.0.0.1:8080/'
}
}
}