diff --git a/.env.dev b/.env.dev index 17275d74..912c2eab 100644 --- a/.env.dev +++ b/.env.dev @@ -13,7 +13,7 @@ VUE_APP_TITLE = 智能监控分析系统 # 芋道管理系统/开发环境 # VUE_APP_BASE_API = 'http://192.168.8.22:48080' -VUE_APP_BASE_API = 'http://172.16.32.79:48082' +VUE_APP_BASE_API = 'http://172.16.33.65:48082' # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/package.json b/package.json index a2a56cde..80777fa7 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "license": "MIT", "scripts": { "local": "vue-cli-service serve --mode local", - "dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --mode dev", + "dev": "vue-cli-service serve --mode dev", "front": "vue-cli-service serve --mode front", "build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode prod", "build:stage": "vue-cli-service build --mode stage", diff --git a/src/api/core/analysis/index.js b/src/api/core/analysis/index.js index 60dd489f..84023604 100644 --- a/src/api/core/analysis/index.js +++ b/src/api/core/analysis/index.js @@ -25,10 +25,10 @@ export function getCT(data) { // 获取产线平衡分析数据(new) export function getNewCTNow(data) { return request({ - url: '/analysis/production-analysis/getNewCTNow', - method: 'post', - data: data - }) + url: '/analysis/production-analysis/getNewCTNow', + method: 'post', + data: data, + }); } // 获取产线平衡分析数据趋势图(new) export function getNewCTCharts(data) { @@ -39,9 +39,10 @@ export function getNewCTCharts(data) { }) } // 获取产线平衡分析数据设备list(new) -export function getNewCTDet(id) { +export function getNewCTDet(data) { return request({ - url: '/analysis/production-analysis/getNewCTDet?lineId='+id, - method: 'get', - }) + url: '/analysis/production-analysis/getNewCTDet', + method: 'post', + data:data + }); } diff --git a/src/api/core/monitoring/auto.js b/src/api/core/monitoring/auto.js index d381ef83..577209a7 100644 --- a/src/api/core/monitoring/auto.js +++ b/src/api/core/monitoring/auto.js @@ -41,6 +41,16 @@ export function getProductAuto(data) { }) } +export function getPdlAutoReportNewSearchNow(data) { + return request({ + url: '/monitoring/production-monitor/getPdlAutoReportNewSearchNow', + method: 'post', + data: data, + timeout: 60000, + }); +} + + // 班组自动报表分页 export function getTeamReportPage(data) { return request({ @@ -57,3 +67,29 @@ export function getTeamReportPageDet(id) { method: 'get', }) } + +// 获取产品当班数据 +export function getProcessAutoReportGroup(data) { + return request({ + url: '/monitoring/production-monitor/getProcessAutoReportGroup', + method: 'post', + data: data, + }); +} + +// 获取产品当天数据 +export function getProcessAutoReportDay(data) { + return request({ + url: '/monitoring/production-monitor/getProcessAutoReportDay', + method: 'post', + data: data, + }); +} +// 获取产品历史数据 +export function getProcessAutoReportNew(data) { + return request({ + url: '/monitoring/production-monitor/getProcessAutoReportNew', + method: 'post', + data: data, + }); +} diff --git a/src/api/core/monitoring/index.js b/src/api/core/monitoring/index.js index 13eb6963..b6e3146e 100644 --- a/src/api/core/monitoring/index.js +++ b/src/api/core/monitoring/index.js @@ -14,3 +14,79 @@ export function getSectionDataSearch(data) { data: data }) } + +// 获取下片日志分页数据 +export function getDownLogPage(data) { + return request({ + url: '/base/down-log/page', + method: 'get', + params: data, + }); +} + +// 获取下片日志历史数据 +export function getDownLogHisData(data) { + return request({ + url: '/base/down-log/pagehis', + method: 'get', + params: data, + }); +} + + + +// 导出下片日志Excel +export function exportDownLogData(query) { + return request({ + url: '/base/down-log/export-excel', + method: 'get', + params: query, + responseType: 'blob', + }); +} + + +// 获得所有工厂产线列表 +export function getPdList() { + return request({ + url: '/base/production-line/listAll', + method: 'get' + }) +} +// 获得玻璃型号列表 +export function getThick() { + return request({ + url: '/base/down-log/thick', + method: 'get', + }); +} + +// 获得原片报表 +export function getCostOriginRadioHisData(data) { + return request({ + url: '/monitoring/cost-origin-ratio-his/page', + method: 'get', + params: data, + }); +} + +// 修改原片报表 +export function editCostOriginRadioHisData(data) { + return request({ + url: '/monitoring/cost-origin-ratio-his/update', + method: 'put', + data: data, + }); +} + +// 导出原片报表 +export function exportCostOriginRadioHisData(data) { + return request({ + url: '/monitoring/cost-origin-ratio-his/export-excel', + method: 'get', + params: data, + responseType: 'blob', + }); +} + + diff --git a/src/components/ButtonNav/index.vue b/src/components/ButtonNav/index.vue index c3bc57aa..dfbcc0f1 100644 --- a/src/components/ButtonNav/index.vue +++ b/src/components/ButtonNav/index.vue @@ -81,7 +81,7 @@ export default { border: none; background: #fff; border-radius: 8px; - padding: 15px; + padding: 16px; color: #888; letter-spacing: 2px; flex: 1; diff --git a/src/views/core/analysis/balanceAnalysis/BarChart.vue b/src/views/core/analysis/balanceAnalysis/BarChart.vue index 06f6c6ca..987288bf 100644 --- a/src/views/core/analysis/balanceAnalysis/BarChart.vue +++ b/src/views/core/analysis/balanceAnalysis/BarChart.vue @@ -80,8 +80,18 @@ export default { immediate: true, }, }, - methods: { - initChart() { + methods: { + getUniqueTimes() { + const { edgeCt, temperCt, downCt } = this.barData; + // 合并所有包含时间的数组 + const allTimeEntries = [...(edgeCt || []), ...(temperCt || []), ...(downCt || [])]; + // 提取时间戳并去重(使用 Set) + const uniqueTimes = [...new Set(allTimeEntries.map(item => item.recordTime))]; + // 按时间戳排序(确保时间顺序正确) + return uniqueTimes.sort((a, b) => a - b); + }, + initChart() { + const uniqueTimes = this.getUniqueTimes(); const _this = this; this.chart.setOption({ title: { @@ -124,9 +134,7 @@ export default { }, xAxis: { type: 'category', - data: this.barData.edgeCt.map((item) => { - return parseTime(item.recordTime, '{m}-{d} {h}:{i}'); - }), + data: uniqueTimes.map(time => parseTime(time, '{m}-{d} {h}:{i}')), axisPointer: { type: 'shadow', }, @@ -152,44 +160,50 @@ export default { end: 100, }, ], - series: [ - { - name: '磨边节拍', - type: 'line', - tooltip: { - valueFormatter: function (value) { - return value + 'pcs/min'; - }, - }, - data: this.barData.edgeCt.map((item) => { - return item.ct; - }), - }, - { - name: '钢化节拍', - type: 'line', - tooltip: { - valueFormatter: function (value) { - return value + 'pcs/min'; - }, - }, - data: this.barData.temperCt.map((item) => { - return item.ct; - }), - }, - { - name: '下片节拍', - type: 'line', - tooltip: { - valueFormatter: function (value) { - return value + 'pcs/min'; - }, - }, - data: this.barData.downCt.map((item) => { - return item.ct; - }), - }, - ], + series: [ + { + name: '磨边节拍', + type: 'line', + tooltip: { + valueFormatter: function (value) { + return value + 'pcs/min'; + }, + }, + data: uniqueTimes.map(time => { + // 查找当前时间对应的 ct 值,没有则补 null(图表中会显示为断点) + const match = this.barData.edgeCt.find(item => item.recordTime === time); + return match ? match.ct : 0; + }) + }, + // 钢化节拍 + { + name: '钢化节拍', + type: 'line', + tooltip: { + valueFormatter: function (value) { + return value + 'pcs/min'; + }, + }, + data: uniqueTimes.map(time => { + const match = this.barData.temperCt.find(item => item.recordTime === time); + return match ? match.ct : 0; + }) + }, + // 下片节拍 + { + name: '下片节拍', + type: 'line', + tooltip: { + valueFormatter: function (value) { + return value + 'pcs/min'; + }, + }, + data: uniqueTimes.map(time => { + const match = this.barData.downCt.find(item => item.recordTime === time); + return match ? match.ct : 0; + }) + } + ] }); }, }, diff --git a/src/views/core/analysis/balanceAnalysis/eq-detail.vue b/src/views/core/analysis/balanceAnalysis/eq-detail.vue index 3cea3c16..73a41acd 100644 --- a/src/views/core/analysis/balanceAnalysis/eq-detail.vue +++ b/src/views/core/analysis/balanceAnalysis/eq-detail.vue @@ -119,12 +119,12 @@ export default { }, methods: { // 获取数据列表 - init(lineId, startTime, endTime) { + init(lId, startTime, endTime) { this.eqChartData = []; this.time.startTime = startTime; this.time.endTime = endTime; this.dataListLoading = true; - getNewCTDet(lineId).then((response) => { + getNewCTDet({ lineId: [lId], startTime, endTime }).then((response) => { this.tableData = response.data; this.dataListLoading = false; }); diff --git a/src/views/core/analysis/balanceAnalysis/index.vue b/src/views/core/analysis/balanceAnalysis/index.vue index dda15b11..1ca92fc4 100644 --- a/src/views/core/analysis/balanceAnalysis/index.vue +++ b/src/views/core/analysis/balanceAnalysis/index.vue @@ -183,7 +183,7 @@ export default { // 获取当前时间 const now = new Date(); // 获取前一天的同一时间 - const yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000); + const yesterday = new Date(now.getTime()); // 设置为00:00:00 yesterday.setHours(0, 0, 0, 0); // 设置为23:59:59 diff --git a/src/views/core/analysis/yieldAnalysis/index.vue b/src/views/core/analysis/yieldAnalysis/index.vue index 65e04e31..9bb73259 100644 --- a/src/views/core/analysis/yieldAnalysis/index.vue +++ b/src/views/core/analysis/yieldAnalysis/index.vue @@ -80,7 +80,7 @@ export default { defaultSelect: [], multiple: true, filterable: true, - width: 400, + width: 200, }, { type: 'datePicker', diff --git a/src/views/core/base/product/add-or-updata.vue b/src/views/core/base/product/add-or-updata.vue index 2401c871..8376d694 100644 --- a/src/views/core/base/product/add-or-updata.vue +++ b/src/views/core/base/product/add-or-updata.vue @@ -1,157 +1,104 @@ + + diff --git a/src/views/core/monitoring/data/index.vue b/src/views/core/monitoring/data/index.vue index a0195c82..c2a8447a 100644 --- a/src/views/core/monitoring/data/index.vue +++ b/src/views/core/monitoring/data/index.vue @@ -95,7 +95,7 @@ const tableProps = [ prop: 'inputN', label: '投入', align: 'center', - children: [ + children: [ { prop: 'inputNum', label: '投入数量/片', diff --git a/src/views/core/monitoring/lineAuto/BarChart.vue b/src/views/core/monitoring/lineAuto/BarChart.vue new file mode 100644 index 00000000..d823cedd --- /dev/null +++ b/src/views/core/monitoring/lineAuto/BarChart.vue @@ -0,0 +1,272 @@ + + + diff --git a/src/views/core/monitoring/lineAuto/index.vue b/src/views/core/monitoring/lineAuto/index.vue index f9548d2a..6ca68b83 100644 --- a/src/views/core/monitoring/lineAuto/index.vue +++ b/src/views/core/monitoring/lineAuto/index.vue @@ -1,481 +1,1362 @@ - + + + + diff --git a/src/views/core/monitoring/nextClip/hisData.vue b/src/views/core/monitoring/nextClip/hisData.vue new file mode 100644 index 00000000..5342afa4 --- /dev/null +++ b/src/views/core/monitoring/nextClip/hisData.vue @@ -0,0 +1,361 @@ + + + + diff --git a/src/views/core/monitoring/nextClip/index.vue b/src/views/core/monitoring/nextClip/index.vue new file mode 100644 index 00000000..55bf6a9c --- /dev/null +++ b/src/views/core/monitoring/nextClip/index.vue @@ -0,0 +1,373 @@ + + + + diff --git a/src/views/core/monitoring/productAuto/BarChart.vue b/src/views/core/monitoring/productAuto/BarChart.vue new file mode 100644 index 00000000..d823cedd --- /dev/null +++ b/src/views/core/monitoring/productAuto/BarChart.vue @@ -0,0 +1,272 @@ + + + diff --git a/src/views/core/monitoring/productAuto/baseTable.vue b/src/views/core/monitoring/productAuto/baseTable.vue new file mode 100644 index 00000000..4b292da6 --- /dev/null +++ b/src/views/core/monitoring/productAuto/baseTable.vue @@ -0,0 +1,273 @@ + + + + + diff --git a/src/views/core/monitoring/productAuto/index.vue b/src/views/core/monitoring/productAuto/index.vue index 13fdf834..764bbbfd 100644 --- a/src/views/core/monitoring/productAuto/index.vue +++ b/src/views/core/monitoring/productAuto/index.vue @@ -1,366 +1,1270 @@ - + + + + diff --git a/src/views/core/monitoring/rawFilmReport/SmallTitle.vue b/src/views/core/monitoring/rawFilmReport/SmallTitle.vue new file mode 100644 index 00000000..93b4a18f --- /dev/null +++ b/src/views/core/monitoring/rawFilmReport/SmallTitle.vue @@ -0,0 +1,65 @@ + + + + + + diff --git a/src/views/core/monitoring/rawFilmReport/add-or-updata.vue b/src/views/core/monitoring/rawFilmReport/add-or-updata.vue new file mode 100644 index 00000000..e73afd7d --- /dev/null +++ b/src/views/core/monitoring/rawFilmReport/add-or-updata.vue @@ -0,0 +1,221 @@ + + + + + diff --git a/src/views/core/monitoring/rawFilmReport/index.vue b/src/views/core/monitoring/rawFilmReport/index.vue new file mode 100644 index 00000000..5dd5448a --- /dev/null +++ b/src/views/core/monitoring/rawFilmReport/index.vue @@ -0,0 +1,281 @@ + + + + diff --git a/src/views/home/components/Count.vue b/src/views/home/components/Count.vue index 36c2dc1a..53f380f8 100644 --- a/src/views/home/components/Count.vue +++ b/src/views/home/components/Count.vue @@ -3,16 +3,17 @@
-

2,344

+

{{ totalDownLoadNumClass ? totalDownLoadNumClass : 0}}

本班合计

-

2,344

+

{{ totalDownLoadNumDay ? totalDownLoadNumDay : 0 }}

本日合计

- + @@ -26,9 +27,64 @@ export default { name: 'Count', components: { ModelBox + }, + props: { + dataObj: { + type: Array, + default: () => [] + } + }, + watch: { + dataObj: { + handler(newVal, oldVal) { + console.log(newVal, 'newVal'); + if (newVal) { + this.totalGlassNum = 0; + this.tableData = []; + // 累加所有项目的downLoadNumDay + this.totalDownLoadNumDay = 0; + this.totalDownLoadNumClass = 0 + // 遍历每条产线数据 + newVal.forEach(item => { + // 计算当前项目的glassNum总和 + const glassArray = JSON.parse(item.glassNum); + const itemGlassSum = glassArray.reduce((sum, num) => sum + num, 0); + this.tableData.push({ + lineName: item.lineName, + glassSum: itemGlassSum, + downLoadNumDay:item.downLoadNumDay, + downLoadNumClass: item.downLoadNumClass + }); + + // 累加downLoadNumDay + this.totalDownLoadNumDay += item.downLoadNumDay; + this.totalDownLoadNumClass += item.downLoadNumClass; + + }); + let eqArr = this.tableData.map((item, index) => [ + `${index+1 || ''} + `, + `${item.lineName || ''} + `, + // formatDate(item.planStartTime) || '', + ` + ${item.downLoadNumClass || ''} + `, + `${item.downLoadNumDay || ''}`, + `${item.glassSum || ''}`, + ]) + this.config.data = eqArr + this.$refs['locationScrollBoardTable'].updateRows(eqArr) + } + // this.getChart(this.todayClass) + }, + deep: true // 深度监听 + } }, data() { return { + totalDownLoadNumDay: 0, + totalDownLoadNumClass:0, config:{ header: ['序号', '产线', '本班', '本日', '一托玻璃数量'], headerHeight: 30, @@ -39,11 +95,6 @@ export default { columnWidth: [70, 125, 125, 125, 130], align : ['center', 'center', 'center', 'center', 'center'], data: [ - ['1', 'A1', '23', '234', '234'], - ['2', 'A2', '13', '234','234'], - ['3', 'A3', '24', '234', '234'], - ['4', 'A4', '45', '234', '234'], - ['5', 'A5', '55', '234', '234'] ] } } @@ -98,4 +149,4 @@ export default { } } - \ No newline at end of file + diff --git a/src/views/home/components/EqAlarm.vue b/src/views/home/components/EqAlarm.vue index 9d8872a1..3c5ca01e 100644 --- a/src/views/home/components/EqAlarm.vue +++ b/src/views/home/components/EqAlarm.vue @@ -1,7 +1,7 @@