123456789101112131415161718192021222324252627 |
- /**
- * Created by Tony on 2017/3/24.
- */
- let cache = require('../../../public/cache/cacheUtil');
- let rpt_cfg = require('../models/rpt_cfg');
- const RPT_CFG_GRP = 'rpt_cfg';
- module.exports = {
- setReportDefaultCache: function () {
- rpt_cfg.getByUserId("Administrator", function (err, cfgs) {
- if (cfgs) {
- cache.setCache(RPT_CFG_GRP,'admin_cfg',cfgs);
- }
- })
- },
- getReportDefaultCache: function () {
- 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;
- }
- }
|