You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

10 lines
8.6 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/tki-tree/tki-tree"],{"6dba":function(e,t,i){"use strict";function n(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function r(e){return a(e)||l(e)||o(e)||c()}function c(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(e,t){if(e){if("string"===typeof e)return d(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?d(e,t):void 0}}function l(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function a(e){if(Array.isArray(e))return d(e)}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var h={name:"tki-tree",props:{range:{type:Array,default:function(){return[]}},idKey:{type:String,default:"id"},rangeKey:{type:String,default:"label"},title:{type:String,default:""},multiple:{type:Boolean,default:!1},selectParent:{type:Boolean,default:!1},foldAll:{type:Boolean,default:!1},confirmColor:{type:String,default:""},cancelColor:{type:String,default:""},titleColor:{type:String,default:""},currentIcon:{type:String,default:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFEAAABRCAYAAACqj0o2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYW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bWyJWgDcze1LPuzVihfxUz7sH4ilJ2bx7Isrm3RtRMu8RiHJ5j0SUyXs0okTeCIj0eSMh0uaNhkiZNyIiXd7IiDR5oyNS5M2ACJ83EyJs3myIkHkzIsLlzYwIkzc7IkTeCojD81ZCHJa3GuKQvBURu+etjNgtb3XELnlHQGyedyTEZnlHQ2ySd0RE97wjI7rlHR3RJe+JeIrbLOecD6ePpZQ6W1kn2epo4MUrPOKyLN8ppYq1+y1VStncOjIdGnFZlo+U0uOtWOeOY2TE12Ouq//pEA7xXL7XfvcufR8K0Svfv6CREN3yDYfYIt9QiK3yjYTYLF95xB75SiP2ylcZsVu+cogj8pVCHJWvEuKwfOkREfKlRkTJlxkRJl86RMR8qRBR82VChM0XHpEhX2hElnyREWnyhUNkzBcKkTVfJETafIcjKuQ7FFEl35GIMvl2R1TMtyuiar49EWXzbY5oZpv/hibXTF2h3+s60FRKeT6+3TjMS3nrA3ZFRD8xrfY3ER1kJ+JEdBBwWGKeRAfEH1wS5WFZSDB/AAAAAElFTkSuQmCC"},lastIcon:{type:String,default:""},border:{type:Boolean,default:!1}},data:function(){return{showTree:!1,treeList:[],selectIndex:-1}},computed:{},methods:{_show:function(){this.showTree=!0},_hide:function(){this.showTree=!1},_cancel:function(){this._hide(),this.$emit("cancel","")},_confirm:function(){var e=this,t=[],i={};this.treeList.forEach((function(n,r){e.treeList[r].checked&&(i={},i.parents=e.treeList[r].parents,i=Object.assign(i,e.treeList[r].source),delete i.children,t.push(i))})),this._hide(),this.$emit("confirm",t)},_renderTreeList:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];t.forEach((function(t){if(e.treeList.push({id:t[e.idKey],name:t[e.rangeKey],source:t,parentId:c,parents:o,rank:i,showChild:!1,open:!1,show:0===i,hideArr:[],orChecked:!!t.checked&&t.checked,checked:!!t.checked&&t.checked}),Array.isArray(t.children)&&t.children.length>0){var l,a=r(c),d=r(o),h=[].concat(h);delete d.children,a.push(t[e.idKey]),d.push((l={},n(l,e.idKey,t[e.idKey]),n(l,e.rangeKey,t[e.rangeKey]),l)),e._renderTreeList(t.children,i+1,a,d)}else e.treeList[e.treeList.length-1].lastRank=!0}))},_defaultSelect:function(){var e=this;this.treeList.forEach((function(t,i){t.checked&&e.treeList.forEach((function(e,i){t.parentId.toString().indexOf(e.parentId.toString())>=0&&(e.show=!0,t.parentId.includes(e.id)&&(e.showChild=!0,e.open=!0))}))}))},_treeItemTap:function(e,t){var i=this;if(!0===e.lastRank)return this.treeList[t].checked=!this.treeList[t].checked,void this._fixMultiple(t);var n=this.treeList,r=e.id;e.showChild=!e.showChild,e.open=!!e.showChild||!e.open,n.forEach((function(t,n){if(!1===e.showChild){if(!t.parentId.includes(r))return;i.foldAll?!0!==t.lastRank&&(t.showChild=!1):(!0===t.lastRank||t.open||(t.showChild=!1),t.show&&(t.hideArr[e.rank]=r)),t.show=!1}else t.parentId[t.parentId.length-1]===r&&(t.show=!0),t.parentId.includes(r)&&!i.foldAll&&t.hideArr[e.rank]===r&&(t.show=!0,t.open&&t.showChild?t.showChild=!0:t.showChild=!1,t.hideArr[e.rank]=null)}))},_treeItemSelect:function(e,t){this.treeList[t].checked=!this.treeList[t].checked,this._fixMultiple(t)},_fixMultiple:function(e){var t=this;this.multiple?this.treeList.forEach((function(i,n){!t.treeList[e].checked&&t.treeList[e].parentId.indexOf(i.id)>-1?t.treeList[n].checked=!1:i.parentId.indexOf(t.treeList[e].id)>-1&&(t.treeList[n].checked=t.treeList[e].checked)})):this.treeList.forEach((function(i,n){t.treeList[n].checked=n==e}))},_reTreeList:function(){var e=this;this.treeList.forEach((function(t,i){e.treeList[i].checked=t.orChecked}))},_initTree:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.range;this.treeList=[],this._renderTreeList(t),this.$nextTick((function(){e._defaultSelect(t)}))}},watch:{range:function(e){this._initTree(e)},multiple:function(){this.range.length&&this._reTreeList()},selectParent:function(){this.range.length&&this._reTreeList()}},mounted:function(){this._initTree()}};t.default=h},"7b02":function(e,t,i){},9195:function(e,t,i){"use strict";i.r(t);var n=i("6dba"),r=i.n(n);for(var c in n)"default"!==c&&function(e){i.d(t,e,(function(){return n[e]}))}(c);t["default"]=r.a},"99d3":function(e,t,i){"use strict";i.r(t);var n=i("d09e"),r=i("9195");for(var c in r)"default"!==c&&function(e){i.d(t,e,(function(){return r[e]}))}(c);i("a8a6");var o,l=i("f0c5"),a=Object(l["a"])(r["default"],n["b"],n["c"],!1,null,"47f9f002",null,!1,n["a"],o);t["default"]=a.exports},a8a6:function(e,t,i){"use strict";var n=i("7b02"),r=i.n(n);r.a},d09e:function(e,t,i){"use strict";var n;i.d(t,"b",(function(){return r})),i.d(t,"c",(function(){return c})),i.d(t,"a",(function(){return n}));var r=function(){var e=this,t=e.$createElement;e._self._c},c=[]}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
'components/tki-tree/tki-tree-create-component',
{
'components/tki-tree/tki-tree-create-component':(function(module, exports, __webpack_require__){
__webpack_require__('543d')['createComponent'](__webpack_require__("99d3"))
})
},
[['components/tki-tree/tki-tree-create-component']]
]);