From 8a24ea24963c165d35a170a469ff318772389595 Mon Sep 17 00:00:00 2001 From: JayChou Date: Sat, 9 Nov 2024 16:27:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E9=A6=96=E9=A1=B5=E6=96=B0?= =?UTF-8?q?=E9=97=BB=20=E6=96=B0=E5=A2=9E=E9=80=9A=E7=9F=A5=E5=85=AC?= =?UTF-8?q?=E5=91=8A=20=E5=B7=A5=E4=BD=9C=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jeecgboot-vue3/src/api/mainHome/index.ts | 24 ++ .../src/router/guard/permissionGuard.ts | 60 +++-- jeecgboot-vue3/src/router/helper/mainOut.ts | 4 +- jeecgboot-vue3/src/store/modules/setting.ts | 12 + .../main-home/components/NewsList/index.vue | 4 + .../components/articleManagement/index.vue | 214 +++++++++++++++++- .../components/columnManagement/index.vue | 214 +++++++++++++++++- .../main-home/components/homePage/index.vue | 167 ++++++++++---- .../components/projectDeclaration/index.vue | 38 +++- .../src/views/demo/main-home/index.vue | 15 +- 10 files changed, 648 insertions(+), 104 deletions(-) create mode 100644 jeecgboot-vue3/src/store/modules/setting.ts diff --git a/jeecgboot-vue3/src/api/mainHome/index.ts b/jeecgboot-vue3/src/api/mainHome/index.ts index 369de3a..c2d93ae 100644 --- a/jeecgboot-vue3/src/api/mainHome/index.ts +++ b/jeecgboot-vue3/src/api/mainHome/index.ts @@ -99,4 +99,28 @@ export function getindexexperttype() { url: '/expert/expert/directioncalListCMS', method: 'GET', }); +} + +// 获取通知公告 +export function getindexnotice(params?: any) { + return defHttp.request({ + url: '/cms/front/getindexnewtzgg', + method: 'GET', + params + }); +} +// 获取新闻快讯 +export function getindexnewskx() { + return defHttp.request({ + url: '/cms/front/getindexnewxwlb', + method: 'GET', + }); +} +// 获取工作动态 +export function getindexgzdt(params?: any) { + return defHttp.request({ + url: '/cms/front/getindexnewgzdt', + method: 'GET', + params + }); } \ No newline at end of file diff --git a/jeecgboot-vue3/src/router/guard/permissionGuard.ts b/jeecgboot-vue3/src/router/guard/permissionGuard.ts index deb36d3..bd654f0 100644 --- a/jeecgboot-vue3/src/router/guard/permissionGuard.ts +++ b/jeecgboot-vue3/src/router/guard/permissionGuard.ts @@ -10,9 +10,10 @@ import { PAGE_NOT_FOUND_ROUTE } from '/@/router/routes/basic'; import { RootRoute } from '/@/router/routes'; import { isOAuth2AppEnv } from '/@/views/sys/login/useLogin'; -import { OAUTH2_THIRD_LOGIN_TENANT_ID } from "/@/enums/cacheEnum"; -import { setAuthCache } from "/@/utils/auth"; - +import { OAUTH2_THIRD_LOGIN_TENANT_ID } from '/@/enums/cacheEnum'; +import { setAuthCache } from '/@/utils/auth'; +import { mainOutRoutes } from '@/router/helper/mainOut'; +import { useSettingStore } from '/@/store/modules/setting'; const LOGIN_PATH = PageEnum.BASE_LOGIN; //auth2登录路由 const OAUTH2_LOGIN_PAGE_PATH = PageEnum.OAUTH2_LOGIN_PAGE_PATH; @@ -27,7 +28,7 @@ const ROOT_PATH = RootRoute.path; //update-begin---author:wangshuai ---date:20220629 for:[issues/I5BG1I]vue3不支持auth2登录------------ //update-begin---author:wangshuai ---date:20221111 for: [VUEN-2472]分享免登录------------ -const whitePathList: PageEnum[] = [LOGIN_PATH, OAUTH2_LOGIN_PAGE_PATH,SYS_FILES_PATH, TOKEN_LOGIN ]; +const whitePathList: PageEnum[] = [LOGIN_PATH, OAUTH2_LOGIN_PAGE_PATH, SYS_FILES_PATH, TOKEN_LOGIN]; //update-end---author:wangshuai ---date:20221111 for: [VUEN-2472]分享免登录------------ //update-end---author:wangshuai ---date:20220629 for:[issues/I5BG1I]vue3不支持auth2登录------------ @@ -39,6 +40,20 @@ export function createPermissionGuard(router: Router) { let homePathJumpCount = 0; router.beforeEach(async (to, from, next) => { + if (to.path.includes('main-home')) { + const settingStore = useSettingStore(); + const routerList = mainOutRoutes[1].children?.filter((item) => !item.meta?.hidden); + let index = routerList.findIndex((item) => item.path === to.path); + if(index === -1) { + index = 4 + console.log(index); + settingStore.serIndex(index); + }else{ + console.log(index); + settingStore.serIndex(index); + } + + } if ( // 【#6861】跳转到自定义首页的逻辑,只跳转一次即可 homePathJumpCount < 1 && @@ -58,12 +73,12 @@ export function createPermissionGuard(router: Router) { if (whitePathList.includes(to.path as PageEnum)) { if (to.path === LOGIN_PATH && token) { const isSessionTimeout = userStore.getSessionTimeout; - + //update-begin---author:scott ---date:2023-04-24 for:【QQYUN-4713】登录代码调整逻辑有问题,改造待观察-- //TODO vben默认写法,暂时不知目的,有问题暂时先注释掉 //await userStore.afterLoginAction(); //update-end---author:scott ---date::2023-04-24 for:【QQYUN-4713】登录代码调整逻辑有问题,改造待观察-- - + try { if (!isSessionTimeout) { next((to.query?.redirect as string) || '/'); @@ -75,8 +90,8 @@ export function createPermissionGuard(router: Router) { //退出登录进入此逻辑 //如果进入的页面是login页面并且当前是OAuth2app环境,并且token为空,就进入OAuth2登录页面 //update-begin---author:wangshuai ---date:20230224 for:[QQYUN-3440]新建企业微信和钉钉配置表,通过租户模式隔离------------ - if(to.query.tenantId){ - setAuthCache(OAUTH2_THIRD_LOGIN_TENANT_ID,to.query.tenantId) + if (to.query.tenantId) { + setAuthCache(OAUTH2_THIRD_LOGIN_TENANT_ID, to.query.tenantId); } next({ path: OAUTH2_LOGIN_PAGE_PATH }); //update-end---author:wangshuai ---date:20230224 for:[QQYUN-3440]新建企业微信和钉钉配置表,通过租户模式隔离------------ @@ -111,11 +126,11 @@ export function createPermissionGuard(router: Router) { //只有首次登陆并且是企业微信或者钉钉的情况下才会调用 let href = window.location.href; //判断当前是auth2页面,并且是钉钉/企业微信,并且包含tenantId参数 - if(isOAuth2AppEnv() && href.indexOf("/tenantId/")!= -1){ + if (isOAuth2AppEnv() && href.indexOf('/tenantId/') != -1) { let params = to.params; - if(params && params.path && params.path.length>0){ + if (params && params.path && params.path.length > 0) { //直接获取参数最后一位 - setAuthCache(OAUTH2_THIRD_LOGIN_TENANT_ID,params.path[params.path.length-1]) + setAuthCache(OAUTH2_THIRD_LOGIN_TENANT_ID, params.path[params.path.length - 1]); } } //---------【首次登陆并且是企业微信或者钉钉的情况下才会调用】------------------------------------------------ @@ -134,21 +149,26 @@ export function createPermissionGuard(router: Router) { //update-begin---author:scott ---date:2023-04-24 for:【QQYUN-4713】登录代码调整逻辑有问题,改造待观察-- if (to.fullPath) { - console.log("to.fullPath 1",to.fullPath) - console.log("to.path 2",to.path) - + console.log('to.fullPath 1', to.fullPath); + console.log('to.path 2', to.path); + let getFullPath = to.fullPath; - if(getFullPath=='/' || getFullPath=='/500' || getFullPath=='/400' || getFullPath=='/login?redirect=/' || getFullPath=='/login?redirect=/login?redirect=/'){ + if ( + getFullPath == '/' || + getFullPath == '/500' || + getFullPath == '/400' || + getFullPath == '/login?redirect=/' || + getFullPath == '/login?redirect=/login?redirect=/' + ) { return; } - //update-end---author:scott ---date:2023-04-24 for:【QQYUN-4713】登录代码调整逻辑有问题,改造待观察-- - + //update-end---author:scott ---date:2023-04-24 for:【QQYUN-4713】登录代码调整逻辑有问题,改造待观察-- + redirectData.query = { ...redirectData.query, // update-begin-author:sunjianlei date:20230306 for: 修复登录成功后,没有正确重定向的问题 redirect: to.fullPath, // update-end-author:sunjianlei date:20230306 for: 修复登录成功后,没有正确重定向的问题 - }; } next(redirectData); @@ -157,12 +177,12 @@ export function createPermissionGuard(router: Router) { //==============================【首次登录并且是企业微信或者钉钉的情况下才会调用】================== //判断是免登录页面,如果页面包含/tenantId/,那么就直接前往主页 - if(isOAuth2AppEnv() && to.path.indexOf("/tenantId/") != -1){ + if (isOAuth2AppEnv() && to.path.indexOf('/tenantId/') != -1) { next(userStore.getUserInfo.homePath || PageEnum.BASE_HOME); return; } //==============================【首次登录并且是企业微信或者钉钉的情况下才会调用】================== - + // Jump to the 404 page after processing the login if (from.path === LOGIN_PATH && to.name === PAGE_NOT_FOUND_ROUTE.name && to.fullPath !== (userStore.getUserInfo.homePath || PageEnum.BASE_HOME)) { next(userStore.getUserInfo.homePath || PageEnum.BASE_HOME); diff --git a/jeecgboot-vue3/src/router/helper/mainOut.ts b/jeecgboot-vue3/src/router/helper/mainOut.ts index f2a435e..011cf35 100644 --- a/jeecgboot-vue3/src/router/helper/mainOut.ts +++ b/jeecgboot-vue3/src/router/helper/mainOut.ts @@ -99,7 +99,7 @@ export const mainOutRoutes: AppRouteModule[] = [ name: 'ColumnManagement', component: () => import('/@/views/demo/main-home/components/columnManagement/index.vue'), meta: { - title: '栏目管理', + title: '通知公告', ignoreAuth: true, hidden: false @@ -110,7 +110,7 @@ export const mainOutRoutes: AppRouteModule[] = [ name: 'ArticleManagement', component: () => import('/@/views/demo/main-home/components/articleManagement/index.vue'), meta: { - title: '文章管理', + title: '工作动态', ignoreAuth: true, hidden: false diff --git a/jeecgboot-vue3/src/store/modules/setting.ts b/jeecgboot-vue3/src/store/modules/setting.ts new file mode 100644 index 0000000..c100118 --- /dev/null +++ b/jeecgboot-vue3/src/store/modules/setting.ts @@ -0,0 +1,12 @@ +import { defineStore } from 'pinia'; +export const useSettingStore = defineStore({ + id: 'app-setting', + state: () => ({ + activeIndex: 0, + }), + actions: { + serIndex(index) { + this.activeIndex = index; + }, + }, +}); diff --git a/jeecgboot-vue3/src/views/demo/main-home/components/NewsList/index.vue b/jeecgboot-vue3/src/views/demo/main-home/components/NewsList/index.vue index b196bf6..335b5d4 100644 --- a/jeecgboot-vue3/src/views/demo/main-home/components/NewsList/index.vue +++ b/jeecgboot-vue3/src/views/demo/main-home/components/NewsList/index.vue @@ -166,6 +166,7 @@ line-height: 40px; margin-top: 30px; background-color: #002e97; + cursor: pointer; } } } @@ -191,6 +192,9 @@ border-bottom: 1px solid #d9d9d9; cursor: pointer; } + .item:hover { + color: #002e97; + } } } } diff --git a/jeecgboot-vue3/src/views/demo/main-home/components/articleManagement/index.vue b/jeecgboot-vue3/src/views/demo/main-home/components/articleManagement/index.vue index 1a607ba..f969e95 100644 --- a/jeecgboot-vue3/src/views/demo/main-home/components/articleManagement/index.vue +++ b/jeecgboot-vue3/src/views/demo/main-home/components/articleManagement/index.vue @@ -1,20 +1,212 @@ - \ No newline at end of file + diff --git a/jeecgboot-vue3/src/views/demo/main-home/components/columnManagement/index.vue b/jeecgboot-vue3/src/views/demo/main-home/components/columnManagement/index.vue index 90f879b..8a55f47 100644 --- a/jeecgboot-vue3/src/views/demo/main-home/components/columnManagement/index.vue +++ b/jeecgboot-vue3/src/views/demo/main-home/components/columnManagement/index.vue @@ -1,20 +1,212 @@ - \ No newline at end of file + diff --git a/jeecgboot-vue3/src/views/demo/main-home/components/homePage/index.vue b/jeecgboot-vue3/src/views/demo/main-home/components/homePage/index.vue index e9364a5..3b16840 100644 --- a/jeecgboot-vue3/src/views/demo/main-home/components/homePage/index.vue +++ b/jeecgboot-vue3/src/views/demo/main-home/components/homePage/index.vue @@ -20,7 +20,7 @@ -
@@ -38,15 +40,7 @@
@@ -57,37 +51,21 @@
-
通知通告
+
新闻快讯
    -
  • 省科技厅召开党组会传达学习省管主要领导干部学习贯彻
  • -
  • 王浩:建设高水平创新型省份 因地制宜大力发展新质生
  • -
  • 省委第四巡视组省科学技术厅工作动员会议召开
  • -
  • 省科技厅召开厅系统重点工作交流会
  • -
  • 省科技厅召开党组(扩大)会总结党纪学习教育工作
  • -
  • 省科技厅召开党组会传达学习贯彻省委十五届五次全会精
  • -
  • 建设高水平创新型省份
  • -
  • 学习贯彻省委十五届五次全会精神
  • -
  • 省科技厅召开党组会传达学习省管主要领导干部学习贯彻
  • +
  • {{ item.title }}
-
通知通告
+
工作动态
    -
  • 省科技厅召开党组会传达学习省管主要领导干部学习贯彻
  • -
  • 王浩:建设高水平创新型省份 因地制宜大力发展新质生
  • -
  • 省委第四巡视组省科学技术厅工作动员会议召开
  • -
  • 省科技厅召开厅系统重点工作交流会
  • -
  • 省科技厅召开党组(扩大)会总结党纪学习教育工作
  • -
  • 省科技厅召开党组会传达学习贯彻省委十五届五次全会精神
  • -
  • 建设高水平创新型省份
  • -
  • 学习贯彻省委十五届五次全会精神
  • -
  • 省科技厅召开党组会传达学习省管主要领导干部学习贯彻
  • +
  • {{ item.title }}
@@ -108,7 +86,6 @@
437
科研平台数量(套)
-
@@ -116,16 +93,16 @@
仪器共享
- +
    -
  • +
  • -
    数字无线电综合测试仪
    -

    分类:电子测量仪器->通讯测量...

    -

    服务次数:0

    -

    鹤壁天海电子信息系统有限公司

    +
    {{ item.name }}
    +

    分类:{{ item.category_dictText }}.

    +

    服务次数:{{ item.serviceFrequency }}

    +

    {{ item.declarationUnit_dictText }}

  • @@ -149,9 +126,10 @@ diff --git a/jeecgboot-vue3/src/views/demo/main-home/components/projectDeclaration/index.vue b/jeecgboot-vue3/src/views/demo/main-home/components/projectDeclaration/index.vue index 14e8f65..3a3fd1d 100644 --- a/jeecgboot-vue3/src/views/demo/main-home/components/projectDeclaration/index.vue +++ b/jeecgboot-vue3/src/views/demo/main-home/components/projectDeclaration/index.vue @@ -9,13 +9,7 @@
    -
  • 浙江省科学技术厅2023年度浙江省科学技术奖提名受理情况公示
  • -
  • 浙江省科学技术厅关于绍兴黄酒重大科技项目立项
  • -
  • 浙江省科学技术厅关于拟下达2024年浙江省中央引导地方科技发展资金...
  • -
  • 关于浙江省人民政府重大委托课题确定中标对象的公示
  • -
  • 省级部门2023年度预期尚未支付中小企业款项信息公开公示
  • -
  • 浙江省科学技术厅关于2023年度省级新型研发机构拟认定名单的公示
  • -
  • 浙江省科学技术厅关于2023年省级新产品试制计划(第二批)拟立项目...
  • +
  • {{ item.title }}
@@ -41,8 +35,32 @@