web-component-gallery 2.3.7 → 2.3.8
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/dist/index.umd.js +1 -1
- package/dist/js.umd.js +1 -1
- package/lib/browse/index.jsx +75 -132
- package/lib/browse/style/index.less +9 -0
- package/lib/form-comp/ASelectCustom.vue +2 -0
- package/lib/form-comp/AUpload.vue +146 -85
- package/lib/form-comp/style/AUpload.less +14 -11
- package/package.json +1 -1
- package/utils/Axios.js +1 -1
- package/utils/File.js +146 -0
- package/utils/Filter.js +590 -133
- package/utils/Tree.js +13 -12
package/utils/Tree.js
CHANGED
|
@@ -96,7 +96,7 @@ export function joinTreeMessage(
|
|
|
96
96
|
node[replaceField] = fields
|
|
97
97
|
.filter(field => node[field])
|
|
98
98
|
.map(field => node[field])
|
|
99
|
-
.join(' ')
|
|
99
|
+
.join(' ')
|
|
100
100
|
|
|
101
101
|
if (Array.isArray(node[childNode])) {
|
|
102
102
|
node[childNode].forEach(processNode)
|
|
@@ -151,9 +151,7 @@ export function getAllParents(tree, nodeId, { children = 'children', key = 'id'
|
|
|
151
151
|
metaInfo.set(node, { parentId })
|
|
152
152
|
nodeMap.set(node[key], { node, metaInfo })
|
|
153
153
|
|
|
154
|
-
if (node[children]
|
|
155
|
-
buildMap(node[children], node[key])
|
|
156
|
-
}
|
|
154
|
+
if (node[children]?.length) buildMap(node[children], node[key])
|
|
157
155
|
})
|
|
158
156
|
}
|
|
159
157
|
buildMap(tree)
|
|
@@ -162,14 +160,17 @@ export function getAllParents(tree, nodeId, { children = 'children', key = 'id'
|
|
|
162
160
|
const path = []
|
|
163
161
|
let current = nodeMap.get(nodeId)
|
|
164
162
|
while (current) {
|
|
165
|
-
returnObjects
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
163
|
+
if (returnObjects) {
|
|
164
|
+
// 直接返回原对象
|
|
165
|
+
path.unshift(current.node)
|
|
166
|
+
} else {
|
|
167
|
+
path.unshift(current.node[key])
|
|
168
|
+
}
|
|
169
|
+
current = current.metaInfo.get(current.node).parentId
|
|
170
|
+
? nodeMap.get(current.metaInfo.get(current.node).parentId)
|
|
171
|
+
: null
|
|
171
172
|
}
|
|
172
173
|
|
|
173
174
|
// 对象集合则返回父级
|
|
174
|
-
return returnObjects ? path
|
|
175
|
-
}
|
|
175
|
+
return returnObjects ? path[0] : path
|
|
176
|
+
}
|