@jecloud/ui
Version:
JECloud UI库,基于ant-design-vue封装
1 lines • 1.6 kB
JavaScript
var n=this&&this.__extends||function(){var n=function(e,o){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])},n(e,o)};return function(e,o){function t(){this.constructor=e}n(e,o),e.prototype=null===o?Object.create(o):(t.prototype=o.prototype,new t)}}();import e from"./base";import{isPlainObject as o,toBoolean as t,forEach as r,pinyin as i,toNumber as d}from"@jecloud/utils";var a=function(e){function a(n){var o,r,a,c,p;void 0===n&&(n={});var l=e.call(this)||this;l.id=n.id,l.text=n.text,l.code=n.code,l.icon=n.icon,l.iconColor=n.iconColor,l.async=null!==(o=n.async)&&void 0!==o&&o,l.checked=null!==(r=n.checked)&&void 0!==r&&r,l.disabled=t(n.disabled),l.expandable=n.expandable,l.expanded=n.expanded,l.layer=d(n.layer),l.nodePath=n.nodePath,l.nodeInfo=n.nodeInfo,l.nodeInfoType=n.nodeInfoType,l.nodeType=n.nodeType,l.orderIndex=n.orderIndex,l.parent=n.parent,l.leaf="LEAF"===l.nodeType,l.bean=null!==(a=n.bean)&&void 0!==a?a:{},l.children=[],l.appendChild(n.children),l.pinyin=i(l.text),l.hasChild=l.async&&!l.leaf;var u=null!==(p=null===(c=l.nodePath)||void 0===c?void 0:c.split("/"))&&void 0!==p?p:[];return u.pop(),l.parentPath=u.join("/"),l}return n(a,e),a.prototype.appendChild=function(n){var e;void 0===n&&(n=[]),o(n)&&(n=[n]),(e=this.children).push.apply(e,n.map((function(n){return n.isModel?n:new a(n)})))},a.prototype.cascade=function(n){if(!1===(null==n?void 0:n(this)))return!1;r(this.children,(function(e){return e.cascade(n)}))},a}(e);export default a;