From 9e85eb7205f96bad7206a1b4e03ad18c95de25b6 Mon Sep 17 00:00:00 2001 From: ping <1017253325@qq.com> Date: Tue, 14 Jul 2026 15:22:23 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E6=96=B0=E9=97=BB=E5=8A=A8=E6=80=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- b/news/enterprise_news_article.sql | 16 ++++++++ b/news/front_news_detail.dspy | 37 ++++++++++++++++++ b/news/front_news_search.dspy | 52 +++++++++++++++++++++++++ b/news/news_article_add.dspy | 62 ++++++++++++++++++++++++++++++ b/news/news_article_delete.dspy | 28 ++++++++++++++ b/news/news_article_detail.dspy | 31 +++++++++++++++ b/news/news_article_offline.dspy | 28 ++++++++++++++ b/news/news_article_publish.dspy | 29 ++++++++++++++ b/news/news_article_search.dspy | 58 ++++++++++++++++++++++++++++ b/news/news_article_update.dspy | 55 ++++++++++++++++++++++++++ 10 files changed, 396 insertions(+) create mode 100644 b/news/enterprise_news_article.sql create mode 100644 b/news/front_news_detail.dspy create mode 100644 b/news/front_news_search.dspy create mode 100644 b/news/news_article_add.dspy create mode 100644 b/news/news_article_delete.dspy create mode 100644 b/news/news_article_detail.dspy create mode 100644 b/news/news_article_offline.dspy create mode 100644 b/news/news_article_publish.dspy create mode 100644 b/news/news_article_search.dspy create mode 100644 b/news/news_article_update.dspy diff --git a/b/news/enterprise_news_article.sql b/b/news/enterprise_news_article.sql new file mode 100644 index 0000000..04c9193 --- /dev/null +++ b/b/news/enterprise_news_article.sql @@ -0,0 +1,16 @@ +CREATE TABLE `enterprise_news_article` ( + `id` varchar(32) NOT NULL COMMENT '唯一标识符', + `domain_name` varchar(64) NOT NULL COMMENT '所属域名', + `title` varchar(100) NOT NULL COMMENT '文章标题', + `article_type` varchar(20) NOT NULL COMMENT '文章类型(企业动态/产品动态/行业洞察/活动资讯)', + `summary` varchar(255) DEFAULT NULL COMMENT '文章摘要', + `cover_img` varchar(255) DEFAULT NULL COMMENT '封面图片', + `content` text COMMENT '文章正文', + `status` varchar(1) DEFAULT '0' COMMENT '状态(0-草稿/1-已发布)', + `publish_time` date DEFAULT NULL COMMENT '发布时间', + `read_count` int(11) DEFAULT 0 COMMENT '阅读数据', + `del_flg` varchar(1) DEFAULT '0' COMMENT '删除标志(0-正常/1-已删除)', + `update_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT '更新时间', + `create_at` timestamp NULL DEFAULT current_timestamp() COMMENT '创建时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='企业文章表'; diff --git a/b/news/front_news_detail.dspy b/b/news/front_news_detail.dspy new file mode 100644 index 0000000..e87c781 --- /dev/null +++ b/b/news/front_news_detail.dspy @@ -0,0 +1,37 @@ +async def front_news_detail(ns={}): + if not ns.get('id'): + return { + 'status': False, + 'msg': '请传递id' + } + + db = DBPools() + async with db.sqlorContext('kboss') as sor: + try: + update_sql = """update enterprise_news_article set read_count = ifnull(read_count, 0) + 1 where id = '%s' and status = '1' and del_flg = '0';""" % ns.get('id') + await sor.sqlExe(update_sql, {}) + search_sql = """ + select id, title, article_type, summary, cover_img, content, publish_time, read_count + from enterprise_news_article + where id = '%s' and status = '1' and del_flg = '0'; + """ % ns.get('id') + result = await sor.sqlExe(search_sql, {}) + if not result: + return { + 'status': False, + 'msg': '文章不存在或未发布' + } + return { + 'status': True, + 'msg': 'search front news detail success', + 'data': result[0] + } + except Exception as e: + await sor.rollback() + return { + 'status': False, + 'msg': 'search front news detail failed, %s' % str(e) + } + +ret = await front_news_detail(params_kw) +return ret diff --git a/b/news/front_news_search.dspy b/b/news/front_news_search.dspy new file mode 100644 index 0000000..09544aa --- /dev/null +++ b/b/news/front_news_search.dspy @@ -0,0 +1,52 @@ +async def front_news_search(ns={}): + if not ns.get('url_link'): + return { + 'status': False, + 'msg': '请传递url_link' + } + domain_name = ns.get('url_link').split("//")[1].split("/")[0] + if 'localhost' in domain_name: + domain_name = 'dev.opencomputing.cn' + + current_page = int(ns.get('current_page', 1)) + page_size = int(ns.get('page_size', 10)) + offset = (current_page - 1) * page_size + + conditions = ["domain_name = '%s'" % domain_name, "status = '1'", "del_flg = '0'"] + if ns.get('article_type'): + conditions.append("article_type = '%s'" % ns.get('article_type')) + if ns.get('title'): + conditions.append("title like '%%%s%%'" % ns.get('title')) + where_clause = " and ".join(conditions) + + db = DBPools() + async with db.sqlorContext('kboss') as sor: + try: + count_sql = """select count(*) as total_count from enterprise_news_article where %s;""" % where_clause + total_count = (await sor.sqlExe(count_sql, {}))[0]['total_count'] + search_sql = """ + select id, title, article_type, summary, cover_img, publish_time, read_count + from enterprise_news_article + where %s + order by publish_time desc, update_time desc + limit %s offset %s; + """ % (where_clause, page_size, offset) + result = await sor.sqlExe(search_sql, {}) + return { + 'status': True, + 'msg': 'search front news success', + 'data': result, + 'pagination': { + 'total': total_count, + 'page_size': page_size, + 'current_page': current_page + } + } + except Exception as e: + return { + 'status': False, + 'msg': 'search front news failed, %s' % str(e) + } + +ret = await front_news_search(params_kw) +return ret diff --git a/b/news/news_article_add.dspy b/b/news/news_article_add.dspy new file mode 100644 index 0000000..cd6a313 --- /dev/null +++ b/b/news/news_article_add.dspy @@ -0,0 +1,62 @@ +async def news_article_add(ns={}): + if not ns.get('url_link'): + return { + 'status': False, + 'msg': '请传递url_link' + } + if not ns.get('title'): + return { + 'status': False, + 'msg': '请传递标题' + } + # if ns.get('article_type') not in ['企业动态', '产品动态', '行业洞察', '活动资讯']: + # return { + # 'status': False, + # 'msg': '文章类型错误' + # } + + domain_name = ns.get('url_link').split("//")[1].split("/")[0] + if 'localhost' in domain_name: + domain_name = 'dev.opencomputing.cn' + + status = ns.get('status', '0') + if status not in ['0', '1']: + status = '0' + + ns_dic = { + 'id': uuid(), + 'domain_name': domain_name, + 'title': ns.get('title'), + 'article_type': ns.get('article_type'), + 'summary': ns.get('summary'), + 'cover_img': ns.get('cover_img'), + 'content': ns.get('content'), + 'status': status, + 'publish_time': ns.get('publish_time'), + 'read_count': 0, + 'del_flg': '0' + } + + db = DBPools() + async with db.sqlorContext('kboss') as sor: + try: + await sor.C('enterprise_news_article', ns_dic) + if status == '1' and not ns.get('publish_time'): + publish_sql = """update enterprise_news_article set publish_time = current_timestamp() where id = '%s';""" % ns_dic.get('id') + await sor.sqlExe(publish_sql, {}) + return { + 'status': True, + 'msg': 'create news article success', + 'data': { + 'id': ns_dic.get('id') + } + } + except Exception as e: + await sor.rollback() + return { + 'status': False, + 'msg': 'create news article failed, %s' % str(e) + } + +ret = await news_article_add(params_kw) +return ret diff --git a/b/news/news_article_delete.dspy b/b/news/news_article_delete.dspy new file mode 100644 index 0000000..37c737b --- /dev/null +++ b/b/news/news_article_delete.dspy @@ -0,0 +1,28 @@ +async def news_article_delete(ns={}): + if not ns.get('id'): + return { + 'status': False, + 'msg': '请传递id' + } + + db = DBPools() + async with db.sqlorContext('kboss') as sor: + try: + ns_dic = { + 'id': ns.get('id'), + 'del_flg': '1' + } + await sor.U('enterprise_news_article', ns_dic) + return { + 'status': True, + 'msg': 'delete news article success' + } + except Exception as e: + await sor.rollback() + return { + 'status': False, + 'msg': 'delete news article failed, %s' % str(e) + } + +ret = await news_article_delete(params_kw) +return ret diff --git a/b/news/news_article_detail.dspy b/b/news/news_article_detail.dspy new file mode 100644 index 0000000..a48ce52 --- /dev/null +++ b/b/news/news_article_detail.dspy @@ -0,0 +1,31 @@ +async def news_article_detail(ns={}): + if not ns.get('id'): + return { + 'status': False, + 'msg': '请传递id' + } + + db = DBPools() + async with db.sqlorContext('kboss') as sor: + try: + search_sql = """select * from enterprise_news_article where id = '%s' and del_flg = '0';""" % ns.get('id') + result = await sor.sqlExe(search_sql, {}) + if not result: + return { + 'status': False, + 'msg': '文章不存在' + } + result[0]['status_name'] = {'0': '草稿', '1': '已发布'}.get(str(result[0].get('status')), result[0].get('status')) + return { + 'status': True, + 'msg': 'search news article detail success', + 'data': result[0] + } + except Exception as e: + return { + 'status': False, + 'msg': 'search news article detail failed, %s' % str(e) + } + +ret = await news_article_detail(params_kw) +return ret diff --git a/b/news/news_article_offline.dspy b/b/news/news_article_offline.dspy new file mode 100644 index 0000000..0450f30 --- /dev/null +++ b/b/news/news_article_offline.dspy @@ -0,0 +1,28 @@ +async def news_article_offline(ns={}): + if not ns.get('id'): + return { + 'status': False, + 'msg': '请传递id' + } + + db = DBPools() + async with db.sqlorContext('kboss') as sor: + try: + ns_dic = { + 'id': ns.get('id'), + 'status': '0' + } + await sor.U('enterprise_news_article', ns_dic) + return { + 'status': True, + 'msg': 'offline news article success' + } + except Exception as e: + await sor.rollback() + return { + 'status': False, + 'msg': 'offline news article failed, %s' % str(e) + } + +ret = await news_article_offline(params_kw) +return ret diff --git a/b/news/news_article_publish.dspy b/b/news/news_article_publish.dspy new file mode 100644 index 0000000..219ab3a --- /dev/null +++ b/b/news/news_article_publish.dspy @@ -0,0 +1,29 @@ +async def news_article_publish(ns={}): + if not ns.get('id'): + return { + 'status': False, + 'msg': '请传递id' + } + + db = DBPools() + async with db.sqlorContext('kboss') as sor: + try: + publish_time = ns.get('publish_time') + if publish_time: + publish_sql = """update enterprise_news_article set status = '1', publish_time = '%s' where id = '%s' and del_flg = '0';""" % (publish_time, ns.get('id')) + else: + publish_sql = """update enterprise_news_article set status = '1' where id = '%s' and del_flg = '0';""" % ns.get('id') + await sor.sqlExe(publish_sql, {}) + return { + 'status': True, + 'msg': 'publish news article success' + } + except Exception as e: + await sor.rollback() + return { + 'status': False, + 'msg': 'publish news article failed, %s' % str(e) + } + +ret = await news_article_publish(params_kw) +return ret diff --git a/b/news/news_article_search.dspy b/b/news/news_article_search.dspy new file mode 100644 index 0000000..5d4d42f --- /dev/null +++ b/b/news/news_article_search.dspy @@ -0,0 +1,58 @@ +async def news_article_search(ns={}): + if not ns.get('url_link'): + return { + 'status': False, + 'msg': '请传递url_link' + } + domain_name = ns.get('url_link').split("//")[1].split("/")[0] + if 'localhost' in domain_name: + domain_name = 'dev.opencomputing.cn' + + current_page = int(ns.get('current_page', 1)) + page_size = int(ns.get('page_size', 10)) + offset = (current_page - 1) * page_size + + conditions = ["domain_name = '%s'" % domain_name, "del_flg = '0'"] + if ns.get('title'): + conditions.append("title like '%%%%%s%%%%'" % ns.get('title')) + if ns.get('article_type'): + conditions.append("article_type = '%s'" % ns.get('article_type')) + if ns.get('status'): + conditions.append("status = '%s'" % ns.get('status')) + where_clause = " and ".join(conditions) + + db = DBPools() + async with db.sqlorContext('kboss') as sor: + try: + count_sql = """select count(*) as total_count from enterprise_news_article where %s;""" % where_clause + total_count = (await sor.sqlExe(count_sql, {}))[0]['total_count'] + search_sql = """ + select id, domain_name, title, article_type, summary, cover_img, status, + publish_time, read_count, update_time, create_at + from enterprise_news_article + where %s + order by publish_time desc, update_time desc + limit %s offset %s; + """ % (where_clause, page_size, offset) + result = await sor.sqlExe(search_sql, {}) + for data_dic in result: + data_dic['status_name'] = {'0': '草稿', '1': '已发布'}.get(str(data_dic.get('status')), data_dic.get('status')) + data_dic['operation_list'] = ['发布', '删除'] if str(data_dic.get('status')) == '0' else ['下架', '删除'] + return { + 'status': True, + 'msg': 'search news article success', + 'data': result, + 'pagination': { + 'total': total_count, + 'page_size': page_size, + 'current_page': current_page + } + } + except Exception as e: + return { + 'status': False, + 'msg': 'search news article failed, %s' % str(e) + } + +ret = await news_article_search(params_kw) +return ret diff --git a/b/news/news_article_update.dspy b/b/news/news_article_update.dspy new file mode 100644 index 0000000..1977efc --- /dev/null +++ b/b/news/news_article_update.dspy @@ -0,0 +1,55 @@ +async def news_article_update(ns={}): + if not ns.get('id'): + return { + 'status': False, + 'msg': '请传递id' + } + + ns_dic = { + 'id': ns.get('id') + } + if 'title' in ns: + ns_dic['title'] = ns.get('title') + if 'article_type' in ns: + # if ns.get('article_type') not in ['企业动态', '产品动态', '行业洞察', '活动资讯']: + # return { + # 'status': False, + # 'msg': '文章类型错误' + # } + ns_dic['article_type'] = ns.get('article_type') + if 'summary' in ns: + ns_dic['summary'] = ns.get('summary') + if 'cover_img' in ns: + ns_dic['cover_img'] = ns.get('cover_img') + if 'content' in ns: + ns_dic['content'] = ns.get('content') + if 'status' in ns: + if ns.get('status') not in ['0', '1']: + return { + 'status': False, + 'msg': '状态错误' + } + ns_dic['status'] = ns.get('status') + if 'publish_time' in ns: + ns_dic['publish_time'] = ns.get('publish_time') + + db = DBPools() + async with db.sqlorContext('kboss') as sor: + try: + await sor.U('enterprise_news_article', ns_dic) + if ns.get('status') == '1' and not ns.get('publish_time'): + publish_sql = """update enterprise_news_article set publish_time = ifnull(publish_time, current_timestamp()) where id = '%s';""" % ns.get('id') + await sor.sqlExe(publish_sql, {}) + return { + 'status': True, + 'msg': 'update news article success' + } + except Exception as e: + await sor.rollback() + return { + 'status': False, + 'msg': 'update news article failed, %s' % str(e) + } + +ret = await news_article_update(params_kw) +return ret -- 2.34.1 From 5bc32fdb24aad7e1bd031b16fcb4a3e62ec26d44 Mon Sep 17 00:00:00 2001 From: ping <1017253325@qq.com> Date: Tue, 14 Jul 2026 17:16:36 +0800 Subject: [PATCH 2/5] updaste --- b/news/front_news_search.dspy | 2 +- b/news/news_article_search.dspy | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/b/news/front_news_search.dspy b/b/news/front_news_search.dspy index 09544aa..67d05f4 100644 --- a/b/news/front_news_search.dspy +++ b/b/news/front_news_search.dspy @@ -16,7 +16,7 @@ async def front_news_search(ns={}): if ns.get('article_type'): conditions.append("article_type = '%s'" % ns.get('article_type')) if ns.get('title'): - conditions.append("title like '%%%s%%'" % ns.get('title')) + conditions.append("title like '%%%%%s%%%%'" % ns.get('title')) where_clause = " and ".join(conditions) db = DBPools() diff --git a/b/news/news_article_search.dspy b/b/news/news_article_search.dspy index 5d4d42f..7ae054e 100644 --- a/b/news/news_article_search.dspy +++ b/b/news/news_article_search.dspy @@ -13,6 +13,7 @@ async def news_article_search(ns={}): offset = (current_page - 1) * page_size conditions = ["domain_name = '%s'" % domain_name, "del_flg = '0'"] + summary_conditions = ["domain_name = '%s'" % domain_name, "del_flg = '0'"] if ns.get('title'): conditions.append("title like '%%%%%s%%%%'" % ns.get('title')) if ns.get('article_type'): @@ -26,6 +27,24 @@ async def news_article_search(ns={}): try: count_sql = """select count(*) as total_count from enterprise_news_article where %s;""" % where_clause total_count = (await sor.sqlExe(count_sql, {}))[0]['total_count'] + summary_sql = """ + select article_type, count(*) as article_count, ifnull(sum(read_count), 0) as read_count + from enterprise_news_article + where %s + group by article_type; + """ % " and ".join(summary_conditions) + summary_result = await sor.sqlExe(summary_sql, {}) + summary_mapping = {} + for summary_dic in summary_result: + summary_mapping[summary_dic.get('article_type')] = summary_dic + article_type_summary = [] + for article_type in ['企业动态', '产品动态', '行业洞察', '活动资讯']: + summary_dic = summary_mapping.get(article_type, {}) + article_type_summary.append({ + 'article_type': article_type, + 'article_count': summary_dic.get('article_count', 0), + 'read_count': summary_dic.get('read_count', 0) + }) search_sql = """ select id, domain_name, title, article_type, summary, cover_img, status, publish_time, read_count, update_time, create_at @@ -42,6 +61,7 @@ async def news_article_search(ns={}): 'status': True, 'msg': 'search news article success', 'data': result, + 'article_type_summary': article_type_summary, 'pagination': { 'total': total_count, 'page_size': page_size, -- 2.34.1 From cf80d6390093125b6221b0fe3a2d397e21d04a91 Mon Sep 17 00:00:00 2001 From: ping <1017253325@qq.com> Date: Wed, 15 Jul 2026 15:30:29 +0800 Subject: [PATCH 3/5] update --- b/news/news_article_search.dspy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b/news/news_article_search.dspy b/b/news/news_article_search.dspy index 7ae054e..de14ded 100644 --- a/b/news/news_article_search.dspy +++ b/b/news/news_article_search.dspy @@ -46,7 +46,7 @@ async def news_article_search(ns={}): 'read_count': summary_dic.get('read_count', 0) }) search_sql = """ - select id, domain_name, title, article_type, summary, cover_img, status, + select id, domain_name, title, article_type, summary, cover_img, status, content, publish_time, read_count, update_time, create_at from enterprise_news_article where %s -- 2.34.1 From d97802f9289e64bdf9ac4270a74f00b37031639d Mon Sep 17 00:00:00 2001 From: hrx <18603305412@163.com> Date: Wed, 15 Jul 2026 16:37:57 +0800 Subject: [PATCH 4/5] =?UTF-8?q?ncmatch=E5=A4=B4=E9=83=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- f/web-kboss/package.json | 2 + f/web-kboss/src/api/newsapi/newsapi.js | 74 ++ .../src/layout/components/Sidebar/index.vue | 2 + f/web-kboss/src/router/index.js | 26 + f/web-kboss/src/store/modules/permission.js | 2 +- .../src/views/LoginDialog/LoginDialog.vue | 810 ++++++++++++++++++ .../homePage/components/topBox/index.vue | 45 +- .../src/views/homePage/mainPage/index.vue | 217 ++--- .../homePage/news/ArticleEditorDialog.vue | 592 +++++++++++++ .../src/views/homePage/news/newsLog.vue | 719 ++++++++++++++++ .../src/views/homePage/news/newsView.vue | 220 +++-- 11 files changed, 2477 insertions(+), 232 deletions(-) create mode 100644 f/web-kboss/src/api/newsapi/newsapi.js create mode 100644 f/web-kboss/src/views/LoginDialog/LoginDialog.vue create mode 100644 f/web-kboss/src/views/homePage/news/ArticleEditorDialog.vue create mode 100644 f/web-kboss/src/views/homePage/news/newsLog.vue 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 @@