rpt_cfg.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. });
  16. let FontSchema = new Schema({
  17. "ID" : String,
  18. "Name" : String,
  19. "CfgDispName": String,
  20. "FontHeight" : String,
  21. "FontColor" : String,
  22. "FontBold" : String,
  23. "FontItalic" : String,
  24. "FontUnderline" : String,
  25. "FontStrikeOut" : String,
  26. "FontAngle" : String
  27. });
  28. let LineSchema = new Schema({
  29. "Position": String,
  30. "LineWeight": String,
  31. "DashStyle": String,
  32. "Color": String
  33. });
  34. let StyleSchema = new Schema({
  35. "ID" : String,
  36. "CfgDispName": String,
  37. "border_style" : [LineSchema]
  38. });
  39. let RptCfgSchema = new Schema({
  40. "userId" : String,
  41. "fonts": [FontSchema],
  42. "borders" : [StyleSchema],
  43. "formats" : [FormatSchema]
  44. });
  45. mongoose.model("rpt_cfg", RptCfgSchema, "rpt_cfg");
  46. // let Rpt_Cfg_Mdl = mongoose.model("rpt_cfg", RptCfgSchema, "rpt_cfg");
  47. // export {Rpt_Cfg_Mdl as default};