proj_setting.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * Created by Mai on 2017/9/14.
  3. */
  4. let mongoose = require("mongoose");
  5. let Schema = mongoose.Schema;
  6. let collectionName = 'proj_setting';
  7. let settingConst = {
  8. billsCalcMode: {
  9. rationContent: 0, rationPrice: 1, rationPriceConverse: 2, billsPrice: 3
  10. },
  11. zanguCalcMode: {
  12. common: 0, gatherMaterial: 1
  13. }
  14. }
  15. let billsCalcModeConst = {
  16. };
  17. let projSettingSchema = {
  18. projectID: Number,
  19. // 列设置
  20. main_tree_col: {
  21. type: Schema.Types.Mixed,
  22. default: {}
  23. },
  24. billsCalcMode: {
  25. type: Number,
  26. default: settingConst.billsCalcMode.rationContent
  27. // rationContent = 0, rationPrice = 1, rationPriceConverse = 2, billsPrice = 3
  28. },
  29. zanguCalcMode: {
  30. type: Number,
  31. default: settingConst.zanguCalcMode.common
  32. }
  33. };
  34. let model = mongoose.model(collectionName, new Schema(projSettingSchema, {versionKey: false, collection: collectionName}));
  35. export {model as default, collectionName as collectionName, settingConst as settingConst};