proj_setting.js 948 B

123456789101112131415161718192021222324252627282930313233343536
  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, rationPriceConverse: 1, rationPrice: 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. },
  28. zanguCalcMode: {
  29. type: Number,
  30. default: settingConst.zanguCalcMode.common
  31. }
  32. };
  33. let model = mongoose.model(collectionName, new Schema(projSettingSchema, {versionKey: false, collection: collectionName}));
  34. export {model as default, collectionName as collectionName, settingConst as settingConst};