wangting
2023-07-21 deed4fd12c523bdcd711958a845e0cbfb9b63610
路由还原
已修改5个文件
35 ■■■■ 文件已修改
Source/UBCS-WEB/public/src/permission.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/public/src/store/modules/tags.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/page/index/index.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/permission.js 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/router/avue-router.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/public/src/permission.js
@@ -36,7 +36,7 @@
          if (to.query.target) {
            window.open(value)
          } else if (meta.isTab !== false && !validatenull(value) && !validatenull(label)) {
            store.commit('', {
            store.commit('ADD_TAG', {
              label: label,
              value: value,
              params: to.params,
Source/UBCS-WEB/public/src/store/modules/tags.js
@@ -47,7 +47,6 @@
      setStore({name: 'tagList', content: state.tagList})
    },
    DEL_TAG: (state, action) => {
      console.log('779',state,action)
      state.tagList = state.tagList.filter(item => {
        return !diff(item, action);
      })
Source/UBCS-WEB/src/page/index/index.vue
@@ -18,9 +18,9 @@
        <!-- 主体视图层 -->
        <div style="height:100%;overflow-y:auto;overflow-x:hidden;" id="avue-view" v-show="!isSearch">
          <keep-alive>
            <router-view class="avue-view" v-if="$route.meta.keepAlive" :key="$route.fullPath"></router-view>
            <router-view class="avue-view" v-if="$route.meta.keepAlive" :key="$route.fullPath"/>
          </keep-alive>
          <router-view class="avue-view"  v-if="!$route.meta.keepAlive" :key="$route.fullPath" ></router-view>
          <router-view class="avue-view" v-if="!$route.meta.keepAlive" :key="$route.fullPath"/>
        </div>
      </div>
    </div>
@@ -38,7 +38,7 @@
  import {validatenull} from "@/util/validate";
  import {calcDate} from "@/util/date.js";
  import {getStore} from "@/util/store.js";
  import {getRoutes} from "@/api/system/menu"
  export default {
    components: {
      top,
@@ -60,15 +60,14 @@
        refreshLock: false,
        //刷新token的时间
        refreshTime: "",
        loading:true,
        routeList:[],
        ids:[]
        loading:true
      };
    },
    created() {
      //实时检测刷新token
      this.refreshToken();
    },
    mounted() {
      this.init();
Source/UBCS-WEB/src/permission.js
@@ -7,8 +7,7 @@
import {validatenull} from '@/util/validate'
import {getToken} from '@/util/auth'
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css'
import Store from "@/store"; // progress bar style
import 'nprogress/nprogress.css' // progress bar style
NProgress.configure({showSpinner: false});
const lockPage = store.getters.website.lockPage; //锁屏页
router.beforeEach((to, from, next) => {
@@ -30,16 +29,8 @@
            next({path: '/login'})
          })
        } else {
          const fullPath = to.fullPath
          const queryString = fullPath.split('?')[1];
          const value = to.query.src || to.fullPath;
          const label = queryString === 'wupin'
            ? '物品主数据'
            : (queryString === 'renyuan'
              ? '人员主数据'
              : (queryString === 'gongyingshang'
                ? '供应商主数据'
                : (to.query.name || to.name)));
          const label = to.query.name || to.name;
          const meta = to.meta || router.$avueRouter.meta || {};
          const i18n = to.query.i18n;
          if (to.query.target) {
Source/UBCS-WEB/src/router/avue-router.js
@@ -23,23 +23,18 @@
    return result.join('&');
  }
  let titileName;
  this.$router.$avueRouter = {
    //全局配置
    $website: this.$store.getters.website,
    group: '',
    meta: {},
    safe: this,
    tianyuan:'',
    // 设置标题
    setTitle: (title) => {
      titileName=title
      const defaultTitle = this.$vue.$t('title');
      this.$router.$avueRouter.tianyuan=title
      title = title ? `${title}-${defaultTitle}` : defaultTitle;
      document.title = title;
    },
    closeTag: (value) => {
      let tag = value || this.$store.getters.tag;
      if (typeof value === 'string') {
@@ -95,6 +90,8 @@
     * first: 为了区分外界 调用formatRoutes 和 当前文件调用 formatRoutes
     */
    formatRoutes: function (aMenu = [], first) {
      // window.console.log('aMenu')
      // window.console.log(aMenu)
      const aRouter = []
      // 获取到全局配置中的 props
      const propsConfig = this.$website.menu.props;
@@ -187,7 +184,6 @@
          })()
        }
        aRouter.push(oRouter)
        // console.log(aRouter)
      }
      // for循环结束
      // 这个first 卡的其实就是首路由