Merge branch 'main' of https://git.opencomputing.cn/yumoqing/kboss
This commit is contained in:
commit
33b48be461
@ -28,7 +28,7 @@ export function getReachargelogAPI(params) {
|
|||||||
//客户充值冲账
|
//客户充值冲账
|
||||||
export function editReachargelogAPI(params) {
|
export function editReachargelogAPI(params) {
|
||||||
return request({
|
return request({
|
||||||
url: `examine/upledger_examine${suffix}`,
|
url: `customer/mybalance.dspy`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
})
|
})
|
||||||
|
|||||||
539
f/web-kboss/src/assets/css/iconfont/demo.css
Normal file
539
f/web-kboss/src/assets/css/iconfont/demo.css
Normal file
@ -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;
|
||||||
|
}
|
||||||
418
f/web-kboss/src/assets/css/iconfont/demo_index.html
Normal file
418
f/web-kboss/src/assets/css/iconfont/demo_index.html
Normal file
@ -0,0 +1,418 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<title>iconfont Demo</title>
|
||||||
|
<link rel="shortcut icon" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg" type="image/x-icon"/>
|
||||||
|
<link rel="icon" type="image/svg+xml" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg"/>
|
||||||
|
<link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css">
|
||||||
|
<link rel="stylesheet" href="demo.css">
|
||||||
|
<link rel="stylesheet" href="iconfont.css">
|
||||||
|
<script src="iconfont.js"></script>
|
||||||
|
<!-- jQuery -->
|
||||||
|
<script src="https://a1.alicdn.com/oss/uploads/2018/12/26/7bfddb60-08e8-11e9-9b04-53e73bb6408b.js"></script>
|
||||||
|
<!-- 代码高亮 -->
|
||||||
|
<script src="https://a1.alicdn.com/oss/uploads/2018/12/26/a3f714d0-08e6-11e9-8a15-ebf944d7534c.js"></script>
|
||||||
|
<style>
|
||||||
|
.main .logo {
|
||||||
|
margin-top: 0;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main .logo a {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main .logo .sub-title {
|
||||||
|
margin-left: 0.5em;
|
||||||
|
font-size: 22px;
|
||||||
|
color: #fff;
|
||||||
|
background: linear-gradient(-45deg, #3967FF, #B500FE);
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
-webkit-text-fill-color: transparent;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="main">
|
||||||
|
<h1 class="logo"><a href="https://www.iconfont.cn/" title="iconfont 首页" target="_blank">
|
||||||
|
<img width="200" src="https://img.alicdn.com/imgextra/i3/O1CN01Mn65HV1FfSEzR6DKv_!!6000000000514-55-tps-228-59.svg">
|
||||||
|
|
||||||
|
</a></h1>
|
||||||
|
<div class="nav-tabs">
|
||||||
|
<ul id="tabs" class="dib-box">
|
||||||
|
<li class="dib active"><span>Unicode</span></li>
|
||||||
|
<li class="dib"><span>Font class</span></li>
|
||||||
|
<li class="dib"><span>Symbol</span></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<a href="https://www.iconfont.cn/manage/index?manage_type=myprojects&projectId=5043107" target="_blank" class="nav-more">查看项目</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="tab-container">
|
||||||
|
<div class="content unicode" style="display: block;">
|
||||||
|
<ul class="icon_lists dib-box">
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">复制</div>
|
||||||
|
<div class="code-name">&#xe61b;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">大类-全部产品</div>
|
||||||
|
<div class="code-name">&#xe64c;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">资源管理器</div>
|
||||||
|
<div class="code-name">&#xe641;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">社区服务</div>
|
||||||
|
<div class="code-name">&#xe616;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">复制</div>
|
||||||
|
<div class="code-name">&#xe648;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">订单管理</div>
|
||||||
|
<div class="code-name">&#xe602;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">客服</div>
|
||||||
|
<div class="code-name">&#xe625;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">地图_地球_o</div>
|
||||||
|
<div class="code-name">&#xebbb;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">消息</div>
|
||||||
|
<div class="code-name">&#xe60a;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">AI助手</div>
|
||||||
|
<div class="code-name">&#xe65f;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
<div class="article markdown">
|
||||||
|
<h2 id="unicode-">Unicode 引用</h2>
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<p>Unicode 是字体在网页端最原始的应用方式,特点是:</p>
|
||||||
|
<ul>
|
||||||
|
<li>支持按字体的方式去动态调整图标大小,颜色等等。</li>
|
||||||
|
<li>默认情况下不支持多色,直接添加多色图标会自动去色。</li>
|
||||||
|
</ul>
|
||||||
|
<blockquote>
|
||||||
|
<p>注意:新版 iconfont 支持两种方式引用多色图标:SVG symbol 引用方式和彩色字体图标模式。(使用彩色字体图标需要在「编辑项目」中开启「彩色」选项后并重新生成。)</p>
|
||||||
|
</blockquote>
|
||||||
|
<p>Unicode 使用步骤如下:</p>
|
||||||
|
<h3 id="-font-face">第一步:拷贝项目下面生成的 <code>@font-face</code></h3>
|
||||||
|
<pre><code class="language-css"
|
||||||
|
>@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');
|
||||||
|
}
|
||||||
|
</code></pre>
|
||||||
|
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
|
||||||
|
<pre><code class="language-css"
|
||||||
|
>.iconfont {
|
||||||
|
font-family: "iconfont" !important;
|
||||||
|
font-size: 16px;
|
||||||
|
font-style: normal;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
}
|
||||||
|
</code></pre>
|
||||||
|
<h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面</h3>
|
||||||
|
<pre>
|
||||||
|
<code class="language-html"
|
||||||
|
><span class="iconfont">&#x33;</span>
|
||||||
|
</code></pre>
|
||||||
|
<blockquote>
|
||||||
|
<p>"iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
|
||||||
|
</blockquote>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="content font-class">
|
||||||
|
<ul class="icon_lists dib-box">
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-fuzhi"></span>
|
||||||
|
<div class="name">
|
||||||
|
复制
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-fuzhi
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-dalei-quanbuchanpin"></span>
|
||||||
|
<div class="name">
|
||||||
|
大类-全部产品
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-dalei-quanbuchanpin
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-ziyuanguanliqi"></span>
|
||||||
|
<div class="name">
|
||||||
|
资源管理器
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-ziyuanguanliqi
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-shequfuwu"></span>
|
||||||
|
<div class="name">
|
||||||
|
社区服务
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-shequfuwu
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-fuzhi-"></span>
|
||||||
|
<div class="name">
|
||||||
|
复制
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-fuzhi-
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-dingdanguanli"></span>
|
||||||
|
<div class="name">
|
||||||
|
订单管理
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-dingdanguanli
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-kefu"></span>
|
||||||
|
<div class="name">
|
||||||
|
客服
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-kefu
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-ditu_diqiu_o"></span>
|
||||||
|
<div class="name">
|
||||||
|
地图_地球_o
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-ditu_diqiu_o
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-xiaoxi"></span>
|
||||||
|
<div class="name">
|
||||||
|
消息
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-xiaoxi
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-AIzhushou"></span>
|
||||||
|
<div class="name">
|
||||||
|
AI助手
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-AIzhushou
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
<div class="article markdown">
|
||||||
|
<h2 id="font-class-">font-class 引用</h2>
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<p>font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。</p>
|
||||||
|
<p>与 Unicode 使用方式相比,具有如下特点:</p>
|
||||||
|
<ul>
|
||||||
|
<li>相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。</li>
|
||||||
|
<li>因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。</li>
|
||||||
|
</ul>
|
||||||
|
<p>使用步骤如下:</p>
|
||||||
|
<h3 id="-fontclass-">第一步:引入项目下面生成的 fontclass 代码:</h3>
|
||||||
|
<pre><code class="language-html"><link rel="stylesheet" href="./iconfont.css">
|
||||||
|
</code></pre>
|
||||||
|
<h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h3>
|
||||||
|
<pre><code class="language-html"><span class="iconfont icon-xxx"></span>
|
||||||
|
</code></pre>
|
||||||
|
<blockquote>
|
||||||
|
<p>"
|
||||||
|
iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
|
||||||
|
</blockquote>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="content symbol">
|
||||||
|
<ul class="icon_lists dib-box">
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-fuzhi"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">复制</div>
|
||||||
|
<div class="code-name">#icon-fuzhi</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-dalei-quanbuchanpin"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">大类-全部产品</div>
|
||||||
|
<div class="code-name">#icon-dalei-quanbuchanpin</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-ziyuanguanliqi"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">资源管理器</div>
|
||||||
|
<div class="code-name">#icon-ziyuanguanliqi</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-shequfuwu"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">社区服务</div>
|
||||||
|
<div class="code-name">#icon-shequfuwu</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-fuzhi-"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">复制</div>
|
||||||
|
<div class="code-name">#icon-fuzhi-</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-dingdanguanli"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">订单管理</div>
|
||||||
|
<div class="code-name">#icon-dingdanguanli</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-kefu"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">客服</div>
|
||||||
|
<div class="code-name">#icon-kefu</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-ditu_diqiu_o"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">地图_地球_o</div>
|
||||||
|
<div class="code-name">#icon-ditu_diqiu_o</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-xiaoxi"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">消息</div>
|
||||||
|
<div class="code-name">#icon-xiaoxi</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-AIzhushou"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">AI助手</div>
|
||||||
|
<div class="code-name">#icon-AIzhushou</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
<div class="article markdown">
|
||||||
|
<h2 id="symbol-">Symbol 引用</h2>
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<p>这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇<a href="">文章</a>
|
||||||
|
这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:</p>
|
||||||
|
<ul>
|
||||||
|
<li>支持多色图标了,不再受单色限制。</li>
|
||||||
|
<li>通过一些技巧,支持像字体那样,通过 <code>font-size</code>, <code>color</code> 来调整样式。</li>
|
||||||
|
<li>兼容性较差,支持 IE9+,及现代浏览器。</li>
|
||||||
|
<li>浏览器渲染 SVG 的性能一般,还不如 png。</li>
|
||||||
|
</ul>
|
||||||
|
<p>使用步骤如下:</p>
|
||||||
|
<h3 id="-symbol-">第一步:引入项目下面生成的 symbol 代码:</h3>
|
||||||
|
<pre><code class="language-html"><script src="./iconfont.js"></script>
|
||||||
|
</code></pre>
|
||||||
|
<h3 id="-css-">第二步:加入通用 CSS 代码(引入一次就行):</h3>
|
||||||
|
<pre><code class="language-html"><style>
|
||||||
|
.icon {
|
||||||
|
width: 1em;
|
||||||
|
height: 1em;
|
||||||
|
vertical-align: -0.15em;
|
||||||
|
fill: currentColor;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</code></pre>
|
||||||
|
<h3 id="-">第三步:挑选相应图标并获取类名,应用于页面:</h3>
|
||||||
|
<pre><code class="language-html"><svg class="icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-xxx"></use>
|
||||||
|
</svg>
|
||||||
|
</code></pre>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
$('.tab-container .content:first').show()
|
||||||
|
|
||||||
|
$('#tabs li').click(function (e) {
|
||||||
|
var tabContent = $('.tab-container .content')
|
||||||
|
var index = $(this).index()
|
||||||
|
|
||||||
|
if ($(this).hasClass('active')) {
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
$('#tabs li').removeClass('active')
|
||||||
|
$(this).addClass('active')
|
||||||
|
|
||||||
|
tabContent.hide().eq(index).fadeIn()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
55
f/web-kboss/src/assets/css/iconfont/iconfont.css
Normal file
55
f/web-kboss/src/assets/css/iconfont/iconfont.css
Normal file
@ -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";
|
||||||
|
}
|
||||||
|
|
||||||
1
f/web-kboss/src/assets/css/iconfont/iconfont.js
Normal file
1
f/web-kboss/src/assets/css/iconfont/iconfont.js
Normal file
File diff suppressed because one or more lines are too long
79
f/web-kboss/src/assets/css/iconfont/iconfont.json
Normal file
79
f/web-kboss/src/assets/css/iconfont/iconfont.json
Normal file
@ -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
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
BIN
f/web-kboss/src/assets/css/iconfont/iconfont.ttf
Normal file
BIN
f/web-kboss/src/assets/css/iconfont/iconfont.ttf
Normal file
Binary file not shown.
BIN
f/web-kboss/src/assets/css/iconfont/iconfont.woff
Normal file
BIN
f/web-kboss/src/assets/css/iconfont/iconfont.woff
Normal file
Binary file not shown.
BIN
f/web-kboss/src/assets/css/iconfont/iconfont.woff2
Normal file
BIN
f/web-kboss/src/assets/css/iconfont/iconfont.woff2
Normal file
Binary file not shown.
BIN
f/web-kboss/src/assets/image/user.png
Normal file
BIN
f/web-kboss/src/assets/image/user.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.6 KiB |
793
f/web-kboss/src/components/MessageCenter/MessageCenter.vue
Normal file
793
f/web-kboss/src/components/MessageCenter/MessageCenter.vue
Normal file
@ -0,0 +1,793 @@
|
|||||||
|
<template>
|
||||||
|
<div class="message-center-wrapper">
|
||||||
|
<!-- 移动端通知弹框 -->
|
||||||
|
<el-drawer
|
||||||
|
:visible.sync="internalVisible"
|
||||||
|
v-if="isMobile"
|
||||||
|
direction="rtl"
|
||||||
|
:with-header="false"
|
||||||
|
size="90%"
|
||||||
|
class="drawerMobile"
|
||||||
|
:modal="true"
|
||||||
|
:modal-append-to-body="true"
|
||||||
|
:append-to-body="true"
|
||||||
|
@close="handleClose"
|
||||||
|
>
|
||||||
|
<el-container class="container">
|
||||||
|
<el-aside width="95px" class="aside">
|
||||||
|
<div class="header">消息中心</div>
|
||||||
|
<div class="title">
|
||||||
|
<div @click="tab(1)" :class="{ active: tab_index === 1 }" class="info">全部消息</div>
|
||||||
|
<div @click="tab(2)" :class="{ active: tab_index === 2 }" class="info">未读消息</div>
|
||||||
|
<div @click="tab(3)" :class="{ active: tab_index === 3 }" class="info">已读消息</div>
|
||||||
|
</div>
|
||||||
|
</el-aside>
|
||||||
|
<el-container class="content_box">
|
||||||
|
<el-header class="header">| {{ tabTitle }}</el-header>
|
||||||
|
<el-main class="content">
|
||||||
|
<!-- 全部信息 -->
|
||||||
|
<div v-if="tab_index == 1" class="allinfo">
|
||||||
|
<div class="button">
|
||||||
|
<el-button size="mini" type="primary" @click="readMassage">已读</el-button>
|
||||||
|
<el-button size="mini" type="danger" @click="delMessage">删除</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
:header-cell-style="rowClass"
|
||||||
|
@expand-change="expandChangeHandler"
|
||||||
|
ref="table"
|
||||||
|
@row-click="expandChangeHandler1"
|
||||||
|
class="table"
|
||||||
|
:row-class-name="rowStyle"
|
||||||
|
:data="alliInformationList ? alliInformationList : []"
|
||||||
|
height="680"
|
||||||
|
tooltip-effect="dark"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-table-column type="expand" width="30px">
|
||||||
|
<template slot-scope="props">
|
||||||
|
<div class="msgtext">
|
||||||
|
{{ props.row.msgtext }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column type="selection" width="55"></el-table-column>
|
||||||
|
<el-table-column label="消息内容" prop="msgtype" :show-overflow-tooltip="true">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="sendtime" label="接收时间">
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 未读信息 -->
|
||||||
|
<div v-if="tab_index == 2" class="noreadinfo">
|
||||||
|
<div class="button">
|
||||||
|
<el-button size="mini" type="primary" @click="readMassage">已读</el-button>
|
||||||
|
<el-button size="mini" type="danger" @click="delMessage">删除</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
:header-cell-style="rowClass"
|
||||||
|
@row-click="expandChangeHandler1"
|
||||||
|
class="table"
|
||||||
|
ref="table"
|
||||||
|
@expand-change="expandChangeHandler"
|
||||||
|
:row-class-name="rowStyle"
|
||||||
|
:data="unreadMessageList"
|
||||||
|
height="680"
|
||||||
|
tooltip-effect="dark"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-table-column type="expand" width="30px">
|
||||||
|
<template slot-scope="props">
|
||||||
|
<div class="msgtext">
|
||||||
|
{{ props.row.msgtext }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column type="selection" width="55"></el-table-column>
|
||||||
|
<el-table-column label="消息内容" prop="msgtype" :show-overflow-tooltip="true">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="sendtime" label="接收时间">
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 已读信息 -->
|
||||||
|
<div v-if="tab_index == 3" class="readinfo">
|
||||||
|
<div class="button">
|
||||||
|
<el-button size="mini" type="danger" @click="delMessage">删除</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
:header-cell-style="rowClass"
|
||||||
|
ref="table"
|
||||||
|
class="table"
|
||||||
|
@row-click="expandChangeHandler2"
|
||||||
|
@expand-change="expandChangeHandler"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
:row-class-name="rowStyle"
|
||||||
|
:data="readInformationList"
|
||||||
|
height="680"
|
||||||
|
tooltip-effect="dark"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-table-column type="expand" width="30px">
|
||||||
|
<template slot-scope="props">
|
||||||
|
<div class="msgtext">
|
||||||
|
{{ props.row.msgtext }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column type="selection" width="55"></el-table-column>
|
||||||
|
<el-table-column label="消息内容" prop="msgtype" :show-overflow-tooltip="true">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="sendtime" label="接收时间">
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</el-container>
|
||||||
|
</el-drawer>
|
||||||
|
|
||||||
|
<!-- 桌面端通知弹框 -->
|
||||||
|
<el-drawer
|
||||||
|
:visible.sync="internalVisible"
|
||||||
|
v-else
|
||||||
|
direction="rtl"
|
||||||
|
:with-header="false"
|
||||||
|
size="70%"
|
||||||
|
class="drawer"
|
||||||
|
:modal="true"
|
||||||
|
:modal-append-to-body="true"
|
||||||
|
:append-to-body="true"
|
||||||
|
@close="handleClose"
|
||||||
|
>
|
||||||
|
<el-container style="height: 100vh">
|
||||||
|
<el-aside width="200px" class="aside">
|
||||||
|
<div class="header" style="font-size:16px;">消息中心</div>
|
||||||
|
<div class="title">
|
||||||
|
<div @click="tab(1)" :class="{ active: tab_index === 1 }" style="font-size:16px;">全部消息</div>
|
||||||
|
<div @click="tab(2)" :class="{ active: tab_index === 2 }" style="font-size:16px;">未读消息</div>
|
||||||
|
<div @click="tab(3)" :class="{ active: tab_index === 3 }" style="font-size:16px;">已读消息</div>
|
||||||
|
</div>
|
||||||
|
</el-aside>
|
||||||
|
<el-container class="content_box">
|
||||||
|
<el-header class="header">| {{ tabTitle }}</el-header>
|
||||||
|
<el-main class="content">
|
||||||
|
<!-- 全部信息 -->
|
||||||
|
<div v-if="tab_index == 1">
|
||||||
|
<div class="button" style="display:flex;">
|
||||||
|
<el-button size="small" type="primary" @click="readMassage">已读</el-button>
|
||||||
|
<el-button size="small" type="danger" @click="delMessage">删除</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
@expand-change="expandChangeHandler"
|
||||||
|
ref="table"
|
||||||
|
@row-click="expandChangeHandler1"
|
||||||
|
class="table"
|
||||||
|
:row-class-name="rowStyle"
|
||||||
|
:data="alliInformationList ? alliInformationList : []"
|
||||||
|
height="780"
|
||||||
|
tooltip-effect="dark"
|
||||||
|
style="width: 100%"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="expand" width="30px">
|
||||||
|
<template slot-scope="props">
|
||||||
|
<div class="msgtext">
|
||||||
|
{{ props.row.msgtext }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column type="selection" width="55"></el-table-column>
|
||||||
|
<el-table-column label="消息内容" prop="msgtype" :show-overflow-tooltip="true">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="sendtime" label="接收时间">
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 未读信息 -->
|
||||||
|
<div v-if="tab_index == 2">
|
||||||
|
<div class="button" style="display:flex;">
|
||||||
|
<el-button size="small" type="primary" @click="readMassage">已读</el-button>
|
||||||
|
<el-button size="small" type="danger" @click="delMessage">删除</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
@row-click="expandChangeHandler1"
|
||||||
|
ref="table"
|
||||||
|
@expand-change="expandChangeHandler"
|
||||||
|
:row-class-name="rowStyle"
|
||||||
|
:data="unreadMessageList"
|
||||||
|
height="780"
|
||||||
|
tooltip-effect="dark"
|
||||||
|
style="width: 100%"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="expand" width="30px">
|
||||||
|
<template slot-scope="props">
|
||||||
|
<div class="msgtext">
|
||||||
|
{{ props.row.msgtext }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column type="selection" width="55"></el-table-column>
|
||||||
|
<el-table-column label="消息内容" prop="msgtype" :show-overflow-tooltip="true">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="sendtime" label="接收时间">
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 已读信息 -->
|
||||||
|
<div v-if="tab_index == 3">
|
||||||
|
<div class="button" style="display:flex;">
|
||||||
|
<el-button size="small" type="danger" @click="delMessage">删除</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
@row-click="expandChangeHandler2"
|
||||||
|
@expand-change="expandChangeHandler"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
:row-class-name="rowStyle"
|
||||||
|
:data="readInformationList"
|
||||||
|
height="780"
|
||||||
|
tooltip-effect="dark"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-table-column type="expand" width="30px">
|
||||||
|
<template slot-scope="props">
|
||||||
|
<div class="msgtext">
|
||||||
|
{{ props.row.msgtext }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column type="selection" width="55"></el-table-column>
|
||||||
|
<el-table-column label="消息内容" prop="msgtype" :show-overflow-tooltip="true">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="sendtime" label="接收时间">
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</el-container>
|
||||||
|
</el-drawer>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
getUnreadmsgAPI,
|
||||||
|
getMsgAPI,
|
||||||
|
getReadmsgAPI,
|
||||||
|
upMsgAPI,
|
||||||
|
delMsgAPI
|
||||||
|
} from "@/api/login";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'MessageCenter',
|
||||||
|
props: {
|
||||||
|
userId: {
|
||||||
|
type: [String, Number],
|
||||||
|
required: false,
|
||||||
|
default: null
|
||||||
|
},
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
isMobile: false,
|
||||||
|
alliInformationList: [], //全部消息
|
||||||
|
unreadMessageList: [], //未读信息
|
||||||
|
readInformationList: [], //已读信息
|
||||||
|
readIdList: [],
|
||||||
|
count: 0,
|
||||||
|
internalVisible: false, // 内部控制的显示状态
|
||||||
|
tabTitle: "消息中心",
|
||||||
|
tab_index: 1,
|
||||||
|
isUpdate: false,
|
||||||
|
oneId: '',
|
||||||
|
isOne: false,
|
||||||
|
originalBodyOverflow: '' // 保存原始body overflow样式
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
// 监听父组件传来的visible属性
|
||||||
|
visible: {
|
||||||
|
immediate: true,
|
||||||
|
handler(newVal) {
|
||||||
|
console.log('MessageCenter visible changed:', newVal);
|
||||||
|
this.internalVisible = newVal;
|
||||||
|
if (newVal) {
|
||||||
|
this.getMsg();
|
||||||
|
this.preventBodyScroll();
|
||||||
|
} else {
|
||||||
|
this.restoreBodyScroll();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 监听内部visible状态,同步到父组件
|
||||||
|
internalVisible(newVal) {
|
||||||
|
if (newVal !== this.visible) {
|
||||||
|
this.$emit('update:visible', newVal);
|
||||||
|
}
|
||||||
|
if (!newVal) {
|
||||||
|
this.getUnreadmsg();
|
||||||
|
this.restoreBodyScroll();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
// 检测是否为移动设备
|
||||||
|
this.checkMobile();
|
||||||
|
this.getUnreadmsg();
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
// 组件销毁时恢复body滚动
|
||||||
|
this.restoreBodyScroll();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 检测移动设备
|
||||||
|
checkMobile() {
|
||||||
|
const userAgent = window.navigator.userAgent;
|
||||||
|
this.isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent);
|
||||||
|
console.log('Is mobile device:', this.isMobile);
|
||||||
|
},
|
||||||
|
|
||||||
|
// 阻止body滚动
|
||||||
|
preventBodyScroll() {
|
||||||
|
this.originalBodyOverflow = document.body.style.overflow;
|
||||||
|
document.body.style.overflow = 'hidden';
|
||||||
|
},
|
||||||
|
|
||||||
|
// 恢复body滚动
|
||||||
|
restoreBodyScroll() {
|
||||||
|
document.body.style.overflow = this.originalBodyOverflow || '';
|
||||||
|
},
|
||||||
|
|
||||||
|
// 打开消息中心
|
||||||
|
open() {
|
||||||
|
console.log('MessageCenter open method called');
|
||||||
|
this.internalVisible = true;
|
||||||
|
this.getMsg();
|
||||||
|
this.preventBodyScroll();
|
||||||
|
},
|
||||||
|
|
||||||
|
// 关闭消息中心
|
||||||
|
close() {
|
||||||
|
console.log('MessageCenter close method called');
|
||||||
|
this.internalVisible = false;
|
||||||
|
this.restoreBodyScroll();
|
||||||
|
},
|
||||||
|
|
||||||
|
// 处理抽屉关闭事件
|
||||||
|
handleClose() {
|
||||||
|
console.log('MessageCenter handleClose called');
|
||||||
|
this.close();
|
||||||
|
},
|
||||||
|
|
||||||
|
rowClass() {
|
||||||
|
return "font-size:14px;";
|
||||||
|
},
|
||||||
|
|
||||||
|
getUnreadmsg() {
|
||||||
|
// 检查用户是否登录
|
||||||
|
const userId = sessionStorage.getItem('userId');
|
||||||
|
if (!userId) {
|
||||||
|
console.log('用户未登录,跳过获取未读消息');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
getUnreadmsgAPI().then(res => {
|
||||||
|
if (res.status) {
|
||||||
|
this.count = res.count;
|
||||||
|
this.unreadMessageList = res.messages;
|
||||||
|
// 触发未读消息数量更新事件
|
||||||
|
this.$emit('unread-count-update', res.count);
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
message: res.msg,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
console.error('获取未读消息失败:', error);
|
||||||
|
// 401错误不显示错误消息,因为用户未登录是正常情况
|
||||||
|
if (error.response && error.response.status !== 401) {
|
||||||
|
this.$message({
|
||||||
|
message: "获取未读消息失败",
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
getReadmsg() {
|
||||||
|
// 检查用户是否登录
|
||||||
|
const userId = sessionStorage.getItem('userId');
|
||||||
|
if (!userId) {
|
||||||
|
console.log('用户未登录,跳过获取已读消息');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
getReadmsgAPI().then(res => {
|
||||||
|
if (res.status) {
|
||||||
|
this.readInformationList = res.msg;
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
message: res.msg,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
console.error('获取已读消息失败:', error);
|
||||||
|
this.$message({
|
||||||
|
message: "获取已读消息失败",
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
rowStyle({ row, rowIndex }) {
|
||||||
|
if (this.isOne == true && row.id == this.oneId) {
|
||||||
|
return 'unReadColor';
|
||||||
|
} else if (row.msgstatus == 1) {
|
||||||
|
return 'unReadColor';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
if (selection) {
|
||||||
|
this.readIdList = [];
|
||||||
|
selection.forEach(item => {
|
||||||
|
this.readIdList.push(item.id);
|
||||||
|
});
|
||||||
|
console.log('Selected messages:', this.readIdList);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
getMsg() {
|
||||||
|
// 检查用户是否登录
|
||||||
|
const userId = sessionStorage.getItem('userId');
|
||||||
|
if (!userId) {
|
||||||
|
console.log('用户未登录,跳过获取消息');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
getMsgAPI({ userid: userId }).then(res => {
|
||||||
|
if (res.status && res.msg) {
|
||||||
|
this.alliInformationList = res.msg;
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
message: res.msg || "获取消息失败",
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
console.error('获取消息失败:', error);
|
||||||
|
this.$message({
|
||||||
|
message: "获取消息失败",
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
// 更新未读消息计数
|
||||||
|
this.getUnreadmsg();
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
message: res.msg,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
console.error('标记已读失败:', error);
|
||||||
|
this.$message({
|
||||||
|
message: "标记已读失败",
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
// 更新未读消息计数
|
||||||
|
this.getUnreadmsg();
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
message: res.msg,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
console.error('删除消息失败:', error);
|
||||||
|
this.$message({
|
||||||
|
message: "删除消息失败",
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
delMessage() {
|
||||||
|
if (this.readIdList.length) {
|
||||||
|
this.$confirm('确定要删除选中的消息吗?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.delMsg(this.readIdList);
|
||||||
|
}).catch(() => {
|
||||||
|
// 用户取消删除
|
||||||
|
});
|
||||||
|
} 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);
|
||||||
|
// 更新未读消息计数
|
||||||
|
this.getUnreadmsg();
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
message: res.msg,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
console.error('标记消息已读失败:', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
expandChangeHandler1(row) {
|
||||||
|
this.isUpdate = true;
|
||||||
|
if (this.$refs.table) {
|
||||||
|
this.$refs.table.toggleRowExpansion(row);
|
||||||
|
}
|
||||||
|
this.expandChangeHandler(row);
|
||||||
|
},
|
||||||
|
|
||||||
|
expandChangeHandler2(row) {
|
||||||
|
if (this.$refs.table) {
|
||||||
|
this.$refs.table.toggleRowExpansion(row);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.message-center-wrapper {
|
||||||
|
position: relative;
|
||||||
|
z-index: 10000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer, .drawerMobile {
|
||||||
|
z-index: 10001 !important;
|
||||||
|
|
||||||
|
::v-deep .el-drawer {
|
||||||
|
z-index: 10002 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-drawer__wrapper {
|
||||||
|
z-index: 10001 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-drawer__container {
|
||||||
|
z-index: 10001 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-drawer__header {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.aside {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
background-color: #f5f7fa;
|
||||||
|
|
||||||
|
.header {
|
||||||
|
padding-left: 20px;
|
||||||
|
height: 60px;
|
||||||
|
line-height: 60px;
|
||||||
|
font-weight: 600;
|
||||||
|
background-color: #d9dee4;
|
||||||
|
border-bottom: 1px solid #e6e6e6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title div {
|
||||||
|
padding-left: 35px;
|
||||||
|
height: 50px;
|
||||||
|
line-height: 50px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 0.3s;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: #ebedf0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
background-color: #e1e5eb;
|
||||||
|
color: #409eff;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.content_box {
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 0 10px;
|
||||||
|
|
||||||
|
.header {
|
||||||
|
font-size: 22px;
|
||||||
|
line-height: 60px;
|
||||||
|
border-bottom: 1px solid #e6e6e6;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msgtext {
|
||||||
|
padding: 15px;
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
border-radius: 4px;
|
||||||
|
line-height: 1.6;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
padding-bottom: 15px;
|
||||||
|
border-bottom: 1px solid #e6e6e6;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 表格样式优化 */
|
||||||
|
::v-deep .el-table {
|
||||||
|
.el-table__row {
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: #f5f7fa !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-table__expanded-cell {
|
||||||
|
padding: 10px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 移动端样式优化 */
|
||||||
|
.drawerMobile {
|
||||||
|
.container {
|
||||||
|
height: 100vh;
|
||||||
|
|
||||||
|
.aside {
|
||||||
|
.header {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
.info {
|
||||||
|
font-size: 12px;
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.content_box {
|
||||||
|
.header {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
.allinfo, .readinfo, .noreadinfo {
|
||||||
|
.button {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 响应式调整 */
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.drawerMobile {
|
||||||
|
::v-deep .el-drawer {
|
||||||
|
width: 90% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 确保所有交互元素可点击 */
|
||||||
|
::v-deep .el-button {
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-table__row {
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-drawer__body {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
File diff suppressed because it is too large
Load Diff
@ -40,7 +40,7 @@ export default {
|
|||||||
name: "Sidebar",
|
name: "Sidebar",
|
||||||
components: { SidebarItem, Logo },
|
components: { SidebarItem, Logo },
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(["permission_routes", "sidebar", "userType"]), // 新增:映射userType
|
...mapGetters(["permission_routes", "sidebar", "userType", "orgType"]),
|
||||||
|
|
||||||
showLogo() {
|
showLogo() {
|
||||||
return true;
|
return true;
|
||||||
@ -54,27 +54,15 @@ export default {
|
|||||||
return !this.sidebar.opened;
|
return !this.sidebar.opened;
|
||||||
},
|
},
|
||||||
|
|
||||||
// 修复:确保权限路由正确获取
|
|
||||||
permissionRoutes() {
|
permissionRoutes() {
|
||||||
const routes = this.permission_routes || [];
|
const routes = this.permission_routes || [];
|
||||||
console.log("Sidebar - 当前权限路由:", routes);
|
|
||||||
console.log("Sidebar - 用户类型:", this.userType); // 新增:打印用户类型
|
|
||||||
|
|
||||||
// 调试:检查是否包含订单管理和资源管理路由
|
|
||||||
const hasOrderManagement = routes.some(route => route.path === '/orderManagement');
|
|
||||||
const hasResourceManagement = routes.some(route => route.path === '/resourceManagement');
|
|
||||||
console.log("是否包含订单管理:", hasOrderManagement);
|
|
||||||
console.log("是否包含资源管理:", hasResourceManagement);
|
|
||||||
|
|
||||||
return routes;
|
return routes;
|
||||||
},
|
},
|
||||||
|
|
||||||
// 修复:激活菜单的高亮
|
|
||||||
activeMenu() {
|
activeMenu() {
|
||||||
const route = this.$route;
|
const route = this.$route;
|
||||||
const { meta, path } = route;
|
const { meta, path } = route;
|
||||||
|
|
||||||
// 如果设置了activeMenu,就使用它
|
|
||||||
if (meta.activeMenu) {
|
if (meta.activeMenu) {
|
||||||
return meta.activeMenu;
|
return meta.activeMenu;
|
||||||
}
|
}
|
||||||
@ -85,25 +73,6 @@ export default {
|
|||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
console.log("Sidebar mounted - 权限路由:", this.permissionRoutes);
|
console.log("Sidebar mounted - 权限路由:", this.permissionRoutes);
|
||||||
console.log("Sidebar mounted - 用户类型:", this.userType);
|
|
||||||
},
|
|
||||||
|
|
||||||
watch: {
|
|
||||||
permission_routes: {
|
|
||||||
handler(newRoutes) {
|
|
||||||
console.log("Sidebar - 权限路由变化:", newRoutes);
|
|
||||||
},
|
|
||||||
deep: true,
|
|
||||||
immediate: true
|
|
||||||
},
|
|
||||||
|
|
||||||
// 新增:监听用户类型变化
|
|
||||||
userType: {
|
|
||||||
handler(newType) {
|
|
||||||
console.log("Sidebar - 用户类型变化:", newType);
|
|
||||||
},
|
|
||||||
immediate: true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@ -139,6 +108,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 重点修改部分 - 更具体的选择器
|
||||||
::v-deep .el-menu-vertical {
|
::v-deep .el-menu-vertical {
|
||||||
border: none;
|
border: none;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@ -152,8 +122,36 @@ export default {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 子菜单容器
|
||||||
|
.el-menu--inline {
|
||||||
|
// 子菜单项
|
||||||
|
.el-menu-item {
|
||||||
|
// 激活的子菜单项
|
||||||
|
&.is-active {
|
||||||
|
background-color: #d7dafd !important;
|
||||||
|
color: #296ad9 !important;
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 3px;
|
||||||
|
background-color: #296ad9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 非激活状态的悬停效果
|
||||||
|
&:not(.is-active):hover {
|
||||||
|
background-color: #f5f7fa !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 折叠状态
|
||||||
::v-deep .el-menu--collapse {
|
::v-deep .el-menu--collapse {
|
||||||
width: 64px !important;
|
width: 64px !important;
|
||||||
min-width: 64px !important;
|
min-width: 64px !important;
|
||||||
@ -163,6 +161,16 @@ export default {
|
|||||||
text-overflow: clip;
|
text-overflow: clip;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 折叠状态下的子菜单激活样式
|
||||||
|
.el-menu--popup {
|
||||||
|
.el-menu-item {
|
||||||
|
&.is-active {
|
||||||
|
background-color: #d7dafd !important;
|
||||||
|
color: #296ad9 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -4,6 +4,8 @@ import Cookies from 'js-cookie'
|
|||||||
|
|
||||||
import 'normalize.css/normalize.css' // a modern alternative to CSS resets
|
import 'normalize.css/normalize.css' // a modern alternative to CSS resets
|
||||||
|
|
||||||
|
import '@/assets/css/iconfont/iconfont.css'
|
||||||
|
|
||||||
import Element from 'element-ui'
|
import Element from 'element-ui'
|
||||||
import './styles/element-variables.scss'
|
import './styles/element-variables.scss'
|
||||||
import 'xterm/css/xterm.css'
|
import 'xterm/css/xterm.css'
|
||||||
@ -22,7 +24,7 @@ let ploady={
|
|||||||
start_date:'',
|
start_date:'',
|
||||||
end_date:''
|
end_date:''
|
||||||
}
|
}
|
||||||
reqSaleMoneyList(ploady)
|
// reqSaleMoneyList(ploady)
|
||||||
// import {saveApprovalInfo} from "@/api/finance/approvalList";
|
// import {saveApprovalInfo} from "@/api/finance/approvalList";
|
||||||
// saveApprovalInfo(JSON.stringify({
|
// saveApprovalInfo(JSON.stringify({
|
||||||
// "flag":"update",
|
// "flag":"update",
|
||||||
@ -98,20 +100,73 @@ Vue.use(Element, {
|
|||||||
//设置跳转页面时给页面的body属性设置滚动条
|
//设置跳转页面时给页面的body属性设置滚动条
|
||||||
var onOverflow = ["/shoppingManagement", "/supplierManagement"];
|
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 => {
|
onOverflow.forEach(element => {
|
||||||
if (to.path == element) {
|
if (to.path == element) {
|
||||||
document.querySelector("body").setAttribute("style", "overflow: auto !important;")
|
document.querySelector("body").setAttribute("style", "overflow: auto !important;")
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
next();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
window.addEventListener('beforeunload', function () {
|
||||||
|
// 清空面包屑状态的代码
|
||||||
|
store.commit('tagsView/resetBreadcrumbState');
|
||||||
|
});
|
||||||
|
|
||||||
Object.keys(filters).forEach(key => {
|
Object.keys(filters).forEach(key => {
|
||||||
Vue.filter(key, filters[key])
|
Vue.filter(key, filters[key])
|
||||||
})
|
})
|
||||||
|
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
|
|
||||||
|
|
||||||
new Vue({
|
new Vue({
|
||||||
el: '#app',
|
el: '#app',
|
||||||
router,
|
router,
|
||||||
|
|||||||
@ -47,7 +47,7 @@ Vue.use(Router);
|
|||||||
/**
|
/**
|
||||||
* constantRoutes
|
* constantRoutes
|
||||||
没有权限要求的基本页面
|
没有权限要求的基本页面
|
||||||
所有角色都可以访问
|
所有角色都可以访问下·
|
||||||
*/
|
*/
|
||||||
export const constantRoutes = [
|
export const constantRoutes = [
|
||||||
{
|
{
|
||||||
@ -325,7 +325,7 @@ export const asyncRoutes = [
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
// 订单管理菜单 - 保持为一级菜单,调整顺序到全部产品后面
|
|
||||||
{
|
{
|
||||||
path: "/orderManagement",
|
path: "/orderManagement",
|
||||||
component: Layout,
|
component: Layout,
|
||||||
@ -352,7 +352,6 @@ export const asyncRoutes = [
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
// 资源管理菜单 - 保持为一级菜单,调整顺序到订单管理后面
|
|
||||||
|
|
||||||
{
|
{
|
||||||
path: "/resourceManagement",
|
path: "/resourceManagement",
|
||||||
|
|||||||
@ -8,12 +8,11 @@ const getters = {
|
|||||||
avatar: state => state.user.avatar,
|
avatar: state => state.user.avatar,
|
||||||
name: state => state.user.name,
|
name: state => state.user.name,
|
||||||
introduction: state => state.user.introduction,
|
introduction: state => state.user.introduction,
|
||||||
user: state => state.user.user,
|
user: state => state.user.user || sessionStorage.getItem('user') || '',
|
||||||
auths: state => state.user.auths,
|
auths: state => state.user.auths || JSON.parse(sessionStorage.getItem('auths') || '[]'),
|
||||||
requestCode: state => state.user.requestCode,
|
requestCode: state => state.user.requestCode,
|
||||||
permission_routes: state => state.permission.routes,
|
permission_routes: state => state.permission.routes,
|
||||||
// 新增:用户类型getter
|
userType: state => state.user.userType || sessionStorage.getItem('userType') || '',
|
||||||
userType: state => state.user.userType,
|
orgType: state => state.user.orgType || parseInt(sessionStorage.getItem('orgType')) || 0,
|
||||||
// errorLogs: state => state.errorLog.logs,
|
|
||||||
}
|
}
|
||||||
export default getters
|
export default getters
|
||||||
|
|||||||
@ -37,7 +37,7 @@ function filterAsyncRoutes(routes, permissions) {
|
|||||||
function addUserRoutes(routes, userType) {
|
function addUserRoutes(routes, userType) {
|
||||||
console.log("addUserRoutes - userType:", userType);
|
console.log("addUserRoutes - userType:", userType);
|
||||||
|
|
||||||
// 如果是普通用户(非管理员),添加订单管理和资源管理路由
|
// 如果是普通用户(org_type为2),添加订单管理和资源管理路由
|
||||||
if (userType === 'user') {
|
if (userType === 'user') {
|
||||||
const orderManagementRoute = routes.find(route => route.path === "/orderManagement");
|
const orderManagementRoute = routes.find(route => route.path === "/orderManagement");
|
||||||
const resourceManagementRoute = routes.find(route => route.path === "/resourceManagement");
|
const resourceManagementRoute = routes.find(route => route.path === "/resourceManagement");
|
||||||
@ -46,12 +46,12 @@ function addUserRoutes(routes, userType) {
|
|||||||
|
|
||||||
if (orderManagementRoute) {
|
if (orderManagementRoute) {
|
||||||
console.log("添加订单管理路由");
|
console.log("添加订单管理路由");
|
||||||
userRoutes.push(orderManagementRoute);
|
userRoutes.push(JSON.parse(JSON.stringify(orderManagementRoute))); // 深拷贝
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resourceManagementRoute) {
|
if (resourceManagementRoute) {
|
||||||
console.log("添加资源管理路由");
|
console.log("添加资源管理路由");
|
||||||
userRoutes.push(resourceManagementRoute);
|
userRoutes.push(JSON.parse(JSON.stringify(resourceManagementRoute))); // 深拷贝
|
||||||
}
|
}
|
||||||
|
|
||||||
return userRoutes;
|
return userRoutes;
|
||||||
@ -113,15 +113,17 @@ const actions = {
|
|||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
let accessedRoutes;
|
let accessedRoutes;
|
||||||
|
|
||||||
// 判断用户类型:admin为1是管理员,否则是普通用户
|
// 从参数或sessionStorage中获取用户类型和组织类型
|
||||||
const userType = params.admin == 1 ? 'admin' : 'user';
|
const userType = params.userType || sessionStorage.getItem('userType') || '';
|
||||||
console.log("用户类型:", 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');
|
accessedRoutes = asyncRoutes.filter(item => item.path === '/superAdministrator');
|
||||||
} else {
|
} 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);
|
console.log("ACTION generateRoutes - auths:", auths);
|
||||||
|
|
||||||
if (auths.length) {
|
if (auths.length) {
|
||||||
@ -144,10 +146,17 @@ const actions = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 新增:为普通用户添加订单管理和资源管理路由
|
// 新增:为普通用户添加订单管理和资源管理路由
|
||||||
if (userType === 'user') {
|
if (userType === 'user' || orgType == 2) {
|
||||||
console.log("为普通用户添加订单管理和资源管理路由");
|
console.log("为普通用户添加订单管理和资源管理路由");
|
||||||
const userSpecificRoutes = addUserRoutes(asyncRoutes, userType);
|
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);
|
console.log("添加用户特定路由后的accessedRoutes:", accessedRoutes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,21 +7,36 @@ import store from "@/store";
|
|||||||
import {myBalanceAPI} from "@/api/finance/customerRechargeManagement";
|
import {myBalanceAPI} from "@/api/finance/customerRechargeManagement";
|
||||||
import {testData} from "@/views/homePage/components/topBox/testData";
|
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 = {
|
const state = {
|
||||||
token: getToken(),
|
token: getToken(),
|
||||||
name: "",
|
name: "",
|
||||||
avatar: "",
|
avatar: "",
|
||||||
introduction: "",
|
introduction: "",
|
||||||
//用户名称
|
//用户名称
|
||||||
user: "",
|
user: storedState.user,
|
||||||
//权限列表
|
//权限列表
|
||||||
auths: [],
|
auths: storedState.auths,
|
||||||
// 当前状态码
|
// 当前状态码
|
||||||
requestCode: 200,
|
requestCode: 200,
|
||||||
//客户余额
|
//客户余额
|
||||||
mybalance: '',
|
mybalance: storedState.mybalance,
|
||||||
// 新增:用户类型(admin/user)
|
// 新增:用户类型(admin/user)
|
||||||
userType: ''
|
userType: storedState.userType,
|
||||||
|
// 新增:组织类型
|
||||||
|
orgType: storedState.orgType
|
||||||
};
|
};
|
||||||
|
|
||||||
const mutations = {
|
const mutations = {
|
||||||
@ -39,22 +54,28 @@ const mutations = {
|
|||||||
},
|
},
|
||||||
SET_AUTHS: (state, auths) => {
|
SET_AUTHS: (state, auths) => {
|
||||||
state.auths = auths;
|
state.auths = auths;
|
||||||
sessionStorage.setItem("auths", JSON.stringify(state.auths));
|
sessionStorage.setItem("auths", JSON.stringify(auths));
|
||||||
},
|
},
|
||||||
SET_USER: (state, user) => {
|
SET_USER: (state, user) => {
|
||||||
state.user = user;
|
state.user = user;
|
||||||
sessionStorage.setItem("user", state.user);
|
sessionStorage.setItem("user", user);
|
||||||
},
|
},
|
||||||
SET_REQUESTSTATE: (state, code) => {
|
SET_REQUESTSTATE: (state, code) => {
|
||||||
state.requestCode = code;
|
state.requestCode = code;
|
||||||
},
|
},
|
||||||
SETMYBANLANCE(state, mybalance) {
|
SETMYBANLANCE(state, mybalance) {
|
||||||
state.mybalance = mybalance
|
state.mybalance = mybalance;
|
||||||
|
sessionStorage.setItem('mybalance', mybalance);
|
||||||
},
|
},
|
||||||
// 新增:设置用户类型
|
// 新增:设置用户类型
|
||||||
SET_USER_TYPE: (state, userType) => {
|
SET_USER_TYPE: (state, userType) => {
|
||||||
state.userType = userType;
|
state.userType = userType;
|
||||||
sessionStorage.setItem("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}) {
|
async getCustmoersMoney({commit}) {
|
||||||
let result = await myBalanceAPI()
|
let result = await myBalanceAPI()
|
||||||
|
|
||||||
if (result.status) {
|
if (result.status) {
|
||||||
commit('SETMYBANLANCE', result.data)
|
commit('SETMYBANLANCE', result.data)
|
||||||
sessionStorage.setItem('mybalance', result.data)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// user login
|
// user login
|
||||||
async login({commit}, userInfo) {
|
async login({commit}, userInfo) {
|
||||||
|
|
||||||
const {username, password, codeid, vcode} = userInfo;
|
const {username, password, codeid, vcode} = userInfo;
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
loginUserAPI(userInfo)
|
loginUserAPI(userInfo)
|
||||||
@ -82,13 +102,15 @@ const actions = {
|
|||||||
type: 'error',
|
type: 'error',
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
const {data, admin} = response;
|
const {data, org_type} = response;
|
||||||
commit("SET_USER", username);
|
commit("SET_USER", username);
|
||||||
|
|
||||||
// 新增:设置用户类型
|
// 新增:根据 org_type 设置用户类型
|
||||||
const userType = admin == 1 ? 'admin' : 'user';
|
// org_type 为 2 表示客户,其他为管理员
|
||||||
|
const userType = org_type == 2 ? 'user' : 'admin';
|
||||||
commit("SET_USER_TYPE", userType);
|
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", []);
|
data ? commit("SET_AUTHS", data) : commit("SET_AUTHS", []);
|
||||||
const accessRoutes = await store.dispatch(
|
const accessRoutes = await store.dispatch(
|
||||||
@ -96,7 +118,8 @@ const actions = {
|
|||||||
{
|
{
|
||||||
user: username,
|
user: username,
|
||||||
auths: data,
|
auths: data,
|
||||||
admin: admin
|
userType: userType,
|
||||||
|
orgType: org_type
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
resetRouter();
|
resetRouter();
|
||||||
@ -117,46 +140,64 @@ const actions = {
|
|||||||
// get user info
|
// get user info
|
||||||
getInfo({commit, state}) {
|
getInfo({commit, state}) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// getInfo(state.token).then(response => {
|
// 从sessionStorage恢复用户信息
|
||||||
// const { data } = response
|
const user = sessionStorage.getItem('user');
|
||||||
// if (!data) {
|
const auths = sessionStorage.getItem('auths');
|
||||||
// reject('Verification failed, please Login again.')
|
const userType = sessionStorage.getItem('userType');
|
||||||
// }
|
const orgType = sessionStorage.getItem('orgType');
|
||||||
// const { roles, name, avatar, introduction } = data
|
|
||||||
// // roles must be a non-empty array
|
if (user) {
|
||||||
// if (!roles || roles.length <= 0) {
|
commit("SET_USER", user);
|
||||||
// reject('getInfo: roles must be a non-null array!')
|
}
|
||||||
// }
|
if (auths) {
|
||||||
// commit('SET_ROLES', roles)
|
commit("SET_AUTHS", JSON.parse(auths));
|
||||||
// commit('SET_NAME', name)
|
}
|
||||||
// commit('SET_AVATAR', avatar)
|
if (userType) {
|
||||||
// commit('SET_INTRODUCTION', introduction)
|
commit("SET_USER_TYPE", userType);
|
||||||
// }).catch(error => {
|
}
|
||||||
// reject(error)
|
if (orgType) {
|
||||||
// })
|
commit("SET_ORG_TYPE", parseInt(orgType));
|
||||||
|
}
|
||||||
|
|
||||||
|
resolve({
|
||||||
|
user: state.user,
|
||||||
|
auths: state.auths,
|
||||||
|
userType: state.userType,
|
||||||
|
orgType: state.orgType
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// user logout
|
// user logout
|
||||||
logout({commit, state, dispatch}) {
|
logout({commit, state, dispatch}) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
logout(state.token)
|
// logout(state.token)
|
||||||
.then(() => {
|
// .then(() => {
|
||||||
commit("SET_TOKEN", "");
|
commit("SET_TOKEN", "");
|
||||||
commit("SET_ROLES", []);
|
commit("SET_ROLES", []);
|
||||||
commit("SET_USER_TYPE", ""); // 新增:清除用户类型
|
commit("SET_USER_TYPE", ""); // 新增:清除用户类型
|
||||||
|
commit("SET_ORG_TYPE", ""); // 新增:清除组织类型
|
||||||
|
commit("SET_USER", "");
|
||||||
|
commit("SET_AUTHS", []);
|
||||||
removeToken();
|
removeToken();
|
||||||
resetRouter();
|
resetRouter();
|
||||||
|
|
||||||
|
// 清除sessionStorage
|
||||||
|
sessionStorage.removeItem('user');
|
||||||
|
sessionStorage.removeItem('auths');
|
||||||
|
sessionStorage.removeItem('userType');
|
||||||
|
sessionStorage.removeItem('orgType');
|
||||||
|
sessionStorage.removeItem('mybalance');
|
||||||
|
|
||||||
// reset visited views and cached views
|
// reset visited views and cached views
|
||||||
// to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2485
|
// to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2485
|
||||||
dispatch("tagsView/delAllViews", null, {root: true});
|
dispatch("tagsView/delAllViews", null, {root: true});
|
||||||
|
|
||||||
resolve();
|
resolve();
|
||||||
})
|
// })
|
||||||
.catch((error) => {
|
// .catch((error) => {
|
||||||
reject(error);
|
// reject(error);
|
||||||
});
|
// });
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -167,7 +208,16 @@ const actions = {
|
|||||||
commit("SET_TOKEN", "");
|
commit("SET_TOKEN", "");
|
||||||
commit("SET_ROLES", []);
|
commit("SET_ROLES", []);
|
||||||
commit("SET_USER_TYPE", ""); // 新增:清除用户类型
|
commit("SET_USER_TYPE", ""); // 新增:清除用户类型
|
||||||
|
commit("SET_ORG_TYPE", ""); // 新增:清除组织类型
|
||||||
|
commit("SET_USER", "");
|
||||||
|
commit("SET_AUTHS", []);
|
||||||
removeToken();
|
removeToken();
|
||||||
|
|
||||||
|
// 清除sessionStorage
|
||||||
|
sessionStorage.removeItem('user');
|
||||||
|
sessionStorage.removeItem('auths');
|
||||||
|
sessionStorage.removeItem('userType');
|
||||||
|
sessionStorage.removeItem('orgType');
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -200,4 +250,5 @@ export default {
|
|||||||
state,
|
state,
|
||||||
mutations,
|
mutations,
|
||||||
actions,
|
actions,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
// / base color
|
// variables.scss
|
||||||
|
// base color
|
||||||
$blue: #324157;
|
$blue: #324157;
|
||||||
$light-blue: #3A71A8;
|
$light-blue: #3A71A8;
|
||||||
$red: #C03639;
|
$red: #C03639;
|
||||||
@ -9,22 +10,17 @@ $yellow: #FEC171;
|
|||||||
$panGreen: #30B08F;
|
$panGreen: #30B08F;
|
||||||
|
|
||||||
// sidebar
|
// sidebar
|
||||||
$menuText: #000;
|
$menuText: #333;
|
||||||
$menuActiveText: #296ad9; // 当前激活菜单项的文字颜色
|
$menuActiveText: #296ad9;
|
||||||
$subMenuActiveText: #100101; // 当前激活子菜单项的文字颜色
|
$subMenuActiveText: #000;
|
||||||
|
|
||||||
$menuBg: #fff; // 整体背景颜色
|
$menuBg: #fff;
|
||||||
$menuHover: #f0f0f0; // 鼠标悬浮一级菜单背景色 (轻微变化更友好)
|
$menuHover: #f5f7fa;
|
||||||
$subMenuBg: #f7f7f7; // 子菜单背景色
|
$subMenuBg: #fff;
|
||||||
$subMenuHover: #eaeaea; // 鼠标悬浮子菜单背景色 (轻微变化更友好)
|
$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 {
|
:export {
|
||||||
menuText: $menuText;
|
menuText: $menuText;
|
||||||
menuActiveText: $menuActiveText;
|
menuActiveText: $menuActiveText;
|
||||||
@ -34,9 +30,4 @@ $sideBarWidth: 230px; // 侧边栏宽度
|
|||||||
subMenuBg: $subMenuBg;
|
subMenuBg: $subMenuBg;
|
||||||
subMenuHover: $subMenuHover;
|
subMenuHover: $subMenuHover;
|
||||||
sideBarWidth: $sideBarWidth;
|
sideBarWidth: $sideBarWidth;
|
||||||
// sideBarCollapseWidth: $sideBarCollapseWidth;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -554,7 +554,7 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss" scope>
|
<style lang="scss" scope>
|
||||||
.myOranization {
|
.myOranization {
|
||||||
height: 81vh;
|
height: 86vh;
|
||||||
|
|
||||||
.oranizationInfo {
|
.oranizationInfo {
|
||||||
// height: 2rem;
|
// height: 2rem;
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="8" style="overflow-x: auto;min-width: 100px;" class="treeCard">
|
<el-col :span="8" style="overflow-x: auto;min-width: 100px;" class="treeCard">
|
||||||
<el-card class="left" style="font-size: 14px;overflow-x: auto!important;padding: 0!important;min-width: 200px;">
|
<el-card class="left" style="font-size: 14px;overflow-x: auto!important;padding: 0!important;min-width: 200px;">
|
||||||
<el-button type="primary" size="small" v-if="treeData.length==[]" @click="addDepartment()">请添加部门</el-button>
|
<el-button type="primary" size="small" v-if="treeData.length==[]" @click="addDepartment()" style="margin-left: 14px;margin-top: 14px;">请添加部门</el-button>
|
||||||
<Tree id="tree" style="overflow-x: auto!important; height: calc(100vh - 106px);" v-else ref="tree" node-key="id" :tree-data="treeData" :add-form-arr="addFormArr" :add-form="addForm" @treeDelChange="treeDelChange" :default-props="defaultProps" :default-expand-all="true" :is-add-del="true" @treeSubmitChange="treeSubmitChange" @treeUpdateChange="treeUpdateChange" @treeEditChange="treeEditChange"></Tree>
|
<Tree id="tree" style="overflow-x: auto!important; height: calc(100vh - 106px);" v-else ref="tree" node-key="id" :tree-data="treeData" :add-form-arr="addFormArr" :add-form="addForm" @treeDelChange="treeDelChange" :default-props="defaultProps" :default-expand-all="true" :is-add-del="true" @treeSubmitChange="treeSubmitChange" @treeUpdateChange="treeUpdateChange" @treeEditChange="treeEditChange"></Tree>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -353,15 +353,15 @@ export default {
|
|||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
.departmentManagement {
|
.departmentManagement {
|
||||||
height: 85vh;
|
height: 90vh;
|
||||||
.left {
|
.left {
|
||||||
height: 85vh;
|
height:90vh;
|
||||||
}
|
}
|
||||||
.right {
|
.right {
|
||||||
.button{
|
.button{
|
||||||
display:flex;
|
display:flex;
|
||||||
}
|
}
|
||||||
height: 85vh;
|
height: 90vh;
|
||||||
.userdeparment {
|
.userdeparment {
|
||||||
// font-size: 18px;
|
// font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,7 +37,7 @@
|
|||||||
{{ getOrderTypeConfig(businessOpFilter).text }}
|
{{ getOrderTypeConfig(businessOpFilter).text }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<el-tag v-if="orderStatusFilter" size="small" closable @close="clearOrderStatusFilter"
|
<el-tag v-if="orderStatusFilter" size="small" closable @close="clearOrderStatusFilter"
|
||||||
:type="orderStatusFilter === '1' ? 'success' : orderStatusFilter === '0' ? 'danger' : 'info'">
|
:type="orderStatusFilter === '1' ? 'success' : orderStatusFilter === '0' ? 'danger' : 'info'">
|
||||||
{{ getOrderStatusText(orderStatusFilter) }}
|
{{ getOrderStatusText(orderStatusFilter) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</div>
|
</div>
|
||||||
@ -49,12 +49,8 @@
|
|||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<div class="mobile-filter">
|
<div class="mobile-filter">
|
||||||
<span class="filter-label">类型:</span>
|
<span class="filter-label">类型:</span>
|
||||||
<el-button
|
<el-button v-for="(config, type) in orderTypes" :key="type" size="mini"
|
||||||
v-for="(config, type) in orderTypes"
|
:type="businessOpFilter === type ? config.buttonType : ''" @click="handleBusinessOpFilter(type)">
|
||||||
:key="type"
|
|
||||||
size="mini"
|
|
||||||
:type="businessOpFilter === type ? config.buttonType : ''"
|
|
||||||
@click="handleBusinessOpFilter(type)">
|
|
||||||
{{ config.text }}
|
{{ config.text }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -66,10 +62,7 @@
|
|||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<div class="mobile-filter">
|
<div class="mobile-filter">
|
||||||
<span class="filter-label">状态:</span>
|
<span class="filter-label">状态:</span>
|
||||||
<el-button
|
<el-button v-for="status in orderStatuses" :key="status.value" size="mini"
|
||||||
v-for="status in orderStatuses"
|
|
||||||
:key="status.value"
|
|
||||||
size="mini"
|
|
||||||
:type="orderStatusFilter === status.value ? status.buttonType : ''"
|
:type="orderStatusFilter === status.value ? status.buttonType : ''"
|
||||||
@click="handleOrderStatusFilter(status.value)">
|
@click="handleOrderStatusFilter(status.value)">
|
||||||
{{ status.text }}
|
{{ status.text }}
|
||||||
@ -88,66 +81,65 @@
|
|||||||
|
|
||||||
<!-- PC端头部 -->
|
<!-- PC端头部 -->
|
||||||
<el-card class="pcCard" v-else>
|
<el-card class="pcCard" v-else>
|
||||||
<div class="header-container">
|
<!-- 头 -->
|
||||||
<div class="search-group">
|
<div class="top">
|
||||||
<el-select v-model="select" filterable @change="selectSearch" class="search-select" placeholder="请选择"
|
<div class="header-container">
|
||||||
size="small" style="width: 100px">
|
<div class="search-group">
|
||||||
<el-option label="订单号" value="id" />
|
<el-select v-model="select" filterable @change="selectSearch" class="search-select" placeholder="请选择"
|
||||||
<el-option label="订单日期" value="order_date" />
|
size="small" style="width: 100px">
|
||||||
<!-- <el-option label="订单状态:未支付" value="0" />
|
<el-option label="订单号" value="id" />
|
||||||
<el-option label="订单状态:已支付" value="1" />
|
<el-option label="订单日期" value="order_date" />
|
||||||
<el-option label="订单状态:已取消" value="3" /> -->
|
</el-select>
|
||||||
</el-select>
|
|
||||||
|
|
||||||
<el-input size="small" v-show="select == 'id'" placeholder="请输入内容" class="search-input" @input="input"
|
<el-input size="small" v-show="select == 'id'" placeholder="请输入内容" class="search-input" @input="input"
|
||||||
v-model="searchValue" clearable style="width: 180px; margin-left: 10px">
|
v-model="searchValue" clearable style="width: 180px; margin-left: 10px">
|
||||||
</el-input>
|
</el-input>
|
||||||
|
|
||||||
<div v-if="select == 'order_date'" class="date-picker-container">
|
<div v-if="select == 'order_date'" class="date-picker-container">
|
||||||
<el-date-picker size="small" @change="change" v-model="value1" type="daterange" range-separator="至"
|
<el-date-picker size="small" @change="change" v-model="value1" type="daterange" range-separator="至"
|
||||||
start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd"
|
start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd"
|
||||||
style="width: 240px; margin-left: 10px">
|
style="width: 240px; margin-left: 10px">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 筛选状态显示 -->
|
|
||||||
<div v-if="hasActiveFilters" class="filter-status-pc">
|
|
||||||
<span class="filter-label">当前筛选: </span>
|
|
||||||
<el-tag v-if="businessOpFilter" size="small" closable @close="clearBusinessOpFilter">
|
|
||||||
{{ getOrderTypeConfig(businessOpFilter).text }}
|
|
||||||
</el-tag>
|
|
||||||
<el-tag v-if="orderStatusFilter" size="small" closable @close="clearOrderStatusFilter"
|
|
||||||
:type="orderStatusFilter === '1' ? 'success' : orderStatusFilter === '0' ? 'danger' : 'info'">
|
|
||||||
{{ getOrderStatusText(orderStatusFilter) }}
|
|
||||||
</el-tag>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="stats-group">
|
|
||||||
<div class="stat-item">
|
|
||||||
<span class="stat-label">累计支付总金额:</span>
|
|
||||||
<div class="stat-value">
|
|
||||||
<el-skeleton animated v-if="all_price_show" :rows="1" style="width: 80px" />
|
|
||||||
<span v-else class="price-text">¥ {{ all_price || '0.00' }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-item">
|
|
||||||
<span class="stat-label">累计优惠总金额:</span>
|
<!-- 筛选状态显示 -->
|
||||||
<div class="stat-value">
|
<div v-if="hasActiveFilters" class="filter-status-pc">
|
||||||
<el-skeleton animated v-if="all_price_show" :rows="1" style="width: 80px" />
|
<span class="filter-label">当前筛选: </span>
|
||||||
<span v-else class="price-text">¥ {{ all_discount || '0.00' }}</span>
|
<el-tag v-if="businessOpFilter" size="small" closable @close="clearBusinessOpFilter">
|
||||||
|
{{ getOrderTypeConfig(businessOpFilter).text }}
|
||||||
|
</el-tag>
|
||||||
|
<el-tag v-if="orderStatusFilter" size="small" closable @close="clearOrderStatusFilter"
|
||||||
|
:type="orderStatusFilter === '1' ? 'success' : orderStatusFilter === '0' ? 'danger' : 'info'">
|
||||||
|
{{ getOrderStatusText(orderStatusFilter) }}
|
||||||
|
</el-tag>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="stats-group">
|
||||||
|
<div class="stat-item">
|
||||||
|
<span class="stat-label">累计支付总金额:</span>
|
||||||
|
<div class="stat-value">
|
||||||
|
<el-skeleton animated v-if="all_price_show" :rows="1" style="width: 80px" />
|
||||||
|
<span v-else class="price-text">¥ {{ all_price || '0.00' }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="stat-item">
|
||||||
|
<span class="stat-label">累计优惠总金额:</span>
|
||||||
|
<div class="stat-value">
|
||||||
|
<el-skeleton animated v-if="all_price_show" :rows="1" style="width: 80px" />
|
||||||
|
<span v-else class="price-text">¥ {{ all_discount || '0.00' }}</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 底部 -->
|
||||||
|
<div class="btm">
|
||||||
<!-- 类型筛选 -->
|
<!-- 类型筛选 -->
|
||||||
<div class="type-filter">
|
<div class="type-filter">
|
||||||
<span>订单类型筛选:</span>
|
<span>订单类型筛选:</span>
|
||||||
<el-button
|
<el-button v-for="(config, type) in orderTypes" :key="type"
|
||||||
v-for="(config, type) in orderTypes"
|
:type="businessOpFilter === type ? config.buttonType : ''" @click="handleBusinessOpFilter(type)">
|
||||||
:key="type"
|
|
||||||
:type="businessOpFilter === type ? config.buttonType : ''"
|
|
||||||
@click="handleBusinessOpFilter(type)">
|
|
||||||
{{ config.text }}
|
{{ config.text }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -155,9 +147,7 @@
|
|||||||
<!-- 状态筛选 -->
|
<!-- 状态筛选 -->
|
||||||
<div class="status-filter">
|
<div class="status-filter">
|
||||||
<span>订单状态筛选:</span>
|
<span>订单状态筛选:</span>
|
||||||
<el-button
|
<el-button v-for="status in orderStatuses" :key="status.value"
|
||||||
v-for="status in orderStatuses"
|
|
||||||
:key="status.value"
|
|
||||||
:type="orderStatusFilter === status.value ? status.buttonType : ''"
|
:type="orderStatusFilter === status.value ? status.buttonType : ''"
|
||||||
@click="handleOrderStatusFilter(status.value)">
|
@click="handleOrderStatusFilter(status.value)">
|
||||||
{{ status.text }}
|
{{ status.text }}
|
||||||
@ -176,51 +166,70 @@
|
|||||||
|
|
||||||
<!-- 表格部分 -->
|
<!-- 表格部分 -->
|
||||||
<el-card class="orderList">
|
<el-card class="orderList">
|
||||||
<el-table border :data="tableData" class="table" height="calc(100vh - 264px)" v-loading="all_price_show">
|
<div class="table-box" >
|
||||||
<el-table-column label="序号" width="180">
|
<el-table border :data="tableData" class="table" height="64vh" width="100%" v-loading="all_price_show">
|
||||||
<template slot-scope="scope">
|
<el-table-column label="序号" width="120" align="center" header-align="center">
|
||||||
{{ (pagination.page - 1) * pagination.size + scope.$index + 1 }}
|
<template slot-scope="scope">
|
||||||
</template>
|
<div class="cell-content">{{ (pagination.page - 1) * pagination.size + scope.$index + 1 }}</div>
|
||||||
</el-table-column>
|
</template>
|
||||||
<el-table-column align="center" min-width="180" header-align="center" prop="product_name" label="产品名称">
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column align="center" header-align="center" prop="product_name" label="产品名称" width="200" show-overflow-tooltip>
|
||||||
<el-table-column align="center" min-width="180" header-align="center" prop="id" label="订单号"></el-table-column>
|
<template slot-scope="scope">
|
||||||
<el-table-column align="center" header-align="center" label="订单原价" prop="list_price">
|
<div class="cell-content">{{ scope.row.product_name }}</div>
|
||||||
<template slot-scope="scope">
|
</template>
|
||||||
¥{{ scope.row.list_price }}
|
</el-table-column>
|
||||||
</template>
|
<el-table-column align="center" header-align="center" prop="id" label="订单号" show-overflow-tooltip>
|
||||||
</el-table-column>
|
<template slot-scope="scope">
|
||||||
<el-table-column align="center" header-align="center" label="订单折后价">
|
<div class="cell-content">{{ scope.row.id }}</div>
|
||||||
<template slot-scope="scope">
|
</template>
|
||||||
{{ scope.row.amount ? "¥" + scope.row.amount : "-" }}
|
</el-table-column>
|
||||||
</template>
|
<el-table-column align="center" header-align="center" label="订单原价" width="140">
|
||||||
</el-table-column>
|
<template slot-scope="scope">
|
||||||
<el-table-column align="center" header-align="center" label="订单类型">
|
<div class="cell-content">¥{{ scope.row.list_price }}</div>
|
||||||
<template slot-scope="scope">
|
</template>
|
||||||
<el-tag :style="{ padding: '0 8px' }" :type="getOrderTypeConfig(scope.row.business_op).type">
|
</el-table-column>
|
||||||
{{ getOrderTypeConfig(scope.row.business_op).text }}
|
<el-table-column align="center" header-align="center" label="订单折后价" width="140">
|
||||||
</el-tag>
|
<template slot-scope="scope">
|
||||||
</template>
|
<div class="cell-content">{{ scope.row.amount ? "¥" + scope.row.amount : "-" }}</div>
|
||||||
</el-table-column>
|
</template>
|
||||||
<el-table-column align="center" header-align="center" label="订单状态">
|
</el-table-column>
|
||||||
<template slot-scope="scope">
|
<el-table-column align="center" header-align="center" label="订单类型" width="120">
|
||||||
<el-tag :style="{ padding: '0 5px' }" :type="getOrderStatusConfig(scope.row.order_status).tagType" effect="dark">
|
<template slot-scope="scope">
|
||||||
{{ getOrderStatusConfig(scope.row.order_status).text }}
|
<div class="cell-content">
|
||||||
</el-tag>
|
<el-tag :type="getOrderTypeConfig(scope.row.business_op).type">
|
||||||
</template>
|
{{ getOrderTypeConfig(scope.row.business_op).text }}
|
||||||
</el-table-column>
|
</el-tag>
|
||||||
<el-table-column align="center" header-align="center" prop="order_date" label="订单日期"></el-table-column>
|
</div>
|
||||||
<el-table-column align="center" header-align="center" label="操作">
|
</template>
|
||||||
<template slot-scope="scope">
|
</el-table-column>
|
||||||
<el-button size="small" v-if="scope.row.order_status === '0'" type="primary"
|
<el-table-column align="center" header-align="center" label="订单状态" width="120">
|
||||||
@click="orderDetails(scope.row)" style="padding: 8px 15px">去支付
|
<template slot-scope="scope">
|
||||||
</el-button>
|
<div class="cell-content">
|
||||||
<el-button size="small" v-else type="primary" @click="orderDetails(scope.row)" style="padding: 8px">
|
<el-tag :type="getOrderStatusConfig(scope.row.order_status).tagType" effect="dark">
|
||||||
查看详情
|
{{ getOrderStatusConfig(scope.row.order_status).text }}
|
||||||
</el-button>
|
</el-tag>
|
||||||
</template>
|
</div>
|
||||||
</el-table-column>
|
</template>
|
||||||
</el-table>
|
</el-table-column>
|
||||||
|
<el-table-column align="center" header-align="center" label="订单日期" width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div class="cell-content">{{ formatOrderDate(scope.row.order_date) }}</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" header-align="center" label="操作" width="140">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div class="cell-content">
|
||||||
|
<el-button size="small" v-if="scope.row.order_status === '0'" type="primary"
|
||||||
|
@click="orderDetails(scope.row)">去支付
|
||||||
|
</el-button>
|
||||||
|
<el-button size="small" v-else type="primary" @click="orderDetails(scope.row)" style="line-height: 0;">
|
||||||
|
查看详情
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 分页 -->
|
<!-- 分页 -->
|
||||||
<div class="page">
|
<div class="page">
|
||||||
@ -330,6 +339,40 @@ export default {
|
|||||||
this.isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(this.userAgent);
|
this.isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(this.userAgent);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 格式化订单日期为 XXXX-XX-XX 格式
|
||||||
|
formatOrderDate(dateString) {
|
||||||
|
if (!dateString) return '-';
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 处理各种可能的日期格式
|
||||||
|
const date = new Date(dateString);
|
||||||
|
if (isNaN(date.getTime())) {
|
||||||
|
// 如果 Date 解析失败,尝试直接处理字符串
|
||||||
|
if (typeof dateString === 'string') {
|
||||||
|
// 移除可能的时间部分
|
||||||
|
const datePart = dateString.split(' ')[0];
|
||||||
|
const parts = datePart.split('-');
|
||||||
|
if (parts.length === 3) {
|
||||||
|
const year = parts[0];
|
||||||
|
const month = parts[1].padStart(2, '0');
|
||||||
|
const day = parts[2].padStart(2, '0');
|
||||||
|
return `${year}-${month}-${day}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return dateString; // 如果无法处理,返回原字符串
|
||||||
|
}
|
||||||
|
|
||||||
|
// 标准日期格式化
|
||||||
|
const year = date.getFullYear().toString();
|
||||||
|
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||||
|
const day = date.getDate().toString().padStart(2, '0');
|
||||||
|
return `${year}-${month}-${day}`;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('日期格式化错误:', error, dateString);
|
||||||
|
return dateString; // 出错时返回原字符串
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 获取订单类型配置
|
// 获取订单类型配置
|
||||||
getOrderTypeConfig(type) {
|
getOrderTypeConfig(type) {
|
||||||
return this.orderTypes[type] || { text: "-", type: "primary", buttonType: "" };
|
return this.orderTypes[type] || { text: "-", type: "primary", buttonType: "" };
|
||||||
@ -620,7 +663,47 @@ export default {
|
|||||||
// PC端优化样式
|
// PC端优化样式
|
||||||
.pcCard {
|
.pcCard {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
.btm{
|
||||||
|
display: flex;
|
||||||
|
margin-top: 10px;
|
||||||
|
.type-filter{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
span {
|
||||||
|
margin-right: 8px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #606266;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-button {
|
||||||
|
margin-right: 5px;
|
||||||
|
padding: 7px 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.status-filter {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-left: 20px;
|
||||||
|
|
||||||
|
span {
|
||||||
|
margin-right: 8px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #606266;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-button {
|
||||||
|
margin-right: 5px;
|
||||||
|
padding: 7px 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.reset {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
.header-container {
|
.header-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -672,6 +755,7 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
|
|
||||||
.stat-label {
|
.stat-label {
|
||||||
color: #606266;
|
color: #606266;
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
@ -689,35 +773,12 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.type-filter, .status-filter {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
margin-left: 20px;
|
|
||||||
|
|
||||||
span {
|
|
||||||
margin-right: 8px;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #606266;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-button {
|
|
||||||
margin-right: 5px;
|
|
||||||
padding: 7px 12px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.reset {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.orderList {
|
.orderList {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
height: calc(100vh - 180px);
|
height: calc(100vh - 214px);
|
||||||
|
|
||||||
.table {
|
.table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -739,6 +800,43 @@ export default {
|
|||||||
padding: 0 8px !important;
|
padding: 0 8px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 表格行高调整
|
||||||
|
::v-deep .el-table {
|
||||||
|
.el-table__row {
|
||||||
|
width: 100%;
|
||||||
|
height: 56px; // 增加行高
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-table__cell {
|
||||||
|
padding: 12px 0; // 增加单元格内边距
|
||||||
|
}
|
||||||
|
|
||||||
|
.cell-content {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100%;
|
||||||
|
min-height: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-button {
|
||||||
|
height: 32px;
|
||||||
|
// line-height: 32px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 表头样式调整
|
||||||
|
::v-deep .el-table .el-table__header-wrapper {
|
||||||
|
.el-table__cell {
|
||||||
|
padding: 16px 0;
|
||||||
|
background-color: #d0cff8;
|
||||||
|
.cell {
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 响应式调整
|
// 响应式调整
|
||||||
@media screen and (max-width: 1200px) {
|
@media screen and (max-width: 1200px) {
|
||||||
.pcCard .header-container {
|
.pcCard .header-container {
|
||||||
|
|||||||
@ -42,7 +42,7 @@
|
|||||||
<i class="el-icon-upload2"></i> 全部导出
|
<i class="el-icon-upload2"></i> 全部导出
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-table size="large" border height="calc(100vh - 210px)" v-loading="loading" :data="tableData"
|
<el-table size="large" border height="calc(100vh - 250px)" v-loading="loading" :data="tableData"
|
||||||
style="width: 100%;border:1px solid #ccc;" element-loading-text="加载中..."
|
style="width: 100%;border:1px solid #ccc;" element-loading-text="加载中..."
|
||||||
element-loading-spinner="el-icon-loading" element-loading-background="rgba(255, 255, 255, 0.8)">
|
element-loading-spinner="el-icon-loading" element-loading-background="rgba(255, 255, 255, 0.8)">
|
||||||
<el-table-column v-if="searchData.radioType!='1'&&searchData.radioType!='3'" prop="date" label="图片" width="180">
|
<el-table-column v-if="searchData.radioType!='1'&&searchData.radioType!='3'" prop="date" label="图片" width="180">
|
||||||
@ -107,7 +107,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination style="background-color: white;" @size-change="handleSizeChange"
|
<el-pagination class="pageBox" @size-change="handleSizeChange"
|
||||||
@current-change="handleCurrentChange" :current-page.sync="current_page" :page-size="page_size"
|
@current-change="handleCurrentChange" :current-page.sync="current_page" :page-size="page_size"
|
||||||
layout="total, prev, pager, next" :total="total_count">
|
layout="total, prev, pager, next" :total="total_count">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
@ -567,7 +567,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.table-box {
|
.table-box {
|
||||||
height: calc(100vh - 120px);
|
height: calc(100vh - 150px);
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
|
|
||||||
@ -602,4 +602,9 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
.pageBox{
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,24 +1,28 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="top-nav">
|
<div class="top-nav">
|
||||||
<!-- 顶部容器,根据homePath决定布局样式 -->
|
<!-- 顶部容器 -->
|
||||||
<div id="topContainer" class="container" :class="{ 'ncmatch-layout': homePath === '/ncmatchHome/index' }">
|
<div id="topContainer" class="container">
|
||||||
<!-- 当homePath不等于/ncmatchHome/index时显示logo和导航 -->
|
<!-- 统一显示logo和导航 -->
|
||||||
<div class="logo" v-if="homePath !== '/ncmatchHome/index'">
|
<div class="logo">
|
||||||
<!-- Logo图片,点击跳转首页 -->
|
<!-- Logo图片,点击跳转首页 -->
|
||||||
<img v-if="JSON.stringify(logoInfoNew) !== '{}'" @click="$router.push(homePath)" style="cursor:pointer;"
|
<img v-if="JSON.stringify(logoInfoNew) !== '{}'" @click="$router.push(homePath)" style="cursor:pointer;"
|
||||||
class="logoImg" :src="logoInfoNew.home.logoImg || ''" alt="">
|
class="logoImg" :src="logoInfoNew.home.logoImg || ''" alt="">
|
||||||
|
|
||||||
<!-- 主导航菜单 -->
|
<!-- 主导航菜单 -->
|
||||||
<nav class="main-nav" v-if="!isNcmatchHome">
|
<nav class="main-nav">
|
||||||
<div class="nav-list">
|
<div class="nav-list">
|
||||||
<!-- 首页 -->
|
<!-- 首页 -->
|
||||||
<p :class="{ active: $route.path.includes('/index') }">
|
<p :class="{ active: $route.path.includes('/index') }">
|
||||||
<a @click="$router.push(homePath)">{{ translations[language].home }}</a>
|
<a @click="$router.push('/homePage/index')">{{ translations[language].home }}</a>
|
||||||
</p>
|
</p>
|
||||||
<!-- 产品与服务:鼠标移入显示子菜单 -->
|
<!-- 产品与服务:鼠标移入显示子菜单 -->
|
||||||
<p @mouseleave="sildeOut" @mouseenter="sildeIn(product_service)">
|
<p @mouseleave="sildeOut" @mouseenter="sildeIn(product_service)">
|
||||||
<a>{{ translations[language].ecosystem }}</a>
|
<a>{{ translations[language].ecosystem }}</a>
|
||||||
</p>
|
</p>
|
||||||
|
<!-- 供需广场 -->
|
||||||
|
<p :class="{ active: $route.path.includes('/supply') }">
|
||||||
|
<a @click="$router.push('/ncmatchHome/supplyAndDemandSquare')">{{ translations[language].supply }}</a>
|
||||||
|
</p>
|
||||||
<!-- 关于我们 -->
|
<!-- 关于我们 -->
|
||||||
<p :class="{ active: $route.path.includes('/about') }" @mouseleave="sildeOut"
|
<p :class="{ active: $route.path.includes('/about') }" @mouseleave="sildeOut"
|
||||||
@click="$router.push('/homePage/about')">
|
@click="$router.push('/homePage/about')">
|
||||||
@ -28,93 +32,21 @@
|
|||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 当homePath等于/ncmatchHome/index时的布局 -->
|
|
||||||
<div class="logo" v-else>
|
|
||||||
<!-- 登录状态下,左侧显示用户信息下拉菜单 -->
|
|
||||||
<el-dropdown v-if="loginState" @visible-change="handleShow"
|
|
||||||
class="avatar-container left-menu-item hover-effect nick-name-style" style="margin-right: 0" trigger="click">
|
|
||||||
<div class="avatar-wrapper">
|
|
||||||
<!-- 显示用户名首字母头像和用户名 -->
|
|
||||||
<i
|
|
||||||
style="font-size: 18px; color: #262626;font-weight: 400;cursor: pointer;display: flex;justify-content: flex-start;align-items: center">
|
|
||||||
<div class="imgUser">{{ nick_name.charAt(0) }}</div>
|
|
||||||
{{ nick_name }}
|
|
||||||
<!-- 下拉箭头图标 -->
|
|
||||||
<i id="resverIcon" class="el-icon-arrow-up el-icon--right resverIcon"></i>
|
|
||||||
</i>
|
|
||||||
</div>
|
|
||||||
<!-- 用户信息下拉菜单内容 -->
|
|
||||||
<el-dropdown-menu slot="dropdown" style="width: 230px;font-size: 16px;" divided>
|
|
||||||
<!-- 用户信息头部 -->
|
|
||||||
<div style="display: flex;flex-direction: column;padding:15px 15px;background-color: #f0f2f5">
|
|
||||||
<span style="font-weight: bold;font-size: 20px;margin-bottom: 5px;color: #333333">{{ nick_name }}</span>
|
|
||||||
<span style="font-size: 12px;color:#666;display: flex;justify-content:flex-start;align-items: center"> ID:
|
|
||||||
<!-- 用户ID,点击复制按钮可复制 -->
|
|
||||||
<span ref="contentToCopy">
|
|
||||||
{{
|
|
||||||
userId
|
|
||||||
}}
|
|
||||||
</span>
|
|
||||||
<!-- 复制按钮 -->
|
|
||||||
<svg @click="copyBtn" class="copy-btn" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
width="12" height="12" style="fill: #1019ab;">
|
|
||||||
<path
|
|
||||||
d="M394.666667 106.666667h448a74.666667 74.666667 0 0 1 74.666666 74.666666v448a74.666667 74.666667 0 0 1-74.666666 74.666667H394.666667a74.666667 74.666667 0 0 1-74.666667-74.666667V181.333333a74.666667 74.666667 0 0 1 74.666667-74.666666z m0 64a10.666667 10.666667 0 0 0-10.666667 10.666666v448a10.666667 10.666667 0 0 0 10.666667 10.666667h448a10.666667 10.666667 0 0 0 10.666666-10.666667V181.333333a10.666667 10.666667 0 0 0-10.666666-10.666666H394.666667z m245.333333 597.333333a32 32 0 0 1 64 0v74.666667a74.666667 74.666667 0 0 1-74.666667 74.666666H181.333333a74.666667 74.666667 0 0 1-74.666666-74.666666V394.666667a74.666667 74.666667 0 0 1 74.666666-74.666667h74.666667a32 32 0 0 1 0 64h-74.666667a10.666667 10.666667 0 0 0-10.666666 10.666667v448a10.666667 10.666667 0 0 0 10.666666 10.666666h448a10.666667 10.666667 0 0 0 10.666667-10.666666v-74.666667z"
|
|
||||||
p-id="1521"></path>
|
|
||||||
</svg>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<!-- 分割线 -->
|
|
||||||
<el-divider style="margin: 0!important;"></el-divider>
|
|
||||||
<!-- 客户角色余额和充值按钮 -->
|
|
||||||
<div v-if="role.includes('客户')"
|
|
||||||
style="padding: 0 18px; width: 100%;height: 60px;display: flex;justify-content: space-between;align-items: center">
|
|
||||||
<span style="color:#666;display: block;font-size: 14px;" class="moneyNow"><span
|
|
||||||
style="display: block;margin-bottom: 5px">{{ translations[language].balance }}</span>{{
|
|
||||||
mybalance ? mybalance : initMybalance()
|
|
||||||
}} ¥</span>
|
|
||||||
<el-button v-if="!isShowKbossCharge" type="primary" @click="$router.push('/kbossCharge')" plain
|
|
||||||
style="padding: 8px; ">
|
|
||||||
{{ translations[language].recharge }}
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
<!-- 个人中心菜单项 -->
|
|
||||||
<el-dropdown-item v-if="role.includes('客户')" @click.native="$router.push('/customer/customerInformation')">
|
|
||||||
<span style="display: block">{{ translations[language].personalCenter }}</span>
|
|
||||||
</el-dropdown-item>
|
|
||||||
<!-- 退出登录菜单项 -->
|
|
||||||
<el-dropdown-item @click.native="logout">
|
|
||||||
<span style="display: block">{{ translations[language].logout }}</span>
|
|
||||||
</el-dropdown-item>
|
|
||||||
</el-dropdown-menu>
|
|
||||||
</el-dropdown>
|
|
||||||
|
|
||||||
<!-- 公司名称居中显示,点击跳转首页 -->
|
|
||||||
<div class="company-name" @click="$router.push(homePath)"
|
|
||||||
style="cursor:pointer;font-size: 24px;font-weight: bold;color: #222F60;margin: 0 auto;">
|
|
||||||
{{ (logoInfoNew.home && logoInfoNew.home.orgName) || '' }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 用户区域:登录/注册按钮和用户下拉菜单 -->
|
<!-- 用户区域:登录/注册按钮和用户下拉菜单 -->
|
||||||
<div class="user-area">
|
<div class="user-area">
|
||||||
<!-- 搜索框 -->
|
|
||||||
<div class="search-box">
|
|
||||||
<i class="el-icon-search"></i>
|
|
||||||
<input type="text" :placeholder="translations[language].searchPlaceholder">
|
|
||||||
</div>
|
|
||||||
<!-- 中英互译 -->
|
<!-- 中英互译 -->
|
||||||
<div class="language-toggle" @click="toggleLanguage">
|
<div class="language-toggle" @click="toggleLanguage">
|
||||||
<span class="language-text">{{ language === 'zh' ? 'English' : '中' }}</span>
|
<span class="iconfont icon-ditu_diqiu_o"></span>
|
||||||
|
<span class="language-text">{{ language === 'zh' ? 'English' : '中文' }}</span>
|
||||||
</div>
|
</div>
|
||||||
<!-- AI -->
|
<!-- AI -->
|
||||||
<i class="el-icon-s-promotion functions" @click="handleGoLogin()"></i>
|
<i class="iconfont icon-AIzhushou functions" @click="handleAIClick"></i>
|
||||||
<!-- 客服 -->
|
<!-- 客服 -->
|
||||||
<i class="el-icon-headset functions" @click="handleGoLogin()"></i>
|
<i class="iconfont icon-kefu functions" @click="handleServiceClick"></i>
|
||||||
<!-- 控制台按钮(已登录) -->
|
<!-- 控制台按钮(已登录) -->
|
||||||
<a @click="goB" v-if="loginState" class="login-btn">{{ translations[language].console }}</a>
|
<a @click="goB" v-if="loginState" class="login-btn">{{ translations[language].console }}</a>
|
||||||
<!-- 消息 -->
|
<!-- 消息 - 修改这里:点击时打开消息中心 -->
|
||||||
<i class="el-icon-message functions" @click="handleGoLogin()"></i>
|
<i class="iconfont icon-xiaoxi functions" @click="handleMessageClick"></i>
|
||||||
<!-- 登录按钮(未登录) -->
|
<!-- 登录按钮(未登录) -->
|
||||||
<a @click="$router.push({
|
<a @click="$router.push({
|
||||||
path: '/login',
|
path: '/login',
|
||||||
@ -126,14 +58,14 @@
|
|||||||
<a @click="$router.push('/registrationPage')" v-if="!loginState" class="register-btn">{{
|
<a @click="$router.push('/registrationPage')" v-if="!loginState" class="register-btn">{{
|
||||||
translations[language].register }}</a>
|
translations[language].register }}</a>
|
||||||
|
|
||||||
<!-- 用户下拉菜单(非ncmatchHome页面且已登录) -->
|
<!-- 用户下拉菜单(已登录) -->
|
||||||
<el-dropdown v-if="loginState && homePath !== '/ncmatchHome/index'" @visible-change="handleShow"
|
<el-dropdown v-if="loginState" @visible-change="handleShow"
|
||||||
class="avatar-container right-menu-item hover-effect nick-name-style" style="margin-right: 0" trigger="click">
|
class="avatar-container right-menu-item hover-effect nick-name-style" style="margin-right: 0" trigger="click">
|
||||||
<div class="avatar-wrapper">
|
<div class="avatar-wrapper">
|
||||||
<!-- 显示用户名首字母头像和用户名 -->
|
<!-- 显示用户名首字母头像和用户名 -->
|
||||||
<i
|
<i
|
||||||
style="font-size: 18px; color: #262626;font-weight: 400;cursor: pointer;display: flex;justify-content: flex-end;align-items: center">
|
style="font-size: 18px; color: #262626;font-weight: 400;cursor: pointer;display: flex;justify-content: flex-end;align-items: center">
|
||||||
<div class="imgUser"><img src="/static/img/user.png" alt=""></div>
|
<div class="imgUser"><img src="../../../../assets/image/user.png" alt=""></div>
|
||||||
{{ nick_name }}
|
{{ nick_name }}
|
||||||
<!-- 下拉箭头图标 -->
|
<!-- 下拉箭头图标 -->
|
||||||
<i id="resverIcon" class="el-icon-arrow-up el-icon--right resverIcon"></i>
|
<i id="resverIcon" class="el-icon-arrow-up el-icon--right resverIcon"></i>
|
||||||
@ -226,7 +158,8 @@
|
|||||||
v-if="secMenuData.length > 0 && secMenuData[0].thrMenu && secMenuData[0].thrMenu.length > 0 && secMenuData[0].thrMenu[0].thrTitle != null && secMenuData[0].secTitle !== secMenuData[0].thrMenu[0].thrTitle"
|
v-if="secMenuData.length > 0 && secMenuData[0].thrMenu && secMenuData[0].thrMenu.length > 0 && secMenuData[0].thrMenu[0].thrTitle != null && secMenuData[0].secTitle !== secMenuData[0].thrMenu[0].thrTitle"
|
||||||
class="ge"></span>
|
class="ge"></span>
|
||||||
<!-- 右侧面板:最细粒度的菜单项 -->
|
<!-- 右侧面板:最细粒度的菜单项 -->
|
||||||
<div class="panelRight" v-if="showPanelRightData.length > 0 && showPanelRightData[0] && showPanelRightData[0].value">
|
<div class="panelRight"
|
||||||
|
v-if="showPanelRightData.length > 0 && showPanelRightData[0] && showPanelRightData[0].value">
|
||||||
<ul class="leastMenu inBox">
|
<ul class="leastMenu inBox">
|
||||||
<li class="clickItem" style="font-size: 14px!important;margin: 8px 0;cursor: pointer"
|
<li class="clickItem" style="font-size: 14px!important;margin: 8px 0;cursor: pointer"
|
||||||
v-for="itemR in showPanelRightData[0].value" :key="itemR.id" @click="clickGo(itemR)">
|
v-for="itemR in showPanelRightData[0].value" :key="itemR.id" @click="clickGo(itemR)">
|
||||||
@ -235,7 +168,7 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<!-- 修复:当没有数据时显示空状态 -->
|
<!-- 当没有数据时显示空状态 -->
|
||||||
<div class="panelRight" v-else>
|
<div class="panelRight" v-else>
|
||||||
<div style="text-align: center; color: #999; padding: 20px;">
|
<div style="text-align: center; color: #999; padding: 20px;">
|
||||||
{{ translations[language].noData }}
|
{{ translations[language].noData }}
|
||||||
@ -243,6 +176,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 消息中心组件 -->
|
||||||
|
<message-center
|
||||||
|
ref="messageCenter"
|
||||||
|
:visible.sync="messageCenterVisible"
|
||||||
|
:userId="userId"
|
||||||
|
@unread-count-update="handleUnreadCountUpdate"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -264,10 +205,17 @@ import { getHomePath } from '@/views/setting/tools'
|
|||||||
// 导入语言管理
|
// 导入语言管理
|
||||||
import { languageStore, languageBus } from '@/utils/language'
|
import { languageStore, languageBus } from '@/utils/language'
|
||||||
|
|
||||||
|
// 导入消息中心组件
|
||||||
|
import MessageCenter from '@/components/MessageCenter/MessageCenter.vue'
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
name: "TopBox",
|
name: "TopBox",
|
||||||
|
components: {
|
||||||
|
MessageCenter
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
messageCenterVisible: false, // 控制消息中心显示
|
||||||
homePath: getHomePath(), // 首页路径
|
homePath: getHomePath(), // 首页路径
|
||||||
isShowKbossCharge: false, // 是否显示Kboss充值按钮
|
isShowKbossCharge: false, // 是否显示Kboss充值按钮
|
||||||
role: sessionStorage.getItem("jueseNew") == "admin" ? [] : sessionStorage.getItem("jueseNew"), // 用户角色
|
role: sessionStorage.getItem("jueseNew") == "admin" ? [] : sessionStorage.getItem("jueseNew"), // 用户角色
|
||||||
@ -285,10 +233,12 @@ export default Vue.extend({
|
|||||||
product_service: [], // 产品服务数据
|
product_service: [], // 产品服务数据
|
||||||
language: 'zh', // 默认设置为中文
|
language: 'zh', // 默认设置为中文
|
||||||
languageChangedHandler: null, // 语言变化事件处理器
|
languageChangedHandler: null, // 语言变化事件处理器
|
||||||
|
messageCount: 0, // 未读消息数量
|
||||||
translations: {
|
translations: {
|
||||||
zh: {
|
zh: {
|
||||||
home: '首页',
|
home: '首页',
|
||||||
ecosystem: '产品与服务',
|
ecosystem: '产品与服务',
|
||||||
|
supply: '供需广场',
|
||||||
aboutUs: '关于我们',
|
aboutUs: '关于我们',
|
||||||
balance: '余额',
|
balance: '余额',
|
||||||
recharge: '充值',
|
recharge: '充值',
|
||||||
@ -299,6 +249,9 @@ export default Vue.extend({
|
|||||||
login: '登录',
|
login: '登录',
|
||||||
register: '立即注册',
|
register: '立即注册',
|
||||||
noData: '暂无数据',
|
noData: '暂无数据',
|
||||||
|
aiAssistant: 'AI助手',
|
||||||
|
customerService: '在线客服',
|
||||||
|
featureComingSoon: '功能即将上线,敬请期待!',
|
||||||
// 一级菜单翻译
|
// 一级菜单翻译
|
||||||
'云': '云',
|
'云': '云',
|
||||||
'算': '算',
|
'算': '算',
|
||||||
@ -400,6 +353,7 @@ export default Vue.extend({
|
|||||||
en: {
|
en: {
|
||||||
home: 'Home',
|
home: 'Home',
|
||||||
ecosystem: 'Products & Services',
|
ecosystem: 'Products & Services',
|
||||||
|
supply: 'Supply',
|
||||||
aboutUs: 'About Us',
|
aboutUs: 'About Us',
|
||||||
balance: 'Balance',
|
balance: 'Balance',
|
||||||
recharge: 'Recharge',
|
recharge: 'Recharge',
|
||||||
@ -410,6 +364,9 @@ export default Vue.extend({
|
|||||||
login: 'Login',
|
login: 'Login',
|
||||||
register: 'Register Now',
|
register: 'Register Now',
|
||||||
noData: 'No Data',
|
noData: 'No Data',
|
||||||
|
aiAssistant: 'AI Assistant',
|
||||||
|
customerService: 'Customer Service',
|
||||||
|
featureComingSoon: 'Feature coming soon, stay tuned!',
|
||||||
// 一级菜单翻译
|
// 一级菜单翻译
|
||||||
'云': 'Cloud',
|
'云': 'Cloud',
|
||||||
'算': 'Computing',
|
'算': 'Computing',
|
||||||
@ -553,10 +510,6 @@ export default Vue.extend({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
// 判断当前是否为ncmatchHome页面
|
|
||||||
isNcmatchHome() {
|
|
||||||
return window.location.href.includes('ncmatchHome')
|
|
||||||
},
|
|
||||||
// 映射Vuex中的getters
|
// 映射Vuex中的getters
|
||||||
...mapGetters(["sidebar", "avatar", "device"]),
|
...mapGetters(["sidebar", "avatar", "device"]),
|
||||||
// 映射Vuex中的state
|
// 映射Vuex中的state
|
||||||
@ -587,6 +540,45 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
initLanguage() {
|
||||||
// 直接从store获取当前语言,确保一致性
|
// 直接从store获取当前语言,确保一致性
|
||||||
@ -713,7 +705,7 @@ export default Vue.extend({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 修改密码(未完全实现)
|
// 修改密码
|
||||||
edituserPassword() {
|
edituserPassword() {
|
||||||
this.passwordDialog = true;
|
this.passwordDialog = true;
|
||||||
},
|
},
|
||||||
@ -748,6 +740,8 @@ export default Vue.extend({
|
|||||||
|
|
||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
async getUserInfo() {
|
async getUserInfo() {
|
||||||
|
if (!this.userId) return;
|
||||||
|
|
||||||
getUserInfoAPI({ id: this.userId }).then((res) => {
|
getUserInfoAPI({ id: this.userId }).then((res) => {
|
||||||
if (res.status) {
|
if (res.status) {
|
||||||
// this.nick_name = res.data[0].nick_name;
|
// this.nick_name = res.data[0].nick_name;
|
||||||
@ -961,7 +955,7 @@ export default Vue.extend({
|
|||||||
this.showPanelRightData = this.threeData
|
this.showPanelRightData = this.threeData
|
||||||
},
|
},
|
||||||
|
|
||||||
// 返回测试数据(未使用)
|
// 返回测试数据
|
||||||
networkData() {
|
networkData() {
|
||||||
return networkData
|
return networkData
|
||||||
},
|
},
|
||||||
@ -1024,6 +1018,8 @@ export default Vue.extend({
|
|||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/login'
|
path: '/login'
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1045,9 +1041,6 @@ export default Vue.extend({
|
|||||||
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.08);
|
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.08);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
@ -1057,7 +1050,7 @@ export default Vue.extend({
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 10px 20px;
|
padding: 14px 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
@ -1123,15 +1116,22 @@ export default Vue.extend({
|
|||||||
|
|
||||||
.language-toggle {
|
.language-toggle {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin: 20px;
|
margin-right: 20px;
|
||||||
width: 60px;
|
// width: 60px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
transition: all 0.3s;
|
transition: all 0.3s;
|
||||||
color: #333;
|
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 {
|
&:hover {
|
||||||
color: #1E6FFF;
|
color: #1E6FFF;
|
||||||
@ -1171,8 +1171,15 @@ export default Vue.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-xiaoxi {
|
||||||
|
font-size: 24px !important;
|
||||||
|
}
|
||||||
|
|
||||||
.functions {
|
.functions {
|
||||||
padding-right: 20px;
|
padding-right: 20px;
|
||||||
|
font-size: 20px;
|
||||||
|
color: #000;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #1E6FFF;
|
color: #1E6FFF;
|
||||||
@ -1357,8 +1364,13 @@ export default Vue.extend({
|
|||||||
width: 30px;
|
width: 30px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background: #081020;
|
|
||||||
color: white;
|
color: white;
|
||||||
|
margin-right: 8px;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.company-name {
|
.company-name {
|
||||||
@ -1372,29 +1384,4 @@ export default Vue.extend({
|
|||||||
color: #1E6FFF;
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -811,6 +811,7 @@ export default Vue.extend({
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: auto !important;
|
overflow: auto !important;
|
||||||
min-width: 1500px;
|
min-width: 1500px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.banner {
|
.banner {
|
||||||
|
|||||||
@ -3,13 +3,9 @@
|
|||||||
|
|
||||||
<div style="margin-top: 25px;">
|
<div style="margin-top: 25px;">
|
||||||
<span style="margin-top: 100px;" class="title">
|
<span style="margin-top: 100px;" class="title">
|
||||||
|
|
||||||
<span class="leftText">
|
<span class="leftText">
|
||||||
算力供需
|
算力供需
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<span class="rightText"> 广场</span></span>
|
<span class="rightText"> 广场</span></span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -72,23 +72,36 @@
|
|||||||
<div class="price card">
|
<div class="price card">
|
||||||
<div class="title">账户余额</div>
|
<div class="title">账户余额</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<span class="balance">¥{{ initMybalance() }}</span>
|
<span class="balance">¥{{ this.mybalance }}</span>
|
||||||
<el-button size="mini" type="primary" @click="$router.push('/kbossCharge')">
|
<el-button size="mini" type="primary" @click="$router.push('/kbossCharge')">
|
||||||
立即充值
|
立即充值
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="announcements card">
|
<!-- 待办事项组件 -->
|
||||||
<div class="title">系统公告</div>
|
<div class="todos card">
|
||||||
<ul class="announcement-list">
|
<div class="title">待办事项</div>
|
||||||
<li v-for="i in 3" :key="i">
|
<ul class="todo-list">
|
||||||
<i class="el-icon-bell"></i>
|
<li
|
||||||
<span>这是第{{ i }}条系统公告内容...</span>
|
v-for="(item, index) in todoList"
|
||||||
|
:key="index"
|
||||||
|
class="todo-item"
|
||||||
|
@click="handleTodoClick(item.name)"
|
||||||
|
>
|
||||||
|
<span class="todo-name">{{ item.name }}</span>
|
||||||
|
<span class="todo-count">{{ item.count }}</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 消息中心弹窗 -->
|
||||||
|
<MessageCenter
|
||||||
|
ref="messageCenter"
|
||||||
|
:visible.sync="messageCenterVisible"
|
||||||
|
@unread-count-update="handleUnreadCountUpdate"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -96,9 +109,15 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import { mapState } from "vuex";
|
import { mapState } from "vuex";
|
||||||
import { reqNewHomeResource, reqNewHomeResourceWarning, reqQuickNav } from "@/api/newHome";
|
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({
|
export default Vue.extend({
|
||||||
name: "mainPage",
|
name: "mainPage",
|
||||||
|
components: {
|
||||||
|
MessageCenter
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableData: [],
|
tableData: [],
|
||||||
@ -109,10 +128,21 @@ export default Vue.extend({
|
|||||||
email: ""
|
email: ""
|
||||||
},
|
},
|
||||||
viewList: [],
|
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() {
|
mounted() {
|
||||||
reqQuickNav().then(res => {
|
reqQuickNav().then(res => {
|
||||||
this.navList = res.data
|
this.navList = res.data
|
||||||
@ -146,9 +176,53 @@ export default Vue.extend({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
initMybalance() {
|
async initMybalance() {
|
||||||
return sessionStorage.getItem('mybalance') || '0.00'
|
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: {
|
computed: {
|
||||||
...mapState({
|
...mapState({
|
||||||
@ -370,33 +444,44 @@ export default Vue.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.announcements {
|
/* 待办事项样式 */
|
||||||
.announcement-list {
|
.todos {
|
||||||
|
.todo-list {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
gap: 15px;
|
||||||
|
|
||||||
li {
|
.todo-item {
|
||||||
padding: 10px 0;
|
|
||||||
border-bottom: 1px solid #eee;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
align-items: center;
|
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 {
|
&:hover {
|
||||||
border-bottom: none;
|
transform: translateY(-3px);
|
||||||
|
box-shadow: 0 4px 12px rgba(64, 158, 255, 0.2);
|
||||||
|
border-color: #409eff;
|
||||||
}
|
}
|
||||||
|
|
||||||
i {
|
.todo-name {
|
||||||
color: #e6a23c;
|
font-size: 14px;
|
||||||
margin-right: 10px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
span {
|
|
||||||
color: #606266;
|
color: #606266;
|
||||||
overflow: hidden;
|
margin-bottom: 8px;
|
||||||
text-overflow: ellipsis;
|
}
|
||||||
white-space: nowrap;
|
|
||||||
|
.todo-count {
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #409eff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -440,9 +525,9 @@ export default Vue.extend({
|
|||||||
.overView {
|
.overView {
|
||||||
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.todo-list {
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -113,7 +113,9 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
|
|
||||||
|
<div class="table-box">
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="tableLoading"
|
v-loading="tableLoading"
|
||||||
:data="listData"
|
:data="listData"
|
||||||
@ -212,6 +214,7 @@
|
|||||||
|
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
|
class="paginationStyle"
|
||||||
layout="prev, pager, next"
|
layout="prev, pager, next"
|
||||||
@current-change="handleCurrentChange"
|
@current-change="handleCurrentChange"
|
||||||
:total="total">
|
:total="total">
|
||||||
@ -462,7 +465,7 @@ export default {
|
|||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.mainBox {
|
.mainBox {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
height: 100%;
|
height: 90vh;
|
||||||
background: white;
|
background: white;
|
||||||
|
|
||||||
.headerT {
|
.headerT {
|
||||||
@ -473,6 +476,8 @@ export default {
|
|||||||
|
|
||||||
.headerL {
|
.headerL {
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
|
padding-top: 20px;
|
||||||
|
padding-left: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.headerR {
|
.headerR {
|
||||||
@ -508,4 +513,11 @@ export default {
|
|||||||
//width: 24%;
|
//width: 24%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.table-box{
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
.paginationStyle{
|
||||||
|
text-align: center;
|
||||||
|
margin: 20px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -5,7 +5,8 @@ align="center" header-align="center"
|
|||||||
<div style="height: 50px;display: flex;justify-content: flex-start;align-items: center;padding-left: 10px">
|
<div style="height: 50px;display: flex;justify-content: flex-start;align-items: center;padding-left: 10px">
|
||||||
<el-button type="primary" @click="hpcLdapAddVisible()" size="small">新增超算账号</el-button>
|
<el-button type="primary" @click="hpcLdapAddVisible()" size="small">新增超算账号</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="tableDate" class="table_height" border height="calc(100vh - 150px)" v-loading="loading">
|
<div class="table-box">
|
||||||
|
<el-table :data="tableDate" class="table_height" border height="calc(100vh - 150px)" v-loading="loading">
|
||||||
<el-table-column align="center" header-align="center" prop="ldapuid" label="超算用户编码"></el-table-column>
|
<el-table-column align="center" header-align="center" prop="ldapuid" label="超算用户编码"></el-table-column>
|
||||||
<el-table-column align="center" header-align="center" prop="orgname" label="已绑定用户">
|
<el-table-column align="center" header-align="center" prop="orgname" label="已绑定用户">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -28,6 +29,7 @@ align="center" header-align="center"
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 新增超算账号弹窗 -->
|
<!-- 新增超算账号弹窗 -->
|
||||||
@ -306,4 +308,8 @@ export default {
|
|||||||
.table_height {
|
.table_height {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
.table-box{
|
||||||
|
padding:10px 20px;
|
||||||
|
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
:data="distributorList"
|
:data="distributorList"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:unique-opened="true"
|
:unique-opened="true"
|
||||||
height="calc(100vh - 130px)"
|
height="100%"
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
:row-key="getRowKeys"
|
:row-key="getRowKeys"
|
||||||
@ -2576,7 +2576,10 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.distributor_box {
|
.distributor_box {
|
||||||
height: calc(100vh - 130px);
|
height: calc(100vh - 160px);
|
||||||
|
padding: 20px;
|
||||||
|
background-color: #fff;
|
||||||
|
margin-top: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 展开详情样式优化 */
|
/* 展开详情样式优化 */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user