proj_setting.js 814 B

12345678910111213141516171819202122232425
  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 billsCalcModeConst = {
  8. rationContent: 0, rationPrice: 1, rationPriceConverse: 2, billsPrice: 3
  9. };
  10. let projSettingSchema = {
  11. projectID: Number,
  12. // 列设置
  13. main_tree_col: {
  14. type: Schema.Types.Mixed,
  15. default: {}
  16. },
  17. billsCalcMode: {
  18. type: Number,
  19. default: billsCalcModeConst.rationContent
  20. // rationContent = 0, rationPrice = 1, rationPriceConverse = 2, billsPrice = 3
  21. }
  22. };
  23. let model = mongoose.model(collectionName, new Schema(projSettingSchema, {versionKey: false, collection: collectionName}));
  24. export {model as default, collectionName as collectionName, billsCalcModeConst as billsCalcModeConst};