MrShi
5 小时以前 bff05c941230c57f0a1ed8d0e3c4f9c7b2b8af13
优化
已修改4个文件
36 ■■■■ 文件已修改
admin/src/components/common/CommonHeader.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/main.js 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/store/index.js 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/business/internalCompany.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/components/common/CommonHeader.vue
@@ -66,7 +66,6 @@
    return {
      title: process.env.VUE_APP_TITLE,
      headerNavData: {},
      currentIndex: 0,
      visible: {
        // 修改密码
        changePwd: false
@@ -99,7 +98,7 @@
    }
  },
  computed: {
    ...mapState(['menuData', 'userInfo', 'topMenuList'])
    ...mapState(['menuData', 'userInfo', 'topMenuList', 'currentIndex'])
    // title () {
    //   return this.$route.meta.title
    // }
@@ -126,7 +125,7 @@
    }
  },
  methods: {
    ...mapMutations(['setUserInfo', 'switchCollapseMenu', 'clearUserInfo', 'setTopMenuCurrent']),
    ...mapMutations(['setUserInfo', 'switchCollapseMenu', 'clearUserInfo', 'setTopMenuCurrent', 'setCurrentIndex']),
    // 修改密码
    changePwd () {
      this.visible.changePwd = true
@@ -165,8 +164,9 @@
      }
    },
    getHeaderNav (item,index) {
      this.currentIndex = index
      this.setCurrentIndex(index)
      if(item.linkType === 0){
        console.log('setTopMenuCurrent')
        this.setTopMenuCurrent(item)
      }else{
        if (item.url && item.url === 'goHKAF' && item.params != null) {
admin/src/main.js
@@ -55,7 +55,7 @@
    }
  },
  methods: {
    ...mapMutations(['switchCollapseMenu', 'setHomePage', 'setTopMenuCurrent', 'setTopMenuCurrent','cleartagsview']),
    ...mapMutations(['switchCollapseMenu', 'setCurrentIndex', 'setHomePage', 'setTopMenuCurrent', 'setTopMenuCurrent','cleartagsview']),
    // 初始化本地配置
    initLocalConfig () {
      // 菜单状态配置
@@ -95,7 +95,14 @@
              tlist.push(...item.children)
            }
          })
          this.setTopMenuCurrent(topCurrent)
          if (this.$route.query && this.$route.query.menuparams) {
            let menu = topList.filter(item => item.params === this.$route.query.menuparams)
            this.setTopMenuCurrent(menu[0])
            this.setCurrentIndex(topList.findIndex(obj => obj.params === this.$route.query.menuparams))
          } else {
            this.setTopMenuCurrent(topCurrent)
            this.setCurrentIndex(0)
          }
          // console.log(topList)
          // var menus = []
          // topList.forEach(item => {
@@ -120,7 +127,9 @@
            redirect: this.homePage.url
          })
          // 路由加载完成后,如果访问的是/,跳转至动态识别的首页
          if (this.$route.path === '/') {
          if (this.$route.query && this.$route.query.menuparams) {
            this.$router.push(topList.filter(item => item.params === this.$route.query.menuparams)[0].homeUrl)
          } else if (this.$route.path === '/') {
            this.$router.push(this.homePage.url)
          }
        })
admin/src/store/index.js
@@ -28,10 +28,17 @@
  // tags数组
  tags: [],
  // tagsview标签显示隐藏
  isCollapse: false
  isCollapse: false,
  // 顶部菜单索引
  currentIndex: 0
}
const mutations = {
  // 设置顶部菜单索引
  setCurrentIndex(state, index) {
    console.log('设置顶部菜单索引', index)
    state.currentIndex = index
  },
  // 切换菜单状态
  switchCollapseMenu (state, value) {
    if (value != null) {
admin/src/views/business/internalCompany.vue
@@ -17,8 +17,8 @@
    <!-- 表格和分页 -->
    <template v-slot:table-wrap>
      <ul class="toolbar" v-permissions="['business:company:create', 'business:company:sync']">
        <li><el-button type="primary" v-permissions="['business:company:create']"
            @click="$refs.OperaInternalCompanyWindow.open('新建组织', null, null)">新建</el-button></li>
<!--        <li><el-button type="primary" v-permissions="['business:company:create']"-->
<!--            @click="$refs.OperaInternalCompanyWindow.open('新建组织', null, null)">新建</el-button></li>-->
        <li><el-button @click="sort('top')" :loading="sorting" icon="el-icon-sort-up"
            v-permissions="['business:company:sort']">上移</el-button></li>
        <li><el-button @click="sort('bottom')" :loading="sorting" icon="el-icon-sort-down"