12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- /**
- * Created by Tony on 2017/12/8.
- */
- let rpt_tpl_cfg_helper = {
- reportCfg: null,
- getReportTplCfg: function() {
- let me = this, params = {};
- params.userId = userID;
- CommonAjax.postEx("report_tpl_api/getUserRptCfg", params, 20000, true, function(result){
- me.reportCfg = result;
- me.refreshRptCfgs();
- }, null, null
- );
- },
- refreshRptCfgs: function () {
- let me = this;
- if (me.reportCfg) {
- me.reportCfg.borderArr = [];
- for (let style of me.reportCfg.styles) {
- me.reportCfg.borderArr.push(style.ID);
- $("#borderStyles").append("<option value='" + style.ID + "'>" + style.CfgDispName + "</option>");
- $("#elementBorders").append("<option value='" + style.ID + "'>" + style.CfgDispName + "</option>");
- }
- me.reportCfg.fontArr = [];
- for (let font of me.reportCfg.fonts) {
- if (font.CfgDispName) {
- me.reportCfg.fontArr.push(font.ID);
- $("#elementFonts").append("<option value='" + font.ID + "'>" + font.CfgDispName + "</option>");
- } else {
- me.reportCfg.fontArr.push("dummy font");
- }
- }
- me.reportCfg.controlArr = [];
- for (let control of me.reportCfg.ctrls) {
- if (control.CfgDispName) {
- me.reportCfg.controlArr.push(control.ID);
- $("#elementControls").append("<option value='" + control.ID + "'>" + control.CfgDispName + "</option>");
- } else {
- me.reportCfg.controlArr.push("dummy control");
- }
- }
- }
- //elementFonts
- let pf = $("#pageFrequency");
- pf.append("<option value='" + JV.PAGE_STATUS[0] + "'>每页</option>");
- pf.append("<option value='" + JV.PAGE_STATUS[1] + "'>首页</option>");
- pf.append("<option value='" + JV.PAGE_STATUS[2] + "'>尾页</option>");
- pf.append("<option value='" + JV.PAGE_STATUS[3] + "'>章首页</option>");
- pf.append("<option value='" + JV.PAGE_STATUS[4] + "'>章尾页</option>");
- pf.append("<option value='" + JV.PAGE_STATUS[5] + "'>分组</option>");
- pf.append("<option value='" + JV.PAGE_STATUS[6] + "'>交叉行尾页</option>");
- pf.append("<option value='" + JV.PAGE_STATUS[7] + "'>交叉列尾页</option>");
- let ba = $("#bandAlignment");
- ba.append("<option value='" + JV.LAYOUT[0] + "'>上</option>");
- ba.append("<option value='" + JV.LAYOUT[1] + "'>下</option>");
- ba.append("<option value='" + JV.LAYOUT[2] + "'>左</option>");
- ba.append("<option value='" + JV.LAYOUT[3] + "'>右</option>");
- ba.append("<option value='" + JV.LAYOUT[4] + "'>填充</option>");
- },
- checkAndSetSelectedNodeCfg: function (treeNode) {
- if (treeNode[JV.PROP_AREA]) {
- $("#element_font")[0].style.display = "";
- $("#element_border")[0].style.display = "";
- $("#element_control")[0].style.display = "";
- } else {
- $("#element_font")[0].style.display = "none";
- $("#element_border")[0].style.display = "none";
- $("#element_control")[0].style.display = "none";
- }
- },
- fontChange: function(dom) {
- //
- },
- borderChange: function(dom) {
- //
- },
- controlChange: function(dom) {
- //
- },
- changeAlignment: function(dom, type) {
- if (type === "horizon") {
- //
- } else {
- //vertical
- }
- }
- };
|