uptada
This commit is contained in:
parent
c31a87369c
commit
b8c117c1e8
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;
|
||||||
|
}
|
||||||
280
f/web-kboss/src/assets/css/iconfont/demo_index.html
Normal file
280
f/web-kboss/src/assets/css/iconfont/demo_index.html
Normal file
@ -0,0 +1,280 @@
|
|||||||
|
<!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">&#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=1760680783657') format('woff2'),
|
||||||
|
url('iconfont.woff?t=1760680783657') format('woff'),
|
||||||
|
url('iconfont.ttf?t=1760680783657') 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-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-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>
|
||||||
31
f/web-kboss/src/assets/css/iconfont/iconfont.css
Normal file
31
f/web-kboss/src/assets/css/iconfont/iconfont.css
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
@font-face {
|
||||||
|
font-family: "iconfont"; /* Project id 5043107 */
|
||||||
|
src: url('iconfont.woff2?t=1760680783657') format('woff2'),
|
||||||
|
url('iconfont.woff?t=1760680783657') format('woff'),
|
||||||
|
url('iconfont.ttf?t=1760680783657') format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconfont {
|
||||||
|
font-family: "iconfont" !important;
|
||||||
|
font-size: 16px;
|
||||||
|
font-style: normal;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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
37
f/web-kboss/src/assets/css/iconfont/iconfont.json
Normal file
37
f/web-kboss/src/assets/css/iconfont/iconfont.json
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"id": "5043107",
|
||||||
|
"name": "kboos",
|
||||||
|
"font_family": "iconfont",
|
||||||
|
"css_prefix_text": "icon-",
|
||||||
|
"description": "",
|
||||||
|
"glyphs": [
|
||||||
|
{
|
||||||
|
"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 |
768
f/web-kboss/src/components/MessageCenter/MessageCenter.vue
Normal file
768
f/web-kboss/src/components/MessageCenter/MessageCenter.vue
Normal file
@ -0,0 +1,768 @@
|
|||||||
|
<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: true
|
||||||
|
},
|
||||||
|
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() {
|
||||||
|
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);
|
||||||
|
this.$message({
|
||||||
|
message: "获取未读消息失败",
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
getReadmsg() {
|
||||||
|
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() {
|
||||||
|
getMsgAPI({ userid: this.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
@ -1,9 +1,11 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
|
|
||||||
import Cookies from 'js-cookie'
|
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'
|
||||||
|
|||||||
@ -1,19 +1,19 @@
|
|||||||
<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)">
|
||||||
@ -32,93 +32,26 @@
|
|||||||
</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">
|
<!-- <div class="search-box">
|
||||||
<i class="el-icon-search"></i>
|
<i class="el-icon-search"></i>
|
||||||
<input type="text" :placeholder="translations[language].searchPlaceholder">
|
<input type="text" :placeholder="translations[language].searchPlaceholder">
|
||||||
</div>
|
</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"></i>
|
||||||
<!-- 客服 -->
|
<!-- 客服 -->
|
||||||
<i class="el-icon-headset functions" @click="handleGoLogin()"></i>
|
<i class="iconfont icon-kefu functions"></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',
|
||||||
@ -130,14 +63,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>
|
||||||
@ -230,7 +163,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)">
|
||||||
@ -239,7 +173,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 }}
|
||||||
@ -247,6 +181,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 消息中心组件 -->
|
||||||
|
|
||||||
|
<message-center ref="messageCenter" :visible.sync="messageCenterVisible" :userId="userId"
|
||||||
|
@unread-count-update="handleUnreadCountUpdate" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -268,8 +207,14 @@ 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 {
|
||||||
homePath: getHomePath(), // 首页路径
|
homePath: getHomePath(), // 首页路径
|
||||||
@ -289,11 +234,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:'供需广场',
|
supply: '供需广场',
|
||||||
aboutUs: '关于我们',
|
aboutUs: '关于我们',
|
||||||
balance: '余额',
|
balance: '余额',
|
||||||
recharge: '充值',
|
recharge: '充值',
|
||||||
@ -405,7 +351,7 @@ export default Vue.extend({
|
|||||||
en: {
|
en: {
|
||||||
home: 'Home',
|
home: 'Home',
|
||||||
ecosystem: 'Products & Services',
|
ecosystem: 'Products & Services',
|
||||||
supply:'Supply',
|
supply: 'Supply',
|
||||||
aboutUs: 'About Us',
|
aboutUs: 'About Us',
|
||||||
balance: 'Balance',
|
balance: 'Balance',
|
||||||
recharge: 'Recharge',
|
recharge: 'Recharge',
|
||||||
@ -559,10 +505,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
|
||||||
@ -593,6 +535,27 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 处理消息图标点击
|
||||||
|
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获取当前语言,确保一致性
|
||||||
@ -719,7 +682,7 @@ export default Vue.extend({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 修改密码(未完全实现)
|
// 修改密码
|
||||||
edituserPassword() {
|
edituserPassword() {
|
||||||
this.passwordDialog = true;
|
this.passwordDialog = true;
|
||||||
},
|
},
|
||||||
@ -1030,6 +993,8 @@ export default Vue.extend({
|
|||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/login'
|
path: '/login'
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1051,9 +1016,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;
|
||||||
@ -1063,7 +1025,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 {
|
||||||
@ -1129,15 +1091,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;
|
||||||
@ -1177,8 +1146,14 @@ export default Vue.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-xiaoxi {
|
||||||
|
font-size: 24px !important;
|
||||||
|
}
|
||||||
|
|
||||||
.functions {
|
.functions {
|
||||||
padding-right: 20px;
|
padding-right: 20px;
|
||||||
|
font-size: 20px;
|
||||||
|
color: #000;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #1E6FFF;
|
color: #1E6FFF;
|
||||||
@ -1363,8 +1338,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 {
|
||||||
@ -1378,29 +1358,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 {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user