@10yun/cv-mobile-ui 0.5.19 → 0.5.21

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 (137) hide show
  1. package/other/mpvue-picker/mpvuePicker.vue +402 -0
  2. package/{uni-ui/lib → other}/mpvue-picker/style.css +0 -1
  3. package/{uni-ui/lib → other}/tab-nvue/style.css +0 -1
  4. package/other/uParse/components/style.css +1 -0
  5. package/other/uParse/components/wxParseAudio.vue +1 -0
  6. package/other/uParse/components/wxParseImg.vue +86 -0
  7. package/other/uParse/components/wxParseTable.vue +54 -0
  8. package/other/uParse/components/wxParseTemplate0.vue +98 -0
  9. package/other/uParse/components/wxParseTemplate1.vue +81 -0
  10. package/other/uParse/components/wxParseTemplate10.vue +81 -0
  11. package/other/uParse/components/wxParseTemplate11.vue +79 -0
  12. package/other/uParse/components/wxParseTemplate2.vue +81 -0
  13. package/other/uParse/components/wxParseTemplate3.vue +81 -0
  14. package/other/uParse/components/wxParseTemplate4.vue +81 -0
  15. package/other/uParse/components/wxParseTemplate5.vue +81 -0
  16. package/other/uParse/components/wxParseTemplate6.vue +81 -0
  17. package/other/uParse/components/wxParseTemplate7.vue +81 -0
  18. package/other/uParse/components/wxParseTemplate8.vue +81 -0
  19. package/other/uParse/components/wxParseTemplate9.vue +81 -0
  20. package/other/uParse/components/wxParseVideo.vue +14 -0
  21. package/other/uParse/editor.css +495 -0
  22. package/{uni-ui/lib/uParse/src → other/uParse}/libs/html2json.js +19 -22
  23. package/{uni-ui/lib/uParse/src → other/uParse}/libs/htmlparser.js +12 -5
  24. package/{uni-ui/lib/uParse/src → other/uParse}/libs/wxDiscode.js +2 -2
  25. package/other/uParse/wxParse.vue +196 -0
  26. package/package.json +1 -1
  27. package/plugins/map/amqp-wx.js +173 -0
  28. package/{uni-ui/lib/mpvueGestureLock/index.vue → ui-cv/components/cv-draw-gesture-lock/cv-draw-gesture-lock.vue} +4 -1
  29. package/ui-cv/components/cv-draw-gesture-lock/gestureLock.js +169 -0
  30. package/{uni-ui/lib/mpvueGestureLock → ui-cv/components/cv-draw-gesture-lock}/style.css +0 -1
  31. package/{uni-ui/lib/mpvue-citypicker → ui-cv/components/cv-geo-region}/style.css +0 -1
  32. package/ui-cv/components/cv-grid-item/cv-grid-item.vue +1 -1
  33. package/uni-ui/lib/uni-badge/uni-badge.vue +150 -1
  34. package/uni-ui/lib/uni-breadcrumb/uni-breadcrumb.vue +37 -1
  35. package/uni-ui/lib/uni-breadcrumb-item/uni-breadcrumb-item.vue +83 -1
  36. package/uni-ui/lib/uni-calendar/uni-calendar-item.vue +122 -1
  37. package/uni-ui/lib/uni-calendar/uni-calendar.vue +366 -1
  38. package/uni-ui/lib/uni-card/uni-card.vue +124 -1
  39. package/uni-ui/lib/uni-col/uni-col.vue +1 -1
  40. package/uni-ui/lib/uni-collapse/uni-collapse.vue +135 -1
  41. package/uni-ui/lib/uni-collapse-item/uni-collapse-item.vue +266 -1
  42. package/uni-ui/lib/uni-combox/uni-combox.vue +1 -1
  43. package/uni-ui/lib/uni-countdown/uni-countdown.vue +239 -1
  44. package/uni-ui/lib/uni-data-checkbox/uni-data-checkbox.vue +487 -1
  45. package/uni-ui/lib/uni-data-picker/uni-data-picker.vue +530 -1
  46. package/uni-ui/lib/uni-data-pickerview/uni-data-picker.js +157 -150
  47. package/uni-ui/lib/uni-data-pickerview/uni-data-pickerview.vue +166 -1
  48. package/uni-ui/lib/uni-data-select/uni-data-select.vue +289 -1
  49. package/uni-ui/lib/uni-datetime-picker/calendar-item.vue +70 -1
  50. package/uni-ui/lib/uni-datetime-picker/calendar.vue +629 -1
  51. package/uni-ui/lib/uni-datetime-picker/time-picker.vue +741 -1
  52. package/uni-ui/lib/uni-datetime-picker/uni-datetime-picker.vue +847 -1
  53. package/uni-ui/lib/uni-drawer/uni-drawer.vue +115 -1
  54. package/uni-ui/lib/uni-easyinput/uni-easyinput.vue +515 -1
  55. package/uni-ui/lib/uni-fab/uni-fab.vue +257 -1
  56. package/uni-ui/lib/uni-fav/uni-fav.vue +123 -1
  57. package/uni-ui/lib/uni-file-picker/uni-file-picker.vue +642 -1
  58. package/uni-ui/lib/uni-file-picker/upload-file.vue +177 -1
  59. package/uni-ui/lib/uni-file-picker/upload-image.vue +176 -1
  60. package/uni-ui/lib/uni-forms/uni-forms.vue +375 -1
  61. package/uni-ui/lib/uni-forms-item/uni-forms-item.vue +429 -1
  62. package/uni-ui/lib/uni-goods-nav/uni-goods-nav.vue +129 -1
  63. package/uni-ui/lib/uni-grid/uni-grid.vue +115 -1
  64. package/uni-ui/lib/uni-grid-item/uni-grid-item.vue +78 -1
  65. package/uni-ui/lib/uni-group/uni-group.vue +85 -1
  66. package/uni-ui/lib/uni-icons/uni-icons.vue +85 -1
  67. package/uni-ui/lib/uni-indexed-list/uni-indexed-list-item.vue +68 -1
  68. package/uni-ui/lib/uni-indexed-list/uni-indexed-list.vue +294 -1
  69. package/uni-ui/lib/uni-list/uni-list.vue +81 -1
  70. package/uni-ui/lib/uni-list-ad/uni-list-ad.vue +77 -1
  71. package/uni-ui/lib/uni-list-chat/uni-list-chat.vue +294 -1
  72. package/uni-ui/lib/uni-list-item/uni-list-item.vue +346 -1
  73. package/uni-ui/lib/uni-load-more/uni-load-more.vue +172 -1
  74. package/uni-ui/lib/uni-nav-bar/uni-nav-bar.vue +205 -1
  75. package/uni-ui/lib/uni-nav-bar/uni-status-bar.vue +18 -1
  76. package/uni-ui/lib/uni-notice-bar/uni-notice-bar.vue +331 -1
  77. package/uni-ui/lib/uni-number-box/uni-number-box.vue +166 -1
  78. package/uni-ui/lib/uni-pagination/uni-pagination.vue +323 -1
  79. package/uni-ui/lib/uni-popup/uni-popup.vue +1 -1
  80. package/uni-ui/lib/uni-popup-dialog/uni-popup-dialog.vue +173 -1
  81. package/uni-ui/lib/uni-popup-message/uni-popup-message.vue +74 -1
  82. package/uni-ui/lib/uni-popup-share/uni-popup-share.vue +106 -1
  83. package/uni-ui/lib/uni-rate/uni-rate.vue +322 -1
  84. package/uni-ui/lib/uni-row/uni-row.vue +1 -1
  85. package/uni-ui/lib/uni-search-bar/uni-search-bar.vue +236 -1
  86. package/uni-ui/lib/uni-section/uni-section.vue +109 -1
  87. package/uni-ui/lib/uni-segmented-control/uni-segmented-control.vue +103 -1
  88. package/uni-ui/lib/uni-status-bar/uni-status-bar.vue +1 -1
  89. package/uni-ui/lib/uni-steps/uni-steps.vue +120 -1
  90. package/uni-ui/lib/uni-swipe-action-item/uni-swipe-action-item.vue +226 -3
  91. package/uni-ui/lib/uni-swiper-dot/uni-swiper-dot.vue +167 -1
  92. package/uni-ui/lib/uni-table/uni-table.vue +297 -1
  93. package/uni-ui/lib/uni-tag/uni-tag.vue +100 -1
  94. package/uni-ui/lib/uni-td/uni-td.vue +78 -1
  95. package/uni-ui/lib/uni-th/filter-dropdown.vue +1 -1
  96. package/uni-ui/lib/uni-th/uni-th.vue +224 -1
  97. package/uni-ui/lib/uni-thead/uni-thead.vue +77 -1
  98. package/uni-ui/lib/uni-tr/table-checkbox.vue +79 -1
  99. package/uni-ui/lib/uni-tr/uni-tr.vue +135 -1
  100. package/uni-ui/lib/amap-wx/js/util.js +0 -181
  101. package/uni-ui/lib/marked/index.js +0 -1
  102. package/uni-ui/lib/mpvue-citypicker/city-data/area.js +0 -12542
  103. package/uni-ui/lib/mpvue-citypicker/city-data/city.js +0 -1503
  104. package/uni-ui/lib/mpvue-citypicker/city-data/province.js +0 -139
  105. package/uni-ui/lib/mpvue-picker/mpvuePicker.vue +0 -3
  106. package/uni-ui/lib/mpvueGestureLock/gestureLock.js +0 -175
  107. package/uni-ui/lib/uParse/src/components/style.css +0 -2
  108. package/uni-ui/lib/uParse/src/components/wxParseAudio.vue +0 -1
  109. package/uni-ui/lib/uParse/src/components/wxParseImg.vue +0 -1
  110. package/uni-ui/lib/uParse/src/components/wxParseTable.vue +0 -3
  111. package/uni-ui/lib/uParse/src/components/wxParseTemplate0.vue +0 -1
  112. package/uni-ui/lib/uParse/src/components/wxParseTemplate1.vue +0 -1
  113. package/uni-ui/lib/uParse/src/components/wxParseTemplate10.vue +0 -1
  114. package/uni-ui/lib/uParse/src/components/wxParseTemplate11.vue +0 -1
  115. package/uni-ui/lib/uParse/src/components/wxParseTemplate2.vue +0 -1
  116. package/uni-ui/lib/uParse/src/components/wxParseTemplate3.vue +0 -1
  117. package/uni-ui/lib/uParse/src/components/wxParseTemplate4.vue +0 -1
  118. package/uni-ui/lib/uParse/src/components/wxParseTemplate5.vue +0 -1
  119. package/uni-ui/lib/uParse/src/components/wxParseTemplate6.vue +0 -1
  120. package/uni-ui/lib/uParse/src/components/wxParseTemplate7.vue +0 -1
  121. package/uni-ui/lib/uParse/src/components/wxParseTemplate8.vue +0 -1
  122. package/uni-ui/lib/uParse/src/components/wxParseTemplate9.vue +0 -1
  123. package/uni-ui/lib/uParse/src/components/wxParseVideo.vue +0 -1
  124. package/uni-ui/lib/uParse/src/editor.css +0 -495
  125. package/uni-ui/lib/uParse/src/wxParse.vue +0 -1
  126. /package/{uni-ui/lib → other}/api-set-tabbar.nvue +0 -0
  127. /package/{uni-ui/lib → other}/mpvue-echarts/src/echarts.vue +0 -0
  128. /package/{uni-ui/lib → other}/mpvue-echarts/src/style.css +0 -0
  129. /package/{uni-ui/lib → other}/mpvue-echarts/src/wx-canvas.js +0 -0
  130. /package/{uni-ui/lib → other}/product.vue +0 -0
  131. /package/{uni-ui/lib → other}/style.css +0 -0
  132. /package/{uni-ui/lib → other}/tab-nvue/mediaList.vue +0 -0
  133. /package/{uni-ui/lib → other}/u-charts/u-charts.js +0 -0
  134. /package/{uni-ui/lib/uParse/src → other/uParse}/wxParse.css +0 -0
  135. /package/{uni-ui/lib/amap-wx → plugins/map}/lib/amap-wx.js +0 -0
  136. /package/{uni-ui/lib/mpvue-citypicker → ui-cv/components/cv-geo-region}/mpvueCityPicker.vue +0 -0
  137. /package/{uni-ui/lib/marked → ui-cv/components/cv-markdown-show}/lib/marked.js +0 -0
@@ -2,14 +2,14 @@ export default {
2
2
  props: {
3
3
  localdata: {
4
4
  type: [Array, Object],
5
- default () {
6
- return []
5
+ default() {
6
+ return [];
7
7
  }
8
8
  },
9
9
  spaceInfo: {
10
10
  type: Object,
11
- default () {
12
- return {}
11
+ default() {
12
+ return {};
13
13
  }
14
14
  },
15
15
  collection: {
@@ -62,14 +62,14 @@ export default {
62
62
  },
63
63
  value: {
64
64
  type: [Array, String, Number],
65
- default () {
66
- return []
65
+ default() {
66
+ return [];
67
67
  }
68
68
  },
69
69
  modelValue: {
70
70
  type: [Array, String, Number],
71
- default () {
72
- return []
71
+ default() {
72
+ return [];
73
73
  }
74
74
  },
75
75
  preload: {
@@ -94,11 +94,11 @@ export default {
94
94
  },
95
95
  map: {
96
96
  type: Object,
97
- default () {
97
+ default() {
98
98
  return {
99
- text: "text",
100
- value: "value"
101
- }
99
+ text: 'text',
100
+ value: 'value'
101
+ };
102
102
  }
103
103
  }
104
104
  },
@@ -119,7 +119,7 @@ export default {
119
119
  size: this.pageSize,
120
120
  count: 0
121
121
  }
122
- }
122
+ };
123
123
  },
124
124
  computed: {
125
125
  isLocalData() {
@@ -129,60 +129,65 @@ export default {
129
129
  return this.collection.length > 0;
130
130
  },
131
131
  isCloudDataList() {
132
- return (this.isCloudData && (!this.parentField && !this.selfField));
132
+ return this.isCloudData && !this.parentField && !this.selfField;
133
133
  },
134
134
  isCloudDataTree() {
135
- return (this.isCloudData && this.parentField && this.selfField);
135
+ return this.isCloudData && this.parentField && this.selfField;
136
136
  },
137
137
  dataValue() {
138
- let isModelValue = Array.isArray(this.modelValue) ? (this.modelValue.length > 0) : (this.modelValue !== null ||
139
- this.modelValue !== undefined);
138
+ let isModelValue = Array.isArray(this.modelValue)
139
+ ? this.modelValue.length > 0
140
+ : this.modelValue !== null || this.modelValue !== undefined;
140
141
  return isModelValue ? this.modelValue : this.value;
141
142
  },
142
143
  hasValue() {
143
144
  if (typeof this.dataValue === 'number') {
144
- return true
145
+ return true;
145
146
  }
146
- return (this.dataValue != null) && (this.dataValue.length > 0)
147
+ return this.dataValue != null && this.dataValue.length > 0;
147
148
  }
148
149
  },
149
150
  created() {
150
- this.$watch(() => {
151
- var al = [];
152
- ['pageCurrent',
153
- 'pageSize',
154
- 'spaceInfo',
155
- 'value',
156
- 'modelValue',
157
- 'localdata',
158
- 'collection',
159
- 'action',
160
- 'field',
161
- 'orderby',
162
- 'where',
163
- 'getont',
164
- 'getcount',
165
- 'gettree'
166
- ].forEach(key => {
167
- al.push(this[key])
168
- });
169
- return al
170
- }, (newValue, oldValue) => {
171
- let needReset = false
172
- for (let i = 2; i < newValue.length; i++) {
173
- if (newValue[i] != oldValue[i]) {
174
- needReset = true
175
- break
151
+ this.$watch(
152
+ () => {
153
+ var al = [];
154
+ [
155
+ 'pageCurrent',
156
+ 'pageSize',
157
+ 'spaceInfo',
158
+ 'value',
159
+ 'modelValue',
160
+ 'localdata',
161
+ 'collection',
162
+ 'action',
163
+ 'field',
164
+ 'orderby',
165
+ 'where',
166
+ 'getont',
167
+ 'getcount',
168
+ 'gettree'
169
+ ].forEach((key) => {
170
+ al.push(this[key]);
171
+ });
172
+ return al;
173
+ },
174
+ (newValue, oldValue) => {
175
+ let needReset = false;
176
+ for (let i = 2; i < newValue.length; i++) {
177
+ if (newValue[i] != oldValue[i]) {
178
+ needReset = true;
179
+ break;
180
+ }
176
181
  }
177
- }
178
- if (newValue[0] != oldValue[0]) {
179
- this.page.current = this.pageCurrent
180
- }
181
- this.page.size = this.pageSize
182
+ if (newValue[0] != oldValue[0]) {
183
+ this.page.current = this.pageCurrent;
184
+ }
185
+ this.page.size = this.pageSize;
182
186
 
183
- this.onPropsChange()
184
- })
185
- this._treeData = []
187
+ this.onPropsChange();
188
+ }
189
+ );
190
+ this._treeData = [];
186
191
  },
187
192
  methods: {
188
193
  onPropsChange() {
@@ -316,13 +321,13 @@ export default {
316
321
  let where = [];
317
322
  let whereField = this._getForeignKeyByField();
318
323
  if (whereField) {
319
- where.push(`${whereField} == '${this.dataValue}'`)
324
+ where.push(`${whereField} == '${this.dataValue}'`);
320
325
  }
321
326
 
322
327
  where = where.join(' || ');
323
328
 
324
329
  if (this.where) {
325
- where = `(${this.where}) && (${where})`
330
+ where = `(${this.where}) && (${where})`;
326
331
  }
327
332
 
328
333
  return this.getCommand({
@@ -351,47 +356,50 @@ export default {
351
356
 
352
357
  getCommand(options = {}) {
353
358
  /* eslint-disable no-undef */
354
- let db = uniCloud.database(this.spaceInfo)
359
+ let db = uniCloud.database(this.spaceInfo);
355
360
 
356
- const action = options.action || this.action
361
+ const action = options.action || this.action;
357
362
  if (action) {
358
- db = db.action(action)
363
+ db = db.action(action);
359
364
  }
360
365
 
361
- const collection = options.collection || this.collection
362
- db = db.collection(collection)
366
+ const collection = options.collection || this.collection;
367
+ db = db.collection(collection);
363
368
 
364
- const where = options.where || this.where
369
+ const where = options.where || this.where;
365
370
  if (!(!where || !Object.keys(where).length)) {
366
- db = db.where(where)
371
+ db = db.where(where);
367
372
  }
368
373
 
369
- const field = options.field || this.field
374
+ const field = options.field || this.field;
370
375
  if (field) {
371
- db = db.field(field)
376
+ db = db.field(field);
372
377
  }
373
378
 
374
- const orderby = options.orderby || this.orderby
379
+ const orderby = options.orderby || this.orderby;
375
380
  if (orderby) {
376
- db = db.orderBy(orderby)
381
+ db = db.orderBy(orderby);
377
382
  }
378
383
 
379
- const current = options.pageCurrent !== undefined ? options.pageCurrent : this.page.current
380
- const size = options.pageSize !== undefined ? options.pageSize : this.page.size
381
- const getCount = options.getcount !== undefined ? options.getcount : this.getcount
382
- const getTree = options.gettree !== undefined ? options.gettree : this.gettree
384
+ const current = options.pageCurrent !== undefined ? options.pageCurrent : this.page.current;
385
+ const size = options.pageSize !== undefined ? options.pageSize : this.page.size;
386
+ const getCount = options.getcount !== undefined ? options.getcount : this.getcount;
387
+ const getTree = options.gettree !== undefined ? options.gettree : this.gettree;
383
388
 
384
389
  const getOptions = {
385
390
  getCount,
386
391
  getTree
387
- }
392
+ };
388
393
  if (options.getTreePath) {
389
- getOptions.getTreePath = options.getTreePath
394
+ getOptions.getTreePath = options.getTreePath;
390
395
  }
391
396
 
392
- db = db.skip(size * (current - 1)).limit(size).get(getOptions)
397
+ db = db
398
+ .skip(size * (current - 1))
399
+ .limit(size)
400
+ .get(getOptions);
393
401
 
394
- return db
402
+ return db;
395
403
  },
396
404
 
397
405
  _cloudDataPostField() {
@@ -403,32 +411,32 @@ export default {
403
411
  },
404
412
 
405
413
  _cloudDataTreeWhere() {
406
- let result = []
407
- let selected = this.selected
408
- let parentField = this.parentField
414
+ let result = [];
415
+ let selected = this.selected;
416
+ let parentField = this.parentField;
409
417
  if (parentField) {
410
- result.push(`${parentField} == null || ${parentField} == ""`)
418
+ result.push(`${parentField} == null || ${parentField} == ""`);
411
419
  }
412
420
  if (selected.length) {
413
421
  for (var i = 0; i < selected.length - 1; i++) {
414
- result.push(`${parentField} == '${selected[i].value}'`)
422
+ result.push(`${parentField} == '${selected[i].value}'`);
415
423
  }
416
424
  }
417
425
 
418
- let where = []
426
+ let where = [];
419
427
  if (this.where) {
420
- where.push(`(${this.where})`)
428
+ where.push(`(${this.where})`);
421
429
  }
422
430
 
423
431
  if (result.length) {
424
- where.push(`(${result.join(' || ')})`)
432
+ where.push(`(${result.join(' || ')})`);
425
433
  }
426
434
 
427
- return where.join(' && ')
435
+ return where.join(' && ');
428
436
  },
429
437
 
430
438
  _cloudDataNodeWhere() {
431
- let where = []
439
+ let where = [];
432
440
  let selected = this.selected;
433
441
  if (selected.length) {
434
442
  where.push(`${this.parentField} == '${selected[selected.length - 1].value}'`);
@@ -437,24 +445,24 @@ export default {
437
445
  where = where.join(' || ');
438
446
 
439
447
  if (this.where) {
440
- return `(${this.where}) && (${where})`
448
+ return `(${this.where}) && (${where})`;
441
449
  }
442
450
 
443
- return where
451
+ return where;
444
452
  },
445
453
 
446
454
  _getWhereByForeignKey() {
447
- let result = []
455
+ let result = [];
448
456
  let whereField = this._getForeignKeyByField();
449
457
  if (whereField) {
450
- result.push(`${whereField} == '${this.dataValue}'`)
458
+ result.push(`${whereField} == '${this.dataValue}'`);
451
459
  }
452
460
 
453
461
  if (this.where) {
454
- return `(${this.where}) && (${result.join(' || ')})`
462
+ return `(${this.where}) && (${result.join(' || ')})`;
455
463
  }
456
464
 
457
- return result.join(' || ')
465
+ return result.join(' || ');
458
466
  },
459
467
 
460
468
  _getForeignKeyByField() {
@@ -474,149 +482,148 @@ export default {
474
482
  },
475
483
 
476
484
  _updateBindData(node) {
477
- const {
478
- dataList,
479
- hasNodes
480
- } = this._filterData(this._treeData, this.selected)
485
+ const { dataList, hasNodes } = this._filterData(this._treeData, this.selected);
481
486
 
482
- let isleaf = this._stepSearh === false && !hasNodes
487
+ let isleaf = this._stepSearh === false && !hasNodes;
483
488
 
484
489
  if (node) {
485
- node.isleaf = isleaf
490
+ node.isleaf = isleaf;
486
491
  }
487
492
 
488
- this.dataList = dataList
489
- this.selectedIndex = dataList.length - 1
493
+ this.dataList = dataList;
494
+ this.selectedIndex = dataList.length - 1;
490
495
 
491
496
  if (!isleaf && this.selected.length < dataList.length) {
492
497
  this.selected.push({
493
498
  value: null,
494
- text: "请选择"
495
- })
499
+ text: '请选择'
500
+ });
496
501
  }
497
502
 
498
503
  return {
499
504
  isleaf,
500
505
  hasNodes
501
- }
506
+ };
502
507
  },
503
508
 
504
509
  _updateSelected() {
505
- let dl = this.dataList
506
- let sl = this.selected
507
- let textField = this.map.text
508
- let valueField = this.map.value
510
+ let dl = this.dataList;
511
+ let sl = this.selected;
512
+ let textField = this.map.text;
513
+ let valueField = this.map.value;
509
514
  for (let i = 0; i < sl.length; i++) {
510
- let value = sl[i].value
511
- let dl2 = dl[i]
515
+ let value = sl[i].value;
516
+ let dl2 = dl[i];
512
517
  for (let j = 0; j < dl2.length; j++) {
513
- let item2 = dl2[j]
518
+ let item2 = dl2[j];
514
519
  if (item2[valueField] === value) {
515
- sl[i].text = item2[textField]
516
- break
520
+ sl[i].text = item2[textField];
521
+ break;
517
522
  }
518
523
  }
519
524
  }
520
525
  },
521
526
 
522
527
  _filterData(data, paths) {
523
- let dataList = []
524
- let hasNodes = true
528
+ let dataList = [];
529
+ let hasNodes = true;
525
530
 
526
- dataList.push(data.filter((item) => {
527
- return (item.parent_value === null || item.parent_value === undefined || item.parent_value === '')
528
- }))
531
+ dataList.push(
532
+ data.filter((item) => {
533
+ return item.parent_value === null || item.parent_value === undefined || item.parent_value === '';
534
+ })
535
+ );
529
536
  for (let i = 0; i < paths.length; i++) {
530
- let value = paths[i].value
537
+ let value = paths[i].value;
531
538
  let nodes = data.filter((item) => {
532
- return item.parent_value === value
533
- })
539
+ return item.parent_value === value;
540
+ });
534
541
 
535
542
  if (nodes.length) {
536
- dataList.push(nodes)
543
+ dataList.push(nodes);
537
544
  } else {
538
- hasNodes = false
545
+ hasNodes = false;
539
546
  }
540
547
  }
541
548
 
542
549
  return {
543
550
  dataList,
544
551
  hasNodes
545
- }
552
+ };
546
553
  },
547
554
 
548
555
  _extractTree(nodes, result, parent_value) {
549
- let list = result || []
550
- let valueField = this.map.value
556
+ let list = result || [];
557
+ let valueField = this.map.value;
551
558
  for (let i = 0; i < nodes.length; i++) {
552
- let node = nodes[i]
559
+ let node = nodes[i];
553
560
 
554
- let child = {}
561
+ let child = {};
555
562
  for (let key in node) {
556
563
  if (key !== 'children') {
557
- child[key] = node[key]
564
+ child[key] = node[key];
558
565
  }
559
566
  }
560
567
  if (parent_value !== null && parent_value !== undefined && parent_value !== '') {
561
- child.parent_value = parent_value
568
+ child.parent_value = parent_value;
562
569
  }
563
- result.push(child)
570
+ result.push(child);
564
571
 
565
- let children = node.children
572
+ let children = node.children;
566
573
  if (children) {
567
- this._extractTree(children, result, node[valueField])
574
+ this._extractTree(children, result, node[valueField]);
568
575
  }
569
576
  }
570
577
  },
571
578
 
572
579
  _extractTreePath(nodes, result) {
573
- let list = result || []
580
+ let list = result || [];
574
581
  for (let i = 0; i < nodes.length; i++) {
575
- let node = nodes[i]
582
+ let node = nodes[i];
576
583
 
577
- let child = {}
584
+ let child = {};
578
585
  for (let key in node) {
579
586
  if (key !== 'children') {
580
- child[key] = node[key]
587
+ child[key] = node[key];
581
588
  }
582
589
  }
583
- result.push(child)
590
+ result.push(child);
584
591
 
585
- let children = node.children
592
+ let children = node.children;
586
593
  if (children) {
587
- this._extractTreePath(children, result)
594
+ this._extractTreePath(children, result);
588
595
  }
589
596
  }
590
597
  },
591
598
 
592
599
  _findNodePath(key, nodes, path = []) {
593
- let textField = this.map.text
594
- let valueField = this.map.value
600
+ let textField = this.map.text;
601
+ let valueField = this.map.value;
595
602
  for (let i = 0; i < nodes.length; i++) {
596
- let node = nodes[i]
597
- let children = node.children
598
- let text = node[textField]
599
- let value = node[valueField]
603
+ let node = nodes[i];
604
+ let children = node.children;
605
+ let text = node[textField];
606
+ let value = node[valueField];
600
607
 
601
608
  path.push({
602
609
  value,
603
610
  text
604
- })
611
+ });
605
612
 
606
613
  if (value === key) {
607
- return path
614
+ return path;
608
615
  }
609
616
 
610
617
  if (children) {
611
- const p = this._findNodePath(key, children, path)
618
+ const p = this._findNodePath(key, children, path);
612
619
  if (p.length) {
613
- return p
620
+ return p;
614
621
  }
615
622
  }
616
623
 
617
- path.pop()
624
+ path.pop();
618
625
  }
619
- return []
626
+ return [];
620
627
  }
621
628
  }
622
- }
629
+ };