疯狂的狮子li
2021-04-14 f093da99ecb963d19d62dc0f242f00b20bc8895c
Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue into dev

 Conflicts:
 ruoyi-admin/src/main/resources/application-prod.yml
 ruoyi-generator/src/main/resources/vm/java/controller.java.vm
 ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm
 ruoyi-ui/src/assets/styles/ruoyi.scss
 ruoyi-ui/src/assets/styles/sidebar.scss
 ruoyi-ui/src/layout/components/Navbar.vue
 ruoyi-ui/src/layout/components/Settings/index.vue
 ruoyi-ui/src/layout/components/TagsView/index.vue
 ruoyi-ui/src/settings.js
 ruoyi-ui/src/store/getters.js
 ruoyi-ui/src/store/modules/permission.js
 ruoyi-ui/src/store/modules/settings.js
 ruoyi-ui/src/store/modules/tagsView.js
 ruoyi-ui/src/views/monitor/druid/index.vue
已修改15个文件
已添加1个文件
454 ■■■■■ 文件已修改
ruoyi-admin/src/main/resources/application-prod.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-generator/src/main/resources/vm/java/controller.java.vm 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/assets/styles/ruoyi.scss 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/assets/styles/sidebar.scss 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/components/Editor/index.vue 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/components/TopNav/index.vue 154 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/layout/components/Navbar.vue 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/layout/components/Settings/index.vue 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/layout/components/TagsView/index.vue 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/settings.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/store/getters.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/store/modules/permission.js 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/store/modules/settings.js 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/store/modules/tagsView.js 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/utils/ruoyi.js 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/monitor/druid/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application-prod.yml
@@ -43,7 +43,7 @@
                allow:
                url-pattern: /druid/*
                # æŽ§åˆ¶å°ç®¡ç†ç”¨æˆ·åå’Œå¯†ç 
                login-username: admin
                login-username: ruoyi
                login-password: 123456
            filter:
                stat:
ruoyi-generator/src/main/resources/vm/java/controller.java.vm
@@ -74,7 +74,7 @@
    public AjaxResult<${ClassName}Vo> export(${ClassName}QueryBo bo) {
        List<${ClassName}Vo> list = i${ClassName}Service.queryList(bo);
        ExcelUtil<${ClassName}Vo> util = new ExcelUtil<${ClassName}Vo>(${ClassName}Vo.class);
        return util.exportExcel(list, "${businessName}" );
        return util.exportExcel(list, "${businessName}数据" );
    }
    /**
ruoyi-ui/src/assets/styles/ruoyi.scss
@@ -176,6 +176,12 @@
  color: #FFFFFF;
}
/* submenu item */
.el-menu--horizontal > .el-submenu .el-submenu__title {
    height: 50px !important;
    line-height: 50px !important;
}
/* text color */
.text-navy {
    color: #1ab394;
ruoyi-ui/src/assets/styles/sidebar.scss
@@ -135,9 +135,6 @@
          margin-left: 20px;
        }
        .el-submenu__icon-arrow {
          display: none;
        }
      }
    }
ruoyi-ui/src/components/Editor/index.vue
@@ -1,5 +1,19 @@
<template>
  <div>
    <el-upload
      :action="uploadUrl"
      :on-success="handleUploadSuccess"
      :on-error="handleUploadError"
      name="file"
      :show-file-list="false"
      :headers="headers"
      style="display: none"
      ref="upload"
      v-if="this.uploadUrl"
    >
    </el-upload>
    <div class="editor" ref="editor" :style="styles"></div>
  </div>
</template>
<script>
@@ -7,6 +21,7 @@
import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css";
import { getToken } from "@/utils/auth";
export default {
  name: "Editor",
@@ -30,10 +45,18 @@
    readOnly: {
      type: Boolean,
      default: false,
    },
    /* ä¸Šä¼ åœ°å€ */
    uploadUrl: {
      type: String,
      default: "",
    }
  },
  data() {
    return {
      headers: {
        Authorization: "Bearer " + getToken()
      },
      Quill: null,
      currentValue: "",
      options: {
@@ -52,7 +75,7 @@
            [{ color: [] }, { background: [] }],             // å­—体颜色、字体背景颜色
            [{ align: [] }],                                 // å¯¹é½æ–¹å¼
            ["clean"],                                       // æ¸…除文本格式
            ["link", "image", "video"]                       // é“¾æŽ¥ã€å›¾ç‰‡ã€è§†é¢‘
            ["link", "image"]                                // é“¾æŽ¥ã€å›¾ç‰‡
          ],
        },
        placeholder: "请输入内容",
@@ -95,6 +118,26 @@
    init() {
      const editor = this.$refs.editor;
      this.Quill = new Quill(editor, this.options);
      // å¦‚果设置了上传地址则自定义图片上传事件
      if (this.uploadUrl) {
        let toolbar = this.Quill.getModule("toolbar");
        toolbar.addHandler("image", (value) => {
          this.uploadType = "image";
          if (value) {
            this.$refs.upload.$children[0].$refs.input.click();
          } else {
            this.quill.format("image", false);
          }
        });
        toolbar.addHandler("video", (value) => {
          this.uploadType = "video";
          if (value) {
            this.$refs.upload.$children[0].$refs.input.click();
          } else {
            this.quill.format("video", false);
          }
        });
      }
      this.Quill.pasteHTML(this.currentValue);
      this.Quill.on("text-change", (delta, oldDelta, source) => {
        const html = this.$refs.editor.children[0].innerHTML;
@@ -114,13 +157,31 @@
        this.$emit("on-editor-change", eventName, ...args);
      });
    },
    handleUploadSuccess(res, file) {
      // èŽ·å–å¯Œæ–‡æœ¬ç»„ä»¶å®žä¾‹
      let quill = this.Quill;
      // å¦‚果上传成功
      if (res.code == 200) {
        // èŽ·å–å…‰æ ‡æ‰€åœ¨ä½ç½®
        let length = quill.getSelection().index;
        // æ’入图片  res.url为服务器返回的图片地址
        quill.insertEmbed(length, "image", res.url);
        // è°ƒæ•´å…‰æ ‡åˆ°æœ€åŽ
        quill.setSelection(length + 1);
      } else {
        this.$message.error("图片插入失败");
      }
    },
    handleUploadError() {
      this.$message.error("图片插入失败");
    },
  },
};
</script>
<style>
.editor, .ql-toolbar {
  white-space: pre-wrap!important;
  white-space: pre-wrap !important;
  line-height: normal !important;
}
.quill-img {
ruoyi-ui/src/components/TopNav/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,154 @@
<template>
  <el-menu
    :default-active="activeMenu"
    mode="horizontal"
    @select="handleSelect"
  >
    <template v-for="(item, index) in topMenus">
      <el-menu-item :index="item.path" :key="index" v-if="index < visibleNumber"
        ><svg-icon :icon-class="item.meta.icon" />
        {{ item.meta.title }}</el-menu-item
      >
    </template>
    <!-- é¡¶éƒ¨èœå•超出数量折叠 -->
    <el-submenu index="more" v-if="topMenus.length > visibleNumber">
      <template slot="title">更多菜单</template>
      <template v-for="(item, index) in topMenus">
        <el-menu-item
          :index="item.path"
          :key="index"
          v-if="index >= visibleNumber"
          ><svg-icon :icon-class="item.meta.icon" />
          {{ item.meta.title }}</el-menu-item
        >
      </template>
    </el-submenu>
  </el-menu>
</template>
<script>
import { constantRoutes } from "@/router";
// ä¸éœ€è¦æ¿€æ´»çš„路由
const noactiveList = ["/user/profile", "/dict/type", "/gen/edit", "/job/log"];
export default {
  data() {
    return {
      // é¡¶éƒ¨æ åˆå§‹æ•°
      visibleNumber: 5,
      // æ˜¯å¦ä¸ºé¦–次加载
      isFrist: false,
    };
  },
  computed: {
    // é¡¶éƒ¨æ˜¾ç¤ºèœå•
    topMenus() {
      let topMenus = [];
      this.routers.map((menu) => {
        if (menu.hidden !== true) {
          topMenus.push(menu);
        }
      });
      return topMenus;
    },
    // æ‰€æœ‰çš„路由信息
    routers() {
      return this.$store.state.permission.topbarRouters;
    },
    // è®¾ç½®å­è·¯ç”±
    childrenMenus() {
      var childrenMenus = [];
      this.routers.map((router) => {
        for (var item in router.children) {
          if (router.children[item].parentPath === undefined) {
            router.children[item].path = router.path + "/" + router.children[item].path;
            router.children[item].parentPath = router.path;
          }
          childrenMenus.push(router.children[item]);
        }
      });
      return constantRoutes.concat(childrenMenus);
    },
    // é»˜è®¤æ¿€æ´»çš„菜单
    activeMenu() {
      const path = this.$route.path;
      let activePath = this.routers[0].path;
      var noactive = noactiveList.some(function (item) {
        return path.indexOf(item) !== -1;
      });
      if (noactive) {
        return;
      }
      if (path.lastIndexOf("/") > 0) {
        const tmpPath = path.substring(1, path.length);
        activePath = "/" + tmpPath.substring(0, tmpPath.indexOf("/"));
      } else if ("/index" == path || "" == path) {
        if (!this.isFrist) {
          this.isFrist = true;
        } else {
          activePath = "index";
        }
      }
      this.activeRoutes(activePath);
      return activePath;
    },
  },
  beforeMount() {
    window.addEventListener('resize', this.setVisibleNumber)
  },
  beforeDestroy() {
    window.removeEventListener('resize', this.setVisibleNumber)
  },
  mounted() {
    this.setVisibleNumber();
  },
  methods: {
    // æ ¹æ®å®½åº¦è®¡ç®—设置显示栏数
    setVisibleNumber() {
      const width = document.body.getBoundingClientRect().width / 3;
      this.visibleNumber = parseInt(width / 85);
    },
    // èœå•选择事件
    handleSelect(key, keyPath) {
      if (key.indexOf("http://") !== -1 || key.indexOf("https://") !== -1) {
        // http(s):// è·¯å¾„新窗口打开
        window.open(key, "_blank");
      } else {
        this.activeRoutes(key);
      }
    },
    // å½“前激活的路由
    activeRoutes(key) {
      var routes = [];
      if (this.childrenMenus && this.childrenMenus.length > 0) {
        this.childrenMenus.map((item) => {
          if (key == item.parentPath || (key == "index" && "" == item.path)) {
            routes.push(item);
          }
        });
      }
      this.$store.commit("SET_SIDEBAR_ROUTERS", routes);
    }
  },
};
</script>
<style lang="scss" scoped>
.el-menu--horizontal > .el-menu-item {
  float: left;
  height: 50px;
  line-height: 50px;
  margin: 0;
  border-bottom: 3px solid transparent;
  color: #999093;
  padding: 0 5px;
  margin: 0 10px;
}
.el-menu--horizontal > .el-menu-item.is-active {
  border-bottom: 3px solid #409eff;
  color: #303133;
}
</style>
ruoyi-ui/src/layout/components/Navbar.vue
@@ -2,7 +2,8 @@
  <div class="navbar">
    <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
    <breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
    <breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/>
    <top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/>
    <div class="right-menu">
      <template v-if="device!=='mobile'">
@@ -48,6 +49,7 @@
<script>
import { mapGetters } from 'vuex'
import Breadcrumb from '@/components/Breadcrumb'
import TopNav from '@/components/TopNav'
import Hamburger from '@/components/Hamburger'
import Screenfull from '@/components/Screenfull'
import SizeSelect from '@/components/SizeSelect'
@@ -58,6 +60,7 @@
export default {
  components: {
    Breadcrumb,
    TopNav,
    Hamburger,
    Screenfull,
    SizeSelect,
@@ -80,6 +83,11 @@
          key: 'showSettings',
          value: val
        })
      }
    },
    topNav: {
      get() {
        return this.$store.state.settings.topNav
      }
    }
  },
@@ -127,6 +135,11 @@
    float: left;
  }
  .topmenu-container {
    position: absolute;
    left: 50px;
  }
  .errLog-container {
    display: inline-block;
    vertical-align: top;
ruoyi-ui/src/layout/components/Settings/index.vue
@@ -41,6 +41,11 @@
      <el-divider/>
      <h3 class="drawer-title">系统布局配置</h3>
      <div class="drawer-item">
        <span>开启 TopNav</span>
        <el-switch v-model="topNav" class="drawer-switch" />
      </div>
      <div class="drawer-item">
        <span>开启 Tags-Views</span>
@@ -57,6 +62,10 @@
        <el-switch v-model="sidebarLogo" class="drawer-switch" />
      </div>
      <el-divider/>
      <el-button size="small" type="primary" plain icon="el-icon-document-add" @click="saveSetting">保存配置</el-button>
      <el-button size="small" plain icon="el-icon-refresh" @click="resetSetting">重置配置</el-button>
    </div>
  </div>
</template>
@@ -67,14 +76,13 @@
export default {
  components: { ThemePicker },
  data() {
    return {}
    return {
      sideTheme: this.$store.state.settings.sideTheme
    };
  },
  computed: {
    theme() {
      return this.$store.state.settings.theme
    },
    sideTheme() {
      return this.$store.state.settings.sideTheme
    },
    fixedHeader: {
      get() {
@@ -85,6 +93,20 @@
          key: 'fixedHeader',
          value: val
        })
      }
    },
    topNav: {
      get() {
        return this.$store.state.settings.topNav
      },
      set(val) {
        this.$store.dispatch('settings/changeSetting', {
          key: 'topNav',
          value: val
        })
        if (!val) {
          this.$store.commit("SET_SIDEBAR_ROUTERS", this.$store.state.permission.defaultRoutes);
        }
      }
    },
    tagsView: {
@@ -122,6 +144,38 @@
        key: 'sideTheme',
        value: val
      })
      this.sideTheme = val;
    },
    saveSetting() {
      const loading = this.$loading({
        lock: true,
        fullscreen: false,
        text: "正在保存到本地,请稍后...",
        spinner: "el-icon-loading",
        background: "rgba(0, 0, 0, 0.7)"
      });
      localStorage.setItem(
        "layout-setting",
        `{
            "topNav":${this.topNav},
            "tagsView":${this.tagsView},
            "fixedHeader":${this.fixedHeader},
            "sidebarLogo":${this.sidebarLogo},
            "sideTheme":"${this.sideTheme}"
          }`
      );
      setTimeout(loading.close(), 1000)
    },
    resetSetting() {
      this.$loading({
        lock: true,
        fullscreen: false,
        text: "正在清除设置缓存并刷新,请稍后...",
        spinner: "el-icon-loading",
        background: "rgba(0, 0, 0, 0.7)"
      });
      localStorage.removeItem("layout-setting")
      setTimeout("window.location.reload()", 1000)
    }
  }
}
ruoyi-ui/src/layout/components/TagsView/index.vue
@@ -21,6 +21,7 @@
      <li @click="refreshSelectedTag(selectedTag)">刷新页面</li>
      <li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)">关闭当前</li>
      <li @click="closeOthersTags">关闭其他</li>
      <li v-if="!isLastView()" @click="closeRightTags">关闭右侧</li>
      <li @click="closeAllTags(selectedTag)">关闭所有</li>
    </ul>
  </div>
@@ -82,6 +83,13 @@
    },
    isAffix(tag) {
      return tag.meta && tag.meta.affix
    },
    isLastView() {
      try {
        return this.selectedTag.fullPath === this.visitedViews[this.visitedViews.length - 1].fullPath
      } catch (err) {
        return false
      }
    },
    filterAffixTags(routes, basePath = '/') {
      let tags = []
@@ -152,6 +160,13 @@
        }
      })
    },
    closeRightTags() {
      this.$store.dispatch('tagsView/delRightTags', this.selectedTag).then(visitedViews => {
        if (!visitedViews.find(i => i.fullPath === this.$route.fullPath)) {
          this.toLastView(visitedViews)
        }
      })
    },
    closeOthersTags() {
      this.$router.push(this.selectedTag).catch(()=>{});
      this.$store.dispatch('tagsView/delOthersViews', this.selectedTag).then(() => {
ruoyi-ui/src/settings.js
@@ -12,6 +12,11 @@
  showSettings: false,
  /**
   * æ˜¯å¦æ˜¾ç¤ºé¡¶éƒ¨å¯¼èˆª
   */
  topNav: false,
  /**
   * æ˜¯å¦æ˜¾ç¤º tagsView
   */
  tagsView: true,
ruoyi-ui/src/store/getters.js
@@ -11,6 +11,8 @@
  roles: state => state.user.roles,
  permissions: state => state.user.permissions,
  permission_routes: state => state.permission.routes,
  topbarRouters:state => state.permission.topbarRouters,
  defaultRoutes:state => state.permission.defaultRoutes,
  sidebarRouters:state => state.permission.sidebarRouters,
}
export default getters
ruoyi-ui/src/store/modules/permission.js
@@ -7,6 +7,8 @@
  state: {
    routes: [],
    addRoutes: [],
    defaultRoutes: [],
    topbarRouters: [],
    sidebarRouters: []
  },
  mutations: {
@@ -14,8 +16,19 @@
      state.addRoutes = routes
      state.routes = constantRoutes.concat(routes)
    },
    SET_SIDEBAR_ROUTERS: (state, routers) => {
      state.sidebarRouters = constantRoutes.concat(routers)
    SET_DEFAULT_ROUTES: (state, routes) => {
      state.defaultRoutes = constantRoutes.concat(routes)
    },
    SET_TOPBAR_ROUTES: (state, routes) => {
      // é¡¶éƒ¨å¯¼èˆªèœå•默认添加统计报表栏指向首页
      const index = [{
        path: 'index',
        meta: { title: '统计报表', icon: 'dashboard'}
      }]
      state.topbarRouters = routes.concat(index);
    },
    SET_SIDEBAR_ROUTERS: (state, routes) => {
      state.sidebarRouters = routes
    },
  },
  actions: {
@@ -30,7 +43,9 @@
          const rewriteRoutes = filterAsyncRouter(rdata, false, true)
          rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true })
          commit('SET_ROUTES', rewriteRoutes)
          commit('SET_SIDEBAR_ROUTERS', sidebarRoutes)
          commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes))
          commit('SET_DEFAULT_ROUTES', sidebarRoutes)
          commit('SET_TOPBAR_ROUTES', sidebarRoutes)
          resolve(rewriteRoutes)
        })
      })
ruoyi-ui/src/store/modules/settings.js
@@ -1,17 +1,18 @@
import variables from '@/assets/styles/element-variables.scss'
import defaultSettings from '@/settings'
const { sideTheme, showSettings, tagsView, fixedHeader, sidebarLogo } = defaultSettings
const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo } = defaultSettings
const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || ''
const state = {
  theme: variables.theme,
  sideTheme: sideTheme,
  sideTheme: storageSetting.sideTheme || sideTheme,
  showSettings: showSettings,
  tagsView: tagsView,
  fixedHeader: fixedHeader,
  sidebarLogo: sidebarLogo
  topNav:  storageSetting.topNav === undefined ? topNav : storageSetting.topNav,
  tagsView: storageSetting.tagsView === undefined ? tagsView : storageSetting.tagsView,
  fixedHeader: storageSetting.fixedHeader === undefined ? fixedHeader : storageSetting.fixedHeader,
  sidebarLogo: storageSetting.sidebarLogo === undefined ? sidebarLogo : storageSetting.sidebarLogo
}
const mutations = {
  CHANGE_SETTING: (state, { key, value }) => {
    if (state.hasOwnProperty(key)) {
ruoyi-ui/src/store/modules/tagsView.js
@@ -62,6 +62,23 @@
        break
      }
    }
  },
  DEL_RIGHT_VIEWS: (state, view) => {
    const index = state.visitedViews.findIndex(v => v.path === view.path)
    if (index === -1) {
      return
    }
    state.visitedViews = state.visitedViews.filter((item, idx) => {
      if (idx <= index || (item.meta && item.meta.affix)) {
        return true
      }
      const i = state.cachedViews.indexOf(item.name)
      if (i > -1) {
        state.cachedViews.splice(i, 1)
      }
      return false
    })
  }
}
@@ -148,6 +165,13 @@
  updateVisitedView({ commit }, view) {
    commit('UPDATE_VISITED_VIEW', view)
  },
  delRightTags({ commit }, view) {
    return new Promise(resolve => {
      commit('DEL_RIGHT_VIEWS', view)
      resolve([...state.visitedViews])
    })
  }
}
ruoyi-ui/src/utils/ruoyi.js
@@ -58,7 +58,7 @@
    var search = params;
    search.params = {};
    if (null != dateRange && '' != dateRange) {
        if (typeof(propName) === "undefined") {
        if (typeof (propName) === "undefined") {
            search.params["beginTime"] = dateRange[0];
            search.params["endTime"] = dateRange[1];
        } else {
@@ -129,24 +129,47 @@
 * @param {*} id id字段 é»˜è®¤ 'id'
 * @param {*} parentId çˆ¶èŠ‚ç‚¹å­—æ®µ é»˜è®¤ 'parentId'
 * @param {*} children å­©å­èŠ‚ç‚¹å­—æ®µ é»˜è®¤ 'children'
 * @param {*} rootId æ ¹Id é»˜è®¤ 0
 */
export function handleTree(data, id, parentId, children, rootId) {
    id = id || 'id'
    parentId = parentId || 'parentId'
    children = children || 'children'
    rootId = rootId || Math.min.apply(Math, data.map(item => { return item[parentId] })) || 0
    //对源数据深度克隆
    const cloneData = JSON.parse(JSON.stringify(data))
    //循环所有项
    const treeData = cloneData.filter(father => {
        let branchArr = cloneData.filter(child => {
            //返回每一项的子级数组
            return father[id] === child[parentId]
        });
        branchArr.length > 0 ? father.children = branchArr : '';
        //返回第一层
        return father[parentId] === rootId;
    });
    return treeData != '' ? treeData : data;
export function handleTree(data, id, parentId, children) {
    let config = {
        id: id || 'id',
        parentId: parentId || 'parentId',
        childrenList: children || 'children'
    };
    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);
    }
    for (let d of data) {
        let parentId = d[config.parentId];
        if (nodeIds[parentId] == null) {
            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);
            }
        }
    }
    return tree;
}
ruoyi-ui/src/views/monitor/druid/index.vue
@@ -8,7 +8,7 @@
  name: "Druid",
  data() {
    return {
      src: process.env.VUE_APP_BASE_API + "/druid/index.html",
      src: process.env.VUE_APP_BASE_API + "/druid/login.html",
      height: document.documentElement.clientHeight - 94.5 + "px;",
      loading: true
    };