| | |
| | |
|
| | |
|
| | | /**
|
| | | * 通用js方法封装处理
|
| | | * Copyright (c) 2019 ruoyi
|
| | |
| | | return actions.join('');
|
| | | }
|
| | |
|
| | | // 回显数据字典(字符串数组)
|
| | | // 回显数据字典(字符串、数组)
|
| | | export function selectDictLabels(datas, value, separator) {
|
| | | if (value === undefined || value.length ===0) {
|
| | | return "";
|
| | |
| | | };
|
| | |
|
| | | var childrenListMap = {};
|
| | | var nodeIds = {};
|
| | | var tree = [];
|
| | |
|
| | | for (let d of data) {
|
| | | let parentId = d[config.parentId];
|
| | | if (childrenListMap[parentId] == null) {
|
| | | childrenListMap[parentId] = [];
|
| | | }
|
| | | nodeIds[d[config.id]] = d;
|
| | | childrenListMap[parentId].push(d);
|
| | | let id = d[config.id];
|
| | | childrenListMap[id] = d;
|
| | | }
|
| | |
|
| | | for (let d of data) {
|
| | | let parentId = d[config.parentId];
|
| | | if (nodeIds[parentId] == null) {
|
| | | let parentId = d[config.parentId]
|
| | | let parentObj = childrenListMap[parentId]
|
| | | if (!parentObj) {
|
| | | tree.push(d);
|
| | | }
|
| | | }
|
| | |
|
| | | for (let t of tree) {
|
| | | adaptToChildrenList(t);
|
| | | }
|
| | |
|
| | | function adaptToChildrenList(o) {
|
| | | if (childrenListMap[o[config.id]] !== null) {
|
| | | o[config.childrenList] = childrenListMap[o[config.id]];
|
| | | }
|
| | | if (o[config.childrenList]) {
|
| | | for (let c of o[config.childrenList]) {
|
| | | adaptToChildrenList(c);
|
| | | }
|
| | | } else {
|
| | | parentObj[config.childrenList].push(d)
|
| | | }
|
| | | }
|
| | | return tree;
|
| | |
| | | }
|
| | | return result
|
| | | }
|
| | |
|
| | |
|
| | | // 返回项目路径
|
| | | export function getNormalPath(p) {
|