|
|
@@ -5,17 +5,41 @@ const reportFormatSetupObj = {
|
|
|
fieldParamOptions: null,
|
|
|
maxFieldID: -1,
|
|
|
currentRptId: -1,
|
|
|
+ currentTopNode: '定制报表',
|
|
|
onCheck: (event, treeId, treeNode) => {
|
|
|
//
|
|
|
},
|
|
|
+ switchButtonEnables: (isSetupEnabled = true, isPermissionEnabled = false) => {
|
|
|
+ $('#btn_confirm_format_setup').attr("disabled", !isSetupEnabled);
|
|
|
+ $('#rpt_title_input').attr("disabled", !isSetupEnabled);
|
|
|
+ $("#add_user_dropdownMenuButton").attr('disabled', !isPermissionEnabled);
|
|
|
+ $("#apply_users_toOtherMenuButton")[0].style.display = !isPermissionEnabled ? 'none' : '';
|
|
|
+ },
|
|
|
onClick: (event,treeId,treeNode) => {
|
|
|
const me = reportFormatSetupObj;
|
|
|
- if (treeNode.nodeType === RT.NodeType.TEMPLATE) {
|
|
|
- me.currentRptId = treeNode.refId;
|
|
|
- me.initialize(treeNode);
|
|
|
- } else {
|
|
|
+ if (treeNode.nodeType !== RT.NodeType.TEMPLATE) {
|
|
|
me.currentRptId = -1;
|
|
|
- }
|
|
|
+ me.clearTplProperties();
|
|
|
+ const jDom = $("#report-permission-div");
|
|
|
+ jDom.empty();
|
|
|
+ me.switchButtonEnables(false, false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let pNode = treeNode;
|
|
|
+ while (pNode.level > 0) {
|
|
|
+ pNode = pNode.getParentNode();
|
|
|
+ }
|
|
|
+ me.currentTopNode = pNode.name;
|
|
|
+ me.currentRptId = treeNode.refId;
|
|
|
+ if (me.currentTopNode === '定制报表') {
|
|
|
+ me.switchButtonEnables(true, true);
|
|
|
+ me.initialize(treeNode);
|
|
|
+ } else {
|
|
|
+ me.switchButtonEnables(false, true);
|
|
|
+ me.clearTplProperties();
|
|
|
+ reportPermissionObj.iniReportPermission();
|
|
|
+ reportPermissionObj.updateSelectedMarks();
|
|
|
+ }
|
|
|
},
|
|
|
onDeleteInfo: (dom) => {
|
|
|
// 删除表眉、表脚项
|
|
|
@@ -89,6 +113,7 @@ const reportFormatSetupObj = {
|
|
|
},
|
|
|
onAddSignature: (dom) => {
|
|
|
const me = reportFormatSetupObj;
|
|
|
+ if (me.currentRptId === -1) return;
|
|
|
me.maxFieldID++;
|
|
|
const newSignature = [];
|
|
|
newSignature.push('<li class="d-flex justify-content-start align-items-center mb-3">');
|