多体系建设信息化条统-前端
祖安之光
4 days ago 83d251608828d17dbb9a8d480c13a1a7c0a20eb5
修改主页跳转
1 files deleted
3 files modified
540 ■■■■ changed files
src/permission.js 35 ●●●●● patch | view | raw | blame | history
src/views/menuPage.vue 17 ●●●●● patch | view | raw | blame | history
src/views/menuPage2.vue 436 ●●●●● patch | view | raw | blame | history
src/views/work/menuIndex/index.vue 52 ●●●●● patch | view | raw | blame | history
src/permission.js
@@ -1,5 +1,5 @@
import router from './router'
import { ElMessage } from 'element-plus'
import { ElMessage, ElLoading } from 'element-plus'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import { getToken } from '@/utils/auth'
@@ -13,6 +13,27 @@
const whiteList = ['/homePage'];
// 全局 Loading 实例
let loadingInstance = null
// 显示 Loading
const showLoading = () => {
  loadingInstance = ElLoading.service({
    fullscreen: false,
    text: '正在加载系统菜单...',
    customClass: 'route-loading'
  })
}
// 隐藏 Loading
const hideLoading = () => {
  if (loadingInstance) {
    loadingInstance.close()
    loadingInstance = null
  }
}
router.beforeEach((to, from, next) => {
  NProgress.start()
  if (getToken()) {
@@ -22,9 +43,18 @@
      next({ path: '/' })
      NProgress.done()
    } else if (whiteList.indexOf(to.path) !== -1) {
      next()
    } else {
      if(to.path ==='/menuPage'){
          next()
          return
        }
      if (useUserStore().roles.length === 0) {
        if(to.path ==='/menuIndex'){
          showLoading()
        }
        isRelogin.show = true
        // 判断当前用户是否已拉取完user_info信息
        useUserStore().getInfo().then(() => {
@@ -36,6 +66,8 @@
                router.addRoute(route) // 动态添加可访问路由表
              }
            })
            hideLoading()
            if (to.fullPath == '/index') {
@@ -77,5 +109,6 @@
})
router.afterEach(() => {
  hideLoading()
  NProgress.done()
})
src/views/menuPage.vue
@@ -197,8 +197,17 @@
  }
}
const debounce = (func, wait) => {
  let timeout
  return (...args) => {
    clearTimeout(timeout)
    timeout = setTimeout(() => {
      func(...args)
    }, wait)
  }
}
const handleSystemLinkClick = (systemId) => {
  console.log('点击了'+ systemId)
  if(systemId == 1){
    router.push({ path: "/menuIndex"});
  }else{
@@ -206,6 +215,12 @@
  }
}
// const debouncedSubmit = ref(debounce(submitHandle, 500))
// const handleSystemLinkClick = (id) => {
//   debouncedSubmit.value(id)
// }
function getInfo() {
  reviewRef.value.openDialog('view',userInfo.value)
}
src/views/menuPage2.vue
File was deleted
src/views/work/menuIndex/index.vue
@@ -11,10 +11,20 @@
              <span class="more-link" @click="toNoticeMng">更多 ></span>
            </div>
            <div class="notice-list">
              <div class="notice-item" v-for="item in noticeList" :key="item">
                <span class="notice-title" @click="openNoticeFile(item.filePath)">{{item.content}}</span>
                <span class="notice-date">{{item.publishDate}}</span>
              </div>
              <template v-if="noticeLoading">
                <div v-for="i in 6" :key="i" class="notice-item skeleton">
                  <div class="skeleton-title"></div>
                  <div class="skeleton-date"></div>
                </div>
              </template>
              <template v-else>
                <div class="notice-item" v-for="item in noticeList" :key="item.id">
                  <span class="notice-title" @click="openNoticeFile(item.filePath)">{{item.content}}</span>
                  <span class="notice-date">{{item.publishDate}}</span>
                </div>
              </template>
            </div>
          </div>
@@ -179,12 +189,6 @@
import userDialog from '@/views/build/conpanyFunctionConsult/staffManage/staffRegister/components/staffDialog.vue'
import editDialog from '@/views/build/conpanyFunctionConsult/infoPlatform/components/editDialog.vue'
import sealDialog from "@/views/work/sealManagement/apply/components/editDialog"
import menu1 from '@/assets/icons/menu1.png'
import menu2 from '@/assets/icons/menu2.png'
import menu3 from '@/assets/icons/menu3.png'
import menu4 from '@/assets/icons/menu4.png'
import menu5 from '@/assets/icons/menu5.png'
import menu6 from '@/assets/icons/menu6.png'
// 引入农历库
import * as lunarCalendar from 'lunar-calendar'
@@ -206,6 +210,8 @@
const calendarRef = ref()
const dialogRef = ref()
const noticeRef = ref();
const noticeLoading = ref(true)
const userStore = useUserStore()
const state = reactive({
  noticeParams: {
@@ -243,10 +249,13 @@
    state.platformParams.companyId = userStore.companyId
    state.isAdmin = false
  }
  await getNoticeList()
  await getPlatformList()
  await getFlowList()
  await getMemo()
  // 并行加载所有数据
  await Promise.allSettled([
    getNoticeList(),
    getPlatformList(),
    getFlowList(),
    getMemo()
  ])
  state.platformList.forEach(system => {
    cardStates.value[system.id] = {
      mouseX: 0,
@@ -292,10 +301,17 @@
    noticeRef.value.openDialog('review', data,state.companyList)
  }
}
function getNoticeList() {
  listNotice(state.noticeParams).then(res => {
    state.noticeList = res.data.list
  })
async function getNoticeList() {
  try {
    noticeLoading.value = true
    const res = await listNotice(state.noticeParams)
    state.noticeList = res.data.list || []
  } catch (error) {
    console.error('获取通知公告失败:', error)
    state.noticeList = []
  } finally {
    noticeLoading.value = false
  }
}
const getCompanyList = async ()=>{
  const queryParams = {