From 8cf2f9f7e9756d8af83a2d24199bc9e87db47a06 Mon Sep 17 00:00:00 2001 From: helloDy <1615073571@qq.com> Date: Fri, 15 Sep 2023 14:37:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 6 +- package.json | 2 + src/api/core/monitoring/auto.js | 25 ++ src/api/core/monitoring/data.js | 25 ++ src/api/core/monitoring/data24.js | 17 ++ src/api/core/monitoring/sectionStatistics.js | 33 +++ src/views/core/mixins/code-filter.js | 9 +- src/views/core/monitoring/auto/index.vue | 225 ++++++++++++------ src/views/core/monitoring/data/index.vue | 89 ++++--- src/views/core/monitoring/data24/index.vue | 189 +++++++++++++++ .../monitoring/sectionStatistics/index.vue | 114 +++++---- 11 files changed, 550 insertions(+), 184 deletions(-) create mode 100644 src/api/core/monitoring/auto.js create mode 100644 src/api/core/monitoring/data.js create mode 100644 src/api/core/monitoring/data24.js create mode 100644 src/api/core/monitoring/sectionStatistics.js create mode 100644 src/views/core/monitoring/data24/index.vue diff --git a/.env.dev b/.env.dev index e5856184..a363e7ac 100644 --- a/.env.dev +++ b/.env.dev @@ -1,7 +1,7 @@ ### # @Author: Do not edit # @Date: 2023-08-29 09:40:39 - # @LastEditTime: 2023-09-11 15:55:29 + # @LastEditTime: 2023-09-12 08:47:57 # @LastEditors: DY # @Description: ### @@ -12,10 +12,10 @@ ENV = 'development' VUE_APP_TITLE = 芋道管理系统 # 芋道管理系统/开发环境 -VUE_APP_BASE_API = 'http://192.168.1.49:48080' +# VUE_APP_BASE_API = 'http://192.168.1.49:48080' # VUE_APP_BASE_API = 'http://192.168.1.8:48080' # VUE_APP_BASE_API = 'http://192.168.0.33:48080' -# VUE_APP_BASE_API = 'http://192.168.1.188:48080' +VUE_APP_BASE_API = 'http://192.168.1.188:48080' # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/package.json b/package.json index 090e7f14..0bbe53e6 100644 --- a/package.json +++ b/package.json @@ -55,8 +55,10 @@ "file-saver": "^2.0.5", "fuse.js": "6.6.2", "highlight.js": "9.18.5", + "html2canvas": "^1.4.1", "js-beautify": "1.13.0", "jsencrypt": "3.3.1", + "jspdf": "^2.5.1", "min-dash": "3.5.2", "mockjs": "^1.1.0", "moment": "^2.29.4", diff --git a/src/api/core/monitoring/auto.js b/src/api/core/monitoring/auto.js new file mode 100644 index 00000000..87b81a50 --- /dev/null +++ b/src/api/core/monitoring/auto.js @@ -0,0 +1,25 @@ +/* + * @Author: Do not edit + * @Date: 2023-09-12 09:44:53 + * @LastEditTime: 2023-09-13 16:11:41 + * @LastEditors: DY + * @Description: + */ +import request from '@/utils/request' + +// 获得工厂分页 +export function getPdlAutoReport(data) { + return request({ + url: '/monitoring/production-monitor/getPdlAutoReport', + method: 'post', + data: data + }) +} + +// 获得所有工厂产线列表 +export function getPdList() { + return request({ + url: '/base/production-line/listAll', + method: 'get' + }) +} \ No newline at end of file diff --git a/src/api/core/monitoring/data.js b/src/api/core/monitoring/data.js new file mode 100644 index 00000000..f9f44367 --- /dev/null +++ b/src/api/core/monitoring/data.js @@ -0,0 +1,25 @@ +/* + * @Author: Do not edit + * @Date: 2023-09-12 09:44:53 + * @LastEditTime: 2023-09-14 10:25:46 + * @LastEditors: DY + * @Description: + */ +import request from '@/utils/request' + +// 获得产线统计数据查询 +export function getPdlDataSearch(data) { + return request({ + url: '/monitoring/production-monitor/getPdlDataSearch', + method: 'post', + data: data + }) +} + +// 获得所有工厂产线列表 +export function getPdList() { + return request({ + url: '/base/production-line/listAll', + method: 'get' + }) +} \ No newline at end of file diff --git a/src/api/core/monitoring/data24.js b/src/api/core/monitoring/data24.js new file mode 100644 index 00000000..86afe0d8 --- /dev/null +++ b/src/api/core/monitoring/data24.js @@ -0,0 +1,17 @@ +/* + * @Author: Do not edit + * @Date: 2023-09-12 09:44:53 + * @LastEditTime: 2023-09-15 14:12:26 + * @LastEditors: DY + * @Description: + */ +import request from '@/utils/request' + +// 获得近24小时产线生产数据 +export function getPdlDataOneDay(data) { + return request({ + url: '/monitoring/production-monitor/getPdlDataOneDay', + method: 'post', + data: data + }) +} diff --git a/src/api/core/monitoring/sectionStatistics.js b/src/api/core/monitoring/sectionStatistics.js new file mode 100644 index 00000000..7d098d22 --- /dev/null +++ b/src/api/core/monitoring/sectionStatistics.js @@ -0,0 +1,33 @@ +/* + * @Author: Do not edit + * @Date: 2023-09-12 09:44:53 + * @LastEditTime: 2023-09-14 14:01:12 + * @LastEditors: DY + * @Description: + */ +import request from '@/utils/request' + +// 获得工段自动统计数据查询 +export function getSectionAutoReport(data) { + return request({ + url: '/monitoring/production-monitor/getSectionAutoReport', + method: 'post', + data: data + }) +} + +// 获得所有工厂产线列表 +export function getPdList() { + return request({ + url: '/base/production-line/listAll', + method: 'get' + }) +} + +// 获得所有产线工段列表 +export function getWorkshopSectionList() { + return request({ + url: '/base/workshop-section/listAll', + method: 'get' + }) +} \ No newline at end of file diff --git a/src/views/core/mixins/code-filter.js b/src/views/core/mixins/code-filter.js index 32340cc0..30c5f12e 100644 --- a/src/views/core/mixins/code-filter.js +++ b/src/views/core/mixins/code-filter.js @@ -1,8 +1,8 @@ /* * @Date: 2020-12-29 16:49:28 - * @LastEditors: zwq - * @LastEditTime: 2023-08-01 11:10:04 + * @LastEditors: DY + * @LastEditTime: 2023-09-12 11:13:34 * @FilePath: \basic-admin\src\filters\basicData\index.js * @Description: */ @@ -13,6 +13,11 @@ const table = { 2: '停止', 3: '未知', }, + reportType: { + 1: '日', + 2: '周', + 3: '月' + } } // 日期格式化 diff --git a/src/views/core/monitoring/auto/index.vue b/src/views/core/monitoring/auto/index.vue index 6b90674a..f13c5aed 100644 --- a/src/views/core/monitoring/auto/index.vue +++ b/src/views/core/monitoring/auto/index.vue @@ -1,7 +1,7 @@ @@ -32,100 +32,104 @@ :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total" - @pagination="getDataList" /> - +
+ + + + + + + + + + + +
+ + xlsx + pdf + + 取 消 + 确 定 + + + + diff --git a/src/views/core/monitoring/sectionStatistics/index.vue b/src/views/core/monitoring/sectionStatistics/index.vue index 0aeaf6ad..152f4acd 100644 --- a/src/views/core/monitoring/sectionStatistics/index.vue +++ b/src/views/core/monitoring/sectionStatistics/index.vue @@ -1,7 +1,7 @@ @@ -9,6 +9,7 @@
import { parseTime } from '../../mixins/code-filter'; -import { - getFactoryPage, - exportFactoryExcel, -} from '@/api/core/base/factory'; +import { getWorkshopSectionList, getPdList, getSectionAutoReport } from '@/api/core/monitoring/sectionStatistics' const tableProps = [ { - prop: 'code', - label: '产线类型', - align: 'center', + prop: 'reportType', + label: '产线类型' }, { - prop: 'createTime', + prop: 'reportStartTime', label: '统计开始时间', - align: 'center', filter: parseTime, }, { - prop: 'createTime3', + prop: 'reportEndTime', label: '统计结束时间', - align: 'center', filter: parseTime, }, { - prop: 'name', - label: '产线名称', - align: 'center', + prop: 'lineName', + label: '产线名称' }, { - prop: 'name1', - label: '工段名称', - align: 'center', + prop: 'sectionName', + label: '工段名称' }, { - prop: 'address', - label: '投入数量/片', - align: 'center', + prop: 'inputNum', + label: '投入数量/片' }, { - prop: 'remark44', - label: '产出数量/片', - align: 'center', + prop: 'outputNum', + label: '产出数量/片' }, { - prop: 'remark23', - label: '产出面积/㎡', - align: 'center', + prop: 'outputArea', + label: '产出面积/㎡' }, { - prop: 'remark145', - label: '损耗数量/片', - align: 'center', + prop: 'lossNum', + label: '损耗数量/片' }, { - prop: 'remark22', - label: '损耗面积/㎡', - align: 'center', + prop: 'lossArea', + label: '损耗面积/㎡' }, { - prop: 'remark1', - label: '损耗比例%', - align: 'center', + prop: 'lossRatio', + label: '损耗比例%' } ]; @@ -107,15 +94,8 @@ export default { data() { return { urlOptions: { - getDataListURL: getFactoryPage, - exportURL: exportFactoryExcel, + getDataListURL: getSectionAutoReport }, - urlOptions: { - getDataListURL: '', - deleteURL: '', - statusUrl: '', - exportURL: '' - }, tableData: [], listQuery: { pageSize: 10, @@ -145,8 +125,21 @@ export default { { type: 'select', label: '报表类型', - selectOptions: [], - param: 'name', + selectOptions: [ + { + id: 1, + name: '日' + }, + { + id: 2, + name: '周' + }, + { + id: 3, + name: '月' + } + ], + param: 'reportType', }, { type: 'datePicker', @@ -158,8 +151,7 @@ export default { startPlaceholder: '开始时间', endPlaceholder: '结束时间', param: 'timeVal', - defaultSelect: [], - width: 350 + defaultSelect: [] }, { type: 'button', @@ -180,8 +172,20 @@ export default { ], }; }, - created() {}, + created() { + this.getDataList() + this.getPdLineList() + }, methods: { + getPdLineList() { + getPdList().then((res) => { + this.formConfig[0].selectOptions = res.data || [] + }) + // 获取工段list + getWorkshopSectionList().then((res) => { + this.formConfig[1].selectOptions = res.data || [] + }) + }, selectChange(val) { console.log(val) this.selectedList = val @@ -191,8 +195,11 @@ export default { case 'search': this.listQuery.pageNo = 1; this.listQuery.pageSize = 10; - this.listQuery.name = val.name; - this.listQuery.code = val.code; + this.listQuery.lineId = val.line ? val.line : undefined; + this.listQuery.sectionId = val.section ? val.section : undefined; + this.listQuery.reportType = val.reportType ? val.reportType : undefined; + this.listQuery.reportStartTime = [new Date(val.timeVal[0]).getTime()]; + this.listQuery.reportEndTime = [new Date(val.timeVal[1]).getTime()]; this.getDataList(); break; case 'export': @@ -206,7 +213,10 @@ export default { getDataList() { this.dataListLoading = true; this.urlOptions.getDataListURL(this.listQuery).then(response => { - this.tableData = response.data.list; + this.tableData = response.data.list.map(item => { + item.reportType = item.reportType === 1 ? '日' : item.reportType === 2 ? '周' : '月' + return item + }); this.total = response.data.total; this.dataListLoading = false; });