evmtools-node
Version:
このライブラリは、プライムブレインズ社で利用している「進捗管理ツール(Excel)」ファイルを読み込み、 プロジェクトの進捗状況や要員別の作業量を可視化するためのライブラリです。
35 lines • 1.42 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExcelProjectCreator = void 0;
const excel_csv_read_write_1 = require("excel-csv-read-write");
const MappingProjectCreator_1 = require("./MappingProjectCreator");
class ExcelProjectCreator {
constructor(_excelPath) {
this._excelPath = _excelPath;
}
async createProject() {
const mappings = await (0, excel_csv_read_write_1.excel2json2)({
filePath: this._excelPath,
sheetName: 'ガントチャート',
option: {
startIndex: 0,
useHeader: false,
// columnEndIndex: 26,
},
});
const holidayRawDatas = await (0, excel_csv_read_write_1.excel2json2)({
filePath: this._excelPath,
sheetName: '休日テーブル',
});
// プロジェクト名
const projectName = getFilenameWithoutExtension(this._excelPath);
// 基準日をセット
return new MappingProjectCreator_1.MappingProjectCreator(mappings, projectName, holidayRawDatas).createProject();
}
}
exports.ExcelProjectCreator = ExcelProjectCreator;
const getFilenameWithoutExtension = (fullPath) => {
const filename = fullPath.split(/[/\\]/).pop() ?? '';
return filename.replace(/\.[^/.]+$/, ''); // 最後の .xxx を除去
};
//# sourceMappingURL=ExcelProjectCreator.js.map