bw/static/qmodel/qmodel.js

4 lines
1.5 MiB
JavaScript
Raw Permalink Normal View History

2023-11-30 20:42:18 +08:00
/*! For license information please see qmodel.min.js.LICENSE.txt */
2023-12-08 20:16:26 +08:00
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.QModelX=t():e.QModelX=t()}(self,(()=>(()=>{var t={111:(e,t,i)=>{"use strict";function n(e,t){var i=document.createElement(e);return i.setAttribute("class",t),i}i.d(t,{O:()=>r,W:()=>s});var r=function(e,t,i,r,s){this.id=i,this.parent=null,this.parentId=0,this.type=r,this.getOperator=t,this.element=n("div","qm-tree"),this.element.setAttribute("title",e);var a="qm-tree-node";s&&(a+=" qm-collapse"),this.treeNodeDOM=n("div",a),this.element.appendChild(this.treeNodeDOM),this._opt={isChecked:!0},this._selectionState="unSelected",this.setData(e),this.subTreeList=[]};r.prototype.setData=function(e){var t=this,i=this._opt.isChecked?"qm-checked":"";t.checkDOM=n("span","qm-label "+i),t.checkDOM.innerHTML='<input type="checkbox" checked="'+t._opt.isChecked+'"><span class="qm-checkbox iconfont icon-duoxuan-xuanzhong"></span>',t.treeNodeDOM.appendChild(this.checkDOM),t.checkDOM.addEventListener("click",(function(e){var i=this.getElementsByTagName("input")[0].checked;if(0==t.type?t.getOperator()._Nz52BEByTree(-1,0,0,i):3==t.type?t.getOperator()._Nz52BEByTree(t.parent.parentId,t.parentId,t.id,i):1==t.type?t.getOperator()._Nz52BEByTree(t.parentId,t.id,0,i):4==t.type?t.getOperator()._Nz52BEByTree(t.id,0,0,i):5==t.type?t.id.data.forEach((e=>{t.getOperator()._Nz52BEByTree(e,0,0,i)})):6==t.type?t.id.data.forEach((e=>{t.getOperator()._Nz52BEByTree(e.doc,e.level,0,i)})):6==t.type&&t.id.data.forEach((e=>{t.getOperator()._Nz52BEByTree(e.doc,e.level,e.category,i)})),t._opt.isChecked=i,t.OnbfLableClick(e,i),t.parent)if(i){for(var n=0;n<t.parent.subTreeList.length&&!t.parent.subTreeList[n].checkDOM.classList.contains("qm_checked");n++);t.parent.checkDOM.classList.remove("qm-checked"),t.parent.checkDOM.classList.add("qm-unchecked")}else t.parent.checkDOM.classList.remove("qm-unchecked"),t.parent.checkDOM.classList.add("qm-checked");var r=i?"unchecked":"checked";console.log(r)})),this.transDOM=n("div","qm-tree-icon qmd-untransparent iconfont icon-cube_box_fill"),this.transDOM.setAttribute("title","半透明"),this.transDOM.addEventListener("click",(function(e){console.log(e.target);var i=e.target.parentNode.parentNode.getElementsByClassName("qm-tree-icon");if(0!=i.length){var n=i[0].classList.contains("qmd-untransparent"),r=1;n&&(r=.5),0==t.type?t.getOperator()._0FKEAJByTree(-1,0,0,r):3==t.type?t.getOperator()._0FKEAJByTree(t.parent.parentId,t.parentId,t.id,r):1==t.type?t.getOperator()._0FKEAJByTree(t.parentId,t.id,0,r):4==t.type&&t.getOperator()._0FKEAJByTree(t.id,0,0,r);for(var s=0;s<i.length;s++){var a=i[s];n?(a.classList.remove("qmd-untransparent"),a.classList.remove("icon-cube_box_fill"),a.classList.add("qmd-transparent"),a.classList.add("icon-pouqiehe")):(a.classList.add("qmd-untransparent"),a.classList.add("icon-cube_box_fill"),a.classList.remove("qmd-transparent"),a.classList.remove("icon-pouqiehe"))}}})),this.treeNodeDOM.appendChild(this.transDOM),this.treeNameDOM=n("span","qm-tree-name"),this.treeNameDOM.addEventListener("click",(function(e){if(3==t.type||1==t.type){3==t.type?t.getOperator()._78r3lI(t.parent.parentId,t.parentId,t.id,0):1==t.type&&t.getOperator()._78r3lI(t.parentId,t.id,0,0);var i=e.target,n=document.querySelectorAll(".qm-selected");n.length>0&&n[0].classList.remove("qm-selected"),i.classList.remove("qm-selected"),i.classList.add("qm-selected")}})),this.treeNameDOM.innerHTML=e,this.treeNodeDOM.appendChild(this.treeNameDOM)},r.prototype.addChildNode=function(e){var t=this;if(null==t.subTreeDOM){t.subTreeDOM=n("div","qm-sub-tree");var i=n("span","qm-icon");this.treeNodeDOM.insertBefore(i,this.treeNodeDOM.children[0]),i.addEventListener("click",(function(e){var t=e.target.parentNode;"DIV"==t.tagName&&(t.classList.contains("qm-collapse")?t.classList.remove("qm-collapse"):t.classList.add("qm-collapse"))})),t.element.appendChild(this.subTreeDOM)}e.parentId=t.id,e.parent=t,t.subTreeList.push(e),t.subTreeDOM.appendChild(e.element)},r.prototype.OnbfLableClick=function(
2023-11-30 20:42:18 +08:00
//# sourceMappingURL=qmodel.min.js.map