rpt_cfg.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * Created by Tony on 2017/6/14.
  3. * 把报表相关的配置(字体、边框、格式等都放在一条记录中,方便整理,毕竟用户的报表格式基本是固定的,无需怎样调整)
  4. */
  5. import mongoose from "mongoose";
  6. let Schema = mongoose.Schema;
  7. let FormatSchema = new Schema({
  8. "ID" : String,
  9. "CfgDispName": String,
  10. "Shrink" : String,
  11. "ShowZero" : String,
  12. "Horizon" : String,
  13. "Vertical" : String,
  14. "Wrap" : String,
  15. "ShrinkFirst" : String,
  16. "CloseOutput" : String
  17. });
  18. let FontSchema = new Schema({
  19. "ID" : String,
  20. "Name" : String,
  21. "CfgDispName": String,
  22. "FontHeight" : String,
  23. "FontColor" : String,
  24. "FontBold" : String,
  25. "FontItalic" : String,
  26. "FontUnderline" : String,
  27. "FontStrikeOut" : String,
  28. "FontAngle" : String
  29. });
  30. let LineSchema = new Schema({
  31. "Position": String,
  32. "LineWeight": String,
  33. "DashStyle": String,
  34. "Color": String
  35. });
  36. let StyleSchema = new Schema({
  37. "ID" : String,
  38. "CfgDispName": String,
  39. "border_style" : [LineSchema]
  40. });
  41. let RptCfgSchema = new Schema({
  42. "userId" : String,
  43. "fonts": [FontSchema],
  44. "borders" : [StyleSchema],
  45. "formats" : [FormatSchema]
  46. });
  47. mongoose.model("rpt_cfg", RptCfgSchema, "rpt_cfg");
  48. // let Rpt_Cfg_Mdl = mongoose.model("rpt_cfg", RptCfgSchema, "rpt_cfg");
  49. // export {Rpt_Cfg_Mdl as default};