diff --git a/f/web-kboss/package.json b/f/web-kboss/package.json index 8aa16f7..5081730 100644 --- a/f/web-kboss/package.json +++ b/f/web-kboss/package.json @@ -22,6 +22,8 @@ "dependencies": { "@form-create/element-ui": "^2.5.30", "@jiaminghi/data-view": "^2.10.0", + "@wangeditor/editor": "^5.1.23", + "@wangeditor/editor-for-vue": "^1.0.2", "@xterm/xterm": "^5.5.0", "amfe-flexible": "^2.2.1", "axios": "0.18.1", diff --git a/f/web-kboss/src/api/newsapi/newsapi.js b/f/web-kboss/src/api/newsapi/newsapi.js new file mode 100644 index 0000000..05e1fe5 --- /dev/null +++ b/f/web-kboss/src/api/newsapi/newsapi.js @@ -0,0 +1,74 @@ +import request from "@/utils/request"; +// 前台新闻列表 +export const reqNewsList = (data) => { + return request({ + url: '/news/front_news_search.dspy', + method: 'post', + data + }) +} +// 后台新闻列表 +export const reqNewsListAdmin = (data) => { + return request({ + url: '/news/news_article_search.dspy', + method: 'get', + params: data + }) +} +// 新闻详情 +export const reqNewsDetail = (data) => { + // 调用文章详情接口,用于编辑时获取完整回显数据。 + return request({ + // 详情接口地址。 + url: '/news/front_news_detail.dspy', + // 详情接口使用 GET 查询。 + method: 'get', + // 传入文章 id 和当前页面 url_link 等查询参数。 + params: data + }) +} +// 添加新闻 +export const reqAddNews = (data) => { + const isFormData = data instanceof FormData + return request({ + url: '/news/news_article_add.dspy', + method: isFormData ? 'post' : 'get', + params: isFormData ? undefined : data, + data: isFormData ? data : undefined, + headers: isFormData ? { 'Content-Type': 'multipart/form-data' } : undefined + }) +} +// 编辑新闻 +export const reqEditNews = (data) => { + const isFormData = data instanceof FormData + return request({ + url: '/news/news_article_update.dspy', + method: 'post', + data, + headers: isFormData ? { 'Content-Type': 'multipart/form-data' } : undefined + }) +} +// 删除新闻 +export const reqDeleteNews = (data) => { + return request({ + url: '/news/news_article_delete.dspy', + method: 'get', + params: data + }) +} +// 上架新闻 +export const reqPublishNews = (data) => { + return request({ + url: '/news/news_article_publish.dspy', + method: 'get', + params: data + }) +} +// 下架新闻 +export const reqUnpublishNews = (data) => { + return request({ + url: '/news/news_article_offline.dspy', + method: 'get', + params: data + }) +} \ No newline at end of file diff --git a/f/web-kboss/src/layout/components/Sidebar/index.vue b/f/web-kboss/src/layout/components/Sidebar/index.vue index a977547..f4a5c7f 100644 --- a/f/web-kboss/src/layout/components/Sidebar/index.vue +++ b/f/web-kboss/src/layout/components/Sidebar/index.vue @@ -118,6 +118,7 @@ export default { .happy-scroll-content { width: 100%; min-width: unset !important; + padding-bottom: 78px; box-sizing: border-box; } } @@ -159,6 +160,7 @@ export default { height: 100%; width: 100% !important; min-width: 100% !important; + padding-bottom: 78px; box-sizing: border-box; .el-submenu__title, diff --git a/f/web-kboss/src/router/index.js b/f/web-kboss/src/router/index.js index aa8fe77..d455f19 100644 --- a/f/web-kboss/src/router/index.js +++ b/f/web-kboss/src/router/index.js @@ -598,6 +598,32 @@ export const asyncRoutes = [ ] }, + // 运营——新闻动态 + { + path: "/newsLog", + component: Layout, + meta: { + title: "新闻动态", + fullPath: "/newsLog", + noCache: true, + icon: "el-icon-document", + roles: ["运营"] + }, + children: [ + { + path: "", + component: () => import('@/views/homePage/news/newsLog.vue'), + name: 'NewsLog', + meta: { + title: "新闻动态", + fullPath: "/newsLog", + noCache: true, + roles: ["运营"] + } + }, + ] + }, + // token市集 - 一级菜单(所有登录用户都能看到) { diff --git a/f/web-kboss/src/store/modules/permission.js b/f/web-kboss/src/store/modules/permission.js index 5431965..d773d45 100644 --- a/f/web-kboss/src/store/modules/permission.js +++ b/f/web-kboss/src/store/modules/permission.js @@ -18,7 +18,7 @@ const SUPER_ADMIN_ROUTE_PATH = '/superAdministrator'; const COMMON_ROUTE_PATHS = ['/product', '/tokenManagement', '/tokenUsage', '/modelExperience', '/modelDetail', '/modelApiDocument']; // 运营角色需要额外补出来的菜单。 -const OPERATION_EXTRA_ROUTE_PATHS = ['/modelManagement', '/modelInfoConfig', '/operationReport']; +const OPERATION_EXTRA_ROUTE_PATHS = ['/modelManagement', '/modelInfoConfig', '/operationReport', '/newsLog']; // 财务角色需要额外补出来的菜单。 const FINANCE_EXTRA_ROUTE_PATHS = ['/financialOverview']; diff --git a/f/web-kboss/src/views/LoginDialog/LoginDialog.vue b/f/web-kboss/src/views/LoginDialog/LoginDialog.vue new file mode 100644 index 0000000..fca96fc --- /dev/null +++ b/f/web-kboss/src/views/LoginDialog/LoginDialog.vue @@ -0,0 +1,810 @@ + + + + + + \ No newline at end of file diff --git a/f/web-kboss/src/views/homePage/components/topBox/index.vue b/f/web-kboss/src/views/homePage/components/topBox/index.vue index 11d9cbf..535f2fe 100644 --- a/f/web-kboss/src/views/homePage/components/topBox/index.vue +++ b/f/web-kboss/src/views/homePage/components/topBox/index.vue @@ -51,16 +51,17 @@ - -
@@ -224,6 +225,12 @@ :user-id="userId" @unread-count-update="handleUnreadCountUpdate" /> + +
@@ -237,13 +244,14 @@ import { reqAIChat } from '@/api/AI/ai' import { gotoYuanJingAPI } from '@/api/gotoYuanJing' import { setLocale } from '@/i18n' import MessageCenter from '@/components/MessageCenter/MessageCenter.vue' +import LoginDialog from '@/views/LoginDialog/LoginDialog.vue' const LOCALE_KEY = 'kboss-locale' const SUPPORTED_LOCALES = ['zh-CN', 'en-US'] export default Vue.extend({ name: 'TopBox', - components: { MessageCenter }, + components: { MessageCenter, LoginDialog }, data() { return { // AI 聊天面板状态 @@ -266,6 +274,7 @@ export default Vue.extend({ messageCount: 0, activeLocale: 'zh-CN', isProductPanelVisible: false, + loginDialogVisible: false, // 登录信息 isShowKbossCharge: false, @@ -494,6 +503,18 @@ export default Vue.extend({ // ========================= // 登录、用户与消息 // ========================= + openLoginDialog() { + this.closeProductPanelImmediate() + if (this.$route && this.$route.fullPath && !this.$route.fullPath.includes('/login')) { + sessionStorage.setItem('loginRedirectPath', this.$route.fullPath) + } + this.loginDialogVisible = true + }, + handleLoginDialogSuccess() { + this.loginDialogVisible = false + this.nick_name = sessionStorage.getItem('username') || '' + this.userId = sessionStorage.getItem('userId') + }, goLogin() { this.closeProductPanelImmediate() if (this.$route && this.$route.fullPath && !this.$route.fullPath.includes('/login')) { @@ -528,12 +549,6 @@ export default Vue.extend({ else if (role.includes('admin')) this.$router.push('/superAdministrator/addAdmin') }, async logout() { - let redirectPath = '' - if (this.$route && this.$route.fullPath && !this.$route.fullPath.includes('/login')) { - redirectPath = this.$route.fullPath - sessionStorage.setItem('loginRedirectPath', redirectPath) - } - this.$store.commit('setLoginState', false) store.commit('tagsView/resetBreadcrumbState') store.commit('permission/RESET_ROUTES') @@ -548,17 +563,17 @@ export default Vue.extend({ sessionStorage.removeItem('roles') sessionStorage.removeItem('juese') sessionStorage.removeItem('jueseNew') + sessionStorage.removeItem('loginRedirectPath') localStorage.removeItem('auths') localStorage.removeItem('routes') localStorage.removeItem('user') localStorage.removeItem('userId') localStorage.removeItem('org_type') + this.userId = '' + this.nick_name = '' - await this.$router.push({ - path: '/login', - query: redirectPath ? { redirect: redirectPath } : {} - }) + await this.$router.replace(getHomePath()).catch(() => {}) }, initMybalance() { return sessionStorage.getItem('mybalance') @@ -928,7 +943,7 @@ export default Vue.extend({ .login-btn { height: 48px; - width: 100px; + width: 86px; padding: 0; border: 0; border-radius: 99px; diff --git a/f/web-kboss/src/views/homePage/mainPage/index.vue b/f/web-kboss/src/views/homePage/mainPage/index.vue index 085dec0..48f745c 100644 --- a/f/web-kboss/src/views/homePage/mainPage/index.vue +++ b/f/web-kboss/src/views/homePage/mainPage/index.vue @@ -155,6 +155,7 @@ + + diff --git a/f/web-kboss/src/views/homePage/news/newsLog.vue b/f/web-kboss/src/views/homePage/news/newsLog.vue new file mode 100644 index 0000000..8f35ccf --- /dev/null +++ b/f/web-kboss/src/views/homePage/news/newsLog.vue @@ -0,0 +1,719 @@ + + + + + \ No newline at end of file diff --git a/f/web-kboss/src/views/homePage/news/newsView.vue b/f/web-kboss/src/views/homePage/news/newsView.vue index 70d06da..5f7419b 100644 --- a/f/web-kboss/src/views/homePage/news/newsView.vue +++ b/f/web-kboss/src/views/homePage/news/newsView.vue @@ -28,7 +28,7 @@ type="button" class="filter-tab" :class="{ active: activeCategory === item.value }" - @click="activeCategory = item.value" + @click="handleCategoryChange(item.value)" > {{ item.label }} @@ -83,11 +83,22 @@ @@ -95,137 +106,112 @@