疯狂的狮子li
2021-09-18 2f18d0d7094b10e169b77a0ea741bd101dbbf1f8
ruoyi-ui/src/utils/ruoyi.js
@@ -72,8 +72,8 @@
export function selectDictLabel(datas, value) {
   var actions = [];
   Object.keys(datas).some((key) => {
      if (datas[key].dictValue == ('' + value)) {
         actions.push(datas[key].dictLabel);
      if (datas[key].value == ('' + value)) {
         actions.push(datas[key].label);
         return true;
      }
   })
@@ -117,6 +117,22 @@
   return str;
}
// 数据合并
export function mergeRecursive(source, target) {
    for (var p in target) {
        try {
            if (target[p].constructor == Object) {
                source[p] = mergeRecursive(source[p], target[p]);
            } else {
                source[p] = target[p];
            }
        } catch(e) {
            source[p] = target[p];
        }
    }
    return source;
};
/**
 * 构造树型结构数据
 * @param {*} data 数据源