diff --git a/.env.dev b/.env.dev index 9bd580d3..1dab39b1 100644 --- a/.env.dev +++ b/.env.dev @@ -25,4 +25,4 @@ VUE_APP_CAPTCHA_ENABLE = true VUE_APP_DOC_ENABLE = true # 百度统计 -VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab +# VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab diff --git a/.env.prod b/.env.prod index 50b5e38e..742d6a09 100644 --- a/.env.prod +++ b/.env.prod @@ -1,18 +1,20 @@ # 生产环境配置 -NODE_ENV = 'production' +ENV = 'production' # 页面标题 VUE_APP_TITLE = 洛玻集团驾驶舱 # 芋道管理系统/生产环境 -# 建议使用相对路径或通过nginx配置的域名/路径,避免写死IP和端口 -VUE_APP_BASE_API = '' # 示例:使用相对路径,由nginx转发到实际后端地址 +# VUE_APP_BASE_API = '/prod-api' +VUE_APP_BASE_API = '' -# 根据服务器或域名修改,使用相对路径,避免写死IP和端口 -PUBLIC_PATH = '' # 改为根路径,或根据实际二级部署路径设置(如 '/subpath/') +# 根据服务器或域名修改 +# PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/' +# PUBLIC_PATH = 'http://192.168.0.33:8888/' +PUBLIC_PATH = '' -# 二级部署路径(如果需要) -# VUE_APP_APP_NAME ='yudao-admin' +# 二级部署路径 +VUE_APP_APP_NAME ='yudao-admin' # 多租户的开关 VUE_APP_TENANT_ENABLE = true diff --git a/dist.zip b/dist.zip deleted file mode 100644 index 857eee84..00000000 Binary files a/dist.zip and /dev/null differ diff --git a/src/api/cockpit.js b/src/api/cockpit.js index a955e6b8..a65b0995 100644 --- a/src/api/cockpit.js +++ b/src/api/cockpit.js @@ -68,3 +68,11 @@ export function getOperateCockpit(data) { }); } +export function getOrderDetail(data) { + return request({ + url: "/lb/operate-cockpit/getOrderDetail", + method: "post", + data: data, + }); +} + diff --git a/src/views/home/PSIAnal.vue b/src/views/home/PSIAnal.vue index 8bb3e841..6cf8d8af 100644 --- a/src/views/home/PSIAnal.vue +++ b/src/views/home/PSIAnal.vue @@ -155,9 +155,9 @@ export default { methods: { getData(obj) { getProductSaleAnalysis({ - startTime: 1762704000000, - endTime: 1762790400000, - mode: 1 + startTime: obj.startTime, + endTime: obj.endTime, + mode: obj.mode, }).then((res) => { console.log(res); this.productSaleData = [ diff --git a/src/views/home/components/Header.vue b/src/views/home/components/Header.vue index ee23fd44..9523dc8c 100644 --- a/src/views/home/components/Header.vue +++ b/src/views/home/components/Header.vue @@ -98,44 +98,40 @@ export default { const mode = this.activeTime + 1; // 1=日,2=月,3=年 const defaultMoment = moment(); // 默认当前时间 - // 处理选择的日期:转为moment对象(兼容不同选择器格式) - console.log('this.date', this.date); - const targetMoment = this.date ? moment(this.date, this.getPickerType === 'date' ? 'YYYY-MM-DD' : (this.getPickerType === 'month' ? 'YYYY-MM' : 'YYYY')) : defaultMoment; - // 验证日期有效性 if (!targetMoment.isValid()) { console.error('无效日期:', this.date); return { startTime, endTime, mode }; } - // 1. 日维度:当天0点 → 次日0点 + // 1. 日维度:00:00:00 → 23:59:59(无毫秒) if (this.activeTime === 0) { - startTime = targetMoment.startOf('day').valueOf(); // 当天00:00:00 时间戳 - endTime = targetMoment.add(1, 'day').startOf('day').valueOf(); // 次日00:00:00 时间戳 + startTime = targetMoment.startOf('day').millisecond(0).valueOf(); + endTime = targetMoment.endOf('day').millisecond(0).valueOf(); } - // 2. 月维度:当月1日0点 → 次月1日0点 + // 2. 月维度:当月1日00:00:00 → 当月最后一天23:59:59(无毫秒) else if (this.activeTime === 1) { - startTime = targetMoment.startOf('month').valueOf(); // 当月1日00:00:00 时间戳 - endTime = targetMoment.add(1, 'month').startOf('month').valueOf(); // 次月1日00:00:00 时间戳 + startTime = targetMoment.startOf('month').millisecond(0).valueOf(); + endTime = targetMoment.endOf('month').millisecond(0).valueOf(); } - // 3. 年维度:当年1月1日0点 → 次年1月1日0点 + // 3. 年维度:当年1月1日00:00:00 → 当年最后一天23:59:59(无毫秒) else if (this.activeTime === 2) { - startTime = targetMoment.startOf('year').valueOf(); // 当年1月1日00:00:00 时间戳 - endTime = targetMoment.add(1, 'year').startOf('year').valueOf(); // 次年1月1日00:00:00 时间戳 + startTime = targetMoment.startOf('year').millisecond(0).valueOf(); + endTime = targetMoment.endOf('year').millisecond(0).valueOf(); } - // 调试输出(格式化显示,便于验证) + // 调试输出:验证是否去掉毫秒 console.log('时间范围计算结果:', { mode, - startTime: moment(startTime).format('YYYY-MM-DD HH:mm:ss'), - endTime: moment(endTime).format('YYYY-MM-DD HH:mm:ss'), - startTimeStamp: startTime, - endTimeStamp: endTime + startTime: moment(startTime * 1000).format('YYYY-MM-DD HH:mm:ss'), // 格式:2025-11-30 00:00:00 + endTime: moment(endTime * 1000).format('YYYY-MM-DD HH:mm:ss'), // 格式:2025-11-30 23:59:59(无毫秒) + startTimeStamp: startTime, // 秒级时间戳(如:1764422400) + endTimeStamp: endTime // 秒级时间戳(如:1764508799) }); return { startTime, endTime, mode }; diff --git a/src/views/home/components/noRouterHeader.vue b/src/views/home/components/noRouterHeader.vue index 3a1c3992..142646a3 100644 --- a/src/views/home/components/noRouterHeader.vue +++ b/src/views/home/components/noRouterHeader.vue @@ -103,44 +103,40 @@ export default { const mode = this.activeTime + 1; // 1=日,2=月,3=年 const defaultMoment = moment(); // 默认当前时间 - // 处理选择的日期:转为moment对象(兼容不同选择器格式) - console.log('this.date', this.date); - const targetMoment = this.date ? moment(this.date, this.getPickerType === 'date' ? 'YYYY-MM-DD' : (this.getPickerType === 'month' ? 'YYYY-MM' : 'YYYY')) : defaultMoment; - // 验证日期有效性 if (!targetMoment.isValid()) { console.error('无效日期:', this.date); return { startTime, endTime, mode }; } - // 1. 日维度:当天0点 → 次日0点 + // 1. 日维度:00:00:00 → 23:59:59(无毫秒) if (this.activeTime === 0) { - startTime = targetMoment.startOf('day').valueOf(); // 当天00:00:00 时间戳 - endTime = targetMoment.add(1, 'day').startOf('day').valueOf(); // 次日00:00:00 时间戳 + startTime = targetMoment.startOf('day').millisecond(0).valueOf(); + endTime = targetMoment.endOf('day').millisecond(0).valueOf(); } - // 2. 月维度:当月1日0点 → 次月1日0点 + // 2. 月维度:当月1日00:00:00 → 当月最后一天23:59:59(无毫秒) else if (this.activeTime === 1) { - startTime = targetMoment.startOf('month').valueOf(); // 当月1日00:00:00 时间戳 - endTime = targetMoment.add(1, 'month').startOf('month').valueOf(); // 次月1日00:00:00 时间戳 + startTime = targetMoment.startOf('month').millisecond(0).valueOf(); + endTime = targetMoment.endOf('month').millisecond(0).valueOf(); } - // 3. 年维度:当年1月1日0点 → 次年1月1日0点 + // 3. 年维度:当年1月1日00:00:00 → 当年最后一天23:59:59(无毫秒) else if (this.activeTime === 2) { - startTime = targetMoment.startOf('year').valueOf(); // 当年1月1日00:00:00 时间戳 - endTime = targetMoment.add(1, 'year').startOf('year').valueOf(); // 次年1月1日00:00:00 时间戳 + startTime = targetMoment.startOf('year').millisecond(0).valueOf(); + endTime = targetMoment.endOf('year').millisecond(0).valueOf(); } - // 调试输出(格式化显示,便于验证) + // 调试输出:验证是否去掉毫秒 console.log('时间范围计算结果:', { mode, - startTime: moment(startTime).format('YYYY-MM-DD HH:mm:ss'), - endTime: moment(endTime).format('YYYY-MM-DD HH:mm:ss'), - startTimeStamp: startTime, - endTimeStamp: endTime + startTime: moment(startTime * 1000).format('YYYY-MM-DD HH:mm:ss'), // 格式:2025-11-30 00:00:00 + endTime: moment(endTime * 1000).format('YYYY-MM-DD HH:mm:ss'), // 格式:2025-11-30 23:59:59(无毫秒) + startTimeStamp: startTime, // 秒级时间戳(如:1764422400) + endTimeStamp: endTime // 秒级时间戳(如:1764508799) }); return { startTime, endTime, mode }; diff --git a/src/views/home/cost.vue b/src/views/home/cost.vue index dafacd57..91ba4748 100644 --- a/src/views/home/cost.vue +++ b/src/views/home/cost.vue @@ -162,9 +162,9 @@ export default { getData(obj) { // obj.levelId = 1 getCostAnalysisList({ - startTime: 1762704000000, - endTime: 1762790400000, - mode:1 + startTime: obj.startTime, + endTime: obj.endTime, + mode: obj.mode, }).then((res) => { this.costOverviews = res.data.costOverviews this.piecesCostViews = res.data.piecesCostViews diff --git a/src/views/home/costComponents/single/noRouterHeader.vue b/src/views/home/costComponents/single/noRouterHeader.vue index f00a7aac..4944cc30 100644 --- a/src/views/home/costComponents/single/noRouterHeader.vue +++ b/src/views/home/costComponents/single/noRouterHeader.vue @@ -111,44 +111,40 @@ export default { const mode = this.activeTime + 1; // 1=日,2=月,3=年 const defaultMoment = moment(); // 默认当前时间 - // 处理选择的日期:转为moment对象(兼容不同选择器格式) - console.log('this.date', this.date); - const targetMoment = this.date ? moment(this.date, this.getPickerType === 'date' ? 'YYYY-MM-DD' : (this.getPickerType === 'month' ? 'YYYY-MM' : 'YYYY')) : defaultMoment; - // 验证日期有效性 if (!targetMoment.isValid()) { console.error('无效日期:', this.date); return { startTime, endTime, mode }; } - // 1. 日维度:当天0点 → 次日0点 + // 1. 日维度:00:00:00 → 23:59:59(无毫秒) if (this.activeTime === 0) { - startTime = targetMoment.startOf('day').valueOf(); // 当天00:00:00 时间戳 - endTime = targetMoment.add(1, 'day').startOf('day').valueOf(); // 次日00:00:00 时间戳 + startTime = targetMoment.startOf('day').millisecond(0).valueOf(); + endTime = targetMoment.endOf('day').millisecond(0).valueOf(); } - // 2. 月维度:当月1日0点 → 次月1日0点 + // 2. 月维度:当月1日00:00:00 → 当月最后一天23:59:59(无毫秒) else if (this.activeTime === 1) { - startTime = targetMoment.startOf('month').valueOf(); // 当月1日00:00:00 时间戳 - endTime = targetMoment.add(1, 'month').startOf('month').valueOf(); // 次月1日00:00:00 时间戳 + startTime = targetMoment.startOf('month').millisecond(0).valueOf(); + endTime = targetMoment.endOf('month').millisecond(0).valueOf(); } - // 3. 年维度:当年1月1日0点 → 次年1月1日0点 + // 3. 年维度:当年1月1日00:00:00 → 当年最后一天23:59:59(无毫秒) else if (this.activeTime === 2) { - startTime = targetMoment.startOf('year').valueOf(); // 当年1月1日00:00:00 时间戳 - endTime = targetMoment.add(1, 'year').startOf('year').valueOf(); // 次年1月1日00:00:00 时间戳 + startTime = targetMoment.startOf('year').millisecond(0).valueOf(); + endTime = targetMoment.endOf('year').millisecond(0).valueOf(); } - // 调试输出(格式化显示,便于验证) + // 调试输出:验证是否去掉毫秒 console.log('时间范围计算结果:', { mode, - startTime: moment(startTime).format('YYYY-MM-DD HH:mm:ss'), - endTime: moment(endTime).format('YYYY-MM-DD HH:mm:ss'), - startTimeStamp: startTime, - endTimeStamp: endTime + startTime: moment(startTime * 1000).format('YYYY-MM-DD HH:mm:ss'), // 格式:2025-11-30 00:00:00 + endTime: moment(endTime * 1000).format('YYYY-MM-DD HH:mm:ss'), // 格式:2025-11-30 23:59:59(无毫秒) + startTimeStamp: startTime, // 秒级时间戳(如:1764422400) + endTimeStamp: endTime // 秒级时间戳(如:1764508799) }); return { startTime, endTime, mode }; diff --git a/src/views/home/costComponents/single/noRouterHeaderPa.vue b/src/views/home/costComponents/single/noRouterHeaderPa.vue index 8ba0860e..20c14640 100644 --- a/src/views/home/costComponents/single/noRouterHeaderPa.vue +++ b/src/views/home/costComponents/single/noRouterHeaderPa.vue @@ -110,44 +110,40 @@ export default { const mode = this.activeTime + 1; // 1=日,2=月,3=年 const defaultMoment = moment(); // 默认当前时间 - // 处理选择的日期:转为moment对象(兼容不同选择器格式) - console.log('this.date', this.date); - const targetMoment = this.date ? moment(this.date, this.getPickerType === 'date' ? 'YYYY-MM-DD' : (this.getPickerType === 'month' ? 'YYYY-MM' : 'YYYY')) : defaultMoment; - // 验证日期有效性 if (!targetMoment.isValid()) { console.error('无效日期:', this.date); return { startTime, endTime, mode }; } - // 1. 日维度:当天0点 → 次日0点 + // 1. 日维度:00:00:00 → 23:59:59(无毫秒) if (this.activeTime === 0) { - startTime = targetMoment.startOf('day').valueOf(); // 当天00:00:00 时间戳 - endTime = targetMoment.add(1, 'day').startOf('day').valueOf(); // 次日00:00:00 时间戳 + startTime = targetMoment.startOf('day').millisecond(0).valueOf(); + endTime = targetMoment.endOf('day').millisecond(0).valueOf(); } - // 2. 月维度:当月1日0点 → 次月1日0点 + // 2. 月维度:当月1日00:00:00 → 当月最后一天23:59:59(无毫秒) else if (this.activeTime === 1) { - startTime = targetMoment.startOf('month').valueOf(); // 当月1日00:00:00 时间戳 - endTime = targetMoment.add(1, 'month').startOf('month').valueOf(); // 次月1日00:00:00 时间戳 + startTime = targetMoment.startOf('month').millisecond(0).valueOf(); + endTime = targetMoment.endOf('month').millisecond(0).valueOf(); } - // 3. 年维度:当年1月1日0点 → 次年1月1日0点 + // 3. 年维度:当年1月1日00:00:00 → 当年最后一天23:59:59(无毫秒) else if (this.activeTime === 2) { - startTime = targetMoment.startOf('year').valueOf(); // 当年1月1日00:00:00 时间戳 - endTime = targetMoment.add(1, 'year').startOf('year').valueOf(); // 次年1月1日00:00:00 时间戳 + startTime = targetMoment.startOf('year').millisecond(0).valueOf(); + endTime = targetMoment.endOf('year').millisecond(0).valueOf(); } - // 调试输出(格式化显示,便于验证) + // 调试输出:验证是否去掉毫秒 console.log('时间范围计算结果:', { mode, - startTime: moment(startTime).format('YYYY-MM-DD HH:mm:ss'), - endTime: moment(endTime).format('YYYY-MM-DD HH:mm:ss'), - startTimeStamp: startTime, - endTimeStamp: endTime + startTime: moment(startTime * 1000).format('YYYY-MM-DD HH:mm:ss'), // 格式:2025-11-30 00:00:00 + endTime: moment(endTime * 1000).format('YYYY-MM-DD HH:mm:ss'), // 格式:2025-11-30 23:59:59(无毫秒) + startTimeStamp: startTime, // 秒级时间戳(如:1764422400) + endTimeStamp: endTime // 秒级时间戳(如:1764508799) }); return { startTime, endTime, mode }; diff --git a/src/views/home/fuelCostAnalysis.vue b/src/views/home/fuelCostAnalysis.vue index a58c562b..702b62e8 100644 --- a/src/views/home/fuelCostAnalysis.vue +++ b/src/views/home/fuelCostAnalysis.vue @@ -169,9 +169,9 @@ export default { // startTime: this.startTime, // endTime: this.endTime, // mode: this.mode, - startTime: 1762704000000, - endTime: 1762790400000, - mode: 1, + startTime: this.dateData.startTime, + endTime: this.dateData.endTime, + mode: this.dateData.mode, trendName: "燃料成本", levelId: this.levelId ? this.levelId :1 }; diff --git a/src/views/home/fuelPowerCostAnalysis.vue b/src/views/home/fuelPowerCostAnalysis.vue index 98916132..81563c26 100644 --- a/src/views/home/fuelPowerCostAnalysis.vue +++ b/src/views/home/fuelPowerCostAnalysis.vue @@ -170,9 +170,9 @@ export default { // startTime: this.startTime, // endTime: this.endTime, // mode: this.mode, - startTime: 1762704000000, - endTime: 1762790400000, - mode: 1, + startTime: this.dateData.startTime, + endTime: this.dateData.endTime, + mode: this.dateData.mode, trendName: "燃动力成本", levelId: this.levelId ? this.levelId : 1 }; diff --git a/src/views/home/index.vue b/src/views/home/index.vue index ff0aaf96..7dc1e323 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -22,7 +22,7 @@ grid-template-columns: 560px 745px 560px ; "> - + @@ -39,7 +39,7 @@ import coreBottomLeft from './components/coreBottomLeft.vue' import orderProgress from './components/orderProgress.vue' import keyWork from './components/keyWork.vue' // import moment from 'moment' -import { getOperateCockpit } from '@/api/cockpit' +import { getOperateCockpit, getOrderDetail } from '@/api/cockpit' export default { name: 'DayReport', components: { ReportHeader, coreSalesKPIs, keyProductionIndicators, coreBottomLeft, keyWork, orderProgress, financeCosts }, @@ -49,6 +49,7 @@ export default { timer: null, beilv: 1, value: 100, + orderTableData:[], productData: {}, purchase: {}, dateData:{}, @@ -107,13 +108,14 @@ export default { } }, methods: { - getOrderData(num) { - this.getData({ - startTime: this.dateData.startTime, - endTime: this.dateData.endTime, - timeDim: this.dateData.mode, + async getOrderData(num) { + const res = await getOrderDetail({ + // startTime: this.dateData.startTime, + // endTime: this.dateData.endTime, + // timeDim: this.dateData.mode, baseId: num }) + this.orderTableData = res.data }, getData(obj) { console.log('obj', obj); diff --git a/src/views/home/operatingRevenue.vue b/src/views/home/operatingRevenue.vue index 74b4df6e..31227805 100644 --- a/src/views/home/operatingRevenue.vue +++ b/src/views/home/operatingRevenue.vue @@ -143,7 +143,7 @@ export default { getSalesRevenueData({ startTime: obj.startTime, endTime: obj.endTime, - timeDim: 1 + timeDim: obj.mode }).then((res) => { console.log(res); this.saleData = res.data.SaleData diff --git a/src/views/home/packagingCostAnalysis.vue b/src/views/home/packagingCostAnalysis.vue index 486150c0..96b5da0d 100644 --- a/src/views/home/packagingCostAnalysis.vue +++ b/src/views/home/packagingCostAnalysis.vue @@ -170,9 +170,9 @@ export default { // startTime: this.startTime, // endTime: this.endTime, // mode: this.mode, - startTime: 1762704000000, - endTime: 1762790400000, - mode: 1, + startTime: this.dateData.startTime, + endTime: this.dateData.endTime, + mode: this.dateData.mode, trendName: "包装物辅材成本", levelId: this.levelId ? this.levelId : 1 }; diff --git a/src/views/home/productionCostsAnalysis.vue b/src/views/home/productionCostsAnalysis.vue index d334c134..11eb3431 100644 --- a/src/views/home/productionCostsAnalysis.vue +++ b/src/views/home/productionCostsAnalysis.vue @@ -170,9 +170,9 @@ export default { // startTime: this.startTime, // endTime: this.endTime, // mode: this.mode, - startTime: 1762704000000, - endTime: 1762790400000, - mode: 1, + startTime: this.dateData.startTime, + endTime: this.dateData.endTime, + mode: this.dateData.mode, trendName: "制造费用成本", levelId: this.levelId ? this.levelId : 1 }; diff --git a/src/views/home/profitAnalysis.vue b/src/views/home/profitAnalysis.vue index 1e18fcc7..09028499 100644 --- a/src/views/home/profitAnalysis.vue +++ b/src/views/home/profitAnalysis.vue @@ -158,9 +158,9 @@ export default { methods: { getData(obj) { getProfitAnalysisData({ - startTime: 1762704000000, - endTime: 1762790400000, - mode: 1 + startTime: obj.startTime, + endTime: obj.endTime, + mode: obj.mode, }).then((res) => { this.profitTotalData = res.data.overviewProfitData.filter(item => { diff --git a/src/views/home/profitImpactAnalysis.vue b/src/views/home/profitImpactAnalysis.vue index fce256b4..0be47186 100644 --- a/src/views/home/profitImpactAnalysis.vue +++ b/src/views/home/profitImpactAnalysis.vue @@ -160,9 +160,9 @@ export default { // startTime: this.startTime, // endTime: this.endTime, // mode: this.mode, - startTime: 1762704000290, - endTime: 1762790399290, - mode: 1, + startTime: this.dateData.startTime, + endTime: this.dateData.endTime, + mode: this.dateData.mode, // analysisObject: this.analysisObject, analysisObject: ["石灰石"], levelId: this.levelId ? this.levelId : 1 diff --git a/src/views/home/rawMaterialCostAnalysis.vue b/src/views/home/rawMaterialCostAnalysis.vue index 6b42bea9..0bac4d4e 100644 --- a/src/views/home/rawMaterialCostAnalysis.vue +++ b/src/views/home/rawMaterialCostAnalysis.vue @@ -156,11 +156,11 @@ export default { // this.dateData = obj // console.log('obj', obj); getCostAnalysisXXCostList({ - startTime: "1762704000290", - endTime: "1762790399290", - mode: 1, + startTime: this.dateData.startTime, + endTime: this.dateData.endTime, + mode: this.dateData.mode, trendName: "原料成本", - levelId: 2 + levelId: this.levelId }).then((res) => { this.itemData = res.data[0].map((item) => { return { diff --git a/src/views/home/singleFuelAnalysis.vue b/src/views/home/singleFuelAnalysis.vue index 90cdc3b8..382afd75 100644 --- a/src/views/home/singleFuelAnalysis.vue +++ b/src/views/home/singleFuelAnalysis.vue @@ -185,9 +185,9 @@ export default { // startTime: this.startTime, // endTime: this.endTime, // mode: this.mode, - startTime: 1762704000000, - endTime: 1762790400000, - mode: 1, + startTime: this.dateData.startTime, + endTime: this.dateData.endTime, + mode: this.dateData.mode, analysisObject: this.analysisObject, levelId: this.levelId ? this.levelId : 1 }; diff --git a/src/views/home/singlePackingAnalysis.vue b/src/views/home/singlePackingAnalysis.vue index 2eb60667..429bf8d2 100644 --- a/src/views/home/singlePackingAnalysis.vue +++ b/src/views/home/singlePackingAnalysis.vue @@ -186,9 +186,9 @@ export default { // startTime: this.startTime, // endTime: this.endTime, // mode: this.mode, - startTime: 1762704000000, - endTime: 1762790400000, - mode: 1, + startTime: this.dateData.startTime, + endTime: this.dateData.endTime, + mode: this.dateData.mode, analysisObject: this.analysisObject, levelId: this.levelId ? this.levelId : 1 }; diff --git a/src/views/home/singleRawMaterialAnalysis.vue b/src/views/home/singleRawMaterialAnalysis.vue index 8a2d0e88..7ac7833a 100644 --- a/src/views/home/singleRawMaterialAnalysis.vue +++ b/src/views/home/singleRawMaterialAnalysis.vue @@ -180,9 +180,9 @@ export default { // startTime: this.startTime, // endTime: this.endTime, // mode: this.mode, - startTime: 1762704000000, - endTime: 1762790400000, - mode: 1, + startTime: this.dateData.startTime, + endTime: this.dateData.endTime, + mode: this.dateData.mode, analysisObject: this.analysisObject, levelId: this.levelId ? this.levelId : 1 }; diff --git a/src/views/home/singlecombustionPowerAnalysis.vue b/src/views/home/singlecombustionPowerAnalysis.vue index e3116438..c5751343 100644 --- a/src/views/home/singlecombustionPowerAnalysis.vue +++ b/src/views/home/singlecombustionPowerAnalysis.vue @@ -186,9 +186,9 @@ export default { // startTime: this.startTime, // endTime: this.endTime, // mode: this.mode, - startTime: 1762704000000, - endTime: 1762790400000, - mode: 1, + startTime: this.dateData.startTime, + endTime: this.dateData.endTime, + mode: this.dateData.mode, analysisObject: this.analysisObject, levelId: this.levelId ? this.levelId : 1 }; diff --git a/vue.config.js b/vue.config.js index 62327384..3e4dbe2a 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,16 +1,16 @@ -'use strict' -const path = require('path') -const defaultSettings = require('./src/settings.js') +"use strict"; +const path = require("path"); +const defaultSettings = require("./src/settings.js"); function resolve(dir) { - return path.join(__dirname, dir) + return path.join(__dirname, dir); } -const CompressionPlugin = require('compression-webpack-plugin') +const CompressionPlugin = require("compression-webpack-plugin"); const name = process.env.VUE_APP_TITLE || "洛玻集团驾驶舱"; // 网页标题 -const port = process.env.port || process.env.npm_config_port || 80 // 端口 +const port = process.env.port || process.env.npm_config_port || 80; // 端口 // vue.config.js 配置说明 //官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions @@ -19,120 +19,115 @@ module.exports = { // 部署生产环境和开发环境下的URL。 // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 - publicPath: process.env.PUBLIC_PATH ? process.env.PUBLIC_PATH : '/', + publicPath: process.env.PUBLIC_PATH ? process.env.PUBLIC_PATH : "/", // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist) - outputDir: 'dist', + outputDir: "dist", // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下) - assetsDir: 'static', + assetsDir: "static", // 是否开启eslint保存检测,有效值:ture | false | 'error' - lintOnSave: process.env.NODE_ENV === 'development', + lintOnSave: process.env.NODE_ENV === "development", // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。 productionSourceMap: false, // webpack-dev-server 相关配置 devServer: { - host: '0.0.0.0', + host: "0.0.0.0", port: port, open: true, proxy: { // detail: https://cli.vuejs.org/config/#devserver-proxy - ['/proxy-api']: { + ["/proxy-api"]: { target: `http://localhost:48080`, // target: `http://api-dashboard.yudao.iocoder.cn`, changeOrigin: true, pathRewrite: { - ['^' + process.env.VUE_APP_BASE_API]: '' - } - } + ["^" + process.env.VUE_APP_BASE_API]: "", + }, + }, }, - disableHostCheck: true + disableHostCheck: true, }, css: { loaderOptions: { sass: { - sassOptions: { outputStyle: "expanded" } - } - } + sassOptions: { outputStyle: "expanded" }, + }, + }, }, configureWebpack: { name: name, resolve: { alias: { - '@': resolve('src') - } + "@": resolve("src"), + }, }, plugins: [ // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件 new CompressionPlugin({ - cache: false, // 不启用文件缓存 - test: /\.(js|css|html)?$/i, // 压缩文件格式 - filename: '[path].gz[query]', // 压缩后的文件名 - algorithm: 'gzip', // 使用gzip压缩 - minRatio: 0.8 // 压缩率小于1才会压缩 - }) + cache: false, // 不启用文件缓存 + test: /\.(js|css|html)?$/i, // 压缩文件格式 + filename: "[path].gz[query]", // 压缩后的文件名 + algorithm: "gzip", // 使用gzip压缩 + minRatio: 0.8, // 压缩率小于1才会压缩 + }), ], }, chainWebpack(config) { - config.plugins.delete('preload') // TODO: need test - config.plugins.delete('prefetch') // TODO: need test + config.plugins.delete("preload"); // TODO: need test + config.plugins.delete("prefetch"); // TODO: need test // set svg-sprite-loader + config.module.rule("svg").exclude.add(resolve("src/assets/icons")).end(); config.module - .rule('svg') - .exclude.add(resolve('src/assets/icons')) - .end() - config.module - .rule('icons') + .rule("icons") .test(/\.svg$/) - .include.add(resolve('src/assets/icons')) + .include.add(resolve("src/assets/icons")) .end() - .use('svg-sprite-loader') - .loader('svg-sprite-loader') + .use("svg-sprite-loader") + .loader("svg-sprite-loader") .options({ - symbolId: 'icon-[name]' + symbolId: "icon-[name]", }) - .end() + .end(); - config - .when(process.env.NODE_ENV !== 'development', - config => { - config - .plugin('ScriptExtHtmlWebpackPlugin') - .after('html') - .use('script-ext-html-webpack-plugin', [{ - // `runtime` must same as runtimeChunk name. default is `runtime` - inline: /runtime\..*\.js$/ - }]) - .end() - config - .optimization.splitChunks({ - chunks: 'all', - cacheGroups: { - libs: { - name: 'chunk-libs', - test: /[\\/]node_modules[\\/]/, - priority: 10, - chunks: 'initial' // only package third parties that are initially dependent - }, - elementUI: { - name: 'chunk-elementUI', // split elementUI into a single package - priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app - test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm - }, - commons: { - name: 'chunk-commons', - test: resolve('src/components'), // can customize your rules - minChunks: 3, // minimum common number - priority: 5, - reuseExistingChunk: true - } - } - }) - config.optimization.runtimeChunk('single'), + config.when(process.env.NODE_ENV !== "development", (config) => { + config + .plugin("ScriptExtHtmlWebpackPlugin") + .after("html") + .use("script-ext-html-webpack-plugin", [ { - from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件 - to: './', //到根目录下 - } - } - ) - } -} + // `runtime` must same as runtimeChunk name. default is `runtime` + inline: /runtime\..*\.js$/, + }, + ]) + .end(); + config.optimization.splitChunks({ + chunks: "all", + cacheGroups: { + libs: { + name: "chunk-libs", + test: /[\\/]node_modules[\\/]/, + priority: 10, + chunks: "initial", // only package third parties that are initially dependent + }, + elementUI: { + name: "chunk-elementUI", // split elementUI into a single package + priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app + test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm + }, + commons: { + name: "chunk-commons", + test: resolve("src/components"), // can customize your rules + minChunks: 3, // minimum common number + priority: 5, + reuseExistingChunk: true, + }, + }, + }); + config.optimization.runtimeChunk("single"), + { + from: path.resolve(__dirname, "./public/robots.txt"), //防爬虫文件 + to: "./", //到根目录下 + }; + }); + }, +};