|
|
@@ -143,6 +143,9 @@ let zTreeOprObj = {
|
|
|
items: me.private_build_items(subNode.items, null),
|
|
|
name: subNode.name
|
|
|
};
|
|
|
+ if (subNode.hasOwnProperty('flags')) {
|
|
|
+ rst.flags = subNode.flags;
|
|
|
+ }
|
|
|
}
|
|
|
return rst;
|
|
|
},
|
|
|
@@ -163,6 +166,9 @@ let zTreeOprObj = {
|
|
|
ir.name = item.name;
|
|
|
ir.ID = item.ID;
|
|
|
ir.released = isReleased;
|
|
|
+ if (item.hasOwnProperty('flags')) {
|
|
|
+ ir.flags = item.flags;
|
|
|
+ }
|
|
|
ir.items = me.private_build_items(item.items);
|
|
|
itemRst.push(ir);
|
|
|
}
|
|
|
@@ -353,7 +359,7 @@ let zTreeOprObj = {
|
|
|
let canContinue = false;
|
|
|
if (isCopy) {
|
|
|
me.getNewNodeID(1, function (newNodeID) {
|
|
|
- let orgID = treeNodes[0].ID;
|
|
|
+ let orgID = treeNodes[0].refId; //refId才是正确的模板ID(因可能copy一个有引用的节点),
|
|
|
treeNodes[0].ID = newNodeID;
|
|
|
if (confirm("是否引用相同的报表模板?")) {
|
|
|
newTopNode = me.buildRootNodeDoc(targetTopNode);
|
|
|
@@ -363,6 +369,9 @@ let zTreeOprObj = {
|
|
|
treeNodes[0].rptTpl.ID = newNodeID;
|
|
|
}
|
|
|
me.currentNode = treeNodes[0];
|
|
|
+ me.chkAndSetDupRefTplIds(me.treeObj.getNodes(), null);
|
|
|
+ me.treeObj.refresh();
|
|
|
+ me.chkAndRreshRefTpl();
|
|
|
}, function(badRst){
|
|
|
displayMessage("更新模板节点失败!", "red", 2000);
|
|
|
// console.log(badRst.toString());
|
|
|
@@ -381,6 +390,9 @@ let zTreeOprObj = {
|
|
|
treeNodes[0].rptTpl.ID = newNodeID;
|
|
|
}
|
|
|
me.currentNode = treeNodes[0];
|
|
|
+ me.chkAndSetDupRefTplIds(me.treeObj.getNodes(), null);
|
|
|
+ me.treeObj.refresh();
|
|
|
+ me.chkAndRreshRefTpl();
|
|
|
}, function(badRst){
|
|
|
displayMessage("更新模板节点失败!", "red", 2000);
|
|
|
// console.log(badRst.toString());
|
|
|
@@ -393,9 +405,9 @@ let zTreeOprObj = {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
- if (canContinue) {
|
|
|
- me.chkAndRreshRefTpl();
|
|
|
- }
|
|
|
+ // if (canContinue) {
|
|
|
+ // me.chkAndRreshRefTpl();
|
|
|
+ // }
|
|
|
} else {
|
|
|
newTopNode = me.buildRootNodeDoc(targetTopNode);
|
|
|
me.updateTreeRootNode(newTopNode, false, function(rst){
|
|
|
@@ -530,6 +542,10 @@ let zTreeOprObj = {
|
|
|
tplNode.icon = "/lib/ztree/css/img/diy/3.png";
|
|
|
}
|
|
|
// tplNode.style = "background:url(/lib/ztree/css/img/diy/3.png) 0 0 no-repeat;"
|
|
|
+ } else {
|
|
|
+ //设置白板
|
|
|
+ // if (!tplNode.isParent) tplNode.icon = "/lib/ztree/css/img/diy/10.png";
|
|
|
+ if (!tplNode.isParent) tplNode.className = "button ico_docu";
|
|
|
}
|
|
|
if (tplNode.items && tplNode.items.length > 0) {
|
|
|
for (let subTplNode of tplNode.items) {
|
|
|
@@ -727,6 +743,23 @@ let zTreeOprObj = {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ onChangeFlag: function(flagProp, flagDom){
|
|
|
+ let me = zTreeOprObj;
|
|
|
+ if (me.currentNode && me.currentNode.nodeType === RT.NodeType.TEMPLATE) {
|
|
|
+ if (!me.currentNode.hasOwnProperty("flags")) {
|
|
|
+ me.currentNode.flags = {};
|
|
|
+ }
|
|
|
+ me.currentNode.flags[flagProp] = flagDom.selectedOptions[0].value;
|
|
|
+ let subTopNode = me.getParentNodeByNodeLevel(me.currentNode, NODE_LEVEL_COMPILATION_NEW + 1);
|
|
|
+ let topPNode = subTopNode.getParentNode();
|
|
|
+ let rawNode = me.buildSubRootNodeDoc(subTopNode);
|
|
|
+ me.updateSubNode(topPNode, rawNode, true, function(rst){
|
|
|
+ if (!(rst)) {
|
|
|
+ alert('修改标记:[' + flagProp + '] 失败!');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
createNewTpl: function () {
|
|
|
let me = zTreeOprObj, params = {};
|
|
|
@@ -816,6 +849,17 @@ let zTreeOprObj = {
|
|
|
me.currentNode.rptTpl["GROUP_KEY"] = grp_keys.join("_");
|
|
|
}
|
|
|
tplHelper.refreshTplView(me.currentNode.rptTpl);
|
|
|
+ if (me.currentNode.hasOwnProperty('flags')) {
|
|
|
+ if (me.currentNode.flags.hasOwnProperty('taxType')) {
|
|
|
+ let val = parseInt(me.currentNode.flags['taxType']);
|
|
|
+ $("#element_flags_select")[0].selectedIndex = val;
|
|
|
+ } else {
|
|
|
+ $("#element_flags_select")[0].selectedIndex = 0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $("#element_flags_select")[0].selectedIndex = 0;
|
|
|
+ }
|
|
|
+
|
|
|
if ($("#rpt_tpl_visual_tab")[0].className === "nav-link p-1 active") {
|
|
|
setTimeout(function(){visualJumbo.iniSpreadJs(); visualJumbo.setupTpl()}, 50)
|
|
|
}
|