crm_second_opening_mini/components/tki-tree/tki-tree.js

11 lines
7.6 KiB
JavaScript

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/tki-tree/tki-tree"],{"4ce5":function(e,t,i){"use strict";var n=i("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(i("9523")),c=n(i("448a")),l=(i("0c59"),{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+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZV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Mvl2R1TMtyuiar49EWXzbY5oZpv/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,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],l=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:n,parents:l,rank:i,showChild:!0,open:!0,show:!0,hideArr:[],orChecked:!!t.checked&&t.checked,checked:!!t.checked&&t.checked}),Array.isArray(t.children)&&t.children.length>0){var h,o=(0,c.default)(n),d=(0,c.default)(l),a=[].concat(a);delete d.children,o.push(t[e.idKey]),d.push((h={},(0,r.default)(h,e.idKey,t[e.idKey]),(0,r.default)(h,e.rangeKey,t[e.rangeKey]),h)),e._renderTreeList(t.children,i+1,o,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[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=l},6482:function(e,t,i){},7711:function(e,t,i){"use strict";var n=i("6482"),r=i.n(n);r.a},"91a3":function(e,t,i){"use strict";i.r(t);var n=i("b3e1"),r=i("b6ed7");for(var c in r)["default"].indexOf(c)<0&&function(e){i.d(t,e,(function(){return r[e]}))}(c);i("7711");var l=i("f0c5"),h=Object(l["a"])(r["default"],n["b"],n["c"],!1,null,"0ae35b7f",null,!1,n["a"],void 0);t["default"]=h.exports},b3e1:function(e,t,i){"use strict";i.d(t,"b",(function(){return n})),i.d(t,"c",(function(){return r})),i.d(t,"a",(function(){}));var n=function(){var e=this.$createElement;this._self._c},r=[]},b6ed7:function(e,t,i){"use strict";i.r(t);var n=i("4ce5"),r=i.n(n);for(var c in n)["default"].indexOf(c)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(c);t["default"]=r.a}}]);
;(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__("91a3"))
})
},
[['components/tki-tree/tki-tree-create-component']]
]);