|
@@ -116,17 +116,17 @@ class LuckySheet extends React.Component {
|
|
// }, 300);
|
|
// }, 300);
|
|
// },
|
|
// },
|
|
};
|
|
};
|
|
- console.log(version)
|
|
|
|
- if(version.flow_id) {
|
|
|
|
|
|
+ console.log(version);
|
|
|
|
+ if (version.flow_id) {
|
|
option.authority = {
|
|
option.authority = {
|
|
sheet: true,
|
|
sheet: true,
|
|
- hintText: '当前处于审批节点,禁止编辑!'
|
|
|
|
- }
|
|
|
|
- } else if(version.audit_status != 0 || version.status == 1) {
|
|
|
|
|
|
+ hintText: '当前处于审批节点,禁止编辑!',
|
|
|
|
+ };
|
|
|
|
+ } else if (version.audit_status != 0 || version.status == 1) {
|
|
option.authority = {
|
|
option.authority = {
|
|
sheet: true,
|
|
sheet: true,
|
|
- hintText: '当前清单不可编辑!'
|
|
|
|
- }
|
|
|
|
|
|
+ hintText: '当前清单不可编辑!',
|
|
|
|
+ };
|
|
}
|
|
}
|
|
} else if (data && data.length > 0) {
|
|
} else if (data && data.length > 0) {
|
|
option.data = JSON.parse(JSON.stringify(data));
|
|
option.data = JSON.parse(JSON.stringify(data));
|
|
@@ -439,7 +439,7 @@ class LuckySheet extends React.Component {
|
|
// });
|
|
// });
|
|
// }
|
|
// }
|
|
|
|
|
|
- downloadExcel(checkValue) {
|
|
|
|
|
|
+ getExcelData(checkValue = null) {
|
|
let resultList = [];
|
|
let resultList = [];
|
|
console.log(this.luckysheet.getAllSheets());
|
|
console.log(this.luckysheet.getAllSheets());
|
|
|
|
|
|
@@ -447,24 +447,21 @@ class LuckySheet extends React.Component {
|
|
currentData.forEach(sheet => {
|
|
currentData.forEach(sheet => {
|
|
let data = sheet.data;
|
|
let data = sheet.data;
|
|
let celldata = sheet.celldata;
|
|
let celldata = sheet.celldata;
|
|
- //获取当前导出列的数组
|
|
|
|
let colList = [];
|
|
let colList = [];
|
|
data[0]?.forEach((rowOneItem, colIdx) => {
|
|
data[0]?.forEach((rowOneItem, colIdx) => {
|
|
- if (rowOneItem && checkValue.indexOf(rowOneItem.v) !== -1) {
|
|
|
|
- colList.indexOf(colIdx) == -1 ? colList.push(colIdx) : true;
|
|
|
|
|
|
+ if (rowOneItem) {
|
|
|
|
+ if (!checkValue || checkValue.indexOf(rowOneItem.v) !== -1) {
|
|
|
|
+ colList.indexOf(colIdx) == -1 ? colList.push(colIdx) : true;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
- //处理data
|
|
|
|
const newData = [];
|
|
const newData = [];
|
|
data.forEach(item => {
|
|
data.forEach(item => {
|
|
if (item !== null) {
|
|
if (item !== null) {
|
|
let arr = item.filter((cur, idx) => {
|
|
let arr = item.filter((cur, idx) => {
|
|
return item && colList.includes(idx);
|
|
return item && colList.includes(idx);
|
|
});
|
|
});
|
|
- // let len = item.length - arr.length
|
|
|
|
- // let nullList = new Array(len).fill(null);
|
|
|
|
- // let rowList = arr.concat(nullList);
|
|
|
|
newData.push(arr);
|
|
newData.push(arr);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -485,6 +482,11 @@ class LuckySheet extends React.Component {
|
|
});
|
|
});
|
|
sheet.celldata = newCellData;
|
|
sheet.celldata = newCellData;
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ return currentData;
|
|
|
|
+ }
|
|
|
|
+ downloadExcel(checkValue) {
|
|
|
|
+ let currentData = this.getExcelData(checkValue);
|
|
exportExcel(currentData, '下载');
|
|
exportExcel(currentData, '下载');
|
|
}
|
|
}
|
|
|
|
|