projects.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /**
  2. * Created by Zhong on 2018/3/22.
  3. */
  4. /*项目*/
  5. const mongoose = require('mongoose');
  6. const { stringAt } = require('pdfkit/js/data');
  7. const Schema = mongoose.Schema;
  8. const deleteSchema = require('../all_schemas/delete_schema');
  9. const collectionName = 'projects';
  10. const shareSchema = new Schema({
  11. userID: String, //userID
  12. allowCopy: {type: Boolean, default: false},
  13. allowCooperate: {type: Boolean, default: false},
  14. shareDate: String,
  15. }, {versionKey: false, _id: false});
  16. const ProjectSchema = new Schema({
  17. "ID":{type: Number, index: true},
  18. "ParentID": Number,
  19. "NextSiblingID": Number,
  20. "userID": String,
  21. "importedByInterface": {type: Boolean, default: false},
  22. "name": String,
  23. "projType": String,
  24. "recentDateTime": Date,
  25. "createDateTime": Date,
  26. "compilation": String,
  27. "deleteInfo": deleteSchema,
  28. 'fullFolder': Array,
  29. //"shareInfo": [shareSchema],
  30. "property": {
  31. type: Schema.Types.Mixed,
  32. default: {}
  33. },
  34. "location":String,//工程所在地
  35. "summaryFees":{
  36. totalFee: String,
  37. estimateFee: String,
  38. safetyFee: String,
  39. chargeFee: String
  40. },
  41. "changeMark":String,//更新标记 feeRate:费率文件发生了改变,unitFile 单件文件发生了改变
  42. "remark":String, //备注
  43. "fileVer": String, // 创建时程序版本号
  44. "lastFileVer": String // 最新打开并计算时的程序版本号
  45. });
  46. mongoose.model(collectionName, ProjectSchema, collectionName);