指挥舱树状菜单样式
This commit is contained in:
@ -101,7 +101,7 @@
|
||||
nodeEventType = "mouseoutCheck";
|
||||
}
|
||||
} else if (tools.eqs(e.type, "click")) {
|
||||
if (setting.check.enable && tools.eqs(target.tagName, "span") && target.getAttribute("treeNode" + consts.id.CHECK) !== null) {
|
||||
if (setting.check.enable && (tools.eqs(target.tagName, "span") || tools.eqs(target.tagName, "svg")) && target.getAttribute("treeNode" + consts.id.CHECK) !== null) {
|
||||
tId = tools.getNodeMainDom(target).id;
|
||||
nodeEventType = "checkNode";
|
||||
}
|
||||
@ -156,12 +156,18 @@
|
||||
_beforeA = function (setting, node, html) {
|
||||
if (setting.check.enable) {
|
||||
data.makeChkFlag(setting, node);
|
||||
html.push("<span ID='", node.tId, consts.id.CHECK, "' class='", view.makeChkClass(setting, node), "' treeNode", consts.id.CHECK, (node.nocheck === true ? " style='display:none;'" : ""), "></span>");
|
||||
if(node.check_Child_State>0 || node.isShow) {
|
||||
html.push("<span ID='", node.tId, consts.id.CHECK, "' class='", view.makeChkClass(setting, node), "' treeNode", consts.id.CHECK, (node.nocheck === true ? " style='display:none;'" : ""), `><svg style="pointer-events: none;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14" viewBox="0 0 14 14" fill="none"><path fill="rgba(var(--color-base1), 1)" d="M7.34788e-16 2L-2.20436e-15 12C-2.40727e-15 13.1046 0.895431 14 2 14L12 14C13.1046 14 14 13.1046 14 12L14 2C14 0.895431 13.1046 -1.46958e-15 12 -1.46958e-15L2 -1.46958e-15C0.895431 -1.60485e-15 8.02424e-16 0.895431 7.34788e-16 2Z"></path><path d="M5.47283 8.3039L3.10764 6.12807C3.06194 6.08647 2.99525 6.08647 2.94955 6.12946L2.04424 6.98093C1.98989 7.03224 1.98495 7.12376 2.03312 7.18201L6.03602 11.9566C6.09778 12.0301 6.20647 12.0065 6.24105 11.9136C7.03644 9.69343 9.25835 5.63439 11.9619 2.69585C11.999 2.65564 12.0101 2.59601 11.9904 2.54331L11.8211 2.08568C11.7915 2.00525 11.7038 1.97474 11.6396 2.02328C8.63587 4.21019 6.45966 6.92546 5.47283 8.3039Z" fill="#004242" ></path></svg></span>`);
|
||||
}
|
||||
else {
|
||||
html.push("<span ID='", node.tId, consts.id.CHECK, "' class='", view.makeChkClass(setting, node), "' treeNode", consts.id.CHECK, (node.nocheck === true ? " style='display:none;'" : ""), `><svg style="pointer-events: none;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14" viewBox="0 0 14 14" fill="none"><path fill-rule="evenodd" fill="url(#linear_border_2442_533_0)" d="M0 12L0 2C0 0.895431 0.895431 0 2 0L12 0C13.1046 0 14 0.895431 14 2L14 12C14 13.1046 13.1046 14 12 14L2 14C0.895431 14 0 13.1046 0 12ZM2 12.5C1.72386 12.5 1.5 12.2761 1.5 12L1.5 2C1.5 1.72386 1.72386 1.5 2 1.5L12 1.5C12.2761 1.5 12.5 1.72386 12.5 2L12.5 12C12.5 12.2761 12.2761 12.5 12 12.5L2 12.5Z"></path><defs><linearGradient id="linear_border_2442_533_0" x1="0" y1="-0.5574798583984375" x2="12.1173095703125" y2="12.878036499023438" gradientUnits="userSpaceOnUse"><stop offset="0.0625" stop-color="rgba(var(--color-base1), 1)" /><stop offset="1" stop-color="var(--color-border1)" /></linearGradient></defs></svg></span>`);
|
||||
}
|
||||
}
|
||||
},
|
||||
//update zTreeObj, add method of check
|
||||
_zTreeTools = function (setting, zTreeTools) {
|
||||
zTreeTools.checkNode = function (node, checked, checkTypeFlag, callbackFlag) {
|
||||
|
||||
var nodeChecked = data.nodeChecked(setting, node);
|
||||
if (node.chkDisabled === true) return;
|
||||
if (checked !== true && checked !== false) {
|
||||
@ -512,6 +518,12 @@
|
||||
obj.show();
|
||||
}
|
||||
obj.attr('class', view.makeChkClass(setting, node));
|
||||
if(node.check_Child_State>0 || node.isShow) {
|
||||
obj.html(`<svg style="pointer-events: none;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14" viewBox="0 0 14 14" fill="none"><path fill="rgba(var(--color-base1), 1)" d="M7.34788e-16 2L-2.20436e-15 12C-2.40727e-15 13.1046 0.895431 14 2 14L12 14C13.1046 14 14 13.1046 14 12L14 2C14 0.895431 13.1046 -1.46958e-15 12 -1.46958e-15L2 -1.46958e-15C0.895431 -1.60485e-15 8.02424e-16 0.895431 7.34788e-16 2Z"></path><path d="M5.47283 8.3039L3.10764 6.12807C3.06194 6.08647 2.99525 6.08647 2.94955 6.12946L2.04424 6.98093C1.98989 7.03224 1.98495 7.12376 2.03312 7.18201L6.03602 11.9566C6.09778 12.0301 6.20647 12.0065 6.24105 11.9136C7.03644 9.69343 9.25835 5.63439 11.9619 2.69585C11.999 2.65564 12.0101 2.59601 11.9904 2.54331L11.8211 2.08568C11.7915 2.00525 11.7038 1.97474 11.6396 2.02328C8.63587 4.21019 6.45966 6.92546 5.47283 8.3039Z" fill="#004242" ></path></svg>`)
|
||||
}
|
||||
else {
|
||||
obj.html(`<svg style="pointer-events: none;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14" viewBox="0 0 14 14" fill="none"><path fill-rule="evenodd" fill="url(#linear_border_2442_533_0)" d="M0 12L0 2C0 0.895431 0.895431 0 2 0L12 0C13.1046 0 14 0.895431 14 2L14 12C14 13.1046 13.1046 14 12 14L2 14C0.895431 14 0 13.1046 0 12ZM2 12.5C1.72386 12.5 1.5 12.2761 1.5 12L1.5 2C1.5 1.72386 1.72386 1.5 2 1.5L12 1.5C12.2761 1.5 12.5 1.72386 12.5 2L12.5 12C12.5 12.2761 12.2761 12.5 12 12.5L2 12.5Z"></path><defs><linearGradient id="linear_border_2442_533_0" x1="0" y1="-0.5574798583984375" x2="12.1173095703125" y2="12.878036499023438" gradientUnits="userSpaceOnUse"><stop offset="0.0625" stop-color="rgba(var(--color-base1), 1)" /><stop offset="1" stop-color="var(--color-border1)" /></linearGradient></defs></svg></span>`)
|
||||
}
|
||||
},
|
||||
setParentNodeCheckBox: function (setting, node, value, srcNode) {
|
||||
var checkObj = $$(node, consts.id.CHECK, setting);
|
||||
|
||||
Reference in New Issue
Block a user