|
@@ -2,35 +2,26 @@
|
|
|
* Created by Tony on 2017/3/24.
|
|
|
*/
|
|
|
let cache = require('../../../public/cache/cacheUtil');
|
|
|
-let cmn_ctrl = require('../models/cfg_control');
|
|
|
-let cmn_font = require('../models/cfg_font');
|
|
|
-let cmn_style = require('../models/cfg_style');
|
|
|
+let rpt_cfg = require('../models/rpt_cfg');
|
|
|
|
|
|
const RPT_CFG_GRP = 'rpt_cfg';
|
|
|
|
|
|
module.exports = {
|
|
|
setReportDefaultCache: function () {
|
|
|
- cmn_ctrl.getAll(null, function(err, ctrls){
|
|
|
- if (ctrls) {
|
|
|
- cache.setCache(RPT_CFG_GRP,'common_ctrls',ctrls);
|
|
|
+ rpt_cfg.getByUserId("Administrator", function (err, cfgs) {
|
|
|
+ if (cfgs) {
|
|
|
+ cache.setCache(RPT_CFG_GRP,'admin_cfg',cfgs);
|
|
|
}
|
|
|
- });
|
|
|
- cmn_font.getAll(null, function(err, fonts){
|
|
|
- if (fonts) {
|
|
|
- cache.setCache(RPT_CFG_GRP,'common_fonts',fonts);
|
|
|
- }
|
|
|
- });
|
|
|
- cmn_style.getAll(null, function(err, styles){
|
|
|
- if (styles) {
|
|
|
- cache.setCache(RPT_CFG_GRP,'common_styles',styles);
|
|
|
- }
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
getReportDefaultCache: function () {
|
|
|
- let rst = {ctrls: null, fonts: null, styles: null};
|
|
|
- rst.ctrls = cache.getCache(RPT_CFG_GRP,'common_ctrls');
|
|
|
- rst.fonts = cache.getCache(RPT_CFG_GRP,'common_fonts');
|
|
|
- rst.styles = cache.getCache(RPT_CFG_GRP,'common_styles');
|
|
|
+ let rst = {ctrls: null, fonts: null, styles: null},
|
|
|
+ admin_cfg = cache.getCache(RPT_CFG_GRP,'admin_cfg');
|
|
|
+ ;
|
|
|
+ rst.ctrls = admin_cfg.formats;
|
|
|
+ rst.fonts = admin_cfg.fonts;
|
|
|
+ rst.styles = admin_cfg.borders;
|
|
|
+ admin_cfg = null;
|
|
|
return rst;
|
|
|
}
|
|
|
}
|