vsyswin-ui 0.2.86 → 0.2.87
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.
- package/lib/vsyswin-ui.common.js +78 -116
- package/lib/vsyswin-ui.common.js.map +1 -1
- package/lib/vsyswin-ui.umd.js +78 -116
- package/lib/vsyswin-ui.umd.js.map +1 -1
- package/lib/vsyswin-ui.umd.min.js +9 -9
- package/lib/vsyswin-ui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/packages/search-bar/src/search-bar.vue +26 -3
- package/vue.config.js +0 -5
package/package.json
CHANGED
|
@@ -389,8 +389,6 @@
|
|
|
389
389
|
import _ from 'lodash'
|
|
390
390
|
import moment from 'moment'
|
|
391
391
|
import saveLocal from './save-local'
|
|
392
|
-
// import XEUtils from 'xe-utils'
|
|
393
|
-
import findTree from 'xe-utils/findTree'
|
|
394
392
|
|
|
395
393
|
function deepCopyFunction(arr1, arr2) {
|
|
396
394
|
for (let i = 0; i < arr1.length; i++) {
|
|
@@ -406,6 +404,31 @@ function deepCopyFunction(arr1, arr2) {
|
|
|
406
404
|
}
|
|
407
405
|
}
|
|
408
406
|
}
|
|
407
|
+
function findTree(allData, fn) {
|
|
408
|
+
function loopFn(arr, pNode) {
|
|
409
|
+
for (let i = 0; i < arr.length; i++) {
|
|
410
|
+
// debugger
|
|
411
|
+
let result = null
|
|
412
|
+
const item = arr[i]
|
|
413
|
+
item.nodes = [item]
|
|
414
|
+
if (pNode) {
|
|
415
|
+
item.nodes = [...pNode.nodes, item]
|
|
416
|
+
}
|
|
417
|
+
// findTree(item.options, tItem => tItem.value === lastValue)
|
|
418
|
+
const flag = fn(item)
|
|
419
|
+
if (flag) {
|
|
420
|
+
result = item
|
|
421
|
+
if (result) return result
|
|
422
|
+
}
|
|
423
|
+
if (item.children) {
|
|
424
|
+
result = loopFn(item.children, item)
|
|
425
|
+
}
|
|
426
|
+
if (result) return result
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
const res = loopFn(allData)
|
|
430
|
+
return res
|
|
431
|
+
}
|
|
409
432
|
|
|
410
433
|
export default {
|
|
411
434
|
name: 'SySearchbar',
|
|
@@ -638,7 +661,7 @@ export default {
|
|
|
638
661
|
} else {
|
|
639
662
|
const lastValue = item.value[item.value.length - 1]
|
|
640
663
|
const find = findTree(item.options, tItem => tItem.value === lastValue)
|
|
641
|
-
obj.name = find.nodes.map(y => y.label).join('/')
|
|
664
|
+
obj.name = find ? find.nodes.map(y => y.label).join('/') : ''
|
|
642
665
|
}
|
|
643
666
|
} else if (item.type === 'slot') {
|
|
644
667
|
if (!item.getValue) return
|
package/vue.config.js
CHANGED
|
@@ -10,11 +10,6 @@ module.exports = {
|
|
|
10
10
|
// 强制内联CSS
|
|
11
11
|
css: { extract: false },
|
|
12
12
|
// 扩展 webpack 配置,使 packages 加入编译
|
|
13
|
-
// configureWebpack: {
|
|
14
|
-
// externals: {
|
|
15
|
-
// 'xe-utils': 'XEUtils'
|
|
16
|
-
// }
|
|
17
|
-
// },
|
|
18
13
|
chainWebpack: config => {
|
|
19
14
|
/* config.module.rule('js')
|
|
20
15
|
.include
|