Compare commits
30 Commits
2f4e9f31cd
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a3e16df1b | |||
|
|
6815ac4cc4 | ||
|
|
4ffbdaef8a | ||
| 36e6551465 | |||
|
|
b1ab1962b1 | ||
| 2cefabc24b | |||
|
|
db47bffb18 | ||
| 65b489d37c | |||
|
|
5afadfb1ce | ||
| 67612107ea | |||
|
|
e0d4e5327f | ||
| 7ec1c5f3fc | |||
|
|
3da95fed21 | ||
| 092d7da353 | |||
|
|
683fc9169a | ||
| e81c4f6907 | |||
|
|
bc4cfdc990 | ||
| 1c67ef4c6a | |||
|
|
0b5740d41c | ||
| bd8bdfd9a8 | |||
|
|
41e680b55d | ||
| fa06c12ece | |||
|
|
28303e4c5f | ||
|
|
bbe5e63075 | ||
| e964c643d8 | |||
|
|
f9d40b3790 | ||
|
|
8ec42773cd | ||
| 715bc73504 | |||
| 63a487dcd2 | |||
| ece96e5cab |
Binary file not shown.
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 24 KiB |
BIN
public/favicon2.ico
Normal file
BIN
public/favicon2.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
BIN
public/google.exe
Normal file
BIN
public/google.exe
Normal file
Binary file not shown.
@@ -1,12 +1,28 @@
|
||||
/*
|
||||
* @Descripttion:
|
||||
* @version:
|
||||
* @Author: fzq
|
||||
* @Date: 2022-11-25 09:51:46
|
||||
* @LastEditors: fzq
|
||||
* @LastEditTime: 2023-01-30 14:26:02
|
||||
*/
|
||||
/**
|
||||
* Created by Jacky.Gao on 2017-10-01.
|
||||
*/
|
||||
import defaultI18nJsonData from './designer.json';
|
||||
import en18nJsonData from './designer_en.json';
|
||||
export default function buildLocal () {
|
||||
let language = getCookie('language') || 'zh-CN';
|
||||
// export default function buildLocal () {
|
||||
// let language = getCookie('language') || 'zh-CN';
|
||||
// window.i18n = defaultI18nJsonData;
|
||||
// if (language !== 'zh-CN') {
|
||||
// window.i18n = en18nJsonData;
|
||||
// }
|
||||
// }
|
||||
|
||||
export default function buildLocal () {
|
||||
let language = getCookie('language') || 'en';
|
||||
window.i18n = defaultI18nJsonData;
|
||||
if (language !== 'zh-CN') {
|
||||
if (language !== 'en') {
|
||||
window.i18n = en18nJsonData;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
<!--
|
||||
* @Descripttion:
|
||||
* @version:
|
||||
* @Author: fzq
|
||||
* @Date: 2022-11-25 09:51:46
|
||||
* @LastEditors: fzq
|
||||
* @LastEditTime: 2023-02-09 14:40:52
|
||||
-->
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
@@ -31,6 +39,7 @@
|
||||
<!-- 开发环境 -->
|
||||
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
|
||||
<script>
|
||||
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.8';
|
||||
window.SITE_CONFIG['apiURL'] = 'http://india.mes.picaiba.com/';
|
||||
</script>
|
||||
<% } %>
|
||||
|
||||
@@ -543,7 +543,8 @@ img {
|
||||
.el-menu-item.is-active,
|
||||
.el-submenu.is-active > .el-submenu__title {
|
||||
// color: mix(#fff, $sidebar--text-color-dark, 80%);
|
||||
color: #409EFF;
|
||||
// color: #409EFF;
|
||||
color: #0B58FF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
<template>
|
||||
<div class="attr-form">
|
||||
<h3>
|
||||
{{ title }} <el-button style="margin-left: 8px;" type="text" v-if="!isDetail && !showAddAttr" @click="showAddAttr = true">{{ $t('add') }}</el-button>
|
||||
<!-- <el-button style="margin-left: 8px" type="text" v-if="!isDetail && !showAddAttr" @click="showAddAttr = true">{{ $t('add') }}</el-button> 跟在{{ title }} 同行后面 -->
|
||||
{{ title }}
|
||||
</h3>
|
||||
<div v-if="!showAddAttr">
|
||||
<component
|
||||
:top-btn-config="topBtnConfig"
|
||||
key="sub-table"
|
||||
:is="require('../../base-table/index.vue').default"
|
||||
:table-head-configs="filterTableConfigs()"
|
||||
@@ -12,8 +14,8 @@
|
||||
:page="pageIndex"
|
||||
:size="pageSize"
|
||||
:max-height="calcMaxHeight(8)"
|
||||
@operate-event="handleOperations"
|
||||
/>
|
||||
@clickTopBtn="clickTopBtn"
|
||||
@operate-event="handleOperations" />
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
@@ -21,15 +23,14 @@
|
||||
:page-sizes="[5, 10, 20, 50]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
>
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
</div>
|
||||
<div v-else style="background: #eee; border-radius: 8px; padding: 12px;">
|
||||
<div v-else style="background: #eee; border-radius: 8px; padding: 12px">
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-form ref="AttrForm" :model="AttrForm" :rules="AttrFormRules" :inline="true" label-position="top">
|
||||
<el-row :gutter="20" style="padding: 0 24px;">
|
||||
<el-row :gutter="20" style="padding: 0 24px">
|
||||
<el-col :span="attrFormFields.length > 6 ? 6 : 12" v-for="field in attrFormFields" :key="field.prop + 'col'">
|
||||
<el-form-item :key="field.prop" :prop="field.prop" :label="field.name" style="width: 100%">
|
||||
<el-input v-if="field.formType === 'input' || !field.formType" v-model="AttrForm[field.prop]" :placeholder="$t('hints.input')" clearable />
|
||||
@@ -43,7 +44,7 @@
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="text-align: right;">
|
||||
<el-row style="text-align: right">
|
||||
<el-button size="small" @click="handleCloseAttrForm">{{ $t('cancel') }}</el-button>
|
||||
<el-button type="success" size="small" @click="handleSaveAttrForm">{{ $t('save') }}</el-button>
|
||||
</el-row>
|
||||
@@ -56,6 +57,12 @@ import i18n from '@/i18n'
|
||||
import BaseTable from '@/components/base-table'
|
||||
import { pick } from 'lodash/object'
|
||||
import { calcMaxHeight } from '@/utils'
|
||||
const topBtnConfig = [
|
||||
{
|
||||
type: 'add',
|
||||
btnName: i18n.t('add')
|
||||
}
|
||||
]
|
||||
export default {
|
||||
name: 'AttrForm',
|
||||
components: { BaseTable },
|
||||
@@ -96,6 +103,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
calcMaxHeight,
|
||||
topBtnConfig,
|
||||
showAddAttr: false,
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
@@ -107,9 +115,9 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
attrFormFields() {
|
||||
const _ = this.tableConfigs.filter(item => item.formField)
|
||||
const _ = this.tableConfigs.filter((item) => item.formField)
|
||||
/** 顺带配置 AttrForm */
|
||||
_.forEach(item => {
|
||||
_.forEach((item) => {
|
||||
this.$set(this.AttrForm, [item.prop], '')
|
||||
})
|
||||
|
||||
@@ -126,11 +134,17 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
// 加个created,来实现不能在topBtnConfig组件直接使用的? : 判别
|
||||
created() {
|
||||
// if(!(!this.isDetail && !this.showAddAttr)) {
|
||||
// this.topBtnConfig = []
|
||||
// }
|
||||
},
|
||||
methods: {
|
||||
filterTableConfigs() {
|
||||
if (this.isDetail) {
|
||||
/** 如果是查看详情,就屏蔽操作列 */
|
||||
return this.tableConfigs.filter(opt => opt.prop !== 'operations')
|
||||
return this.tableConfigs.filter((opt) => opt.prop !== 'operations')
|
||||
}
|
||||
return this.tableConfigs
|
||||
},
|
||||
@@ -182,7 +196,7 @@ export default {
|
||||
this.$nextTick(() => {
|
||||
this.$http.get(this.$http.adornUrl(`${this.url}/${id}`)).then(({ data: res }) => {
|
||||
if (res && res.code === 0 && res.data) {
|
||||
const neededFields = [...this.attrFormFields.map(item => item.prop), 'id']
|
||||
const neededFields = [...this.attrFormFields.map((item) => item.prop), 'id']
|
||||
const filtered = pick(res.data, neededFields)
|
||||
for (let field of neededFields) {
|
||||
this.AttrForm[field] = filtered[field]
|
||||
@@ -231,7 +245,7 @@ export default {
|
||||
},
|
||||
|
||||
handleSaveAttrForm() {
|
||||
this.$refs['AttrForm'].validate(valid => {
|
||||
this.$refs['AttrForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
// url: this.$http.adornUrl(`${this.url}/${!this.AttrForm.id ? '' : this.AttrForm.id}`),
|
||||
@@ -271,6 +285,9 @@ export default {
|
||||
currentChangeHandle(val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
clickTopBtn() {
|
||||
this.showAddAttr = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,12 +27,15 @@
|
||||
: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" />
|
||||
<!-- 全部selcet下拉框可输入搜索 filterable-->
|
||||
<el-select
|
||||
v-if="getType(n, c) === 'select'"
|
||||
:placeholder="getPlaceholder(n, c)"
|
||||
v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]"
|
||||
clearable
|
||||
:disabled="isDetail"
|
||||
filterable
|
||||
:disabled="isDetail || configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].isDisabled"
|
||||
|
||||
@change="emitSelectChange(configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name, $event)">
|
||||
<el-option v-for="opt in configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].options" :key="opt.label + Math.random()" :label="opt.label" :value="opt.value" />
|
||||
</el-select>
|
||||
@@ -49,6 +52,7 @@
|
||||
v-if="getType(n, c) === 'date'"
|
||||
v-bind="configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].props"
|
||||
:placeholder="getPlaceholder(n, c)"
|
||||
value-format='yyyy-MM-ddTHH:mm:ss'
|
||||
v-model="dataForm[configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name]"
|
||||
:disabled="isDetail" />
|
||||
</el-form-item>
|
||||
@@ -97,6 +101,7 @@
|
||||
color: btnColor[operate.name]
|
||||
}"
|
||||
@click="handleClick(operate)"
|
||||
:disabled='isDisabled'
|
||||
>{{ btnName[operate.name] }}</el-button
|
||||
>
|
||||
</template>
|
||||
@@ -120,8 +125,8 @@ const title = {
|
||||
|
||||
// 或者也可以改造成自定义颜色:
|
||||
const btnType = {
|
||||
add :'#0b58ff',
|
||||
save: '#000',
|
||||
add: '#0b58ff',
|
||||
save: '#0b58ff',
|
||||
update: '#0b58ff',
|
||||
reset: ''
|
||||
// cancel: 'text'
|
||||
@@ -179,6 +184,8 @@ export default {
|
||||
// },
|
||||
data() {
|
||||
return {
|
||||
// 按钮防重复点击
|
||||
isDisabled: false,
|
||||
COLUMN_PER_ROW,
|
||||
title,
|
||||
/** 按钮相关属性 */
|
||||
@@ -456,6 +463,7 @@ export default {
|
||||
},
|
||||
|
||||
emitSelectChange(name, id) {
|
||||
// console.log(id)
|
||||
const currentField = this.configs.fields.find((item) => item.name === name)
|
||||
if (currentField.relatedField) {
|
||||
this.dataForm[currentField.relatedField] = null
|
||||
@@ -476,7 +484,16 @@ export default {
|
||||
/** 操作 */
|
||||
switch (btn.name) {
|
||||
case 'save':
|
||||
this.isDisabled = true
|
||||
setTimeout(() => {
|
||||
this.isDisabled = false
|
||||
}, 3000)
|
||||
case 'update':
|
||||
this.isDisabled = true
|
||||
setTimeout(() => {
|
||||
this.isDisabled = false
|
||||
}, 3000)
|
||||
|
||||
/** 需要验证表单的操作 */
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
|
||||
@@ -1,13 +1,25 @@
|
||||
<!--
|
||||
* @Descripttion:
|
||||
* @version:
|
||||
* @Author: fzq
|
||||
* @Date: 2022-11-25 09:51:46
|
||||
* @LastEditors: fzq
|
||||
* @LastEditTime: 2023-02-09 10:17:22
|
||||
-->
|
||||
<template>
|
||||
<!-- 数字代表多级表头最小列宽 -->
|
||||
<!-- :width="opt.width || null" -->
|
||||
<!-- :width="flexColumnWidth(opt.prop || null)" -->
|
||||
<!-- header-align="center" align="center" -->
|
||||
<!-- :min-width="opt.minWidth || null" -->
|
||||
<el-table-column
|
||||
:label="opt.label ? opt.label : opt.name"
|
||||
:prop="opt.prop || null"
|
||||
:width="opt.width || null"
|
||||
:min-width="opt.minWidth || null"
|
||||
:min-width="[$route.fullPath == '/monitoring-realtimeQualityInspection' ? 170 : (opt.minWidth || null)]"
|
||||
:fixed="opt.fixed || null"
|
||||
:show-overflow-tooltip="opt.showOverflowTooltip || false"
|
||||
filter-placement="top"
|
||||
:align="opt.align || null"
|
||||
:align="opt.align || 'center'"
|
||||
v-bind="opt.more"
|
||||
>
|
||||
<template v-if="opt.prop" slot-scope="scope">
|
||||
@@ -35,6 +47,33 @@ export default {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 自定义表头列宽
|
||||
flexColumnWidth(str) {
|
||||
let flexWidth = 0
|
||||
for (const char of str) {
|
||||
if ((char >= 'A' && char <= 'Z') || (char >= 'a' && char <= 'z')) {
|
||||
// 如果是英文字符,为字符分配8个单位宽度
|
||||
flexWidth += 8
|
||||
} else if (char >= '\u4e00' && char <= '\u9fa5') {
|
||||
// 如果是中文字符,为字符分配20个单位宽度
|
||||
flexWidth += 20
|
||||
} else {
|
||||
// 其他种类字符,为字符分配5个单位宽度
|
||||
flexWidth += 5
|
||||
}
|
||||
}
|
||||
// if (flexWidth < 50) {
|
||||
// // 设置最小宽度
|
||||
// flexWidth = 50
|
||||
// }
|
||||
if (flexWidth > 250) {
|
||||
// 设置最大宽度
|
||||
flexWidth = 250
|
||||
}
|
||||
return flexWidth + 'px'
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -55,6 +55,8 @@
|
||||
"
|
||||
v-bind="head.more"></el-table-column>
|
||||
<!-- 普通的表头 -->
|
||||
<!-- :align="head.align || null" 表头居中 -->
|
||||
<!-- :min-width="head.minWidth || null" -->
|
||||
<el-table-column
|
||||
v-else
|
||||
:key="idx + 'else'"
|
||||
@@ -66,7 +68,7 @@
|
||||
:show-overflow-tooltip="head.showOverflowTooltip || true"
|
||||
:tooltip-effect="head.tooltipEffect || 'light'"
|
||||
filter-placement="top"
|
||||
:align="head.align || null"
|
||||
:align="head.align || 'center'"
|
||||
v-bind="head.more">
|
||||
<!-- 子组件 编辑/删除 -->
|
||||
<template v-if="head.prop" slot-scope="scope">
|
||||
@@ -77,7 +79,7 @@
|
||||
|
||||
<!-- 多级表头 -->
|
||||
<template v-if="!head.prop && head.children">
|
||||
<TableHead v-for="(subhead, subindex) in head.children" :key="'subhead-' + idx + '-subindex-' + subindex" :opt="subhead" />
|
||||
<TableHead v-for="(subhead, subindex) in head.children" :key="'subhead-' + idx + '-subindex-' + subindex" :opt="subhead"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
@@ -109,7 +111,9 @@ export default {
|
||||
maxHeight: {
|
||||
type: Number,
|
||||
// default: window.innerHeight - 325
|
||||
default: 500
|
||||
// el-table高度
|
||||
default: window.innerHeight - 100
|
||||
// default: 500
|
||||
},
|
||||
spanMethod: {
|
||||
type: Function,
|
||||
@@ -172,7 +176,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
// console.log(this.selectedBox)
|
||||
console.log(this.tableHeadConfigs)
|
||||
// console.log(this.tableHeadConfigs)
|
||||
},
|
||||
methods: {
|
||||
handleSubEmitData(payload) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
183
src/i18n/en.js
183
src/i18n/en.js
@@ -25,16 +25,18 @@ t.routes['厂务'] = 'Factory Affair'
|
||||
t.routes['设备'] = 'Equipment'
|
||||
t.routes['字典管理'] = 'Dict Management'
|
||||
t.routes['PLC信息'] = 'PLC'
|
||||
t.routes['设备与PLC关联配置'] = 'Relations between plc & equipments'
|
||||
t.routes['设备生产实时数据'] = 'Realtime Equipment Data'
|
||||
t.routes['产线生产实时数据'] = 'Realtime Productline Data'
|
||||
t.routes['质量检查实时数据'] = 'Realtime Quality Inspection Data'
|
||||
// Relations between
|
||||
t.routes['设备与PLC关联配置'] = 'PLC & Equipments'
|
||||
t.routes['近24小时设备生产数据'] = 'Equipment Data'
|
||||
t.routes['近24小时产线生产数据'] = 'Productline Data'
|
||||
t.routes['近24小时质量检查数据'] = 'Quality Inspection Data'
|
||||
t.routes['报表总览'] = 'Report Overview'
|
||||
t.routes['报表分类'] = 'Report Types'
|
||||
t.routes['报表详情'] = 'Report Detail'
|
||||
t.routes['报表设计'] = 'Report Design'
|
||||
t.routes['报表预览'] = 'Report Preview'
|
||||
t.routes['质量检测基础数据'] = 'Quality Inspection Basic Data'
|
||||
// Quality
|
||||
t.routes['质量检测基础数据'] = 'Inspection Basic Data'
|
||||
t.routes['当前检测数据'] = 'Current Inspection Data'
|
||||
t.routes['检测统计数据'] = 'Statistics Data'
|
||||
t.routes['质量检查信息记录'] = 'Quality Inspection Records'
|
||||
@@ -46,10 +48,14 @@ t.routes['参数管理'] = 'Params Management'
|
||||
t.routes['定时任务'] = 'Timed Tasks'
|
||||
t.routes['文件上传'] = 'File Upload'
|
||||
t.routes['登录日志'] = 'Login Records'
|
||||
t.routes['操作日志'] = 'Oprations Records'
|
||||
t.routes['设备效率分析'] = 'Equipment Efficiency Analysis'
|
||||
t.routes['设备异常分析'] = 'Equipment Exceptions Analysis'
|
||||
t.routes['设备状态时序图'] = 'Equipment Status Timesequence'
|
||||
t.routes['操作日志'] = 'Operations Records'
|
||||
t.routes['设备效率分析'] = 'EQU Efficiency Analysis'
|
||||
t.routes['设备异常分析'] = 'EQU Exceptions Analysis'
|
||||
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'
|
||||
@@ -103,12 +109,12 @@ t.updatorName = 'Updator\'s name'
|
||||
t.updateTime = 'Update Time'
|
||||
t.version = 'Version'
|
||||
t.search = 'Search'
|
||||
t.countPerPage = '每页数' // ?
|
||||
t.currentPage = '当前页' // ?
|
||||
t.fetchList = '获取数据列表' // ?
|
||||
t.multi = '多选' // ?
|
||||
t.do = '进行' // ?
|
||||
t.submit = '表单提交' // ?
|
||||
t.countPerPage = 'Per Page' // ?
|
||||
t.currentPage = 'Current Page' // ?
|
||||
t.fetchList = 'Fetch Data List' // ?
|
||||
t.multi = 'Multiple Selection' // ?
|
||||
t.do = 'Proceed' // ?
|
||||
t.submit = 'Submit' // ?
|
||||
t.desc = 'Description'
|
||||
t.disable = 'Disable'
|
||||
t.equipment = 'Equipment'
|
||||
@@ -117,7 +123,7 @@ t.cannotempty = 'can\'t be empty'
|
||||
t.parameter = 'Parameters'
|
||||
t.enable = 'Enable'
|
||||
t.index = 'Index'
|
||||
t.relation = '关联'
|
||||
t.relation = 'Relation'
|
||||
t.fetchInfo = 'Fetch Info'
|
||||
t.name = 'Name'
|
||||
t.code = 'Code'
|
||||
@@ -141,6 +147,7 @@ t.normal = 'Normal'
|
||||
t.shutdown = 'Shut Down'
|
||||
t.malfunction = 'Malfunction' // ?
|
||||
t.diagram = 'Device Status Sequence Diagram'
|
||||
t.diagram2 = 'Device Product Sequence Diagram'
|
||||
t.addr = 'Address'
|
||||
t.planStop = 'Plan to stop'
|
||||
t.startTime = 'Start Time'
|
||||
@@ -152,6 +159,9 @@ t.ti = 'Time'
|
||||
t.plcCode = 'PLC Code'
|
||||
t.equName = 'Equipment Name'
|
||||
t.equCode = 'Equipment Code'
|
||||
t.yAxisTime = 'Time (h)'
|
||||
t.yAxisRate = 'Percentage (%)'
|
||||
t.hourTime = '(h)'
|
||||
|
||||
|
||||
t.graph = 'Graph'
|
||||
@@ -182,6 +192,12 @@ t.timetype = 'Time Type'
|
||||
t.reftimerange = 'By time range'
|
||||
t.refdate = 'By date'
|
||||
t.hour = 'Hour(s)'
|
||||
t.yes = 'yes'
|
||||
t.no = 'no'
|
||||
t.LoginRecords = ' Login Records'
|
||||
t.operationsRecords = ' Operations Records'
|
||||
t.allIcons= 'All Icons'
|
||||
t.err= 'Error'
|
||||
|
||||
t.errors = {}
|
||||
t.errors.nosection = 'There is no sections on this product line.'
|
||||
@@ -266,15 +282,15 @@ t.inspect.typeCount = 'Data of inspection types'
|
||||
|
||||
|
||||
t.realtime = {}
|
||||
t.realtime.eq = 'Realtime data of equipments'
|
||||
t.realtime.pl = 'Realtime data of product lines'
|
||||
t.realtime.inspect = 'Realtime data of quality inspections'
|
||||
t.realtime.eq = 'Realtime data of equipments(24h)'
|
||||
t.realtime.pl = 'Realtime data of productlines(24h)'
|
||||
t.realtime.inspect = 'Realtime data of quality inspections(24h)'
|
||||
t.realtime.in = 'in'
|
||||
t.realtime.out = 'out'
|
||||
t.realtime.data = 'scrap'
|
||||
t.realtime.num = 'scrap quantity'
|
||||
t.realtime.rate = 'scrap rate'
|
||||
t.realtime.total = 'total production'
|
||||
t.realtime.total = 'Equipment total production'
|
||||
t.realtime.goodrate = 'Passed Rate'
|
||||
t.realtime.runState = 'running state'
|
||||
t.realtime.state = 'status'
|
||||
@@ -373,13 +389,26 @@ t.eq.month = 'month'
|
||||
t.eq.realyield = 'Actual processing speed'
|
||||
t.eq.designyield = 'Theoretical processing speed'
|
||||
t.eq.viewtrend = 'View Trends'
|
||||
t.eq.productQuality = 'Product Quality Analysis'
|
||||
t.eq.productionAnalysis = 'Production Analysis'
|
||||
t.eq.productQuantity = 'Product Quantity'
|
||||
t.eq.line1= 'Line 1'
|
||||
t.eq.line2= 'Line 2'
|
||||
t.eq.line3= 'Line 3'
|
||||
t.eq.line4= 'Line 4'
|
||||
|
||||
|
||||
t.eq.sectionName = 'Section Name'
|
||||
t.eq.equipmentName = 'Equipment Name'
|
||||
t.eq.okNum = 'Qualified Quantity'
|
||||
t.eq.nokNum = 'Unqualified Quantity'
|
||||
t.eq.passRate = 'Qualified Rate'
|
||||
t.eq.passRatePercent = 'Qualified Rate(%)'
|
||||
|
||||
t.pl = {}
|
||||
t.pl.title = 'Product Line'
|
||||
t.pl.id = 'Product Line ID'
|
||||
t.pl.name = 'Product Line Name'
|
||||
t.pl.sum = 'Sum'
|
||||
t.pl.code = 'Product Line Code'
|
||||
t.pl.status = 'Product Line Status'
|
||||
t.pl.belong = 'Product Line'
|
||||
@@ -387,6 +416,7 @@ t.pl.tvalue = 'TT Value'
|
||||
t.pl.factoryHints = 'Please select a factory'
|
||||
t.pl.process = 'Working procedure'
|
||||
t.pl.add = 'Add Euipment'
|
||||
t.pl.add2 = 'Add Comparison Euipment'
|
||||
t.pl.queryFirst = 'Please Query First'
|
||||
t.pl.choose = 'Please select equipment'
|
||||
t.pl.confirm = 'Confirm'
|
||||
@@ -407,10 +437,11 @@ t.validate = {}
|
||||
t.validate.required = 'This is required.'
|
||||
t.validate.format = '{attr} has a wrong format.'
|
||||
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.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.button = 'upload'
|
||||
|
||||
@@ -478,60 +509,60 @@ t.schedule.times = 'Time Cost (ms)'
|
||||
t.schedule.createDate = 'Executed Tune' // ?
|
||||
|
||||
t.oss = {}
|
||||
t.oss.config = '云存储配置'
|
||||
t.oss.upload = '上传文件'
|
||||
t.oss.url = 'URL地址'
|
||||
t.oss.config = 'Cloud storage configuration'
|
||||
t.oss.upload = 'upload'
|
||||
t.oss.url = 'url'
|
||||
t.oss.createDate = 'Create Time'
|
||||
t.oss.type = '类型'
|
||||
t.oss.type1 = '七牛'
|
||||
t.oss.type2 = '阿里云'
|
||||
t.oss.type3 = '腾讯云'
|
||||
t.oss.qiniuDomain = '域名'
|
||||
t.oss.qiniuDomainTips = '七牛绑定的域名'
|
||||
t.oss.qiniuPrefix = '路径前缀'
|
||||
t.oss.qiniuPrefixTips = '不设置默认为空'
|
||||
t.oss.type = 'type'
|
||||
t.oss.type1 = 'Qiniu'
|
||||
t.oss.type2 = 'Aliyun'
|
||||
t.oss.type3 = 'Tencent Cloud'
|
||||
t.oss.qiniuDomain = 'Domain name'
|
||||
t.oss.qiniuDomainTips = 'Bound domain name'
|
||||
t.oss.qiniuPrefix = 'Prefix'
|
||||
t.oss.qiniuPrefixTips = 'If no, the default value is null'
|
||||
t.oss.qiniuAccessKey = 'AccessKey'
|
||||
t.oss.qiniuAccessKeyTips = '七牛AccessKey'
|
||||
t.oss.qiniuAccessKeyTips = 'Qiniu AccessKey'
|
||||
t.oss.qiniuSecretKey = 'SecretKey'
|
||||
t.oss.qiniuSecretKeyTips = '七牛SecretKey'
|
||||
t.oss.qiniuBucketName = '空间名'
|
||||
t.oss.qiniuBucketNameTips = '七牛存储空间名'
|
||||
t.oss.aliyunDomain = '域名'
|
||||
t.oss.aliyunDomainTips = '阿里云绑定的域名,如:http://cdn.renren.io'
|
||||
t.oss.aliyunPrefix = '路径前缀'
|
||||
t.oss.aliyunPrefixTips = '不设置默认为空'
|
||||
t.oss.qiniuSecretKeyTips = 'Qiniu SecretKey'
|
||||
t.oss.qiniuBucketName = 'BucketName'
|
||||
t.oss.qiniuBucketNameTips = 'Qiniu BucketName'
|
||||
t.oss.aliyunDomain = 'Domain'
|
||||
t.oss.aliyunDomainTips = 'Domain name bound to Ali Cloud, such as:http://cdn.renren.io'
|
||||
t.oss.aliyunPrefix = 'Prefix'
|
||||
t.oss.aliyunPrefixTips = 'If no, the default value is null'
|
||||
t.oss.aliyunEndPoint = 'EndPoint'
|
||||
t.oss.aliyunEndPointTips = '阿里云EndPoint'
|
||||
t.oss.aliyunEndPointTips = 'Aliyun EndPoint'
|
||||
t.oss.aliyunAccessKeyId = 'AccessKeyId'
|
||||
t.oss.aliyunAccessKeyIdTips = '阿里云AccessKeyId'
|
||||
t.oss.aliyunAccessKeyIdTips = 'Aliyun AccessKeyId'
|
||||
t.oss.aliyunAccessKeySecret = 'AccessKeySecret'
|
||||
t.oss.aliyunAccessKeySecretTips = '阿里云AccessKeySecret'
|
||||
t.oss.aliyunAccessKeySecretTips = 'Aliyun AccessKeySecret'
|
||||
t.oss.aliyunBucketName = 'BucketName'
|
||||
t.oss.aliyunBucketNameTips = '阿里云BucketName'
|
||||
t.oss.qcloudDomain = '域名'
|
||||
t.oss.qcloudDomainTips = '腾讯云绑定的域名'
|
||||
t.oss.qcloudPrefix = '路径前缀'
|
||||
t.oss.qcloudPrefixTips = '不设置默认为空'
|
||||
t.oss.aliyunBucketNameTips = 'Aliyun BucketName'
|
||||
t.oss.qcloudDomain = 'Domain'
|
||||
t.oss.qcloudDomainTips = 'Tencent Cloud Domains'
|
||||
t.oss.qcloudPrefix = 'Prefix'
|
||||
t.oss.qcloudPrefixTips = 'If no, the default value is null'
|
||||
t.oss.qcloudAppId = 'AppId'
|
||||
t.oss.qcloudAppIdTips = '腾讯云AppId'
|
||||
t.oss.qcloudAppIdTips = 'Tencent Cloud AppId'
|
||||
t.oss.qcloudSecretId = 'SecretId'
|
||||
t.oss.qcloudSecretIdTips = '腾讯云SecretId'
|
||||
t.oss.qcloudSecretIdTips = 'Tencent Cloud SecretId'
|
||||
t.oss.qcloudSecretKey = 'SecretKey'
|
||||
t.oss.qcloudSecretKeyTips = '腾讯云SecretKey'
|
||||
t.oss.qcloudSecretKeyTips = 'Tencent Cloud SecretKey'
|
||||
t.oss.qcloudBucketName = 'BucketName'
|
||||
t.oss.qcloudBucketNameTips = '腾讯云BucketName'
|
||||
t.oss.qcloudRegion = '所属地区'
|
||||
t.oss.qcloudRegionTips = '请选择'
|
||||
t.oss.qcloudRegionBeijing1 = '北京一区(华北)'
|
||||
t.oss.qcloudRegionBeijing = '北京'
|
||||
t.oss.qcloudRegionShanghai = '上海(华东)'
|
||||
t.oss.qcloudRegionGuangzhou = '广州(华南)'
|
||||
t.oss.qcloudRegionChengdu = '成都(西南)'
|
||||
t.oss.qcloudRegionChongqing = '重庆'
|
||||
t.oss.qcloudRegionSingapore = '新加坡'
|
||||
t.oss.qcloudRegionHongkong = '香港'
|
||||
t.oss.qcloudRegionToronto = '多伦多'
|
||||
t.oss.qcloudRegionFrankfurt = '法兰克福'
|
||||
t.oss.qcloudBucketNameTips = 'Tencent Cloud BucketName'
|
||||
t.oss.qcloudRegion = 'Region'
|
||||
t.oss.qcloudRegionTips = 'Select'
|
||||
t.oss.qcloudRegionBeijing1 = 'Beijing District 1 (North China)'
|
||||
t.oss.qcloudRegionBeijing = 'Beijing'
|
||||
t.oss.qcloudRegionShanghai = 'Shanghai (East China)'
|
||||
t.oss.qcloudRegionGuangzhou = 'Guangzhou (South China)'
|
||||
t.oss.qcloudRegionChengdu = 'Chengdu (Southwest)'
|
||||
t.oss.qcloudRegionChongqing = 'Chongqing'
|
||||
t.oss.qcloudRegionSingapore = 'Singapore'
|
||||
t.oss.qcloudRegionHongkong = 'Hong Kong'
|
||||
t.oss.qcloudRegionToronto = 'Toronto'
|
||||
t.oss.qcloudRegionFrankfurt = 'Frankfurt'
|
||||
|
||||
t.dept = {}
|
||||
t.dept.name = 'Department Name'
|
||||
@@ -551,7 +582,7 @@ t.dict.remark = 'Remark'
|
||||
t.dict.createDate = 'Create Time'
|
||||
|
||||
t.logError = {}
|
||||
t.logError.requestUri = 'Request URI'
|
||||
t.logError.requestUri = 'Request URL'
|
||||
t.logError.requestMethod = 'Request Method'
|
||||
t.logError.requestParams = 'Request Parameters'
|
||||
t.logError.ip = 'IP'
|
||||
@@ -578,7 +609,7 @@ t.logOperation.status0 = 'Failed'
|
||||
t.logOperation.status1 = 'Success'
|
||||
t.logOperation.creatorName = 'User Name'
|
||||
t.logOperation.operation = 'User Operations'
|
||||
t.logOperation.requestUri = 'Request URI'
|
||||
t.logOperation.requestUri = 'Request URL'
|
||||
t.logOperation.requestMethod = 'Request Method'
|
||||
t.logOperation.requestParams = 'Request Parameters'
|
||||
t.logOperation.requestTime = 'Request Duration'
|
||||
@@ -587,21 +618,22 @@ t.logOperation.userAgent = 'User-Agent'
|
||||
t.logOperation.createDate = 'Create Time'
|
||||
|
||||
t.menu = {}
|
||||
t.menu.name = 'Name'
|
||||
t.menu.name = 'Chinese Name'
|
||||
t.menu.nameEn = 'Name'
|
||||
t.menu.icon = 'Icons'
|
||||
t.menu.type = 'Type'
|
||||
t.menu.type0 = 'Menu'
|
||||
t.menu.type1 = 'Button'
|
||||
t.menu.sort = 'Sort'
|
||||
t.menu.url = 'Route'
|
||||
t.menu.permissions = '授权标识'
|
||||
t.menu.permissionsTips = '多个用逗号分隔,如:sys:menu:save,sys:menu:update'
|
||||
t.menu.parentName = '上级菜单'
|
||||
t.menu.permissions = 'Authorization Identifier'
|
||||
t.menu.permissionsTips = 'Multiple are separated by commas, such as:sys:menu:save,sys:menu:update'
|
||||
t.menu.parentName = 'Superior menu'
|
||||
t.menu.parentNameDefault = 'First tier menu'
|
||||
t.menu.resource = '授权资源'
|
||||
t.menu.resourceUrl = '资源URL'
|
||||
t.menu.resource = 'Authorized Resource'
|
||||
t.menu.resourceUrl = 'Resource URL'
|
||||
t.menu.resourceMethod = 'Request methods'
|
||||
t.menu.resourceAddItem = '添加一项'
|
||||
t.menu.resourceAddItem = 'Add Item'
|
||||
|
||||
t.params = {}
|
||||
t.params.name = 'Parameter Name'
|
||||
@@ -610,7 +642,7 @@ t.params.paramCode = 'Parameter Code'
|
||||
t.params.paramValue = 'Parameter Value'
|
||||
t.params.paramStdValue = 'Standard Parameter Code'
|
||||
t.params.plctitle = 'PLC Collection Parameters'
|
||||
t.params.plcid = 'PLC连接表ID'
|
||||
t.params.plcid = 'PLC ID'
|
||||
t.params.remark = 'Remark'
|
||||
|
||||
t.role = {}
|
||||
@@ -641,5 +673,6 @@ t.user.validate = {}
|
||||
t.user.validate.confirmPassword = 'The two passwords are different. Please check again.'
|
||||
t.user.select = 'Select an user'
|
||||
t.user.selecterror = 'Pick up a record'
|
||||
t.user.userTable = ' User Table'
|
||||
|
||||
export default t
|
||||
@@ -27,9 +27,9 @@ t.routes['设备'] = '设备'
|
||||
t.routes['字典管理'] = '字典管理'
|
||||
t.routes['PLC信息'] = 'PLC信息'
|
||||
t.routes['设备与PLC关联配置'] = '设备与PLC关联配置' // ?
|
||||
t.routes['设备生产实时数据'] = '设备生产实时数据'
|
||||
t.routes['产线生产实时数据'] = '产线生产实时数据'
|
||||
t.routes['质量检查实时数据'] = '质量检查实时数据'
|
||||
t.routes['近24小时设备生产数据'] = '近24小时设备生产数据'
|
||||
t.routes['近24小时产线生产数据'] = '近24小时产线生产数据'
|
||||
t.routes['近24小时质量检查数据'] = '近24小时质量检查数据'
|
||||
t.routes['报表总览'] = '报表总览'
|
||||
t.routes['报表分类'] = '报表分类'
|
||||
t.routes['报表详情'] = '报表详情'
|
||||
@@ -51,6 +51,11 @@ t.routes['操作日志'] = '操作日志'
|
||||
t.routes['设备效率分析'] = '设备效率分析'
|
||||
t.routes['设备异常分析'] = '设备异常分析'
|
||||
t.routes['设备状态时序图'] = '设备状态时序图'
|
||||
t.routes['产品质量分析'] = '产品质量分析'
|
||||
t.routes['产量分析'] = '产量分析'
|
||||
t.routes['生产节拍时序图'] = '生产节拍时序图'
|
||||
t.routes['设备产量时序图'] = '设备产量时序图'
|
||||
|
||||
|
||||
// 三级
|
||||
t.routes['工厂'] = '工厂'
|
||||
@@ -141,6 +146,7 @@ t.normal = '正常' // ?
|
||||
t.shutdown = '停机' // ?
|
||||
t.malfunction = '故障' // ?
|
||||
t.diagram = '设备状态时序图'
|
||||
t.diagram2 = '设备产量时序图'
|
||||
t.addr = '地址' // 1
|
||||
t.planStop = '计划停机' // ?
|
||||
t.startTime = '开始时间' // 1
|
||||
@@ -153,6 +159,9 @@ t.ti = '时间'
|
||||
t.plcCode = 'PLC 编码'
|
||||
t.equName = '设备名称'
|
||||
t.equCode = '设备编码'
|
||||
t.yAxisTime = '时间 (h)'
|
||||
t.yAxisRate = '百分比 (%)'
|
||||
t.hourTime = '(时)'
|
||||
|
||||
t.graph = '图形'
|
||||
t.category = '分类'
|
||||
@@ -182,6 +191,13 @@ t.timetype = '时间类型'
|
||||
t.reftimerange = '按时间段'
|
||||
t.refdate = '按日期'
|
||||
t.hour = '小时'
|
||||
t.yes = '是'
|
||||
t.no = '否'
|
||||
t.LoginRecords = ' 登录日志'
|
||||
t.operationsRecords = ' 操作日志'
|
||||
t.allIcons= '所有图标'
|
||||
t.err= '错误'
|
||||
|
||||
|
||||
t.errors = {}
|
||||
t.errors.nosection = '该产线没有工段'
|
||||
@@ -266,15 +282,15 @@ t.inspect.typeCount = '检测类型统计数据'
|
||||
|
||||
|
||||
t.realtime = {}
|
||||
t.realtime.eq = '设备生产实时数据'
|
||||
t.realtime.pl = '产线生产实时数据'
|
||||
t.realtime.inspect = '质量检查实时数据'
|
||||
t.realtime.eq = '近24小时产线生产数据'
|
||||
t.realtime.pl = '近24小时产线生产数据'
|
||||
t.realtime.inspect = '近24小时质量检查数据'
|
||||
t.realtime.in = '进数据'
|
||||
t.realtime.out = '出数据'
|
||||
t.realtime.data = '报废数据'
|
||||
t.realtime.num = '报废数量'
|
||||
t.realtime.rate = '报废比例'
|
||||
t.realtime.total = '总产量'
|
||||
t.realtime.total = '设备总产量'
|
||||
t.realtime.goodrate = '良品率'
|
||||
t.realtime.runState = '是否运行'
|
||||
t.realtime.state = '状态'
|
||||
@@ -373,12 +389,27 @@ t.eq.month='月'
|
||||
t.eq.realyield = '实际加工速度'
|
||||
t.eq.designyield = '理论加工速度'
|
||||
t.eq.viewtrend = '查看趋势'
|
||||
t.eq.productQuality = '产品质量分析'
|
||||
t.eq.productionAnalysis = '产量分析'
|
||||
t.eq.productQuantity = '产品数量'
|
||||
t.eq.line1= '产线1'
|
||||
t.eq.line2= '产线2'
|
||||
t.eq.line3= '产线3'
|
||||
t.eq.line4= '产线4'
|
||||
|
||||
t.eq.sectionName = '工序'
|
||||
t.eq.equipmentName = '设备名称'
|
||||
t.eq.okNum = '合格数量'
|
||||
t.eq.nokNum = '不合格数量'
|
||||
t.eq.passRate = '合格率'
|
||||
t.eq.passRatePercent = '合格率(%)'
|
||||
|
||||
|
||||
t.pl = {}
|
||||
t.pl.title = '产线'
|
||||
t.pl.id = '产线ID'
|
||||
t.pl.name = '产线名称'
|
||||
t.pl.sum = '合计'
|
||||
t.pl.code = '产线编码'
|
||||
t.pl.status = '产线状态'
|
||||
t.pl.belong = '所属产线'
|
||||
@@ -386,6 +417,7 @@ t.pl.tvalue = '产线TT值(每小时下片数量)'
|
||||
t.pl.factoryHints = '请选择所属工厂'
|
||||
t.pl.process = '工序'
|
||||
t.pl.add = '添加设备'
|
||||
t.pl.add2 = '添加对比设备'
|
||||
t.pl.queryFirst = '请先查询数据'
|
||||
t.pl.success = '新设备数据获取成功'
|
||||
t.pl.choose = '请选择设备'
|
||||
@@ -406,6 +438,8 @@ t.validate = {}
|
||||
t.validate.required = '必填项不能为空'
|
||||
t.validate.format = '{attr}格式错误'
|
||||
t.validate.keyValueWarning = '该数值必须是100以内的正整数!'
|
||||
t.validate.requiredRole = '至少选择一个角色'
|
||||
|
||||
|
||||
t.upload = {}
|
||||
t.upload.title = '上传资料'
|
||||
@@ -550,7 +584,7 @@ t.dict.remark = '备注'
|
||||
t.dict.createDate = '创建时间'
|
||||
|
||||
t.logError = {}
|
||||
t.logError.requestUri = '请求URI'
|
||||
t.logError.requestUri = '请求URL'
|
||||
t.logError.requestMethod = '请求方式'
|
||||
t.logError.requestParams = '请求参数'
|
||||
t.logError.ip = '操作IP'
|
||||
@@ -577,7 +611,7 @@ t.logOperation.status0 = '失败'
|
||||
t.logOperation.status1 = '成功'
|
||||
t.logOperation.creatorName = '用户名'
|
||||
t.logOperation.operation = '用户操作'
|
||||
t.logOperation.requestUri = '请求URI'
|
||||
t.logOperation.requestUri = '请求URL'
|
||||
t.logOperation.requestMethod = '请求方式'
|
||||
t.logOperation.requestParams = '请求参数'
|
||||
t.logOperation.requestTime = '请求时长'
|
||||
@@ -586,7 +620,8 @@ t.logOperation.userAgent = 'User-Agent'
|
||||
t.logOperation.createDate = '创建时间'
|
||||
|
||||
t.menu = {}
|
||||
t.menu.name = '名称'
|
||||
t.menu.name = '中文名'
|
||||
t.menu.nameEn = '英文名'
|
||||
t.menu.icon = '图标'
|
||||
t.menu.type = '类型'
|
||||
t.menu.type0 = '菜单'
|
||||
@@ -640,6 +675,7 @@ t.user.validate = {}
|
||||
t.user.validate.confirmPassword = '确认密码与密码输入不一致'
|
||||
t.user.select = '选择用户'
|
||||
t.user.selecterror = '请选择一条记录'
|
||||
t.user.userTable = ' 用户表'
|
||||
|
||||
|
||||
export default t
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* @Author: fzq
|
||||
* @Date: 2022-11-25 09:51:46
|
||||
* @LastEditors: fzq
|
||||
* @LastEditTime: 2023-01-11 20:52:35
|
||||
* @LastEditTime: 2023-02-01 09:39:37
|
||||
*/
|
||||
/** filters */
|
||||
import moment from 'moment'
|
||||
@@ -16,7 +16,7 @@ export const dictFilter = dictTypeId => {
|
||||
}
|
||||
|
||||
export const timeFilter = (val) => {
|
||||
return moment(val).format('YYYY-MM-DD HH:mm:ss')
|
||||
return val ? moment(val).format('YYYY-MM-DD HH:mm:ss') : '-'
|
||||
}
|
||||
|
||||
export const pick = (obj, paths) => {
|
||||
|
||||
@@ -46,7 +46,7 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
// 通过加上ref,再删除数组第一个元素来把空元素删除,不知道为何会出现这个元素
|
||||
// 通过加上ref,再删除数组第一个元素来把空元素删除,不知为何会出现这个元素
|
||||
this.$store.state.contentTabs.splice(0, 1)
|
||||
// 加个判断防止home页面报$children的错
|
||||
if (this.$route.meta.hiddenSiderbar !== true) {
|
||||
@@ -56,6 +56,16 @@ export default {
|
||||
// console.log('11',this.$refs.tabs.$children[0].$refs.tabs[0])
|
||||
// console.log('22',this.$store.state.contentTabs)
|
||||
})
|
||||
|
||||
// setTimeout(function() {
|
||||
// // 执行代码块
|
||||
// // 不加.bind(this) 因为使用的是function() 这样函数就不会从你的类组件继承this,所以this是undefined
|
||||
// this.$store.state.contentTabs.splice(0, 1)
|
||||
// // 加个判断防止home页面报$children的错
|
||||
// if (this.$route.meta.hiddenSiderbar !== true) {
|
||||
// this.$refs.tabs.$children[0].$refs.tabs[0].style.display = 'none'
|
||||
// }
|
||||
// }.bind(this),0)
|
||||
},
|
||||
methods: {
|
||||
// tabs, 是否通过iframe展示
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="visible" :title="$t('updatePassword.title')" :close-on-click-modal="false" :close-on-press-escape="false" :append-to-body="true">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="170px">
|
||||
<el-form-item :label="$t('updatePassword.username')">
|
||||
<span>{{ $store.state.user.name }}</span>
|
||||
</el-form-item>
|
||||
|
||||
@@ -128,12 +128,11 @@
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</el-menu-item>
|
||||
<el-menu-item
|
||||
<!-- <el-menu-item
|
||||
:style="{
|
||||
backgroundColor: this.$route.meta.hiddenSiderbar !== true ? '#fff' : 'rgb(13,43,104)',
|
||||
color: this.$route.meta.hiddenSiderbar !== true ? '#000' : '#fff'
|
||||
}">
|
||||
<!-- href="Lodap.zip" -->
|
||||
<a
|
||||
><svg
|
||||
:style="this.$route.meta.hiddenSiderbar !== true ? 'color: #000' : 'color: #fff'"
|
||||
@@ -144,14 +143,13 @@
|
||||
<use v-if="!this.$route.meta.hiddenSiderbar" xlink:href="#download"></use>
|
||||
</svg>
|
||||
</a>
|
||||
</el-menu-item>
|
||||
</el-menu-item> -->
|
||||
<el-menu-item
|
||||
:style="{
|
||||
backgroundColor: this.$route.meta.hiddenSiderbar !== true ? '#fff' : 'rgb(13,43,104)',
|
||||
color: this.$route.meta.hiddenSiderbar !== true ? '#000' : '#fff'
|
||||
}">
|
||||
<!-- href="google.exe" -->
|
||||
<a >
|
||||
<a href="google.exe" >
|
||||
<!-- <svg-icon style="width: 24px; height: 24px; vertical-align: -7px" icon-class="chrome" /></a> -->
|
||||
<svg v-if="this.$route.meta.hiddenSiderbar" style="color: #fff; width: 24px; height: 24px; vertical-align: -7px">
|
||||
<use xlink:href="#chrome2"></use>
|
||||
@@ -219,7 +217,7 @@ import moment from 'moment'
|
||||
// let logoutInterval = null
|
||||
// const timeInterval = null
|
||||
export default {
|
||||
inject: ['refresh'],
|
||||
// inject: ['refresh'],
|
||||
data() {
|
||||
return {
|
||||
// logoutTime: 1800000,
|
||||
@@ -309,6 +307,9 @@ export default {
|
||||
getLang() {
|
||||
return Cookies.get('language')
|
||||
},
|
||||
refresh() {
|
||||
this.$router.go(0)
|
||||
},
|
||||
// 切换语言环境
|
||||
handleCommand(command) {
|
||||
// 切换语言选项时,可能需要手动刷新页面
|
||||
|
||||
@@ -29,7 +29,7 @@ export default {
|
||||
mounted() {
|
||||
// this.$store.state.sidebarMenuList = window.SITE_CONFIG['menuList']
|
||||
this.$nextTick(() => {
|
||||
console.log(`window.SITE_CONFIG['menuList']`, window.SITE_CONFIG['menuList'])
|
||||
// console.log(`window.SITE_CONFIG['menuList']`, window.SITE_CONFIG['menuList'])
|
||||
this.unhiddenMenuList = this.getUnhiddenRoutesListFrom(window.SITE_CONFIG['menuList'])
|
||||
/** 本地保存一份,store保存一份,感觉 store 都不需要保存... */
|
||||
this.$store.state.sidebarMenuList = this.unhiddenMenuList
|
||||
|
||||
@@ -1,23 +1,18 @@
|
||||
<template>
|
||||
<div class="choicepart-container">
|
||||
<!-- <div class="choicepat-navbar">
|
||||
<div class="choicepart-container">
|
||||
<!-- <div class="choicepat-navbar">
|
||||
<navbar :showhome="false" :show-title="true" />
|
||||
</div> -->
|
||||
<div class="choicepart-box">
|
||||
<div
|
||||
v-for="(item, index) in routeList"
|
||||
:key="item.path"
|
||||
class="choicepart-item"
|
||||
@click="handelClick(item, index)"
|
||||
>
|
||||
<!-- :style="{ background: colorArr.colorList[index % 9] }" -->
|
||||
<div class="choicepart-item-border">
|
||||
<img :src="require(`../../assets/img/choicepart/${item.name}.png`)" alt="">
|
||||
</div>
|
||||
<div class="choicepart-item-title" :title="item.name">{{ item.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="choicepart-box">
|
||||
<div v-for="(item, index) in routeList" :key="item.path" class="choicepart-item" @click="handelClick(item, index)">
|
||||
<!-- :style="{ background: colorArr.colorList[index % 9] }" -->
|
||||
<div class="choicepart-item-border">
|
||||
<img :src="require(`../../assets/img/choicepart/${item.name}.png`)" alt="" />
|
||||
</div>
|
||||
<div class="choicepart-item-title" :title="item.name">{{ item.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -32,212 +27,218 @@ const colorList = ['#8080ff', '#ff8080', '#b004fb', '#ff409f', '#00caca', '#8080
|
||||
const colorList1 = ['#b4b4ff', '#ffb4b4', '#c648fb', '#ff86c2', '#66f6f6', '#a2a2f3', '#ffff9a', '#ffc3a5', '#367cd4']
|
||||
|
||||
export default {
|
||||
name: 'ChoicePart',
|
||||
// components: { Navbar },
|
||||
data() {
|
||||
return {
|
||||
baseImg: require('../../assets/img/login-back.jpg'),
|
||||
coverImgUrl: localStorage.getItem('backImg') || '',
|
||||
rowNum: 1,
|
||||
colorArr: {
|
||||
colorList,
|
||||
colorList1
|
||||
},
|
||||
windowWidth: 0,
|
||||
dbConnect: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
routeList() {
|
||||
// const cangoList = []
|
||||
// const permission_routes = store.getters.permission_routes
|
||||
// console.log(permission_routes)
|
||||
// permission_routes.map(item => {
|
||||
// if (!item.hidden && item.meta) {
|
||||
// cangoList.push(item)
|
||||
// }
|
||||
// })
|
||||
// const formatList = cangoList.map((item, index) => {
|
||||
// return this.setIndex(item, index)
|
||||
// })
|
||||
// console.log(formatList)
|
||||
return window.SITE_CONFIG['menuList']
|
||||
},
|
||||
// ...mapGetters(['language', 'dictList', 'dictObj'])
|
||||
},
|
||||
created() {
|
||||
// 确保小图标点回来依然带字符
|
||||
this.$store.state.sidebarFold = false
|
||||
this.windowWidth = window.innerWidth
|
||||
console.log(this.$route)
|
||||
// this.dbConnect = db({
|
||||
// DBName: 'back_img',
|
||||
// version: '1.0',
|
||||
// params: [
|
||||
// { name: 'id', unique: true },
|
||||
// { name: 'imgUrl', unique: true }
|
||||
// ]
|
||||
// })
|
||||
// const request = this.dbConnect.openDB()
|
||||
// request.onsuccess = () => {
|
||||
// // const result = this.dbConnect.search('back_img', 'id', 1)
|
||||
// }
|
||||
},
|
||||
mounted() {
|
||||
// console.log(this.dictList, this.dictObj)
|
||||
// this.getPic()
|
||||
},
|
||||
methods: {
|
||||
// getPic() {
|
||||
// // edit here
|
||||
// downLoadBGP().then(response => {
|
||||
// if (response.data.size) {
|
||||
// blobToBase64(response.data).then(res => {
|
||||
// this.coverImgUrl = res
|
||||
// localStorage.setItem('backImg', res)
|
||||
// console.log(res)
|
||||
// // const result = this.dbConnect.search('back_img', 'id', 1)
|
||||
// // if (result.result) {
|
||||
// // this.dbConnect.update({
|
||||
// // id: 1,
|
||||
// // imgUrl: res
|
||||
// // })
|
||||
// // } else {
|
||||
// // this.dbConnect.add({
|
||||
// // id: 1,
|
||||
// // imgUrl: res
|
||||
// // })
|
||||
// // }
|
||||
// })
|
||||
// // this.coverImgUrl = response.data
|
||||
// // const temp = response.data.split('/')
|
||||
// // temp.splice(0, 2)
|
||||
// // this.coverImgUrl = 'http://zzdhg.mes.picaiba.com/' + temp.join('/')
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
resize() {},
|
||||
handelClick(item, index) {
|
||||
// this.$store.dispatch('app/setChoicepart', index)
|
||||
// if (item.meta.unuse) {
|
||||
// this.$message.warning(this.$t('choisePart.module'))
|
||||
// } else {
|
||||
// this.toRouter(item)
|
||||
// }
|
||||
// console.log('item',item)
|
||||
this.toRouter(item)
|
||||
},
|
||||
toRouter(item) {
|
||||
// console.log(item.children[0].url)
|
||||
// 加个判断看是否双层children
|
||||
if ((item.children) && (item.children[0].url == "")){
|
||||
this.$router.push({name: item.children[0].children[0].url.replace(new RegExp('/','g'),'-')})
|
||||
}
|
||||
else {
|
||||
this.$router.push({name: item.children[0].url.replace(new RegExp('/','g'),'-')})
|
||||
}
|
||||
},
|
||||
setIndex(list, index) {
|
||||
list.meta.routeIndex = index
|
||||
if (list.children) {
|
||||
list.children.map(item => {
|
||||
this.setIndex(item, index)
|
||||
})
|
||||
}
|
||||
return list
|
||||
}
|
||||
}
|
||||
name: 'ChoicePart',
|
||||
// components: { Navbar },
|
||||
data() {
|
||||
return {
|
||||
baseImg: require('../../assets/img/login-back.jpg'),
|
||||
coverImgUrl: localStorage.getItem('backImg') || '',
|
||||
rowNum: 1,
|
||||
colorArr: {
|
||||
colorList,
|
||||
colorList1
|
||||
},
|
||||
windowWidth: 0,
|
||||
dbConnect: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
routeList() {
|
||||
// const cangoList = []
|
||||
// const permission_routes = store.getters.permission_routes
|
||||
// console.log(permission_routes)
|
||||
// permission_routes.map(item => {
|
||||
// if (!item.hidden && item.meta) {
|
||||
// cangoList.push(item)
|
||||
// }
|
||||
// })
|
||||
// const formatList = cangoList.map((item, index) => {
|
||||
// return this.setIndex(item, index)
|
||||
// })
|
||||
// console.log(formatList)
|
||||
return window.SITE_CONFIG['menuList']
|
||||
}
|
||||
// ...mapGetters(['language', 'dictList', 'dictObj'])
|
||||
},
|
||||
created() {
|
||||
// 确保小图标点回来依然带字符
|
||||
this.$store.state.sidebarFold = false
|
||||
this.windowWidth = window.innerWidth
|
||||
console.log(this.$route)
|
||||
// this.dbConnect = db({
|
||||
// DBName: 'back_img',
|
||||
// version: '1.0',
|
||||
// params: [
|
||||
// { name: 'id', unique: true },
|
||||
// { name: 'imgUrl', unique: true }
|
||||
// ]
|
||||
// })
|
||||
// const request = this.dbConnect.openDB()
|
||||
// request.onsuccess = () => {
|
||||
// // const result = this.dbConnect.search('back_img', 'id', 1)
|
||||
// }
|
||||
},
|
||||
mounted() {
|
||||
// console.log(this.dictList, this.dictObj)
|
||||
// this.getPic()
|
||||
},
|
||||
methods: {
|
||||
// getPic() {
|
||||
// // edit here
|
||||
// downLoadBGP().then(response => {
|
||||
// if (response.data.size) {
|
||||
// blobToBase64(response.data).then(res => {
|
||||
// this.coverImgUrl = res
|
||||
// localStorage.setItem('backImg', res)
|
||||
// console.log(res)
|
||||
// // const result = this.dbConnect.search('back_img', 'id', 1)
|
||||
// // if (result.result) {
|
||||
// // this.dbConnect.update({
|
||||
// // id: 1,
|
||||
// // imgUrl: res
|
||||
// // })
|
||||
// // } else {
|
||||
// // this.dbConnect.add({
|
||||
// // id: 1,
|
||||
// // imgUrl: res
|
||||
// // })
|
||||
// // }
|
||||
// })
|
||||
// // this.coverImgUrl = response.data
|
||||
// // const temp = response.data.split('/')
|
||||
// // temp.splice(0, 2)
|
||||
// // this.coverImgUrl = 'http://zzdhg.mes.picaiba.com/' + temp.join('/')
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
resize() {},
|
||||
handelClick(item, index) {
|
||||
// this.$store.dispatch('app/setChoicepart', index)
|
||||
// if (item.meta.unuse) {
|
||||
// this.$message.warning(this.$t('choisePart.module'))
|
||||
// } else {
|
||||
// this.toRouter(item)
|
||||
// }
|
||||
// console.log('item',item)
|
||||
this.toRouter(item)
|
||||
},
|
||||
toRouter(item) {
|
||||
// console.log(item.children[0].url)
|
||||
// 加个判断看是否双层children
|
||||
if (item.children && item.children[0].url == '') {
|
||||
this.$router.push({ name: item.children[0].children[0].url.replace(new RegExp('/', 'g'), '-') })
|
||||
} else {
|
||||
this.$router.push({ name: item.children[0].url.replace(new RegExp('/', 'g'), '-') })
|
||||
}
|
||||
},
|
||||
setIndex(list, index) {
|
||||
list.meta.routeIndex = index
|
||||
if (list.children) {
|
||||
list.children.map((item) => {
|
||||
this.setIndex(item, index)
|
||||
})
|
||||
}
|
||||
return list
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.choicepart-container{
|
||||
min-width: 100%;
|
||||
min-height: 100vh;
|
||||
// background: linear-gradient(-45deg, rgb(25, 25, 200), rgb(0, 100, 200));
|
||||
background: url('../../assets/img/choicepart/choicepart-back.png') repeat;
|
||||
background-size: cover;
|
||||
overflow-x: scroll;
|
||||
.choicepart-box{
|
||||
width: 1440px;
|
||||
margin: 0 auto;
|
||||
margin: 0 auto;
|
||||
padding-top: 16vh;
|
||||
min-height: 100vh;
|
||||
.choicepart-item{
|
||||
display: inline-block;
|
||||
width: 208px;
|
||||
height: 258px;
|
||||
margin: 40px;
|
||||
background: url('../../assets/img/choicepart/choice-item-back.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
// border: 1px dashed #fff;
|
||||
box-shadow: 0 2px 10px rgba(0, 0, 0, .5);
|
||||
top: 0;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
img {
|
||||
width: 208px;
|
||||
height: 258px;
|
||||
}
|
||||
.choicepart-item-border{
|
||||
height: 100%;
|
||||
border-radius: 5px;
|
||||
padding: 0 5px;
|
||||
line-height: 32px;
|
||||
font-size: 28px;
|
||||
font-weight: lighter;
|
||||
color: #2C6BD8;
|
||||
overflow: hidden;
|
||||
}
|
||||
.choicepart-item-title {
|
||||
overflow:hidden;
|
||||
padding: 0 10px;
|
||||
text-overflow:ellipsis;
|
||||
white-space:nowrap;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
line-height: 48px;
|
||||
height: 48px;
|
||||
letter-spacing: 2px;
|
||||
background-color: rgba($color: #0B58FF, $alpha: 0.45);
|
||||
}
|
||||
}
|
||||
.choicepart-item:hover {
|
||||
.choicepart-item-title {
|
||||
background-color: rgba($color: #0B58FF, $alpha: 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
.choicepat-navbar{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
.choicepart-container {
|
||||
min-width: 100%;
|
||||
min-height: 100vh;
|
||||
// background: linear-gradient(-45deg, rgb(25, 25, 200), rgb(0, 100, 200));
|
||||
background: url('../../assets/img/choicepart/choicepart-back.png') repeat;
|
||||
background-size: cover;
|
||||
overflow-x: scroll;
|
||||
// flex布局
|
||||
.choicepart-box {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
justify-content: center;
|
||||
width: 1440px;
|
||||
margin: 0 auto;
|
||||
margin: 0 auto;
|
||||
padding-top: 16vh;
|
||||
min-height: 100vh;
|
||||
.choicepart-item {
|
||||
display: inline-block;
|
||||
width: 208px;
|
||||
height: 258px;
|
||||
margin: 40px;
|
||||
background: url('../../assets/img/choicepart/choice-item-back.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
// border: 1px dashed #fff;
|
||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
|
||||
top: 0;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
img {
|
||||
width: 208px;
|
||||
height: 258px;
|
||||
}
|
||||
.choicepart-item-border {
|
||||
height: 100%;
|
||||
border-radius: 5px;
|
||||
padding: 0 5px;
|
||||
line-height: 32px;
|
||||
font-size: 28px;
|
||||
font-weight: lighter;
|
||||
color: #2c6bd8;
|
||||
overflow: hidden;
|
||||
}
|
||||
.choicepart-item-title {
|
||||
overflow: hidden;
|
||||
padding: 0 10px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
line-height: 48px;
|
||||
height: 48px;
|
||||
letter-spacing: 2px;
|
||||
background-color: rgba($color: #0b58ff, $alpha: 0.45);
|
||||
}
|
||||
}
|
||||
.choicepart-item:hover {
|
||||
.choicepart-item-title {
|
||||
background-color: rgba($color: #0b58ff, $alpha: 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
.choicepat-navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
}
|
||||
::-webkit-scrollbar-track-piece { //滚动条凹槽的颜色,还可以设置边框属性
|
||||
background: rgba(255, 255, 255, .1);
|
||||
::-webkit-scrollbar-track-piece {
|
||||
//滚动条凹槽的颜色,还可以设置边框属性
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
::-webkit-scrollbar {//滚动条的宽度
|
||||
width:9px;
|
||||
height:9px;
|
||||
::-webkit-scrollbar {
|
||||
//滚动条的宽度
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {//滚动条的设置
|
||||
background-color: #dddddd;
|
||||
background-clip:padding-box;
|
||||
min-height:28px;
|
||||
border-radius: 9px;
|
||||
::-webkit-scrollbar-thumb {
|
||||
//滚动条的设置
|
||||
background-color: #dddddd;
|
||||
background-clip: padding-box;
|
||||
min-height: 28px;
|
||||
border-radius: 9px;
|
||||
}
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background-color:#bbb;
|
||||
background-color: #bbb;
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="170px">
|
||||
<el-form-item prop="beanName" :label="$t('schedule.beanName')">
|
||||
<el-input v-model="dataForm.beanName" :placeholder="$t('schedule.beanNameTips')"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
@@ -1,78 +1,72 @@
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-job__schedule">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="currentChangeHandle(1)" class="blueTip" size="small">
|
||||
<el-form-item>
|
||||
{{ $t('schedule.beanName') }}
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.beanName" :placeholder="$t('schedule.beanName')" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button class="buttonColor" @click="currentChangeHandle(1)">{{ $t('query') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:pause')" type="danger" @click="pauseHandle()">{{ $t('schedule.pauseBatch') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:resume')" type="danger" @click="resumeHandle()">{{ $t('schedule.resumeBatch') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:run')" type="danger" @click="runHandle()">{{ $t('schedule.runBatch') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:log')" type="success" @click="logHandle()">{{ $t('schedule.log') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<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 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="cronExpression" :label="$t('schedule.cronExpression')" header-align="center" align="center"></el-table-column>
|
||||
<el-table-column prop="remark" :label="$t('schedule.remark')" header-align="center" align="center"></el-table-column>
|
||||
<el-table-column prop="status" :label="$t('schedule.status')" sortable="custom" header-align="center" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status === 1" size="small">{{ $t('schedule.status1') }}</el-tag>
|
||||
<el-tag v-else size="small" type="danger">{{ $t('schedule.status0') }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="$hasPermission('sys:schedule:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
|
||||
<el-button v-if="$hasPermission('sys:schedule:pause')" type="text" size="small" @click="pauseHandle(scope.row.id)">{{ $t('schedule.pause') }}</el-button>
|
||||
<el-button v-if="$hasPermission('sys:schedule:resume')" type="text" size="small" @click="resumeHandle(scope.row.id)">{{ $t('schedule.resume') }}</el-button>
|
||||
<el-button v-if="$hasPermission('sys:schedule:run')" type="text" size="small" @click="runHandle(scope.row.id)">{{ $t('schedule.run') }}</el-button>
|
||||
<el-button v-if="$hasPermission('sys:schedule:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
:current-page="page"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="limit"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="pageSizeChangeHandle"
|
||||
@current-change="pageCurrentChangeHandle">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
<!-- 弹窗, 日志列表 -->
|
||||
<log v-if="logVisible" ref="log"></log>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-job__schedule">
|
||||
<el-form :inline="true" :model="dataForm" ref="form" @keyup.enter.native="currentChangeHandle(dataForm.beanName)" class="blueTip" size="small">
|
||||
<el-form-item>
|
||||
{{ $t('schedule.beanName') }}
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.beanName" :placeholder="$t('schedule.beanName')" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button class="buttonColor" @click="currentChangeHandle(dataForm.beanName)">{{ $t('query') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:pause')" type="danger" @click="pauseHandle()">{{ $t('schedule.pauseBatch') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:resume')" type="danger" @click="resumeHandle()">{{ $t('schedule.resumeBatch') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:run')" type="danger" @click="runHandle()">{{ $t('schedule.runBatch') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:log')" type="success" @click="logHandle()">{{ $t('schedule.log') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<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 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="cronExpression" :label="$t('schedule.cronExpression')" header-align="center" align="center"></el-table-column>
|
||||
<el-table-column prop="remark" :label="$t('schedule.remark')" header-align="center" align="center"></el-table-column>
|
||||
<el-table-column prop="status" :label="$t('schedule.status')" sortable="custom" header-align="center" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status === 1" size="small">{{ $t('schedule.status1') }}</el-tag>
|
||||
<el-tag v-else size="small" type="danger">{{ $t('schedule.status0') }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="$hasPermission('sys:schedule:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
|
||||
<el-button v-if="$hasPermission('sys:schedule:pause')" type="text" size="small" @click="pauseHandle(scope.row.id)">{{ $t('schedule.pause') }}</el-button>
|
||||
<el-button v-if="$hasPermission('sys:schedule:resume')" type="text" size="small" @click="resumeHandle(scope.row.id)">{{ $t('schedule.resume') }}</el-button>
|
||||
<el-button v-if="$hasPermission('sys:schedule:run')" type="text" size="small" @click="runHandle(scope.row.id)">{{ $t('schedule.run') }}</el-button>
|
||||
<el-button v-if="$hasPermission('sys:schedule:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
:current-page="page"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="limit"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="pageSizeChangeHandle"
|
||||
@current-change="pageCurrentChangeHandle">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
<!-- 弹窗, 日志列表 -->
|
||||
<log v-if="logVisible" ref="log"></log>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -80,127 +74,153 @@ import mixinViewModule from '@/mixins/view-module'
|
||||
import AddOrUpdate from './schedule-add-or-update'
|
||||
import Log from './schedule-log'
|
||||
export default {
|
||||
mixins: [mixinViewModule],
|
||||
data () {
|
||||
return {
|
||||
mixinViewModuleOptions: {
|
||||
getDataListURL: '/sys/schedule/page',
|
||||
getDataListIsPage: true,
|
||||
deleteURL: '/sys/schedule',
|
||||
deleteIsBatch: true
|
||||
},
|
||||
dataForm: {
|
||||
beanName: ''
|
||||
},
|
||||
logVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
Log
|
||||
},
|
||||
methods: {
|
||||
mixins: [mixinViewModule],
|
||||
data() {
|
||||
return {
|
||||
mixinViewModuleOptions: {
|
||||
getDataListURL: '/sys/schedule/page',
|
||||
getDataListIsPage: true,
|
||||
deleteURL: '/sys/schedule',
|
||||
deleteIsBatch: true
|
||||
},
|
||||
dataForm: {
|
||||
beanName: ''
|
||||
},
|
||||
logVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
Log
|
||||
},
|
||||
methods: {
|
||||
// destroy dialog
|
||||
handleDestroyDialog() {
|
||||
setTimeout(() => {
|
||||
this.addOrUpdateVisible= false
|
||||
}, /** after dialog animated */ 200);
|
||||
this.addOrUpdateVisible = false
|
||||
}, /** after dialog animated */ 200)
|
||||
},
|
||||
// 暂停
|
||||
pauseHandle (id) {
|
||||
if (!id && this.dataListSelections.length <= 0) {
|
||||
return this.$message({
|
||||
message: this.$t('prompt.deleteBatch'),
|
||||
type: 'warning',
|
||||
duration: 500
|
||||
})
|
||||
}
|
||||
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('schedule.pause') }), this.$t('prompt.title'), {
|
||||
confirmButtonText: this.$t('confirm'),
|
||||
cancelButtonText: this.$t('cancel'),
|
||||
type: 'warning'
|
||||
}).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) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 恢复
|
||||
resumeHandle (id) {
|
||||
if (!id && this.dataListSelections.length <= 0) {
|
||||
return this.$message({
|
||||
message: this.$t('prompt.deleteBatch'),
|
||||
type: 'warning',
|
||||
duration: 500
|
||||
})
|
||||
}
|
||||
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('schedule.resume') }), this.$t('prompt.title'), {
|
||||
confirmButtonText: this.$t('confirm'),
|
||||
cancelButtonText: this.$t('cancel'),
|
||||
type: 'warning'
|
||||
}).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) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 执行
|
||||
runHandle (id) {
|
||||
if (!id && this.dataListSelections.length <= 0) {
|
||||
return this.$message({
|
||||
message: this.$t('prompt.deleteBatch'),
|
||||
type: 'warning',
|
||||
duration: 500
|
||||
})
|
||||
}
|
||||
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('schedule.run') }), this.$t('prompt.title'), {
|
||||
confirmButtonText: this.$t('confirm'),
|
||||
cancelButtonText: this.$t('cancel'),
|
||||
type: 'warning'
|
||||
}).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) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 日志列表
|
||||
logHandle () {
|
||||
this.logVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.log.init()
|
||||
})
|
||||
}
|
||||
}
|
||||
// 暂停
|
||||
pauseHandle(id) {
|
||||
if (!id && this.dataListSelections.length <= 0) {
|
||||
return this.$message({
|
||||
message: this.$t('prompt.deleteBatch'),
|
||||
type: 'warning',
|
||||
duration: 500
|
||||
})
|
||||
}
|
||||
this.$confirm(this.$t('prompt.info', { handle: this.$t('schedule.pause') }), this.$t('prompt.title'), {
|
||||
confirmButtonText: this.$t('confirm'),
|
||||
cancelButtonText: this.$t('cancel'),
|
||||
type: 'warning'
|
||||
})
|
||||
.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) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
// 恢复
|
||||
resumeHandle(id) {
|
||||
if (!id && this.dataListSelections.length <= 0) {
|
||||
return this.$message({
|
||||
message: this.$t('prompt.deleteBatch'),
|
||||
type: 'warning',
|
||||
duration: 500
|
||||
})
|
||||
}
|
||||
this.$confirm(this.$t('prompt.info', { handle: this.$t('schedule.resume') }), this.$t('prompt.title'), {
|
||||
confirmButtonText: this.$t('confirm'),
|
||||
cancelButtonText: this.$t('cancel'),
|
||||
type: 'warning'
|
||||
})
|
||||
.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) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
// 执行
|
||||
runHandle(id) {
|
||||
if (!id && this.dataListSelections.length <= 0) {
|
||||
return this.$message({
|
||||
message: this.$t('prompt.deleteBatch'),
|
||||
type: 'warning',
|
||||
duration: 500
|
||||
})
|
||||
}
|
||||
this.$confirm(this.$t('prompt.info', { handle: this.$t('schedule.run') }), this.$t('prompt.title'), {
|
||||
confirmButtonText: this.$t('confirm'),
|
||||
cancelButtonText: this.$t('cancel'),
|
||||
type: 'warning'
|
||||
})
|
||||
.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) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
// 日志列表
|
||||
logHandle() {
|
||||
this.logVisible = true
|
||||
this.$nextTick(() => {
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
788
src/views/modules/monitoring/equProductTimesequence.vue
Normal file
788
src/views/modules/monitoring/equProductTimesequence.vue
Normal 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>
|
||||
@@ -66,6 +66,7 @@ const topBtnConfig = [
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
width: 100,
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{
|
||||
@@ -411,7 +412,7 @@ export default {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.data.list
|
||||
// this.dataList = new Array(20).fill('1')
|
||||
// console.log('data list', this.dataList)
|
||||
console.log('data list', this.dataList)
|
||||
this.totalPage = data.data.total
|
||||
} else {
|
||||
this.dataList = []
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
|
||||
<el-form-item label="报警信息ID,关联T_equipment_group_alarm表" prop="alarmId">
|
||||
<el-input v-model="dataForm.alarmId" placeholder="报警信息ID,关联T_equipment_group_alarm表"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
|
||||
<el-form-item label="设备ID" prop="equipmentId">
|
||||
<el-input v-model="dataForm.equipmentId" placeholder="设备ID"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{{ $t('pl.name') }}
|
||||
</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>
|
||||
<el-option v-for="line in lineList" :key="line.code" :value="line.id" :label="line.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -13,7 +13,7 @@
|
||||
{{ $t('eq.name') }}
|
||||
</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-select>
|
||||
</el-form-item>
|
||||
@@ -23,7 +23,14 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<base-table :page="pageIndex" :size="pageSize" :data="dataList" :table-head-configs="tableConfigs" :max-height="calcMaxHeight(8)" @operate-event="handleOperations" @refreshDataList="getDataList" />
|
||||
<base-table
|
||||
:page="pageIndex"
|
||||
:size="pageSize"
|
||||
:data="dataList"
|
||||
:table-head-configs="tableConfigs"
|
||||
:max-height="calcMaxHeight(8)"
|
||||
@operate-event="handleOperations"
|
||||
@refreshDataList="getDataList" />
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
@@ -31,8 +38,7 @@
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
>
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :configs="addOrUpdateConfigs" @refreshDataList="getDataList" @destory-dialog="handleDestroyDialog" />
|
||||
@@ -52,31 +58,46 @@ import TableTextComponent from '@/components/base-table/components/detailCompone
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
width: 100,
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'equipmentName', name: i18n.t('realtime.eqName') },
|
||||
{ prop: 'equipmentCode', name: i18n.t('realtime.eqCode') },
|
||||
{ prop: 'inputNum', name: i18n.t('realtime.input') },
|
||||
{ prop: 'outputNum', name: i18n.t('realtime.output') },
|
||||
{
|
||||
prop: 'inputNum',
|
||||
name: i18n.t('realtime.input'),
|
||||
filter: (val) => {
|
||||
if (val !== null && val !== undefined) return val ? val : '-'
|
||||
else return '-'
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'outputNum',
|
||||
name: i18n.t('realtime.output'),
|
||||
filter: (val) => {
|
||||
if (val !== null && val !== undefined) return val ? val : '-'
|
||||
else return '-'
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'run',
|
||||
name: i18n.t('realtime.runState'),
|
||||
filter: val => {
|
||||
if (val !== null && val !== undefined) return val ? '是' : '否'
|
||||
filter: (val) => {
|
||||
if (val !== null && val !== undefined) return val ? i18n.t('yes') : i18n.t('no')
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
name: i18n.t('realtime.state'),
|
||||
filter: val => {
|
||||
if (val !== null && val !== undefined) return ['正常', '计划停机', '故障'][+val]
|
||||
filter: (val) => {
|
||||
if (val !== null && val !== undefined) return [i18n.t('normal'), i18n.t('planStop'), i18n.t('malfunction')][+val]
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'error',
|
||||
name: i18n.t('realtime.hasFault'),
|
||||
filter: val => {
|
||||
if (val !== null && val !== undefined) return val ? '是' : '否'
|
||||
filter: (val) => {
|
||||
if (val !== null && val !== undefined) return val ? i18n.t('yes') : i18n.t('no')
|
||||
}
|
||||
},
|
||||
{ prop: 'quantityTime', name: i18n.t('realtime.productionSnapshotTime'), filter: timeFilter },
|
||||
@@ -137,14 +158,18 @@ export default {
|
||||
// destroy dialog
|
||||
handleDestroyDialog() {
|
||||
setTimeout(() => {
|
||||
this.addOrUpdateVisible= false
|
||||
}, /** after dialog animated */ 200);
|
||||
this.addOrUpdateVisible = false
|
||||
}, /** after dialog animated */ 200)
|
||||
},
|
||||
// 设备
|
||||
getEqList() {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipment/page'),
|
||||
method: 'get'
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
limit: 99999,
|
||||
page: 1
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.eqList = data.data.list
|
||||
@@ -231,7 +256,7 @@ export default {
|
||||
deleteHandle(id) {
|
||||
var ids = id
|
||||
? [id]
|
||||
: this.dataListSelections.map(item => {
|
||||
: this.dataListSelections.map((item) => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`${i18n.t('prompt.info', { handle: id ? i18n.t('delete').toLowerCase() : i18n.t('deleteBatch').toLowerCase() })}`, i18n.t('prompt.title'), {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<!-- <el-select v-model="dataForm.factoryId" :placeholder="$t('eq.name') + ' / ' + $t('eq.code')" clearable></el-select> -->
|
||||
<el-select v-model="dataForm.ftId" :placeholder="$t('factory.title')" clearable>
|
||||
<el-select v-model="dataForm.ftId" :placeholder="$t('factory.title')" @change="handleftIdChange" clearable filterable>
|
||||
<el-option v-for="factory in factoryList" :key="factory.id" :value="factory.id" :label="factory.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -17,7 +17,7 @@
|
||||
{{ $t('pl.title') }}
|
||||
</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-select>
|
||||
</el-form-item>
|
||||
@@ -89,6 +89,7 @@ import moment from 'moment'
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
width: 100,
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{
|
||||
@@ -124,8 +125,8 @@ const tableConfigs = [
|
||||
{
|
||||
name: i18n.t('eq.speedlost'),
|
||||
children: [
|
||||
{ prop: 'realYield', name: i18n.t('eq.realyield'), width: 120, filter: val => `${val} `+i18n.t('hour') },
|
||||
{ prop: 'designYield', name: i18n.t('eq.designyield'), width: 120, filter: val => `${val} `+i18n.t('hour') },
|
||||
{ prop: 'realYield', name: i18n.t('eq.realyield'), width: 120, filter: val => `${val} `+'/'+i18n.t('hour') },
|
||||
{ prop: 'designYield', name: i18n.t('eq.designyield'), width: 120, filter: val => `${val} `+'/'+i18n.t('hour') },
|
||||
{ prop: 'peEfficiency', name: i18n.t('eq.speedefficiency'), width: 120, filter: val => (val * 100).toFixed(2) + '%' }
|
||||
]
|
||||
},
|
||||
@@ -206,7 +207,7 @@ export default {
|
||||
this.factoryList = res.data
|
||||
/** set default */
|
||||
if (this.factoryList.length) {
|
||||
this.dataForm.ftId = this.factoryList[0].id
|
||||
// this.dataForm.ftId = this.factoryList[0].id
|
||||
}
|
||||
} else {
|
||||
this.factoryList = []
|
||||
@@ -235,14 +236,16 @@ export default {
|
||||
if (res && res.code === 0 && res.data.length) {
|
||||
this.productLineList = res.data
|
||||
/** set default */
|
||||
this.dataForm.productlines = [this.productLineList[0].id]
|
||||
// this.dataForm.productlines = [this.productLineList[0].id]
|
||||
} else {
|
||||
this.productLineList = []
|
||||
this.dataForm.productlines = []
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
handleftIdChange() {
|
||||
this.getProductLineList()
|
||||
},
|
||||
// 时间类型预处理
|
||||
getTimeRange() {
|
||||
let startTime
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
/*
|
||||
* @Author: lb
|
||||
* @Date: 2022-07-24 13:30:00
|
||||
* @LastEditTime: 2022-07-28 09:30:00
|
||||
* @LastEditors: lb
|
||||
* @LastEditTime: 2023-02-09 15:25:13
|
||||
* @LastEditors: fzq
|
||||
* @Description: 设备效率分析-echarts图
|
||||
*/
|
||||
-->
|
||||
<template>
|
||||
<div class="graph-area">
|
||||
<span class="close-btn" @click="close">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" style="height: 100%; width: 100%;" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" style="height: 100%; width: 100%" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
|
||||
</svg>
|
||||
</span>
|
||||
@@ -21,12 +21,12 @@
|
||||
<el-radio-button :label="$t('eq.time')" />
|
||||
</el-radio-group>
|
||||
|
||||
<el-radio-group v-if="1" v-model="searchType" class="head-radio-group" style="margin-left: 8px;" size="small" @change="handleRadioGroupChanged">
|
||||
<el-radio-group v-if="1" v-model="searchType" class="head-radio-group" style="margin-left: 8px" size="small" @change="handleRadioGroupChanged">
|
||||
<el-radio-button v-for="(opt, index) in searchRadioOptions" :key="index" :label="opt" />
|
||||
</el-radio-group>
|
||||
</div>
|
||||
|
||||
<div id="trend-graph" class="real-graph" style="width: 100%; height: 500px;" />
|
||||
<div id="trend-graph" class="real-graph" style="width: 100%; height: 500px" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -131,6 +131,7 @@ export default {
|
||||
this.config.setTitle(this.injectData.equipmentName + i18n.t('eq.timetrend'))
|
||||
await this.getList()
|
||||
this.setLegend()
|
||||
// console.log('this.dataType',this.dataType);
|
||||
},
|
||||
|
||||
init(data) {
|
||||
@@ -181,14 +182,14 @@ export default {
|
||||
getList() {
|
||||
const params = this.makeQuerys()
|
||||
// 发起请求
|
||||
return this.getOEE(params).then(datalist => {
|
||||
return this.getOEE(params).then((datalist) => {
|
||||
console.log('getOEE res:', datalist)
|
||||
this.timeList.splice(0)
|
||||
this.rateList.splice(0)
|
||||
this.xAxis.splice(0)
|
||||
if (datalist.length) {
|
||||
// 分流
|
||||
datalist.map(item => {
|
||||
datalist.map((item) => {
|
||||
const time = moment(item.time)
|
||||
if (this.searchType === i18n.t('eq.monthgap')) {
|
||||
this.xAxis.push(`${time.year()}${i18n.t('eq.year')}${time.month() + 1}${i18n.t('eq.month')}`)
|
||||
@@ -241,7 +242,7 @@ export default {
|
||||
const workTimeList = []
|
||||
const stopTimeList = []
|
||||
const downTimeList = []
|
||||
this.timeList.map(item => {
|
||||
this.timeList.map((item) => {
|
||||
workTimeList.push(item.workTime)
|
||||
stopTimeList.push(item.stopTime)
|
||||
downTimeList.push(item.downTime)
|
||||
@@ -260,7 +261,7 @@ export default {
|
||||
const timeEfficiencyList = []
|
||||
const oeeList = []
|
||||
const teepList = []
|
||||
this.rateList.map(item => {
|
||||
this.rateList.map((item) => {
|
||||
workRateList.push(item.workRate)
|
||||
stopRateList.push(item.stopRate)
|
||||
downRateList.push(item.downRate)
|
||||
@@ -283,6 +284,18 @@ export default {
|
||||
|
||||
// 重新绘制图形
|
||||
renderGraph() {
|
||||
if (this.dataType === i18n.t('eq.time')) {
|
||||
this.config.yAxis = {
|
||||
type: 'value',
|
||||
name: i18n.t('yAxisTime')
|
||||
}
|
||||
} else {
|
||||
this.config.yAxis = {
|
||||
type: 'value',
|
||||
name: i18n.t('yAxisRate')
|
||||
}
|
||||
}
|
||||
console.log('this.dataType', this.dataType)
|
||||
console.log('latest config: ', JSON.stringify(this.config))
|
||||
this.$nextTick(() => {
|
||||
// this.chart.setOption(this.config)
|
||||
@@ -320,11 +333,14 @@ export default {
|
||||
}
|
||||
|
||||
.close-btn:hover {
|
||||
color: #409eff;
|
||||
/* color: #409eff; */
|
||||
color: #0B58FF;
|
||||
}
|
||||
|
||||
.head-radio-group >>> .el-radio-button__orig-radio:checked + .el-radio-button__inner {
|
||||
background-color: #409eff;
|
||||
border-color: #409eff;
|
||||
/* background-color: #409eff;
|
||||
border-color: #409eff; */
|
||||
background-color: #0B58FF;
|
||||
border-color: #0B58FF;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
{{ $t('pl.title') }}
|
||||
</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-select>
|
||||
</el-form-item>
|
||||
@@ -52,6 +52,7 @@ import moment from 'moment'
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
width: 100,
|
||||
name: i18n.t('index')
|
||||
},
|
||||
// { prop: 'time', name: '时间', filter: timeFilter },
|
||||
@@ -134,10 +135,10 @@ export default {
|
||||
}).then(({ data: res }) => {
|
||||
if (res && res.code === 0) {
|
||||
this.productLineList = res.data
|
||||
/** set default */
|
||||
if (this.productLineList.length) {
|
||||
this.dataForm.productlines = [this.productLineList[0].id]
|
||||
}
|
||||
/** set default 默认*/
|
||||
// if (this.productLineList.length) {
|
||||
// this.dataForm.productlines = [this.productLineList[0].id]
|
||||
// }
|
||||
} else {
|
||||
this.productLineList = []
|
||||
this.dataForm.productlines = []
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
|
||||
<el-form-item label="设备ID" prop="equipmentId">
|
||||
<el-input v-model="dataForm.equipmentId" placeholder="设备ID"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
@@ -57,6 +57,7 @@ const topBtnConfig = [
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
width: 100,
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
@@ -70,7 +71,7 @@ const tableConfigs = [
|
||||
const addOrUpdateConfigs = {
|
||||
type: 'dialog',
|
||||
infoUrl: '/monitoring/equipmentGroup',
|
||||
fields: [{ name: 'name', required: true, label: i18n.t('eq.groupname') }, { name: 'code', required: true, label: i18n.t('eq.groupcode') }, 'remark'],
|
||||
fields: [{ name: 'name', required: true, label: i18n.t('eq.groupname') }, { name: 'code', required: true, label: i18n.t('eq.groupcode'),api: '/monitoring/equipmentGroupAlarm/getCode' }, 'remark'],
|
||||
operations: [
|
||||
{ name: 'cancel', showAlways: true },
|
||||
{ name: 'save', url: '/monitoring/equipmentGroup', permission: 'monitoring:equipmentgroup:save', showOnEdit: false },
|
||||
|
||||
@@ -76,6 +76,7 @@ const topBtnConfig = [
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
width: 100,
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
|
||||
@@ -1,16 +1,37 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" class="blueTip" size="small">
|
||||
<el-form-item :label="$t('eqId')">
|
||||
<strong>{{ $route.params.id }}</strong></el-form-item
|
||||
>
|
||||
<el-form :inline="true" class="blueTip" size="small">
|
||||
<!-- <el-form-item>
|
||||
{{ $t('eq.plcname') }}
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="dataForm.lineId" :placeholder="$t('eq.plcname')" clearable>
|
||||
<el-option v-for="line in lineList" :key="line.code" :value="line.id" :label="line.name" />
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item :label="$t('eqId')">
|
||||
<strong>{{ $route.params.id }}</strong>
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="$t('equName')">
|
||||
<strong>{{ equipmentName }}</strong>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('equCode')">
|
||||
<strong>{{ equipmentCode }}</strong>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- <base-table :page="pageIndex" :size="pageSize" :data="dataList" :table-head-configs="tableConfigs" :max-height="calcMaxHeight(8)" @operate-event="handleOperations" @refreshDataList="getDataList" /> -->
|
||||
<base-table
|
||||
:data="dataList"
|
||||
:table-head-configs="tableConfigs"
|
||||
:max-height="calcMaxHeight(8)" />
|
||||
<base-table v-if="tableConfigs.length > 3" :data="dataList" :table-head-configs="tableConfigs" :max-height="calcMaxHeight(8)" />
|
||||
<base-table v-if="tableConfigs2.length > 3" :data="dataList2" :table-head-configs="tableConfigs2" :max-height="calcMaxHeight(8)" />
|
||||
<base-table v-if="tableConfigs3.length > 3" :data="dataList3" :table-head-configs="tableConfigs3" :max-height="calcMaxHeight(8)" />
|
||||
<base-table v-if="tableConfigs4.length > 3" :data="dataList4" :table-head-configs="tableConfigs4" :max-height="calcMaxHeight(8)" />
|
||||
<base-table v-if="tableConfigs5.length > 3" :data="dataList5" :table-head-configs="tableConfigs5" :max-height="calcMaxHeight(8)" />
|
||||
<base-table v-if="tableConfigs6.length > 3" :data="dataList6" :table-head-configs="tableConfigs6" :max-height="calcMaxHeight(8)" />
|
||||
<base-table v-if="tableConfigs7.length > 3" :data="dataList7" :table-head-configs="tableConfigs7" :max-height="calcMaxHeight(8)" />
|
||||
<base-table v-if="tableConfigs8.length > 3" :data="dataList8" :table-head-configs="tableConfigs8" :max-height="calcMaxHeight(8)" />
|
||||
<base-table v-if="tableConfigs9.length > 3" :data="dataList9" :table-head-configs="tableConfigs9" :max-height="calcMaxHeight(8)" />
|
||||
<base-table v-if="tableConfigs10.length > 3" :data="dataList10" :table-head-configs="tableConfigs10" :max-height="calcMaxHeight(8)" />
|
||||
<!-- <base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="calcMaxHeight(8)" /> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -21,13 +42,35 @@ import AddOrUpdate from '@/components/base-dialog/addOrUpdate'
|
||||
import i18n from '@/i18n'
|
||||
import BaseTable from '@/components/base-table'
|
||||
import { pick } from 'lodash/object'
|
||||
import equipmentVue from './equipment.vue'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
calcMaxHeight,
|
||||
equipmentName: null,
|
||||
equipmentCode: null,
|
||||
tableConfigs: [],
|
||||
tableConfigs2: [],
|
||||
tableConfigs3: [],
|
||||
tableConfigs4: [],
|
||||
tableConfigs5: [],
|
||||
tableConfigs6: [],
|
||||
tableConfigs7: [],
|
||||
tableConfigs8: [],
|
||||
tableConfigs9: [],
|
||||
tableConfigs10: [],
|
||||
dataLength: null,
|
||||
dataList: [],
|
||||
dataList2: [],
|
||||
dataList3: [],
|
||||
dataList4: [],
|
||||
dataList5: [],
|
||||
dataList6: [],
|
||||
dataList7: [],
|
||||
dataList8: [],
|
||||
dataList9: [],
|
||||
dataList10: [],
|
||||
dataListLoading: false,
|
||||
dataListSelections: []
|
||||
}
|
||||
@@ -42,12 +85,15 @@ export default {
|
||||
mouted() {
|
||||
this.getDataList()
|
||||
},
|
||||
created() {
|
||||
// console.log('params',this.$route.params)
|
||||
},
|
||||
methods: {
|
||||
// destroy dialog
|
||||
handleDestroyDialog() {
|
||||
setTimeout(() => {
|
||||
this.addOrUpdateVisible= false
|
||||
}, /** after dialog animated */ 200);
|
||||
this.addOrUpdateVisible = false
|
||||
}, /** after dialog animated */ 200)
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
@@ -56,6 +102,10 @@ export default {
|
||||
url: this.$http.adornUrl(`/monitoring/equipmentValueMonitor/runLog/${this.$route.params.id}`),
|
||||
method: 'get'
|
||||
}).then(({ data: 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 (
|
||||
res &&
|
||||
res.code === 0 &&
|
||||
@@ -66,13 +116,138 @@ export default {
|
||||
res.data[0].data &&
|
||||
res.data[0].data.length > 0
|
||||
) {
|
||||
// console.log(this.equipmentName)
|
||||
this.setTableProps(res.data[0].nameData)
|
||||
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
|
||||
})
|
||||
}).catch(()=>{}) //---去除无效报错---
|
||||
},
|
||||
setTableProps(nameData) {
|
||||
this.tableConfigs = [
|
||||
@@ -82,19 +257,289 @@ export default {
|
||||
},
|
||||
{ prop: 'time', name: this.$t('ti'), filter: timeFilter },
|
||||
{ prop: 'plcCode', name: this.$t('plcCode') },
|
||||
{ prop: 'equName', name: this.$t('equName') },
|
||||
{ prop: 'equCode', name: this.$t('equCode') },
|
||||
// { prop: 'equName', name: this.$t('equName') },
|
||||
// { prop: 'equCode', name: this.$t('equCode') },
|
||||
// ...['数值1', '数值2', '数值3'].map(name => {
|
||||
// return { prop: name, name }
|
||||
// })
|
||||
...Array.from(new Set(nameData.map(item => item.name))).map(name => ({ prop: name, name }))
|
||||
...Array.from(new Set(nameData.map((item) => item.name))).map((name) => ({ prop: name, name }))
|
||||
]
|
||||
// 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) {
|
||||
this.dataList = data.map(item => {
|
||||
this.dataList = data.map((item) => {
|
||||
const rowItem = pick(item, ['time', 'plcCode', 'equName', 'equCode'])
|
||||
if (item.data && item.data.length > 0) {
|
||||
item.data.forEach(param => {
|
||||
item.data.forEach((param) => {
|
||||
rowItem[param.dynamicName] = param.dynamicValue
|
||||
})
|
||||
}
|
||||
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
|
||||
})
|
||||
}
|
||||
|
||||
@@ -165,6 +165,8 @@ export default {
|
||||
// page: this.pageIndex,
|
||||
// limit: this.pageSize,
|
||||
// key: this.dataForm.key
|
||||
limit: 99999,
|
||||
page: 1
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
const eqConfig = this.addOrUpdateConfigs.fields.find(item => item.name === 'equipmentId')
|
||||
@@ -180,6 +182,8 @@ export default {
|
||||
// page: this.pageIndex,
|
||||
// limit: this.pageSize,
|
||||
// key: this.dataForm.key
|
||||
limit: 99999,
|
||||
page: 1
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
const plcConfig = this.addOrUpdateConfigs.fields.find(item => item.name === 'plcId')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
|
||||
<el-form-item label="plc连接表ID" prop="plcConId">
|
||||
<el-input v-model="dataForm.plcConId" placeholder="plc连接表ID"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
|
||||
<el-form-item label="设备外部编码" prop="externalCode">
|
||||
<el-input v-model="dataForm.externalCode" placeholder="设备外部编码"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
|
||||
<el-form-item label="设备外部代码" prop="externalCode">
|
||||
<el-input v-model="dataForm.externalCode" placeholder="设备外部代码"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
{{ $t('pl.title') }}
|
||||
</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"
|
||||
:label="productLine.name" />
|
||||
</el-select>
|
||||
@@ -18,7 +18,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<!-- <el-select v-model="dataForm.factoryId" :placeholder="$t('eq.name') + ' / ' + $t('eq.code')" clearable></el-select> -->
|
||||
<el-select v-model="dataForm.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-select>
|
||||
</el-form-item>
|
||||
@@ -35,7 +35,7 @@
|
||||
<!-- <el-button v-if="$hasPermission('monitoring:equipmentEffiency:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> -->
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="success" @click="addEq()">{{ $t('pl.add') }}</el-button>
|
||||
<el-button type="success" @click="addEq()">{{ $t('pl.add2') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
</div>
|
||||
|
||||
<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-select>
|
||||
<div slot="footer">
|
||||
@@ -270,10 +270,10 @@ export default {
|
||||
}).then(({ data: res }) => {
|
||||
if (res && res.code === 0) {
|
||||
this.productLineList = res.data
|
||||
/** set default */
|
||||
if (this.productLineList.length) {
|
||||
this.dataForm.productlines = this.productLineList[0].id
|
||||
}
|
||||
/** set default 默认*/
|
||||
// if (this.productLineList.length) {
|
||||
// this.dataForm.productlines = this.productLineList[0].id
|
||||
// }
|
||||
} else {
|
||||
this.productLineList = []
|
||||
}
|
||||
@@ -489,8 +489,8 @@ export default {
|
||||
const condition = {
|
||||
startTime,
|
||||
endTime,
|
||||
productlines: [this.dataForm.productlines],
|
||||
wsId: this.dataForm.wsId,
|
||||
// productlines: [this.dataForm.productlines],
|
||||
// wsId: this.dataForm.wsId,
|
||||
eqId: this.eqId
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ const topBtnConfig = [
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
width: 100,
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
@@ -72,7 +73,7 @@ const addOrUpdateConfigs = {
|
||||
fields: [
|
||||
{ name: 'name', required: true, label: i18n.t('eq.type') },
|
||||
{ name: 'code', required: true, label: i18n.t('eq.typecode'), api: '/monitoring/equipmentType/getCode' },
|
||||
{ name: 'parentId', label: i18n.t('eq.parent'), type: 'cascader', props: { label: 'name', value: 'id', checkStrictly: true, emitPath: false }, options: [] },
|
||||
// { name: 'parentId', label: i18n.t('eq.parent'), type: 'cascader', props: { label: 'name', value: 'id', checkStrictly: true, emitPath: false }, options: [] },
|
||||
'remark'
|
||||
],
|
||||
operations: [
|
||||
@@ -133,16 +134,16 @@ export default {
|
||||
},
|
||||
// 获取设备类型树形数据
|
||||
getTreeEquipmentType() {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmentType/getTree'),
|
||||
method: 'post'
|
||||
}).then(({ data: res }) => {
|
||||
if (res && res.code === 0 && res.data.length) {
|
||||
this.addOrUpdateConfigs.fields.find(item => item.name === 'parentId').options = res.data
|
||||
} else {
|
||||
this.addOrUpdateConfigs.fields.find(item => item.name === 'parentId').options.splice(0)
|
||||
}
|
||||
})
|
||||
// this.$http({
|
||||
// url: this.$http.adornUrl('/monitoring/equipmentType/getTree'),
|
||||
// method: 'post'
|
||||
// }).then(({ data: res }) => {
|
||||
// if (res && res.code === 0 && res.data.length) {
|
||||
// this.addOrUpdateConfigs.fields.find(item => item.name === 'parentId').options = res.data
|
||||
// } else {
|
||||
// this.addOrUpdateConfigs.fields.find(item => item.name === 'parentId').options.splice(0)
|
||||
// }
|
||||
// })
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
|
||||
<el-form-item label="设备类型ID" prop="equipmentTypeId">
|
||||
<el-input v-model="dataForm.equipmentTypeId" placeholder="设备类型ID"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
@@ -38,6 +38,7 @@ import TableOperateComponent from '@/components/base-table/components/operationC
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
width: 100,
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
|
||||
@@ -56,6 +56,7 @@ const topBtnConfig = [
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
width: 100,
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
|
||||
@@ -143,7 +143,9 @@ const addOrUpdateConfigs = {
|
||||
relatedField: 'productId',
|
||||
tableConfigs: [
|
||||
{ type: 'index', width: 100, name: i18n.t('index') },
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: (val) => (val ? moment(val).format('YYYY-MM-DD hh:mm:ss') : '-') },
|
||||
// 12小时制的时间
|
||||
// { prop: 'createTime', name: i18n.t('createTime'), filter: (val) => (val ? moment(val).format('YYYY-MM-DD hh:mm:ss') : '-') },
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
{ prop: 'name', name: i18n.t('attrName'), formField: true, rules: [{ required: true, message: i18n.t('required'), trigger: 'blur' }] },
|
||||
{ prop: 'code', name: i18n.t('attrValue'), formField: true },
|
||||
{ prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
|
||||
|
||||
729
src/views/modules/monitoring/productAnalysis.vue
Normal file
729
src/views/modules/monitoring/productAnalysis.vue
Normal 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>
|
||||
744
src/views/modules/monitoring/productQuality.vue
Normal file
744
src/views/modules/monitoring/productQuality.vue
Normal 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>
|
||||
@@ -54,6 +54,7 @@ const topBtnConfig = [
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
width: 100,
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
|
||||
<el-form-item label="产线id" prop="productionLineId">
|
||||
<el-input v-model="dataForm.productionLineId" placeholder="产线id"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
:configs="addOrUpdateConfigs"
|
||||
@refreshDataList="getDataList"
|
||||
@refreshDataList="addSuccess"
|
||||
@select-change="handleDialogSelectChange"
|
||||
@destory-dialog="handleDestroyDialog" />
|
||||
</div>
|
||||
@@ -65,6 +65,7 @@ const topBtnConfig = [
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
width: 100,
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{
|
||||
@@ -92,7 +93,7 @@ const addOrUpdateConfigs = {
|
||||
fields: [
|
||||
// { name: 'productionId', label: i18n.t('eq.name'), required: true },
|
||||
{ name: 'productionId', label: i18n.t('pl.title'), required: true, type: 'select', options: [], relatedField: 'sectionId' },
|
||||
{ name: 'sectionId', label: i18n.t('ws.title'), required: true, type: 'select', options: [] },
|
||||
{ name: 'sectionId', label: i18n.t('ws.title'), required: true, type: 'select', options: [], isDisabled: true },
|
||||
{ name: 'model', label: i18n.t('andeng.btnBoxModel') },
|
||||
{
|
||||
// name: 'keyValue',
|
||||
@@ -215,6 +216,7 @@ export default {
|
||||
methods: {
|
||||
// destroy dialog
|
||||
handleDestroyDialog() {
|
||||
this.$set(this.addOrUpdateConfigs.fields[1], 'isDisabled', true)
|
||||
setTimeout(() => {
|
||||
this.addOrUpdateVisible = false
|
||||
}, /** after dialog animated */ 200)
|
||||
@@ -332,8 +334,7 @@ export default {
|
||||
this.addOrUpdateConfigs.fields.forEach((item) => {
|
||||
// console.log('item',item)
|
||||
// console.log('res',res)
|
||||
if (item.name === 'inspectionDetContent')
|
||||
item.options = res.data.list.map((item) => ({ label: item.content, value: item.content, inspectionDetId: item.code }))
|
||||
if (item.name === 'inspectionDetContent') item.options = res.data.list.map((item) => ({ label: item.content, value: item.content, inspectionDetId: item.code }))
|
||||
// console.log('item',item)
|
||||
})
|
||||
} else {
|
||||
@@ -359,10 +360,19 @@ export default {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 对话框里的某个选择改变了
|
||||
handleDialogSelectChange({ name, id }) {
|
||||
async handleDialogSelectChange({ name, id }) {
|
||||
switch (name) {
|
||||
case 'productionId':
|
||||
this.getWsList(id)
|
||||
// this.getWsList(id)
|
||||
if (name === 'productionId') {
|
||||
// 如果选择了产线,就依据此更新工单的选项
|
||||
if (id) {
|
||||
this.$set(this.addOrUpdateConfigs.fields[1], 'isDisabled', false)
|
||||
} else {
|
||||
this.$set(this.addOrUpdateConfigs.fields[1], 'isDisabled', true)
|
||||
}
|
||||
await this.getWsList(id)
|
||||
}
|
||||
case 'inspectionDetContent':
|
||||
// this.dataForm.inspectionDetId = id
|
||||
// console.log(id)
|
||||
@@ -377,6 +387,11 @@ export default {
|
||||
console.log('addOrUpdateConfigs', this.addOrUpdateConfigs.fields)
|
||||
}
|
||||
},
|
||||
addSuccess() {
|
||||
this.getDataList()
|
||||
this.$set(this.addOrUpdateConfigs.fields[1], 'options', [])
|
||||
this.$set(this.addOrUpdateConfigs.fields[1], 'isDisabled', true)
|
||||
},
|
||||
handleOperations({ type, data: id }) {
|
||||
switch (type) {
|
||||
case 'view-detail':
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" @keyup.enter.native="getDataList()" class="blueTip" size="small">
|
||||
<el-form-item>
|
||||
{{ $t('time')}}
|
||||
{{ $t('time') }}
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<!-- type="datetimerange" -->
|
||||
@@ -15,8 +15,7 @@
|
||||
:range-separator="$t('to')"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
:picker-options="quickOptions"
|
||||
clearable
|
||||
/>
|
||||
clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button class="buttonColor" @click="getDataList()">{{ $t('query') }}</el-button>
|
||||
@@ -28,32 +27,31 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<small-title :size="'md'">{{ $t('inspect.ioTotal') }}</small-title>
|
||||
<el-row style="margin-top: 12px;">
|
||||
<el-row style="margin-top: 12px">
|
||||
<base-table :data="dataListStatic" :table-head-configs="tableConfigStatic" :max-height="500" @operate-event="handleOperations" @refreshDataList="getDataList" />
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row style="margin-top: 28px;">
|
||||
<el-row style="margin-top: 28px">
|
||||
<el-col>
|
||||
<el-row>
|
||||
<small-title :size="'md'">{{ $t('inspect.plTotal') }}</small-title>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 8px;">
|
||||
<el-row style="margin-top: 8px">
|
||||
<el-radio-group v-model="dataType" size="medium" @change="handleDataTypeChange">
|
||||
<el-radio-button :label="$t('table2')"></el-radio-button>
|
||||
<el-radio-button :label="$t('graph')"></el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 12px;">
|
||||
<el-row style="margin-top: 12px">
|
||||
<base-table
|
||||
v-if="!showGraph"
|
||||
:data="dataListDynamic"
|
||||
:table-head-configs="tableConfigDynamic"
|
||||
:max-height="500"
|
||||
@operate-event="handleOperations"
|
||||
@refreshDataList="getDataList"
|
||||
/>
|
||||
@refreshDataList="getDataList" />
|
||||
<fake-chart v-else :categories="echartCategories" :type-list="echartCheckTypes" :series-data="echartsData" />
|
||||
</el-row>
|
||||
</el-col>
|
||||
@@ -77,7 +75,7 @@ const tableConfigStatic = [
|
||||
{ name: i18n.t('inspect.inTotal'), prop: 'sumUp' },
|
||||
{ name: i18n.t('inspect.outTotal'), prop: 'sumDown' },
|
||||
{ name: i18n.t('inspect.checkTotal'), prop: 'sumCheck' },
|
||||
{ name: i18n.t('inspect.rate'), prop: 'scrapRatio', filter: val => (val || val === 0 ? `${val}%` : '-') }
|
||||
{ name: i18n.t('inspect.rate'), prop: 'scrapRatio', filter: (val) => (val || val === 0 ? `${val}%` : '-') }
|
||||
]
|
||||
const tableConfigDynamic = [
|
||||
{ type: 'index', width: 100, name: i18n.t('index') },
|
||||
@@ -125,7 +123,7 @@ const FakeChart = {
|
||||
right: 0,
|
||||
width: '12%',
|
||||
/** 修复文本太长时显示问题 */
|
||||
formatter: function(name) {
|
||||
formatter: function (name) {
|
||||
return echarts.format.truncateText(name, 120, '14px Microsoft Yahei', '...')
|
||||
},
|
||||
tooltip: {
|
||||
@@ -153,7 +151,7 @@ const FakeChart = {
|
||||
},
|
||||
watch: {
|
||||
categories: {
|
||||
handler: function(val, oldVal) {
|
||||
handler: function (val, oldVal) {
|
||||
if (val && val !== oldVal) {
|
||||
this.defaultOpts.xAxis.data.push(...val)
|
||||
}
|
||||
@@ -161,7 +159,7 @@ const FakeChart = {
|
||||
immediate: true
|
||||
},
|
||||
typeList: {
|
||||
handler: function(val, oldVal) {
|
||||
handler: function (val, oldVal) {
|
||||
if (val && val !== oldVal) {
|
||||
this.defaultOpts.legend.data.push(...val)
|
||||
}
|
||||
@@ -169,7 +167,7 @@ const FakeChart = {
|
||||
immediate: true
|
||||
},
|
||||
seriesData: {
|
||||
handler: function(val, oldVal) {
|
||||
handler: function (val, oldVal) {
|
||||
if (val && val !== oldVal) {
|
||||
this.defaultOpts.series.push(...val)
|
||||
}
|
||||
@@ -177,7 +175,7 @@ const FakeChart = {
|
||||
immediate: true
|
||||
},
|
||||
defaultOpts: {
|
||||
handler: function(val) {
|
||||
handler: function (val) {
|
||||
console.log('defaullt opts change: ', val)
|
||||
this.setOptions()
|
||||
},
|
||||
@@ -205,7 +203,7 @@ const FakeChart = {
|
||||
if (this.chart) this.chart.setOption(this.defaultOpts)
|
||||
}
|
||||
},
|
||||
render: function(h) {
|
||||
render: function (h) {
|
||||
return h('div', { attrs: { id: 'bar-chart' }, style: { background: '#eee', width: '100%', height: '300px', padding: '8px' } }, '')
|
||||
}
|
||||
}
|
||||
@@ -269,16 +267,8 @@ export default {
|
||||
this.echartCategories = null
|
||||
this.echartCheckTypes.splice(0)
|
||||
/** 设置默认日期 */
|
||||
const startTime =
|
||||
this.datetime[0] ||
|
||||
moment()
|
||||
.set({ hour: 0, minute: 0, second: 0 })
|
||||
.format('yyyy-MM-DDTHH:mm:ss')
|
||||
const endTime =
|
||||
this.datetime[1] ||
|
||||
moment()
|
||||
.set({ hour: 23, minute: 59, second: 59 })
|
||||
.format('yyyy-MM-DDTHH:mm:ss')
|
||||
const startTime = this.datetime[0] || moment().set({ hour: 0, minute: 0, second: 0 }).format('yyyy-MM-DDTHH:mm:ss')
|
||||
const endTime = this.datetime[1] || moment().set({ hour: 23, minute: 59, second: 59 }).format('yyyy-MM-DDTHH:mm:ss')
|
||||
|
||||
/** [1] 获取上下片数据 */
|
||||
this.fetchList('sx', startTime, endTime).then(({ data: res }) => {
|
||||
@@ -287,11 +277,12 @@ export default {
|
||||
})
|
||||
/** [2] 获取产线检测类型 */
|
||||
this.fetchList('pl', startTime, endTime).then(({ data: res }) => {
|
||||
// console.log('pl: ', res)
|
||||
console.log('res: ', res)
|
||||
/** TODO: 解析 nameData */
|
||||
this.parseTableProps(res.data.nameData)
|
||||
|
||||
this.dataListDynamic = this.parseDynamicData(res.data.data) || []
|
||||
console.log('this.dataListDynamic', this.dataListDynamic)
|
||||
|
||||
this.buildGraphData()
|
||||
})
|
||||
@@ -303,7 +294,7 @@ export default {
|
||||
|
||||
if (nameData.length) {
|
||||
/** 处理 nameData */
|
||||
nameData.forEach(item => {
|
||||
nameData.forEach((item) => {
|
||||
if (!labelNameMap.get(item.name)) {
|
||||
labelNameMap.set(item.name, 1)
|
||||
subProps.push({ name: item.name, prop: item.name })
|
||||
@@ -316,21 +307,22 @@ export default {
|
||||
{ name: i18n.t('inspect.det'), prop: 'inspectionContent' },
|
||||
...subProps,
|
||||
{ name: i18n.t('inspect.typetotal'), prop: 'sumInput' },
|
||||
{ name: i18n.t('inspect.rate'), prop: 'scrapRatio', filter: val => (val || val === 0 ? `${val}%` : '-') }
|
||||
{ name: i18n.t('inspect.rate'), prop: 'scrapRatio', filter: (val) => (val || val === 0 ? `${val}%` : '-') }
|
||||
]
|
||||
|
||||
/** echarts related */
|
||||
this.echartCategories = subProps.map(item => item.name)
|
||||
this.echartCategories = subProps.map((item) => item.name)
|
||||
// console.log('this.echartCategories',this.echartCategories)
|
||||
},
|
||||
|
||||
parseDynamicData(data) {
|
||||
this.echartCheckTypes.splice(0)
|
||||
return data.map(item => {
|
||||
return data.map((item) => {
|
||||
/** echarts related */
|
||||
this.echartCheckTypes.push(item.inspectionContent)
|
||||
if (item.data.length) {
|
||||
/** 解析子数组 */
|
||||
item.data.forEach(subitem => {
|
||||
item.data.forEach((subitem) => {
|
||||
item[subitem.dynamicName] = subitem.dynamicValue
|
||||
})
|
||||
}
|
||||
@@ -342,13 +334,15 @@ export default {
|
||||
/** 构造 echart 需要的数据 */
|
||||
const result = []
|
||||
|
||||
this.echartCheckTypes.forEach(ect => {
|
||||
this.echartCheckTypes.forEach((ect) => {
|
||||
result.push({ name: ect, type: 'bar', data: [] })
|
||||
})
|
||||
|
||||
console.log('result', result)
|
||||
console.log('echartCheckTypes',this.echartCheckTypes);
|
||||
console.log('this.echartCategories',this.echartCategories);
|
||||
this.dataListDynamic.forEach((inspection, index) => {
|
||||
console.log('inspection: ', inspection)
|
||||
this.echartCategories.forEach(cate => {
|
||||
// console.log('inspection: ', inspection)
|
||||
this.echartCategories.forEach((cate) => {
|
||||
if (cate in inspection) {
|
||||
result[index].data.push(inspection[cate])
|
||||
} else {
|
||||
@@ -376,7 +370,7 @@ export default {
|
||||
startTime,
|
||||
endTime
|
||||
}
|
||||
}).catch(err => {
|
||||
}).catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
case 'pl':
|
||||
@@ -387,7 +381,7 @@ export default {
|
||||
startTime,
|
||||
endTime
|
||||
}
|
||||
}).catch(err => {
|
||||
}).catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ const topBtnConfig = [
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
width: 100,
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="currentChangeHandle(1)" class="blueTip" size="small">
|
||||
<el-form-item>
|
||||
{{ $t('pl.title') }}
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="dataForm.lineId" :placeholder="$t('pl.title')" clearable filterable>
|
||||
<el-option v-for="pl in plList" :key="pl.value" :value="pl.value" :label="pl.label" />
|
||||
@@ -11,7 +11,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
{{ $t('inspect.det') }}
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" :placeholder="$t('inspect.det')" clearable></el-input>
|
||||
</el-form-item>
|
||||
@@ -22,7 +22,7 @@
|
||||
</el-form>
|
||||
|
||||
<base-table
|
||||
:top-btn-config="topBtnConfig"
|
||||
:top-btn-config="topBtnConfig"
|
||||
:page="pageIndex"
|
||||
:size="pageSize"
|
||||
:data="dataList"
|
||||
@@ -30,8 +30,7 @@
|
||||
:max-height="calcMaxHeight(8)"
|
||||
@operate-event="handleOperations"
|
||||
@refreshDataList="getDataList"
|
||||
@clickTopBtn="clickTopBtn"
|
||||
/>
|
||||
@clickTopBtn="clickTopBtn" />
|
||||
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@@ -40,8 +39,7 @@
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
>
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
@@ -49,10 +47,9 @@
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
:configs="addOrUpdateConfigs"
|
||||
@refreshDataList="getDataList"
|
||||
@refreshDataList="addSuccess"
|
||||
@destory-dialog="handleDestroyDialog"
|
||||
@select-change="handleSelectChange"
|
||||
/>
|
||||
@select-change="handleSelectChange" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -74,6 +71,7 @@ const topBtnConfig = [
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
width: 100,
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
@@ -87,7 +85,7 @@ const tableConfigs = [
|
||||
// { prop: 'productionId', name: i18n.t('pl.id') },
|
||||
// { prop: 'sectionId', name: i18n.t('ws.id') },
|
||||
{ prop: 'checkPerson', name: i18n.t('inspect.people') },
|
||||
{ prop: 'source', name: i18n.t('source'), filter: val => ({ 1: i18n.t('manual'), 2: i18n.t('auto') }[val]) },
|
||||
{ prop: 'source', name: i18n.t('source'), filter: (val) => ({ 1: i18n.t('manual'), 2: i18n.t('auto') }[val]) },
|
||||
{ prop: 'explainText', name: i18n.t('desc') },
|
||||
{ prop: 'remark', name: i18n.t('remark') },
|
||||
{ prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
|
||||
@@ -98,8 +96,23 @@ const addOrUpdateConfigs = {
|
||||
infoUrl: '/monitoring/qualityInspectionRecord',
|
||||
fields: [
|
||||
{ name: 'checkTime', required: true, label: i18n.t('inspect.time'), type: 'date', props: { style: 'width: 100%', type: 'datetime' }, placeholder: i18n.t('hints.checktime') },
|
||||
// {
|
||||
// name: 'checkTime',
|
||||
// required: true,
|
||||
// label: i18n.t('inspect.time'),
|
||||
// type: 'date',
|
||||
// props: {
|
||||
// 'type': 'date', // element-ui 的配置
|
||||
// 'placeholder': i18n.t('hints.date'),
|
||||
// 'value-format': 'yyyy-MM-ddTHH:mm:ss',
|
||||
// 'style': {
|
||||
// width: '100%'
|
||||
// }
|
||||
// },
|
||||
// placeholder: i18n.t('hints.checktime')
|
||||
// },
|
||||
{ name: 'productionId', required: true, label: i18n.t('pl.title'), type: 'select', options: [] },
|
||||
{ name: 'sectionId', required: true, label: i18n.t('ws.title'), type: 'select', options: [] },
|
||||
{ name: 'sectionId', required: true, label: i18n.t('ws.title'), type: 'select', options: [], isDisabled: true },
|
||||
{
|
||||
name: 'source',
|
||||
label: i18n.t('source'),
|
||||
@@ -155,16 +168,29 @@ export default {
|
||||
methods: {
|
||||
// destroy dialog
|
||||
handleDestroyDialog() {
|
||||
this.$set(this.addOrUpdateConfigs.fields[2], 'isDisabled', true)
|
||||
setTimeout(() => {
|
||||
this.addOrUpdateVisible = false
|
||||
}, /** after dialog animated */ 200)
|
||||
},
|
||||
// handle
|
||||
async handleSelectChange({ name, id }) {
|
||||
// console.log('this',this)
|
||||
if (name === 'productionId') {
|
||||
// 如果选择了产线,就依据此更新工单的选项
|
||||
if (id) {
|
||||
this.$set(this.addOrUpdateConfigs.fields[2], 'isDisabled', false)
|
||||
} else {
|
||||
this.$set(this.addOrUpdateConfigs.fields[2], 'isDisabled', true)
|
||||
}
|
||||
await this.getWorkSections(id)
|
||||
}
|
||||
if (name === 'sectionId') {
|
||||
// 如果选择了产线,就依据此更新工单的选项
|
||||
// console.log('nihao',id);
|
||||
// console.log('nihao2',this.addOrUpdateConfigs.fields[1].options == []);
|
||||
// console.log('nihao2',this.addOrUpdateConfigs.fields[1].options );
|
||||
}
|
||||
},
|
||||
// 获取检测内容
|
||||
getInspectionDet() {
|
||||
@@ -172,15 +198,17 @@ export default {
|
||||
url: this.$http.adornUrl('/monitoring/qualityInspectionDet/page'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
page: this.pageIndex,
|
||||
limit: this.pageSize,
|
||||
key: this.dataForm.key
|
||||
// page: this.pageIndex,
|
||||
// limit: this.pageSize,
|
||||
// key: this.dataForm.key
|
||||
page: 1,
|
||||
limit: 9999999
|
||||
})
|
||||
}).then(({ data: res }) => {
|
||||
console.log('insdet:', res)
|
||||
const insDetOpt = this.addOrUpdateConfigs.fields.find(item => item.name === 'inspectionDetId')
|
||||
const insDetOpt = this.addOrUpdateConfigs.fields.find((item) => item.name === 'inspectionDetId')
|
||||
if (insDetOpt) {
|
||||
insDetOpt.options = res.data.list.map(item => ({ value: item.id, label: item.content })) || []
|
||||
insDetOpt.options = res.data.list.map((item) => ({ value: item.id, label: item.content })) || []
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -190,11 +218,11 @@ export default {
|
||||
url: this.$http.adornUrl('/monitoring/productionLine/list'),
|
||||
method: 'get'
|
||||
}).then(({ data: res }) => {
|
||||
const plOpt = this.addOrUpdateConfigs.fields.find(item => item.name === 'productionId')
|
||||
const plOpt = this.addOrUpdateConfigs.fields.find((item) => item.name === 'productionId')
|
||||
if (plOpt) {
|
||||
plOpt.options = res.data.map(item => ({ value: item.id, label: item.name })) || []
|
||||
plOpt.options = res.data.map((item) => ({ value: item.id, label: item.name })) || []
|
||||
}
|
||||
this.plList = res.data.map(item => ({ value: item.id, label: item.name })) || []
|
||||
this.plList = res.data.map((item) => ({ value: item.id, label: item.name })) || []
|
||||
})
|
||||
},
|
||||
// 获取工段
|
||||
@@ -215,15 +243,23 @@ export default {
|
||||
if (res.data.total === 0) {
|
||||
this.$message.error(i18n.t('errors.nosection'))
|
||||
} else {
|
||||
// console.log('da',this.dataForm);
|
||||
this.$message.success(i18n.t('errors.numsection', { num: res.data.total }))
|
||||
}
|
||||
}
|
||||
const wsOpt = this.addOrUpdateConfigs.fields.find(item => item.name === 'sectionId')
|
||||
const wsOpt = this.addOrUpdateConfigs.fields.find((item) => item.name === 'sectionId')
|
||||
// const wsOpt2 = this.addOrUpdateConfigs.fields.find((item) => item.name === 'productionId')
|
||||
// console.log('wsOpt',wsOpt);
|
||||
if (wsOpt) {
|
||||
wsOpt.options = res.data.list.map(item => ({ value: item.id, label: item.name })) || []
|
||||
wsOpt.options = res.data.list.map((item) => ({ value: item.id, label: item.name })) || []
|
||||
}
|
||||
})
|
||||
},
|
||||
addSuccess() {
|
||||
this.getDataList()
|
||||
this.$set(this.addOrUpdateConfigs.fields[2], 'options', [])
|
||||
this.$set(this.addOrUpdateConfigs.fields[2], 'isDisabled', true)
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.addOrUpdateVisible = false
|
||||
@@ -245,6 +281,7 @@ export default {
|
||||
method: 'get',
|
||||
params: this.$http.adornParams(queryParams)
|
||||
}).then(({ data }) => {
|
||||
// console.log('data', data)
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.data.list
|
||||
this.totalPage = data.data.total
|
||||
@@ -295,7 +332,7 @@ export default {
|
||||
deleteHandle(id) {
|
||||
var ids = id
|
||||
? [id]
|
||||
: this.dataListSelections.map(item => {
|
||||
: this.dataListSelections.map((item) => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`${i18n.t('prompt.info', { handle: id ? i18n.t('delete').toLowerCase() : i18n.t('deleteBatch').toLowerCase() })}`, i18n.t('prompt.title'), {
|
||||
|
||||
@@ -57,6 +57,7 @@ const topBtnConfig = [
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
width: 100,
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
* @Author: lb
|
||||
* @Date: 2022-06-22 14:00:17
|
||||
* @LastEditors: fzq
|
||||
* @LastEditTime: 2023-01-03 10:18:14
|
||||
* @LastEditTime: 2023-02-09 09:36:38
|
||||
* @Description: 设备生产实时数据
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<div class="app-container">
|
||||
<small-title :size="'md'">{{ $t('realtime.eq') }}</small-title>
|
||||
<base-table v-if="loadTable" :table-head-configs="tableProps" :data="tableData.length ? tableData : []" :span-method="spanMethod" />
|
||||
<base-table v-if="loadTable" :table-head-configs="tableProps" :data="tableData.length ? tableData : []" :span-method="spanMethod"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -59,7 +59,7 @@ export default {
|
||||
}
|
||||
})
|
||||
}, 1000 * 60 * 5)
|
||||
console.log(this.tableProps)
|
||||
// console.log(this.tableProps)
|
||||
},
|
||||
// beforeDestroy() {
|
||||
// console.log('before destroyed...')
|
||||
@@ -130,7 +130,7 @@ export default {
|
||||
if (obj.recordTime) {
|
||||
// 如果 obj.recordTime 是有效的
|
||||
this.tableProps.push({
|
||||
label: moment(obj.recordTime).format('YYYY-MM-DD HH:mm:ss'),
|
||||
label: moment(obj.recordTime).format('YYYY-MM-DD HH')+ moment(obj.recordTime).add(1,'hours').format('-HH')+i18n.t('hourTime'),
|
||||
children: [
|
||||
{ prop: obj.recordTime + '-inputNum', label: i18n.t('realtime.in') },
|
||||
{ prop: obj.recordTime + '-outputNum', label: i18n.t('realtime.out') },
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<!--
|
||||
* @Author: lb
|
||||
* @Date: 2022-06-22 14:00:17
|
||||
* @LastEditors: lb
|
||||
* @LastEditTime: 2022-06-22 14:00:17
|
||||
* @LastEditors: fzq
|
||||
* @LastEditTime: 2023-02-09 09:53:57
|
||||
* @Description: 产线生产实时数据
|
||||
-->
|
||||
<template>
|
||||
@@ -38,13 +38,26 @@ export default {
|
||||
},
|
||||
|
||||
mounted() {
|
||||
// console.log('this.$route', this.$route)
|
||||
this.clearData()
|
||||
this.fetchList().then(({ data: res }) => {
|
||||
// console.log('fetchlist:', res)
|
||||
this.testData = res
|
||||
this.handleData()
|
||||
console.log('res', res)
|
||||
let loading = this.$loading({
|
||||
lock: true, //lock的修改符--默认是false
|
||||
text: this.$t('loading'), //显示在加载图标下方的加载文案
|
||||
background: 'rgba(0,0,0,0.8)', //遮罩层颜色
|
||||
spinner: 'el-icon-loading' //自定义加载图标类名
|
||||
})
|
||||
console.log('testData:', this.testData)
|
||||
if (this.testData || this.$route.fullPath !== '/monitoring-realtimeProductLine') {
|
||||
// 获取数据显示成功后,关闭loading
|
||||
loading.close()
|
||||
} else {
|
||||
this.$message.error(this.$t('err'))
|
||||
}
|
||||
})
|
||||
|
||||
this.intervalId = setInterval(() => {
|
||||
this.$message({
|
||||
message: this.$t('realtime.refresh'),
|
||||
@@ -63,6 +76,9 @@ export default {
|
||||
deactivated() {
|
||||
if (this.intervalId) clearInterval(this.intervalId)
|
||||
},
|
||||
created() {
|
||||
// console.log('this.tableData', this.tableData)
|
||||
},
|
||||
|
||||
methods: {
|
||||
fetchList() {
|
||||
@@ -97,7 +113,7 @@ export default {
|
||||
expandDataStepOne() {
|
||||
// 扩展服务器返回的数据第一阶段
|
||||
// console.log('create new one')
|
||||
this.tableData = this.testData.data.map(item => {
|
||||
this.tableData = this.testData.data.map((item) => {
|
||||
const newItem = {
|
||||
lineName: item.lineName,
|
||||
orderName: item.orderName,
|
||||
@@ -105,14 +121,14 @@ export default {
|
||||
}
|
||||
|
||||
if (item.det) {
|
||||
item.det.forEach(obj => {
|
||||
item.det.forEach((obj) => {
|
||||
// Step2: 设置动态props
|
||||
if (!this.dynamicPropSet) {
|
||||
this.tableProps.push({
|
||||
label: moment(obj.recordTime).format('YYYY-MM-DD HH:mm:ss'),
|
||||
label: moment(obj.recordTime).format('YYYY-MM-DD HH') + moment(obj.recordTime).add(1, 'hours').format('-HH') + i18n.t('hourTime'),
|
||||
children: [
|
||||
{ prop: obj.recordTime + '-inputNum', label: i18n.t('realtime.in') },
|
||||
{ prop: obj.recordTime + '-outputNum', label: i18n.t('realtime.out') },
|
||||
{ prop: obj.recordTime + '-outputNum', label: i18n.t('realtime.out') }
|
||||
// { prop: obj.recordTime + '-passArea', label: i18n.t('realtime.goodrate') },
|
||||
// { prop: obj.recordTime + '-scrapNum', label: i18n.t('realtime.num') },
|
||||
// { prop: obj.recordTime + '-scrapRate', label: i18n.t('realtime.rate') }
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
<div>
|
||||
<div class="app-container">
|
||||
<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>
|
||||
</template>
|
||||
@@ -82,7 +83,7 @@ export default {
|
||||
this.initProps()
|
||||
// console.log('props ===> ', this.tableProps)
|
||||
this.initData()
|
||||
// console.log('datas ===> ', this.tableData)
|
||||
console.log('datas ===> ', this.tableData)
|
||||
this.loadTable = true
|
||||
},
|
||||
|
||||
@@ -138,14 +139,14 @@ export default {
|
||||
// 保存为 props
|
||||
for (const key of sortedTime) {
|
||||
// const prop = { label: key, children: [] }
|
||||
const prop = { label: moment(key).format('YYYY-MM-DD HH:mm:ss'), children: [] }
|
||||
const prop = { label: moment(key).format('YYYY-MM-DD HH')+ moment(key).add(1,'hours').format('-HH')+i18n.t('hourTime'), children: [] }
|
||||
for (const subKey in timeMap[key]) {
|
||||
prop.children.push({ label: subKey, prop: key + subKey })
|
||||
}
|
||||
dynamicPropNames.push(prop)
|
||||
}
|
||||
|
||||
return [{ prop: 'checkType', label: i18n.t('inspect.type'), isFixed: true }, ...dynamicPropNames]
|
||||
// isFixed: true
|
||||
return [{ prop: 'checkType', label: i18n.t('inspect.det'), fixed: true }, ...dynamicPropNames]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ const topBtnConfig = [
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
width: 100,
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
|
||||
<el-form-item label="分类:关联report_sheet_category" prop="category">
|
||||
<el-input v-model="dataForm.category" placeholder="分类:关联report_sheet_category"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
|
||||
<el-form-item label="编码" prop="code">
|
||||
<el-input v-model="dataForm.code" placeholder="编码"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
|
||||
<el-form-item label="文件类型编号" prop="typeCode">
|
||||
<el-input v-model="dataForm.typeCode" placeholder="文件类型编号"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
|
||||
<el-form-item label="文件类型编号" prop="typeCode">
|
||||
<el-input v-model="dataForm.typeCode" placeholder="文件类型编号"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
@@ -58,6 +58,7 @@ const topBtnConfig = [
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
width: 100,
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
@@ -75,7 +76,7 @@ const addOrUpdateConfigs = {
|
||||
fields: [
|
||||
{ name: 'name', required: true, label: i18n.t('ws.name') },
|
||||
{ name: 'code', required: true, label: i18n.t('ws.code'), api: '/monitoring/workshopSection/getCode' },
|
||||
{ name: 'productionLineId', label: i18n.t('ws.belong'), type: 'select', options: [] },
|
||||
{ name: 'productionLineId', required: true, label: i18n.t('ws.belong'), type: 'select', options: [] },
|
||||
'description',
|
||||
'remark'
|
||||
],
|
||||
|
||||
@@ -4,9 +4,8 @@
|
||||
:title="isDetail ? $t('ws.detail') : !dataForm.id ? $t('add') : $t('edit')"
|
||||
:visible.sync="visible"
|
||||
:close-on-click-modal="false"
|
||||
:destroy-on-close="true"
|
||||
>
|
||||
<div style="max-height: 60vh; overflow-y: scroll; overflow-x: hidden;">
|
||||
:destroy-on-close="true">
|
||||
<div style="max-height: 60vh; overflow-y: scroll; overflow-x: hidden">
|
||||
<el-form ref="dataForm" :model="dataForm" :rules="dataFormRules">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12"
|
||||
@@ -20,7 +19,7 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12"
|
||||
><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-select> </el-form-item
|
||||
></el-col>
|
||||
@@ -49,8 +48,7 @@
|
||||
:table-head-configs="tableProps"
|
||||
:max-height="calcMaxHeight(8)"
|
||||
@operate-event="handleOperations"
|
||||
@refreshDataList="getDataList"
|
||||
/>
|
||||
@refreshDataList="getDataList" />
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
@@ -58,16 +56,31 @@
|
||||
:page-sizes="[5, 10, 15, 20]"
|
||||
:page-size="limit"
|
||||
:total="eqTotal"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
/>
|
||||
layout="total, sizes, prev, pager, next, jumper" />
|
||||
</div>
|
||||
<attr-form v-else ref="AttrFrom" :workshop-section-id="dataForm.id" @close-attr-form="showAttrForm = false" @refresh-list="handleRefreshList" />
|
||||
</section>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleClick({ name: 'cancel' })">{{ $t('cancel') }}</el-button>
|
||||
<el-button type="primary" v-if="dataForm.id" @click="handleClick({ name: 'update' })">{{ $t('update') }}</el-button>
|
||||
<el-button type="success" v-else @click="handleClick({ name: 'save' })">{{ $t('save') }}</el-button>
|
||||
<el-button
|
||||
:style="{
|
||||
backgroundColor: '#0b58ff',
|
||||
color: '#fff'
|
||||
}"
|
||||
v-if="dataForm.id"
|
||||
@click="handleClick({ name: 'update' })"
|
||||
>{{ $t('update') }}</el-button
|
||||
>
|
||||
<el-button
|
||||
:style="{
|
||||
backgroundColor: '#0b58ff',
|
||||
color: '#fff'
|
||||
}"
|
||||
v-else
|
||||
@click="handleClick({ name: 'save' })"
|
||||
>{{ $t('save') }}</el-button
|
||||
>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -83,6 +96,7 @@ import { calcMaxHeight } from '@/utils'
|
||||
const tableProps = [
|
||||
{
|
||||
type: 'index',
|
||||
width: 100,
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ name: i18n.t('eq.name'), prop: 'equipmentName' },
|
||||
@@ -124,7 +138,8 @@ export default {
|
||||
},
|
||||
dataFormRules: {
|
||||
name: [{ required: true, message: i18n.t('validate.required'), trigger: 'blur' }],
|
||||
code: [{ required: true, message: i18n.t('validate.required'), trigger: 'blur' }]
|
||||
code: [{ required: true, message: i18n.t('validate.required'), trigger: 'blur' }],
|
||||
productionLineId: [{ required: true, message: i18n.t('validate.required'), trigger: 'blur' }]
|
||||
},
|
||||
limit: 5,
|
||||
page: 1,
|
||||
@@ -290,7 +305,7 @@ export default {
|
||||
}
|
||||
},
|
||||
handleCreateOrUpdate() {
|
||||
this.$refs['dataForm'].validate(valid => {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/workshopSection'),
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<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-select>
|
||||
<el-input v-else disabled v-model="bindedEquipmentName" /> </el-form-item
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? i18n.t('add') : i18n.t('update')" :close-on-click-modal="false" :visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="170px">
|
||||
<el-form-item label="工段ID" prop="workshopSectionId">
|
||||
<el-input v-model="dataForm.workshopSectionId" placeholder="工段ID"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="visible" :title="$t('oss.config')" :close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="170px">
|
||||
<el-form-item :label="$t('oss.type')" size="mini">
|
||||
<el-radio-group v-model="dataForm.type">
|
||||
<el-radio :label="1">{{ $t('oss.type1') }}</el-radio>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="170px">
|
||||
<el-form-item prop="name" :label="$t('dept.name')">
|
||||
<el-input v-model="dataForm.name" :placeholder="$t('dept.name')"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="170px">
|
||||
<el-form-item prop="dictValue" :label="$t('dict.dictValue')">
|
||||
<el-input v-model="dataForm.dictValue" :placeholder="$t('dict.dictValue')"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="170px">
|
||||
<el-form-item prop="dictName" :label="$t('dict.dictName')">
|
||||
<el-input v-model="dataForm.dictName" :placeholder="$t('dict.dictName')"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
<el-form-item>
|
||||
<el-button class="buttonColor" @click="getDataList()">{{ $t('query') }}</el-button>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:dict:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
|
||||
</el-form-item> -->
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:dict:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="showIcons()">所有图标</el-button>
|
||||
<el-button @click="showIcons()">{{ $t('allIcons') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- border
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* @Author: fzq
|
||||
* @Date: 2022-11-25 09:51:46
|
||||
* @LastEditors: fzq
|
||||
* @LastEditTime: 2023-01-13 08:59:37
|
||||
* @LastEditTime: 2023-02-08 16:18:20
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
@@ -81,6 +81,35 @@ export default {
|
||||
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>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* @Author: fzq
|
||||
* @Date: 2022-11-25 09:51:46
|
||||
* @LastEditors: fzq
|
||||
* @LastEditTime: 2023-01-13 09:01:16
|
||||
* @LastEditTime: 2023-02-08 16:19:16
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
@@ -81,6 +81,35 @@ export default {
|
||||
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>
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="170px">
|
||||
<el-form-item prop="type" :label="$t('menu.type')" size="mini">
|
||||
<el-radio-group v-model="dataForm.type" :disabled="!!dataForm.id">
|
||||
<el-radio :label="0">{{ $t('menu.type0') }}</el-radio>
|
||||
<el-radio :label="1">{{ $t('menu.type1') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</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-input v-model="dataForm.name" :placeholder="$t('menu.name')"></el-input>
|
||||
</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-tree
|
||||
v-if="$i18n.locale == 'zh-CN'"
|
||||
:data="menuList"
|
||||
:props="{ label: 'name', children: 'children' }"
|
||||
node-key="id"
|
||||
@@ -20,11 +24,24 @@
|
||||
:highlight-current="true"
|
||||
:expand-on-click-node="false"
|
||||
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-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>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
@@ -72,8 +89,10 @@ export default {
|
||||
id: '',
|
||||
type: 0,
|
||||
name: '',
|
||||
nameEn: '',
|
||||
pid: '0',
|
||||
parentName: '',
|
||||
parentNameEn: '',
|
||||
url: '',
|
||||
permissions: '',
|
||||
sort: 0,
|
||||
@@ -85,6 +104,7 @@ export default {
|
||||
dataRule() {
|
||||
return {
|
||||
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' }]
|
||||
}
|
||||
}
|
||||
@@ -98,8 +118,8 @@ export default {
|
||||
// destroy dialog
|
||||
handleDestroyDialog() {
|
||||
setTimeout(() => {
|
||||
this.addOrUpdateVisible= false
|
||||
}, /** after dialog animated */ 200);
|
||||
this.addOrUpdateVisible = false
|
||||
}, /** after dialog animated */ 200)
|
||||
},
|
||||
init() {
|
||||
this.visible = true
|
||||
@@ -138,6 +158,7 @@ export default {
|
||||
...this.dataForm,
|
||||
...res.data
|
||||
}
|
||||
// console.log('/sys/menu/', this.dataForm)
|
||||
if (this.dataForm.pid === '0') {
|
||||
return this.deptListTreeSetDefaultHandle()
|
||||
}
|
||||
@@ -153,7 +174,12 @@ export default {
|
||||
// 上级菜单树, 选中
|
||||
menuListTreeCurrentChangeHandle(data) {
|
||||
this.dataForm.pid = data.id
|
||||
this.dataForm.parentName = data.name
|
||||
if (this.$i18n.locale == 'zh-CN') {
|
||||
this.dataForm.parentName = data.name
|
||||
}
|
||||
if (this.$i18n.locale == 'en') {
|
||||
this.dataForm.parentNameEn = data.nameEn
|
||||
}
|
||||
this.menuListVisible = false
|
||||
},
|
||||
// 图标, 选中
|
||||
@@ -163,11 +189,12 @@ export default {
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmitHandle: debounce(
|
||||
function() {
|
||||
this.$refs['dataForm'].validate(valid => {
|
||||
function () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
console.log('this.dataForm', this.dataForm)
|
||||
this.$http[!this.dataForm.id ? 'post' : 'put'](this.$http.adornUrl('/sys/menu'), this.dataForm)
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* @Author: fzq
|
||||
* @Date: 2022-11-25 09:51:46
|
||||
* @LastEditors: fzq
|
||||
* @LastEditTime: 2023-01-13 09:06:03
|
||||
* @LastEditTime: 2023-02-08 10:06:36
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
@@ -15,7 +15,8 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<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">
|
||||
<template slot-scope="scope">
|
||||
<svg class="icon-svg" aria-hidden="true"><use :xlink:href="`#${scope.row.icon}`"></use></svg>
|
||||
@@ -58,6 +59,10 @@ export default {
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
created(){
|
||||
// console.log('mixinViewModuleOptions',this.mixinViewModuleOptions);
|
||||
// console.log('this.$i18n.locale',this.$i18n.locale);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="170px">
|
||||
<el-form-item prop="paramCode" :label="$t('params.paramCode')">
|
||||
<el-input v-model="dataForm.paramCode" :placeholder="$t('params.paramCode')"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="170px">
|
||||
<el-form-item prop="name" :label="$t('role.name')">
|
||||
<el-input v-model="dataForm.name" :placeholder="$t('role.name')"></el-input>
|
||||
</el-form-item>
|
||||
@@ -10,7 +10,11 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<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-col>
|
||||
<el-col :span="12">
|
||||
@@ -55,8 +59,8 @@ export default {
|
||||
// destroy dialog
|
||||
handleDestroyDialog() {
|
||||
setTimeout(() => {
|
||||
this.addOrUpdateVisible= false
|
||||
}, /** after dialog animated */ 200);
|
||||
this.addOrUpdateVisible = false
|
||||
}, /** after dialog animated */ 200)
|
||||
},
|
||||
init() {
|
||||
this.visible = true
|
||||
@@ -79,7 +83,9 @@ export default {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
console.log('res.data', res.data)
|
||||
this.menuList = res.data
|
||||
console.log('this.menuList', this.menuList)
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
@@ -92,6 +98,7 @@ export default {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.deptList = res.data
|
||||
console.log('this.deptList', this.deptList)
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
@@ -107,15 +114,15 @@ export default {
|
||||
...this.dataForm,
|
||||
...res.data
|
||||
}
|
||||
this.dataForm.menuIdList.forEach(item => this.$refs.menuListTree.setChecked(item, true))
|
||||
this.dataForm.menuIdList.forEach((item) => this.$refs.menuListTree.setChecked(item, true))
|
||||
this.$refs.deptListTree.setCheckedKeys(this.dataForm.deptIdList)
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmitHandle: debounce(
|
||||
function() {
|
||||
this.$refs['dataForm'].validate(valid => {
|
||||
function () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="170px">
|
||||
<el-form-item prop="username" :label="$t('user.username')">
|
||||
<el-input v-model="dataForm.username" :placeholder="$t('user.username')"></el-input>
|
||||
</el-form-item>
|
||||
@@ -18,6 +18,11 @@
|
||||
</el-form-item>
|
||||
<el-form-item prop="gender" :label="$t('user.gender')">
|
||||
<ren-radio-group v-model="dataForm.gender" dict-type="gender"></ren-radio-group>
|
||||
<!-- <el-radio-group v-model="dataForm.gender">
|
||||
<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 prop="email" :label="$t('user.email')">
|
||||
<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-form-item>
|
||||
<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-select>
|
||||
</el-form-item>
|
||||
@@ -66,7 +71,8 @@ export default {
|
||||
mobile: '',
|
||||
roleIdList: [],
|
||||
status: 1
|
||||
}
|
||||
},
|
||||
radio: '1'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -105,8 +111,9 @@ export default {
|
||||
confirmPassword: [{ validator: validateConfirmPassword, trigger: 'blur' }],
|
||||
realName: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
email: [{ validator: validateEmail, trigger: 'blur' }],
|
||||
mobile: [{ validator: validateMobile, trigger: 'blur' }],
|
||||
roleIdList: [{ required: true, message: '至少选择一个角色', trigger: 'change' }]
|
||||
// 解除手机号输入限制
|
||||
// mobile: [{ validator: validateMobile, trigger: 'blur' }],
|
||||
roleIdList: [{ required: true, message: this.$t('validate.requiredRole'), trigger: 'change' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -114,8 +121,8 @@ export default {
|
||||
// destroy dialog
|
||||
handleDestroyDialog() {
|
||||
setTimeout(() => {
|
||||
this.addOrUpdateVisible= false
|
||||
}, /** after dialog animated */ 200);
|
||||
this.addOrUpdateVisible = false
|
||||
}, /** after dialog animated */ 200)
|
||||
},
|
||||
init() {
|
||||
this.visible = true
|
||||
@@ -157,7 +164,7 @@ export default {
|
||||
}
|
||||
// 角色配置, 区分是否为默认角色
|
||||
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])
|
||||
continue
|
||||
}
|
||||
@@ -168,8 +175,8 @@ export default {
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmitHandle: debounce(
|
||||
function() {
|
||||
this.$refs['dataForm'].validate(valid => {
|
||||
function () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* @Author: fzq
|
||||
* @Date: 2022-11-25 09:51:46
|
||||
* @LastEditors: fzq
|
||||
* @LastEditTime: 2023-01-13 09:06:52
|
||||
* @LastEditTime: 2023-02-13 16:29:14
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
@@ -20,13 +20,16 @@
|
||||
{{ $t('user.gender') }}
|
||||
</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>
|
||||
{{ $t('dept.title') }}
|
||||
</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-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-form-item>
|
||||
</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 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>
|
||||
@@ -58,7 +61,7 @@
|
||||
<el-tag v-else size="small" type="success">{{ $t('user.status1') }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createDate" :label="$t('user.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
|
||||
<!-- <el-table-column prop="createDate" :label="$t('user.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column> -->
|
||||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="$hasPermission('sys:user:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
|
||||
@@ -73,8 +76,7 @@
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="pageSizeChangeHandle"
|
||||
@current-change="pageCurrentChangeHandle"
|
||||
>
|
||||
@current-change="pageCurrentChangeHandle">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
@@ -100,7 +102,54 @@ export default {
|
||||
username: '',
|
||||
deptId: '',
|
||||
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: {
|
||||
|
||||
Reference in New Issue
Block a user