1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- /**
- * 编办管理数据模型
- *
- * @author CaiAoLin
- * @date 2017/7/28
- * @version
- */
- const mongoose = require('mongoose');
- let Schema = mongoose.Schema;
- let collectionName = 'compilation';
- let childrenSchema = new Schema({
- id:String,
- // 计价名称
- name: String,
- // 工程专业列表
- engineering_list: {
- type: Schema.Types.Mixed,
- default: []
- },
- // 是否启用
- enable: {
- type: Boolean,
- default: false
- },
- // 类型
- type: {
- type: Number
- }
- },{_id: false});
- let modelSchema = {
- // 是否发布
- is_release: {
- type: Boolean,
- default: false
- },
- // 清单计价规则
- bill_valuation: {
- type: [childrenSchema],
- default: []
- },
- // 定额计价规则
- ration_valuation: {
- type: [childrenSchema],
- default: []
- },
- // 名称
- name: String,
- //描述
- description: String,
- //例题
- example: [],
- //导入欢迎页项目
- adProjects:[],
- //代码覆盖路径
- overWriteUrl:String,
- // 创建时间
- create_time: Number,
- // 创建者id
- creator: String,
- // 发布时间
- release_time: {
- type: Number,
- default: 0
- },
- // cld 办事处id
- categoryID: {
- type: Number,
- default: 12 // 总部id
- }
- };
- mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false, collection: collectionName}));
|