diff --git a/cclqms-vue/src/i18n/locales/qc.en.js b/cclqms-vue/src/i18n/locales/qc.en.js index 9fdc083..a7befe0 100644 --- a/cclqms-vue/src/i18n/locales/qc.en.js +++ b/cclqms-vue/src/i18n/locales/qc.en.js @@ -976,7 +976,7 @@ module.exports = { dataSyncConfirm: 'Run material catalog data sync?', dataSyncSuccess: 'Data sync completed', dataSyncFail: 'Data sync failed', - exportPrefix: 'InspectionTemplateByMaterial', + exportPrefix: 'Inspection template by material', exportHeader: 'Inspection template by material', tableNameMain: 'Material attribute settings', tableNameTemplate: 'Inspection template list', diff --git a/cclqms-vue/src/utils/excel-util.js b/cclqms-vue/src/utils/excel-util.js index 4f86f55..af4a708 100644 --- a/cclqms-vue/src/utils/excel-util.js +++ b/cclqms-vue/src/utils/excel-util.js @@ -154,9 +154,25 @@ let export2Excel = opt => { setStyle(ws, merges); } // console.log(ws); - const wb = XLSX.utils.book_new(); - XLSX.utils.book_append_sheet(wb, ws, options.fileName.replace(/\.xlsx/, "")); - XLSX.writeFile(wb, options.fileName); + const wb = XLSX.utils.book_new(); + +// Excel sheet名称限制:最大31个字符,且不能包含 \ / ? * [ ] + let sheetName = options.fileName + .replace(/\.xlsx/, "") + .replace(/[\\\/\?\*\[\]]/g, ""); + +// 限制31字符 + if (sheetName.length > 31) { + sheetName = sheetName.substring(0, 31); + } + + XLSX.utils.book_append_sheet( + wb, + ws, + sheetName + ); + + XLSX.writeFile(wb, options.fileName); }); } diff --git a/cclqms-vue/src/views/modules/qc/qcPartAttribute.vue b/cclqms-vue/src/views/modules/qc/qcPartAttribute.vue index 908cee0..662d4f4 100644 --- a/cclqms-vue/src/views/modules/qc/qcPartAttribute.vue +++ b/cclqms-vue/src/views/modules/qc/qcPartAttribute.vue @@ -373,7 +373,7 @@ - + @@ -412,7 +412,7 @@ - + @@ -942,7 +942,7 @@ - + @@ -4949,7 +4949,7 @@ export default { }, openQcSpecWarningDialog(row) { this.qcSpecWarningCurrentRow = row - + this.qcSpecWarningList = [] this.qcSpecWarningDialogFlag = true this.loadQcSpecWarningDictOptions().then(() => { @@ -6640,13 +6640,12 @@ export default { this.searchData.page = 1 excel.exportTable({ url: '/pms/qc/qcPartAttributeSearch', - columnMapping: this.columnList, //可以直接用table,不需要的列就剔除 - mergeSetting: [], //需要合并的列 + columnMapping: this.columnList, params: this.searchData, fileName: this.exportName + '.xlsx', - rowFetcher: (res) => res.data, - columnFormatter: [], - dropColumns: [], + rowFetcher: (res) => { + return res.data + }, }) },