Config.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.Config = exports.RetCode = void 0;
  4. var RetCode;
  5. (function (RetCode) {
  6. RetCode[RetCode["SUCC"] = 0] = "SUCC";
  7. RetCode[RetCode["INPUT_DIR_IS_NOT_FOUND"] = 1] = "INPUT_DIR_IS_NOT_FOUND";
  8. RetCode[RetCode["EXCEL_DATA_ERROR"] = 2] = "EXCEL_DATA_ERROR";
  9. RetCode[RetCode["NOT_FOUND_ONE_ARRAY_SYMBOL"] = 3] = "NOT_FOUND_ONE_ARRAY_SYMBOL";
  10. RetCode[RetCode["NOT_FOUND_TWO_ARRAY_SYMBOL"] = 4] = "NOT_FOUND_TWO_ARRAY_SYMBOL";
  11. RetCode[RetCode["COL_NAME_REPEAT"] = 5] = "COL_NAME_REPEAT";
  12. RetCode[RetCode["SAME_COL_ROW_UNIQ_REPEAT"] = 6] = "SAME_COL_ROW_UNIQ_REPEAT";
  13. })(RetCode || (exports.RetCode = RetCode = {}));
  14. var Config = /** @class */ (function () {
  15. function Config() {
  16. }
  17. Config.checkState = function (retCode, error) {
  18. if (retCode === void 0) { retCode = RetCode.SUCC; }
  19. if (error === void 0) { error = ''; }
  20. this.retCode = retCode;
  21. this.error = error;
  22. if (this.retCode != RetCode.SUCC) {
  23. console.error(this.error);
  24. process.exit(Config.retCode);
  25. }
  26. };
  27. Config.part = 0.25; // 进度粒度
  28. Config.partIndex = 0; // 粒度进度
  29. Config.inputDir = './input'; // 输入文件夹
  30. Config.outPutDir = './output'; // 输出文件夹
  31. Config.ONE_ARRAY_SYMBOL = '^'; // 一维数组分隔符
  32. Config.TWO_ARRAY_SYMBOL = '|'; // 二维数组分隔符
  33. Config.THREEE_ARRAY_SYMBOL = '#'; // 三维数组分隔符
  34. Config.jsonOutputDir = 'resources/json'; // json 输出文件夹
  35. Config.tsOutputDir = 'scripts/Data'; // 精简ts 输出文件夹
  36. Config.error = ''; // 运行信息
  37. Config.retCode = RetCode.SUCC; // 返回值
  38. Config.yuanRate = 1;
  39. Config.replaceStr = null;
  40. Config.objectKey = '';
  41. return Config;
  42. }());
  43. exports.Config = Config;