diff --git a/f/web-kboss/src/api/finance/customerRechargeManagement.js b/f/web-kboss/src/api/finance/customerRechargeManagement.js index a555990..11e9946 100644 --- a/f/web-kboss/src/api/finance/customerRechargeManagement.js +++ b/f/web-kboss/src/api/finance/customerRechargeManagement.js @@ -28,7 +28,7 @@ export function getReachargelogAPI(params) { //客户充值冲账 export function editReachargelogAPI(params) { return request({ - url: `examine/upledger_examine${suffix}`, + url: `customer/mybalance.dspy`, method: 'get', params: params }) diff --git a/f/web-kboss/src/assets/css/iconfont/demo.css b/f/web-kboss/src/assets/css/iconfont/demo.css new file mode 100644 index 0000000..a67054a --- /dev/null +++ b/f/web-kboss/src/assets/css/iconfont/demo.css @@ -0,0 +1,539 @@ +/* Logo 字体 */ +@font-face { + font-family: "iconfont logo"; + src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834'); + src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'), + url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'), + url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'), + url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg'); +} + +.logo { + font-family: "iconfont logo"; + font-size: 160px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +/* tabs */ +.nav-tabs { + position: relative; +} + +.nav-tabs .nav-more { + position: absolute; + right: 0; + bottom: 0; + height: 42px; + line-height: 42px; + color: #666; +} + +#tabs { + border-bottom: 1px solid #eee; +} + +#tabs li { + cursor: pointer; + width: 100px; + height: 40px; + line-height: 40px; + text-align: center; + font-size: 16px; + border-bottom: 2px solid transparent; + position: relative; + z-index: 1; + margin-bottom: -1px; + color: #666; +} + + +#tabs .active { + border-bottom-color: #f00; + color: #222; +} + +.tab-container .content { + display: none; +} + +/* 页面布局 */ +.main { + padding: 30px 100px; + width: 960px; + margin: 0 auto; +} + +.main .logo { + color: #333; + text-align: left; + margin-bottom: 30px; + line-height: 1; + height: 110px; + margin-top: -50px; + overflow: hidden; + *zoom: 1; +} + +.main .logo a { + font-size: 160px; + color: #333; +} + +.helps { + margin-top: 40px; +} + +.helps pre { + padding: 20px; + margin: 10px 0; + border: solid 1px #e7e1cd; + background-color: #fffdef; + overflow: auto; +} + +.icon_lists { + width: 100% !important; + overflow: hidden; + *zoom: 1; +} + +.icon_lists li { + width: 100px; + margin-bottom: 10px; + margin-right: 20px; + text-align: center; + list-style: none !important; + cursor: default; +} + +.icon_lists li .code-name { + line-height: 1.2; +} + +.icon_lists .icon { + display: block; + height: 100px; + line-height: 100px; + font-size: 42px; + margin: 10px auto; + color: #333; + -webkit-transition: font-size 0.25s linear, width 0.25s linear; + -moz-transition: font-size 0.25s linear, width 0.25s linear; + transition: font-size 0.25s linear, width 0.25s linear; +} + +.icon_lists .icon:hover { + font-size: 100px; +} + +.icon_lists .svg-icon { + /* 通过设置 font-size 来改变图标大小 */ + width: 1em; + /* 图标和文字相邻时,垂直对齐 */ + vertical-align: -0.15em; + /* 通过设置 color 来改变 SVG 的颜色/fill */ + fill: currentColor; + /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示 + normalize.css 中也包含这行 */ + overflow: hidden; +} + +.icon_lists li .name, +.icon_lists li .code-name { + color: #666; +} + +/* markdown 样式 */ +.markdown { + color: #666; + font-size: 14px; + line-height: 1.8; +} + +.highlight { + line-height: 1.5; +} + +.markdown img { + vertical-align: middle; + max-width: 100%; +} + +.markdown h1 { + color: #404040; + font-weight: 500; + line-height: 40px; + margin-bottom: 24px; +} + +.markdown h2, +.markdown h3, +.markdown h4, +.markdown h5, +.markdown h6 { + color: #404040; + margin: 1.6em 0 0.6em 0; + font-weight: 500; + clear: both; +} + +.markdown h1 { + font-size: 28px; +} + +.markdown h2 { + font-size: 22px; +} + +.markdown h3 { + font-size: 16px; +} + +.markdown h4 { + font-size: 14px; +} + +.markdown h5 { + font-size: 12px; +} + +.markdown h6 { + font-size: 12px; +} + +.markdown hr { + height: 1px; + border: 0; + background: #e9e9e9; + margin: 16px 0; + clear: both; +} + +.markdown p { + margin: 1em 0; +} + +.markdown>p, +.markdown>blockquote, +.markdown>.highlight, +.markdown>ol, +.markdown>ul { + width: 80%; +} + +.markdown ul>li { + list-style: circle; +} + +.markdown>ul li, +.markdown blockquote ul>li { + margin-left: 20px; + padding-left: 4px; +} + +.markdown>ul li p, +.markdown>ol li p { + margin: 0.6em 0; +} + +.markdown ol>li { + list-style: decimal; +} + +.markdown>ol li, +.markdown blockquote ol>li { + margin-left: 20px; + padding-left: 4px; +} + +.markdown code { + margin: 0 3px; + padding: 0 5px; + background: #eee; + border-radius: 3px; +} + +.markdown strong, +.markdown b { + font-weight: 600; +} + +.markdown>table { + border-collapse: collapse; + border-spacing: 0px; + empty-cells: show; + border: 1px solid #e9e9e9; + width: 95%; + margin-bottom: 24px; +} + +.markdown>table th { + white-space: nowrap; + color: #333; + font-weight: 600; +} + +.markdown>table th, +.markdown>table td { + border: 1px solid #e9e9e9; + padding: 8px 16px; + text-align: left; +} + +.markdown>table th { + background: #F7F7F7; +} + +.markdown blockquote { + font-size: 90%; + color: #999; + border-left: 4px solid #e9e9e9; + padding-left: 0.8em; + margin: 1em 0; +} + +.markdown blockquote p { + margin: 0; +} + +.markdown .anchor { + opacity: 0; + transition: opacity 0.3s ease; + margin-left: 8px; +} + +.markdown .waiting { + color: #ccc; +} + +.markdown h1:hover .anchor, +.markdown h2:hover .anchor, +.markdown h3:hover .anchor, +.markdown h4:hover .anchor, +.markdown h5:hover .anchor, +.markdown h6:hover .anchor { + opacity: 1; + display: inline-block; +} + +.markdown>br, +.markdown>p>br { + clear: both; +} + + +.hljs { + display: block; + background: white; + padding: 0.5em; + color: #333333; + overflow-x: auto; +} + +.hljs-comment, +.hljs-meta { + color: #969896; +} + +.hljs-string, +.hljs-variable, +.hljs-template-variable, +.hljs-strong, +.hljs-emphasis, +.hljs-quote { + color: #df5000; +} + +.hljs-keyword, +.hljs-selector-tag, +.hljs-type { + color: #a71d5d; +} + +.hljs-literal, +.hljs-symbol, +.hljs-bullet, +.hljs-attribute { + color: #0086b3; +} + +.hljs-section, +.hljs-name { + color: #63a35c; +} + +.hljs-tag { + color: #333333; +} + +.hljs-title, +.hljs-attr, +.hljs-selector-id, +.hljs-selector-class, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #795da3; +} + +.hljs-addition { + color: #55a532; + background-color: #eaffea; +} + +.hljs-deletion { + color: #bd2c00; + background-color: #ffecec; +} + +.hljs-link { + text-decoration: underline; +} + +/* 代码高亮 */ +/* PrismJS 1.15.0 +https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */ +/** + * prism.js default theme for JavaScript, CSS and HTML + * Based on dabblet (http://dabblet.com) + * @author Lea Verou + */ +code[class*="language-"], +pre[class*="language-"] { + color: black; + background: none; + text-shadow: 0 1px white; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +pre[class*="language-"]::-moz-selection, +pre[class*="language-"] ::-moz-selection, +code[class*="language-"]::-moz-selection, +code[class*="language-"] ::-moz-selection { + text-shadow: none; + background: #b3d4fc; +} + +pre[class*="language-"]::selection, +pre[class*="language-"] ::selection, +code[class*="language-"]::selection, +code[class*="language-"] ::selection { + text-shadow: none; + background: #b3d4fc; +} + +@media print { + + code[class*="language-"], + pre[class*="language-"] { + text-shadow: none; + } +} + +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: .5em 0; + overflow: auto; +} + +:not(pre)>code[class*="language-"], +pre[class*="language-"] { + background: #f5f2f0; +} + +/* Inline code */ +:not(pre)>code[class*="language-"] { + padding: .1em; + border-radius: .3em; + white-space: normal; +} + +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: slategray; +} + +.token.punctuation { + color: #999; +} + +.namespace { + opacity: .7; +} + +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.constant, +.token.symbol, +.token.deleted { + color: #905; +} + +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.inserted { + color: #690; +} + +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string { + color: #9a6e3a; + background: hsla(0, 0%, 100%, .5); +} + +.token.atrule, +.token.attr-value, +.token.keyword { + color: #07a; +} + +.token.function, +.token.class-name { + color: #DD4A68; +} + +.token.regex, +.token.important, +.token.variable { + color: #e90; +} + +.token.important, +.token.bold { + font-weight: bold; +} + +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} diff --git a/f/web-kboss/src/assets/css/iconfont/demo_index.html b/f/web-kboss/src/assets/css/iconfont/demo_index.html new file mode 100644 index 0000000..3c4d26b --- /dev/null +++ b/f/web-kboss/src/assets/css/iconfont/demo_index.html @@ -0,0 +1,418 @@ + + + + + iconfont Demo + + + + + + + + + + + + + +
+

+ + +

+ +
+
+
    + +
  • + +
    复制
    +
    
    +
  • + +
  • + +
    大类-全部产品
    +
    
    +
  • + +
  • + +
    资源管理器
    +
    
    +
  • + +
  • + +
    社区服务
    +
    
    +
  • + +
  • + +
    复制
    +
    
    +
  • + +
  • + +
    订单管理
    +
    
    +
  • + +
  • + +
    客服
    +
    
    +
  • + +
  • + +
    地图_地球_o
    +
    
    +
  • + +
  • + +
    消息
    +
    
    +
  • + +
  • + +
    AI助手
    +
    
    +
  • + +
+
+

Unicode 引用

+
+ +

Unicode 是字体在网页端最原始的应用方式,特点是:

+
    +
  • 支持按字体的方式去动态调整图标大小,颜色等等。
  • +
  • 默认情况下不支持多色,直接添加多色图标会自动去色。
  • +
+
+

注意:新版 iconfont 支持两种方式引用多色图标:SVG symbol 引用方式和彩色字体图标模式。(使用彩色字体图标需要在「编辑项目」中开启「彩色」选项后并重新生成。)

+
+

Unicode 使用步骤如下:

+

第一步:拷贝项目下面生成的 @font-face

+
@font-face {
+  font-family: 'iconfont';
+  src: url('iconfont.woff2?t=1760930186762') format('woff2'),
+       url('iconfont.woff?t=1760930186762') format('woff'),
+       url('iconfont.ttf?t=1760930186762') format('truetype');
+}
+
+

第二步:定义使用 iconfont 的样式

+
.iconfont {
+  font-family: "iconfont" !important;
+  font-size: 16px;
+  font-style: normal;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+
+

第三步:挑选相应图标并获取字体编码,应用于页面

+
+<span class="iconfont">&#x33;</span>
+
+
+

"iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。

+
+
+
+
+
    + +
  • + +
    + 复制 +
    +
    .icon-fuzhi +
    +
  • + +
  • + +
    + 大类-全部产品 +
    +
    .icon-dalei-quanbuchanpin +
    +
  • + +
  • + +
    + 资源管理器 +
    +
    .icon-ziyuanguanliqi +
    +
  • + +
  • + +
    + 社区服务 +
    +
    .icon-shequfuwu +
    +
  • + +
  • + +
    + 复制 +
    +
    .icon-fuzhi- +
    +
  • + +
  • + +
    + 订单管理 +
    +
    .icon-dingdanguanli +
    +
  • + +
  • + +
    + 客服 +
    +
    .icon-kefu +
    +
  • + +
  • + +
    + 地图_地球_o +
    +
    .icon-ditu_diqiu_o +
    +
  • + +
  • + +
    + 消息 +
    +
    .icon-xiaoxi +
    +
  • + +
  • + +
    + AI助手 +
    +
    .icon-AIzhushou +
    +
  • + +
+
+

font-class 引用

+
+ +

font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。

+

与 Unicode 使用方式相比,具有如下特点:

+
    +
  • 相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。
  • +
  • 因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。
  • +
+

使用步骤如下:

+

第一步:引入项目下面生成的 fontclass 代码:

+
<link rel="stylesheet" href="./iconfont.css">
+
+

第二步:挑选相应图标并获取类名,应用于页面:

+
<span class="iconfont icon-xxx"></span>
+
+
+

" + iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。

+
+
+
+
+
    + +
  • + +
    复制
    +
    #icon-fuzhi
    +
  • + +
  • + +
    大类-全部产品
    +
    #icon-dalei-quanbuchanpin
    +
  • + +
  • + +
    资源管理器
    +
    #icon-ziyuanguanliqi
    +
  • + +
  • + +
    社区服务
    +
    #icon-shequfuwu
    +
  • + +
  • + +
    复制
    +
    #icon-fuzhi-
    +
  • + +
  • + +
    订单管理
    +
    #icon-dingdanguanli
    +
  • + +
  • + +
    客服
    +
    #icon-kefu
    +
  • + +
  • + +
    地图_地球_o
    +
    #icon-ditu_diqiu_o
    +
  • + +
  • + +
    消息
    +
    #icon-xiaoxi
    +
  • + +
  • + +
    AI助手
    +
    #icon-AIzhushou
    +
  • + +
+
+

Symbol 引用

+
+ +

这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇文章 + 这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:

+
    +
  • 支持多色图标了,不再受单色限制。
  • +
  • 通过一些技巧,支持像字体那样,通过 font-size, color 来调整样式。
  • +
  • 兼容性较差,支持 IE9+,及现代浏览器。
  • +
  • 浏览器渲染 SVG 的性能一般,还不如 png。
  • +
+

使用步骤如下:

+

第一步:引入项目下面生成的 symbol 代码:

+
<script src="./iconfont.js"></script>
+
+

第二步:加入通用 CSS 代码(引入一次就行):

+
<style>
+.icon {
+  width: 1em;
+  height: 1em;
+  vertical-align: -0.15em;
+  fill: currentColor;
+  overflow: hidden;
+}
+</style>
+
+

第三步:挑选相应图标并获取类名,应用于页面:

+
<svg class="icon" aria-hidden="true">
+  <use xlink:href="#icon-xxx"></use>
+</svg>
+
+
+
+ +
+
+ + + diff --git a/f/web-kboss/src/assets/css/iconfont/iconfont.css b/f/web-kboss/src/assets/css/iconfont/iconfont.css new file mode 100644 index 0000000..ba31468 --- /dev/null +++ b/f/web-kboss/src/assets/css/iconfont/iconfont.css @@ -0,0 +1,55 @@ +@font-face { + font-family: "iconfont"; /* Project id 5043107 */ + src: url('iconfont.woff2?t=1760930186762') format('woff2'), + url('iconfont.woff?t=1760930186762') format('woff'), + url('iconfont.ttf?t=1760930186762') format('truetype'); +} + +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-fuzhi:before { + content: "\e61b"; +} + +.icon-dalei-quanbuchanpin:before { + content: "\e64c"; +} + +.icon-ziyuanguanliqi:before { + content: "\e641"; +} + +.icon-shequfuwu:before { + content: "\e616"; +} + +.icon-fuzhi-:before { + content: "\e648"; +} + +.icon-dingdanguanli:before { + content: "\e602"; +} + +.icon-kefu:before { + content: "\e625"; +} + +.icon-ditu_diqiu_o:before { + content: "\ebbb"; +} + +.icon-xiaoxi:before { + content: "\e60a"; +} + +.icon-AIzhushou:before { + content: "\e65f"; +} + diff --git a/f/web-kboss/src/assets/css/iconfont/iconfont.js b/f/web-kboss/src/assets/css/iconfont/iconfont.js new file mode 100644 index 0000000..e6f71cb --- /dev/null +++ b/f/web-kboss/src/assets/css/iconfont/iconfont.js @@ -0,0 +1 @@ +window._iconfont_svg_string_5043107='',(l=>{var c=(t=(t=document.getElementsByTagName("script"))[t.length-1]).getAttribute("data-injectcss"),t=t.getAttribute("data-disable-injectsvg");if(!t){var a,e,i,o,n,h=function(c,t){t.parentNode.insertBefore(c,t)};if(c&&!l.__iconfont__svg__cssinject__){l.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(c){console&&console.log(c)}}a=function(){var c,t=document.createElement("div");t.innerHTML=l._iconfont_svg_string_5043107,(t=t.getElementsByTagName("svg")[0])&&(t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.width=0,t.style.height=0,t.style.overflow="hidden",t=t,(c=document.body).firstChild?h(t,c.firstChild):c.appendChild(t))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(a,0):(e=function(){document.removeEventListener("DOMContentLoaded",e,!1),a()},document.addEventListener("DOMContentLoaded",e,!1)):document.attachEvent&&(i=a,o=l.document,n=!1,d(),o.onreadystatechange=function(){"complete"==o.readyState&&(o.onreadystatechange=null,s())})}function s(){n||(n=!0,i())}function d(){try{o.documentElement.doScroll("left")}catch(c){return void setTimeout(d,50)}s()}})(window); \ No newline at end of file diff --git a/f/web-kboss/src/assets/css/iconfont/iconfont.json b/f/web-kboss/src/assets/css/iconfont/iconfont.json new file mode 100644 index 0000000..7357ac2 --- /dev/null +++ b/f/web-kboss/src/assets/css/iconfont/iconfont.json @@ -0,0 +1,79 @@ +{ + "id": "5043107", + "name": "kboos", + "font_family": "iconfont", + "css_prefix_text": "icon-", + "description": "", + "glyphs": [ + { + "icon_id": "300409", + "name": "复制", + "font_class": "fuzhi", + "unicode": "e61b", + "unicode_decimal": 58907 + }, + { + "icon_id": "10621831", + "name": "大类-全部产品", + "font_class": "dalei-quanbuchanpin", + "unicode": "e64c", + "unicode_decimal": 58956 + }, + { + "icon_id": "11121510", + "name": "资源管理器", + "font_class": "ziyuanguanliqi", + "unicode": "e641", + "unicode_decimal": 58945 + }, + { + "icon_id": "12459826", + "name": "社区服务", + "font_class": "shequfuwu", + "unicode": "e616", + "unicode_decimal": 58902 + }, + { + "icon_id": "12562411", + "name": "复制", + "font_class": "fuzhi-", + "unicode": "e648", + "unicode_decimal": 58952 + }, + { + "icon_id": "19657695", + "name": "订单管理", + "font_class": "dingdanguanli", + "unicode": "e602", + "unicode_decimal": 58882 + }, + { + "icon_id": "2674476", + "name": "客服", + "font_class": "kefu", + "unicode": "e625", + "unicode_decimal": 58917 + }, + { + "icon_id": "5388029", + "name": "地图_地球_o", + "font_class": "ditu_diqiu_o", + "unicode": "ebbb", + "unicode_decimal": 60347 + }, + { + "icon_id": "31157387", + "name": "消息", + "font_class": "xiaoxi", + "unicode": "e60a", + "unicode_decimal": 58890 + }, + { + "icon_id": "44896696", + "name": "AI助手", + "font_class": "AIzhushou", + "unicode": "e65f", + "unicode_decimal": 58975 + } + ] +} diff --git a/f/web-kboss/src/assets/css/iconfont/iconfont.ttf b/f/web-kboss/src/assets/css/iconfont/iconfont.ttf new file mode 100644 index 0000000..a5632ff Binary files /dev/null and b/f/web-kboss/src/assets/css/iconfont/iconfont.ttf differ diff --git a/f/web-kboss/src/assets/css/iconfont/iconfont.woff b/f/web-kboss/src/assets/css/iconfont/iconfont.woff new file mode 100644 index 0000000..e6a7a2c Binary files /dev/null and b/f/web-kboss/src/assets/css/iconfont/iconfont.woff differ diff --git a/f/web-kboss/src/assets/css/iconfont/iconfont.woff2 b/f/web-kboss/src/assets/css/iconfont/iconfont.woff2 new file mode 100644 index 0000000..acea079 Binary files /dev/null and b/f/web-kboss/src/assets/css/iconfont/iconfont.woff2 differ diff --git a/f/web-kboss/src/assets/image/user.png b/f/web-kboss/src/assets/image/user.png new file mode 100644 index 0000000..9218676 Binary files /dev/null and b/f/web-kboss/src/assets/image/user.png differ diff --git a/f/web-kboss/src/components/MessageCenter/MessageCenter.vue b/f/web-kboss/src/components/MessageCenter/MessageCenter.vue new file mode 100644 index 0000000..939b31d --- /dev/null +++ b/f/web-kboss/src/components/MessageCenter/MessageCenter.vue @@ -0,0 +1,793 @@ + + + + + diff --git a/f/web-kboss/src/layout/components/Navbar.vue b/f/web-kboss/src/layout/components/Navbar.vue index 3b5681a..1f27cb9 100644 --- a/f/web-kboss/src/layout/components/Navbar.vue +++ b/f/web-kboss/src/layout/components/Navbar.vue @@ -4,14 +4,14 @@ 平台充值中心 - - + +
+ style="display:flex;justify-content: flex-end!important;align-items: center!important;margin-right: 10px;"> - +
-
{{ nick_name.charAt(0) }}
{{ nick_name }} - -
-
{{ nick_name }} ID: - {{ - userId - }} - + {{ userId }} @@ -93,11 +75,10 @@
- - 余额{{ - mybalance ? mybalance : initMybalance() - }} ¥ + + 余额 + {{ mybalance ? mybalance : initMybalance() }} ¥ + 充值 @@ -106,210 +87,23 @@ 个人中心 - - - - - - - - - 修改密码 - - 退出登录 - - - - -
- - - - -
消息中心
-
-
全部消息
-
未读消息
-
已读消息
-
-
- - | {{ this.tabTitle }} - - -
-
- 已读 - 删除 -
- - - - - - - - - - - -
- - -
-
- 已读 - 删除 -
- - - - - - - - - - - -
- - -
-
- 删除 -
- - - - - - - - - -
-
-
-
-
- - - - - -
消息中心
-
-
全部消息
-
未读消息
-
已读消息
-
-
- - | {{ this.tabTitle }} - - -
-
- 已读 - 删除 -
- - - - - - - - - - - -
- - -
-
- 已读 - 删除 -
- - - - - - - - - - - -
- - -
-
- 删除 -
- - - - - - - - - - -
-
-
-
-
- + + - + @@ -373,7 +167,6 @@ -
图表的颜色: @@ -397,12 +190,13 @@ 确 定
- + + - + 开元云公司作为一级分销商面对直接客户,售出设备产品。产品由供应商上传平台,设置产品价格配置,及设备账号密码等配置信息,开元云进行审核,审核通过产品上线,客户可直接购买。开元云可以将产品分配给各供应商销售,分配时配置给供应商的折扣,供应商得到产品及开元云的折扣后,设置折扣面向客户,客户通过kboss进行购买,分销商的客户如自己上传产品,也可以成为开元云的供应商。 @@ -412,8 +206,7 @@
- - + @@ -428,7 +221,6 @@ {{ item.description }} -
@@ -437,6 +229,7 @@ +
@@ -464,11 +257,6 @@ import { logoutAPI, editPasswordAPI, getTimeAPI, - getUnreadmsgAPI, - getMsgAPI, - getReadmsgAPI, - upMsgAPI, - delMsgAPI, addPictureAPI, getPictureAPI, getOpictureAPI, @@ -482,39 +270,34 @@ import { reqSearchProductList } from "@/api/product/product"; import { bdProducts, jdProducts } from "@/views/product/productionData"; import { getHomePath } from "@/views/setting/tools"; +// 导入消息中心组件 +import MessageCenter from '@/components/MessageCenter/MessageCenter.vue' + export default { data() { return { + messageCenterVisible: false, // 控制消息中心显示 drawerPro: false, searchLoading: false, searchResultList: [], searchValue: '', searchDialogVisible: false, - channelManagementShow: false,//渠道管理 + channelManagementShow: false, isMobileScreen: false, cuxiaoIsShow: false, - isShowKbossCharge: false,//判断是否在充值页面 - isUpdate: false,//检测用户是否“已读” + isShowKbossCharge: false, isLocalhost: false, - // 获取用户代理字P串 userAgent: window.navigator.userAgent, - // 判断是否为移动设备 - isMobile: false, imageUrl: '', - alliInformationList: [],//全部消息 - unreadMessageList: [],//未读信息 - readInformationList: [],//已读信息 - readIdList: [], - count: null, + messageCount: 0, // 未读消息数量 userInfoList: [], - editUserInfoForm: { //修改个人信息表单 + editUserInfoForm: { nick_name: "", email: "", address: "", mobile: "", }, passwordForm: { - //修改密码表单 password: "", newpassword: "", configPassword: "", @@ -544,15 +327,10 @@ export default { "https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png", passwordDialog: false, editUserInfoDialog: false, - //通知 - drawer: false, - direction: "rtl", - nick_name: JSON.parse(localStorage.getItem('user_info')).username, - userId: sessionStorage.getItem("userId"), + nick_name: JSON.parse(localStorage.getItem('user_info'))?.username || '用户', + userId: sessionStorage.getItem("userId") || '', org_type: sessionStorage.getItem("org_type"), role: sessionStorage.getItem("jueseNew") == "admin" ? [] : sessionStorage.getItem("jueseNew"), - tabTitle: "消息中心", - tab_index: 1, dialogTableVisible: false, dialogFormVisible: false, form: { @@ -580,12 +358,11 @@ export default { color: '#F51515' }, }, - oneId: '', - isOne: false, currentFile: null }; }, components: { + MessageCenter, // 注册消息中心组件 PromotionalInvitationCode, Breadcrumb, Hamburger, @@ -601,19 +378,33 @@ export default { gridObj: state => state.operationAnalysis.gridObj, mybalance: state => state.user.mybalance, logoutUrl: state => state.login.logoutUrl, - }) }, created() { - this.isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(this.userAgent); - this.getUserInfo(); - // this.autoShuaXin(); this.themeState = sessionStorage.getItem('themeState') - this.getUnreadmsg() this.handleResize() }, methods: { + // 处理消息点击 + handleMessageClick() { + const userId = sessionStorage.getItem('userId'); + if (!userId) { + this.$message.warning('请先登录'); + this.$router.push('/login'); + return; + } + this.messageCenterVisible = true; + if (this.$refs.messageCenter) { + this.$refs.messageCenter.open(); + } + }, + + // 处理未读消息数量更新 + handleUnreadCountUpdate(count) { + this.messageCount = count; + }, + goHomePage() { this.$router.push('/homePage/index') this.$store.commit('setShowHomeNav', true) @@ -692,7 +483,6 @@ export default { params: { product_name: '数据库' } }) } else { - // console.log("走了京哦else") this.$router.push('/product/jdProduct') } } else if (item.type === "sdzx") { @@ -706,9 +496,6 @@ export default { return } this.searchLoading = true - // setTimeout(() => { - // this.searchLoading = false - // }, 300) reqSearchProductList({ name: this.searchValue }).then(res => { this.searchLoading = false if (res.status) { @@ -723,24 +510,6 @@ export default { }, goScreen() { window.open('https://www.kaiyuancloud.cn/dev/#/screen/k8sRescource', '_blank'); - // const newWindow = window.open('https://www.kaiyuancloud.cn/dev/#/screen/index', '_blank'); - // const newWindow = window.open('http://localhost:9527/#/screen/index', '_blank'); - // // 确保窗口已经打开 - // newWindow.onload = function () { - // // 这需要用户的交互才能全屏 - // if (newWindow.document.documentElement.requestFullscreen) { - // console.log("走了if") - // newWindow.document.documentElement.requestFullscreen(); - // } else if (newWindow.document.documentElement.mozRequestFullScreen) { // Firefox - // newWindow.document.documentElement.mozRequestFullScreen(); - // } else if (newWindow.document.documentElement.webkitRequestFullscreen) { // Chrome, Safari and Opera - // console.log("走了if谷歌") - // newWindow.document.documentElement.webkitRequestFullscreen(); - // } else if (newWindow.document.documentElement.msRequestFullscreen) { // IE/Edge - // newWindow.document.documentElement.msRequestFullscreen(); - // } - // }; - }, channelFirstBtn() { reqApplyChannel({ user_id: this.userId }).then(res => { @@ -753,7 +522,7 @@ export default { } }) }, - ChannelConfirmBtn() {//渠道确定按钮 + ChannelConfirmBtn() { reqApplyChannel({ user_id: this.userId, code: '200' }).then(res => { if (res.status) { this.$message.success("申请渠道成功,后续会有相关人员和您沟通~") @@ -762,9 +531,7 @@ export default { this.$message.error("申请渠道失败~") } }) - }, - // 屏幕宽度变化时触发的方法 handleResize() { if (window.matchMedia('(max-width: 760px)').matches) { this.isMobileScreen = true; @@ -773,10 +540,8 @@ export default { } }, beforeDestroy() { - // 在组件销毁前移除监听器 window.removeEventListener('resize', this.handleResize); }, - //接受子组件信息 acceptSonMessage(value) { this.cuxiaoIsShow = value }, @@ -785,12 +550,10 @@ export default { }, handleShow(isShow) { let resverNode = document.getElementById('resverIcon') - if (isShow) { if (this.role.includes('客户')) { this.$store.dispatch('user/getCustmoersMoney') } - resverNode.style.transform = 'rotate(180deg)' } else { resverNode.style.transform = 'rotate(0)' @@ -799,218 +562,26 @@ export default { initMybalance() { return sessionStorage.getItem('mybalance') }, - copyBtn() {//个人信息复制id + copyBtn() { const textToCopy = this.$refs.contentToCopy.innerText; navigator.clipboard.writeText(textToCopy).then(() => { this.$message.success('复制成功!') - }).catch((error) => { console.error('复制失败', error); }); - - }, - closeMesssageWindow() {//抽屉关闭的回调 - - this.getUnreadmsg() - if (this.isUpdate) { - - - } else { - - } - - }, - rowClass() { - return "font-size:14px;" }, handleAvatarSuccess(file, fileList) { this.imageUrl = URL.createObjectURL(file.raw); this.currentFile = file; }, - personalMessage() {//进入个人信息页面 + personalMessage() { this.$router.push('/customer/customerInformation') }, - getUnreadmsg() {//获取未读信息 - getUnreadmsgAPI().then(res => { - if (res.status) { - this.count = res.count - this.unreadMessageList = res.messages - } else { - this.$message({ - message: res.msg, - type: "error", - }); - } - }) - }, - getReadmsg() {//获取已读信息 - getReadmsgAPI().then(res => { - if (res.status) { - this.readInformationList = res.msg - } else { - this.$message({ - message: res.msg, - type: "error", - }); - } - }) - }, - rowStyle({ row, rowIndex }) {//改变表格某一行样式 - if (this.isOne == true && row.id == this.oneId) { - return 'unReadColor'; - } else if (row.msgstatus == 1) { - return 'unReadColor'; - } - return ''; - }, + async getUserInfo() { + if (!this.userId) return; - handleSelectionChange(selection) {//获取选择的数据的id - if (selection) { - this.readIdList = [] - selection.forEach(item => { - this.readIdList.push(item.id) - }) - } - }, - infrom() { // 通知 - this.isUpdate = false - this.drawer = true; - this.getMsg() - }, - getMsg() {//获取所有信息 - getMsgAPI({ userid: this.userId }).then(res => { - if (res.status && res.msg) { - this.alliInformationList = res.msg - } - }) - }, - readMassage() {//一键已读 - this.isUpdate = true - if (this.readIdList.length) { - this.upMsg(this.readIdList) - } else { - this.$message({ - message: "请选择数据", - type: "warning", - }); - } - }, - upMsg(data) {//更改消息状态 - let params = { - msgids: data - } - upMsgAPI(params).then(res => { - if (res.status) { - this.$message({ - message: "一键已读成功", - type: "success", - }); - if (this.tab_index == 1) { - this.getMsg() - } else if (this.tab_index == 2) { - this.getUnreadmsg() - } - } else { - this.$message({ - message: res.msg, - type: "error", - }); - } - }) - }, - delMsg(data) {//删除消息 - let params = { - id: data - } - delMsgAPI(params).then(res => { - if (res.status) { - this.$message({ - message: "删除成功", - type: "success", - }); - if (this.tab_index == 1) { - this.getMsg() - } else if (this.tab_index == 2) { - this.getUnreadmsg() - } else if (this.tab_index == 3) { - this.getReadmsg() - } - } else { - this.$message({ - message: res.msg, - type: "error", - }); - } - }) - }, - delMessage() {//一键删除 - if (this.readIdList.length) { - this.delMsg(this.readIdList) - } else { - this.$message({ - message: "请选择数据", - type: "warning", - }); - } - }, - expandChangeHandler(row) {//表格每一行展开时 - this.isOne = true - this.oneId = row.id - let params = { - msgids: [row.id] - } - upMsgAPI(params).then(res => { - if (res.status) { - this.rowStyle(row) - - } else { - this.$message({ - message: res.msg, - type: "error", - }); - } - }) - - }, - expandChangeHandler1(row) { - this.isUpdate = true - this.$refs.table.toggleRowExpansion(row); - this.expandChangeHandler(row) - }, - expandChangeHandler2(row) { - this.$refs.table.toggleRowExpansion(row); - }, - change(row, expanded) { - // console.log(row); - // console.log(expanded); - - }, - tab(i) {//通知切换 - this.tab_index = i; - if (i == 1) { - this.tabTitle = "全部消息"; - this.getMsg() - } else if (i == 2) { - this.tabTitle = "未读消息"; - this.getUnreadmsg() - - } else { - this.tabTitle = "已读消息"; - this.getReadmsg() - } - }, - autoShuaXin() { // 自动刷新 - setInterval(() => { - getTimeAPI().then((res) => { - // console.log(res); - }); - // 时间间隔 - }, 100000); - }, - async getUserInfo() { //获取个人信息 getUserInfoAPI({ id: this.userId }).then((res) => { if (res.status == true) { - // this.nick_name = res.data[0].username; this.userInfoList = res.data; sessionStorage.setItem("orgid", res.data[0].orgid); } else { @@ -1021,17 +592,16 @@ export default { } }); }, - goShopping() { //跳转购物车 - // this.$router.push("/shoppingManagement"); + goShopping() { this.$router.push("/product/shoppingCart"); }, toggleSideBar() { this.$store.dispatch("app/toggleSideBar"); }, - edituserPassword() {//修改密码 + edituserPassword() { this.passwordDialog = true; }, - onsubmit() { //修改密码 + onsubmit() { this.$refs.passwordForm.validate((valid) => { if (valid) { if ( @@ -1066,7 +636,7 @@ export default { } }); }, - async edituser() { //修改个人信息 + async edituser() { this.editUserInfoDialog = true; if (this.role == '运营') { this.getOpicture() @@ -1077,9 +647,10 @@ export default { this.editUserInfoForm.email = this.userInfoList[0].email; this.editUserInfoForm.address = this.userInfoList[0].address; this.editUserInfoForm.mobile = this.userInfoList[0].mobile; - // this.editUserInfoForm.nick_name = this.userInfoList[0].username; }, getPicture() { + if (!this.userId) return; + let params = { userid: this.userId } @@ -1087,7 +658,9 @@ export default { this.imageUrl = res.picture_url ? res.picture_url : null; }) }, - getOpicture() {//仅运营角色用 + getOpicture() { + if (!this.userId) return; + let params = { userid: this.userId } @@ -1095,8 +668,7 @@ export default { this.imageUrl = res.data ? res.data : null; }) }, - - editOnsubmit() { //修改个人信息 + editOnsubmit() { this.editUserInfoForm.contactor_phone = this.editUserInfoForm.mobile; editUserInfoAPI({ ...this.editUserInfoForm, id: this.userId, }).then( (res) => { @@ -1123,7 +695,6 @@ export default { if (this.role == '运营') { addOpictureAPI(formData).then(res => { if (res.status) { - } else { this.$message({ message: res.msg, @@ -1134,7 +705,6 @@ export default { } else { addPictureAPI(formData).then(res => { if (res.status) { - } else { this.$message({ message: res.msg, @@ -1143,7 +713,6 @@ export default { } }) } - }, handleClose1() { this.$refs.passwordForm.resetFields(); @@ -1160,32 +729,7 @@ export default { this.$refs.editUserInfoForm.resetFields(); this.editUserInfoDialog = false; }, - async logout() {//退出登录 - - // logout() { - // await this.$store.dispatch('auth/removeToken') - // logoutAPI().then((res) => { - // // console.log(res); - // }); - - //获取当前url - let url = window.location.href; - //判断url中是否包含domain_name字段 - // if (!url.includes('domain_name')) { - // //跳转到https://www.opencomputing.cn/ - // window.location.href = 'https://www.opencomputing.cn/'; - // - // } else { - // await this.$router.push(`/homePage?redirect=${this.$route.fullPath}`); - // } - - - // if (this.logoutUrl) { - // window.location.href = this.logoutUrl - // } else {mo - // window.location.href = 'https://www.opencomputing.cn/'; - // } - + async logout() { store.commit('tagsView/resetBreadcrumbState'); sessionStorage.removeItem("auths"); sessionStorage.removeItem("routes"); @@ -1193,8 +737,6 @@ export default { sessionStorage.removeItem("userId"); sessionStorage.removeItem("org_type") localStorage.removeItem('userId') - - localStorage.removeItem("auths"); localStorage.removeItem("routes"); localStorage.removeItem("user"); @@ -1202,22 +744,12 @@ export default { localStorage.removeItem("org_type") sessionStorage.removeItem('userId') this.$store.commit('setLoginState', false) - await this.$router.push(getHomePath()); - // window.location.reload() }, - - async logout1() {//退出登录 - - // logout() { - // await this.$store.dispatch('auth/removeToken') + async logout1() { logoutAPI().then((res) => { - // console.log(res); }); - - //获取当前url let url = window.location.href; - //判断url中是否包含domain_name字段 await this.$router.push(`/login`); store.commit('tagsView/resetBreadcrumbState'); sessionStorage.removeItem("auths"); @@ -1225,13 +757,12 @@ export default { sessionStorage.removeItem("user"); sessionStorage.removeItem("userId"); }, - //改变图表颜色 changeColor() { this.dialogFormVisible = false this.$store.commit('operationAnalysis/setGridObj', this.newGridObj) localStorage.setItem('gridObj', JSON.stringify(this.newGridObj)) }, - getFormData(object) {//转换参数为formdata格式 + getFormData(object) { const formData = new FormData(); Object.keys(object).forEach((key) => { const value = object[key]; @@ -1247,40 +778,25 @@ export default { }, }, watch: { - // gridObj(newValue, oldValue) { - // this.themeState = newValue - // console.log("gridObj原先是", oldValue) - // console.log("gridObj现在是", newValue) - // console.log("tgridObj", this.gridObj) - // }, gridObj: { handler(newValue, oldValue) { - // console.log("gridObj原先是", oldValue) - // console.log("gridObj现在是", newValue) - // console.log("tgridObj", this.gridObj) } } }, mounted() { this.role = sessionStorage.getItem("jueseNew") if (this.role.includes('客户')) { - // this.$store.commit('app/closeSiderBtn') } - - //判断是否在充值也展示 if (window.location.href.includes('kbossCharge')) { this.isShowKbossCharge = true } if (JSON.parse(localStorage.getItem('gridObj')) != {}) { - // this.newGridObj.bar.color = JSON.parse(localStorage.getItem('gridObj')).bar.color - // this.newGridObj.lineHuan.color = JSON.parse(localStorage.getItem('gridObj')).lineHuan.color - // this.newGridObj.lineTong.color = JSON.parse(localStorage.getItem('gridObj')).lineTong.color - // console.log("grid",this.gridObj) } this.isLocalhost = window.location.href.includes('localhost') || window.location.href.includes('xterm') }, }; + + + + diff --git a/f/web-kboss/src/main.js b/f/web-kboss/src/main.js index 8e955d1..4d0b2f1 100644 --- a/f/web-kboss/src/main.js +++ b/f/web-kboss/src/main.js @@ -4,6 +4,8 @@ import Cookies from 'js-cookie' import 'normalize.css/normalize.css' // a modern alternative to CSS resets +import '@/assets/css/iconfont/iconfont.css' + import Element from 'element-ui' import './styles/element-variables.scss' import 'xterm/css/xterm.css' @@ -22,7 +24,7 @@ let ploady={ start_date:'', end_date:'' } -reqSaleMoneyList(ploady) +// reqSaleMoneyList(ploady) // import {saveApprovalInfo} from "@/api/finance/approvalList"; // saveApprovalInfo(JSON.stringify({ // "flag":"update", @@ -98,20 +100,73 @@ Vue.use(Element, { //设置跳转页面时给页面的body属性设置滚动条 var onOverflow = ["/shoppingManagement", "/supplierManagement"]; -router.afterEach((to, from, next) => { +// 修复:在路由守卫中恢复用户状态和重新生成路由 +router.beforeEach(async (to, from, next) => { + // 清空面包屑状态的代码 + // store.commit('tagsView/resetBreadcrumbState'); + + // 新增:如果已登录且有token,但Vuex状态丢失,从sessionStorage恢复 + if (store.getters.token && (!store.getters.user || !store.getters.userType)) { + console.log("检测到状态丢失,从sessionStorage恢复用户状态"); + + const user = sessionStorage.getItem('user'); + const auths = sessionStorage.getItem('auths'); + const userType = sessionStorage.getItem('userType'); + const orgType = sessionStorage.getItem('orgType'); + + if (user) { + store.commit('user/SET_USER', user); + } + if (auths) { + store.commit('user/SET_AUTHS', JSON.parse(auths)); + } + if (userType) { + store.commit('user/SET_USER_TYPE', userType); + } + if (orgType) { + store.commit('user/SET_ORG_TYPE', parseInt(orgType)); + } + + // 重新生成路由 + try { + const accessRoutes = await store.dispatch('permission/generateRoutes', { + user: store.getters.user, + auths: store.getters.auths, + userType: store.getters.userType, + orgType: store.getters.orgType + }); + + // 重新添加路由 + router.addRoutes(accessRoutes); + + // 重定向到当前路由以确保路由更新 + next({ ...to, replace: true }); + return; + } catch (error) { + console.error('重新生成路由失败:', error); + } + } + onOverflow.forEach(element => { if (to.path == element) { document.querySelector("body").setAttribute("style", "overflow: auto !important;") } }); + + next(); }); + +window.addEventListener('beforeunload', function () { + // 清空面包屑状态的代码 + store.commit('tagsView/resetBreadcrumbState'); +}); + Object.keys(filters).forEach(key => { Vue.filter(key, filters[key]) }) Vue.config.productionTip = false - new Vue({ el: '#app', router, diff --git a/f/web-kboss/src/router/index.js b/f/web-kboss/src/router/index.js index 0fa9c7a..f412102 100644 --- a/f/web-kboss/src/router/index.js +++ b/f/web-kboss/src/router/index.js @@ -47,7 +47,7 @@ Vue.use(Router); /** * constantRoutes 没有权限要求的基本页面 - 所有角色都可以访问 + 所有角色都可以访问下· */ export const constantRoutes = [ { @@ -325,7 +325,7 @@ export const asyncRoutes = [ ] }, - // 订单管理菜单 - 保持为一级菜单,调整顺序到全部产品后面 + { path: "/orderManagement", component: Layout, @@ -352,7 +352,6 @@ export const asyncRoutes = [ ] }, - // 资源管理菜单 - 保持为一级菜单,调整顺序到订单管理后面 { path: "/resourceManagement", diff --git a/f/web-kboss/src/store/getters.js b/f/web-kboss/src/store/getters.js index e66a442..0d6cfd8 100644 --- a/f/web-kboss/src/store/getters.js +++ b/f/web-kboss/src/store/getters.js @@ -8,12 +8,11 @@ const getters = { avatar: state => state.user.avatar, name: state => state.user.name, introduction: state => state.user.introduction, - user: state => state.user.user, - auths: state => state.user.auths, + user: state => state.user.user || sessionStorage.getItem('user') || '', + auths: state => state.user.auths || JSON.parse(sessionStorage.getItem('auths') || '[]'), requestCode: state => state.user.requestCode, permission_routes: state => state.permission.routes, - // 新增:用户类型getter - userType: state => state.user.userType, - // errorLogs: state => state.errorLog.logs, + userType: state => state.user.userType || sessionStorage.getItem('userType') || '', + orgType: state => state.user.orgType || parseInt(sessionStorage.getItem('orgType')) || 0, } export default getters diff --git a/f/web-kboss/src/store/modules/permission.js b/f/web-kboss/src/store/modules/permission.js index e81fa6d..969a0a2 100644 --- a/f/web-kboss/src/store/modules/permission.js +++ b/f/web-kboss/src/store/modules/permission.js @@ -37,7 +37,7 @@ function filterAsyncRoutes(routes, permissions) { function addUserRoutes(routes, userType) { console.log("addUserRoutes - userType:", userType); - // 如果是普通用户(非管理员),添加订单管理和资源管理路由 + // 如果是普通用户(org_type为2),添加订单管理和资源管理路由 if (userType === 'user') { const orderManagementRoute = routes.find(route => route.path === "/orderManagement"); const resourceManagementRoute = routes.find(route => route.path === "/resourceManagement"); @@ -46,12 +46,12 @@ function addUserRoutes(routes, userType) { if (orderManagementRoute) { console.log("添加订单管理路由"); - userRoutes.push(orderManagementRoute); + userRoutes.push(JSON.parse(JSON.stringify(orderManagementRoute))); // 深拷贝 } if (resourceManagementRoute) { console.log("添加资源管理路由"); - userRoutes.push(resourceManagementRoute); + userRoutes.push(JSON.parse(JSON.stringify(resourceManagementRoute))); // 深拷贝 } return userRoutes; @@ -113,15 +113,17 @@ const actions = { return new Promise((resolve) => { let accessedRoutes; - // 判断用户类型:admin为1是管理员,否则是普通用户 - const userType = params.admin == 1 ? 'admin' : 'user'; - console.log("用户类型:", userType); + // 从参数或sessionStorage中获取用户类型和组织类型 + const userType = params.userType || sessionStorage.getItem('userType') || ''; + const orgType = params.orgType || parseInt(sessionStorage.getItem('orgType')) || 0; - if (params.user.includes("admin") && params.admin == 1) { + console.log("用户类型:", userType, "orgType:", orgType); + + if (params.user && params.user.includes("admin") && orgType != 2) { // 管理员:只显示超级管理员菜单 accessedRoutes = asyncRoutes.filter(item => item.path === '/superAdministrator'); } else { - const auths = JSON.parse(JSON.stringify(params.auths)); + const auths = params.auths ? JSON.parse(JSON.stringify(params.auths)) : []; console.log("ACTION generateRoutes - auths:", auths); if (auths.length) { @@ -144,10 +146,17 @@ const actions = { } // 新增:为普通用户添加订单管理和资源管理路由 - if (userType === 'user') { + if (userType === 'user' || orgType == 2) { console.log("为普通用户添加订单管理和资源管理路由"); const userSpecificRoutes = addUserRoutes(asyncRoutes, userType); - accessedRoutes = [...accessedRoutes, ...userSpecificRoutes]; + + // 确保不重复添加路由 + userSpecificRoutes.forEach(route => { + if (!accessedRoutes.some(r => r.path === route.path)) { + accessedRoutes.push(route); + } + }); + console.log("添加用户特定路由后的accessedRoutes:", accessedRoutes); } } diff --git a/f/web-kboss/src/store/modules/user.js b/f/web-kboss/src/store/modules/user.js index c2e673f..b356a37 100644 --- a/f/web-kboss/src/store/modules/user.js +++ b/f/web-kboss/src/store/modules/user.js @@ -7,21 +7,36 @@ import store from "@/store"; import {myBalanceAPI} from "@/api/finance/customerRechargeManagement"; import {testData} from "@/views/homePage/components/topBox/testData"; +// 从sessionStorage恢复状态 +const getStoredState = () => { + return { + user: sessionStorage.getItem('user') || "", + auths: JSON.parse(sessionStorage.getItem('auths')) || [], + userType: sessionStorage.getItem('userType') || '', + orgType: parseInt(sessionStorage.getItem('orgType')) || '', + mybalance: sessionStorage.getItem('mybalance') || '' + }; +}; + +const storedState = getStoredState(); + const state = { token: getToken(), name: "", avatar: "", introduction: "", //用户名称 - user: "", + user: storedState.user, //权限列表 - auths: [], + auths: storedState.auths, // 当前状态码 requestCode: 200, //客户余额 - mybalance: '', + mybalance: storedState.mybalance, // 新增:用户类型(admin/user) - userType: '' + userType: storedState.userType, + // 新增:组织类型 + orgType: storedState.orgType }; const mutations = { @@ -39,22 +54,28 @@ const mutations = { }, SET_AUTHS: (state, auths) => { state.auths = auths; - sessionStorage.setItem("auths", JSON.stringify(state.auths)); + sessionStorage.setItem("auths", JSON.stringify(auths)); }, SET_USER: (state, user) => { state.user = user; - sessionStorage.setItem("user", state.user); + sessionStorage.setItem("user", user); }, SET_REQUESTSTATE: (state, code) => { state.requestCode = code; }, SETMYBANLANCE(state, mybalance) { - state.mybalance = mybalance + state.mybalance = mybalance; + sessionStorage.setItem('mybalance', mybalance); }, // 新增:设置用户类型 SET_USER_TYPE: (state, userType) => { state.userType = userType; sessionStorage.setItem("userType", userType); + }, + // 新增:设置组织类型 + SET_ORG_TYPE: (state, orgType) => { + state.orgType = orgType; + sessionStorage.setItem("orgType", orgType.toString()); } }; @@ -62,14 +83,13 @@ const actions = { //客户获取余额 async getCustmoersMoney({commit}) { let result = await myBalanceAPI() + if (result.status) { commit('SETMYBANLANCE', result.data) - sessionStorage.setItem('mybalance', result.data) } }, // user login async login({commit}, userInfo) { - const {username, password, codeid, vcode} = userInfo; return new Promise(async (resolve, reject) => { loginUserAPI(userInfo) @@ -82,13 +102,15 @@ const actions = { type: 'error', }) } else { - const {data, admin} = response; + const {data, org_type} = response; commit("SET_USER", username); - // 新增:设置用户类型 - const userType = admin == 1 ? 'admin' : 'user'; + // 新增:根据 org_type 设置用户类型 + // org_type 为 2 表示客户,其他为管理员 + const userType = org_type == 2 ? 'user' : 'admin'; commit("SET_USER_TYPE", userType); - console.log("登录用户类型:", userType); + commit("SET_ORG_TYPE", org_type); + console.log("登录用户类型:", userType, "org_type:", org_type); data ? commit("SET_AUTHS", data) : commit("SET_AUTHS", []); const accessRoutes = await store.dispatch( @@ -96,7 +118,8 @@ const actions = { { user: username, auths: data, - admin: admin + userType: userType, + orgType: org_type } ) resetRouter(); @@ -117,46 +140,64 @@ const actions = { // get user info getInfo({commit, state}) { return new Promise((resolve, reject) => { - // getInfo(state.token).then(response => { - // const { data } = response - // if (!data) { - // reject('Verification failed, please Login again.') - // } - // const { roles, name, avatar, introduction } = data - // // roles must be a non-empty array - // if (!roles || roles.length <= 0) { - // reject('getInfo: roles must be a non-null array!') - // } - // commit('SET_ROLES', roles) - // commit('SET_NAME', name) - // commit('SET_AVATAR', avatar) - // commit('SET_INTRODUCTION', introduction) - // }).catch(error => { - // reject(error) - // }) + // 从sessionStorage恢复用户信息 + const user = sessionStorage.getItem('user'); + const auths = sessionStorage.getItem('auths'); + const userType = sessionStorage.getItem('userType'); + const orgType = sessionStorage.getItem('orgType'); + + if (user) { + commit("SET_USER", user); + } + if (auths) { + commit("SET_AUTHS", JSON.parse(auths)); + } + if (userType) { + commit("SET_USER_TYPE", userType); + } + if (orgType) { + commit("SET_ORG_TYPE", parseInt(orgType)); + } + + resolve({ + user: state.user, + auths: state.auths, + userType: state.userType, + orgType: state.orgType + }); }); }, // user logout logout({commit, state, dispatch}) { return new Promise((resolve, reject) => { - logout(state.token) - .then(() => { + // logout(state.token) + // .then(() => { commit("SET_TOKEN", ""); commit("SET_ROLES", []); commit("SET_USER_TYPE", ""); // 新增:清除用户类型 + commit("SET_ORG_TYPE", ""); // 新增:清除组织类型 + commit("SET_USER", ""); + commit("SET_AUTHS", []); removeToken(); resetRouter(); + // 清除sessionStorage + sessionStorage.removeItem('user'); + sessionStorage.removeItem('auths'); + sessionStorage.removeItem('userType'); + sessionStorage.removeItem('orgType'); + sessionStorage.removeItem('mybalance'); + // reset visited views and cached views // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2485 dispatch("tagsView/delAllViews", null, {root: true}); resolve(); - }) - .catch((error) => { - reject(error); - }); + // }) + // .catch((error) => { + // reject(error); + // }); }); }, @@ -167,7 +208,16 @@ const actions = { commit("SET_TOKEN", ""); commit("SET_ROLES", []); commit("SET_USER_TYPE", ""); // 新增:清除用户类型 + commit("SET_ORG_TYPE", ""); // 新增:清除组织类型 + commit("SET_USER", ""); + commit("SET_AUTHS", []); removeToken(); + + // 清除sessionStorage + sessionStorage.removeItem('user'); + sessionStorage.removeItem('auths'); + sessionStorage.removeItem('userType'); + sessionStorage.removeItem('orgType'); resolve(); }); }, @@ -200,4 +250,5 @@ export default { state, mutations, actions, + }; diff --git a/f/web-kboss/src/styles/variables.scss b/f/web-kboss/src/styles/variables.scss index 8759553..aef5d78 100644 --- a/f/web-kboss/src/styles/variables.scss +++ b/f/web-kboss/src/styles/variables.scss @@ -1,4 +1,5 @@ -// / base color +// variables.scss +// base color $blue: #324157; $light-blue: #3A71A8; $red: #C03639; @@ -9,22 +10,17 @@ $yellow: #FEC171; $panGreen: #30B08F; // sidebar -$menuText: #000; -$menuActiveText: #296ad9; // 当前激活菜单项的文字颜色 -$subMenuActiveText: #100101; // 当前激活子菜单项的文字颜色 +$menuText: #333; +$menuActiveText: #296ad9; +$subMenuActiveText: #000; -$menuBg: #fff; // 整体背景颜色 -$menuHover: #f0f0f0; // 鼠标悬浮一级菜单背景色 (轻微变化更友好) -$subMenuBg: #f7f7f7; // 子菜单背景色 -$subMenuHover: #eaeaea; // 鼠标悬浮子菜单背景色 (轻微变化更友好) +$menuBg: #fff; +$menuHover: #f5f7fa; +$subMenuBg: #fff; +$subMenuHover: #f0f0f0; -$sideBarWidth: 230px; // 侧边栏宽度 +$sideBarWidth: 230px; -// Element UI 默认折叠宽度为 64px -// $sideBarCollapseWidth: 64px; - -// the :export directive is the magic sauce for webpack -// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass :export { menuText: $menuText; menuActiveText: $menuActiveText; @@ -34,9 +30,4 @@ $sideBarWidth: 230px; // 侧边栏宽度 subMenuBg: $subMenuBg; subMenuHover: $subMenuHover; sideBarWidth: $sideBarWidth; - // sideBarCollapseWidth: $sideBarCollapseWidth; -} - - - - +} diff --git a/f/web-kboss/src/views/administrator/configureOrganizationUserRole/index.vue b/f/web-kboss/src/views/administrator/configureOrganizationUserRole/index.vue index 25e566e..3b64abe 100644 --- a/f/web-kboss/src/views/administrator/configureOrganizationUserRole/index.vue +++ b/f/web-kboss/src/views/administrator/configureOrganizationUserRole/index.vue @@ -554,7 +554,7 @@ export default { 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 ca31e5d..4852ca9 100644 --- a/f/web-kboss/src/views/homePage/components/topBox/index.vue +++ b/f/web-kboss/src/views/homePage/components/topBox/index.vue @@ -1,24 +1,28 @@ @@ -264,10 +205,17 @@ import { getHomePath } from '@/views/setting/tools' // 导入语言管理 import { languageStore, languageBus } from '@/utils/language' +// 导入消息中心组件 +import MessageCenter from '@/components/MessageCenter/MessageCenter.vue' + export default Vue.extend({ name: "TopBox", + components: { + MessageCenter + }, data() { return { + messageCenterVisible: false, // 控制消息中心显示 homePath: getHomePath(), // 首页路径 isShowKbossCharge: false, // 是否显示Kboss充值按钮 role: sessionStorage.getItem("jueseNew") == "admin" ? [] : sessionStorage.getItem("jueseNew"), // 用户角色 @@ -285,10 +233,12 @@ export default Vue.extend({ product_service: [], // 产品服务数据 language: 'zh', // 默认设置为中文 languageChangedHandler: null, // 语言变化事件处理器 + messageCount: 0, // 未读消息数量 translations: { zh: { home: '首页', ecosystem: '产品与服务', + supply: '供需广场', aboutUs: '关于我们', balance: '余额', recharge: '充值', @@ -299,6 +249,9 @@ export default Vue.extend({ login: '登录', register: '立即注册', noData: '暂无数据', + aiAssistant: 'AI助手', + customerService: '在线客服', + featureComingSoon: '功能即将上线,敬请期待!', // 一级菜单翻译 '云': '云', '算': '算', @@ -400,6 +353,7 @@ export default Vue.extend({ en: { home: 'Home', ecosystem: 'Products & Services', + supply: 'Supply', aboutUs: 'About Us', balance: 'Balance', recharge: 'Recharge', @@ -410,6 +364,9 @@ export default Vue.extend({ login: 'Login', register: 'Register Now', noData: 'No Data', + aiAssistant: 'AI Assistant', + customerService: 'Customer Service', + featureComingSoon: 'Feature coming soon, stay tuned!', // 一级菜单翻译 '云': 'Cloud', '算': 'Computing', @@ -553,10 +510,6 @@ export default Vue.extend({ } }, computed: { - // 判断当前是否为ncmatchHome页面 - isNcmatchHome() { - return window.location.href.includes('ncmatchHome') - }, // 映射Vuex中的getters ...mapGetters(["sidebar", "avatar", "device"]), // 映射Vuex中的state @@ -587,6 +540,45 @@ export default Vue.extend({ }, }, methods: { + // 处理AI助手点击 + handleAIClick() { + this.$message.info({ + message: this.translations[this.language].featureComingSoon, + duration: 3000, + showClose: true + }); + + }, + + // 处理客服点击 + handleServiceClick() { + this.$message.info({ + message: this.translations[this.language].featureComingSoon, + duration: 3000, + showClose: true + }); + }, + + // 处理消息图标点击 + handleMessageClick() { + if (this.loginState) { + // 已登录状态:打开消息中心 + this.messageCenterVisible = true; + // 同时调用组件方法确保初始化 + if (this.$refs.messageCenter) { + this.$refs.messageCenter.open(); + } + } else { + // 未登录状态:跳转到登录页 + this.handleGoLogin() + } + }, + + // 处理未读消息数量更新 + handleUnreadCountUpdate(count) { + this.messageCount = count; + }, + // 初始化语言状态 initLanguage() { // 直接从store获取当前语言,确保一致性 @@ -713,7 +705,7 @@ export default Vue.extend({ } }, - // 修改密码(未完全实现) + // 修改密码 edituserPassword() { this.passwordDialog = true; }, @@ -748,6 +740,8 @@ export default Vue.extend({ // 获取用户信息 async getUserInfo() { + if (!this.userId) return; + getUserInfoAPI({ id: this.userId }).then((res) => { if (res.status) { // this.nick_name = res.data[0].nick_name; @@ -961,7 +955,7 @@ export default Vue.extend({ this.showPanelRightData = this.threeData }, - // 返回测试数据(未使用) + // 返回测试数据 networkData() { return networkData }, @@ -1024,6 +1018,8 @@ export default Vue.extend({ this.$router.push({ path: '/login' }); + } else { + } } }, @@ -1045,9 +1041,6 @@ export default Vue.extend({ box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.08); width: 100%; z-index: 1000; - display: flex; - justify-content: space-between; - align-items: center; .container { font-size: 18px; @@ -1057,7 +1050,7 @@ export default Vue.extend({ display: flex; align-items: center; justify-content: space-between; - padding: 10px 20px; + padding: 14px 20px; } .logo { @@ -1123,15 +1116,22 @@ export default Vue.extend({ .language-toggle { cursor: pointer; - margin: 20px; - width: 60px; + margin-right: 20px; + // width: 60px; text-align: center; border-radius: 4px; font-size: 14px; text-decoration: none; transition: all 0.3s; color: #333; - z-index: 1001; /* 确保按钮在最上层 */ + z-index: 1001; + display: flex; + align-items: center; + + .icon-ditu_diqiu_o { + margin-right: 5px; + font-size: 24px !important; + } &:hover { color: #1E6FFF; @@ -1171,8 +1171,15 @@ export default Vue.extend({ } } + .icon-xiaoxi { + font-size: 24px !important; + } + .functions { padding-right: 20px; + font-size: 20px; + color: #000; + cursor: pointer; &:hover { color: #1E6FFF; @@ -1357,8 +1364,13 @@ export default Vue.extend({ width: 30px; height: 30px; border-radius: 50%; - background: #081020; color: white; + margin-right: 8px; + + img { + width: 40px; + height: 40px; + } } .company-name { @@ -1372,29 +1384,4 @@ export default Vue.extend({ color: #1E6FFF; } } - -/* 当homePath等于/ncmatchHome/index时的特殊样式 */ -.top-nav .container { - &.ncmatch-layout { - .logo { - flex: 1; - justify-content: space-between; - align-items: center; - } - - .user-area { - justify-content: flex-end; - flex-shrink: 0; - } - } -} - -/* 左侧用户头像样式 */ -.left-menu-item { - .avatar-wrapper { - i { - justify-content: flex-start !important; - } - } -} diff --git a/f/web-kboss/src/views/homePage/mainPage/index.vue b/f/web-kboss/src/views/homePage/mainPage/index.vue index f040e91..e0009f4 100644 --- a/f/web-kboss/src/views/homePage/mainPage/index.vue +++ b/f/web-kboss/src/views/homePage/mainPage/index.vue @@ -811,6 +811,7 @@ export default Vue.extend({ height: 100%; overflow: auto !important; min-width: 1500px; + } .banner { diff --git a/f/web-kboss/src/views/homePage/ncmatch/supplyAndDemandSquare/index.vue b/f/web-kboss/src/views/homePage/ncmatch/supplyAndDemandSquare/index.vue index c03ae37..30ef73f 100644 --- a/f/web-kboss/src/views/homePage/ncmatch/supplyAndDemandSquare/index.vue +++ b/f/web-kboss/src/views/homePage/ncmatch/supplyAndDemandSquare/index.vue @@ -3,13 +3,9 @@
- 算力供需 - - - 广场
@@ -556,4 +552,4 @@ export default { flex-direction: column; } - \ No newline at end of file + diff --git a/f/web-kboss/src/views/product/mainPage/index.vue b/f/web-kboss/src/views/product/mainPage/index.vue index fdca5aa..c17b6c5 100644 --- a/f/web-kboss/src/views/product/mainPage/index.vue +++ b/f/web-kboss/src/views/product/mainPage/index.vue @@ -72,23 +72,36 @@
账户余额
- ¥{{ initMybalance() }} + ¥{{ this.mybalance }} 立即充值
-
-
系统公告
-
    -
  • - - 这是第{{ i }}条系统公告内容... + +
    +
    待办事项
    +
      +
    • + {{ item.name }} + {{ item.count }}
+ + +
@@ -96,9 +109,15 @@ import Vue from 'vue' import { mapState } from "vuex"; import { reqNewHomeResource, reqNewHomeResourceWarning, reqQuickNav } from "@/api/newHome"; +import { editReachargelogAPI } from "@/api/finance/customerRechargeManagement"; +import { getUnreadmsgAPI } from "@/api/login"; // 导入站内信API +import MessageCenter from '@/components/MessageCenter/MessageCenter.vue'; // 导入消息中心组件 export default Vue.extend({ name: "mainPage", + components: { + MessageCenter + }, data() { return { tableData: [], @@ -109,10 +128,21 @@ export default Vue.extend({ email: "" }, viewList: [], - navList: [] + navList: [], + mybalance: 0, // 余额 + todoList: [ + { name: '待支付', count: 1 }, + { name: '待续费', count: 2 }, + { name: '处理中', count: 2 }, + { name: '站内信', count: 0 } // 初始值为0,将从API获取 + ], + messageCenterVisible: false // 控制消息中心弹窗显示 } }, - + created() { + this.initMybalance(); + this.getUnreadMsgCount(); // 获取未读消息数量 + }, mounted() { reqQuickNav().then(res => { this.navList = res.data @@ -146,9 +176,53 @@ export default Vue.extend({ } }) }, - initMybalance() { - return sessionStorage.getItem('mybalance') || '0.00' + async initMybalance() { + const res = await editReachargelogAPI() + if (res.status) { + this.mybalance = res.data + } }, + // 获取未读消息数量 + async getUnreadMsgCount() { + try { + const res = await getUnreadmsgAPI(); + if (res.status) { + // 更新站内信的未读数量 + const messageItem = this.todoList.find(item => item.name === '站内信'); + if (messageItem) { + messageItem.count = res.data || 0; + } + } else { + this.$message.error(res.msg || '获取未读消息失败'); + } + } catch (error) { + console.error('获取未读消息失败:', error); + this.$message.error('获取未读消息失败'); + } + }, + // 处理待办事项点击 + handleTodoClick(todoName) { + // 根据不同的待办事项类型进行跳转 + if (todoName === '站内信') { + // 打开消息中心弹窗 + this.openMessageCenter(); + } else { + // 待支付、待续费、处理中都跳转到产品概览页面 + this.$router.push('/product/overview'); + } + }, + // 打开消息中心 + openMessageCenter() { + this.messageCenterVisible = true; + }, + // 处理未读消息数量更新 + handleUnreadCountUpdate(count) { + // 更新站内信的未读数量 + const messageItem = this.todoList.find(item => item.name === '站内信'); + if (messageItem) { + messageItem.count = count || 0; + } + } }, computed: { ...mapState({ @@ -370,33 +444,44 @@ export default Vue.extend({ } } -.announcements { - .announcement-list { +/* 待办事项样式 */ +.todos { + .todo-list { list-style: none; padding: 0; margin: 0; + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 15px; - li { - padding: 10px 0; - border-bottom: 1px solid #eee; + .todo-item { display: flex; + flex-direction: column; align-items: center; + justify-content: center; + padding: 15px; + border: 1px solid #ebeef5; + border-radius: 8px; + text-align: center; + transition: all 0.3s ease; + cursor: pointer; - &:last-child { - border-bottom: none; + &:hover { + transform: translateY(-3px); + box-shadow: 0 4px 12px rgba(64, 158, 255, 0.2); + border-color: #409eff; } - i { - color: #e6a23c; - margin-right: 10px; - flex-shrink: 0; - } - - span { + .todo-name { + font-size: 14px; color: #606266; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; + margin-bottom: 8px; + } + + .todo-count { + font-size: 24px; + font-weight: bold; + color: #409eff; } } } @@ -440,9 +525,9 @@ export default Vue.extend({ .overView { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } + + .todo-list { + grid-template-columns: repeat(2, 1fr); + } } - - - - diff --git a/f/web-kboss/src/views/sales/BdUserMangement/orderMangement/index.vue b/f/web-kboss/src/views/sales/BdUserMangement/orderMangement/index.vue index 8967948..0a3bc3a 100644 --- a/f/web-kboss/src/views/sales/BdUserMangement/orderMangement/index.vue +++ b/f/web-kboss/src/views/sales/BdUserMangement/orderMangement/index.vue @@ -113,7 +113,9 @@
-
+ + +
@@ -462,7 +465,7 @@ export default { diff --git a/f/web-kboss/src/views/sales/customerManagement/jiNanChaoSuanUserList/index.vue b/f/web-kboss/src/views/sales/customerManagement/jiNanChaoSuanUserList/index.vue index 5df7900..9c0ca3d 100644 --- a/f/web-kboss/src/views/sales/customerManagement/jiNanChaoSuanUserList/index.vue +++ b/f/web-kboss/src/views/sales/customerManagement/jiNanChaoSuanUserList/index.vue @@ -5,7 +5,8 @@ align="center" header-align="center"
新增超算账号
- +
+ +
@@ -306,4 +308,8 @@ export default { .table_height { width: 100%; } +.table-box{ + padding:10px 20px; + +} diff --git a/f/web-kboss/src/views/sales/distributorManagement/index.vue b/f/web-kboss/src/views/sales/distributorManagement/index.vue index 88f5d46..cc63ea4 100644 --- a/f/web-kboss/src/views/sales/distributorManagement/index.vue +++ b/f/web-kboss/src/views/sales/distributorManagement/index.vue @@ -9,7 +9,7 @@ :data="distributorList" style="width: 100%" :unique-opened="true" - height="calc(100vh - 130px)" + height="100%" v-loading="loading" highlight-current-row :row-key="getRowKeys" @@ -2576,7 +2576,10 @@ export default { } .distributor_box { - height: calc(100vh - 130px); + height: calc(100vh - 160px); + padding: 20px; + background-color: #fff; + margin-top: 16px; } /* 展开详情样式优化 */