diff --git a/src/components/Modules/MultiLayerPaperTapeWidthAngleCalculate.vue b/src/components/Modules/MultiLayerPaperTapeWidthAngleCalculate.vue index 3152563..87652de 100644 --- a/src/components/Modules/MultiLayerPaperTapeWidthAngleCalculate.vue +++ b/src/components/Modules/MultiLayerPaperTapeWidthAngleCalculate.vue @@ -212,11 +212,9 @@ } try { - const filename = `${t('multiLayerPaperTapeWidthAngleCalculate')}-${new Date().toISOString().slice(0, 10)}.xlsx`.replace(/\s+/g, '') - // 创建工作簿和工作表 const workbook = new EXCEL.Workbook() - const worksheet = workbook.addWorksheet(t('results')) + const worksheet = workbook.addWorksheet(t('multiLayerExcelOutputFile')) // 创建样式 // headerStyle: 表头样式,根据Excel内建样式Calculation设置 @@ -340,13 +338,13 @@ // 添加Results表头列名 worksheet.getCell('A8').value = t('layer') worksheet.getCell('A8').style = parameterStyle - worksheet.getCell('B8').value = t('paperGrammage') + worksheet.getCell('B8').value = t('paperGrammage') + ` (${recordList.value[0].grammage.unit})` worksheet.getCell('B8').style = parameterStyle - worksheet.getCell('C8').value = t('cumulativeThickness') + worksheet.getCell('C8').value = t('cumulativeThickness') + ` (${recordList.value[0].cumulativeThickness.unit})` worksheet.getCell('C8').style = parameterStyle - worksheet.getCell('D8').value = t('angle') + worksheet.getCell('D8').value = t('angle') + ` (${recordList.value[0].angle.unit})` worksheet.getCell('D8').style = parameterStyle - worksheet.getCell('E8').value = t('paperWidth') + worksheet.getCell('E8').value = t('paperWidth') + ` (${recordList.value[0].paperWidth.unit})` worksheet.getCell('E8').style = parameterStyle // 添加Results数据 @@ -440,6 +438,10 @@ } } + // 设置文件名 + const timeStamp = new Date().toISOString().replace(/[-:T]/g, '').slice(0, 15) + const filename = `${t('multiLayerExcelOutputFile')}_${timeStamp}.xlsx` + // 导出为文件 const buffer = await workbook.xlsx.writeBuffer() const blob = new Blob([buffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }) diff --git a/src/locale/en.json b/src/locale/en.json index feae076..f516c26 100644 --- a/src/locale/en.json +++ b/src/locale/en.json @@ -61,5 +61,6 @@ "maximum": "Maximum", "calculatedValue": "Calculated value", "fit": "FIT", - "notFit": "NOT FIT" + "notFit": "NOT FIT", + "multiLayerExcelOutputFile": "MultiLayerPaperTapeWidthAngle" } diff --git a/src/locale/zh.json b/src/locale/zh.json index e1c005d..4e12d5a 100644 --- a/src/locale/zh.json +++ b/src/locale/zh.json @@ -61,5 +61,6 @@ "maximum": "最小值", "calculatedValue": "计算值", "fit": "符合", - "notFit": "不符合" + "notFit": "不符合", + "multiLayerExcelOutputFile": "多层纸带宽度角度计算" }