| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- /**
- * Created by Mai on 2017/9/14.
- */
- let mongoose = require("mongoose");
- let Schema = mongoose.Schema;
- let collectionName = 'proj_setting';
- let settingConst = {
- billsCalcMode: {
- rationContent: 0, rationPriceConverse: 1, rationPrice: 2, billsPrice: 3
- },
- zanguCalcMode: {
- common: 0, gatherMaterial: 1
- }
- }
- let billsCalcModeConst = {
-
- };
- // 呈现选项
- const displayOption = {
- autoHeight: 0,
- rationDisplay: 0
- };
- let projSettingSchema = {
- projectID: Number,
- // 列设置
- main_tree_col: {
- type: Schema.Types.Mixed,
- default: {}
- },
- billsCalcMode: {
- type: Number,
- default: settingConst.billsCalcMode.rationContent
- },
- zanguCalcMode: {
- type: Number,
- default: settingConst.zanguCalcMode.common
- },
- displayOption: {
- type: Schema.Types.Mixed,
- default: displayOption
- }
- };
- let model = mongoose.model(collectionName, new Schema(projSettingSchema, {versionKey: false, collection: collectionName}));
- export {model as default, collectionName as collectionName, settingConst as settingConst, displayOption as displayOption};
|