From cd319421d56203c143ae1c8fb5b93df522a56e91 Mon Sep 17 00:00:00 2001 From: wang-liang0615 <53748875+wang-liang0615@users.noreply.github.com> Date: Tue, 12 Dec 2023 13:38:08 +0800 Subject: [PATCH] pref(cmdb-ui):batch upload for date type (#298) * fix(cmdb-ui):set localstorage '' after unsubscribe ci * pref(cmdb-ui):batch upload for date type --- cmdb-ui/src/modules/cmdb/api/batch.js | 3 +-- cmdb-ui/src/modules/cmdb/views/batch/index.vue | 17 +++++++++++++++++ .../cmdb/views/batch/modules/CiUploadTable.vue | 1 + .../modules/cmdb/views/ci_types/triggerForm.vue | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/cmdb-ui/src/modules/cmdb/api/batch.js b/cmdb-ui/src/modules/cmdb/api/batch.js index c37efc5..19f6143 100644 --- a/cmdb-ui/src/modules/cmdb/api/batch.js +++ b/cmdb-ui/src/modules/cmdb/api/batch.js @@ -7,7 +7,7 @@ export function processFile(fileObj) { reader.readAsBinaryString(fileObj) reader.onload = function (e) { const data = e.target.result - const workbook = XLSX.read(data, { type: 'binary' }) + const workbook = XLSX.read(data, { type: 'binary', cellDates: true, }) const sheet = workbook.Sheets[workbook.SheetNames[0]] const lt = XLSX.utils.sheet_to_json(sheet, { header: 1 }) resolve(lt) @@ -56,7 +56,6 @@ export function any(ArrayList) { // 去除一个二维数组 底下为空的部分 export function filterNull(twoDimArray) { - console.log(twoDimArray) const newArray = [] for (let i = 0; i < twoDimArray.length; i++) { if (any(twoDimArray[i])) { diff --git a/cmdb-ui/src/modules/cmdb/views/batch/index.vue b/cmdb-ui/src/modules/cmdb/views/batch/index.vue index 1a4010f..f48f698 100644 --- a/cmdb-ui/src/modules/cmdb/views/batch/index.vue +++ b/cmdb-ui/src/modules/cmdb/views/batch/index.vue @@ -29,6 +29,7 @@