17 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
Fanzink
28303e4c5f 'update' 2023-02-08 18:13:08 +08:00
Fanzink
bbe5e63075 'update' 2023-02-06 10:25:01 +08:00
78 changed files with 4377 additions and 702 deletions

View File

@@ -1,3 +1,11 @@
<!--
* @Descripttion:
* @version:
* @Author: fzq
* @Date: 2022-11-25 09:51:46
* @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> <!DOCTYPE html>
<html> <html>
<head> <head>
@@ -31,25 +39,30 @@
<!-- 开发环境 --> <!-- 开发环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %> <% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
<script> <script>
window.SITE_CONFIG['apiURL'] = 'http://india.mes.picaiba.com/'; // 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> </script>
<% } %> <% } %>
<!-- 集成测试环境 --> <!-- 集成测试环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod:sit') { %> <% if (process.env.VUE_APP_NODE_ENV === 'prod:sit') { %>
<script> <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> </script>
<% } %> <% } %>
<!-- 验收测试环境 --> <!-- 验收测试环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod:uat') { %> <% if (process.env.VUE_APP_NODE_ENV === 'prod:uat') { %>
<script> <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> </script>
<% } %> <% } %>
<!-- 生产环境 --> <!-- 生产环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod') { %> <% if (process.env.VUE_APP_NODE_ENV === 'prod') { %>
<script> <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> </script>
<% } %> <% } %>
</head> </head>

View File

@@ -543,7 +543,8 @@ img {
.el-menu-item.is-active, .el-menu-item.is-active,
.el-submenu.is-active > .el-submenu__title { .el-submenu.is-active > .el-submenu__title {
// color: mix(#fff, $sidebar--text-color-dark, 80%); // 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 }) => { }).then(({ data: res }) => {
if (res && res.code === 0) { if (res && res.code === 0) {
const dataFormKeys = Object.keys(this.dataForm) 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) this.dataForm = pick(res.data, dataFormKeys)
// LABEL: FILE_RELATED // LABEL: FILE_RELATED

View File

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

View File

@@ -27,11 +27,13 @@
:disabled="isDetail" /> :disabled="isDetail" />
<el-radio v-if="getType(n, c) === 'radio'" v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]" :disabled="isDetail" /> <el-radio v-if="getType(n, c) === 'radio'" v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]" :disabled="isDetail" />
<el-checkbox v-if="getType(n, c) === 'check'" v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]" :disabled="isDetail" /> <el-checkbox v-if="getType(n, c) === 'check'" v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]" :disabled="isDetail" />
<!-- 全部selcet下拉框可输入搜索 filterable-->
<el-select <el-select
v-if="getType(n, c) === 'select'" v-if="getType(n, c) === 'select'"
:placeholder="getPlaceholder(n, c)" :placeholder="getPlaceholder(n, c)"
v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]" v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]"
clearable clearable
filterable
:disabled="isDetail || configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].isDisabled" :disabled="isDetail || configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].isDisabled"
@change="emitSelectChange(configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name, $event)"> @change="emitSelectChange(configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name, $event)">
@@ -124,7 +126,7 @@ const title = {
// 或者也可以改造成自定义颜色: // 或者也可以改造成自定义颜色:
const btnType = { const btnType = {
add: '#0b58ff', add: '#0b58ff',
save: '#000', save: '#0b58ff',
update: '#0b58ff', update: '#0b58ff',
reset: '' reset: ''
// cancel: 'text' // cancel: 'text'
@@ -182,6 +184,8 @@ export default {
// }, // },
data() { data() {
return { return {
//按钮盒用
idMark: 1,
// 按钮防重复点击 // 按钮防重复点击
isDisabled: false, isDisabled: false,
COLUMN_PER_ROW, COLUMN_PER_ROW,
@@ -409,10 +413,10 @@ export default {
}).then(({ data: res }) => { }).then(({ data: res }) => {
if (res && res.code === 0) { if (res && res.code === 0) {
const dataFormKeys = Object.keys(this.dataForm) const dataFormKeys = Object.keys(this.dataForm)
console.log('keys ===> ', dataFormKeys) // console.log('keys ===> ', dataFormKeys)
// 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) 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 // LABEL: FILE_RELATED
/** 对文件下载进行分流 */ /** 对文件下载进行分流 */
this.fileList = {} this.fileList = {}
@@ -467,6 +471,9 @@ export default {
this.dataForm[currentField.relatedField] = null this.dataForm[currentField.relatedField] = null
} }
this.$emit('select-change', { name, id }) this.$emit('select-change', { name, id })
//按钮盒页面用
this.idMark = id
}, },
handleEditorReady(val) {}, handleEditorReady(val) {},
@@ -508,9 +515,19 @@ export default {
} }
this.$set(this.dataForm, 'fileIds', fileIds) this.$set(this.dataForm, 'fileIds', fileIds)
} }
// console.log('this.$route',this.$route);
// console.log('before send: ', this.dataForm)
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({ this.$http({
url: this.$http.adornUrl(urls[btn.name].url), url: this.$http.adornUrl(urls[btn.name].url),
method: btn.name === 'save' ? 'POST' : 'PUT', method: btn.name === 'save' ? 'POST' : 'PUT',

View File

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

View File

@@ -55,6 +55,8 @@
" "
v-bind="head.more"></el-table-column> v-bind="head.more"></el-table-column>
<!-- 普通的表头 --> <!-- 普通的表头 -->
<!-- :align="head.align || null" 表头居中 -->
<!-- :min-width="head.minWidth || null" -->
<el-table-column <el-table-column
v-else v-else
:key="idx + 'else'" :key="idx + 'else'"
@@ -66,7 +68,7 @@
:show-overflow-tooltip="head.showOverflowTooltip || true" :show-overflow-tooltip="head.showOverflowTooltip || true"
:tooltip-effect="head.tooltipEffect || 'light'" :tooltip-effect="head.tooltipEffect || 'light'"
filter-placement="top" filter-placement="top"
:align="head.align || null" :align="head.align || 'center'"
v-bind="head.more"> v-bind="head.more">
<!-- 子组件 编辑/删除 --> <!-- 子组件 编辑/删除 -->
<template v-if="head.prop" slot-scope="scope"> <template v-if="head.prop" slot-scope="scope">
@@ -77,7 +79,7 @@
<!-- 多级表头 --> <!-- 多级表头 -->
<template v-if="!head.prop && head.children"> <template v-if="!head.prop && head.children">
<TableHead v-for="(subhead, subindex) in head.children" :key="'subhead-' + idx + '-subindex-' + subindex" :opt="subhead" /> <TableHead v-for="(subhead, subindex) in head.children" :key="'subhead-' + idx + '-subindex-' + subindex" :opt="subhead"/>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
@@ -174,7 +176,7 @@ export default {
}, },
created() { created() {
// console.log(this.selectedBox) // console.log(this.selectedBox)
console.log(this.tableHeadConfigs) // console.log(this.tableHeadConfigs)
}, },
methods: { methods: {
handleSubEmitData(payload) { 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

@@ -25,16 +25,19 @@ t.routes['厂务'] = 'Factory Affair'
t.routes['设备'] = 'Equipment' t.routes['设备'] = 'Equipment'
t.routes['字典管理'] = 'Dict Management' t.routes['字典管理'] = 'Dict Management'
t.routes['PLC信息'] = 'PLC' t.routes['PLC信息'] = 'PLC'
t.routes['设备与PLC关联配置'] = 'Relations between plc & equipments' // Relations between
t.routes['近24小时设备生产数据'] = 'Realtime Equipment Data(24h)' t.routes['设备与PLC关联配置'] = 'PLC & Equipments'
t.routes['近24小时产线生产数据'] = 'Realtime Productline Data(24h)' t.routes['下片监测'] = 'Unload Log'
t.routes['近24小时质量检查数据'] = 'Realtime Quality Inspection Data(24h)' t.routes['近24小时设备生产数据'] = 'Equipment Data'
t.routes['近24小时产线生产数据'] = 'Productline Data'
t.routes['近24小时质量检查数据'] = 'Quality Inspection Data'
t.routes['报表总览'] = 'Report Overview' t.routes['报表总览'] = 'Report Overview'
t.routes['报表分类'] = 'Report Types' t.routes['报表分类'] = 'Report Types'
t.routes['报表详情'] = 'Report Detail' t.routes['报表详情'] = 'Report Detail'
t.routes['报表设计'] = 'Report Design' t.routes['报表设计'] = 'Report Design'
t.routes['报表预览'] = 'Report Preview' t.routes['报表预览'] = 'Report Preview'
t.routes['质量检测基础数据'] = 'Quality Inspection Basic Data' // Quality
t.routes['质量检测基础数据'] = 'Inspection Basic Data'
t.routes['当前检测数据'] = 'Current Inspection Data' t.routes['当前检测数据'] = 'Current Inspection Data'
t.routes['检测统计数据'] = 'Statistics Data' t.routes['检测统计数据'] = 'Statistics Data'
t.routes['质量检查信息记录'] = 'Quality Inspection Records' t.routes['质量检查信息记录'] = 'Quality Inspection Records'
@@ -46,10 +49,14 @@ t.routes['参数管理'] = 'Params Management'
t.routes['定时任务'] = 'Timed Tasks' t.routes['定时任务'] = 'Timed Tasks'
t.routes['文件上传'] = 'File Upload' t.routes['文件上传'] = 'File Upload'
t.routes['登录日志'] = 'Login Records' t.routes['登录日志'] = 'Login Records'
t.routes['操作日志'] = 'Oprations Records' t.routes['操作日志'] = 'Operations Records'
t.routes['设备效率分析'] = 'Equipment Efficiency Analysis' t.routes['设备效率分析'] = 'EQU Efficiency Analysis'
t.routes['设备异常分析'] = 'Equipment Exceptions Analysis' t.routes['设备异常分析'] = 'EQU Exceptions Analysis'
t.routes['设备状态时序图'] = 'Equipment 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' t.routes['工厂'] = 'Factory'
@@ -61,6 +68,7 @@ t.routes['设备信息'] = 'Equipment Details'
t.routes['设备参数状态监控'] = 'Current Equipment State' t.routes['设备参数状态监控'] = 'Current Equipment State'
t.routes['设备分组报警信息'] = 'Equipment Group Alarm' t.routes['设备分组报警信息'] = 'Equipment Group Alarm'
t.routes['设备历史参数'] = 'Equipment Historical Parameters' t.routes['设备历史参数'] = 'Equipment Historical Parameters'
t.routes['下片详情'] = 'Unload Detail'
t.routes['质量检测类型'] = 'Quality Inpection Types' t.routes['质量检测类型'] = 'Quality Inpection Types'
t.routes['质量检测信息'] = 'Quality Inpection Details' t.routes['质量检测信息'] = 'Quality Inpection Details'
t.routes['安灯检测盒'] = 'Andeng inspection box' t.routes['安灯检测盒'] = 'Andeng inspection box'
@@ -103,12 +111,12 @@ t.updatorName = 'Updator\'s name'
t.updateTime = 'Update Time' t.updateTime = 'Update Time'
t.version = 'Version' t.version = 'Version'
t.search = 'Search' t.search = 'Search'
t.countPerPage = '每页数' // ? t.countPerPage = 'Per Page' // ?
t.currentPage = '当前页' // ? t.currentPage = 'Current Page' // ?
t.fetchList = '获取数据列表' // ? t.fetchList = 'Fetch Data List' // ?
t.multi = '多选' // ? t.multi = 'Multiple Selection' // ?
t.do = '进行' // ? t.do = 'Proceed' // ?
t.submit = '表单提交' // ? t.submit = 'Submit' // ?
t.desc = 'Description' t.desc = 'Description'
t.disable = 'Disable' t.disable = 'Disable'
t.equipment = 'Equipment' t.equipment = 'Equipment'
@@ -117,7 +125,7 @@ t.cannotempty = 'can\'t be empty'
t.parameter = 'Parameters' t.parameter = 'Parameters'
t.enable = 'Enable' t.enable = 'Enable'
t.index = 'Index' t.index = 'Index'
t.relation = '关联' t.relation = 'Relation'
t.fetchInfo = 'Fetch Info' t.fetchInfo = 'Fetch Info'
t.name = 'Name' t.name = 'Name'
t.code = 'Code' t.code = 'Code'
@@ -140,7 +148,13 @@ t.status = 'Status'
t.normal = 'Normal' t.normal = 'Normal'
t.shutdown = 'Shut Down' t.shutdown = 'Shut Down'
t.malfunction = 'Malfunction' // ? 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.diagram = 'Device Status Sequence Diagram'
t.diagram2 = 'Device Product Sequence Diagram'
t.addr = 'Address' t.addr = 'Address'
t.planStop = 'Plan to stop' t.planStop = 'Plan to stop'
t.startTime = 'Start Time' t.startTime = 'Start Time'
@@ -187,6 +201,10 @@ t.refdate = 'By date'
t.hour = 'Hour(s)' t.hour = 'Hour(s)'
t.yes = 'yes' t.yes = 'yes'
t.no = 'no' t.no = 'no'
t.LoginRecords = ' Login Records'
t.operationsRecords = ' Operations Records'
t.allIcons= 'All Icons'
t.err= 'Error'
t.errors = {} t.errors = {}
t.errors.nosection = 'There is no sections on this product line.' t.errors.nosection = 'There is no sections on this product line.'
@@ -272,7 +290,7 @@ t.inspect.typeCount = 'Data of inspection types'
t.realtime = {} t.realtime = {}
t.realtime.eq = 'Realtime data of equipments(24h)' t.realtime.eq = 'Realtime data of equipments(24h)'
t.realtime.pl = 'Realtime data of product lines(24h)' t.realtime.pl = 'Realtime data of productlines(24h)'
t.realtime.inspect = 'Realtime data of quality inspections(24h)' t.realtime.inspect = 'Realtime data of quality inspections(24h)'
t.realtime.in = 'in' t.realtime.in = 'in'
t.realtime.out = 'out' t.realtime.out = 'out'
@@ -378,13 +396,26 @@ t.eq.month = 'month'
t.eq.realyield = 'Actual processing speed' t.eq.realyield = 'Actual processing speed'
t.eq.designyield = 'Theoretical processing speed' t.eq.designyield = 'Theoretical processing speed'
t.eq.viewtrend = 'View Trends' 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 = {}
t.pl.title = 'Product Line' t.pl.title = 'Product Line'
t.pl.id = 'Product Line ID' t.pl.id = 'Product Line ID'
t.pl.name = 'Product Line Name' t.pl.name = 'Product Line Name'
t.pl.sum = 'Sum'
t.pl.code = 'Product Line Code' t.pl.code = 'Product Line Code'
t.pl.status = 'Product Line Status' t.pl.status = 'Product Line Status'
t.pl.belong = 'Product Line' t.pl.belong = 'Product Line'
@@ -398,6 +429,13 @@ t.pl.choose = 'Please select equipment'
t.pl.confirm = 'Confirm' t.pl.confirm = 'Confirm'
t.pl.cancel = 'Cancel' t.pl.cancel = 'Cancel'
t.pl.success = 'The new device data is obtained successfully' 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 = {} t.prompt = {}
@@ -413,10 +451,11 @@ t.validate = {}
t.validate.required = 'This is required.' t.validate.required = 'This is required.'
t.validate.format = '{attr} has a wrong format.' t.validate.format = '{attr} has a wrong format.'
t.validate.keyValueWarning = 'The value must be an integer between 0 and 100!' t.validate.keyValueWarning = 'The value must be an integer between 0 and 100!'
t.validate.requiredRole = 'Choose at least one role'
t.upload = {} t.upload = {}
t.upload.title = 'Upload Assets' t.upload.title = 'Upload Assets'
t.upload.text = '将文件拖到此处,或<em>点击上传</em>' t.upload.text = 'Drag the file here, or <em> click Upload </em>'
t.upload.tip = 'Only support files with format: {format}' t.upload.tip = 'Only support files with format: {format}'
t.upload.button = 'upload' t.upload.button = 'upload'
@@ -484,60 +523,60 @@ t.schedule.times = 'Time Cost (ms)'
t.schedule.createDate = 'Executed Tune' // ? t.schedule.createDate = 'Executed Tune' // ?
t.oss = {} t.oss = {}
t.oss.config = '云存储配置' t.oss.config = 'Cloud storage configuration'
t.oss.upload = '上传文件' t.oss.upload = 'upload'
t.oss.url = 'URL地址' t.oss.url = 'url'
t.oss.createDate = 'Create Time' t.oss.createDate = 'Create Time'
t.oss.type = '类型' t.oss.type = 'type'
t.oss.type1 = '七牛' t.oss.type1 = 'Qiniu'
t.oss.type2 = '阿里云' t.oss.type2 = 'Aliyun'
t.oss.type3 = '腾讯云' t.oss.type3 = 'Tencent Cloud'
t.oss.qiniuDomain = '域名' t.oss.qiniuDomain = 'Domain name'
t.oss.qiniuDomainTips = '七牛绑定的域名' t.oss.qiniuDomainTips = 'Bound domain name'
t.oss.qiniuPrefix = '路径前缀' t.oss.qiniuPrefix = 'Prefix'
t.oss.qiniuPrefixTips = '不设置默认为空' t.oss.qiniuPrefixTips = 'If no, the default value is null'
t.oss.qiniuAccessKey = 'AccessKey' t.oss.qiniuAccessKey = 'AccessKey'
t.oss.qiniuAccessKeyTips = '七牛AccessKey' t.oss.qiniuAccessKeyTips = 'Qiniu AccessKey'
t.oss.qiniuSecretKey = 'SecretKey' t.oss.qiniuSecretKey = 'SecretKey'
t.oss.qiniuSecretKeyTips = '七牛SecretKey' t.oss.qiniuSecretKeyTips = 'Qiniu SecretKey'
t.oss.qiniuBucketName = '空间名' t.oss.qiniuBucketName = 'BucketName'
t.oss.qiniuBucketNameTips = '七牛存储空间名' t.oss.qiniuBucketNameTips = 'Qiniu BucketName'
t.oss.aliyunDomain = '域名' t.oss.aliyunDomain = 'Domain'
t.oss.aliyunDomainTips = '阿里云绑定的域名,如http://cdn.renren.io' t.oss.aliyunDomainTips = 'Domain name bound to Ali Cloud, such ashttp://cdn.renren.io'
t.oss.aliyunPrefix = '路径前缀' t.oss.aliyunPrefix = 'Prefix'
t.oss.aliyunPrefixTips = '不设置默认为空' t.oss.aliyunPrefixTips = 'If no, the default value is null'
t.oss.aliyunEndPoint = 'EndPoint' t.oss.aliyunEndPoint = 'EndPoint'
t.oss.aliyunEndPointTips = '阿里云EndPoint' t.oss.aliyunEndPointTips = 'Aliyun EndPoint'
t.oss.aliyunAccessKeyId = 'AccessKeyId' t.oss.aliyunAccessKeyId = 'AccessKeyId'
t.oss.aliyunAccessKeyIdTips = '阿里云AccessKeyId' t.oss.aliyunAccessKeyIdTips = 'Aliyun AccessKeyId'
t.oss.aliyunAccessKeySecret = 'AccessKeySecret' t.oss.aliyunAccessKeySecret = 'AccessKeySecret'
t.oss.aliyunAccessKeySecretTips = '阿里云AccessKeySecret' t.oss.aliyunAccessKeySecretTips = 'Aliyun AccessKeySecret'
t.oss.aliyunBucketName = 'BucketName' t.oss.aliyunBucketName = 'BucketName'
t.oss.aliyunBucketNameTips = '阿里云BucketName' t.oss.aliyunBucketNameTips = 'Aliyun BucketName'
t.oss.qcloudDomain = '域名' t.oss.qcloudDomain = 'Domain'
t.oss.qcloudDomainTips = '腾讯云绑定的域名' t.oss.qcloudDomainTips = 'Tencent Cloud Domains'
t.oss.qcloudPrefix = '路径前缀' t.oss.qcloudPrefix = 'Prefix'
t.oss.qcloudPrefixTips = '不设置默认为空' t.oss.qcloudPrefixTips = 'If no, the default value is null'
t.oss.qcloudAppId = 'AppId' t.oss.qcloudAppId = 'AppId'
t.oss.qcloudAppIdTips = '腾讯云AppId' t.oss.qcloudAppIdTips = 'Tencent Cloud AppId'
t.oss.qcloudSecretId = 'SecretId' t.oss.qcloudSecretId = 'SecretId'
t.oss.qcloudSecretIdTips = '腾讯云SecretId' t.oss.qcloudSecretIdTips = 'Tencent Cloud SecretId'
t.oss.qcloudSecretKey = 'SecretKey' t.oss.qcloudSecretKey = 'SecretKey'
t.oss.qcloudSecretKeyTips = '腾讯云SecretKey' t.oss.qcloudSecretKeyTips = 'Tencent Cloud SecretKey'
t.oss.qcloudBucketName = 'BucketName' t.oss.qcloudBucketName = 'BucketName'
t.oss.qcloudBucketNameTips = '腾讯云BucketName' t.oss.qcloudBucketNameTips = 'Tencent Cloud BucketName'
t.oss.qcloudRegion = '所属地区' t.oss.qcloudRegion = 'Region'
t.oss.qcloudRegionTips = '请选择' t.oss.qcloudRegionTips = 'Select'
t.oss.qcloudRegionBeijing1 = '北京一区(华北)' t.oss.qcloudRegionBeijing1 = 'Beijing District 1 (North China)'
t.oss.qcloudRegionBeijing = '北京' t.oss.qcloudRegionBeijing = 'Beijing'
t.oss.qcloudRegionShanghai = '上海(华东)' t.oss.qcloudRegionShanghai = 'Shanghai (East China)'
t.oss.qcloudRegionGuangzhou = '广州(华南)' t.oss.qcloudRegionGuangzhou = 'Guangzhou (South China)'
t.oss.qcloudRegionChengdu = '成都(西南)' t.oss.qcloudRegionChengdu = 'Chengdu (Southwest)'
t.oss.qcloudRegionChongqing = '重庆' t.oss.qcloudRegionChongqing = 'Chongqing'
t.oss.qcloudRegionSingapore = '新加坡' t.oss.qcloudRegionSingapore = 'Singapore'
t.oss.qcloudRegionHongkong = '香港' t.oss.qcloudRegionHongkong = 'Hong Kong'
t.oss.qcloudRegionToronto = '多伦多' t.oss.qcloudRegionToronto = 'Toronto'
t.oss.qcloudRegionFrankfurt = '法兰克福' t.oss.qcloudRegionFrankfurt = 'Frankfurt'
t.dept = {} t.dept = {}
t.dept.name = 'Department Name' t.dept.name = 'Department Name'
@@ -557,7 +596,7 @@ t.dict.remark = 'Remark'
t.dict.createDate = 'Create Time' t.dict.createDate = 'Create Time'
t.logError = {} t.logError = {}
t.logError.requestUri = 'Request URI' t.logError.requestUri = 'Request URL'
t.logError.requestMethod = 'Request Method' t.logError.requestMethod = 'Request Method'
t.logError.requestParams = 'Request Parameters' t.logError.requestParams = 'Request Parameters'
t.logError.ip = 'IP' t.logError.ip = 'IP'
@@ -584,7 +623,7 @@ t.logOperation.status0 = 'Failed'
t.logOperation.status1 = 'Success' t.logOperation.status1 = 'Success'
t.logOperation.creatorName = 'User Name' t.logOperation.creatorName = 'User Name'
t.logOperation.operation = 'User Operations' t.logOperation.operation = 'User Operations'
t.logOperation.requestUri = 'Request URI' t.logOperation.requestUri = 'Request URL'
t.logOperation.requestMethod = 'Request Method' t.logOperation.requestMethod = 'Request Method'
t.logOperation.requestParams = 'Request Parameters' t.logOperation.requestParams = 'Request Parameters'
t.logOperation.requestTime = 'Request Duration' t.logOperation.requestTime = 'Request Duration'
@@ -593,21 +632,22 @@ t.logOperation.userAgent = 'User-Agent'
t.logOperation.createDate = 'Create Time' t.logOperation.createDate = 'Create Time'
t.menu = {} t.menu = {}
t.menu.name = 'Name' t.menu.name = 'Chinese Name'
t.menu.nameEn = 'Name'
t.menu.icon = 'Icons' t.menu.icon = 'Icons'
t.menu.type = 'Type' t.menu.type = 'Type'
t.menu.type0 = 'Menu' t.menu.type0 = 'Menu'
t.menu.type1 = 'Button' t.menu.type1 = 'Button'
t.menu.sort = 'Sort' t.menu.sort = 'Sort'
t.menu.url = 'Route' t.menu.url = 'Route'
t.menu.permissions = '授权标识' t.menu.permissions = 'Authorization Identifier'
t.menu.permissionsTips = '多个用逗号分隔,如:sys:menu:save,sys:menu:update' t.menu.permissionsTips = 'Multiple are separated by commas, such as:sys:menu:save,sys:menu:update'
t.menu.parentName = '上级菜单' t.menu.parentName = 'Superior menu'
t.menu.parentNameDefault = 'First tier menu' t.menu.parentNameDefault = 'First tier menu'
t.menu.resource = '授权资源' t.menu.resource = 'Authorized Resource'
t.menu.resourceUrl = '资源URL' t.menu.resourceUrl = 'Resource URL'
t.menu.resourceMethod = 'Request methods' t.menu.resourceMethod = 'Request methods'
t.menu.resourceAddItem = '添加一项' t.menu.resourceAddItem = 'Add Item'
t.params = {} t.params = {}
t.params.name = 'Parameter Name' t.params.name = 'Parameter Name'
@@ -616,7 +656,7 @@ t.params.paramCode = 'Parameter Code'
t.params.paramValue = 'Parameter Value' t.params.paramValue = 'Parameter Value'
t.params.paramStdValue = 'Standard Parameter Code' t.params.paramStdValue = 'Standard Parameter Code'
t.params.plctitle = 'PLC Collection Parameters' t.params.plctitle = 'PLC Collection Parameters'
t.params.plcid = 'PLC连接表ID' t.params.plcid = 'PLC ID'
t.params.remark = 'Remark' t.params.remark = 'Remark'
t.role = {} t.role = {}
@@ -647,5 +687,6 @@ t.user.validate = {}
t.user.validate.confirmPassword = 'The two passwords are different. Please check again.' t.user.validate.confirmPassword = 'The two passwords are different. Please check again.'
t.user.select = 'Select an user' t.user.select = 'Select an user'
t.user.selecterror = 'Pick up a record' t.user.selecterror = 'Pick up a record'
t.user.userTable = ' User Table'
export default t export default t

View File

@@ -27,6 +27,7 @@ t.routes['设备'] = '设备'
t.routes['字典管理'] = '字典管理' t.routes['字典管理'] = '字典管理'
t.routes['PLC信息'] = 'PLC信息' t.routes['PLC信息'] = 'PLC信息'
t.routes['设备与PLC关联配置'] = '设备与PLC关联配置' // ? t.routes['设备与PLC关联配置'] = '设备与PLC关联配置' // ?
t.routes['下片监测'] = '下片监测'
t.routes['近24小时设备生产数据'] = '近24小时设备生产数据' t.routes['近24小时设备生产数据'] = '近24小时设备生产数据'
t.routes['近24小时产线生产数据'] = '近24小时产线生产数据' 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['产量分析'] = '产量分析'
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['下片详情'] = '下片详情'
t.routes['质量检测类型'] = '质量检测类型' t.routes['质量检测类型'] = '质量检测类型'
t.routes['质量检测信息'] = '质量检测信息' t.routes['质量检测信息'] = '质量检测信息'
t.routes['安灯检测盒'] = '安灯检测盒' t.routes['安灯检测盒'] = '安灯检测盒'
@@ -140,9 +147,16 @@ t.status = '状态' // 1
t.normal = '正常' // ? t.normal = '正常' // ?
t.shutdown = '停机' // ? t.shutdown = '停机' // ?
t.malfunction = '故障' // ? t.malfunction = '故障' // ?
t.stop = '停止'
t.run = '运行'
t.unknown = '未知'
t.buttonId = '网关号'
t.boxNo = '盒子编号'
t.diagram = '设备状态时序图' t.diagram = '设备状态时序图'
t.diagram2 = '设备产量时序图'
t.addr = '地址' // 1 t.addr = '地址' // 1
t.planStop = '计划停机' // ? t.planStop = '计划停机' // ?
t.startTime = '开始时间' // 1 t.startTime = '开始时间' // 1
t.endTime = '结束时间' // 1 t.endTime = '结束时间' // 1
t.to = '至' // 1 t.to = '至' // 1
@@ -187,6 +201,10 @@ t.refdate = '按日期'
t.hour = '小时' t.hour = '小时'
t.yes = '是' t.yes = '是'
t.no = '否' t.no = '否'
t.LoginRecords = ' 登录日志'
t.operationsRecords = ' 操作日志'
t.allIcons= '所有图标'
t.err= '错误'
t.errors = {} t.errors = {}
@@ -379,12 +397,27 @@ t.eq.month='月'
t.eq.realyield = '实际加工速度' t.eq.realyield = '实际加工速度'
t.eq.designyield = '理论加工速度' t.eq.designyield = '理论加工速度'
t.eq.viewtrend = '查看趋势' 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 = {}
t.pl.title = '产线' t.pl.title = '产线'
t.pl.id = '产线ID' t.pl.id = '产线ID'
t.pl.name = '产线名称' t.pl.name = '产线名称'
t.pl.sum = '合计'
t.pl.code = '产线编码' t.pl.code = '产线编码'
t.pl.status = '产线状态' t.pl.status = '产线状态'
t.pl.belong = '所属产线' t.pl.belong = '所属产线'
@@ -398,6 +431,14 @@ t.pl.success = '新设备数据获取成功'
t.pl.choose = '请选择设备' t.pl.choose = '请选择设备'
t.pl.confirm = '确定' t.pl.confirm = '确定'
t.pl.cancel = '取消' 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 = {} t.prompt = {}
@@ -413,6 +454,8 @@ t.validate = {}
t.validate.required = '必填项不能为空' t.validate.required = '必填项不能为空'
t.validate.format = '{attr}格式错误' t.validate.format = '{attr}格式错误'
t.validate.keyValueWarning = '该数值必须是100以内的正整数' t.validate.keyValueWarning = '该数值必须是100以内的正整数'
t.validate.requiredRole = '至少选择一个角色'
t.upload = {} t.upload = {}
t.upload.title = '上传资料' t.upload.title = '上传资料'
@@ -557,7 +600,7 @@ t.dict.remark = '备注'
t.dict.createDate = '创建时间' t.dict.createDate = '创建时间'
t.logError = {} t.logError = {}
t.logError.requestUri = '请求URI' t.logError.requestUri = '请求URL'
t.logError.requestMethod = '请求方式' t.logError.requestMethod = '请求方式'
t.logError.requestParams = '请求参数' t.logError.requestParams = '请求参数'
t.logError.ip = '操作IP' t.logError.ip = '操作IP'
@@ -584,7 +627,7 @@ t.logOperation.status0 = '失败'
t.logOperation.status1 = '成功' t.logOperation.status1 = '成功'
t.logOperation.creatorName = '用户名' t.logOperation.creatorName = '用户名'
t.logOperation.operation = '用户操作' t.logOperation.operation = '用户操作'
t.logOperation.requestUri = '请求URI' t.logOperation.requestUri = '请求URL'
t.logOperation.requestMethod = '请求方式' t.logOperation.requestMethod = '请求方式'
t.logOperation.requestParams = '请求参数' t.logOperation.requestParams = '请求参数'
t.logOperation.requestTime = '请求时长' t.logOperation.requestTime = '请求时长'
@@ -593,7 +636,8 @@ t.logOperation.userAgent = 'User-Agent'
t.logOperation.createDate = '创建时间' t.logOperation.createDate = '创建时间'
t.menu = {} t.menu = {}
t.menu.name = '名' t.menu.name = '中文名'
t.menu.nameEn = '英文名'
t.menu.icon = '图标' t.menu.icon = '图标'
t.menu.type = '类型' t.menu.type = '类型'
t.menu.type0 = '菜单' t.menu.type0 = '菜单'
@@ -647,6 +691,7 @@ t.user.validate = {}
t.user.validate.confirmPassword = '确认密码与密码输入不一致' t.user.validate.confirmPassword = '确认密码与密码输入不一致'
t.user.select = '选择用户' t.user.select = '选择用户'
t.user.selecterror = '请选择一条记录' t.user.selecterror = '请选择一条记录'
t.user.userTable = ' 用户表'
export default t export default t

View File

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

View File

@@ -1,6 +1,6 @@
<template> <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-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')"> <el-form-item :label="$t('updatePassword.username')">
<span>{{ $store.state.user.name }}</span> <span>{{ $store.state.user.name }}</span>
</el-form-item> </el-form-item>

View File

@@ -4,15 +4,10 @@
<navbar :showhome="false" :show-title="true" /> <navbar :showhome="false" :show-title="true" />
</div> --> </div> -->
<div class="choicepart-box"> <div class="choicepart-box">
<div <div v-for="(item, index) in routeList" :key="item.path" class="choicepart-item" @click="handelClick(item, index)">
v-for="(item, index) in routeList"
:key="item.path"
class="choicepart-item"
@click="handelClick(item, index)"
>
<!-- :style="{ background: colorArr.colorList[index % 9] }" --> <!-- :style="{ background: colorArr.colorList[index % 9] }" -->
<div class="choicepart-item-border"> <div class="choicepart-item-border">
<img :src="require(`../../assets/img/choicepart/${item.name}.png`)" alt=""> <img :src="require(`../../assets/img/choicepart/${item.name}.png`)" alt="" />
</div> </div>
<div class="choicepart-item-title" :title="item.name">{{ item.name }}</div> <div class="choicepart-item-title" :title="item.name">{{ item.name }}</div>
</div> </div>
@@ -33,7 +28,7 @@ const colorList1 = ['#b4b4ff', '#ffb4b4', '#c648fb', '#ff86c2', '#66f6f6', '#a2a
export default { export default {
name: 'ChoicePart', name: 'ChoicePart',
// components: { Navbar }, // components: { Navbar },
data() { data() {
return { return {
baseImg: require('../../assets/img/login-back.jpg'), baseImg: require('../../assets/img/login-back.jpg'),
@@ -62,7 +57,7 @@ export default {
// }) // })
// console.log(formatList) // console.log(formatList)
return window.SITE_CONFIG['menuList'] return window.SITE_CONFIG['menuList']
}, }
// ...mapGetters(['language', 'dictList', 'dictObj']) // ...mapGetters(['language', 'dictList', 'dictObj'])
}, },
created() { created() {
@@ -130,17 +125,16 @@ export default {
toRouter(item) { toRouter(item) {
// console.log(item.children[0].url) // console.log(item.children[0].url)
// 加个判断看是否双层children // 加个判断看是否双层children
if ((item.children) && (item.children[0].url == "")){ if (item.children && item.children[0].url == '') {
this.$router.push({name: item.children[0].children[0].url.replace(new RegExp('/','g'),'-')}) this.$router.push({ name: item.children[0].children[0].url.replace(new RegExp('/', 'g'), '-') })
} } else {
else { this.$router.push({ name: item.children[0].url.replace(new RegExp('/', 'g'), '-') })
this.$router.push({name: item.children[0].url.replace(new RegExp('/','g'),'-')})
} }
}, },
setIndex(list, index) { setIndex(list, index) {
list.meta.routeIndex = index list.meta.routeIndex = index
if (list.children) { if (list.children) {
list.children.map(item => { list.children.map((item) => {
this.setIndex(item, index) this.setIndex(item, index)
}) })
} }
@@ -151,20 +145,24 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.choicepart-container{ .choicepart-container {
min-width: 100%; min-width: 100%;
min-height: 100vh; min-height: 100vh;
// background: linear-gradient(-45deg, rgb(25, 25, 200), rgb(0, 100, 200)); // background: linear-gradient(-45deg, rgb(25, 25, 200), rgb(0, 100, 200));
background: url('../../assets/img/choicepart/choicepart-back.png') repeat; background: url('../../assets/img/choicepart/choicepart-back.png') repeat;
background-size: cover; background-size: cover;
overflow-x: scroll; overflow-x: scroll;
.choicepart-box{ // flex布局
.choicepart-box {
display: flex;
flex-flow: row wrap;
justify-content: center;
width: 1440px; width: 1440px;
margin: 0 auto; margin: 0 auto;
margin: 0 auto; margin: 0 auto;
padding-top: 16vh; padding-top: 16vh;
min-height: 100vh; min-height: 100vh;
.choicepart-item{ .choicepart-item {
display: inline-block; display: inline-block;
width: 208px; width: 208px;
height: 258px; height: 258px;
@@ -172,7 +170,7 @@ export default {
background: url('../../assets/img/choicepart/choice-item-back.png') no-repeat; background: url('../../assets/img/choicepart/choice-item-back.png') no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
// border: 1px dashed #fff; // border: 1px dashed #fff;
box-shadow: 0 2px 10px rgba(0, 0, 0, .5); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
top: 0; top: 0;
border-radius: 5px; border-radius: 5px;
overflow: hidden; overflow: hidden;
@@ -182,21 +180,21 @@ export default {
width: 208px; width: 208px;
height: 258px; height: 258px;
} }
.choicepart-item-border{ .choicepart-item-border {
height: 100%; height: 100%;
border-radius: 5px; border-radius: 5px;
padding: 0 5px; padding: 0 5px;
line-height: 32px; line-height: 32px;
font-size: 28px; font-size: 28px;
font-weight: lighter; font-weight: lighter;
color: #2C6BD8; color: #2c6bd8;
overflow: hidden; overflow: hidden;
} }
.choicepart-item-title { .choicepart-item-title {
overflow:hidden; overflow: hidden;
padding: 0 10px; padding: 0 10px;
text-overflow:ellipsis; text-overflow: ellipsis;
white-space:nowrap; white-space: nowrap;
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0;
@@ -207,16 +205,16 @@ export default {
line-height: 48px; line-height: 48px;
height: 48px; height: 48px;
letter-spacing: 2px; letter-spacing: 2px;
background-color: rgba($color: #0B58FF, $alpha: 0.45); background-color: rgba($color: #0b58ff, $alpha: 0.45);
} }
} }
.choicepart-item:hover { .choicepart-item:hover {
.choicepart-item-title { .choicepart-item-title {
background-color: rgba($color: #0B58FF, $alpha: 1); background-color: rgba($color: #0b58ff, $alpha: 1);
} }
} }
} }
.choicepat-navbar{ .choicepat-navbar {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
@@ -224,20 +222,23 @@ export default {
z-index: 10; z-index: 10;
} }
} }
::-webkit-scrollbar-track-piece { //滚动条凹槽的颜色,还可以设置边框属性 ::-webkit-scrollbar-track-piece {
background: rgba(255, 255, 255, .1); //滚动条凹槽的颜色,还可以设置边框属性
background: rgba(255, 255, 255, 0.1);
} }
::-webkit-scrollbar {//滚动条的宽度 ::-webkit-scrollbar {
width:9px; //滚动条的宽度
height:9px; width: 9px;
height: 9px;
} }
::-webkit-scrollbar-thumb {//滚动条的设置 ::-webkit-scrollbar-thumb {
//滚动条的设置
background-color: #dddddd; background-color: #dddddd;
background-clip:padding-box; background-clip: padding-box;
min-height:28px; min-height: 28px;
border-radius: 9px; border-radius: 9px;
} }
::-webkit-scrollbar-thumb:hover { ::-webkit-scrollbar-thumb:hover {
background-color:#bbb; background-color: #bbb;
} }
</style> </style>

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false"> <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-form-item prop="beanName" :label="$t('schedule.beanName')">
<el-input v-model="dataForm.beanName" :placeholder="$t('schedule.beanNameTips')"></el-input> <el-input v-model="dataForm.beanName" :placeholder="$t('schedule.beanNameTips')"></el-input>
</el-form-item> </el-form-item>

View File

@@ -1,7 +1,7 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-job__schedule"> <div class="mod-job__schedule">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="currentChangeHandle(1)" class="blueTip" size="small"> <el-form :inline="true" :model="dataForm" ref="form" @keyup.enter.native="currentChangeHandle(dataForm.beanName)" class="blueTip" size="small">
<el-form-item> <el-form-item>
{{ $t('schedule.beanName') }} {{ $t('schedule.beanName') }}
</el-form-item> </el-form-item>
@@ -9,7 +9,7 @@
<el-input v-model="dataForm.beanName" :placeholder="$t('schedule.beanName')" clearable></el-input> <el-input v-model="dataForm.beanName" :placeholder="$t('schedule.beanName')" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button class="buttonColor" @click="currentChangeHandle(1)">{{ $t('query') }}</el-button> <el-button class="buttonColor" @click="currentChangeHandle(dataForm.beanName)">{{ $t('query') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button v-if="$hasPermission('sys:schedule:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> <el-button v-if="$hasPermission('sys:schedule:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
@@ -30,13 +30,7 @@
<el-button v-if="$hasPermission('sys:schedule:log')" type="success" @click="logHandle()">{{ $t('schedule.log') }}</el-button> <el-button v-if="$hasPermission('sys:schedule:log')" type="success" @click="logHandle()">{{ $t('schedule.log') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" @sort-change="dataListSortChangeHandle" style="width: 100%">
v-loading="dataListLoading"
:data="dataList"
border
@selection-change="dataListSelectionChangeHandle"
@sort-change="dataListSortChangeHandle"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column> <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="beanName" :label="$t('schedule.beanName')" header-align="center" align="center"></el-table-column> <el-table-column prop="beanName" :label="$t('schedule.beanName')" header-align="center" align="center"></el-table-column>
<el-table-column prop="params" :label="$t('schedule.params')" header-align="center" align="center"></el-table-column> <el-table-column prop="params" :label="$t('schedule.params')" header-align="center" align="center"></el-table-column>
@@ -81,7 +75,7 @@ import AddOrUpdate from './schedule-add-or-update'
import Log from './schedule-log' import Log from './schedule-log'
export default { export default {
mixins: [mixinViewModule], mixins: [mixinViewModule],
data () { data() {
return { return {
mixinViewModuleOptions: { mixinViewModuleOptions: {
getDataListURL: '/sys/schedule/page', getDataListURL: '/sys/schedule/page',
@@ -103,11 +97,11 @@ export default {
// destroy dialog // destroy dialog
handleDestroyDialog() { handleDestroyDialog() {
setTimeout(() => { setTimeout(() => {
this.addOrUpdateVisible= false this.addOrUpdateVisible = false
}, /** after dialog animated */ 200); }, /** after dialog animated */ 200)
}, },
// 暂停 // 暂停
pauseHandle (id) { pauseHandle(id) {
if (!id && this.dataListSelections.length <= 0) { if (!id && this.dataListSelections.length <= 0) {
return this.$message({ return this.$message({
message: this.$t('prompt.deleteBatch'), message: this.$t('prompt.deleteBatch'),
@@ -115,12 +109,15 @@ export default {
duration: 500 duration: 500
}) })
} }
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('schedule.pause') }), this.$t('prompt.title'), { this.$confirm(this.$t('prompt.info', { handle: this.$t('schedule.pause') }), this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'), confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'), cancelButtonText: this.$t('cancel'),
type: 'warning' type: 'warning'
}).then(() => { })
this.$http.put(this.$http.adornUrl('/sys/schedule/pause'), id ? [id] : this.dataListSelections.map(item => item.id)).then(({ data: res }) => { .then(() => {
this.$http
.put(this.$http.adornUrl('/sys/schedule/pause'), id ? [id] : this.dataListSelections.map((item) => item.id))
.then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
@@ -132,11 +129,13 @@ export default {
this.getDataList() this.getDataList()
} }
}) })
}).catch(() => {}) })
}).catch(() => {}) .catch(() => {})
})
.catch(() => {})
}, },
// 恢复 // 恢复
resumeHandle (id) { resumeHandle(id) {
if (!id && this.dataListSelections.length <= 0) { if (!id && this.dataListSelections.length <= 0) {
return this.$message({ return this.$message({
message: this.$t('prompt.deleteBatch'), message: this.$t('prompt.deleteBatch'),
@@ -144,12 +143,15 @@ export default {
duration: 500 duration: 500
}) })
} }
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('schedule.resume') }), this.$t('prompt.title'), { this.$confirm(this.$t('prompt.info', { handle: this.$t('schedule.resume') }), this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'), confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'), cancelButtonText: this.$t('cancel'),
type: 'warning' type: 'warning'
}).then(() => { })
this.$http.put(this.$http.adornUrl('/sys/schedule/resume'), id ? [id] : this.dataListSelections.map(item => item.id)).then(({ data: res }) => { .then(() => {
this.$http
.put(this.$http.adornUrl('/sys/schedule/resume'), id ? [id] : this.dataListSelections.map((item) => item.id))
.then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
@@ -161,11 +163,13 @@ export default {
this.getDataList() this.getDataList()
} }
}) })
}).catch(() => {}) })
}).catch(() => {}) .catch(() => {})
})
.catch(() => {})
}, },
// 执行 // 执行
runHandle (id) { runHandle(id) {
if (!id && this.dataListSelections.length <= 0) { if (!id && this.dataListSelections.length <= 0) {
return this.$message({ return this.$message({
message: this.$t('prompt.deleteBatch'), message: this.$t('prompt.deleteBatch'),
@@ -173,12 +177,15 @@ export default {
duration: 500 duration: 500
}) })
} }
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('schedule.run') }), this.$t('prompt.title'), { this.$confirm(this.$t('prompt.info', { handle: this.$t('schedule.run') }), this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'), confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'), cancelButtonText: this.$t('cancel'),
type: 'warning' type: 'warning'
}).then(() => { })
this.$http.put(this.$http.adornUrl('/sys/schedule/run'), id ? [id] : this.dataListSelections.map(item => item.id)).then(({ data: res }) => { .then(() => {
this.$http
.put(this.$http.adornUrl('/sys/schedule/run'), id ? [id] : this.dataListSelections.map((item) => item.id))
.then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
@@ -190,15 +197,28 @@ export default {
this.getDataList() this.getDataList()
} }
}) })
}).catch(() => {}) })
}).catch(() => {}) .catch(() => {})
})
.catch(() => {})
}, },
// 日志列表 // 日志列表
logHandle () { logHandle() {
this.logVisible = true this.logVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.log.init() this.$refs.log.init()
}) })
},
// 当前页
currentChangeHandle(val) {
console.log('val', val)
this.$nextTick(() => {
this.dataForm.beanName = val
})
this.getDataList()
// this.$refs['form'].resetFields()
this.dataForm.beanName = ''
console.log('this.dataForm', this.dataForm)
} }
} }
} }

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

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

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible"> <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-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-input v-model="dataForm.alarmId" placeholder="报警信息ID关联T_equipment_group_alarm表"></el-input>
</el-form-item> </el-form-item>

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible"> <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-form-item label="设备ID" prop="equipmentId">
<el-input v-model="dataForm.equipmentId" placeholder="设备ID"></el-input> <el-input v-model="dataForm.equipmentId" placeholder="设备ID"></el-input>
</el-form-item> </el-form-item>

View File

@@ -5,7 +5,7 @@
{{ $t('pl.name') }} {{ $t('pl.name') }}
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-select v-model="dataForm.lineId" :placeholder="$t('pl.name')" clearable> <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-option v-for="line in lineList" :key="line.code" :value="line.id" :label="line.name" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -13,7 +13,7 @@
{{ $t('eq.name') }} {{ $t('eq.name') }}
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-select v-model="dataForm.equipmentId" :placeholder="$t('eq.name')" clearable> <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-option v-for="eq in eqList" :key="eq.code" :value="eq.id" :label="eq.name" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -58,6 +58,7 @@ import TableTextComponent from '@/components/base-table/components/detailCompone
const tableConfigs = [ const tableConfigs = [
{ {
type: 'index', type: 'index',
width: 100,
name: i18n.t('index') name: i18n.t('index')
}, },
{ prop: 'equipmentName', name: i18n.t('realtime.eqName') }, { prop: 'equipmentName', name: i18n.t('realtime.eqName') },
@@ -89,6 +90,7 @@ const tableConfigs = [
prop: 'status', prop: 'status',
name: i18n.t('realtime.state'), name: i18n.t('realtime.state'),
filter: (val) => { 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] if (val !== null && val !== undefined) return [i18n.t('normal'), i18n.t('planStop'), i18n.t('malfunction')][+val]
} }
}, },
@@ -149,8 +151,9 @@ export default {
BaseTable BaseTable
}, },
activated() { activated() {
this.getEqList() // this.getEqList()
this.getLineList() this.getLineList()
this.getEqList()
this.getDataList() this.getDataList()
}, },
methods: { methods: {
@@ -164,7 +167,11 @@ export default {
getEqList() { getEqList() {
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipment/page'), url: this.$http.adornUrl('/monitoring/equipment/page'),
method: 'get' method: 'get',
params: this.$http.adornParams({
limit: 99999,
page: 1
})
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.eqList = data.data.list this.eqList = data.data.list
@@ -173,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() { getLineList() {
this.$http({ this.$http({

View File

@@ -8,7 +8,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<!-- <el-select v-model="dataForm.factoryId" :placeholder="$t('eq.name') + ' / ' + $t('eq.code')" clearable></el-select> --> <!-- <el-select v-model="dataForm.factoryId" :placeholder="$t('eq.name') + ' / ' + $t('eq.code')" clearable></el-select> -->
<el-select v-model="dataForm.ftId" :placeholder="$t('factory.title')" @change="handleftIdChange" clearable> <el-select v-model="dataForm.ftId" :placeholder="$t('factory.title')" @change="handleftIdChange" clearable filterable>
<el-option v-for="factory in factoryList" :key="factory.id" :value="factory.id" :label="factory.name" /> <el-option v-for="factory in factoryList" :key="factory.id" :value="factory.id" :label="factory.name" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -17,7 +17,7 @@
{{ $t('pl.title') }} {{ $t('pl.title') }}
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-select v-model="dataForm.productlines" :placeholder="$t('pl.title')" multiple clearable> <el-select v-model="dataForm.productlines" :placeholder="$t('pl.title')" multiple clearable filterable>
<el-option v-for="productLine in productLineList" :key="productLine.id" :value="productLine.id" :label="productLine.name" /> <el-option v-for="productLine in productLineList" :key="productLine.id" :value="productLine.id" :label="productLine.name" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -89,6 +89,7 @@ import moment from 'moment'
const tableConfigs = [ const tableConfigs = [
{ {
type: 'index', type: 'index',
width: 100,
name: i18n.t('index') name: i18n.t('index')
}, },
{ {
@@ -206,7 +207,7 @@ export default {
this.factoryList = res.data this.factoryList = res.data
/** set default */ /** set default */
if (this.factoryList.length) { if (this.factoryList.length) {
this.dataForm.ftId = this.factoryList[0].id // this.dataForm.ftId = this.factoryList[0].id
} }
} else { } else {
this.factoryList = [] this.factoryList = []
@@ -235,7 +236,7 @@ export default {
if (res && res.code === 0 && res.data.length) { if (res && res.code === 0 && res.data.length) {
this.productLineList = res.data this.productLineList = res.data
/** set default */ /** set default */
this.dataForm.productlines = [this.productLineList[0].id] // this.dataForm.productlines = [this.productLineList[0].id]
} else { } else {
this.productLineList = [] this.productLineList = []
this.dataForm.productlines = [] this.dataForm.productlines = []

View File

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

View File

@@ -14,7 +14,7 @@
{{ $t('pl.title') }} {{ $t('pl.title') }}
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-select v-model="dataForm.productlines" :placeholder="$t('pl.title')" multiple clearable> <el-select v-model="dataForm.productlines" :placeholder="$t('pl.title')" multiple clearable filterable>
<el-option v-for="productLine in productLineList" :key="productLine.id" :value="productLine.id" :label="productLine.name" /> <el-option v-for="productLine in productLineList" :key="productLine.id" :value="productLine.id" :label="productLine.name" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -52,6 +52,7 @@ import moment from 'moment'
const tableConfigs = [ const tableConfigs = [
{ {
type: 'index', type: 'index',
width: 100,
name: i18n.t('index') name: i18n.t('index')
}, },
// { prop: 'time', name: '时间', filter: timeFilter }, // { prop: 'time', name: '时间', filter: timeFilter },
@@ -134,10 +135,10 @@ export default {
}).then(({ data: res }) => { }).then(({ data: res }) => {
if (res && res.code === 0) { if (res && res.code === 0) {
this.productLineList = res.data this.productLineList = res.data
/** set default */ /** set default 默认*/
if (this.productLineList.length) { // if (this.productLineList.length) {
this.dataForm.productlines = [this.productLineList[0].id] // this.dataForm.productlines = [this.productLineList[0].id]
} // }
} else { } else {
this.productLineList = [] this.productLineList = []
this.dataForm.productlines = [] this.dataForm.productlines = []

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible"> <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-form-item label="设备ID" prop="equipmentId">
<el-input v-model="dataForm.equipmentId" placeholder="设备ID"></el-input> <el-input v-model="dataForm.equipmentId" placeholder="设备ID"></el-input>
</el-form-item> </el-form-item>

View File

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

View File

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

View File

@@ -21,7 +21,17 @@
</el-form> </el-form>
<!-- <base-table :page="pageIndex" :size="pageSize" :data="dataList" :table-head-configs="tableConfigs" :max-height="calcMaxHeight(8)" @operate-event="handleOperations" @refreshDataList="getDataList" /> --> <!-- <base-table :page="pageIndex" :size="pageSize" :data="dataList" :table-head-configs="tableConfigs" :max-height="calcMaxHeight(8)" @operate-event="handleOperations" @refreshDataList="getDataList" /> -->
<base-table :data="dataList" :table-head-configs="tableConfigs" :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> </div>
</template> </template>
@@ -41,7 +51,26 @@ export default {
equipmentName: null, equipmentName: null,
equipmentCode: null, equipmentCode: null,
tableConfigs: [], tableConfigs: [],
tableConfigs2: [],
tableConfigs3: [],
tableConfigs4: [],
tableConfigs5: [],
tableConfigs6: [],
tableConfigs7: [],
tableConfigs8: [],
tableConfigs9: [],
tableConfigs10: [],
dataLength: null,
dataList: [], dataList: [],
dataList2: [],
dataList3: [],
dataList4: [],
dataList5: [],
dataList6: [],
dataList7: [],
dataList8: [],
dataList9: [],
dataList10: [],
dataListLoading: false, dataListLoading: false,
dataListSelections: [] dataListSelections: []
} }
@@ -56,7 +85,7 @@ export default {
mouted() { mouted() {
this.getDataList() this.getDataList()
}, },
created(){ created() {
// console.log('params',this.$route.params) // console.log('params',this.$route.params)
}, },
methods: { methods: {
@@ -73,7 +102,10 @@ export default {
url: this.$http.adornUrl(`/monitoring/equipmentValueMonitor/runLog/${this.$route.params.id}`), url: this.$http.adornUrl(`/monitoring/equipmentValueMonitor/runLog/${this.$route.params.id}`),
method: 'get' method: 'get'
}).then(({ data: res }) => { }).then(({ data: res }) => {
console.log('res',res) 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
if ( if (
res && res &&
res.code === 0 && res.code === 0 &&
@@ -84,16 +116,138 @@ export default {
res.data[0].data && res.data[0].data &&
res.data[0].data.length > 0 res.data[0].data.length > 0
) { ) {
this.equipmentName = res.data[0].data[0].equName // console.log(this.equipmentName)
this.equipmentCode = res.data[0].data[0].equCode
console.log(this.equipmentName)
this.setTableProps(res.data[0].nameData) this.setTableProps(res.data[0].nameData)
this.setTableData(res.data[0].data) this.setTableData(res.data[0].data)
} else { }
this.dataList = [] 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 this.dataListLoading = false
}) }).catch(()=>{}) //---去除无效报错---
}, },
setTableProps(nameData) { setTableProps(nameData) {
this.tableConfigs = [ this.tableConfigs = [
@@ -110,6 +264,177 @@ export default {
// }) // })
...Array.from(new Set(nameData.map((item) => item.name))).map((name) => ({ prop: name, name })) ...Array.from(new Set(nameData.map((item) => item.name))).map((name) => ({ prop: name, name }))
] ]
// 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) { setTableData(data) {
this.dataList = data.map((item) => { this.dataList = data.map((item) => {
@@ -121,6 +446,105 @@ export default {
} }
return rowItem 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) => {
rowItem[param.dynamicName] = param.dynamicValue
})
}
return rowItem
})
} }
} }
} }

View File

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

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible"> <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-form-item label="plc连接表ID" prop="plcConId">
<el-input v-model="dataForm.plcConId" placeholder="plc连接表ID"></el-input> <el-input v-model="dataForm.plcConId" placeholder="plc连接表ID"></el-input>
</el-form-item> </el-form-item>

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible"> <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-form-item label="设备外部编码" prop="externalCode">
<el-input v-model="dataForm.externalCode" placeholder="设备外部编码"></el-input> <el-input v-model="dataForm.externalCode" placeholder="设备外部编码"></el-input>
</el-form-item> </el-form-item>

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible"> <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-form-item label="设备外部代码" prop="externalCode">
<el-input v-model="dataForm.externalCode" placeholder="设备外部代码"></el-input> <el-input v-model="dataForm.externalCode" placeholder="设备外部代码"></el-input>
</el-form-item> </el-form-item>

View File

@@ -7,7 +7,7 @@
{{ $t('pl.title') }} {{ $t('pl.title') }}
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-select v-model="dataForm.productlines" :placeholder="$t('pl.title')" @change="handleProductLineChange" clearable> <el-select v-model="dataForm.productlines" :placeholder="$t('pl.title')" @change="handleProductLineChange" clearable filterable>
<el-option v-for="productLine in productLineList" :key="productLine.id" :value="productLine.id" <el-option v-for="productLine in productLineList" :key="productLine.id" :value="productLine.id"
:label="productLine.name" /> :label="productLine.name" />
</el-select> </el-select>
@@ -18,7 +18,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<!-- <el-select v-model="dataForm.factoryId" :placeholder="$t('eq.name') + ' / ' + $t('eq.code')" clearable></el-select> --> <!-- <el-select v-model="dataForm.factoryId" :placeholder="$t('eq.name') + ' / ' + $t('eq.code')" clearable></el-select> -->
<el-select v-model="dataForm.wsId" :placeholder="$t('pl.process')" clearable> <el-select v-model="dataForm.wsId" :placeholder="$t('pl.process')" clearable filterable>
<el-option v-for="ws in wsList" :key="ws.id" :value="ws.id" :label="ws.name" /> <el-option v-for="ws in wsList" :key="ws.id" :value="ws.id" :label="ws.name" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -47,7 +47,7 @@
</div> </div>
<el-dialog :visible.sync="dialogVisible" :title="$t('pl.add')" width="30%"> <el-dialog :visible.sync="dialogVisible" :title="$t('pl.add')" width="30%">
<el-select v-model="eqId" style="width: 100%" :placeholder="$t('pl.choose')" clearable> <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-option v-for="eq in dialogEqList" :key="eq.id" :label="eq.name" :value="eq.id" />
</el-select> </el-select>
<div slot="footer"> <div slot="footer">
@@ -270,10 +270,10 @@ export default {
}).then(({ data: res }) => { }).then(({ data: res }) => {
if (res && res.code === 0) { if (res && res.code === 0) {
this.productLineList = res.data this.productLineList = res.data
/** set default */ /** set default 默认*/
if (this.productLineList.length) { // if (this.productLineList.length) {
this.dataForm.productlines = this.productLineList[0].id // this.dataForm.productlines = this.productLineList[0].id
} // }
} else { } else {
this.productLineList = [] this.productLineList = []
} }

View File

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

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible"> <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-form-item label="设备类型ID" prop="equipmentTypeId">
<el-input v-model="dataForm.equipmentTypeId" placeholder="设备类型ID"></el-input> <el-input v-model="dataForm.equipmentTypeId" placeholder="设备类型ID"></el-input>
</el-form-item> </el-form-item>

View File

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

View File

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

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

@@ -54,13 +54,14 @@ const topBtnConfig = [
const tableConfigs = [ const tableConfigs = [
{ {
type: 'index', type: 'index',
width: 100,
name: i18n.t('index') name: i18n.t('index')
}, },
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter }, { prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
{ prop: 'factoryName', name: i18n.t('factory.title') }, { prop: 'factoryName', name: i18n.t('factory.title') },
{ prop: 'name', name: i18n.t('pl.name') }, { prop: 'name', name: i18n.t('pl.name') },
{ prop: 'code', name: i18n.t('pl.code') }, { 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: 'description', name: i18n.t('desc') },
{ prop: 'remark', name: i18n.t('remark') }, { prop: 'remark', name: i18n.t('remark') },
{ prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] } { prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible"> <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-form-item label="产线id" prop="productionLineId">
<el-input v-model="dataForm.productionLineId" placeholder="产线id"></el-input> <el-input v-model="dataForm.productionLineId" placeholder="产线id"></el-input>
</el-form-item> </el-form-item>

View File

@@ -65,6 +65,7 @@ const topBtnConfig = [
const tableConfigs = [ const tableConfigs = [
{ {
type: 'index', type: 'index',
width: 100,
name: i18n.t('index') name: i18n.t('index')
}, },
{ {
@@ -74,7 +75,7 @@ const tableConfigs = [
}, },
{ prop: 'inspectionDetContent', name: i18n.t('andeng.inspectContent') }, // name: '检测内容' }, { prop: 'inspectionDetContent', name: i18n.t('andeng.inspectContent') }, // name: '检测内容' },
{ prop: 'keyValue', name: i18n.t('andeng.btnVal') }, // 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', prop: 'operations',
@@ -144,7 +145,9 @@ const addOrUpdateConfigs = {
required: true, required: true,
type: 'select', type: 'select',
options: [] options: []
} },
{ name: 'buttonId', label: i18n.t('buttonId') },
{ name: 'boxNo', label: i18n.t('boxNo') }
], ],
operations: [ operations: [
{ name: 'cancel', showAlways: true }, { name: 'cancel', showAlways: true },
@@ -333,14 +336,15 @@ export default {
this.addOrUpdateConfigs.fields.forEach((item) => { this.addOrUpdateConfigs.fields.forEach((item) => {
// console.log('item',item) // console.log('item',item)
// console.log('res',res) // console.log('res',res)
if (item.name === 'inspectionDetContent') item.options = res.data.list.map((item) => ({ label: item.content, value: item.content, inspectionDetId: item.code })) if (item.name === 'inspectionDetContent') item.options = res.data.list.map((item) => ({ label: item.content, value: item.content, inspectionDetId: item.id }))
// console.log('item',item) // console.log('this.addOrUpdateConfigs.fields[4].options', this.addOrUpdateConfigs.fields[4].options)
}) })
} else { } else {
this.addOrUpdateConfigs.fields.forEach((item) => { this.addOrUpdateConfigs.fields.forEach((item) => {
if (item.name === 'inspectionDetContent') item.options.splice(0) if (item.name === 'inspectionDetContent') item.options.splice(0)
}) })
} }
// console.log('this.addOrUpdateConfigs.fields[4]检测内容',this.addOrUpdateConfigs)
}) })
}, },
// 每页数 // 每页数
@@ -374,16 +378,20 @@ export default {
} }
case 'inspectionDetContent': case 'inspectionDetContent':
// this.dataForm.inspectionDetId = id // this.dataForm.inspectionDetId = id
// console.log(id) // console.log('name',name)
// console.log('id',id)
// console.log(this.addOrUpdateConfigs.fields[4].options) // console.log(this.addOrUpdateConfigs.fields[4].options)
for (var i = 0; i < this.addOrUpdateConfigs.fields[4].options.length; i++) { for (var i = 0; i < this.addOrUpdateConfigs.fields[4].options.length; i++) {
if (this.addOrUpdateConfigs.fields[4].options[i].label == id) { if (this.addOrUpdateConfigs.fields[4].options[i].label == id) {
this.dataForm.inspectionDetId = this.addOrUpdateConfigs.fields[4].options[i].inspectionDetId this.dataForm.inspectionDetId = this.addOrUpdateConfigs.fields[4].options[i].inspectionDetId
this.addOrUpdateConfigs.fields.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('dataForm', this.dataForm)
console.log('addOrUpdateConfigs', this.addOrUpdateConfigs.fields) // console.log('addOrUpdateConfigs', this.addOrUpdateConfigs.fields)
} }
}, },
addSuccess() { addSuccess() {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -2,7 +2,7 @@
* @Author: lb * @Author: lb
* @Date: 2022-06-22 14:00:17 * @Date: 2022-06-22 14:00:17
* @LastEditors: fzq * @LastEditors: fzq
* @LastEditTime: 2023-02-02 17:17:45 * @LastEditTime: 2023-02-09 09:53:57
* @Description: 产线生产实时数据 * @Description: 产线生产实时数据
--> -->
<template> <template>
@@ -38,13 +38,26 @@ export default {
}, },
mounted() { mounted() {
// console.log('this.$route', this.$route)
this.clearData() this.clearData()
this.fetchList().then(({ data: res }) => { this.fetchList().then(({ data: res }) => {
// console.log('fetchlist:', res)
this.testData = res this.testData = res
this.handleData() 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.intervalId = setInterval(() => {
this.$message({ this.$message({
message: this.$t('realtime.refresh'), message: this.$t('realtime.refresh'),
@@ -63,6 +76,9 @@ export default {
deactivated() { deactivated() {
if (this.intervalId) clearInterval(this.intervalId) if (this.intervalId) clearInterval(this.intervalId)
}, },
created() {
// console.log('this.tableData', this.tableData)
},
methods: { methods: {
fetchList() { fetchList() {
@@ -97,7 +113,7 @@ export default {
expandDataStepOne() { expandDataStepOne() {
// 扩展服务器返回的数据第一阶段 // 扩展服务器返回的数据第一阶段
// console.log('create new one') // console.log('create new one')
this.tableData = this.testData.data.map(item => { this.tableData = this.testData.data.map((item) => {
const newItem = { const newItem = {
lineName: item.lineName, lineName: item.lineName,
orderName: item.orderName, orderName: item.orderName,
@@ -105,14 +121,14 @@ export default {
} }
if (item.det) { if (item.det) {
item.det.forEach(obj => { item.det.forEach((obj) => {
// Step2: 设置动态props // Step2: 设置动态props
if (!this.dynamicPropSet) { if (!this.dynamicPropSet) {
this.tableProps.push({ this.tableProps.push({
label: moment(obj.recordTime).format('YYYY-MM-DD HH')+ moment(obj.recordTime).add(1,'hours').format('-HH')+i18n.t('hourTime'), label: moment(obj.recordTime).format('YYYY-MM-DD HH') + moment(obj.recordTime).add(1, 'hours').format('-HH') + i18n.t('hourTime'),
children: [ children: [
{ prop: obj.recordTime + '-inputNum', label: i18n.t('realtime.in') }, { prop: obj.recordTime + '-inputNum', label: i18n.t('realtime.in') },
{ prop: obj.recordTime + '-outputNum', label: i18n.t('realtime.out') }, { prop: obj.recordTime + '-outputNum', label: i18n.t('realtime.out') }
// { prop: obj.recordTime + '-passArea', label: i18n.t('realtime.goodrate') }, // { prop: obj.recordTime + '-passArea', label: i18n.t('realtime.goodrate') },
// { prop: obj.recordTime + '-scrapNum', label: i18n.t('realtime.num') }, // { prop: obj.recordTime + '-scrapNum', label: i18n.t('realtime.num') },
// { prop: obj.recordTime + '-scrapRate', label: i18n.t('realtime.rate') } // { prop: obj.recordTime + '-scrapRate', label: i18n.t('realtime.rate') }

View File

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

View File

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

View File

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

View File

@@ -1,8 +1,8 @@
<!-- <!--
* @Author: gtz * @Author: gtz
* @Date: 2021-03-07 18:39:03 * @Date: 2021-03-07 18:39:03
* @LastEditors: gtz * @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: 2022-02-24 16:35:51 * @LastEditTime: 2023-09-20 11:14:33
* @Description: file content * @Description: file content
--> -->
<template> <template>
@@ -24,7 +24,8 @@ export default {
// url: process.env.VUE_APP_REPORT_VIEW_URL // url: process.env.VUE_APP_REPORT_VIEW_URL
// url: window.SITE_CONFIG['apiURL'] + this.$http.adornUrl('/ureport/preview') // url: window.SITE_CONFIG['apiURL'] + this.$http.adornUrl('/ureport/preview')
// url: (process.env.NODE_ENV === 'production' ? '/api' : '/yd-monitor') + '/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() { mounted() {

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible"> <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-form-item label="分类关联report_sheet_category" prop="category">
<el-input v-model="dataForm.category" placeholder="分类关联report_sheet_category"></el-input> <el-input v-model="dataForm.category" placeholder="分类关联report_sheet_category"></el-input>
</el-form-item> </el-form-item>

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible"> <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-form-item label="编码" prop="code">
<el-input v-model="dataForm.code" placeholder="编码"></el-input> <el-input v-model="dataForm.code" placeholder="编码"></el-input>
</el-form-item> </el-form-item>

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible"> <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-form-item label="文件类型编号" prop="typeCode">
<el-input v-model="dataForm.typeCode" placeholder="文件类型编号"></el-input> <el-input v-model="dataForm.typeCode" placeholder="文件类型编号"></el-input>
</el-form-item> </el-form-item>

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible"> <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-form-item label="文件类型编号" prop="typeCode">
<el-input v-model="dataForm.typeCode" placeholder="文件类型编号"></el-input> <el-input v-model="dataForm.typeCode" placeholder="文件类型编号"></el-input>
</el-form-item> </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

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

View File

@@ -4,9 +4,8 @@
:title="isDetail ? $t('ws.detail') : !dataForm.id ? $t('add') : $t('edit')" :title="isDetail ? $t('ws.detail') : !dataForm.id ? $t('add') : $t('edit')"
:visible.sync="visible" :visible.sync="visible"
:close-on-click-modal="false" :close-on-click-modal="false"
:destroy-on-close="true" :destroy-on-close="true">
> <div style="max-height: 60vh; overflow-y: scroll; overflow-x: hidden">
<div style="max-height: 60vh; overflow-y: scroll; overflow-x: hidden;">
<el-form ref="dataForm" :model="dataForm" :rules="dataFormRules"> <el-form ref="dataForm" :model="dataForm" :rules="dataFormRules">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12" <el-col :span="12"
@@ -20,7 +19,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12" <el-col :span="12"
><el-form-item :label="$t('ws.belong')" prop="productionLineId"> ><el-form-item :label="$t('ws.belong')" prop="productionLineId">
<el-select v-model="dataForm.productionLineId" :placeholder="$t('ws.belong')"> <el-select v-model="dataForm.productionLineId" :placeholder="$t('ws.belong')" filterable>
<el-option v-for="line in lineList" :key="line.id" :value="line.id" :label="line.name" /> <el-option v-for="line in lineList" :key="line.id" :value="line.id" :label="line.name" />
</el-select> </el-form-item </el-select> </el-form-item
></el-col> ></el-col>
@@ -49,8 +48,7 @@
:table-head-configs="tableProps" :table-head-configs="tableProps"
:max-height="calcMaxHeight(8)" :max-height="calcMaxHeight(8)"
@operate-event="handleOperations" @operate-event="handleOperations"
@refreshDataList="getDataList" @refreshDataList="getDataList" />
/>
<el-pagination <el-pagination
@size-change="sizeChangeHandle" @size-change="sizeChangeHandle"
@current-change="currentChangeHandle" @current-change="currentChangeHandle"
@@ -58,16 +56,31 @@
:page-sizes="[5, 10, 15, 20]" :page-sizes="[5, 10, 15, 20]"
:page-size="limit" :page-size="limit"
:total="eqTotal" :total="eqTotal"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper" />
/>
</div> </div>
<attr-form v-else ref="AttrFrom" :workshop-section-id="dataForm.id" @close-attr-form="showAttrForm = false" @refresh-list="handleRefreshList" /> <attr-form v-else ref="AttrFrom" :workshop-section-id="dataForm.id" @close-attr-form="showAttrForm = false" @refresh-list="handleRefreshList" />
</section> </section>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="handleClick({ name: 'cancel' })">{{ $t('cancel') }}</el-button> <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
<el-button type="success" v-else @click="handleClick({ name: 'save' })">{{ $t('save') }}</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> </span>
</el-dialog> </el-dialog>
</template> </template>
@@ -83,6 +96,7 @@ import { calcMaxHeight } from '@/utils'
const tableProps = [ const tableProps = [
{ {
type: 'index', type: 'index',
width: 100,
name: i18n.t('index') name: i18n.t('index')
}, },
{ name: i18n.t('eq.name'), prop: 'equipmentName' }, { name: i18n.t('eq.name'), prop: 'equipmentName' },
@@ -291,7 +305,7 @@ export default {
} }
}, },
handleCreateOrUpdate() { handleCreateOrUpdate() {
this.$refs['dataForm'].validate(valid => { this.$refs['dataForm'].validate((valid) => {
if (valid) { if (valid) {
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/workshopSection'), url: this.$http.adornUrl('/monitoring/workshopSection'),

View File

@@ -5,7 +5,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="edit ? $t('ws.binded') : $t('ws.unbind')" prop="equipmentId"> <el-form-item :label="edit ? $t('ws.binded') : $t('ws.unbind')" prop="equipmentId">
<el-select v-if="!edit" clearable v-model="dataForm.equipmentId" :placeholder="$t('ws.eqbindplaceholder')"> <el-select v-if="!edit" clearable v-model="dataForm.equipmentId" :placeholder="$t('ws.eqbindplaceholder')" filterable>
<el-option v-for="eq in eqList" :key="eq.id" :label="eq.name" :value="eq.id" /> <el-option v-for="eq in eqList" :key="eq.id" :label="eq.name" :value="eq.id" />
</el-select> </el-select>
<el-input v-else disabled v-model="bindedEquipmentName" /> </el-form-item <el-input v-else disabled v-model="bindedEquipmentName" /> </el-form-item

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible"> <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-form-item label="工段ID" prop="workshopSectionId">
<el-input v-model="dataForm.workshopSectionId" placeholder="工段ID"></el-input> <el-input v-model="dataForm.workshopSectionId" placeholder="工段ID"></el-input>
</el-form-item> </el-form-item>

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog :visible.sync="visible" :title="$t('oss.config')" :close-on-click-modal="false" :close-on-press-escape="false"> <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-form-item :label="$t('oss.type')" size="mini">
<el-radio-group v-model="dataForm.type"> <el-radio-group v-model="dataForm.type">
<el-radio :label="1">{{ $t('oss.type1') }}</el-radio> <el-radio :label="1">{{ $t('oss.type1') }}</el-radio>

View File

@@ -30,7 +30,8 @@ export default {
this.visible = true this.visible = true
// this.url = `${window.SITE_CONFIG['apiURL']}/sys/oss/upload?token=${Cookies.get('token')}` // 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 = (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.num = 0
this.fileList = [] this.fileList = []
}, },

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false"> <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-form-item prop="name" :label="$t('dept.name')">
<el-input v-model="dataForm.name" :placeholder="$t('dept.name')"></el-input> <el-input v-model="dataForm.name" :placeholder="$t('dept.name')"></el-input>
</el-form-item> </el-form-item>

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false"> <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-form-item prop="dictValue" :label="$t('dict.dictValue')">
<el-input v-model="dataForm.dictValue" :placeholder="$t('dict.dictValue')"></el-input> <el-input v-model="dataForm.dictValue" :placeholder="$t('dict.dictValue')"></el-input>
</el-form-item> </el-form-item>

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false"> <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="dictName" :label="$t('dict.dictName')"> <el-form-item prop="dictName" :label="$t('dict.dictName')">
<el-input v-model="dataForm.dictName" :placeholder="$t('dict.dictName')"></el-input> <el-input v-model="dataForm.dictName" :placeholder="$t('dict.dictName')"></el-input>
</el-form-item> </el-form-item>

View File

@@ -24,7 +24,7 @@
<el-button v-if="$hasPermission('sys:dict:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> <el-button v-if="$hasPermission('sys:dict:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="showIcons()">所有图标</el-button> <el-button @click="showIcons()">{{ $t('allIcons') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- border <!-- border

View File

@@ -4,7 +4,7 @@
* @Author: fzq * @Author: fzq
* @Date: 2022-11-25 09:51:46 * @Date: 2022-11-25 09:51:46
* @LastEditors: fzq * @LastEditors: fzq
* @LastEditTime: 2023-01-13 08:59:37 * @LastEditTime: 2023-02-08 16:18:20
--> -->
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
@@ -81,6 +81,35 @@ export default {
status: '' status: ''
} }
} }
},
methods: {
exportHandle() {
// 导出登录日志
this.$http({
url: this.$http.adornUrl(`/sys/log/login/export${this.dataForm.creatorName,this.dataForm.status}`),
method: 'get',
responseType: "blob"
}).then((response) => {
let fileName = ''
const contentDisposition = response.headers['content-disposition']
if (contentDisposition) {
// fileName = contentDisposition.slice(contentDisposition.indexOf('filename=') + 9).replace('.xls',this.$t('LoginRecords')) +'.xls'
fileName = contentDisposition.slice(contentDisposition.indexOf('filename=') + 9)
}
fileName = decodeURIComponent(fileName)
const blob = new Blob([response.data])
const reader = new FileReader()
reader.readAsDataURL(blob)
reader.onload = (e) => {
const a = document.createElement('a')
a.download = fileName
a.href = e.target.result
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
}
})
}
} }
} }
</script> </script>

View File

@@ -4,7 +4,7 @@
* @Author: fzq * @Author: fzq
* @Date: 2022-11-25 09:51:46 * @Date: 2022-11-25 09:51:46
* @LastEditors: fzq * @LastEditors: fzq
* @LastEditTime: 2023-01-13 09:01:16 * @LastEditTime: 2023-02-08 16:19:16
--> -->
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
@@ -81,6 +81,35 @@ export default {
status: '' status: ''
} }
} }
},
methods: {
exportHandle() {
// 导出操作日志
this.$http({
url: this.$http.adornUrl(`/sys/log/operation/export`),
method: 'get',
responseType: "blob"
}).then((response) => {
let fileName = ''
const contentDisposition = response.headers['content-disposition']
if (contentDisposition) {
// fileName = contentDisposition.slice(contentDisposition.indexOf('filename=') + 9).replace('.xls',this.$t('operationsRecords')) +'.xls'
fileName = contentDisposition.slice(contentDisposition.indexOf('filename=') + 9)
}
fileName = decodeURIComponent(fileName)
const blob = new Blob([response.data])
const reader = new FileReader()
reader.readAsDataURL(blob)
reader.onload = (e) => {
const a = document.createElement('a')
a.download = fileName
a.href = e.target.result
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
}
})
}
} }
} }
</script> </script>

View File

@@ -1,18 +1,22 @@
<template> <template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false"> <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-form-item prop="type" :label="$t('menu.type')" size="mini">
<el-radio-group v-model="dataForm.type" :disabled="!!dataForm.id"> <el-radio-group v-model="dataForm.type" :disabled="!!dataForm.id">
<el-radio :label="0">{{ $t('menu.type0') }}</el-radio> <el-radio :label="0">{{ $t('menu.type0') }}</el-radio>
<el-radio :label="1">{{ $t('menu.type1') }}</el-radio> <el-radio :label="1">{{ $t('menu.type1') }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item prop="nameEn" :label="$t('menu.nameEn')">
<el-input v-model="dataForm.nameEn" :placeholder="$t('menu.nameEn')"></el-input>
</el-form-item>
<el-form-item prop="name" :label="$t('menu.name')"> <el-form-item prop="name" :label="$t('menu.name')">
<el-input v-model="dataForm.name" :placeholder="$t('menu.name')"></el-input> <el-input v-model="dataForm.name" :placeholder="$t('menu.name')"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="parentName" :label="$t('menu.parentName')" class="menu-list"> <el-form-item prop="parentNameEn" :label="$t('menu.parentName')" class="menu-list">
<el-popover v-model="menuListVisible" ref="menuListPopover" placement="bottom-start" trigger="click"> <el-popover v-model="menuListVisible" ref="menuListPopover" placement="bottom-start" trigger="click">
<el-tree <el-tree
v-if="$i18n.locale == 'zh-CN'"
:data="menuList" :data="menuList"
:props="{ label: 'name', children: 'children' }" :props="{ label: 'name', children: 'children' }"
node-key="id" node-key="id"
@@ -20,11 +24,24 @@
:highlight-current="true" :highlight-current="true"
:expand-on-click-node="false" :expand-on-click-node="false"
accordion accordion
@current-change="menuListTreeCurrentChangeHandle" @current-change="menuListTreeCurrentChangeHandle">
> </el-tree>
<el-tree
v-if="$i18n.locale == 'en'"
:data="menuList"
:props="{ label: 'nameEn', children: 'children' }"
node-key="id"
ref="menuListTree"
:highlight-current="true"
:expand-on-click-node="false"
accordion
@current-change="menuListTreeCurrentChangeHandle">
</el-tree> </el-tree>
</el-popover> </el-popover>
<el-input v-model="dataForm.parentName" v-popover:menuListPopover :readonly="true" :placeholder="$t('menu.parentName')"> <el-input v-if="$i18n.locale == 'zh-CN'" v-model="dataForm.parentName" v-popover:menuListPopover :readonly="true" :placeholder="$t('menu.parentName')">
<i v-if="dataForm.pid !== '0'" slot="suffix" @click.stop="deptListTreeSetDefaultHandle()" class="el-icon-circle-close el-input__icon"></i>
</el-input>
<el-input v-if="$i18n.locale == 'en'" v-model="dataForm.parentNameEn" v-popover:menuListPopover :readonly="true" :placeholder="$t('menu.parentName')">
<i v-if="dataForm.pid !== '0'" slot="suffix" @click.stop="deptListTreeSetDefaultHandle()" class="el-icon-circle-close el-input__icon"></i> <i v-if="dataForm.pid !== '0'" slot="suffix" @click.stop="deptListTreeSetDefaultHandle()" class="el-icon-circle-close el-input__icon"></i>
</el-input> </el-input>
</el-form-item> </el-form-item>
@@ -72,8 +89,10 @@ export default {
id: '', id: '',
type: 0, type: 0,
name: '', name: '',
nameEn: '',
pid: '0', pid: '0',
parentName: '', parentName: '',
parentNameEn: '',
url: '', url: '',
permissions: '', permissions: '',
sort: 0, sort: 0,
@@ -85,6 +104,7 @@ export default {
dataRule() { dataRule() {
return { return {
name: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }], name: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
nameEn: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
parentName: [{ required: true, message: this.$t('validate.required'), trigger: 'change' }] parentName: [{ required: true, message: this.$t('validate.required'), trigger: 'change' }]
} }
} }
@@ -98,8 +118,8 @@ export default {
// destroy dialog // destroy dialog
handleDestroyDialog() { handleDestroyDialog() {
setTimeout(() => { setTimeout(() => {
this.addOrUpdateVisible= false this.addOrUpdateVisible = false
}, /** after dialog animated */ 200); }, /** after dialog animated */ 200)
}, },
init() { init() {
this.visible = true this.visible = true
@@ -138,6 +158,7 @@ export default {
...this.dataForm, ...this.dataForm,
...res.data ...res.data
} }
// console.log('/sys/menu/', this.dataForm)
if (this.dataForm.pid === '0') { if (this.dataForm.pid === '0') {
return this.deptListTreeSetDefaultHandle() return this.deptListTreeSetDefaultHandle()
} }
@@ -153,7 +174,12 @@ export default {
// 上级菜单树, 选中 // 上级菜单树, 选中
menuListTreeCurrentChangeHandle(data) { menuListTreeCurrentChangeHandle(data) {
this.dataForm.pid = data.id this.dataForm.pid = data.id
if (this.$i18n.locale == 'zh-CN') {
this.dataForm.parentName = data.name this.dataForm.parentName = data.name
}
if (this.$i18n.locale == 'en') {
this.dataForm.parentNameEn = data.nameEn
}
this.menuListVisible = false this.menuListVisible = false
}, },
// 图标, 选中 // 图标, 选中
@@ -163,11 +189,12 @@ export default {
}, },
// 表单提交 // 表单提交
dataFormSubmitHandle: debounce( dataFormSubmitHandle: debounce(
function() { function () {
this.$refs['dataForm'].validate(valid => { this.$refs['dataForm'].validate((valid) => {
if (!valid) { if (!valid) {
return false return false
} }
console.log('this.dataForm', this.dataForm)
this.$http[!this.dataForm.id ? 'post' : 'put'](this.$http.adornUrl('/sys/menu'), this.dataForm) this.$http[!this.dataForm.id ? 'post' : 'put'](this.$http.adornUrl('/sys/menu'), this.dataForm)
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {

View File

@@ -4,7 +4,7 @@
* @Author: fzq * @Author: fzq
* @Date: 2022-11-25 09:51:46 * @Date: 2022-11-25 09:51:46
* @LastEditors: fzq * @LastEditors: fzq
* @LastEditTime: 2023-01-13 09:06:03 * @LastEditTime: 2023-02-08 10:06:36
--> -->
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
@@ -15,7 +15,8 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-loading="dataListLoading" :data="dataList" row-key="id" border style="width: 100%;"> <el-table v-loading="dataListLoading" :data="dataList" row-key="id" border style="width: 100%;">
<el-table-column prop="name" :label="$t('menu.name')" header-align="center" min-width="150"></el-table-column> <el-table-column v-if="$i18n.locale == 'zh-CN'" prop="name" :label="$t('menu.name')" header-align="center" min-width="150"></el-table-column>
<el-table-column v-if="$i18n.locale == 'en'" prop="nameEn" :label="$t('menu.name')" header-align="center" min-width="150"></el-table-column>
<el-table-column prop="icon" :label="$t('menu.icon')" header-align="center" align="center"> <el-table-column prop="icon" :label="$t('menu.icon')" header-align="center" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<svg class="icon-svg" aria-hidden="true"><use :xlink:href="`#${scope.row.icon}`"></use></svg> <svg class="icon-svg" aria-hidden="true"><use :xlink:href="`#${scope.row.icon}`"></use></svg>
@@ -58,6 +59,10 @@ export default {
}, },
components: { components: {
AddOrUpdate AddOrUpdate
},
created(){
// console.log('mixinViewModuleOptions',this.mixinViewModuleOptions);
// console.log('this.$i18n.locale',this.$i18n.locale);
} }
} }
</script> </script>

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false"> <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-form-item prop="paramCode" :label="$t('params.paramCode')">
<el-input v-model="dataForm.paramCode" :placeholder="$t('params.paramCode')"></el-input> <el-input v-model="dataForm.paramCode" :placeholder="$t('params.paramCode')"></el-input>
</el-form-item> </el-form-item>

View File

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

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false"> <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-form-item prop="username" :label="$t('user.username')">
<el-input v-model="dataForm.username" :placeholder="$t('user.username')"></el-input> <el-input v-model="dataForm.username" :placeholder="$t('user.username')"></el-input>
</el-form-item> </el-form-item>
@@ -18,6 +18,11 @@
</el-form-item> </el-form-item>
<el-form-item prop="gender" :label="$t('user.gender')"> <el-form-item prop="gender" :label="$t('user.gender')">
<ren-radio-group v-model="dataForm.gender" dict-type="gender"></ren-radio-group> <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-form-item> </el-form-item>
<el-form-item prop="email" :label="$t('user.email')"> <el-form-item prop="email" :label="$t('user.email')">
<el-input v-model="dataForm.email" :placeholder="$t('user.email')"></el-input> <el-input v-model="dataForm.email" :placeholder="$t('user.email')"></el-input>
@@ -26,7 +31,7 @@
<el-input v-model="dataForm.mobile" :placeholder="$t('user.mobile')"></el-input> <el-input v-model="dataForm.mobile" :placeholder="$t('user.mobile')"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="roleIdList" :label="$t('user.roleIdList')" class="role-list"> <el-form-item prop="roleIdList" :label="$t('user.roleIdList')" class="role-list">
<el-select v-model="dataForm.roleIdList" multiple :placeholder="$t('user.roleIdList')"> <el-select v-model="dataForm.roleIdList" multiple :placeholder="$t('user.roleIdList')" filterable>
<el-option v-for="role in roleList" :key="role.id" :label="role.name" :value="role.id"></el-option> <el-option v-for="role in roleList" :key="role.id" :label="role.name" :value="role.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -66,7 +71,8 @@ export default {
mobile: '', mobile: '',
roleIdList: [], roleIdList: [],
status: 1 status: 1
} },
radio: '1'
} }
}, },
computed: { computed: {
@@ -107,7 +113,7 @@ export default {
email: [{ validator: validateEmail, trigger: 'blur' }], email: [{ validator: validateEmail, trigger: 'blur' }],
// 解除手机号输入限制 // 解除手机号输入限制
// mobile: [{ validator: validateMobile, trigger: 'blur' }], // mobile: [{ validator: validateMobile, trigger: 'blur' }],
roleIdList: [{ required: true, message: '至少选择一个角色', trigger: 'change' }] roleIdList: [{ required: true, message: this.$t('validate.requiredRole'), trigger: 'change' }]
} }
} }
}, },
@@ -115,8 +121,8 @@ export default {
// destroy dialog // destroy dialog
handleDestroyDialog() { handleDestroyDialog() {
setTimeout(() => { setTimeout(() => {
this.addOrUpdateVisible= false this.addOrUpdateVisible = false
}, /** after dialog animated */ 200); }, /** after dialog animated */ 200)
}, },
init() { init() {
this.visible = true this.visible = true
@@ -158,7 +164,7 @@ export default {
} }
// 角色配置, 区分是否为默认角色 // 角色配置, 区分是否为默认角色
for (var i = 0; i < res.data.roleIdList.length; i++) { for (var i = 0; i < res.data.roleIdList.length; i++) {
if (this.roleList.filter(item => item.id === res.data.roleIdList[i])[0]) { if (this.roleList.filter((item) => item.id === res.data.roleIdList[i])[0]) {
this.dataForm.roleIdList.push(res.data.roleIdList[i]) this.dataForm.roleIdList.push(res.data.roleIdList[i])
continue continue
} }
@@ -169,8 +175,8 @@ export default {
}, },
// 表单提交 // 表单提交
dataFormSubmitHandle: debounce( dataFormSubmitHandle: debounce(
function() { function () {
this.$refs['dataForm'].validate(valid => { this.$refs['dataForm'].validate((valid) => {
if (!valid) { if (!valid) {
return false return false
} }

View File

@@ -4,7 +4,7 @@
* @Author: fzq * @Author: fzq
* @Date: 2022-11-25 09:51:46 * @Date: 2022-11-25 09:51:46
* @LastEditors: fzq * @LastEditors: fzq
* @LastEditTime: 2023-02-02 15:36:55 * @LastEditTime: 2023-02-13 16:29:14
--> -->
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
@@ -20,13 +20,16 @@
{{ $t('user.gender') }} {{ $t('user.gender') }}
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<ren-select v-model="dataForm.gender" dict-type="gender" :placeholder="$t('user.gender')"></ren-select> <!-- <ren-select v-model="dataForm.gender" dict-type="gender" :placeholder="$t('user.gender')"></ren-select> -->
<el-select v-model="dataForm.gender" :placeholder="$t('user.gender')" clearable>
<el-option v-for="item in genderOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
{{ $t('dept.title') }} {{ $t('dept.title') }}
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<ren-dept-tree v-model="dataForm.deptId" :placeholder="$t('dept.title')" :query="true"></ren-dept-tree> <ren-dept-tree v-model="dataForm.deptId" :placeholder="$t('dept.title')" :query="true" clearable></ren-dept-tree>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button class="buttonColor" @click="getDataList()">{{ $t('query') }}</el-button> <el-button class="buttonColor" @click="getDataList()">{{ $t('query') }}</el-button>
@@ -41,7 +44,7 @@
<el-button v-if="$hasPermission('sys:user:export')" type="info" @click="exportHandle()">{{ $t('export') }}</el-button> <el-button v-if="$hasPermission('sys:user:export')" type="info" @click="exportHandle()">{{ $t('export') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" @sort-change="dataListSortChangeHandle" style="width: 100%;"> <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" @sort-change="dataListSortChangeHandle" style="width: 100%">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column> <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="username" :label="$t('user.username')" sortable="custom" header-align="center" align="center"></el-table-column> <el-table-column prop="username" :label="$t('user.username')" sortable="custom" header-align="center" align="center"></el-table-column>
<el-table-column prop="deptName" :label="$t('user.deptName')" header-align="center" align="center"></el-table-column> <el-table-column prop="deptName" :label="$t('user.deptName')" header-align="center" align="center"></el-table-column>
@@ -73,8 +76,7 @@
:total="total" :total="total"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle" @size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle" @current-change="pageCurrentChangeHandle">
>
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
@@ -100,7 +102,54 @@ export default {
username: '', username: '',
deptId: '', deptId: '',
gender: '' gender: ''
},
genderOptions: [
{
value: 0,
label: this.$t('user.gender0')
},
{
value: 1,
label: this.$t('user.gender1')
},
{
value: 2,
label: this.$t('user.gender2')
} }
]
}
},
methods: {
exportHandle() {
// 导出用户
// exportEquipments({
// ...this.listQuery,
// fileName: `user-${this.listQuery.current}-${this.listQuery.size}`
// }).then((response) => {
this.$http({
url: this.$http.adornUrl(`/sys/user/export${this.dataForm.username}`),
method: 'get',
responseType: 'arraybuffer'
}).then((response) => {
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)
}
fileName = decodeURIComponent(fileName)
const blob = new Blob([response.data])
const reader = new FileReader()
reader.readAsDataURL(blob)
reader.onload = (e) => {
const a = document.createElement('a')
a.download = fileName
a.href = e.target.result
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
}
})
} }
}, },
components: { components: {

View File

@@ -166,7 +166,8 @@ export default {
this.dataForm.uuid = getUUID() this.dataForm.uuid = getUUID()
// this.captchaPath = `${window.SITE_CONFIG['apiURL']}/captcha?uuid=${this.dataForm.uuid}` // 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 = (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( dataFormSubmitHandle: debounce(

View File

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