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.
1 lines
24 KiB
1 lines
24 KiB
{"version":3,"sources":["webpack:///F:/zhaoshang/zhaoshangMiniApp_uni/components/tki-tree/tki-tree.vue?2e79","webpack:///F:/zhaoshang/zhaoshangMiniApp_uni/components/tki-tree/tki-tree.vue?46fe","webpack:///F:/zhaoshang/zhaoshangMiniApp_uni/components/tki-tree/tki-tree.vue?ab1a","webpack:///F:/zhaoshang/zhaoshangMiniApp_uni/components/tki-tree/tki-tree.vue?5a4d","uni-app:///components/tki-tree/tki-tree.vue","webpack:///F:/zhaoshang/zhaoshangMiniApp_uni/components/tki-tree/tki-tree.vue?c702","webpack:///F:/zhaoshang/zhaoshangMiniApp_uni/components/tki-tree/tki-tree.vue?c019"],"names":[],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA4I;AAC5I;AAC4D;AACL;AACqC;;;AAG5F;AAC+M;AAC/M,gBAAgB,uNAAU;AAC1B,EAAE,8EAAM;AACR,EAAE,0GAAM;AACR,EAAE,mHAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,8GAAU;AACZ;AACA;;AAEA;AACe,gF;;;;;;;;;;;;ACvBf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACRA;AAAA;AAAA;AAAA;AAAozB,CAAgB,o0BAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC0Cx0B;AACA,kBADA;AAEA;AACA;AACA,iBADA;AAEA;AACA;AACA,OAJA,EADA;;AAOA;AACA,kBADA;AAEA,mBAFA,EAPA;;AAWA;AACA,kBADA;AAEA,sBAFA,EAXA;;AAeA;AACA,kBADA;AAEA,iBAFA,EAfA;;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;AASA;AACA,OAZA;AAaA,KA9EA;AA+EA;AACA,gBAhFA,wBAgFA,IAhFA,EAgFA,KAhFA,EAgFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WARA,MAQA;AACA;AACA;AACA;AACA;AACA;AACA,SAnBA,MAmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAFA,MAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAxCA;AAyCA;AACA,KArIA;AAsIA,mBAtIA,2BAsIA,IAtIA,EAsIA,KAtIA,EAsIA;AACA;AACA;AACA,KAzIA;AA0IA;AACA,gBA3IA,wBA2IA,KA3IA,EA2IA;AACA;AACA;AACA;AACA;AACA;AACA,WAFA,MAEA;AACA;AACA;AACA,SANA;AAOA,OATA,MASA;AACA;AACA;AACA;AACA,WAFA,MAEA;AACA;AACA;AACA,SANA;AAOA;AACA,KA9JA;AA+JA;AACA,eAhKA,yBAgKA;AACA;AACA;AACA,OAFA;AAGA,KApKA;AAqKA,aArKA,uBAqKA;AACA;AACA;AACA;AACA;AACA,OAFA;AAGA,KA3KA,EAvEA;;AAoPA;AACA,SADA,iBACA,IADA,EACA;AACA;AACA,KAHA;AAIA,YAJA,sBAIA;AACA;AACA;AACA;AACA,KARA;AASA,gBATA,0BASA;AACA;AACA;AACA;AACA,KAbA,EApPA;;AAmQA,SAnQA,qBAmQA;AACA;AACA,GArQA,E;;;;;;;;;;;;AC1CA;AAAA;AAAA;AAAA;AAAkrC,CAAgB,qqCAAG,EAAC,C;;;;;;;;;;;ACAtsC;AACA,OAAO,KAAU,EAAE,kBAKd","file":"components/tki-tree/tki-tree.js","sourcesContent":["import { render, staticRenderFns, recyclableRender, components } from \"./tki-tree.vue?vue&type=template&id=a8274bb8&scoped=true&xlang=wxml&\"\nvar renderjs\nimport script from \"./tki-tree.vue?vue&type=script&lang=js&\"\nexport * from \"./tki-tree.vue?vue&type=script&lang=js&\"\nimport style0 from \"./tki-tree.vue?vue&type=style&index=0&id=a8274bb8&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\runtime\\\\componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"a8274bb8\",\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"components/tki-tree/tki-tree.vue\"\nexport default component.exports","export * from \"-!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\loaders\\\\templateLoader.js??vue-loader-options!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--16-0!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\template.js!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-uni-app-loader\\\\page-meta.js!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./tki-tree.vue?vue&type=template&id=a8274bb8&scoped=true&xlang=wxml&\"","var components\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./tki-tree.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./tki-tree.vue?vue&type=script&lang=js&\"","<template xlang=\"wxml\">\r\n\t<view class=\"tki-tree\">\r\n\t\t<view class=\"tki-tree-mask\" :class=\"{'show':showTree}\" @tap=\"_cancel\"></view>\r\n\t\t<view class=\"tki-tree-cnt\" :class=\"{'show':showTree}\">\r\n\t\t\t<view class=\"tki-tree-bar\">\r\n\t\t\t\t<view class=\"tki-tree-bar-cancel\" :style=\"{'color':cancelColor}\" hover-class=\"hover-c\" @tap=\"_cancel\">取消</view>\r\n\t\t\t\t<view class=\"tki-tree-bar-title\" :style=\"{'color':titleColor}\">{{title}}</view>\r\n\t\t\t\t<view class=\"tki-tree-bar-confirm\" :style=\"{'color':confirmColor}\" hover-class=\"hover-c\" @tap=\"_confirm\">确定</view>\r\n\t\t\t</view>\r\n\t\t\t<view class=\"tki-tree-view\">\r\n\t\t\t\t<scroll-view class=\"tki-tree-view-sc\" :scroll-y=\"true\">\r\n\t\t\t\t\t<block v-for=\"(item, index) in treeList\" :key=\"index\">\r\n\t\t\t\t\t\t<view class=\"tki-tree-item\" :style=\"[{\r\n\t\t\t\t\t\t\tpaddingLeft: item.rank*15 + 'px',\r\n\t\t\t\t\t\t\tzIndex: item.rank*-1 +50\r\n\t\t\t\t\t\t}]\"\r\n\t\t\t\t\t\t :class=\"{\r\n\t\t\t\t\t\t\tborder: border === true,\r\n\t\t\t\t\t\t\tshow: item.show,\r\n\t\t\t\t\t\t\tlast: item.lastRank,\r\n\t\t\t\t\t\t\tshowchild: item.showChild,\r\n\t\t\t\t\t\t\topen: item.open,\r\n\t\t\t\t\t\t}\">\r\n\t\t\t\t\t\t\t<view class=\"tki-tree-label\" @tap.stop=\"_treeItemTap(item, index)\">\r\n\t\t\t\t\t\t\t\t<image class=\"tki-tree-icon\" :src=\"item.lastRank ? lastIcon : item.showChild ? currentIcon : defaultIcon\"></image>\r\n\t\t\t\t\t\t\t\t{{item.name}}\r\n\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t\t<view class=\"tki-tree-check\" @tap.stop=\"_treeItemSelect(item, index)\" v-if=\"selectParent?true:item.lastRank\">\r\n\t\t\t\t\t\t\t\t<view class=\"tki-tree-check-yes\" v-if=\"item.checked\" :class=\"{'radio':!multiple}\" :style=\"{'border-color':confirmColor}\">\r\n\t\t\t\t\t\t\t\t\t<view class=\"tki-tree-check-yes-b\" :style=\"{'background-color':confirmColor}\"></view>\r\n\t\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t\t\t<view class=\"tki-tree-check-no\" v-else :class=\"{'radio':!multiple}\" :style=\"{'border-color':confirmColor}\"></view>\r\n\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t</block>\r\n\t\t\t\t</scroll-view>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t</view>\r\n</template>\r\n\r\n<script>\r\n\texport default {\r\n\t\tname: \"tki-tree\",\r\n\t\tprops: {\r\n\t\t\trange: {\r\n\t\t\t\ttype: Array,\r\n\t\t\t\tdefault: function() {\r\n\t\t\t\t\treturn []\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tidKey: {\r\n\t\t\t\ttype: String,\r\n\t\t\t\tdefault: 'id'\r\n\t\t\t},\r\n\t\t\trangeKey: {\r\n\t\t\t\ttype: String,\r\n\t\t\t\tdefault: 'label'\r\n\t\t\t},\r\n\t\t\ttitle: {\r\n\t\t\t\ttype: String,\r\n\t\t\t\tdefault: ''\r\n\t\t\t},\r\n\t\t\tmultiple: { // 是否可以多选\r\n\t\t\t\ttype: Boolean,\r\n\t\t\t\tdefault: false\r\n\t\t\t\t// default: true\r\n\t\t\t},\r\n\t\t\tselectParent: { //是否可以选父级\r\n\t\t\t\ttype: Boolean,\r\n\t\t\t\tdefault: false\r\n\t\t\t},\r\n\t\t\tfoldAll: { //折叠时关闭所有已经打开的子集,再次打开时需要一级一级打开\r\n\t\t\t\ttype: Boolean,\r\n\t\t\t\tdefault: false\r\n\t\t\t},\r\n\t\t\tconfirmColor: { // 确定按钮颜色\r\n\t\t\t\ttype: String,\r\n\t\t\t\tdefault: '' // #07bb07\r\n\t\t\t},\r\n\t\t\tcancelColor: { // 取消按钮颜色\r\n\t\t\t\ttype: String,\r\n\t\t\t\tdefault: '' // #757575\r\n\t\t\t},\r\n\t\t\ttitleColor: { // 标题颜色\r\n\t\t\t\ttype: String,\r\n\t\t\t\tdefault: '' // #757575\r\n\t\t\t},\r\n\t\t\tcurrentIcon: { // 展开时候的ic\r\n\t\t\t\ttype: String,\r\n\t\t\t\tdefault: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFEAAABRCAYAAACqj0o2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYg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h0uaNhkiZNyIiXd7IiDR5oyNS5M2ACJ83EyJs3myIkHkzIsLlzYwIkzc7IkTeCojD81ZCHJa3GuKQvBURu+etjNgtb3XELnlHQGyedyTEZnlHQ2ySd0RE97wjI7rlHR3RJe+JeIrbLOecD6ePpZQ6W1kn2epo4MUrPOKyLN8ppYq1+y1VStncOjIdGnFZlo+U0uOtWOeOY2TE12Ouq//pEA7xXL7XfvcufR8K0Svfv6CREN3yDYfYIt9QiK3yjYTYLF95xB75SiP2ylcZsVu+cogj8pVCHJWvEuKwfOkREfKlRkTJlxkRJl86RMR8qRBR82VChM0XHpEhX2hElnyREWnyhUNkzBcKkTVfJETafIcjKuQ7FFEl35GIMvl2R1TMtyuiar49EWXzbY5oZpv/hibXTF2h3+s60FRKeT6+3TjMS3nrA3ZFRD8xrfY3ER1kJ+JEdBBwWGKeRAfEH1wS5WFZSDB/AAAAAElFTkSuQmCC'\r\n\t\t\t},\r\n\t\t\tlastIcon: { // 没有子集的ic\r\n\t\t\t\ttype: String,\r\n\t\t\t\tdefault: ''\r\n\t\t\t},\r\n\t\t\tborder: { // 是否有分割线\r\n\t\t\t\ttype: Boolean,\r\n\t\t\t\tdefault: false\r\n\t\t\t},\r\n\t\t},\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\tshowTree: false,\r\n\t\t\t\ttreeList: [],\r\n\t\t\t\tselectIndex: -1,\r\n\t\t\t}\r\n\t\t},\r\n\t\tcomputed: {},\r\n\t\tmethods: {\r\n\t\t\t_show() {\r\n\t\t\t\tthis.showTree = true\r\n\t\t\t},\r\n\t\t\t_hide() {\r\n\t\t\t\tthis.showTree = false\r\n\t\t\t},\r\n\t\t\t_cancel() {\r\n\t\t\t\tthis._hide()\r\n\t\t\t\tthis.$emit(\"cancel\", '');\r\n\t\t\t},\r\n\t\t\t_confirm() {\r\n\t\t\t\t// 处理所选数据\r\n\t\t\t\tlet rt = [],\r\n\t\t\t\t\tobj = {};\r\n\t\t\t\tthis.treeList.forEach((v, i) => {\r\n\t\t\t\t\tif (this.treeList[i].checked) {\r\n\t\t\t\t\t\tobj = {}\r\n\t\t\t\t\t\tobj.parents = this.treeList[i].parents\r\n\t\t\t\t\t\tobj = Object.assign(obj, this.treeList[i].source)\r\n\t\t\t\t\t\t// 移除子元素\r\n\t\t\t\t\t\tdelete obj.children\r\n\t\t\t\t\t\trt.push(obj)\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t\tthis._hide()\r\n\t\t\t\tthis.$emit(\"confirm\", rt);\r\n\t\t\t},\r\n\t\t\t//扁平化树结构\r\n\t\t\t_renderTreeList(list = [], rank = 0, parentId = [], parents = []) {\r\n\t\t\t\tlist.forEach(item => {\r\n\t\t\t\t\tthis.treeList.push({\r\n\t\t\t\t\t\tid: item[this.idKey],\r\n\t\t\t\t\t\tname: item[this.rangeKey],\r\n\t\t\t\t\t\tsource: item,\r\n\t\t\t\t\t\tparentId, // 父级id数组\r\n\t\t\t\t\t\tparents, // 父级id数组\r\n\t\t\t\t\t\trank, // 层级\r\n\t\t\t\t\t\tshowChild: false, //子级是否显示\r\n\t\t\t\t\t\topen: false, //是否打开\r\n\t\t\t\t\t\tshow: rank === 0, // 自身是否显示\r\n\t\t\t\t\t\thideArr: [],\r\n\t\t\t\t\t\torChecked: item.checked ? item.checked : false,\r\n\t\t\t\t\t\tchecked: item.checked ? item.checked : false,\r\n\t\t\t\t\t})\r\n\t\t\t\t\tif (Array.isArray(item.children) && item.children.length > 0) {\r\n\t\t\t\t\t\t// console.log(item)\r\n\t\t\t\t\t\tlet parentid = [...parentId],\r\n\t\t\t\t\t\t\tparentArr = [...parents],\r\n\t\t\t\t\t\t\tchildrenid = [...childrenid];\r\n\t\t\t\t\t\tdelete parentArr.children\r\n\t\t\t\t\t\tparentid.push(item[this.idKey]);\r\n\t\t\t\t\t\tparentArr.push({\r\n\t\t\t\t\t\t\t[this.idKey]: item[this.idKey],\r\n\t\t\t\t\t\t\t[this.rangeKey]: item[this.rangeKey]\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\tthis._renderTreeList(item.children, rank + 1, parentid, parentArr);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.treeList[this.treeList.length - 1].lastRank = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t\t// console.log(list)\r\n\t\t\t},\r\n\t\t\t// 处理默认选择\r\n\t\t\t_defaultSelect() {\r\n\t\t\t\tthis.treeList.forEach((v, i) => {\r\n\t\t\t\t\tif (v.checked) {\r\n\t\t\t\t\t\tthis.treeList.forEach((v2, i2) => {\r\n\t\t\t\t\t\t\tif (v.parentId.toString().indexOf(v2.parentId.toString()) >= 0) {\r\n\t\t\t\t\t\t\t\tv2.show = true\r\n\t\t\t\t\t\t\t\tif (v.parentId.includes(v2.id)) {\r\n\t\t\t\t\t\t\t\t\tv2.showChild = true;\r\n\t\t\t\t\t\t\t\t\tv2.open = true;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t// 点击\r\n\t\t\t_treeItemTap(item, index) {\r\n\t\t\t\tif (item.lastRank === true) {\r\n\t\t\t\t\t//点击最后一级时触发事件\r\n\t\t\t\t\tthis.treeList[index].checked = !this.treeList[index].checked\r\n\t\t\t\t\tthis._fixMultiple(index)\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tlet list = this.treeList;\r\n\t\t\t\tlet id = item.id;\r\n\t\t\t\titem.showChild = !item.showChild;\r\n\t\t\t\titem.open = item.showChild ? true : !item.open;\r\n\t\t\t\tlist.forEach((childItem, i) => {\r\n\t\t\t\t\tif (item.showChild === false) {\r\n\t\t\t\t\t\t//隐藏所有子级\r\n\t\t\t\t\t\tif (!childItem.parentId.includes(id)) {\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (!this.foldAll) {\r\n\t\t\t\t\t\t\tif (childItem.lastRank !== true && !childItem.open) {\r\n\t\t\t\t\t\t\t\tchildItem.showChild = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// 为隐藏的内容添加一个标记\r\n\t\t\t\t\t\t\tif (childItem.show) {\r\n\t\t\t\t\t\t\t\tchildItem.hideArr[item.rank] = id\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tif (childItem.lastRank !== true) {\r\n\t\t\t\t\t\t\t\tchildItem.showChild = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tchildItem.show = false;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// 打开子集\r\n\t\t\t\t\t\tif (childItem.parentId[childItem.parentId.length - 1] === id) {\r\n\t\t\t\t\t\t\tchildItem.show = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// 打开被隐藏的子集\r\n\t\t\t\t\t\tif (childItem.parentId.includes(id) && !this.foldAll) {\r\n\t\t\t\t\t\t\t// console.log(childItem.hideArr)\r\n\t\t\t\t\t\t\tif (childItem.hideArr[item.rank] === id) {\r\n\t\t\t\t\t\t\t\tchildItem.show = true;\r\n\t\t\t\t\t\t\t\tif (childItem.open && childItem.showChild) {\r\n\t\t\t\t\t\t\t\t\tchildItem.showChild = true\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tchildItem.showChild = false\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tchildItem.hideArr[item.rank] = null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// console.log(childItem.hideArr)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t\t// console.log(this.treeList)\r\n\t\t\t},\r\n\t\t\t_treeItemSelect(item, index) {\r\n\t\t\t\tthis.treeList[index].checked = !this.treeList[index].checked\r\n\t\t\t\tthis._fixMultiple(index)\r\n\t\t\t},\r\n\t\t\t// 处理单选多选\r\n\t\t\t_fixMultiple(index) {\r\n\t\t\t\tif (!this.multiple) {\r\n\t\t\t\t\t// 如果是单选\r\n\t\t\t\t\tthis.treeList.forEach((v, i) => {\r\n\t\t\t\t\t\tif (i != index) {\r\n\t\t\t\t\t\t\tthis.treeList[i].checked = false\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthis.treeList[i].checked = true\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\t\t\t\t} else {\n\t\t\t\t\tthis.treeList.forEach((obj, i) => {\n\t\t\t\t\t\t\tif (!this.treeList[index].checked && this.treeList[index].parentId.indexOf(obj.id) > -1) {\n\t\t\t\t\t\t\t\tthis.treeList[i].checked = false;\n\t\t\t\t\t\t\t} else if (obj.parentId.indexOf(this.treeList[index].id) > -1) {\n\t\t\t\t\t\t\t\tthis.treeList[i].checked = this.treeList[index].checked;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t// 重置数据\r\n\t\t\t_reTreeList() {\r\n\t\t\t\tthis.treeList.forEach((v, i) => {\r\n\t\t\t\t\tthis.treeList[i].checked = v.orChecked\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t_initTree(range = this.range){\r\n\t\t\t\tthis.treeList = [];\r\n\t\t\t\tthis._renderTreeList(range);\r\n\t\t\t\tthis.$nextTick(() => {\r\n\t\t\t\t\tthis._defaultSelect(range)\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t},\r\n\t\twatch: {\r\n\t\t\trange(list) {\r\n\t\t\t\tthis._initTree(list);\r\n\t\t\t},\r\n\t\t\tmultiple() {\r\n\t\t\t\tif (this.range.length) {\r\n\t\t\t\t\tthis._reTreeList();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tselectParent() {\r\n\t\t\t\tif (this.range.length) {\r\n\t\t\t\t\tthis._reTreeList();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t},\r\n\t\tmounted() {\r\n\t\t\tthis._initTree();\r\n\t\t}\r\n\t}\r\n</script>\r\n\r\n<style scoped>\r\n\t@import \"./style.css\";\r\n</style>\n","import mod from \"-!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\mini-css-extract-plugin\\\\dist\\\\loader.js??ref--6-oneOf-1-0!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\css-loader\\\\dist\\\\cjs.js??ref--6-oneOf-1-1!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\loaders\\\\stylePostLoader.js!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--6-oneOf-1-2!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\postcss-loader\\\\src\\\\index.js??ref--6-oneOf-1-3!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./tki-tree.vue?vue&type=style&index=0&id=a8274bb8&scoped=true&lang=css&\"; export default mod; export * from \"-!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\mini-css-extract-plugin\\\\dist\\\\loader.js??ref--6-oneOf-1-0!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\css-loader\\\\dist\\\\cjs.js??ref--6-oneOf-1-1!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\loaders\\\\stylePostLoader.js!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--6-oneOf-1-2!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\postcss-loader\\\\src\\\\index.js??ref--6-oneOf-1-3!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!D:\\\\Program Files\\\\HBuilderX.3.1.13.20210514\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./tki-tree.vue?vue&type=style&index=0&id=a8274bb8&scoped=true&lang=css&\"","// extracted by mini-css-extract-plugin\n if(module.hot) {\n // 1634867350438\n var cssReload = require(\"D:/Program Files/HBuilderX.3.1.13.20210514/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/hmr/hotModuleReplacement.js\")(module.id, {\"hmr\":true,\"publicPath\":\"../../\",\"locals\":false});\n module.hot.dispose(cssReload);\n module.hot.accept(undefined, cssReload);\n }\n "],"sourceRoot":""} |