dlsjs 0.1.20 → 0.1.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.
- package/dist/dlsjs.cjs.js +1 -1
- package/dist/dlsjs.cjs.js.map +1 -1
- package/dist/dlsjs.esm.js +1 -1
- package/dist/dlsjs.esm.js.map +1 -1
- package/dist/dlsjs.umd.js +1 -1
- package/dist/dlsjs.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/core/ES/Tree.js +4 -4
package/package.json
CHANGED
package/src/core/ES/Tree.js
CHANGED
|
@@ -162,16 +162,16 @@ export function forkProp(obj, leafKey, propName) {
|
|
|
162
162
|
|
|
163
163
|
/**
|
|
164
164
|
* 维表转树
|
|
165
|
-
* @param dimList
|
|
166
|
-
* @param dimLink
|
|
167
|
-
* @param dimMap
|
|
165
|
+
* @param dimList 平铺维表
|
|
166
|
+
* @param dimLink 维表关联关系 e.g.['市','区县','乡镇']
|
|
167
|
+
* @param dimMap 维表关联映射字段 e.g.{'市': {propFieldName: 'code1', textFieldName: 'name1'}, '区': {propFieldName: 'code2', textFieldName: 'name2'}, '乡镇': {propFieldName: 'code3', textFieldName: 'name3'}}
|
|
168
168
|
*/
|
|
169
169
|
export function dim2Tree(dimList, dimLink, dimMap) {
|
|
170
170
|
let filedSort = [];
|
|
171
171
|
if (dimLink.length) {
|
|
172
172
|
for (let propName of dimLink) {
|
|
173
173
|
if (!propName) continue;
|
|
174
|
-
let match = dimMap
|
|
174
|
+
let match = dimMap[propName]
|
|
175
175
|
filedSort.push(match);
|
|
176
176
|
}
|
|
177
177
|
}
|