rpt_cfg.js 1.4 KB

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