|
@@ -12,9 +12,13 @@ class ExcelimportService extends Service {
|
|
|
|
|
|
// 获取导入的XLSX文件中的数据
|
|
// 获取导入的XLSX文件中的数据
|
|
async getImportXLSXData(elem) {
|
|
async getImportXLSXData(elem) {
|
|
- const filepath = this.ctx.app.config.fileDirImp + elem.content;
|
|
|
|
|
|
+ // 导入学籍的情况
|
|
if (elem.type === '0') {
|
|
if (elem.type === '0') {
|
|
- const workbook = XLSX.readFile(filepath);
|
|
|
|
|
|
+ const filepath = this.ctx.app.config.baseDirImp + elem.content;
|
|
|
|
+ const file = await this.ctx.curl(filepath);
|
|
|
|
+ console.log(11111);
|
|
|
|
+ console.log(file.data);
|
|
|
|
+ const workbook = XLSX.read(file.data);
|
|
// 读取内容
|
|
// 读取内容
|
|
const sheetNames = workbook.SheetNames; // 获取所有sheet页
|
|
const sheetNames = workbook.SheetNames; // 获取所有sheet页
|
|
const sheet = workbook.Sheets[sheetNames[0]]; // 通过取得当前sheet页
|
|
const sheet = workbook.Sheets[sheetNames[0]]; // 通过取得当前sheet页
|