Sfoglia il codice sorgente

基础组件优化,接口更改成idass

李文 4 anni fa
parent
commit
776cfa2ac2

+ 1 - 1
public/index.html

@@ -51,7 +51,7 @@
   <% } %>
   <!-- 生产环境 -->
   <% if (process.env.VUE_APP_NODE_ENV === 'prod') { %>
-    <script>window.SITE_CONFIG['apiURL'] = '/api';</script>
+    <script>window.SITE_CONFIG['apiURL'] = '/api-idaas';</script>
   <% } %>
 </head>
 <body>

BIN
src/assets/img/common/icon-jczj-toggle.png


BIN
src/assets/img/jczj/icon-czrz.png


+ 100 - 6
src/assets/scss/smp.scss

@@ -1726,16 +1726,15 @@ html,body{
     .bc-top-change{
       position:absolute;
       top:0;
-      left:0;
-      width:36px;
+      left:47px;
       height:36px;
-      font-size:20px;
+      font-size:14px;
       display: flex;
       align-items: center;
       justify-content: center;
       color:$smp--color-blue;
-      font-weight:bold;
       cursor:pointer;
+      
     }
     .smp-normal-input{
       width:743px;
@@ -1743,7 +1742,21 @@ html,body{
       @include normal-shadow-1();
       display: block;
     }
+    .bc-search-bread{
+      // position:absolute;
+      padding:0 47px;
+      height:30px;
+      top:36px;
+      left:47px;
+      display: flex;
+      align-items: center;
+      .el-icon-close{
+        margin:0 10px 0 0;
+        cursor: pointer;
+      }
+    }
   }
+  
   .bc-bd{
     padding:15px 0 20px;
     flex:1;
@@ -1789,6 +1802,9 @@ html,body{
   width:100%;
   background-color: $smp--color-white;
   @include normal-shadow();
+  &.onLight{
+    box-shadow: 0 0 5px rgba(255,0,0,0.5) ;
+  }
   .co-hd{
     position:relative;
     width:100%;
@@ -1810,13 +1826,23 @@ html,body{
       color:$smp--color-font-color-3;
       font-weight:bold;
       text-indent: 11px;
+      &.isurl{
+        cursor: pointer;
+        color:$smp--color-blue;
+      }
     }
   }
   .co-bd{
-    min-height:95px;
+    
   }
   
 }
+.icon-jczj-toggle{
+  width:15px;
+  height:12px;
+  margin:0 5px 0 0;
+  background:url('~@/assets/img/common/icon-jczj-toggle.png') no-repeat 0 0;
+}
 
 // 基础组件子组件
 .com-menu{
@@ -1824,6 +1850,15 @@ html,body{
     display: flex;
     flex-wrap: wrap;
     padding:5px 4.8% 0;
+    min-height:100px;
+  }
+  .cm-subwraper-nochild{
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    font-size:20px;
+    color:#ccc;
+    height:50px;
   }
 }
 .com-sub-menu{
@@ -1835,7 +1870,7 @@ html,body{
     padding:0;
   }
   .csm-item{
-    background-color: #fafafa;
+    background-color: #f6f6f6;
     // background-color: #ff0;
     @include smp-radius-normal();
     height:68px;
@@ -1845,6 +1880,7 @@ html,body{
     position:relative;
     a{
       text-decoration: none;
+      padding:0 0 0 15px;
     }
     .el-icon-arrow-right{
       position: absolute;
@@ -1875,6 +1911,12 @@ html,body{
       white-space: pre-wrap;
       
     }
+    &:hover{
+      .csm-name{
+        font-weight:bold;
+        color:$smp--color-blue;
+      }
+    }
   }
 }
 .csm-zk-menu{
@@ -1898,6 +1940,58 @@ html,body{
     text-decoration: none;
     display: flex;
     align-items: center;
+    color:$smp--color-font-color-3;
+    padding:0!important;
+    &:hover{
+      background-color: $smp--color-gray_f5;
+      .csm-sec-name{
+        font-weight:bold;
+        color:$smp--color-blue;
+      }
+    }
+  }
+  .csm-sec-name{
+    padding:0 0 0 15px;
+    line-height: 40px;
+  }
+  .csm-sub-lv2{
+    .el-submenu__title{
+      line-height: 40px;
+      height:40px;
+      &:hover{
+        background-color: $smp--color-gray_f5;
+        .csm-sec-name{
+          font-weight:bold;
+          color:$smp--color-blue;
+        }
+      }
+    }
+    &.is-opened {
+      >.el-submenu__title .csm-sec-name{
+        font-weight:bold;
+        color:$smp--color-blue;
+      }
+      >.el-submenu__title .el-icon-arrow-right{
+        color:$smp--color-blue;
+      }
+    }
+  }
+  .el-submenu.is-opened{
+    background-color: $smp--color-gray_f5;
+    .csm-name{
+      font-weight:bold;
+      color:$smp--color-blue;
+    }
+    .csm-item .el-icon-arrow-right{
+      color:$smp--color-blue;
+    }
+    // .el-submenu__title{
+    //   .csm-sec-name{
+    //     font-weight:bold;
+    //     color:$smp--color-blue;
+    //   }
+    // }
+    
   }
 }
 $list: apiwg bzdlys bzdxsj bzqxyx bzslwp bzswmx bzyxsj clda czrz dawh dazdy dddlfw dpda dwjx fbsyykf ffdy fzfw jrclyq jsmxkj kshfxtyxt lcbdfw ljskf mxgl qjdlxx qyda ryda sjda sjgd sjkshfw sjmf sjzz snwyth sslxr swdcxr swdxfx swsjct swsjjz swtxmn tyqxrz tysjfw wbfx wfs wms wmts xtrz xtxtgj xxdl ycrz yhjsgl yhqxgl yhrz yhxxrz yzsff zhxss znbq znsb zstp zxfb zzjgrz tyyhfw; //$list 就是一个列表

+ 4 - 4
src/mock/index.js

@@ -11,14 +11,14 @@ import * as sysUser from './modules/sys-user'
 // tips
 // 1. 开启/关闭[业务模块]拦截, 通过调用fnCreate方法[isOpen参数]设置.
 // 2. 开启/关闭[业务模块中某个请求]拦截, 通过函数返回对象中的[isOpen属性]设置.
-fnCreate(common, true)
+fnCreate(common, false)
 fnCreate(jobSchedule, true)
 fnCreate(oss, true)
 fnCreate(sysConfig, true)
 fnCreate(sysLog, true)
-fnCreate(sysMenu, true)
-fnCreate(sysRole, true)
-fnCreate(sysUser, true)
+fnCreate(sysMenu, false)
+fnCreate(sysRole, false)
+fnCreate(sysUser, false)
 
 /**
  * 创建mock模拟数据

+ 2 - 2
src/mock/modules/common.js

@@ -20,7 +20,7 @@ import Mock from 'mockjs'
 export function login () {
   return {
     // isOpen: false,
-    url: '/login',
+    url: '/idaas/sso/login',
     type: 'post',
     data: {
       'msg': '登录成功',
@@ -34,7 +34,7 @@ export function login () {
 export function logout () {
   return {
     // isOpen: false,
-    url: '/sys/logout',
+    url: '/idaas/sso/logout',
     type: 'post',
     data: {
       'msg': 'success',

+ 64 - 1
src/mock/modules/sys-menu.js

@@ -549,6 +549,24 @@ var navDataList4 = [
     'children': []
   },
   {
+    'UUID': '12',
+    'parentUUID': '1',
+    'name': '监测预警22',
+    'ename': 'jcyjindex2',
+    'path': '',
+    'componentPath': 'business/home/home',
+    'children': []
+  },
+  {
+    'UUID': '13',
+    'parentUUID': '1',
+    'name': '监测预警333',
+    'ename': 'jcyjindex3',
+    'path': 'jcyjindex3',
+    'componentPath': 'business/home/home',
+    'children': []
+  },
+  {
     'UUID': '111',
     'parentUUID': '11',
     'name': 'xiao监测预警',
@@ -558,6 +576,15 @@ var navDataList4 = [
     'children': []
   },
   {
+    'UUID': '112',
+    'parentUUID': '11',
+    'name': 'xiao监测预警2',
+    'ename': 'jcyjindex222',
+    'path': 'jcyjindex32222',
+    'componentPath': 'business/home/home',
+    'children': []
+  },
+  {
     'UUID': '1111',
     'parentUUID': '111',
     'name': 'xiaoxiao监测预警',
@@ -567,6 +594,42 @@ var navDataList4 = [
     'children': []
   },
   {
+    'UUID': '1112',
+    'parentUUID': '111',
+    'name': 'xiaoxiao监测预警133',
+    'ename': 'jcyjindex133',
+    'path': 'jcyjindex41',
+    'componentPath': 'business/home/home',
+    'children': []
+  },
+  {
+    'UUID': '11111',
+    'parentUUID': '1111',
+    'name': 'xiaoxiao监测预警5级',
+    'ename': 'jcyjindex555',
+    'path': 'jcyjindex4555',
+    'componentPath': 'business/home/home',
+    'children': []
+  },
+  {
+    'UUID': '11112',
+    'parentUUID': '1111',
+    'name': 'xiaoxiao监测预警5-2级',
+    'ename': 'jcyjindex555-2',
+    'path': 'jcyjindex4555-2',
+    'componentPath': 'business/home/home',
+    'children': []
+  },
+  {
+    'UUID': '111111',
+    'parentUUID': '11111',
+    'name': 'xiaoxiao监测预警6级',
+    'ename': 'jcyjindex5556',
+    'path': 'jcyjindex45556',
+    'componentPath': 'business/home/home',
+    'children': []
+  },
+  {
     'UUID': '2',
     'parentUUID': 0,
     'name': '列表',
@@ -641,7 +704,7 @@ export function nav () {
 export function list () {
   return {
     // isOpen: false,
-    url: '/sys/menu/list',
+    url: '/idaas/ps/user/menuList',
     type: 'get',
     data: {
       'msg': 'success',

+ 2 - 2
src/mock/modules/sys-role.js

@@ -125,12 +125,12 @@ export function userinfo () {
 export function buttonList () {
   return {
     // isOpen: false,
-    url: '/sys/button/list',
+    url: '/idaas/ps/user/buttonList',
     type: 'get',
     data: {
       'msg': 'success',
       'code': 0,
-      'list': []
+      'buttonList': []
     }
   }
 }

+ 1 - 1
src/mock/modules/sys-user.js

@@ -39,7 +39,7 @@ export function list () {
 export function info () {
   return {
     // isOpen: false,
-    url: '/sys/user/info',
+    url: '/idaas/sso/user/info',
     type: 'get',
     data: {
       'msg': 'success',

+ 26 - 19
src/router/index.js

@@ -63,14 +63,15 @@ router.beforeEach((to, from, next) => {
     return next()
   }
   // 获取菜单列表, 添加并全局变量保存
-  http.get('/sys/menu/list').then(({data: res}) => {
+  http.get('/idaas/ps/user/menuList').then(({data: res}) => {
     if (res.code !== 0) {
       Vue.prototype.$message.error(res.msg)
       return next({name: 'login'})
     }
-    let toObj = findPathInHttpMenu(to, res.list)
-    let firstPath = toObj ? toObj.path : getParent(res.list)
-    // console.log(firstPath)
+    let toPath = findPathInHttpMenu(to, res.menuList)
+    let firstPath = toPath || getFirstPath(res.menuList)
+    setPathByUUID(res.menuList)
+    // console.log(to, from, res, firstPath)
     // if (!firstPath) {
     //   let homePage = {
     //     'UUID': 'index1',
@@ -84,7 +85,7 @@ router.beforeEach((to, from, next) => {
     //   firstPath = '/home'
     // }
 
-    window.SITE_CONFIG['menuList'] = res.list
+    window.SITE_CONFIG['menuList'] = res.menuList
     fnAddDynamicMenuRoutes(window.SITE_CONFIG['menuList'])
     // console.log(firstPath)
     next({path: firstPath, replace: true})
@@ -94,26 +95,32 @@ router.beforeEach((to, from, next) => {
 })
 
 function findPathInHttpMenu (to, list) {
-  let obj = ''
+  let backPath = ''
   list.forEach((e) => {
-    if ('/' + e.path === to.path) {
-      obj = e
+    let path = e.path || e.UUID
+    if ('/' + path === to.path) {
+      backPath = path
     }
   })
-  return obj
+  return backPath
 }
 
-function getParent (list) {
-  let arr = list.filter((e) => {
-    if (!e.path) {
-      e.path = e.UUID
-    }
-    if (!e.url) {
-      // e.url = 'https://juejin.im/'
+function getFirstPath (list) {
+  let backPath = ''
+  for (let i = 0; i < list.length; i++) {
+    let e = list[i]
+    let path = e.path || e.UUID
+    if (!e.parentUUID && path && e.url) {
+      backPath = path
+      break
     }
-    return !e.parentUUID && e.path && e.url
+  }
+  return backPath
+}
+function setPathByUUID (list) {
+  list.forEach((e) => {
+    !e.path && (e.path = e.UUID)
   })
-  return arr[0].path
 }
 
 /**
@@ -146,7 +153,7 @@ function fnAddDynamicMenuRoutes (menuList = [], routes = []) {
       temp = temp.concat(menuList[i].children)
       continue
     }
-    let path = menuList[i].path
+    let path = menuList[i].path || menuList[i].UUID
     let componentPath = menuList[i].componentPath
     let url = menuList[i].url
     // if (!url) {

+ 1 - 1
src/views/main/main-navbar-user.vue

@@ -64,7 +64,7 @@ export default {
         cancelButtonText: this.$t('cancel'),
         type: 'warning'
       }).then(() => {
-        this.$http.post('/logout').then(({ data: res }) => {
+        this.$http.post('/idaas/sso/logout').then(({ data: res }) => {
           if (res.code !== 0) {
             return this.$message.error(res.msg)
           }

+ 2 - 1
src/views/main/main-sidebar.vue

@@ -3,7 +3,7 @@
     <div class="smps-hd" :class="{'smps-hdclose':menuClose}">
       <div class="smpsh-title">{{currentMenuName}}</div>
       <div class="smpsh-change" :class="{'on':menuClose}" @click="changeMenuType">
-        <i class="el-icon-refresh"></i>
+        <i class="icon-jczj-toggle"></i>
       </div>
       <div class="smpsh-switch" :class="{'on':menuClose}" @click="switchMenu">
         <i class="smp-nav-icon-16 smp-ni16-slidebar-switch"></i>
@@ -187,6 +187,7 @@ export default {
       this.currentMenuList = this.currentMenuItem.children || []
       this.currentMenuName = this.currentMenuItem.name
       this.initMenu()
+      console.log(this.currentMenuList)
     }
   },
   mounted () {

+ 4 - 4
src/views/main/main.vue

@@ -135,7 +135,7 @@ export default {
     },
     // 获取当前管理员信息
     getUserInfo () {
-      return this.$http.get('/user/info').then(({ data: res }) => {
+      return this.$http.get('/idaas/sso/user/info').then(({ data: res }) => {
         if (res.code !== 0) {
           return this.$message.error(res.msg)
         }
@@ -145,12 +145,12 @@ export default {
     },
     // 获取权限
     getPermissions () {
-      return this.$http.get('/sys/button/list').then(({ data: res }) => {
+      return this.$http.get('/idaas/ps/user/buttonList').then(({ data: res }) => {
         if (res.code !== 0) {
           return this.$message.error(res.msg)
         }
-        this.$store.dispatch('permission', res.list)
-        window.SITE_CONFIG['permissions'] = res.list
+        this.$store.dispatch('permission', res.buttonList)
+        window.SITE_CONFIG['permissions'] = res.buttonList
       }).catch(() => {})
     }
   }

+ 115 - 50
src/views/modules/demo/basicComponent/basic-com.vue

@@ -1,12 +1,19 @@
 <template>
   <div class="basic-com">
     <div class="bc-top-search">
-      <div class="bc-top-change" v-if="isSidebar" title="切换正常导航" @click="changeSidebar">
-        <i class="el-icon-refresh"></i>
+      <div class="bc-top-change" v-if="isSidebar" @click="changeSidebar">
+        <i class="icon-jczj-toggle"></i>
+        切换
       </div>
       <el-autocomplete value-key="name" :trigger-on-focus="false" placeholder="请输入关键字" @select="gotoMenuTop" :fetch-suggestions="FindMenu" v-model="keyValue" class="smp-normal-input">
         <el-button slot="append" icon="el-icon-search"></el-button>
       </el-autocomplete>
+      <div class="bc-search-bread" v-if="searchBreadList.length">
+        <i class="el-icon-close" @click="removeSearchBread"></i>
+        <el-breadcrumb class="bcsb-crumb" separator-class="el-icon-arrow-right">
+          <el-breadcrumb-item v-for="(item,index) in searchBreadList" :key="index">{{item.name}}</el-breadcrumb-item>
+        </el-breadcrumb>
+      </div>
     </div>
     <div class="bc-bd">
       <div class="bc-wraper scrollbar-transparent">
@@ -29,6 +36,9 @@ export default {
   },
   data () {
     return {
+      iconIndex: 0,
+      sidebarMenuItem: {},
+      searchBreadList: [],
       keyValue: '',
       list: [
         // {
@@ -131,6 +141,10 @@ export default {
         })
       }
     },
+    removeSearchBread () {
+      this.removeSearchBreadLight()
+      this.searchBreadList = []
+    },
     changeSidebar () {
       this.$parent.gotoNormalSidebar()
     },
@@ -142,12 +156,67 @@ export default {
       } else {
         this.getBasicComList()
       }
+      this.list.forEach((e) => {
+        e.onSearchStatus = false
+      })
     },
     getBasicComList () {
+      // let dataArr = [
+      //   {
+      //     name: '智能工具',
+      //     children: ['NLP文本分析', '可视化分析推演系统', '智慧新搜索', '多维解析', '数据魔方', '统一时间服务', '系统协同工具', '智能识别', '知识图谱', '数据可视化服务', '流程表单服务'],
+      //     icon: ['wbfx', 'kshfxtyxt', 'zhxss', 'dwjx', 'sjmf', 'tysjfw', 'xtxtgj', 'znsb', 'zstp', 'sjkshfw', 'lcbdfw']
+      //   },
+      //   {
+      //     name: '模型工具',
+      //     children: ['模型管理', '智能标签'],
+      //     icon: ['mxgl', 'znbq']
+      //   },
+      //   {
+      //     name: '时空信息服务',
+      //     children: ['三维数据加载', '三维数据出图', '三维特效模拟', '标准地理要素服务', '标准影像数据服务', '标准矢量瓦片服务', '三维地形分析', '标准地形数据服务', '标准三维模型服务', '用户角色管理', '用户权限管理', '三维底层渲染', '标准倾斜影像服务', 'OGCWMTS服务', 'OGCWFS服务', 'OGCWMS服务', '全景地理信息服务', '室内外一体化'],
+      //     icon: ['swsjjz', 'swsjct', 'swtxmn', 'bzdlys', 'bzyxsj', 'bzslwp', 'swdxfx', 'bzdxsj', 'bzswmx', 'yhjsgl', 'yhqxgl', 'swdcxr', 'bzqxyx', 'wmts', 'wfs', 'wms', 'qjdlxx', 'snwyth']
+      //   },
+      //   {
+      //     name: '认证服务',
+      //     children: ['统一用户服务', '单点登录服务', '用户信息认证', '组织机构认证', '统一权限认证'],
+      //     icon: ['tyyhfw', 'dddlfw', 'yhxxrz', 'zzjgrz', 'tyqxrz']
+      //   },
+      //   {
+      //     name: '离线计算服务',
+      //     children: ['数据装载', '计算模型框架', '实时流写入'],
+      //     icon: ['sjzz', 'jsmxkj', 'sslxr']
+      //   },
+      //   {
+      //     name: '流计算服务',
+      //     children: ['加入处理引擎', '流计算开发', '辅助服务'],
+      //     icon: ['jrclyq', 'ljskf', 'fzfw']
+      //   },
+      //   {
+      //     name: '全息档案',
+      //     children: ['人员档案', '车辆档案', '企业档案', '店铺档案', '事件档案', '档案自定义', '在线发布', '档案维护'],
+      //     icon: ['ryda', 'clda', 'qyda', 'dpda', 'sjda', 'dazdy', 'zxfb', 'dawh']
+      //   },
+      //   {
+      //     name: '中间件服务',
+      //     children: ['消息队列MQ', '分布式应用开发服务', 'API网关'],
+      //     icon: ['xxdl', 'fbsyykf', 'apiwg']
+      //   },
+      //   {
+      //     name: '平台日志服务',
+      //     children: ['系统日志', '用户日志', '异常日志', '操作日志'],
+      //     icon: ['xtrz', 'yhrz', 'ycrz', 'czrz']
+      //   },
+      //   {
+      //     name: '数据分发服务',
+      //     children: ['一站式分发处理', '分发订阅', '数据归档'],
+      //     icon: ['yzsff', 'ffdy', 'sjgd']
+      //   }
+      // ]
       let dataArr = [
         {
           name: '智能工具',
-          children: ['NLP文本分析', '可视化分析推演系统', '智慧新搜索', '多维解析', '数据魔方', '统一时间服务', '系统协同工具', '智能识别', '知识图谱', '数据可视化服务', '流程表单服务'],
+          children: ['NLP文本分析', '可视化分析推演系统', '智慧新搜索', '多维解析'],
           icon: ['wbfx', 'kshfxtyxt', 'zhxss', 'dwjx', 'sjmf', 'tysjfw', 'xtxtgj', 'znsb', 'zstp', 'sjkshfw', 'lcbdfw']
         },
         {
@@ -156,44 +225,14 @@ export default {
           icon: ['mxgl', 'znbq']
         },
         {
-          name: '时空信息服务',
-          children: ['三维数据加载', '三维数据出图', '三维特效模拟', '标准地理要素服务', '标准影像数据服务', '标准矢量瓦片服务', '三维地形分析', '标准地形数据服务', '标准三维模型服务', '用户角色管理', '用户权限管理', '三维底层渲染', '标准倾斜影像服务', 'OGCWMTS服务', 'OGCWFS服务', 'OGCWMS服务', '全景地理信息服务', '室内外一体化'],
-          icon: ['swsjjz', 'swsjct', 'swtxmn', 'bzdlys', 'bzyxsj', 'bzslwp', 'swdxfx', 'bzdxsj', 'bzswmx', 'yhjsgl', 'yhqxgl', 'swdcxr', 'bzqxyx', 'wmts', 'wfs', 'wms', 'qjdlxx', 'snwyth']
-        },
-        {
-          name: '认证服务',
-          children: ['统一用户服务', '单点登录服务', '用户信息认证', '组织机构认证', '统一权限认证'],
-          icon: ['tyyhfw', 'dddlfw', 'yhxxrz', 'zzjgrz', 'tyqxrz']
-        },
-        {
-          name: '离线计算服务',
-          children: ['数据装载', '计算模型框架', '实时流写入'],
-          icon: ['sjzz', 'jsmxkj', 'sslxr']
-        },
-        {
-          name: '流计算服务',
-          children: ['加入处理引擎', '流计算开发', '辅助服务'],
-          icon: ['jrclyq', 'ljskf', 'fzfw']
-        },
-        {
-          name: '全息档案',
-          children: ['人员档案', '车辆档案', '企业档案', '店铺档案', '事件档案', '档案自定义', '在线发布', '档案维护'],
-          icon: ['ryda', 'clda', 'qyda', 'dpda', 'sjda', 'dazdy', 'zxfb', 'dawh']
-        },
-        {
-          name: '中间件服务',
-          children: ['消息队列MQ', '分布式应用开发服务', 'API网关'],
-          icon: ['xxdl', 'fbsyykf', 'apiwg']
-        },
-        {
-          name: '平台日志服务',
-          children: ['系统日志', '用户日志', '异常日志', '操作日志'],
-          icon: ['xtrz', 'yhrz', 'ycrz', 'czrz']
+          name: '模型工具',
+          children: ['模型管理', '智能标签'],
+          icon: ['mxgl', 'znbq']
         },
         {
-          name: '数据分发服务',
-          children: ['一站式分发处理', '分发订阅', '数据归档'],
-          icon: ['yzsff', 'ffdy', 'sjgd']
+          name: '模型工具',
+          children: ['模型管理', '智能标签'],
+          icon: ['mxgl', 'znbq']
         }
       ]
       let list = []
@@ -266,21 +305,24 @@ export default {
       //         icon: 'iconName'
       //       },
       let list = []
-      let iconIndex = 0
       let iconArr = this.iconArr
       arr.forEach((e) => {
         if (!e.noMenu) {
+          let url = e.path ? ('/' + e.path) : ''
+          if (!e.url && lv === 0) {
+            url = ''
+          }
           let obj = {
             ...e,
             lv: lv,
             id: e.UUID,
             pid: e.parentUUID,
-            url: e.path ? ('/' + e.path) : '',
+            url: url,
             style: {},
-            icon: iconArr[iconIndex++]
+            icon: iconArr[this.iconIndex++]
           }
-          if (iconIndex === iconArr.length) {
-            iconIndex = 0
+          if (this.iconIndex === iconArr.length) {
+            this.iconIndex = 0
           }
           if (e.children && e.children.length) {
             obj.children = this.addMenu(e.children, (lv + 1))
@@ -297,8 +339,20 @@ export default {
       console.log(itemArr)
       cb(itemArr)
     },
+    setSearchBreadLight () {
+      let root = this.searchBreadList[0]
+      let jqRoot = window.$('#root' + root.id)
+      jqRoot.addClass('onLight')
+    },
+    removeSearchBreadLight () {
+      let root = this.searchBreadList[0]
+      let jqRoot = window.$('#root' + root.id)
+      jqRoot.removeClass('onLight')
+    },
     gotoMenuTop (item) {
       let rootParent = this.findParent(item)
+      this.searchBreadList = this.findParentByLv(item)
+      this.setSearchBreadLight()
       // let rootItem = document.querySelector('#root' + rootParent.id)
       let jqRoot = window.$('#root' + rootParent.id).parent()
       let top = jqRoot.position().top
@@ -324,15 +378,26 @@ export default {
         return item
       }
     },
+    findParentByLv (item) {
+      // console.log(item.id)
+      let arr = []
+      let parent = this.treeObj[item.pid]
+      if (parent) {
+        arr = this.findParentByLv(parent).concat([item])
+      } else {
+        arr.unshift(item)
+      }
+      return arr
+    },
     flatData (arr) {
       arr.forEach((e, i) => {
-        let item = Object.assign({}, e)
-        this.treeArr.push(item)
-        if (item.children && item.children.length > 0) {
-          this.flatData(item.children)
+        // let item = Object.assign({}, e)
+        this.treeArr.push(e)
+        if (e.children && e.children.length > 0) {
+          this.flatData(e.children)
         }
-        item.children = ''
-        delete item.children
+        // item.children = ''
+        // delete item.children
         // item = cloneDeep(e)
       })
     }

+ 11 - 4
src/views/modules/demo/basicComponent/com-menu.vue

@@ -1,8 +1,11 @@
 <template>
-  <comOne class="com-menu" :title="menuItem.name">
-    <div class="cm-subwraper">
+  <comOne class="com-menu" :title="menuItem.name" :url="menuItem.url">
+    <div class="cm-subwraper" v-if="hasChild">
       <comSubmenu v-for="(item,index) in menuItem.children" :menuItem="item" :key="index"></comSubmenu>
     </div>
+    <div class="cm-subwraper-nochild" v-else>
+      暂无子组件
+    </div>
   </comOne>
 </template>
 <script>
@@ -27,12 +30,16 @@ export default {
 
     }
   },
-  computed: {},
+  computed: {
+    hasChild () {
+      return this.menuItem.children && this.menuItem.children.length
+    }
+  },
   created () {
 
   },
   mounted () {
-
+    console.log(this.menuItem)
   },
   methods: {
 

+ 25 - 5
src/views/modules/demo/basicComponent/com-one.vue

@@ -1,8 +1,9 @@
 <template>
-  <div class="com-one">
+  <div class="com-one" :class="{onSearchStatus:onSearchStatus}">
     <div class="co-hd">
       <i class="icon-title-bg"></i>
-      <span class="title-box">{{title}}</span>
+      <a v-if="isUrl" class="title-box isurl" :href="getHref(url)" target="_blank">{{title}} >></a>
+      <span class="title-box" v-else>{{title}}</span>
     </div>
     <div class="co-bd">
       <slot></slot>
@@ -12,14 +13,24 @@
 <script>
 export default {
   props: {
-    title: ''
+    title: '',
+    url: '',
+    onSearchStatus: ''
   },
   data () {
     return {
 
     }
   },
-  computed: {},
+  computed: {
+    isUrl () {
+      if (this.url) {
+        return true
+      } else {
+        return false
+      }
+    }
+  },
   created () {
 
   },
@@ -27,7 +38,16 @@ export default {
 
   },
   methods: {
-
+    getHref (url) {
+      // console.log(item.url, window.location)
+      let host = window.location.host
+      let href = window.location.href
+      if (url.indexOf('http') > -1) {
+        return url
+      } else if (href.indexOf(host + '/#') > -1) {
+        return '/#' + url
+      }
+    }
   }
 }
 </script>

+ 3 - 3
src/views/modules/demo/basicComponent/com-third-menu.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-submenu v-if="menuItem.children && menuItem.children.length >= 1" :index="menuItem.id+'sub'" :popper-append-to-body="false">
+  <el-submenu v-if="menuItem.children && menuItem.children.length >= 1" :index="menuItem.id+'sub'" :popper-append-to-body="false" :class="{'csm-sub-lv2':menuItem.lv>=2}">
     <template slot="title">
       <template v-if="menuItem.lv===1" class="cs">
         <div class="csm-item">
@@ -9,7 +9,7 @@
         </div>
       </template>
       <template v-if="menuItem.lv>=2">
-        <em class="csm-point">&middot;</em>
+        <!-- <em class="csm-point">&middot;</em> -->
         <span class="csm-sec-name" :title=" menuItem.name">
           {{ menuItem.name }}
         </span>
@@ -28,7 +28,7 @@
     </template>
     <template v-if="menuItem.lv>=2">
       <a class="menuItemA" :href="getHref(menuItem)" :target="getTarget(menuItem)">
-      <em class="csm-point">&middot;</em>
+      <!-- <em class="csm-point">&middot;</em> -->
       <span class="csm-sec-name" :title=" menuItem.name">
         {{ menuItem.name }}
       </span>

+ 1 - 0
src/views/modules/demo/basicComponent/pubuliu.vue

@@ -71,6 +71,7 @@ export default {
       this.wfitemW = (this.boxW - this.gap * (this.colNum - 1)) / this.colNum
     },
     setPosition () {
+      this.lastItem = []
       // console.log(this.list)
       let nodeList = document.querySelectorAll('.wf-item')
       nodeList.forEach((e, i) => {