cbvirtua 1.0.116 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/package.json +3 -5
  2. package/valid.txt +468 -0
  3. package/vue3-hash-calendar-main.zip +0 -0
  4. package/vv.txt +10442 -0
  5. package/1.zip +0 -0
  6. package/7.zip +0 -0
  7. package/888.zip +0 -0
  8. package/Checkbox Checked-1.png +0 -0
  9. package/_/345/217/267 (1).svg" +0 -1
  10. package/_/345/217/267.svg +0 -1
  11. package/a.png +0 -0
  12. package/babel-plugin-async-lock-master.zip +0 -0
  13. package/build-own-react-main.zip +0 -0
  14. package/check_box.svg +0 -1
  15. package/check_box_outline_blank.svg +0 -1
  16. package/checkbox_unchecked.svg +0 -1
  17. package/floating-vue-main.zip +0 -0
  18. package/font_2009600_gpzp7pxtnw.zip +0 -0
  19. package/font_2553510_ciljc7axaw7.woff +0 -0
  20. package/font_2553510_ciljc7axaw7.woff2 +0 -0
  21. package/leetcode-javascript-master.zip +0 -0
  22. package/loginDemo-master.zip +0 -0
  23. package/mi.txt +0 -374
  24. package/mitt-main.zip +0 -0
  25. package/mp-weixin-back-main.zip +0 -0
  26. package/pdfsss.txt +0 -900
  27. package/sms-check-code-master.zip +0 -0
  28. package/sss.txt +0 -2
  29. package/study-summarize-master.zip +0 -0
  30. package/tool.txt +0 -19
  31. package/v-dropdown-menu-master.zip +0 -0
  32. package/v-track-master/v-track-master/.browserslistrc +0 -3
  33. package/v-track-master/v-track-master/.eslintignore +0 -3
  34. package/v-track-master/v-track-master/.eslintrc.js +0 -15
  35. package/v-track-master/v-track-master/.gitattributes +0 -1
  36. package/v-track-master/v-track-master/.github/FUNDING.yml +0 -12
  37. package/v-track-master/v-track-master/.github/workflows/node.js.yml +0 -29
  38. package/v-track-master/v-track-master/.travis.yml +0 -22
  39. package/v-track-master/v-track-master/.yarnrc +0 -1
  40. package/v-track-master/v-track-master/LICENSE +0 -21
  41. package/v-track-master/v-track-master/README.md +0 -131
  42. package/v-track-master/v-track-master/babel.config.js +0 -25
  43. package/v-track-master/v-track-master/build/rollup.config.base.js +0 -14
  44. package/v-track-master/v-track-master/build/rollup.config.browser.js +0 -21
  45. package/v-track-master/v-track-master/build/rollup.config.es.js +0 -11
  46. package/v-track-master/v-track-master/docs/.babelrc +0 -5
  47. package/v-track-master/v-track-master/docs/App.vue +0 -61
  48. package/v-track-master/v-track-master/docs/assets/app.scss +0 -197
  49. package/v-track-master/v-track-master/docs/assets/index.scss +0 -10
  50. package/v-track-master/v-track-master/docs/assets/mixins.scss +0 -64
  51. package/v-track-master/v-track-master/docs/assets/normalize.scss +0 -349
  52. package/v-track-master/v-track-master/docs/components/button.vue +0 -15
  53. package/v-track-master/v-track-master/docs/components/code-snippet.vue +0 -72
  54. package/v-track-master/v-track-master/docs/dist/css/app.2e14d2d6.css +0 -4
  55. package/v-track-master/v-track-master/docs/dist/css/chunk-vendors.c687a9b2.css +0 -1
  56. package/v-track-master/v-track-master/docs/dist/favicon.ico +0 -0
  57. package/v-track-master/v-track-master/docs/dist/fonts/element-icons.535877f5.woff +0 -0
  58. package/v-track-master/v-track-master/docs/dist/fonts/element-icons.732389de.ttf +0 -0
  59. package/v-track-master/v-track-master/docs/dist/js/app.efe84ade.js +0 -2
  60. package/v-track-master/v-track-master/docs/dist/js/app.efe84ade.js.map +0 -1
  61. package/v-track-master/v-track-master/docs/dist/js/chunk-vendors.c94e27ba.js +0 -13
  62. package/v-track-master/v-track-master/docs/dist/js/chunk-vendors.c94e27ba.js.map +0 -1
  63. package/v-track-master/v-track-master/docs/index.html +0 -1
  64. package/v-track-master/v-track-master/docs/main.js +0 -78
  65. package/v-track-master/v-track-master/docs/pages/block-show.vue +0 -177
  66. package/v-track-master/v-track-master/docs/pages/custom-events.vue +0 -291
  67. package/v-track-master/v-track-master/docs/pages/home.vue +0 -269
  68. package/v-track-master/v-track-master/docs/pages/started.vue +0 -151
  69. package/v-track-master/v-track-master/docs/pages/track-view.vue +0 -234
  70. package/v-track-master/v-track-master/docs/tracks/action.js +0 -37
  71. package/v-track-master/v-track-master/docs/tracks/events.js +0 -140
  72. package/v-track-master/v-track-master/docs/tracks/index.js +0 -13
  73. package/v-track-master/v-track-master/docs/utils/date.js +0 -219
  74. package/v-track-master/v-track-master/docs/utils/dom.js +0 -26
  75. package/v-track-master/v-track-master/jest.config.js +0 -18
  76. package/v-track-master/v-track-master/package.json +0 -67
  77. package/v-track-master/v-track-master/postcss.config.js +0 -5
  78. package/v-track-master/v-track-master/public/favicon.ico +0 -0
  79. package/v-track-master/v-track-master/public/index.html +0 -18
  80. package/v-track-master/v-track-master/src/hooks/index.js +0 -217
  81. package/v-track-master/v-track-master/src/index.js +0 -79
  82. package/v-track-master/v-track-master/src/utils/debug.js +0 -13
  83. package/v-track-master/v-track-master/src/utils/dom.js +0 -73
  84. package/v-track-master/v-track-master/src/utils/helper.js +0 -122
  85. package/v-track-master/v-track-master/src/utils/vis-monitor.js +0 -183
  86. package/v-track-master/v-track-master/tests/helper.js +0 -37
  87. package/v-track-master/v-track-master/tests/unit/.eslintrc.js +0 -5
  88. package/v-track-master/v-track-master/tests/unit/track-click-async.spec.js +0 -52
  89. package/v-track-master/v-track-master/tests/unit/track-click-delay.spec.js +0 -46
  90. package/v-track-master/v-track-master/tests/unit/track-click-native.spec.js +0 -84
  91. package/v-track-master/v-track-master/tests/unit/track-click-param.spec.js +0 -55
  92. package/v-track-master/v-track-master/tests/unit/track-click.spec.js +0 -47
  93. package/v-track-master/v-track-master/tests/unit/track-custom-event-async.spec.js +0 -61
  94. package/v-track-master/v-track-master/tests/unit/track-custom-event-delay.spec.js +0 -59
  95. package/v-track-master/v-track-master/tests/unit/track-custom-event-param.spec.js +0 -68
  96. package/v-track-master/v-track-master/tests/unit/track-custom-event.spec.js +0 -55
  97. package/v-track-master/v-track-master/tests/unit/track-show-custom-scroll-once.spec.js +0 -62
  98. package/v-track-master/v-track-master/tests/unit/track-show-custom-scroll.spec.js +0 -62
  99. package/v-track-master/v-track-master/tests/unit/track-show-once.spec.js +0 -55
  100. package/v-track-master/v-track-master/tests/unit/track-show-param.spec.js +0 -51
  101. package/v-track-master/v-track-master/tests/unit/track-show.spec.js +0 -55
  102. package/v-track-master/v-track-master/tests/unit/track-view-vif.spec.js +0 -54
  103. package/v-track-master/v-track-master/tests/unit/track-view-watch-delay.spec.js +0 -63
  104. package/v-track-master/v-track-master/tests/unit/track-view-watch.spec.js +0 -61
  105. package/v-track-master/v-track-master/tests/unit/track-view.spec.js +0 -32
  106. package/v-track-master/v-track-master/vue.config.js +0 -45
  107. package/v-track-master/v-track-master/yarn.lock +0 -10186
  108. package/v-track-master.zip +0 -0
  109. package/vant-weapp-dev.zip +0 -0
  110. package/vue-autosize-input-master.zip +0 -0
  111. package/vue-awesome-dropdown-master.zip +0 -0
  112. package/vue-codemod-main.zip +0 -0
  113. package/vue-collapsed-main.zip +0 -0
  114. package/vue-input-code-master.zip +0 -0
  115. package/vue-jscodeshift-adapter-master.zip +0 -0
  116. package/vue-verify-master.zip +0 -0
  117. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/.hbuilderx/launch.json +0 -11
  118. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/App.vue +0 -17
  119. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/README.md +0 -13
  120. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/components/xiaolu-tree/code.js +0 -408
  121. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/components/xiaolu-tree/css/icon.css +0 -342
  122. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/components/xiaolu-tree/css/style.scss +0 -119
  123. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/components/xiaolu-tree/search/index.vue +0 -66
  124. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/components/xiaolu-tree/tree.vue +0 -70
  125. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/main.js +0 -11
  126. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/manifest.json +0 -78
  127. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/pages/chooseUser/chooseUser.vue +0 -69
  128. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/pages/chooseUser/data.js +0 -96
  129. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/pages/index/index.vue +0 -122
  130. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/pages.json +0 -25
  131. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/changelog.md +0 -80
  132. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/i18n/en.json +0 -7
  133. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/i18n/index.js +0 -8
  134. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json +0 -7
  135. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json +0 -7
  136. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/keypress.js +0 -45
  137. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/popup.js +0 -26
  138. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/uni-popup.uvue +0 -90
  139. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/uni-popup.vue +0 -496
  140. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js +0 -45
  141. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue +0 -313
  142. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue +0 -143
  143. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue +0 -187
  144. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/package.json +0 -87
  145. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/readme.md +0 -17
  146. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/changelog.md +0 -8
  147. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/index.scss +0 -1
  148. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/package.json +0 -82
  149. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/readme.md +0 -4
  150. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/index.scss +0 -7
  151. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_border.scss +0 -3
  152. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_color.scss +0 -66
  153. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_radius.scss +0 -55
  154. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_space.scss +0 -56
  155. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_styles.scss +0 -167
  156. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_text.scss +0 -24
  157. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_variables.scss +0 -146
  158. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/tools/functions.scss +0 -19
  159. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/theme.scss +0 -31
  160. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/variables.scss +0 -62
  161. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-transition/changelog.md +0 -22
  162. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-transition/components/uni-transition/createAnimation.js +0 -131
  163. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-transition/components/uni-transition/uni-transition.vue +0 -286
  164. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-transition/package.json +0 -84
  165. package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-transition/readme.md +0 -11
  166. package//346/224/266/347/274/251/344/270/212/347/256/255/345/244/264 (1).svg" +0 -1
  167. package//346/224/266/347/274/251/344/270/212/347/256/255/345/244/264.svg +0 -1
  168. package//346/224/266/347/274/251/344/270/213/347/256/255/345/244/264.svg +0 -1
  169. package//346/224/266/347/274/251/347/256/255/345/244/264.svg +0 -1
  170. package//346/226/260/345/273/272 /346/226/207/346/234/254/346/226/207/346/241/243 (2).txt" +0 -90
  171. package//346/226/260/345/273/272 /346/226/207/346/234/254/346/226/207/346/241/243 (3).txt" +0 -142
  172. package//346/226/260/345/273/272 /346/226/207/346/234/254/346/226/207/346/241/243 (3).zip +0 -0
  173. package//346/226/260/345/273/272 /346/226/207/346/234/254/346/226/207/346/241/243.txt" +0 -59
  174. package//351/227/256/345/217/267.svg +0 -1
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,11 +0,0 @@
1
- { // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
2
- // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
3
- "version": "0.0",
4
- "configurations": [{
5
- "type": "uniCloud",
6
- "default": {
7
- "launchtype": "remote"
8
- }
9
- }
10
- ]
11
- }
@@ -1,17 +0,0 @@
1
- <script>
2
- export default {
3
- onLaunch: function() {
4
- // console.log('App Launch')
5
- },
6
- onShow: function() {
7
- // console.log('App Show')
8
- },
9
- onHide: function() {
10
- // console.log('App Hide')
11
- }
12
- }
13
- </script>
14
-
15
- <style>
16
- /*每个页面公共css */
17
- </style>
@@ -1,13 +0,0 @@
1
- # xiaolu-tree-plugin
2
- 在线预览地址:https://lsz579.github.io/xiaolu-tree-plugin/#/
3
- 无限极树形结构选择器,树形选择器增强版,支持多选、单选、父级选择,单选支持查找路径
4
-
5
- ## 文档地址
6
- <a href="https://ext.dcloud.net.cn/plugin?id=2423">查看说明文档</a>
7
-
8
- ## 效果图
9
- <img src="https://img-blog.csdnimg.cn/2021051112360651.gif#pic_center"></img>
10
-
11
- # 觉得好用的话,务必给start
12
-
13
- 动态加载版(只支持单选或单纯展示数据): <a href="https://github.com/LSZ579/xiaolu-dynamic-load-tree">点击跳转</a>
@@ -1,408 +0,0 @@
1
- import search from './search/index.vue'
2
- /*
3
- * 已兼容h5和小程序端,其它端没测试过,估计问题不大,只需要改一下传值的方式
4
- *
5
- * 如有问题可以加qq:122720267
6
- *
7
- * 使用该插件的朋友请给个好评,或者到git start一下
8
- * git地址:https://github.com/LSZ579/xiaolu-tree-plugin.git
9
- * 插件市场地址: https://ext.dcloud.net.cn/plugin?id=2423
10
- *
11
- */
12
- export default {
13
- name: "treeComponent",
14
- data() {
15
- return {
16
- is_search: false,
17
- tree: Object.freeze(this.treeNone),
18
- newNum: 0,
19
- oldNum: 0,
20
- catchTreeNone: [...this.treeNone],
21
- tree_stack: [1],
22
- searchResult: [],
23
- newCheckList: this.checkList,
24
- scrollLeft: 999,
25
- nodePathArray: []
26
- }
27
- },
28
- components: {
29
- search
30
- },
31
- computed: {
32
- isSelect() {
33
- return (item) => {
34
- const checkList = this.newCheckList
35
- if (checkList.length == 0) {
36
- this.props.checkStrictly ? (item.bx = 0, item.qx = 0) : ''
37
- return false
38
- }
39
- const select = checkList.some(e => item[this.keyValue] == e[this.keyValue]);
40
- return select && !item.qx
41
- }
42
- },
43
- radioSelect() {
44
- const list = this.newCheckList
45
- return (item) => {
46
- return list.length > 0 && item[this.keyValue] == list[0][this.keyValue]
47
- }
48
- },
49
- isActive() {
50
- return (index) => {
51
- return index === this.tree_stack.length - 1
52
- }
53
- }
54
- },
55
- created() {
56
- this.Init()
57
- },
58
- methods: {
59
- // 初始化
60
- Init() {
61
- if (this.newCheckList.length !== 0) {
62
- let {
63
- tree_stack,
64
- props,
65
- catchTreeNone,
66
- newCheckList
67
- } = this, index = 0, flag = props.multiple && props.checkStrictly;
68
- flag && (index = newCheckList.length - 1);
69
- this.getNodeRoute(catchTreeNone, newCheckList[index][this.keyValue])
70
- let arr = this.nodePathArray.reverse()
71
- if (arr.length == 0) return;
72
- this.tree_stack = tree_stack.concat(arr);
73
- this.tree = this.tree_stack[this.tree_stack.length - 1][this.props.children];
74
- flag && this.checkAllChoose();
75
- }
76
- },
77
- // 点击项目处理
78
- handleClick(item, index) {
79
- let children = item[this.props.children]
80
- if (index > -1 && children && children.length > 0) {
81
- this.toChildren(item)
82
- } else if (this.props.multiple) {
83
- this.checkboxChange(item, index, item.bx, item.qx)
84
- } else {
85
- this.checkbox(item, index)
86
- }
87
- },
88
- // (tree为目标树,targetId为目标节点id)
89
- getNodeRoutePath(tree, targetId, nodePathArray = []) {
90
- for (let index = 0; index < tree.length; index++) {
91
- if (tree[index][this.props.children]) {
92
- let endRecursiveLoop = this.getNodeRoutePath(tree[index][this.props.children], targetId,
93
- nodePathArray)
94
- if (endRecursiveLoop) {
95
- nodePathArray.push(tree[index])
96
- return true
97
- }
98
- }
99
- if (tree[index][this.keyValue] === targetId) {
100
- return true
101
- }
102
- }
103
- },
104
- // 获取路径
105
- getPath(id) {
106
- if (!this.props.hasPath) return '';
107
- const {
108
- keyValue,
109
- tree_stack,
110
- props
111
- } = this
112
- if (this.is_search) {
113
- // 搜索情况下,无法获取完整的路径,如果需要获取,则只能通过完整的树去查找
114
- let path = []
115
- this.getNodeRoutePath(this.catchTreeNone, id, path)
116
- console.log(path)
117
- return path.reverse();
118
- }
119
- const path = [...tree_stack].map(e => {
120
- const item = Object.assign({}, e)
121
- delete item[props.child]
122
- return item
123
- })
124
- return path.slice(1, path.length) || []
125
- },
126
- //多选
127
- async checkboxChange(item, index, bx, qx) {
128
- let that = this;
129
- const {
130
- props
131
- } = that
132
- if (!props.multiple) return;
133
- let findIdex = that.newCheckList.findIndex(e => item[this.keyValue] == e[this.keyValue]);
134
- const path = this.getPath(item[this.keyValue])
135
- if (findIdex > -1) { //反选
136
- if (props.checkStrictly) { //关联子级
137
- if (item.user) { //用户
138
- that.newCheckList.splice(findIdex, 1)
139
- } else { //非用户,取消所有下一级
140
- that.getIdBydelete(item[this.props.children])
141
- }
142
- } else {
143
- that.newCheckList.splice(findIdex, 1)
144
- }
145
- // if (props.checkStrictly && !item.user) { //关联子级 非用户,取消所有下一级
146
- // item.qx = item.bx = 0
147
- // that.getIdBydelete(item[this.props.children])
148
- // }
149
- } else { //选中
150
- if (!item.user && props.checkStrictly) { //选中下一级
151
- if (qx || bx) { //取消下级
152
- await that.getIdBydelete(item[this.props.children]);
153
- item.qx = item.bx = 0
154
- that.newCheckList.splice(findIdex, 1)
155
- } else {
156
- item.qx = 1;
157
- item.bx = 0;
158
- const {
159
- id,
160
- name,
161
- user
162
- } = item
163
- const newObj = {
164
- id,
165
- name,
166
- user
167
- }
168
- const pathList = this.tree_stack.length === 1 ? [newObj, ...path] : [...path, newObj]
169
- await that.chooseChild(item[this.props.children], pathList);
170
- // that.newCheckList.push({
171
- // ...item,
172
- // paths
173
- // });
174
- }
175
- this.$forceUpdate()
176
- return
177
- }
178
- that.newCheckList.push({
179
- ...item,
180
- path
181
- });
182
- }
183
- },
184
- // 取消下一级的选中
185
- getIdBydelete(arr) {
186
- arr.forEach(e => {
187
- if (e.user) {
188
- for (var i = 0; i < this.newCheckList.length; i++) {
189
- if (e[this.keyValue] == this.newCheckList[i][this.keyValue]) {
190
- this.newCheckList.splice(i, 1)
191
- break;
192
- }
193
- }
194
- } else {
195
- this.getIdBydelete(e[this.props.children])
196
- }
197
- })
198
- },
199
-
200
- // 关联下一级,选中
201
- chooseChild(arr, path) {
202
- let that = this;
203
- const oldPath = [...path]
204
- for (var i = 0, len = arr.length; i < len; i++) {
205
- let item = arr[i];
206
- if (item.user) {
207
- that.newCheckList.push({
208
- ...item,
209
- path: oldPath
210
- })
211
- } else {
212
- const newItem = {
213
- ...item
214
- }
215
- delete newItem[that.props.children]
216
- const newPath = [...oldPath, newItem]
217
- that.chooseChild(item[this.props.children], newPath)
218
- }
219
- }
220
- },
221
-
222
- // (tree为目标树,targetId为目标节点id)
223
- getNodeRoute(tree, targetId) {
224
- for (let index = 0; index < tree.length; index++) {
225
- if (tree[index][this.props.children]) {
226
- let endRecursiveLoop = this.getNodeRoute(tree[index][this.props.children], targetId)
227
- if (endRecursiveLoop) {
228
- this.nodePathArray.push(tree[index])
229
- return true
230
- }
231
- }
232
- if (tree[index][this.keyValue] === targetId) {
233
- return true
234
- }
235
- }
236
- },
237
-
238
- //单选
239
- checkbox(item, index) {
240
- const path = this.getPath(item[this.keyValue])
241
- this.$set(this, 'newCheckList', [{
242
- ...item,
243
- path
244
- }])
245
- },
246
- //到下一级
247
- toChildren(item) {
248
- if (item.user) return
249
- var that = this;
250
- uni.showLoading({
251
- title: '加载中'
252
- })
253
- let children = that.props.children;
254
- if (!item.user && item[children].length > 0 && !(that.tree_stack[0][this.keyValue] == item[this
255
- .keyValue])) {
256
- that.tree = item[children];
257
- that.tree_stack.push(item);
258
- }
259
- this.$nextTick(() => {
260
- uni.hideLoading()
261
- this.scrollLeft += 200;
262
- })
263
- if (this.props.checkStrictly) this.checkAllChoose();
264
- },
265
- //搜索
266
- confirmSearch(val) {
267
- this.searchResult = []
268
- this.search(this.catchTreeNone, val)
269
- this.is_search = true
270
- this.tree_stack.splice(1, 1000)
271
- uni.showLoading({
272
- title: '正在查找'
273
- })
274
- setTimeout(() => {
275
- this.tree = this.searchResult
276
- if (this.props.checkStrictly) this.checkAllChoose();
277
- uni.hideLoading()
278
- }, 300)
279
- },
280
- search(data, keyword) {
281
- let that = this
282
- let {
283
- label,
284
- children
285
- } = that.props
286
- for (var i = 0, len = data.length; i < len; i++) {
287
- if (data[i][label].indexOf(keyword) >= 0) {
288
- that.searchResult.push(data[i])
289
- }
290
- if (!data[i].user && data[i][children].length > 0) {
291
- that.search(data[i][children], keyword)
292
- }
293
- }
294
- },
295
- checkAllChoose() {
296
- this.tree.forEach((e, i) => {
297
- if (!e.user) {
298
- e.qx = e.bx = false;
299
- this.computAllNumber(e.children);
300
- // console.log(this.newNum,this.oldNum)
301
- if (this.newNum != 0 && this.oldNum != 0) {
302
- e.qx = this.newNum == this.oldNum
303
- e.bx = !e.qx
304
- }
305
- if (this.newNum != 0 && this.oldNum == 0) {
306
- this.$set(this.tree[i], 'bx', false);
307
- this.$set(this.tree[i], 'qx', false);
308
- }
309
- this.$forceUpdate()
310
- this.newNum = this.oldNum = 0
311
- }
312
- })
313
- },
314
- computAllNumber(arr) {
315
- for (let j = 0; j < arr.length; j++) {
316
- var e = arr[j];
317
- this.checkSum(e[this.keyValue])
318
- if (e.user) {
319
- this.newNum++;
320
- } else {
321
- this.computAllNumber(e.children)
322
- }
323
- }
324
- },
325
- checkSum(id) {
326
- for (let i = 0; i < this.newCheckList.length; i++) {
327
- if (id == this.newCheckList[i][this.keyValue]) {
328
- this.oldNum++;
329
- break
330
- }
331
- }
332
- },
333
- //返回其它层
334
- backTree(item, index) {
335
- let that = this,
336
- tree_stack = that.tree_stack,
337
- max = 300;
338
- if (index === -1) {
339
- that.tree = that.catchTreeNone
340
- that.tree_stack.splice(1, max)
341
- that.is_search = false
342
- that.$refs.sea?.clears()
343
- } else if (index === -2) { //搜索
344
- that.tree = that.searchResult
345
- that.tree_stack.splice(1, max)
346
- } else {
347
- if (tree_stack.length - index > 2) {
348
- that.tree_stack.splice(index + 1, max)
349
- } else if (index !== tree_stack.length - 1) {
350
- that.tree_stack.splice(tree_stack.length - 1, 1)
351
- }
352
- that.tree = item[that.props.children]
353
- }
354
- if (this.props.checkStrictly) this.checkAllChoose();
355
- this.$forceUpdate()
356
- },
357
- backConfirm() {
358
- this.$emit('sendValue', this.newCheckList, 'back')
359
- }
360
- },
361
- props: {
362
- // 树形数据源
363
- treeNone: {
364
- type: Array,
365
- default: () => {
366
- return []
367
- }
368
- },
369
- //是否开启选中
370
- isCheck: {
371
- type: Boolean,
372
- default: () => {
373
- return false
374
- }
375
- },
376
- // 弹出模式时需传的列表滚动高度
377
- scrollHeight: {
378
- type: String,
379
- default: '',
380
- },
381
- // 选中的值的 必传[{[keyValue]:value}]
382
- checkList: {
383
- type: Array,
384
- default: () => []
385
- },
386
- searchIf: {
387
- type: Boolean,
388
- default: () => true
389
- },
390
- // 默认key
391
- keyValue: {
392
- type: String,
393
- default: 'id',
394
- },
395
- props: {
396
- type: Object,
397
- default: () => {
398
- return {
399
- label: 'name',
400
- children: 'children',
401
- multiple: false,
402
- checkStrictly: false, //不关联
403
- hasPath: false, //返回值是否都带路径
404
- }
405
- }
406
- }
407
- },
408
- }