From 9eeb740c2e819bfeff98add73c60f4c50982b287 Mon Sep 17 00:00:00 2001
From: juzi <819872918@qq.com>
Date: Fri, 10 Feb 2023 17:14:06 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E8=AE=BE=E5=A4=87OEE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.development | 2 +-
.env.production | 2 +-
src/api/deviceManagement.js | 14 ++
.../reportManagement/reportDesign.vue | 5 +-
.../components/deviceOeeLine.vue | 58 ++++++-
.../components/productPowerEdit.vue | 148 +++++++++++++-----
.../performanceAnalysis/devicePage.vue | 144 +++++++++++------
vue.config.js | 2 +-
8 files changed, 277 insertions(+), 98 deletions(-)
diff --git a/.env.development b/.env.development
index 7471996..571c208 100644
--- a/.env.development
+++ b/.env.development
@@ -5,4 +5,4 @@ ENV = 'development'
# 这里修改成api服务器地址
VUE_APP_BASE_API = '/api'
VUE_APP_VIEW_PIC = 'http://tft.mes.picaiba.com/api/common/attachment/downloadFile?type=0&attachmentId='
-VUE_APP_REPORT_DESIGN_URL = 'http://hfxny.mes.picaiba.com/ureport/designer'
\ No newline at end of file
+VUE_APP_REPORT_DESIGN_URL = 'http://tft.mes.picaiba.com/ureport/designer'
\ No newline at end of file
diff --git a/.env.production b/.env.production
index 7a3d5ab..a00ff93 100644
--- a/.env.production
+++ b/.env.production
@@ -5,4 +5,4 @@ ENV = 'production'
# 这里修改成api服务器地址
VUE_APP_BASE_API = '/api'
VUE_APP_VIEW_PIC = 'http://tft.mes.picaiba.com/api/common/attachment/downloadFile?type=0&attachmentId='
-VUE_APP_REPORT_DESIGN_URL = 'http://hfxny.mes.picaiba.com/ureport/designer'
\ No newline at end of file
+VUE_APP_REPORT_DESIGN_URL = 'http://tft.mes.picaiba.com/ureport/designer'
\ No newline at end of file
diff --git a/src/api/deviceManagement.js b/src/api/deviceManagement.js
index 7954bd5..28455af 100644
--- a/src/api/deviceManagement.js
+++ b/src/api/deviceManagement.js
@@ -16,6 +16,13 @@ export function performanceAnalysisPlan(data) {
data
})
}
+export function performanceUpdatePlan(data) {
+ return request({
+ url: '/equipment/PerformanceAnalysis/updatePlan',
+ method: 'post',
+ data
+ })
+}
// 托盘指标分析
export function palletIndicatorAnalysisPage(data) {
return request({
@@ -24,6 +31,13 @@ export function palletIndicatorAnalysisPage(data) {
data
})
}
+export function palletIndicatorGetType(data) {
+ return request({
+ url: '/equipment/PalletIndicatorAnalysis/getType',
+ method: 'post',
+ data
+ })
+}
// 托盘指标分析
export function palletIndicatorAnalysisType(data) {
diff --git a/src/views/basicConfig/reportManagement/reportDesign.vue b/src/views/basicConfig/reportManagement/reportDesign.vue
index 86e5e95..ae6a2a4 100644
--- a/src/views/basicConfig/reportManagement/reportDesign.vue
+++ b/src/views/basicConfig/reportManagement/reportDesign.vue
@@ -8,10 +8,7 @@ export default {
name: 'ReportDesign',
data() {
return {
- // url: ''
- // url: process.env.VUE_APP_REPORT_DESIGN_URL
- // url: 'http://hfxny.mes.picaiba.com/ureport/designer'
- url: 'http://tft.mes.picaiba.com/ureport/designer'
+ url: process.env.VUE_APP_REPORT_DESIGN_URL
}
},
mounted() {
diff --git a/src/views/deviceManagement/components/deviceOeeLine.vue b/src/views/deviceManagement/components/deviceOeeLine.vue
index cff2f7a..3149c2d 100644
--- a/src/views/deviceManagement/components/deviceOeeLine.vue
+++ b/src/views/deviceManagement/components/deviceOeeLine.vue
@@ -14,6 +14,15 @@ import resize from '@/utils/chartMixins/resize'
export default {
name: 'deviceOeeLine',
mixins: [resize],
+ props: {
+ chartMsg: {
+ type: Array,
+ required: true,
+ default: () => {
+ return []
+ }
+ }
+ },
data() {
return {
chartDom: '',
@@ -22,15 +31,48 @@ export default {
}
},
mounted() {
- this.chartDom = document.getElementById('main')
- this.chart = echarts.init(this.chartDom)
- this.getChart()
+ this.$nextTick(() => {
+ this.getChart()
+ })
window.addEventListener('resize', () => {
this.chartHeight = tableHeight(214) / 2 - 35
})
},
+ watch: {
+ chartMsg: function () {
+ this.getChart()
+ }
+ },
+ beforeDestroy() {
+ if (!this.chart) {
+ return
+ }
+ this.chart.dispose()
+ this.chart = null
+ },
methods: {
getChart() {
+ if (
+ this.chart !== null &&
+ this.chart !== '' &&
+ this.chart !== undefined
+ ) {
+ this.chart.dispose() // 页面多次刷新会出现警告,Dom已经初始化了一个实例,这是销毁实例
+ }
+ this.chartDom = document.getElementById('main')
+ this.chart = echarts.init(this.chartDom)
+ let dateList = []
+ let activationList = []
+ let performanceList = []
+ let failurePercentList = []
+ let combinedEfficiencyList = []
+ for (let i = 0; i < this.chartMsg.length; i++) {
+ dateList.push(new Date(this.chartMsg[i].date).getDate())
+ activationList.push(this.chartMsg[i].activation)
+ performanceList.push(this.chartMsg[i].performance)
+ failurePercentList.push(this.chartMsg[i].failurePercent)
+ combinedEfficiencyList.push(this.chartMsg[i].combinedEfficiency)
+ }
var option = {
color: ['#5B8FF9', '#5AD8A6', '#5D7092', '#F6BD16'],
tooltip: {
@@ -49,7 +91,7 @@ export default {
xAxis: {
type: 'category',
boundaryGap: false,
- data: ['1', '2', '3', '4', '5', '6', '7']
+ data: dateList
},
yAxis: {
type: 'value'
@@ -59,25 +101,25 @@ export default {
name: '时间开动率',
type: 'line',
stack: 'Total',
- data: [120, 132, 101, 134, 90, 230, 210]
+ data: activationList
},
{
name: '性能开动率',
type: 'line',
stack: 'Total',
- data: [220, 182, 191, 234, 290, 330, 310]
+ data: performanceList
},
{
name: '设备故障率',
type: 'line',
stack: 'Total',
- data: [150, 232, 201, 154, 190, 330, 410]
+ data: failurePercentList
},
{
name: '综合效率',
type: 'line',
stack: 'Total',
- data: [320, 332, 301, 334, 390, 330, 320]
+ data: combinedEfficiencyList
}
]
}
diff --git a/src/views/deviceManagement/components/productPowerEdit.vue b/src/views/deviceManagement/components/productPowerEdit.vue
index 033b343..4ff5227 100644
--- a/src/views/deviceManagement/components/productPowerEdit.vue
+++ b/src/views/deviceManagement/components/productPowerEdit.vue
@@ -1,98 +1,168 @@
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
@@ -268,7 +320,11 @@ export default {
.main-box {
width: 100%;
padding: 0px 6px 0 16px;
- .left-box,
+ .left-box {
+ padding-top: 16px;
+ border-radius: 8px;
+ background-color: #fff;
+ }
.top-left,
.top-right,
.right-bottom {
diff --git a/vue.config.js b/vue.config.js
index 28ea7e6..68c3051 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -11,7 +11,7 @@ module.exports = defineConfig({
proxy: {
'/api': {
target: 'http://tft.mes.picaiba.com/api',
- // target: 'http://192.168.1.94:8080/api',
+ // target: 'http://192.168.1.22:8080/api',
ws: true,
changeOrigin: true,
pathRewrite: {
From 16d7c0c4adee9a7e1ee313538b28c45b4c8c1412 Mon Sep 17 00:00:00 2001
From: juzi <819872918@qq.com>
Date: Mon, 13 Feb 2023 17:24:54 +0800
Subject: [PATCH 2/2] 2.13
---
src/api/deviceManagement.js | 9 --
.../basicConfig/components/accountAdd.vue | 2 +-
.../inAndOutManagement.vue | 7 +
.../performanceAnalysis/analysisOfPallet.vue | 7 +-
.../particleLineChart.vue | 130 +++++++++++++-----
5 files changed, 108 insertions(+), 47 deletions(-)
diff --git a/src/api/deviceManagement.js b/src/api/deviceManagement.js
index 28455af..851996d 100644
--- a/src/api/deviceManagement.js
+++ b/src/api/deviceManagement.js
@@ -39,15 +39,6 @@ export function palletIndicatorGetType(data) {
})
}
-// 托盘指标分析
-export function palletIndicatorAnalysisType(data) {
- return request({
- url: '/equipment/PalletIndicatorAnalysis/getType',
- method: 'post',
- data
- })
-}
-
// 备品备件
export function getSparePartStockPage(data) {
return request({
diff --git a/src/views/basicConfig/components/accountAdd.vue b/src/views/basicConfig/components/accountAdd.vue
index 8ab1756..28cea7d 100644
--- a/src/views/basicConfig/components/accountAdd.vue
+++ b/src/views/basicConfig/components/accountAdd.vue
@@ -3,7 +3,6 @@
@@ -109,6 +108,7 @@ export default {
submitForm() {
this.$refs['form'].validate((valid) => {
if (valid) {
+ this.form.account = this.form.account.replace(/[\W]/g, '')
if (this.isEdit) {
//编辑
accountUpdate({ ...this.form }).then((res) => {
diff --git a/src/views/consumablesManagement/inAndOutManagement.vue b/src/views/consumablesManagement/inAndOutManagement.vue
index f6282d3..cccb45d 100644
--- a/src/views/consumablesManagement/inAndOutManagement.vue
+++ b/src/views/consumablesManagement/inAndOutManagement.vue
@@ -12,6 +12,7 @@
:table-props="tableProps"
:table-data="tableData"
:max-height="tableH"
+ :row-class-name="tableRowClassName"
>
0) {
+ return 'danger-row'
+ }
+ return ''
+ },
handleCancel() {
this.$refs.inAndOutManagementAdd.formClear()
this.addAndEdit = ''
diff --git a/src/views/deviceManagement/performanceAnalysis/analysisOfPallet.vue b/src/views/deviceManagement/performanceAnalysis/analysisOfPallet.vue
index 25f0a78..3a52b0a 100644
--- a/src/views/deviceManagement/performanceAnalysis/analysisOfPallet.vue
+++ b/src/views/deviceManagement/performanceAnalysis/analysisOfPallet.vue
@@ -55,7 +55,7 @@ import { tableHeight } from '@/utils/index'
import palletLevelChart from './../components/palletLevelChart.vue'
import {
palletIndicatorAnalysisPage,
- palletIndicatorAnalysisType
+ palletIndicatorGetType
} from '@/api/deviceManagement'
import { timeFormatter } from '@/utils'
const tableProps = [
@@ -159,7 +159,8 @@ export default {
],
listQuery: {
current: 1,
- size: 20
+ size: 20,
+ palletId: ''
},
total: 0,
tableProps,
@@ -200,7 +201,7 @@ export default {
},
getLevel() {
// 需要修改ID
- palletIndicatorAnalysisType({ id: 1 }).then((res) => {
+ palletIndicatorGetType({ id: 1 }).then((res) => {
this.tableData2 = []
if (res.code === 0) {
const data = res.data
diff --git a/src/views/qualityManagement/processFullInspection/particleLineChart.vue b/src/views/qualityManagement/processFullInspection/particleLineChart.vue
index 6049f56..1ed6297 100644
--- a/src/views/qualityManagement/processFullInspection/particleLineChart.vue
+++ b/src/views/qualityManagement/processFullInspection/particleLineChart.vue
@@ -14,7 +14,7 @@
import * as echarts from 'echarts'
import { tableHeight } from '@/utils/index'
import resize from '@/utils/chartMixins/resize'
-import { getProcessFull } from '@/api/qualityManagement'
+// import { getProcessFull } from '@/api/qualityManagement'
import moment from 'moment'
export default {
name: 'particleLineChart',
@@ -49,12 +49,8 @@ export default {
chartDom: '',
chart: '',
chartHeight: tableHeight(320),
- listQuery: {
- size: 1000,
- current: 1,
- checkOutTime: '',
- maxLine: ''
- }
+ checkOutTime: '',
+ maxLine: ''
}
},
mounted() {
@@ -63,15 +59,15 @@ export default {
window.addEventListener('resize', () => {
this.chartHeight = tableHeight(320)
})
- this.formConfig[0].defaultSelect = moment().format('YYYY-MM-DDTHH:mm:ss')
+ this.formConfig[0].defaultSelect = moment().format('YYYY-MM-DD HH:mm:ss')
this.getMsg()
},
methods: {
buttonClick(val) {
console.log(val)
if (val.btnName === 'search') {
- this.listQuery.checkOutTime = val.checkOutTime
- this.listQuery.maxLine = val.maxLine
+ this.checkOutTime = val.checkOutTime
+ this.maxLine = val.maxLine
this.getMsg()
}
},
@@ -83,29 +79,44 @@ export default {
let xlList = []
let sumList = []
let msg = {}
- getProcessFull({ ...this.listQuery }).then((res) => {
- console.log(res)
- if (res.code === 0 && res.data.length > 0) {
- res.data.map((item) => {
- console.log(item)
- time.push(moment(item.hour).format('MM-DD HH:mm:ss'))
- sList.push(item.s)
- mList.push(item.m)
- lList.push(item.l)
- xlList.push(item.xl)
- sumList.push(item.sum)
- })
- msg.time = time
- msg.sList = sList
- msg.mList = mList
- msg.lList = lList
- msg.xlList = xlList
- msg.sumList = sumList
- this.getChart(msg)
- }
- })
+ for (let i = 0; i < 100; i++) {
+ time.push(moment().add(1, 'days').format('YYYY-MM-DD HH:mm:ss'))
+ sList.push(Math.floor(Math.random() * 80 + 10))
+ mList.push(Math.floor(Math.random() * 80 + 20))
+ lList.push(Math.floor(Math.random() * 80 + 30))
+ xlList.push(Math.floor(Math.random() * 80 + 40))
+ sumList.push(sList[i] + mList[i] + lList[i] + xlList[i])
+ }
+ msg.time = time
+ msg.sList = sList
+ msg.mList = mList
+ msg.lList = lList
+ msg.xlList = xlList
+ msg.sumList = sumList
+ this.getChart(msg)
+ // getProcessFull({ checkOutTime: this.checkOutTime }).then((res) => {
+ // console.log(res)
+ // if (res.code === 0 && res.data.length > 0) {
+ // res.data.map((item) => {
+ // console.log(item)
+ // time.push(moment(item.hour).format('MM-DD HH:mm:ss'))
+ // sList.push(item.s)
+ // mList.push(item.m)
+ // lList.push(item.l)
+ // xlList.push(item.xl)
+ // sumList.push(item.sum)
+ // })
+ // msg.time = time
+ // msg.sList = sList
+ // msg.mList = mList
+ // msg.lList = lList
+ // msg.xlList = xlList
+ // msg.sumList = sumList
+ // this.getChart(msg)
+ // }
+ // })
},
- getChart(msg) {
+ getChart1(msg) {
var option = {
color: ['#5AD8A6', '#5B8FF9', '#5D7092', '#F6BD16', '#E8684A'],
title: {
@@ -141,7 +152,7 @@ export default {
Symbol: 'none',
label: {
position: 'end',
- formatter: '合格线\n' + this.listQuery.maxLine
+ formatter: '合格线\n' + this.maxLine
},
data: [
{
@@ -150,7 +161,7 @@ export default {
type: 'dashed',
color: '#0B58FF'
},
- yAxis: this.listQuery.maxLine
+ yAxis: this.maxLine
}
]
}
@@ -178,6 +189,57 @@ export default {
]
}
+ option && this.chart.setOption(option)
+ },
+ getChart(msg) {
+ console.log(msg)
+ var option = {
+ title: {
+ text: 'Beijing AQI',
+ left: '1%'
+ },
+ tooltip: {
+ trigger: 'axis'
+ },
+ grid: {
+ left: '5%',
+ right: '15%',
+ bottom: '10%'
+ },
+ xAxis: msg.time,
+ yAxis: {},
+ toolbox: {
+ right: 10,
+ feature: {
+ dataZoom: {
+ yAxisIndex: 'none'
+ },
+ restore: {},
+ saveAsImage: {}
+ }
+ },
+ dataZoom: [
+ {
+ startValue: '2014-06-01'
+ },
+ {
+ type: 'inside'
+ }
+ ],
+ visualMap: {
+ top: 50,
+ right: 10,
+ outOfRange: {
+ color: '#999'
+ }
+ },
+ series: {
+ name: 'Beijing AQI',
+ type: 'line',
+ data: msg.sList
+ }
+ }
+
option && this.chart.setOption(option)
}
}