branch_hxd
peyqfw698 2 months ago
parent 327565db82
commit c086ce336f

File diff suppressed because it is too large Load Diff

@ -1,167 +1,166 @@
@charset "utf-8"; @charset "utf-8";
* { * {
box-sizing: border-box; box-sizing: border-box; /* 设置所有元素的盒子模型为border-box */
} }
#app-menu ul { #app-menu ul {
padding: 0; padding: 0; /* 移除列表的默认内边距 */
} }
#app-menu li { #app-menu li {
list-style: none; list-style: none; /* 移除列表项的默认样式 */
} }
#app-menu { #app-menu {
overflow: hidden; overflow: hidden; /* 隐藏溢出的内容 */
width: 100%; width: 100%; /* 设置宽度为100% */
} }
.weixin-preview { .weixin-preview {
position: relative; position: relative; /* 相对定位 */
width: 320px; width: 320px; /* 设置宽度 */
height: 540px; height: 540px; /* 设置高度 */
float: left; float: left; /* 左浮动 */
margin-right: 10px; margin-right: 10px; /* 右边距 */
border: 1px solid #e7e7eb; border: 1px solid #e7e7eb; /* 边框颜色和宽度 */
} }
.weixin-preview a { .weixin-preview a {
text-decoration: none; text-decoration: none; /* 移除链接下划线 */
color: #616161; color: #616161; /* 文字颜色 */
} }
.weixin-preview .weixin-hd .weixin-title { .weixin-preview .weixin-hd .weixin-title {
color: #fff; color: #fff; /* 文字颜色 */
font-size: 15px; font-size: 15px; /* 字体大小 */
width: 100%; width: 100%; /* 宽度 */
text-align: center; text-align: center; /* 文字居中对齐 */
position: absolute; position: absolute; /* 绝对定位 */
top: 33px; top: 33px; /* 顶部位置 */
left: 0px; left: 0px; /* 左侧位置 */
} }
.weixin-preview .weixin-header{ .weixin-preview .weixin-header{
text-align: center; text-align: center; /* 文字居中对齐 */
padding: 10px 0; padding: 10px 0; /* 上下内边距 */
background-color: #616161; background-color: #616161; /* 背景颜色 */
color: #ffffff; color: #ffffff; /* 文字颜色 */
} }
.weixin-preview .weixin-menu { .weixin-preview .weixin-menu {
position: absolute; position: absolute; /* 绝对定位 */
bottom: 0; bottom: 0; /* 底部位置 */
left: 0; left: 0; /* 左侧位置 */
right: 0; right: 0; /* 右侧位置 */
border-top: 1px solid #e7e7e7; border-top: 1px solid #e7e7e7; /* 上边框颜色和宽度 */
background-position: 0 0; background-position: 0 0; /* 背景图像位置 */
background-repeat: no-repeat; background-repeat: no-repeat; /* 背景图像不重复 */
margin-bottom: 0px; margin-bottom: 0px; /* 底部外边距 */
} }
/*一级*/ /*一级*/
.weixin-preview .weixin-menu .menu-item { .weixin-preview .weixin-menu .menu-item {
position: relative; position: relative; /* 相对定位 */
float: left; float: left; /* 左浮动 */
line-height: 50px; line-height: 50px; /* 行高 */
height: 50px; height: 50px; /* 高度 */
text-align: center; text-align: center; /* 文字居中对齐 */
width: 33.33%; width: 33.33%; /* 宽度 */
border-left: 1px solid #e7e7e7; border-left: 1px solid #e7e7e7; /* 左边框颜色和宽度 */
cursor: pointer; cursor: pointer; /* 鼠标指针变为手型 */
color: #616161; color: #616161; /* 文字颜色 */
} }
/*二级*/ /*二级*/
.weixin-preview .weixin-sub-menu { .weixin-preview .weixin-sub-menu {
position: absolute; position: absolute; /* 绝对定位 */
bottom: 60px; bottom: 60px; /* 底部位置 */
left: 0; left: 0; /* 左侧位置 */
right: 0; right: 0; /* 右侧位置 */
border-top: 1px solid #d0d0d0; border-top: 1px solid #d0d0d0; /* 上边框颜色和宽度 */
margin-bottom: 0px; margin-bottom: 0px; /* 底部外边距 */
background: #fafafa; background: #fafafa; /* 背景颜色 */
display: block; display: block; /* 块级显示 */
padding: 0; padding: 0; /* 内边距 */
} }
.weixin-preview .weixin-sub-menu .menu-sub-item { .weixin-preview .weixin-sub-menu .menu-sub-item {
line-height: 50px; line-height: 50px; /* 行高 */
height: 50px; height: 50px; /* 高度 */
text-align: center; text-align: center; /* 文字居中对齐 */
width: 100%; width: 100%; /* 宽度 */
border: 1px solid #d0d0d0; border: 1px solid #d0d0d0; /* 边框颜色和宽度 */
border-top-width: 0px; border-top-width: 0px; /* 顶部边框宽度 */
cursor: pointer; cursor: pointer; /* 鼠标指针变为手型 */
position: relative; position: relative; /* 相对定位 */
color: #616161; color: #616161; /* 文字颜色 */
} }
.weixin-preview .weixin-sub-menu .menu-sub-item.on-drag-over{ .weixin-preview .weixin-sub-menu .menu-sub-item.on-drag-over{
border-top: 2px solid #44b549; border-top: 2px solid #44b549; /* 顶部边框颜色和宽度 */
} }
.weixin-preview .menu-arrow { .weixin-preview .menu-arrow {
position: absolute; position: absolute; /* 绝对定位 */
left: 50%; left: 50%; /* 左侧位置 */
margin-left: -6px; margin-left: -6px; /* 左边距调整 */
} }
.weixin-preview .arrow_in { .weixin-preview .arrow_in {
bottom: -4px; bottom: -4px; /* 底部位置 */
display: inline-block; display: inline-block; /* 行内块级显示 */
width: 0px; width: 0px; /* 宽度 */
height: 0px; height: 0px; /* 高度 */
border-width: 6px 6px 0px; border-width: 6px 6px 0px; /* 边框宽度 */
border-style: solid dashed dashed; border-style: solid dashed dashed; /* 边框样式 */
border-color: #fafafa transparent transparent; border-color: #fafafa transparent transparent; /* 边框颜色 */
} }
.weixin-preview .arrow_out { .weixin-preview .arrow_out {
bottom: -5px; bottom: -5px; /* 底部位置 */
display: inline-block; display: inline-block; /* 行内块级显示 */
width: 0px; width: 0px; /* 宽度 */
height: 0px; height: 0px; /* 高度 */
border-width: 6px 6px 0px; border-width: 6px 6px 0px; /* 边框宽度 */
border-style: solid dashed dashed; border-style: solid dashed dashed; /* 边框样式 */
border-color: #d0d0d0 transparent transparent; border-color: #d0d0d0 transparent transparent; /* 边框颜色 */
} }
.weixin-preview .menu-item .menu-item-title, .weixin-preview .menu-sub-item .menu-item-title { .weixin-preview .menu-item .menu-item-title, .weixin-preview .menu-sub-item .menu-item-title {
width: 100%; width: 100%; /* 宽度 */
overflow: hidden; overflow: hidden; /* 内容溢出时隐藏 */
white-space: nowrap; white-space: nowrap; /* 不换行 */
text-overflow: ellipsis; text-overflow: ellipsis; /* 文本溢出时显示省略号 */
box-sizing: border-box; box-sizing: border-box; /* 盒子模型为border-box */
} }
.weixin-preview .menu-item.current, .weixin-preview .menu-sub-item.current { .weixin-preview .menu-item.current, .weixin-preview .menu-sub-item.current {
border: 1px solid #44b549; border: 1px solid #44b549; /* 边框颜色和宽度 */
background: #fff; background: #fff; /* 背景颜色 */
color: #44b549; color: #44b549; /* 文字颜色 */
} }
.weixin-preview .weixin-sub-menu.show { .weixin-preview .weixin-sub-menu.show {
display: block; display: block; /* 块级显示 */
} }
.weixin-preview .icon_menu_dot { .weixin-preview .icon_menu_dot {
/* background: url(../images/index_z354723.png) 0px -36px no-repeat; */ /* background: url(../images/index_z354723.png) 0px -36px no-repeat; */
width: 7px; width: 7px; /* 宽度 */
height: 7px; height: 7px; /* 高度 */
vertical-align: middle; vertical-align: middle; /* 垂直居中对齐 */
display: inline-block; display: inline-block; /* 行内块级显示 */
margin-right: 2px; margin-right: 2px; /* 右边距 */
margin-top: -2px; margin-top: -2px; /* 顶部外边距调整 */
} }
.weixin-preview .icon14_menu_add { .weixin-preview .icon14_menu_add {
/* background: url(../images/index_z354723.png) 0px 0px no-repeat; */ /* background: url(../images/index_z354723.png) 0px 0px no-repeat; */
width: 14px; width: 14px; /* 宽度 */
height: 14px; height: 14px; /* 高度 */
vertical-align: middle; vertical-align: middle; /* 垂直居中对齐 */
display: inline-block; display: inline-block; /* 行内块级显示 */
margin-top: -2px; margin-top: -2px; /* 顶部外边距调整 */
} }
.weixin-preview li:hover .icon14_menu_add { .weixin-preview li:hover .icon14_menu_add {
@ -169,197 +168,197 @@
} }
.weixin-preview .menu-item:hover { .weixin-preview .menu-item:hover {
color: #000; color: #000; /* 文字颜色 */
} }
.weixin-preview .menu-sub-item:hover { .weixin-preview .menu-sub-item:hover {
background: #eee; background: #eee; /* 背景颜色 */
} }
.weixin-preview li.current:hover { .weixin-preview li.current:hover {
background: #fff; background: #fff; /* 背景颜色 */
color: #44b549; color: #44b549; /* 文字颜色 */
} }
/*菜单内容*/ /*菜单内容*/
.weixin-menu-detail { .weixin-menu-detail {
width: 600px; width: 600px; /* 宽度 */
padding: 0px 20px 5px; padding: 0px 20px 5px; /* 内边距 */
background-color: #f4f5f9; background-color: #f4f5f9; /* 背景颜色 */
border: 1px solid #e7e7eb; border: 1px solid #e7e7eb; /* 边框颜色和宽度 */
float: left; float: left; /* 左浮动 */
min-height: 540px; min-height: 540px; /* 最小高度 */
} }
.weixin-menu-detail .menu-name { .weixin-menu-detail .menu-name {
float: left; float: left; /* 左浮动 */
height: 40px; height: 40px; /* 高度 */
line-height: 40px; line-height: 40px; /* 行高 */
font-size: 18px; font-size: 18px; /* 字体大小 */
} }
.weixin-menu-detail .menu-del { .weixin-menu-detail .menu-del {
float: right; float: right; /* 右浮动 */
height: 40px; height: 40px; /* 高度 */
line-height: 40px; line-height: 40px; /* 行高 */
color: #459ae9; color: #459ae9; /* 文字颜色 */
cursor: pointer; cursor: pointer; /* 鼠标指针变为手型 */
} }
.weixin-menu-detail .menu-input-group { .weixin-menu-detail .menu-input-group {
width: 540px; width: 540px; /* 宽度 */
margin: 10px 0 30px 0; margin: 10px 0 30px 0; /* 外边距 */
overflow: hidden; overflow: hidden; /* 隐藏溢出的内容 */
} }
.weixin-menu-detail .menu-label { .weixin-menu-detail .menu-label {
float: left; float: left; /* 左浮动 */
height: 30px; height: 30px; /* 高度 */
line-height: 30px; line-height: 30px; /* 行高 */
width: 80px; width: 80px; /* 宽度 */
text-align: right; text-align: right; /* 文字右对齐 */
} }
.weixin-menu-detail .menu-input { .weixin-menu-detail .menu-input {
float: left; float: left; /* 左浮动 */
width: 380px width: 380px; /* 宽度 */
} }
.weixin-menu-detail .menu-input-text { .weixin-menu-detail .menu-input-text {
border: 0px; border: 0px; /* 边框宽度 */
outline: 0px; outline: 0px; /* focus时的轮廓宽度 */
background: #fff; background: #fff; /* 背景颜色 */
width: 300px; width: 300px; /* 宽度 */
padding: 5px 0px 5px 0px; padding: 5px 0px 5px 0px; /* 内边距 */
margin-left: 10px; margin-left: 10px; /* 左边距 */
text-indent: 10px; text-indent: 10px; /* text缩进 */
height: 35px; height: 35px; /* 高度 */
} }
.weixin-menu-detail .menu-tips { .weixin-menu-detail .menu-tips {
color: #8d8d8d; color: #8d8d8d; /* 文字颜色 */
padding-top: 4px; padding-top: 4px; /* top方向的内边距 */
margin: 0; margin: 0; /* margin属性值设置为0 */
} }
.weixin-menu-detail .menu-tips.cursor { .weixin-menu-detail .menu-tips.cursor {
color: #459ae9; color: #459ae9; /* 文字颜色 */
cursor: pointer; cursor: pointer; /* mouse指针变为手型图标 */
} }
.weixin-menu-detail .menu-input .menu-tips { .weixin-menu-detail .menu-input .menu-tips {
margin: 0 0 0 10px; margin: 0 0 0 10px; /* margin属性值设置为0最后一个参数为10px */
} }
.weixin-menu-detail .menu-content { .weixin-menu-detail .menu-content {
padding: 16px 20px; padding: 16px 20px; /* Padding属性值设置为16px和20px */
border: 1px solid #e7e7eb; border: 1px solid #e7e7eb; /* Border属性值设置为1px和#e7e7eb颜色值 */
background-color: #fff; background-color: #fff; /* background-color属性值设置为白色 */
} }
.weixin-menu-detail .menu-content .menu-input-group { .weixin-menu-detail .menu-content .menu-input-group {
margin: 0px 0 10px 0; margin: 0px 0 10px 0; /* margin属性值设置为0px,10px和0px */
} }
.weixin-menu-detail .menu-content .menu-label { .weixin-menu-detail .menu-content .menu-label {
text-align: left; text-align: left; /* text对齐方式设置为左对齐 */
width: 100px; width: 100px; /* width属性值设置为100px */
} }
.weixin-menu-detail .menu-content .menu-input-text { .weixin-menu-detail .menu-content .menu-input-text {
border: 1px solid #e7e7eb; border: 1px solid #e7e7eb; /* border属性值设置为1px和#e7e7eb颜色值 */
} }
.weixin-menu-detail .menu-content .menu-tips { .weixin-menu-detail .menu-content .menu-tips {
padding-bottom: 10px; padding-bottom: 10px; /* bottom方向的内边距设置为10px */
} }
.weixin-menu-detail .menu-msg-content { .weixin-menu-detail .menu-msg-content {
padding: 0; padding: 0; /* Padding属性值设置为0 */
border: 1px solid #e7e7eb; border: 1px solid #e7e7eb; /* Border属性值设置为1px和#e7e7eb颜色值 */
background-color: #fff; background-color: #fff; /* background-color属性值设置为白色 */
} }
.weixin-menu-detail .menu-msg-content .menu-msg-head { .weixin-menu-detail .menu-msg-content .menu-msg-head {
overflow: hidden; overflow: hidden; /* Overflow属性值设置为hidden */
border-bottom: 1px solid #e7e7eb; border-bottom: 1px solid #e7e7eb; /* Border属性值设置为1px和#e7e7eb颜色值 */
line-height: 38px; line-height: 38px; /* Line height属性值设置为38px */
height: 38px; height: 38px; /* height属性值设置为38px */
padding: 0 20px; padding: 0 20px; /* Padding属性值设置为0和20px */
} }
.weixin-menu-detail .menu-msg-content .menu-msg-panel { .weixin-menu-detail .menu-msg-content .menu-msg-panel {
padding: 30px 50px; padding: 30px 50px; /* Padding属性值设置为30px和50px */
} }
.weixin-menu-detail .menu-msg-content .menu-msg-select { .weixin-menu-detail .menu-msg-content .menu-msg-select {
padding: 40px 20px; padding: 40px 20px; /* Padding属性值设置为40px和20px */
border: 2px dotted #d9dadc; border: 2px dotted #d9dadc; /* Border属性值设置为2px虚线和#d9dadc颜色值 */
text-align: center; text-align: center; /* text对齐方式设置为居中对齐 */
} }
.weixin-menu-detail .menu-msg-content .menu-msg-select:hover { .weixin-menu-detail .menu-msg-content .menu-msg-select:hover {
border-color: #b3b3b3; border-color: #b3b3b3; /* border颜色值设置为#b3b3b3 */
} }
.weixin-menu-detail .menu-msg-content strong { .weixin-menu-detail .menu-msg-content strong {
display: block; display: block; /* Display属性值设置为block */
padding-top: 3px; padding-top: 3px; /* Top方向的内边距设置为3px */
font-weight: 400; font-weight: 400; /* font weight属性值设置为400 */
font-style: normal; font-style: normal; /* font style属性值设置为normal */
} }
.weixin-menu-detail .menu-msg-content .menu-msg-title { .weixin-menu-detail .menu-msg-content .menu-msg-title {
float: left; float: left; /* float属性值设置为left */
width: 310px; width: 310px; /* width属性值设置为310px */
height: 30px; height: 30px; /* height属性值设置为30px */
line-height: 30px; line-height: 30px; /* line height属性值设置为30px */
overflow: hidden; overflow: hidden; /* Overflow属性值设置为hidden */
text-overflow: ellipsis; text-overflow: ellipsis; /* TextOverflow属性值设置为ellipsis */
white-space: nowrap; white-space: nowrap; /* WhiteSpace属性值设置为nowrap */
} }
.icon36_common { .icon36_common {
width: 36px; width: 36px; /* width属性值设置为36px */
height: 36px; height: 36px; /* height属性值设置为36px */
vertical-align: middle; vertical-align: middle; /* vertical align属性值设置为middle */
display: inline-block; display: inline-block; /* Display属性值设置为inline block */
} }
.icon_msg_sender { .icon_msg_sender {
margin-right: 3px; margin-right: 3px; /* Right方向的外边距设置为3px */
margin-top: -2px; margin-top: -2px; /* Top方向的外边距设置为负2px */
width: 20px; width: 20px; /* width属性值设置为20px */
height: 20px; height: 20px; /* height属性值设置为20px */
vertical-align: middle; vertical-align: middle; /* vertical align属性值设置为middle */
display: inline-block; display: inline-block; /* Display属性值设置为inline block */
/* background: url(../images/msg_tab_z25df2d.png) 0 -270px no-repeat; */ /* background: url(../images/msg_tab_z25df2d.png) 0 -270px no-repeat; */
} }
.weixin-btn-group { .weixin-btn-group {
text-align: center; text-align: center; /* text对齐方式设置为居中对齐 */
width: 100%; width: 100%; /* width属性值设置为100% */
margin: 30px 0px; margin: 30px 0px; /* margin属性值设置为30px和0px */
overflow: hidden; overflow: hidden; /* Overflow属性值设置为hidden */
} }
.weixin-btn-group .btn { .weixin-btn-group .btn {
width: 100px; width: 100px; /* width属性值设置为100px */
border-radius: 0px; border-radius: 0px; /* border radius属性值设置为0px */
} }
#material-list { #material-list {
padding: 20px; padding: 20px; /* Padding属性值设置为20px */
overflow-y: scroll; overflow-y: scroll; /* Overflow y属性值设置为scroll使内容可滚动 */
height: 558px; height: 558px; /* height属性值设置为558px */
} }
#news-list { #news-list {
padding: 20px; padding: 20px; /* Padding属性值设置为20px */
overflow-y: scroll; overflow-y: scroll; /* Overflow y属性值设置为scroll使内容可滚动 */
height: 558px; height: 558px; /* height属性值设置为558px */
} }
#material-list table { #material-list table {
width: 100%; width: 100%; /* width属性值设置为100% */
} }

@ -1,9 +1,11 @@
/* 设置所有元素和伪元素的 box-sizing 为 border-box */
*, *,
*:before, *:before,
*:after { *:after {
box-sizing: border-box; box-sizing: border-box;
} }
/* 设置 body 的字体、大小、行高和颜色 */
body { body {
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif; font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
font-size: 14px; font-size: 14px;
@ -12,10 +14,12 @@ body {
background-color: #fff; background-color: #fff;
} }
/* 设置链接的颜色和文本装饰 */
a { a {
color: mix(#fff, $--color-primary, 20%); color: mix(#fff, $--color-primary, 20%); /* 使用混合色函数设置颜色 */
text-decoration: none; text-decoration: none; /* 去掉下划线 */
/* 当链接获得焦点或悬停时,改变颜色并添加下划线 */
&:focus, &:focus,
&:hover { &:hover {
color: $--color-primary; color: $--color-primary;
@ -23,97 +27,104 @@ a {
} }
} }
/* 设置图片垂直对齐方式为中间 */
img { img {
vertical-align: middle; vertical-align: middle;
} }
/* Utils /* Utils
------------------------------ */ ------------------------------ */
/* 清除浮动工具类 */
.clearfix:before, .clearfix:before,
.clearfix:after { .clearfix:after {
content: " "; content: " "; /* 生成内容以触发 clearfix */
display: table; display: table; /* 设置为表格布局 */
} }
.clearfix:after { .clearfix:after {
clear: both; clear: both; /* 清除浮动 */
} }
/* Animation /* Animation
------------------------------ */ ------------------------------ */
/* 淡入淡出动画过渡效果 */
.fade-enter-active, .fade-enter-active,
.fade-leave-active { .fade-leave-active {
transition: opacity .5s; transition: opacity .5s; /* 设置透明度变化的过渡时间 */
} }
.fade-enter, .fade-enter,
.fade-leave-to { .fade-leave-to {
opacity: 0; opacity: 0; /* 初始透明度为 0 */
} }
/* Reset element-ui /* Reset element-ui
------------------------------ */ ------------------------------ */
/* 重置 element-ui 样式 */
.site-wrapper { .site-wrapper {
.el-pagination { .el-pagination {
margin-top: 15px; margin-top: 15px; /* 设置分页组件的上边距 */
text-align: right; text-align: right; /* 设置分页组件的文本对齐方式 */
} }
} }
/* Layout /* Layout
------------------------------ */ ------------------------------ */
/* 设置布局相关样式 */
.site-wrapper { .site-wrapper {
position: relative; position: relative; /* 相对定位 */
min-width: 1180px; min-width: 1180px; /* 最小宽度 */
} }
/* Sidebar fold /* Sidebar fold
------------------------------ */ ------------------------------ */
/* 侧边栏折叠样式 */
.site-sidebar--fold { .site-sidebar--fold {
/* 设置导航栏头部、品牌、侧边栏及其内部元素的宽度 */
.site-navbar__header, .site-navbar__header,
.site-navbar__brand, .site-navbar__brand,
.site-sidebar, .site-sidebar,
.site-sidebar__inner, .site-sidebar__inner,
.el-menu.site-sidebar__menu { .el-menu.site-sidebar__menu {
width: 64px; width: 64px; /* 宽度为 64px */
} }
/* 设置导航栏主体和内容包装器的左边距 */
.site-navbar__body, .site-navbar__body,
.site-content__wrapper { .site-content__wrapper {
margin-left: 64px; margin-left: 64px; /* 左边距为 64px */
} }
/* 设置品牌图标在不同状态下的显示方式 */
.site-navbar__brand { .site-navbar__brand {
&-lg { &-lg {
display: none; display: none; /* 大尺寸时隐藏 */
} }
&-mini { &-mini {
display: inline-block; display: inline-block; /* 小尺寸时内联显示 */
} }
} }
/* 设置侧边栏和其内部元素的溢出处理 */
.site-sidebar, .site-sidebar,
.site-sidebar__inner { .site-sidebar__inner {
overflow: initial; overflow: initial; /* 初始溢出处理 */
} }
/* 设置侧边栏菜单图标的右边距和字体大小 */
.site-sidebar__menu-icon { .site-sidebar__menu-icon {
margin-right: 0; margin-right: 0; /* 右边距为 0 */
font-size: 20px; font-size: 20px; /* 字体大小为 20px */
} }
/* 设置标签页内容的左边距 */
.site-content--tabs > .el-tabs > .el-tabs__header { .site-content--tabs > .el-tabs > .el-tabs__header {
left: 64px; left: 64px; /* 左边距为 64px */
} }
} }
// animation //* animation */
.site-navbar__header, .site-navbar__header,
.site-navbar__brand, .site-navbar__brand,
.site-navbar__body, .site-navbar__body,
@ -123,154 +134,154 @@ img {
.site-sidebar__menu-icon, .site-sidebar__menu-icon,
.site-content__wrapper, .site-content__wrapper,
.site-content--tabs > .el-tabs .el-tabs__header { .site-content--tabs > .el-tabs .el-tabs__header {
//
transition: inline-block .3s, left .3s, width .3s, margin-left .3s, font-size .3s; transition: inline-block .3s, left .3s, width .3s, margin-left .3s, font-size .3s;
} }
/* Navbar */
/* Navbar
------------------------------ */
.site-navbar { .site-navbar {
//
position: fixed; position: fixed;
top: 0; top: 0;
right: 0; right: 0;
left: 0; left: 0;
z-index: 1030; z-index: 1030; //
height: 50px; height: 50px; // 50px
box-shadow: 0 2px 4px rgba(0, 0, 0, .08); box-shadow: 0 2px 4px rgba(0, 0, 0, .08); //
background-color: $navbar--background-color; background-color: $navbar--background-color; //
&--inverse { &--inverse {
.site-navbar__body { .site-navbar__body {
background-color: transparent; background-color: transparent; //
} }
.el-menu { .el-menu {
> .el-menu-item, > .el-menu-item,
> .el-submenu > .el-submenu__title { > .el-submenu > .el-submenu__title {
color: #fff; color: #fff; //
&:focus, &:focus,
&:hover { &:hover {
color: #fff; color: #fff; //
background-color: mix(#000, $navbar--background-color, 15%); background-color: mix(#000, $navbar--background-color, 15%); //
} }
} }
> .el-menu-item.is-active, > .el-menu-item.is-active,
> .el-submenu.is-active > .el-submenu__title { > .el-submenu.is-active > .el-submenu__title {
border-bottom-color: mix(#fff, $navbar--background-color, 85%); border-bottom-color: mix(#fff, $navbar--background-color, 85%); //
} }
.el-menu-item i, .el-menu-item i,
.el-submenu__title i, .el-submenu__title i,
.el-dropdown { .el-dropdown {
color: #fff; color: #fff; //
} }
} }
.el-menu--popup-bottom-start { .el-menu--popup-bottom-start {
background-color: $navbar--background-color; background-color: $navbar--background-color; //
} }
} }
&__header { &__header {
position: relative; position: relative; //
float: left; float: left; //
width: 230px; width: 230px; // 230px
height: 50px; height: 50px; // 50px
overflow: hidden; overflow: hidden; //
} }
&__brand { &__brand {
display: table-cell; display: table-cell; //
vertical-align: middle; vertical-align: middle; //
width: 230px; width: 230px; // 230px
height: 50px; height: 50px; // 50px
margin: 0; margin: 0; //
line-height: 50px; line-height: 50px; // 50px
font-size: 20px; font-size: 20px; // 20px
text-align: center; text-align: center; //
text-transform: uppercase; text-transform: uppercase; //
white-space: nowrap; white-space: nowrap; //
color: #fff; color: #fff; //
&-lg, &-lg,
&-mini { &-mini {
margin: 0 5px; margin: 0 5px; // 5px
color: #fff; color: #fff; //
&:focus, &:focus,
&:hover { &:hover {
color: #fff; color: #fff; //
text-decoration: none; text-decoration: none; // 线
} }
} }
&-mini { &-mini {
display: none; display: none; //
} }
} }
&__switch { &__switch {
font-size: 18px; font-size: 18px; // 18px
border-bottom: none !important; border-bottom: none !important; //
} }
&__avatar { &__avatar {
border-bottom: none !important; border-bottom: none !important; //
* { * {
vertical-align: inherit; vertical-align: inherit; //
} }
.el-dropdown-link { .el-dropdown-link {
> img { > img {
width: 36px; width: 36px; // 36px
height: auto; height: auto; //
margin-right: 5px; margin-right: 5px; // 5px
border-radius: 100%; border-radius: 100%; //
vertical-align: middle; vertical-align: middle; //
} }
} }
} }
&__body { &__body {
position: relative; position: relative; //
margin-left: 230px; margin-left: 230px; // 230px
padding-right: 15px; padding-right: 15px; // 15px
background-color: #fff; background-color: #fff; //
} }
&__menu { &__menu {
float: left; float: left; //
background-color: transparent; background-color: transparent; //
border-bottom: 0; border-bottom: 0; //
&--right { &--right {
float: right; float: right; //
} }
a:focus, a:focus,
a:hover { a:hover {
text-decoration: none; text-decoration: none; // 线
} }
.el-menu-item, .el-menu-item,
.el-submenu > .el-submenu__title { .el-submenu > .el-submenu__title {
height: 50px; height: 50px; // 50px
line-height: 50px; line-height: 50px; // 50px
} }
.el-submenu > .el-menu { .el-submenu > .el-menu {
top: 55px; top: 55px; // 55px
} }
.el-badge { .el-badge {
display: inline; display: inline; //
z-index: 2; z-index: 2; // z2
&__content { &__content {
line-height: 16px; line-height: 16px; // 16px
} }
} }
} }
@ -280,124 +291,123 @@ img {
/* Sidebar /* Sidebar
------------------------------ */ ------------------------------ */
.site-sidebar { .site-sidebar {
position: fixed; position: fixed; //
top: 50px; top: 50px; // 50px
left: 0; left: 0; // 0
bottom: 0; bottom: 0; //
z-index: 1020; z-index: 1020; // z
width: 230px; width: 230px; // 230px
overflow: hidden; overflow: hidden; //
&--dark, &--dark,
&--dark-popper { &--dark-popper {
background-color: $sidebar--background-color-dark; background-color: $sidebar--background-color-dark; //
.site-sidebar__menu.el-menu, .site-sidebar__menu.el-menu,
> .el-menu--popup { > .el-menu--popup {
background-color: $sidebar--background-color-dark; background-color: $sidebar--background-color-dark; //
.el-menu-item, .el-menu-item,
.el-submenu > .el-submenu__title { .el-submenu > .el-submenu__title {
color: $sidebar--color-text-dark; color: $sidebar--color-text-dark; //
&:focus, &:focus,
&:hover { &:hover {
color: mix(#fff, $sidebar--color-text-dark, 50%); color: mix(#fff, $sidebar--color-text-dark, 50%); //
background-color: mix(#fff, $sidebar--background-color-dark, 2.5%); background-color: mix(#fff, $sidebar--background-color-dark, 2.5%); //
} }
} }
.el-menu, .el-menu,
.el-submenu.is-opened { .el-submenu.is-opened {
background-color: mix(#000, $sidebar--background-color-dark, 15%); background-color: mix(#000, $sidebar--background-color-dark, 15%); //
} }
.el-menu-item.is-active, .el-menu-item.is-active,
.el-submenu.is-active > .el-submenu__title { .el-submenu.is-active > .el-submenu__title {
color: mix(#fff, $sidebar--color-text-dark, 80%); color: mix(#fff, $sidebar--color-text-dark, 80%); //
} }
} }
} }
&__inner { &__inner {
position: relative; position: relative; //
z-index: 1; z-index: 1; // z
width: 250px; width: 250px; // 250px
height: 100%; height: 100%; // 100%
padding-bottom: 15px; padding-bottom: 15px; // 15px
overflow-y: scroll; overflow-y: scroll; // y
} }
&__menu.el-menu { &__menu.el-menu {
width: 230px; width: 230px; // 230px
border-right: 0; border-right: 0; //
} }
&__menu-icon { &__menu-icon {
width: 24px; width: 24px; // 24px
margin-right: 5px; margin-right: 5px; // 5px
text-align: center; text-align: center; //
font-size: 16px; font-size: 16px; // 16px
color: inherit !important; color: inherit !important; //
} }
} }
/* Content /* Content
------------------------------ */ ------------------------------ */
.site-content { .site-content {
position: relative; position: relative; //
padding: 15px; padding: 15px; // 15px
&__wrapper { &__wrapper {
position: relative; position: relative; //
padding-top: 50px; padding-top: 50px; // 50px
margin-left: 230px; margin-left: 230px; // 230px
min-height: 100%; min-height: 100%; // 100%
background: $content--background-color; background: $content--background-color; //
} }
&--tabs { &--tabs {
padding: 55px 0 0; padding: 55px 0 0; // 55px00
} }
> .el-tabs { > .el-tabs {
> .el-tabs__header { > .el-tabs__header {
position: fixed; position: fixed; //
top: 50px; top: 50px; // 50px
left: 230px; left: 230px; // 230px
right: 0; right: 0; // 0
z-index: 930; z-index: 930; // z
padding: 0 55px 0 15px; padding: 0 55px 0 15px; //
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .12), 0 0 6px 0 rgba(0, 0, 0, .04); box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .12), 0 0 6px 0 rgba(0, 0, 0, .04); //
background-color: #fff; background-color: #fff; //
> .el-tabs__nav-wrap { > .el-tabs__nav-wrap {
margin-bottom: 0; margin-bottom: 0; // 0
&:after { &:after {
display: none; display: none; //
} }
} }
} }
> .el-tabs__content { > .el-tabs__content {
padding: 0 15px 15px; padding: 0 15px 15px; //
> .site-tabs__tools { > .site-tabs__tools {
position: fixed; position: fixed; //
top: 50px; top: 50px; // 50px
right: 0; right: 0; // 0
z-index: 931; z-index: 931; // z
height: 40px; height: 40px; // 40px
padding: 0 12px; padding: 0 12px; //
font-size: 16px; font-size: 16px; // 16px
line-height: 40px; line-height: 40px; // 40px
background-color: $content--background-color; background-color: $content--background-color; //
cursor: pointer; cursor: pointer; //
.el-icon--right { .el-icon--right {
margin-left: 0; margin-left: 0; // 0
} }
} }
} }
@ -405,8 +415,8 @@ img {
} }
.el-table__expand-icon { .el-table__expand-icon {
display: inline-block; display: inline-block; //
width: 14px; width: 14px; // 14px
vertical-align: middle; vertical-align: middle; //
margin-right: 5px; margin-right: 5px; // 5px
} }

@ -1,12 +1,11 @@
/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */ /*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */
/* Document //* Document
========================================================================== */ ========================================================================== */
/** /**
* 1. Correct the line height in all browsers. * 1.
* 2. Prevent adjustments of font size after orientation changes in * 2. Windows Phone iOS IE
* IE on Windows Phone and in iOS.
*/ */
html { html {
@ -19,7 +18,7 @@ html {
========================================================================== */ ========================================================================== */
/** /**
* Remove the margin in all browsers (opinionated). *
*/ */
body { body {
@ -27,7 +26,7 @@ body {
} }
/** /**
* Add the correct display in IE 9-. * IE 9-
*/ */
article, article,
@ -40,8 +39,7 @@ section {
} }
/** /**
* Correct the font size and margin on `h1` elements within `section` and * ChromeFirefox Safari `h1` `section` `article`
* `article` contexts in Chrome, Firefox, and Safari.
*/ */
h1 { h1 {
@ -53,8 +51,8 @@ h1 {
========================================================================== */ ========================================================================== */
/** /**
* Add the correct display in IE 9-. * IE 9-
* 1. Add the correct display in IE. * 1. IE
*/ */
figcaption, figcaption,
@ -64,7 +62,7 @@ main { /* 1 */
} }
/** /**
* Add the correct margin in IE 8. * IE 8
*/ */
figure { figure {
@ -72,8 +70,8 @@ figure {
} }
/** /**
* 1. Add the correct box sizing in Firefox. * 1. Firefox
* 2. Show the overflow in Edge and IE. * 2. Edge IE
*/ */
hr { hr {
@ -83,8 +81,8 @@ hr {
} }
/** /**
* 1. Correct the inheritance and scaling of font size in all browsers. * 1.
* 2. Correct the odd `em` font sizing in all browsers. * 2. `em`
*/ */
pre { pre {
@ -96,8 +94,8 @@ pre {
========================================================================== */ ========================================================================== */
/** /**
* 1. Remove the gray background on active links in IE 10. * 1. IE 10
* 2. Remove gaps in links underline in iOS 8+ and Safari 8+. * 2. iOS 8+ Safari 8+ 线
*/ */
a { a {
@ -106,8 +104,8 @@ a {
} }
/** /**
* 1. Remove the bottom border in Chrome 57- and Firefox 39-. * 1. Chrome 57- Firefox 39-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. * 2. ChromeEdgeIEOpera Safari
*/ */
abbr[title] { abbr[title] {
@ -117,7 +115,7 @@ abbr[title] {
} }
/** /**
* Prevent the duplicate application of `bolder` by the next rule in Safari 6. * Safari 6 `bolder`
*/ */
b, b,
@ -126,7 +124,7 @@ strong {
} }
/** /**
* Add the correct font weight in Chrome, Edge, and Safari. * ChromeEdge Safari
*/ */
b, b,
@ -135,8 +133,8 @@ strong {
} }
/** /**
* 1. Correct the inheritance and scaling of font size in all browsers. * 1.
* 2. Correct the odd `em` font sizing in all browsers. * 2. `em`
*/ */
code, code,
@ -147,7 +145,7 @@ samp {
} }
/** /**
* Add the correct font style in Android 4.3-. * Android 4.3-
*/ */
dfn { dfn {
@ -155,7 +153,7 @@ dfn {
} }
/** /**
* Add the correct background and color in IE 9-. * IE 9-
*/ */
mark { mark {
@ -164,7 +162,7 @@ mark {
} }
/** /**
* Add the correct font size in all browsers. *
*/ */
small { small {
@ -172,8 +170,7 @@ small {
} }
/** /**
* Prevent `sub` and `sup` elements from affecting the line height in * `sub` `sup`
* all browsers.
*/ */
sub, sub,
@ -196,7 +193,7 @@ sup {
========================================================================== */ ========================================================================== */
/** /**
* Add the correct display in IE 9-. * IE 9-
*/ */
audio, audio,
@ -205,7 +202,7 @@ video {
} }
/** /**
* Add the correct display in iOS 4-7. * iOS 4-7
*/ */
audio:not([controls]) { audio:not([controls]) {
@ -214,7 +211,7 @@ audio:not([controls]) {
} }
/** /**
* Remove the border on images inside links in IE 10-. * IE 10-
*/ */
img { img {
@ -222,19 +219,20 @@ img {
} }
/** /**
* Hide the overflow in IE. * IE
*/ */
svg:not(:root) { svg:not(:root) {
overflow: hidden; overflow: hidden;
} }
/* Forms /* Forms
========================================================================== */ ========================================================================== */
/** /**
* 1. Change the font styles in all browsers (opinionated). * 1.
* 2. Remove the margin in Firefox and Safari. * 2. Firefox Safari
*/ */
button, button,
@ -249,8 +247,8 @@ textarea {
} }
/** /**
* Show the overflow in IE. * IE
* 1. Show the overflow in Edge. * 1. Edge
*/ */
button, button,
@ -259,8 +257,8 @@ input { /* 1 */
} }
/** /**
* Remove the inheritance of text transform in Edge, Firefox, and IE. * EdgeFirefox IE
* 1. Remove the inheritance of text transform in Firefox. * 1. Firefox
*/ */
button, button,
@ -269,9 +267,8 @@ select { /* 1 */
} }
/** /**
* 1. Prevent a WebKit bug where (2) destroys native `audio` and `video` * 1. WebKit bug bug Android 4 `audio` `video`
* controls in Android 4. * 2. iOS Safari
* 2. Correct the inability to style clickable types in iOS and Safari.
*/ */
button, button,
@ -282,7 +279,7 @@ html [type="button"], /* 1 */
} }
/** /**
* Remove the inner border and padding in Firefox. * Firefox
*/ */
button::-moz-focus-inner, button::-moz-focus-inner,
@ -294,7 +291,7 @@ button::-moz-focus-inner,
} }
/** /**
* Restore the focus styles unset by the previous rule. *
*/ */
button:-moz-focusring, button:-moz-focusring,
@ -305,7 +302,7 @@ button:-moz-focusring,
} }
/** /**
* Correct the padding in Firefox. * Firefox
*/ */
fieldset { fieldset {
@ -313,10 +310,9 @@ fieldset {
} }
/** /**
* 1. Correct the text wrapping in Edge and IE. * 1. Edge IE
* 2. Correct the color inheritance from `fieldset` elements in IE. * 2. IE `fieldset`
* 3. Remove the padding so developers are not caught out when they zero out * 3. `fieldset`
* `fieldset` elements in all browsers.
*/ */
legend { legend {
@ -329,8 +325,8 @@ legend {
} }
/** /**
* 1. Add the correct display in IE 9-. * 1. IE 9+
* 2. Add the correct vertical alignment in Chrome, Firefox, and Opera. * 2. ChromeFirefox Opera
*/ */
progress { progress {
@ -339,7 +335,7 @@ progress {
} }
/** /**
* Remove the default vertical scrollbar in IE. * IE
*/ */
textarea { textarea {
@ -347,8 +343,8 @@ textarea {
} }
/** /**
* 1. Add the correct box sizing in IE 10-. * 1. IE 10+
* 2. Remove the padding in IE 10-. * 2. IE 10+
*/ */
[type="checkbox"], [type="checkbox"],
@ -358,7 +354,7 @@ textarea {
} }
/** /**
* Correct the cursor style of increment and decrement buttons in Chrome. * Chrome
*/ */
[type="number"]::-webkit-inner-spin-button, [type="number"]::-webkit-inner-spin-button,
@ -367,8 +363,8 @@ textarea {
} }
/** /**
* 1. Correct the odd appearance in Chrome and Safari. * 1. Chrome Safari
* 2. Correct the outline style in Safari. * 2. Safari
*/ */
[type="search"] { [type="search"] {
@ -377,7 +373,7 @@ textarea {
} }
/** /**
* Remove the inner padding and cancel buttons in Chrome and Safari on macOS. * Chrome Safari on macOS
*/ */
[type="search"]::-webkit-search-cancel-button, [type="search"]::-webkit-search-cancel-button,
@ -386,8 +382,8 @@ textarea {
} }
/** /**
* 1. Correct the inability to style clickable types in iOS and Safari. * 1. iOS Safari
* 2. Change font properties to `inherit` in Safari. * 2. Safari `inherit`
*/ */
::-webkit-file-upload-button { ::-webkit-file-upload-button {
@ -399,8 +395,8 @@ textarea {
========================================================================== */ ========================================================================== */
/* /*
* Add the correct display in IE 9-. * IE 9+
* 1. Add the correct display in Edge, IE, and Firefox. * 1. EdgeIE Firefox
*/ */
details, /* 1 */ details, /* 1 */
@ -409,7 +405,7 @@ menu {
} }
/* /*
* Add the correct display in all browsers. *
*/ */
summary { summary {
@ -420,7 +416,7 @@ summary {
========================================================================== */ ========================================================================== */
/** /**
* Add the correct display in IE 9-. * IE 9+
*/ */
canvas { canvas {
@ -428,7 +424,7 @@ canvas {
} }
/** /**
* Add the correct display in IE. * IE
*/ */
template { template {
@ -439,7 +435,7 @@ template {
========================================================================== */ ========================================================================== */
/** /**
* Add the correct display in IE 10-. * IE 10+
*/ */
[hidden] { [hidden] {

@ -3,11 +3,15 @@
$--color-primary: #409EFF; $--color-primary: #409EFF;
// Navbar // Navbar
//
$navbar--background-color: $--color-primary; $navbar--background-color: $--color-primary;
// Sidebar // Sidebar
//
$sidebar--background-color-dark: #263238; $sidebar--background-color-dark: #263238;
//
$sidebar--color-text-dark: #8a979e; $sidebar--color-text-dark: #8a979e;
// Content // Content
//
$content--background-color: #f1f4f5; $content--background-color: #f1f4f5;

@ -1,5 +1,7 @@
@import "normalize"; @import "normalize";
// normalize.css
// api: https://github.com/necolas/normalize.css/ // api: https://github.com/necolas/normalize.css/
@import "variables"; @import "variables";
// // 使
@import "base"; @import "base";
//

@ -1,36 +1,40 @@
<template> <template>
<!-- SVG元素使用动态绑定的类名宽度和高度属性 -->
<svg :class="getClassName" :width="width" :height="height" aria-hidden="true"> <svg :class="getClassName" :width="width" :height="height" aria-hidden="true">
<!-- 使用xlink:href属性引用外部定义的SVG符号 -->
<use :xlink:href="getName"></use> <use :xlink:href="getName"></use>
</svg> </svg>
</template> </template>
<script> <script>
export default { export default {
name: 'icon-svg', name: 'icon-svg', // 'icon-svg'
props: { props: {
name: { name: {
type: String, type: String, // 'name'
required: true required: true // 'name'
}, },
className: { className: {
type: String type: String // 'className'
}, },
width: { width: {
type: String type: String // 'width'
}, },
height: { height: {
type: String type: String // 'height'
} }
}, },
computed: { computed: {
// 'getName'ID
getName() { getName() {
return `#icon-${this.name}` return `#icon-${this.name}`
}, },
// 'getClassName'
getClassName() { getClassName() {
return [ return [
'icon-svg', 'icon-svg', //
`icon-svg__${this.name}`, `icon-svg__${this.name}`, // 'name'
this.className && /\S/.test(this.className) ? `${this.className}` : '' this.className && /\S/.test(this.className) ? `${this.className}` : '' // 'className'
] ]
} }
} }
@ -38,10 +42,11 @@ export default {
</script> </script>
<style> <style>
/* 样式定义 */
.icon-svg { .icon-svg {
width: 1em; width: 1em; // 1em
height: 1em; height: 1em; // 1em
fill: currentColor; fill: currentColor; //
overflow: hidden; overflow: hidden; //
} }
</style> </style>

@ -1,7 +1,11 @@
<template> <template>
<!-- 定义一个表格列绑定属性和插槽 -->
<el-table-column :prop="prop" v-bind="$attrs"> <el-table-column :prop="prop" v-bind="$attrs">
<!-- 自定义单元格内容 -->
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 点击时触发toggleHandle方法并应用样式 -->
<span @click.prevent="toggleHandle(scope.$index, scope.row)" :style="childStyles(scope.row)"> <span @click.prevent="toggleHandle(scope.$index, scope.row)" :style="childStyles(scope.row)">
<!-- 根据行数据动态设置图标类和样式 -->
<i :class="iconClasses(scope.row)" :style="iconStyles(scope.row)"></i> <i :class="iconClasses(scope.row)" :style="iconStyles(scope.row)"></i>
{{ scope.row[prop] }} {{ scope.row[prop] }}
</span> </span>
@ -10,74 +14,81 @@
</template> </template>
<script> <script>
// lodashisArray
import isArray from 'lodash/isArray' import isArray from 'lodash/isArray'
export default { export default {
name: 'table-tree-column', name: 'table-tree-column', //
props: { props: {
prop: { prop: {
type: String type: String //
}, },
treeKey: { treeKey: {
type: String, type: String,
default: 'id' default: 'id' // 'id'
}, },
parentKey: { parentKey: {
type: String, type: String,
default: 'parentId' default: 'parentId' // 'parentId'
}, },
levelKey: { levelKey: {
type: String, type: String,
default: '_level' default: '_level' // '_level'
}, },
childKey: { childKey: {
type: String, type: String,
default: 'children' default: 'children' // 'children'
} }
}, },
methods: { methods: {
//
childStyles(row) { childStyles(row) {
return { 'padding-left': (row[this.levelKey] > 1 ? row[this.levelKey] * 7 : 0) + 'px' } return { 'padding-left': (row[this.levelKey] > 1 ? row[this.levelKey] * 7 : 0) + 'px' }
}, },
//
iconClasses(row) { iconClasses(row) {
return [!row._expanded ? 'el-icon-caret-right' : 'el-icon-caret-bottom'] return [!row._expanded ? 'el-icon-caret-right' : 'el-icon-caret-bottom']
}, },
//
iconStyles(row) { iconStyles(row) {
return { 'visibility': this.hasChild(row) ? 'visible' : 'hidden' } return { 'visibility': this.hasChild(row) ? 'visible' : 'hidden' }
}, },
//
hasChild(row) { hasChild(row) {
return (isArray(row[this.childKey]) && row[this.childKey].length >= 1) || false return (isArray(row[this.childKey]) && row[this.childKey].length >= 1) || false
}, },
// //
toggleHandle(index, row) { toggleHandle(index, row) {
if (this.hasChild(row)) { if (this.hasChild(row)) {
var data = this.$parent.store.states.data.slice(0) var data = this.$parent.store.states.data.slice(0) //
data[index]._expanded = !data[index]._expanded data[index]._expanded = !data[index]._expanded //
if (data[index]._expanded) { if (data[index]._expanded) {
//
data = data.splice(0, index + 1).concat(row[this.childKey]).concat(data) data = data.splice(0, index + 1).concat(row[this.childKey]).concat(data)
} else { } else {
//
data = this.removeChildNode(data, row[this.treeKey]) data = this.removeChildNode(data, row[this.treeKey])
} }
this.$parent.store.commit('setData', data) this.$parent.store.commit('setData', data) //
this.$nextTick(() => { this.$nextTick(() => {
this.$parent.doLayout() this.$parent.doLayout() //
}) })
} }
}, },
// //
removeChildNode(data, parentId) { removeChildNode(data, parentId) {
var parentIds = isArray(parentId) ? parentId : [parentId] var parentIds = isArray(parentId) ? parentId : [parentId] // parentId
if (parentId.length <= 0) { if (parentId.length <= 0) {
return data return data // parentId
} }
var ids = [] var ids = [] // ID
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
if (parentIds.indexOf(data[i][this.parentKey]) !== -1 && parentIds.indexOf(data[i][this.treeKey]) === -1) { if (parentIds.indexOf(data[i][this.parentKey]) !== -1 && parentIds.indexOf(data[i][this.treeKey]) === -1) {
data[i]._expanded = false data[i]._expanded = false //
ids.push(data.splice(i, 1)[0][this.treeKey]) ids.push(data.splice(i, 1)[0][this.treeKey]) // ID
i-- i-- //
} }
} }
return this.removeChildNode(data, ids) return this.removeChildNode(data, ids) //
} }
} }
} }

@ -1,22 +1,26 @@
<template> <template>
<!-- 面板容器使用flex布局 -->
<div class="panel flex flex-wrap"> <div class="panel flex flex-wrap">
<!-- 动态生成的标签列表 -->
<el-tag v-for="tag in dynamicTags" closable @close="handleClose(tag)" :disable-transitions="false" :key="tag"> <el-tag v-for="tag in dynamicTags" closable @close="handleClose(tag)" :disable-transitions="false" :key="tag">
{{tag}} {{tag}}
</el-tag> </el-tag>
<!-- 输入框用于添加新标签 -->
<el-input class="input-new-tag" v-if="inputVisible" v-model="inputValue" ref="saveTagInput" size="small" @keyup.enter.native="handleInputConfirm" @blur="handleInputConfirm"> <el-input class="input-new-tag" v-if="inputVisible" v-model="inputValue" ref="saveTagInput" size="small" @keyup.enter.native="handleInputConfirm" @blur="handleInputConfirm">
</el-input> </el-input>
<!-- 按钮点击后显示输入框 -->
<el-button v-else class="button-new-tag" size="small" @click="showInput">+ </el-button> <el-button v-else class="button-new-tag" size="small" @click="showInput">+ </el-button>
</div> </div>
</template> </template>
<script>
/** /**
* 标签编辑器 * 标签编辑器组件
*/ */
let touchMoved = false; let touchMoved = false; //
export default { export default {
name: 'tags-editor', name: 'tags-editor', //
props: { props: {
value: { value: { //
type: String, type: String,
required: true, required: true,
default: "" default: ""
@ -28,50 +32,52 @@ export default {
}, },
data() { data() {
return { return {
inputVisible: false, inputVisible: false, //
inputValue: '' inputValue: '' //
} }
}, },
computed: { computed: {
dynamicTags() { dynamicTags() { // value
if (this.value != "") return this.value.split(',') if (this.value != "") return this.value.split(',')
return [] return []
} }
}, },
methods: { methods: {
handleClose(tag) { handleClose(tag) { //
let newTags = this.dynamicTags; let newTags = this.dynamicTags; //
newTags.splice(newTags.indexOf(tag), 1); newTags.splice(newTags.indexOf(tag), 1); //
this.$emit('input', newTags.join(",")); this.$emit('input', newTags.join(",")); //
}, },
showInput() { showInput() { //
this.inputVisible = true; this.inputVisible = true; //
this.$nextTick(_ => { this.$nextTick(_ => { // DOM
this.$refs.saveTagInput.$refs.input.focus(); this.$refs.saveTagInput.$refs.input.focus(); //
}); });
}, },
handleInputConfirm() { handleInputConfirm() { //
let inputValue = this.inputValue; let inputValue = this.inputValue; //
let newTags = this.dynamicTags; let newTags = this.dynamicTags; //
if (inputValue && newTags.indexOf(inputValue) < 0) { if (inputValue && newTags.indexOf(inputValue) < 0) { //
newTags.push(inputValue); newTags.push(inputValue); //
} }
this.inputVisible = false; this.inputVisible = false; //
this.inputValue = ''; this.inputValue = ''; //
this.$emit('input', newTags.join(",")); this.$emit('input', newTags.join(",")); //
} }
} }
} }
</script>
<style scoped> <style scoped>
/* 面板样式 */
.panel { .panel {
flex: 1; flex: 1; /* 弹性布局,占满剩余空间 */
} }
/* 标签和按钮样式 */
.el-tag,.button-new-tag{ .el-tag,.button-new-tag{
margin: 5px; margin: 5px; /* 外边距 */
} }
/* 输入框样式 */
.input-new-tag { .input-new-tag {
width: inherit; width: inherit; /* 继承父元素的宽度 */
} }
</style> </style>

@ -1,185 +1,207 @@
<template> <template>
<!-- 模态对话框用于筛选模板消息目标用户 -->
<el-dialog title="筛选模板消息目标用户" :close-on-click-modal="false" :visible.sync="visible"> <el-dialog title="筛选模板消息目标用户" :close-on-click-modal="false" :visible.sync="visible">
<!-- 表单布局为行内绑定数据模型dataForm清除按钮可清空输入框 -->
<el-form :inline="true" :model="dataForm" ref="dataForm" clearable @keyup.enter.native="getWxUsers()"> <el-form :inline="true" :model="dataForm" ref="dataForm" clearable @keyup.enter.native="getWxUsers()">
<!-- 用户标签选择框 -->
<el-form-item> <el-form-item>
<el-select v-model="dataForm.tagid" filterable placeholder="用户标签" @change="getWxUsers()"> <el-select v-model="dataForm.tagid" filterable placeholder="用户标签" @change="getWxUsers()">
<!-- 遍历用户标签列表生成选项 -->
<el-option v-for="item in wxUserTags" :key="item.id" :label="item.name" :value="item.id+''"></el-option> <el-option v-for="item in wxUserTags" :key="item.id" :label="item.name" :value="item.id+''"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 昵称输入框 -->
<el-form-item> <el-form-item>
<el-input v-model="dataForm.nickname" placeholder="昵称" @change="getWxUsers()" clearable></el-input> <el-input v-model="dataForm.nickname" placeholder="昵称" @change="getWxUsers()" clearable></el-input>
</el-form-item> </el-form-item>
<!-- 省份输入框 -->
<el-form-item> <el-form-item>
<el-input v-model="dataForm.province" placeholder="省份" @change="getWxUsers()" clearable></el-input> <el-input v-model="dataForm.province" placeholder="省份" @change="getWxUsers()" clearable></el-input>
</el-form-item> </el-form-item>
<!-- 城市输入框 -->
<el-form-item> <el-form-item>
<el-input v-model="dataForm.city" placeholder="城市" @change="getWxUsers()" clearable></el-input> <el-input v-model="dataForm.city" placeholder="城市" @change="getWxUsers()" clearable></el-input>
</el-form-item> </el-form-item>
<!-- 备注输入框 -->
<el-form-item> <el-form-item>
<el-input v-model="dataForm.remark" placeholder="备注" @change="getWxUsers()" clearable></el-input> <el-input v-model="dataForm.remark" placeholder="备注" @change="getWxUsers()" clearable></el-input>
</el-form-item> </el-form-item>
<!-- 扫码场景值输入框 -->
<el-form-item> <el-form-item>
<el-input v-model="dataForm.qrScene" placeholder="扫码场景值" @change="getWxUsers()" clearable></el-input> <el-input v-model="dataForm.qrScene" placeholder="扫码场景值" @change="getWxUsers()" clearable></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- 显示将发送的消息预览 -->
<div class="text-bold">本消息将发送给</div> <div class="text-bold">本消息将发送给</div>
<!-- 用户列表区域加载状态时显示加载动画 -->
<div class="user-list" v-loading="wxUsersLoading"> <div class="user-list" v-loading="wxUsersLoading">
<!-- 遍历用户列表生成用户卡片 -->
<div class="user-card" v-for="item in wxUserList" :key="item.openid"> <div class="user-card" v-for="item in wxUserList" :key="item.openid">
<!-- 用户头像 -->
<el-avatar :src="item.headimgurl"></el-avatar> <el-avatar :src="item.headimgurl"></el-avatar>
<!-- 用户昵称 -->
<div class="nickname">{{item.nickname}}</div> <div class="nickname">{{item.nickname}}</div>
</div> </div>
<!-- 当用户数量超过10个时显示省略号和总用户数 -->
<div class="text-bold"> <div class="text-bold">
<span v-show="totalCount>10">...</span> <span v-show="totalCount>10">...</span>
等共<span class="text-success">{{totalCount}}</span>个用户 等共<span class="text-success">{{totalCount}}</span>个用户
</div> </div>
</div> </div>
<!-- 消息预览标题 -->
<div class="margin-top text-bold">消息预览</div> <div class="margin-top text-bold">消息预览</div>
<!-- 消息预览内容禁用编辑且自动调整大小 -->
<div class="margin-top-xs"> <div class="margin-top-xs">
<el-input type="textarea" disabled autosize v-model="msgReview" placeholder="模版"></el-input> <el-input type="textarea" disabled autosize v-model="msgReview" placeholder="模版"></el-input>
</div> </div>
<!-- 底部操作栏 -->
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<!-- 发送按钮根据发送状态显示不同文本 -->
<el-button @click="send" type="success" :disabled="totalCount<=0 || sending">{{sending?'发送中...':'发送'}}</el-button> <el-button @click="send" type="success" :disabled="totalCount<=0 || sending">{{sending?'发送中...':'发送'}}</el-button>
<!-- 关闭按钮 -->
<el-button @click="visible=false"></el-button> <el-button @click="visible=false"></el-button>
</span> </span>
</el-dialog> </div>
</template> </template>
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
export default { export default {
name:'template-msg-task', name: 'template-msg', //
props: { props: {
wxUserTagName:{ //
type:String, wxUserTagName: String,
required:false
}
}, },
data() { data() {
return { return {
visible:false, visible: false, //
wxUsersLoading:false, wxUsersLoading: false, //
sending:false, dataForm: { //
msgTemplate:{}, page: 1, //
dataForm: { sidx: 'subscribe_time', //
page:1, order: 'desc', //
sidx: 'subscribe_time', tagid: '', // ID
order: 'desc', nickname: '', //
tagid:'', province: '', //
nickname: '', city: '', //
city:'', remark: '', //
province:'', qrScene: '', //
remark:'',
qrScene:''
}, },
wxUserList:[], msgTemplate: {}, //
totalCount:0 wxUserList: [], //
totalCount: 0, //
} }
}, },
computed: mapState({ computed: mapState({
wxUserTags:state=>state.wxUserTags.tags, wxUserTags: state => state.wxUserTags.tags, // Vuex
msgReview(){ msgReview(): string { //
if(!this.msgTemplate.data) return "" if (!this.msgTemplate.data) return "" //
let content = this.msgTemplate.content let content = this.msgTemplate.content //
this.msgTemplate.data.forEach(item=>{ this.msgTemplate.data.forEach(item => { //
content = content.replace("{{"+item.name+".DATA}}",item.value) content = content.replace("{{" + item.name + ".DATA}}", item.value) //
}) })
return content return content //
} }
}), }),
mounted() { mounted() {
this.getWxUserTags().then((taglist)=>{ this.getWxUserTags().then((taglist) => { //
if(this.wxUserTagName){ if (this.wxUserTagName) { //
let tagItem = taglist.find(tag=>tag.name==this.wxUserTagName) let tagItem = taglist.find(tag => tag.name === this.wxUserTagName) //
console.log(tagItem) if (tagItem) { //
if(tagItem) { this.dataForm.tagid = tagItem.id + '' // IDID
this.dataForm.tagid=tagItem.id+''
} }
} }
this.getWxUsers() this.getWxUsers(); //
}); });
}, },
methods: { methods: {
init(msgTemplate){ init(msgTemplate) { //
if(!msgTemplate || !msgTemplate.templateId){ if (!msgTemplate || !msgTemplate.templateId) { // ID
this.$message.error('消息模板无效') this.$message.error('消息模板无效') //
return return //
} }
if(!msgTemplate.data || !(msgTemplate.data instanceof Array)){ if (!msgTemplate.data || !(msgTemplate.data instanceof Array)) { //
this.$message.error('请现配置此模板填充数据') this.$message.error('请现配置此模板填充数据') //
return return //
} }
this.msgTemplate=msgTemplate this.msgTemplate = msgTemplate //
this.visible=true; this.visible = true; //
}, },
getWxUserTags() { getWxUserTags() { //
return new Promise((resolve,reject)=>{ return new Promise((resolve, reject) => { // Promise
this.$http({ this.$http({ // HTTP
url: this.$http.adornUrl('/manage/wxUserTags/list'), url: this.$adorn.url('/manage/wxUserTags/list'), // URL
method: 'get', method: 'get', // HTTPGET
}).then(({ data }) => { params: this.$adorn.params({}) //
if (data && data.code === 200) { }).then((response) => { //
this.$store.commit('wxUserTags/updateTags', data.list) if (response.data.code == 200) { // 200
resolve(data.list) this.$store.dispatch('wxUserTags/updateTags', response.data.list) // Vuex
resolve(response.data.list) // Promise
} else { } else {
this.$message.error(data.msg) this.$message.error(response.data.msg) //
reject(data.msg) reject(response.data.msg) // Promise
} }
}).catch(err=>reject(err)) }).catch(err=>reject(err)) // Promise
}) });
}, },
getWxUsers() { getWxUsers() { //
this.wxUsersLoading = true this.wxUsersLoading = true // true
this.$http({ this.$http({ // HTTP
url: this.$http.adornUrl('/manage/wxUser/list'), url: this.$adorn.url('/manage/wxUser/list'), // URL
method: 'get', method: 'get', // HTTPGET
params: this.$http.adornParams(this.dataForm) params: this.$adorn.params(this.dataForm) //
}).then(({ data }) => { }).then((response) => { //
if (data && data.code === 200) { if (response.data.code == 200) { // 200
this.wxUserList = data.page.list this.wxUserList = response.data.page.list //
this.totalCount = data.page.totalCount this.totalCount = response.data.page.totalCount //
} else { } else {
this.$message.error(data.msg) this.$message.error(response.data.msg) //
} }
this.wxUsersLoading = false this.wxUsersLoading = false // false
}) }).catch(err=>reject(err)) // Promise
}, },
send(){ send() { //
if(this.sending)return if (this.sending) return //
this.sending=true this.sending = true // true
this.$http({ this.$http({ // HTTP
url: this.$http.adornUrl('/manage/msgTemplate/sendMsgBatch'), url: this.$adorn.url('/manage/msgTemplate/sendMsgBatch'), // URL
method: 'post', method: 'post', // HTTPPOST
data:this.$http.adornData({ data: this.$adorn.data({ //
wxUserFilterParams : this.dataForm, wxUserFilterParams: this.dataForm, //
templateId : this.msgTemplate.templateId, templateId: this.msgTemplate.templateId, // IDID
url : this.msgTemplate.url, url: this.msgTemplate.url, // URLURL
miniprogram : this.msgTemplate.miniprogram, miniprogram: this.msgTemplate.miniprogram, // miniprogram
data : this.msgTemplate.data, data: this.msgTemplate.data, // data
}) })
}).then(({ data }) => { }).then((response) => { //
this.sending = false this.sending = false // false
if (data && data.code === 200) { if (response.data.code == 200) { // 200
this.$message.success("消息将在后台发送") this.$message.success("消息将在后台发送") //
this.visible=false this.visible = false; //
} else { } else {
this.$message.error(data.msg) this.$message.error(response.data.msg) //
} }
}) }).catch(err=>reject(err)) // Promise
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
/* 用户列表样式 */
.user-list{ .user-list{
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
align-items: center; align-items: center;
} }
/* 用户卡片样式 */
.user-card{ .user-card{
overflow: hidden; overflow: hidden;
max-width: 60px; max-width: 60px;
margin: 5px; margin: 5px;
text-align: center; text-align: center;
} }
/* 昵称样式 */
.nickname{ .nickname{
color: #999999; color: #999999;
overflow: hidden; overflow: hidden;

@ -1,99 +1,102 @@
<template> <template>
<!-- 定义一个包含TinyMCE编辑器的div容器 -->
<div class="tinymce-editor"> <div class="tinymce-editor">
<!-- 使用TinyMCE组件绑定v-model为myValue初始化配置为init监听onExecCommand事件 -->
<editor v-model="myValue" :init="init" @onExecCommand="onExecCommand"></editor> <editor v-model="myValue" :init="init" @onExecCommand="onExecCommand"></editor>
</div> </div>
</template> </template>
<script>
import Editor from "@tinymce/tinymce-vue";
var cos; import Editor from "@tinymce/tinymce-vue"; // TinyMCE Vue
var cos; // cos
export default { export default {
name: "tinymce-editor", name: "tinymce-editor", //
components: { components: {
Editor Editor // TinyMCE
}, },
props: { props: {
value: { value: {
type: String, type: String, // value
default: "" default: "" //
} }
}, },
data() { data() {
return { return {
// TinyMCE
init: { init: {
language_url: "./tinymce/zh_CN.js", //public language_url: "./tinymce/zh_CN.js", //
language: "zh_CN", language: "zh_CN", //
height: 500, height: 500, //
plugins: "lists image media table paste link searchreplace anchor code preview pagebreak importcss", plugins: "lists image media table paste link searchreplace anchor code preview pagebreak importcss", //
toolbar: "undo redo searchreplace | formatselect pagebreak | bold italic forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | lists link anchor image media table | removeformat code preview", // toolbar: "undo redo searchreplace | formatselect pagebreak | bold italic forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | lists link anchor image media table | removeformat code preview", //
toolbar_drawer: false, toolbar_drawer: false, //
image_advtab: true, image_advtab: true, //
object_resizing: false, object_resizing: false, //
paste_data_images: true, paste_data_images: true, //
content_css: "./tinymce/article.css", content_css: "./tinymce/article.css", //
images_upload_handler: (blobInfo, success, failure) => { images_upload_handler: (blobInfo, success, failure) => {
//
this.uploadFile(blobInfo.blob()).then(fileUrl => success(fileUrl)).catch(err => failure(err)) this.uploadFile(blobInfo.blob()).then(fileUrl => success(fileUrl)).catch(err => failure(err))
} }
}, },
myValue: this.value, myValue: this.value, // valuemyValue
uploading: false, uploading: false, //
cosConfig: [] cosConfig: [] //
}; };
}, },
mounted() { mounted() {
// console.log('tinymce-editor mounted:',this.value) // console.log('tinymce-editor mounted:',this.value) // value
tinymce.init({}); tinymce.init({}); // TinyMCE
this.cosInit(); this.cosInit(); // cosInit
}, },
methods: { methods: {
cosInit() { cosInit() {
// HTTP
this.$http({ this.$http({
url: this.$http.adornUrl("/sys/oss/config"), url: this.$http.adornUrl("/sys/oss/config"), // URL
method: "get", method: "get", // HTTPGET
params: this.$http.adornParams() params: this.$http.adornParams() //
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 200) { if (data && data.code === 200) {
this.cosConfig = data.config; this.cosConfig = data.config; // cosConfig
} else { } else {
this.$message.error("请先配置云存储相关信息!"); this.$message.error("请先配置云存储相关信息!"); //
} }
}); });
}, },
onExecCommand(e) { onExecCommand(e) {
//console.log(e) //console.log(e) //
}, },
uploadFile(file) { uploadFile(file) {
this.uploading = true; this.uploading = true; // true
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let formData = new FormData(); let formData = new FormData(); // FormData
formData.append("file", file); formData.append("file", file); // FormData
// HTTP
this.$http({ this.$http({
url: this.$http.adornUrl('/sys/oss/upload'), url: this.$http.adornUrl('/sys/oss/upload'), // URL
method: 'post', method: 'post', // HTTPPOST
data: formData data: formData // FormData
}).then(({ data }) => { }).then(({ data }) => {
console.log(data) console.log(data) //
if (data && data.code === 200) { if (data && data.code === 200) {
this.$emit('uploaded', data.url) this.$emit('uploaded', data.url) // uploadedURL
resolve(data.url) resolve(data.url) // PromiseURL
} else { } else {
this.$message.error("文件上传失败:" + data.msg) this.$message.error("文件上传失败:" + data.msg) //
reject(data.msg) reject(data.msg) // Promise
} }
this.uploading = false; this.uploading = false; // false
}).catch(err=>reject(err)) }).catch(err=>reject(err)) // Promise
}); });
} }
}, },
watch: { watch: {
value(newValue) { value(newValue) {
this.myValue = newValue; this.myValue = newValue; // valuemyValue
}, },
myValue(newValue) { myValue(newValue) {
this.$emit("input", newValue); this.$emit("input", newValue); // myValueinput
} }
} }
}; };
</script>

@ -1,45 +1,46 @@
<template> <template>
<!-- 使用Element UI的el-select组件绑定v-model为selectedAppid设置size为small并添加v-loading指令来控制加载状态 -->
<el-select v-model="selectedAppid" size="small" v-loading="dataListLoading" @change="selectAccount" filterable> <el-select v-model="selectedAppid" size="small" v-loading="dataListLoading" @change="selectAccount" filterable>
<!-- 遍历accountList数组生成el-option选项 -->
<el-option v-for="item in accountList" :key="item.appid" :label="item.name+''+ACCOUNT_TYPES[item.type]+''" :value="item.appid"></el-option> <el-option v-for="item in accountList" :key="item.appid" :label="item.name+''+ACCOUNT_TYPES[item.type]+''" :value="item.appid"></el-option>
</el-select> </el-select>
</template> </template>
<script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
export default { export default {
data() { data() {
return { return {
dataListLoading: false dataListLoading: false // dataListLoading
} }
}, },
computed: mapState({ computed: mapState({
accountList: state=>state.wxAccount.accountList, accountList: state=>state.wxAccount.accountList, // VuexaccountList
ACCOUNT_TYPES: state=>state.wxAccount.ACCOUNT_TYPES, ACCOUNT_TYPES: state=>state.wxAccount.ACCOUNT_TYPES, // VuexACCOUNT_TYPES
selectedAppid:state=>state.wxAccount.selectedAppid selectedAppid:state=>state.wxAccount.selectedAppid // VuexselectedAppid
}), }),
mounted(){ mounted(){
this.getDataList() this.getDataList() // getDataList
}, },
methods:{ methods:{
getDataList() { getDataList() {
this.dataListLoading = true this.dataListLoading = true // dataListLoadingtrue
this.$http({ this.$http({
url: this.$http.adornUrl('/manage/wxAccount/list'), url: this.$http.adornUrl('/manage/wxAccount/list'), // URL
method: 'get' method: 'get' // HTTPGET
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 200) { if (data && data.code === 200) { // 200
this.$store.commit('wxAccount/updateAccountList', data.list) this.$store.commit('wxAccount/updateAccountList', data.list) // mutationaccountList
if(!data.list.length){ if(!data.list.length){ //
this.$message.info("公众号列表为空,请先添加") this.$message.info("公众号列表为空,请先添加") //
} }
} }
this.dataListLoading = false this.dataListLoading = false // dataListLoadingfalse
}) })
}, },
selectAccount(appid){ selectAccount(appid){
if(this.selectedAppid!=appid){ if(this.selectedAppid!=appid){ // appidappid
this.$store.commit('wxAccount/selectAccount', appid) this.$store.commit('wxAccount/selectAccount', appid) // mutationselectedAppid
} }
} }
} }
} }
</script>

@ -1,20 +1,28 @@
<template> <template>
<!-- 消息预览面板 -->
<div class="panel"> <div class="panel">
<!-- 工具提示显示消息方向 -->
<el-tooltip class="item" effect="dark" :content="msg.inOut?'公众号发出的消息':'来自用户的消息'" placement="right"> <el-tooltip class="item" effect="dark" :content="msg.inOut?'公众号发出的消息':'来自用户的消息'" placement="right">
<!-- 根据消息方向显示不同的图标和标签 -->
<el-tag size="mini" v-if="msg.inOut" class="margin-right el-icon-upload2" type="info"></el-tag> <el-tag size="mini" v-if="msg.inOut" class="margin-right el-icon-upload2" type="info"></el-tag>
<el-tag size="mini" v-else class="margin-right el-icon-download"></el-tag> <el-tag size="mini" v-else class="margin-right el-icon-download"></el-tag>
</el-tooltip> </el-tooltip>
<!-- 消息内容展示区域 -->
<span class="panel-content"> <span class="panel-content">
<!-- 文本消息类型 -->
<span v-if="msg.msgType=='text'" v-html="msg.detail.content"></span> <span v-if="msg.msgType=='text'" v-html="msg.detail.content"></span>
<!-- 事件消息类型 -->
<span v-else-if="msg.msgType=='event'"> <span v-else-if="msg.msgType=='event'">
<el-tag size="mini" type="warning" effect="plain">事件</el-tag> <el-tag size="mini" type="warning" effect="plain">事件</el-tag>
<el-tag size="mini" type="info" effect="plain">{{msg.detail.event}}</el-tag> <el-tag size="mini" type="info" effect="plain">{{msg.detail.event}}</el-tag>
{{msg.detail.eventKey}} {{msg.detail.eventKey}}
</span> </span>
<!-- 转客服事件 -->
<span v-else-if="msg.msgType=='transfer_customer_service'"> <span v-else-if="msg.msgType=='transfer_customer_service'">
<el-tag size="mini" type="warning" effect="plain">事件</el-tag> <el-tag size="mini" type="warning" effect="plain">事件</el-tag>
<el-tag size="mini" type="info" effect="plain">消息转客服</el-tag> <el-tag size="mini" type="info" effect="plain">消息转客服</el-tag>
</span> </span>
<!-- 其他消息类型 -->
<span v-else> <span v-else>
<el-tag size="mini" effect="plain">{{XmlMsgType[msg.msgType]}}</el-tag> <el-tag size="mini" effect="plain">{{XmlMsgType[msg.msgType]}}</el-tag>
后台不支持预览 后台不支持预览
@ -22,21 +30,25 @@
</span> </span>
</div> </div>
</template> </template>
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
export default { export default {
name:'wx-msg-preview', name:'wx-msg-preview', //
props:{ props:{
msg:Object msg:Object //
}, },
computed:mapState({ computed:mapState({
// VuexXmlMsgType
XmlMsgType:state=>state.message.XmlMsgType, XmlMsgType:state=>state.message.XmlMsgType,
}) })
} }
</script> </script>
<style scoped> <style scoped>
/* 面板样式 */
.panel,.panel a{ .panel,.panel a{
color: #999; color: #999; //
word-break: break-all; word-break: break-all; //
} }
</style> </style>

@ -1,139 +1,157 @@
<template> <template>
<!-- 模态框用于显示公众号用户标签管理界面 -->
<el-dialog title="公众号用户标签管理" :close-on-click-modal="false" :visible.sync="dialogVisible"> <el-dialog title="公众号用户标签管理" :close-on-click-modal="false" :visible.sync="dialogVisible">
<!-- 面板容器包含标签和输入框 -->
<div class="panel flex flex-wrap" v-loading="submitting"> <div class="panel flex flex-wrap" v-loading="submitting">
<!-- 遍历并显示所有标签 -->
<el-tag v-for="tag in wxUserTags" closable @click="editTag(tag.id,tag.name)" @close="deleteTag(tag.id)" :disable-transitions="false" :key="tag.id"> <el-tag v-for="tag in wxUserTags" closable @click="editTag(tag.id,tag.name)" @close="deleteTag(tag.id)" :disable-transitions="false" :key="tag.id">
{{tag.id}} {{tag.name}} {{tag.id}} {{tag.name}}
</el-tag> </el-tag>
<!-- 当inputVisible为true时显示输入框否则显示添加按钮 -->
<el-input class="input-new-tag" v-if="inputVisible" placeholder="回车确认" v-model="inputValue" ref="saveTagInput" size="small" @keyup.enter.native="addTag"> <el-input class="input-new-tag" v-if="inputVisible" placeholder="回车确认" v-model="inputValue" ref="saveTagInput" size="small" @keyup.enter.native="addTag">
</el-input> </el-input>
<el-button v-else class="button-new-tag" size="small" @click="showInput">+ </el-button> <el-button v-else class="button-new-tag" size="small" @click="showInput">+ </el-button>
</div> </div>
<!-- 对话框底部的关闭按钮 -->
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible=false"></el-button> <el-button @click="dialogVisible=false"></el-button>
</span> </span>
</el-dialog> </el-dialog>
</template> </template>
<script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
export default { export default {
name: 'wx-user-tags-manager', name: 'wx-user-tags-manager', //
props: { props: {
visible: { visible: {
type: Boolean, type: Boolean, //
default: true default: true // true
} }
}, },
data() { data() {
return { return {
dialogVisible:false, dialogVisible: false, //
inputVisible: false, inputVisible: false, //
inputValue: '', inputValue: '', //
submitting:false, submitting: false, //
} }
}, },
computed: mapState({ computed: mapState({
// VuexwxUserTags
wxUserTags: state => state.wxUserTags.tags wxUserTags: state => state.wxUserTags.tags
}), }),
mounted() { mounted() {
//
this.getWxUserTags(); this.getWxUserTags();
}, },
methods: { methods: {
//
show(){ show(){
this.dialogVisible = true; this.dialogVisible = true;
}, },
//
getWxUserTags() { getWxUserTags() {
this.$http({ this.$http({
url: this.$http.adornUrl('/manage/wxUserTags/list'), url: this.$http.adornUrl('/manage/wxUserTags/list'), // URL
method: 'get', method: 'get', // HTTPGET
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 200) { if (data && data.code === 200) {
// Vuex
this.$store.commit('wxUserTags/updateTags', data.list) this.$store.commit('wxUserTags/updateTags', data.list)
} else { } else {
//
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
}, },
//
deleteTag(tagid) { deleteTag(tagid) {
if(this.submitting){ if(this.submitting){
return return //
} }
this.$confirm(`确定删除标签?`, '提示', { this.$confirm(`确定删除标签?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定', //
cancelButtonText: '取消', cancelButtonText: '取消', //
type: 'warning' type: 'warning' //
}).then(() => { }).then(() => {
this.submitting=true this.submitting = true // true
this.$http({ this.$http({
url: this.$http.adornUrl('/manage/wxUserTags/delete/'+tagid), url: this.$http.adornUrl('/manage/wxUserTags/delete/' + tagid), // URL
method: 'post', method: 'post', // HTTPPOST
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 200) { if (data && data.code === 200) {
this.getWxUserTags(); this.getWxUserTags(); //
this.$emit('change'); this.$emit('change'); // change
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg) //
} }
this.submitting=false; this.submitting = false; //
}) })
}) })
}, },
//
showInput() { showInput() {
this.inputVisible = true; this.inputVisible = true; //
this.$nextTick(_ => { this.$nextTick(_ => {
this.$refs.saveTagInput.$refs.input.focus(); this.$refs.saveTagInput.$refs.input.focus(); //
}); });
}, },
//
addTag() { addTag() {
let newTagName = this.inputValue; let newTagName = this.inputValue; //
this.saveTag(newTagName) this.saveTag(newTagName) //
this.inputVisible = false; this.inputVisible = false; //
this.inputValue = ''; this.inputValue = ''; //
}, },
//
editTag(tagid, orignName=''){ editTag(tagid, orignName=''){
this.$prompt('请输入新标签名称', '提示', { this.$prompt('请输入新标签名称', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定', //
cancelButtonText: '取消', cancelButtonText: '取消', //
inputValue:orignName, inputValue: orignName, //
inputPattern: /^.{1,30}$/, inputPattern: /^.{1,30}$/, // 1-30
inputErrorMessage: '名称1-30字符' inputErrorMessage: '名称1-30字符' //
}).then(({ value }) => { }).then(({ value }) => {
console.log(value) this.saveTag(value, tagid) //
this.saveTag(value,tagid)
}) })
}, },
//
saveTag(name, tagid){ saveTag(name, tagid){
if(this.submitting){ if(this.submitting){
return return //
} }
this.submitting=true this.submitting = true // true
this.$http({ this.$http({
url: this.$http.adornUrl('/manage/wxUserTags/save'), url: this.$http.adornUrl('/manage/wxUserTags/save'), // URL
method: 'post', method: 'post', // HTTPPOST
data: this.$http.adornData({ data: this.$http.adornData({
id : tagid?tagid:undefined, id: tagid ? tagid : undefined, // tagid
name : name name: name //
}) })
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 200) { if (data && data.code === 200) {
this.getWxUserTags(); this.getWxUserTags(); //
this.$emit('change'); this.$emit('change'); // change
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg) //
} }
this.submitting=false; this.submitting = false; //
}) })
} }
} }
} }
</script>
<style scoped> <style scoped>
/* 面板样式 */
.panel { .panel {
flex: 1; flex: 1; /* 弹性布局,占满剩余空间 */
} }
/* 标签和按钮样式 */
.el-tag, .button-new-tag { .el-tag, .button-new-tag {
margin: 5px; margin: 5px; /* 外边距 */
} }
/* 输入框样式 */
.input-new-tag { .input-new-tag {
width: inherit; width: inherit; /* 宽度继承父元素 */
} }
</style> </style>

@ -1 +1,3 @@
// 导出一个函数,该函数接收一个文件名作为参数
// 返回一个动态导入模块的函数
module.exports = file => () => import('@/views/' + file + '.vue') module.exports = file => () => import('@/views/' + file + '.vue')

@ -10,13 +10,16 @@ import http from '@/utils/httpRequest'
import { isURL } from '@/utils/validate' import { isURL } from '@/utils/validate'
import { clearLoginInfo } from '@/utils' import { clearLoginInfo } from '@/utils'
// 使用VueRouter插件
Vue.use(VueRouter) Vue.use(VueRouter)
// 动态导入视图组件的函数
const _import = require('./import-views') const _import = require('./import-views')
// 全局路由(无需嵌套上左右整体布局) // 全局路由(无需嵌套上左右整体布局)
const globalRoutes = [ const globalRoutes = [
{ path: '/404', component: () => import('@/views/common/404'), name: '404', meta: { title: '404未找到' } }, { path: '/404', component: () => import('@/views/common/404'), name: '404', meta: { title: '404未找到' } }, // 404页面路由
{ path: '/login', component: () => import('@/views/common/login'), name: 'login', meta: { title: '登录' } } { path: '/login', component: () => import('@/views/common/login'), name: 'login', meta: { title: '登录' } } // 登录页面路由
] ]
// 主入口路由(需嵌套上左右整体布局) // 主入口路由(需嵌套上左右整体布局)
@ -30,11 +33,11 @@ const mainRoutes = {
// 通过meta对象设置路由展示方式 // 通过meta对象设置路由展示方式
// 1. isTab: 是否通过tab展示内容, true: 是, false: 否 // 1. isTab: 是否通过tab展示内容, true: 是, false: 否
// 2. iframeUrl: 是否通过iframe嵌套展示内容, '以http[s]://开头': 是, '': 否 // 2. iframeUrl: 是否通过iframe嵌套展示内容, '以http[s]://开头': 是, '': 否
// 提示: 如需要通过iframe嵌套展示内容, 但不通过tab打开, 请自行创建组件使用iframe处理! { path: '/home', component: () => import('@/views/common/home'), name: 'home', meta: { title: '首页' } }, // 首页路由
{ path: '/home', component: () => import('@/views/common/home'), name: 'home', meta: { title: '首页' } }, { path: '/theme', component: () => import('@/views/common/theme'), name: 'theme', meta: { title: '主题' } } // 主题页面路由
{ path: '/theme', component: () => import('@/views/common/theme'), name: 'theme', meta: { title: '主题' } },
], ],
beforeEnter(to, from, next) { beforeEnter(to, from, next) {
// 检查用户是否已登录,如果未登录则重定向到登录页
let token = Vue.cookie.get('token') let token = Vue.cookie.get('token')
if (!token || !/\S/.test(token)) { if (!token || !/\S/.test(token)) {
clearLoginInfo() clearLoginInfo()
@ -44,39 +47,37 @@ const mainRoutes = {
} }
} }
// 创建VueRouter实例
const router = new VueRouter({ const router = new VueRouter({
mode: 'hash', mode: 'hash', // 使用hash模式
scrollBehavior: () => ({ y: 0 }), scrollBehavior: () => ({ y: 0 }), // 滚动行为:切换路由时滚动到顶部
isAddDynamicMenuRoutes: false, // 是否已经添加动态(菜单)路由 isAddDynamicMenuRoutes: false, // 是否已经添加动态(菜单)路由
routes: globalRoutes.concat(mainRoutes) routes: globalRoutes.concat(mainRoutes) // 合并全局路由和主入口路由
}) })
// 全局前置守卫,用于处理动态菜单路由的添加
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
// 添加动态(菜单)路由 // 如果已经添加了动态(菜单)路由或当前路由是全局路由,直接放行
// 1. 已经添加 or 全局路由, 直接访问
// 2. 获取菜单列表, 添加并保存本地存储
if (router.options.isAddDynamicMenuRoutes || fnCurrentRouteType(to, globalRoutes) === 'global') { if (router.options.isAddDynamicMenuRoutes || fnCurrentRouteType(to, globalRoutes) === 'global') {
next() next()
} else { } else {
// 否则,请求菜单列表并添加动态(菜单)路由
http({ http({
url: http.adornUrl('/sys/menu/nav'), url: http.adornUrl('/sys/menu/nav'),
method: 'get', method: 'get',
params: http.adornParams() params: http.adornParams()
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 200) { if (data && data.code === 200) {
fnAddDynamicMenuRoutes(data.menuList) fnAddDynamicMenuRoutes(data.menuList) // 添加动态(菜单)路由
router.options.isAddDynamicMenuRoutes = true router.options.isAddDynamicMenuRoutes = true // 标记为已添加动态(菜单)路由
sessionStorage.setItem('menuList', JSON.stringify(data.menuList || '[]')) next({ ...to, replace: true }) // 重新导航到当前路由,确保添加完动态路由后能正确显示页面
sessionStorage.setItem('permissions', JSON.stringify(data.permissions || '[]'))
next({ ...to, replace: true })
} else { } else {
sessionStorage.setItem('menuList', '[]') console.log(`%c${e} 请求菜单列表和权限失败,跳转至登录页!!`, 'color:blue') // 打印错误信息
sessionStorage.setItem('permissions', '[]') router.push({ name: 'login' }) // 跳转到登录页
next()
} }
}).catch((e) => { }).catch((e) => {
console.log(`%c${e} 请求菜单列表和权限失败,跳转至登录页!!`, 'color:blue') console.log(`%c${e} 请求菜单列表和权限失败,跳转至登录页!!`, 'color:blue') // 打印错误信息
router.push({ name: 'login' }) router.push({ name: 'login' }) // 跳转到登录页
}) })
} }
}) })
@ -89,12 +90,12 @@ function fnCurrentRouteType(route, globalRoutes = []) {
var temp = [] var temp = []
for (var i = 0; i < globalRoutes.length; i++) { for (var i = 0; i < globalRoutes.length; i++) {
if (route.path === globalRoutes[i].path) { if (route.path === globalRoutes[i].path) {
return 'global' return 'global' // 如果是全局路由,返回'global'
} else if (globalRoutes[i].children && globalRoutes[i].children.length >= 1) { } else if (globalRoutes[i].children && globalRoutes[i].children.length >= 1) {
temp = temp.concat(globalRoutes[i].children) temp = temp.concat(globalRoutes[i].children) // 如果有子路由,添加到临时数组中
} }
} }
return temp.length >= 1 ? fnCurrentRouteType(route, temp) : 'main' return temp.length >= 1 ? fnCurrentRouteType(route, temp) : 'main' // 递归判断,直到找到匹配的路由类型
} }
/** /**
@ -106,49 +107,46 @@ function fnAddDynamicMenuRoutes(menuList = [], routes = []) {
var temp = [] var temp = []
for (var i = 0; i < menuList.length; i++) { for (var i = 0; i < menuList.length; i++) {
if (menuList[i].list && menuList[i].list.length >= 1) { if (menuList[i].list && menuList[i].list.length >= 1) {
temp = temp.concat(menuList[i].list) temp = temp.concat(menuList[i].list) // 如果菜单项有子菜单,添加到临时数组中
} else if (menuList[i].url && /\S/.test(menuList[i].url)) { } else if (menuList[i].url && /\S/.test(menuList[i].url)) {
menuList[i].url = menuList[i].url.replace(/^\//, '') menuList[i].url = menuList[i].url.replace(/^\//, '') // 去掉URL前的斜杠
var route = { var route = {
path: menuList[i].url.replace('/', '-'), path: menuList[i].url.replace('/', '-'), // 将URL中的斜杠替换为短横线作为路径的一部分
component: null, component: null, // 初始化组件为空
name: menuList[i].url.replace('/', '-'), name: menuList[i].url.replace('/', '-'), // 将URL中的斜杠替换为短横线作为路由名称的一部分
meta: { meta: {
menuId: menuList[i].menuId, menuId: menuList[i].menuId, // 菜单ID
title: menuList[i].name, title: menuList[i].name, // 菜单名称
isDynamic: true, isDynamic: true, // 标记为动态路由
isTab: true, isTab: true, // 标记为标签页
iframeUrl: '' iframeUrl: '' // 初始化iframeUrl为空
} }
} }
// url以http[s]://开头, 通过iframe展示 // 如果URL以http[s]://开头,通过iframe展示
if (isURL(menuList[i].url)) { if (isURL(menuList[i].url)) {
route['path'] = `i-${menuList[i].menuId}` route['path'] = `i-${menuList[i].menuId}` // 修改路径为i-加上菜单ID
route['name'] = `i-${menuList[i].menuId}` route['name'] = `i-${menuList[i].menuId}` // 修改名称为i-加上菜单ID
route['meta']['iframeUrl'] = menuList[i].url route['meta']['iframeUrl'] = menuList[i].url // 设置iframeUrl为菜单URL
} else { } else {
try { try {
route['component'] = _import(`modules/${menuList[i].url}`) || null route['component'] = _import(`modules/${menuList[i].url}`) || null // 动态导入组件
// route['component'] = ()=>import(`@/views/modules/${menuList[i].url}.vue`) || null } catch (e) { } // 如果导入失败,捕获异常但不做处理
} catch (e) { }
} }
routes.push(route) routes.push(route) // 将路由添加到routes数组中
} }
} }
if (temp.length >= 1) { if (temp.length >= 1) {
fnAddDynamicMenuRoutes(temp, routes) fnAddDynamicMenuRoutes(temp, routes) // 如果临时数组中有数据,递归调用自身继续处理
} else { } else {
mainRoutes.name = 'main-dynamic' mainRoutes.name = 'main-dynamic' // 修改主入口路由的名称为main-dynamic
mainRoutes.children = routes mainRoutes.children = routes // 将动态生成的路由设置为主入口路由的子路由
router.addRoutes([ router.addRoutes([mainRoutes, { path: '*', redirect: { name: '404' } }]) // 添加动态路由和404重定向规则到路由器中
mainRoutes, sessionStorage.setItem('dynamicMenuRoutes', JSON.stringify(mainRoutes.children || '')) // 将动态路由存储到sessionStorage中以便后续使用
{ path: '*', redirect: { name: '404' } } console.log('\n')
]) console.log('%c!<-------------------- 动态(菜单)路由 s -------------------->', 'color:blue') // 打印动态路由开始标志
sessionStorage.setItem('dynamicMenuRoutes', JSON.stringify(mainRoutes.children || '[]')) console.log(mainRoutes.children) // 打印动态生成的路由信息
console.log('%c!<-------------------- 动态(菜单)路由 e -------------------->', 'color:blue') // 打印动态路由结束标志
console.log('\n') console.log('\n')
console.log('%c!<-------------------- 动态(菜单)路由 s -------------------->', 'color:blue')
console.log(mainRoutes.children)
console.log('%c!<-------------------- 动态(菜单)路由 e -------------------->', 'color:blue')
} }
} }
export default router export default router // 导出路由器实例

@ -1,12 +1,14 @@
export default { export default {
// 启用命名空间使得该模块的状态和getters、actions、mutations是注册在全局命名空间下的子模块
namespaced: true, namespaced: true,
state: { state: {
// 定义文章类型常量对象
ARTICLE_TYPES: { ARTICLE_TYPES: {
1: '普通文章', 1: '普通文章', // 普通文章类型
5: '帮助中心', 5: '帮助中心', // 帮助中心类型
} }
}, },
mutations: { mutations: {
// 目前没有定义任何mutation
} }
} }

@ -1,6 +1,7 @@
import router from '@/router' import router from '@/router'
export default { export default {
// 启用命名空间使得该模块的状态和getters、actions、mutations是注册在全局命名空间下的子模块
namespaced: true, namespaced: true,
state: { state: {
// 页面文档可视高度(随窗口改变大小) // 页面文档可视高度(随窗口改变大小)
@ -11,47 +12,60 @@ export default {
sidebarLayoutSkin: 'dark', sidebarLayoutSkin: 'dark',
// 侧边栏, 折叠状态 // 侧边栏, 折叠状态
sidebarFold: false, sidebarFold: false,
// 侧边栏, 菜单 // 侧边栏, 菜单列表
menuList: [], menuList: [],
// 当前激活的菜单项名称
menuActiveName: '', menuActiveName: '',
// 内容, 是否需要刷新 // 内容区域是否需要刷新
contentIsNeedRefresh: false, contentIsNeedRefresh: false,
// 主入口标签页 // 主入口标签页数组
mainTabs: [], mainTabs: [],
// 当前激活的标签页名称
mainTabsActiveName: '' mainTabsActiveName: ''
}, },
mutations: { mutations: {
// 更新文档可视高度
updateDocumentClientHeight(state, height) { updateDocumentClientHeight(state, height) {
state.documentClientHeight = height state.documentClientHeight = height
}, },
// 更新导航条布局类型
updateNavbarLayoutType(state, type) { updateNavbarLayoutType(state, type) {
state.navbarLayoutType = type state.navbarLayoutType = type
}, },
// 更新侧边栏布局皮肤
updateSidebarLayoutSkin(state, skin) { updateSidebarLayoutSkin(state, skin) {
state.sidebarLayoutSkin = skin state.sidebarLayoutSkin = skin
}, },
// 更新侧边栏折叠状态
updateSidebarFold(state, fold) { updateSidebarFold(state, fold) {
state.sidebarFold = fold state.sidebarFold = fold
}, },
// 更新菜单列表
updateMenuList(state, list) { updateMenuList(state, list) {
state.menuList = list state.menuList = list
}, },
// 更新当前激活的菜单项名称
updateMenuActiveName(state, name) { updateMenuActiveName(state, name) {
state.menuActiveName = name state.menuActiveName = name
}, },
// 更新内容区域是否需要刷新
updateContentIsNeedRefresh(state, status) { updateContentIsNeedRefresh(state, status) {
state.contentIsNeedRefresh = status state.contentIsNeedRefresh = status
}, },
// 更新主入口标签页数组
updateMainTabs(state, tabs) { updateMainTabs(state, tabs) {
state.mainTabs = tabs state.mainTabs = tabs
}, },
// 更新当前激活的标签页名称
updateMainTabsActiveName(state, name) { updateMainTabsActiveName(state, name) {
state.mainTabsActiveName = name state.mainTabsActiveName = name
}, },
// 移除指定的标签页
removeTab(state, tabName) { removeTab(state, tabName) {
// 过滤掉要删除的标签页
state.mainTabs = state.mainTabs.filter(item => item.name !== tabName) state.mainTabs = state.mainTabs.filter(item => item.name !== tabName)
if (state.mainTabs.length >= 1) { if (state.mainTabs.length >= 1) {
// 当前选中tab被删除 // 如果当前选中的标签页被删除,则跳转到最后一个标签页
if (tabName === state.mainTabsActiveName) { if (tabName === state.mainTabsActiveName) {
var tab = state.mainTabs[state.mainTabs.length - 1] var tab = state.mainTabs[state.mainTabs.length - 1]
router.push({ name: tab.name, query: tab.query, params: tab.params }, () => { router.push({ name: tab.name, query: tab.query, params: tab.params }, () => {
@ -59,10 +73,12 @@ export default {
}) })
} }
} else { } else {
// 如果没有剩余的标签页,重置菜单并跳转到首页
state.menuActiveName = '' state.menuActiveName = ''
router.push({ name: 'home' }) router.push({ name: 'home' })
} }
}, },
// 关闭当前激活的标签页
closeCurrentTab(state) { closeCurrentTab(state) {
this.commit('common/removeTab', state.mainTabsActiveName) this.commit('common/removeTab', state.mainTabsActiveName)
} }

@ -1,32 +1,39 @@
// 导出一个默认的模块对象
export default { export default {
// 启用命名空间使得该模块的状态和getters、actions、mutations是注册在全局命名空间下的子模块
namespaced: true, namespaced: true,
// 定义模块的初始状态
state: { state: {
// 定义微信消息类型的映射关系
XmlMsgType: { XmlMsgType: {
"text":"文字", "text": "文字", // 文本消息类型
"image":"图片", "image": "图片", // 图片消息类型
"voice":"语音", "voice": "语音", // 语音消息类型
"shortvideo":"短视频", "shortvideo": "短视频", // 短视频消息类型
"video":"视频", "video": "视频", // 视频消息类型
"news":"图文", "news": "图文", // 图文消息类型
"music":"音乐", "music": "音乐", // 音乐消息类型
"location":"位置", "location": "位置", // 位置消息类型
"link":"链接", "link": "链接", // 链接消息类型
"event":"事件", "event": "事件", // 事件消息类型
"transfer_customer_service":"转客服" "transfer_customer_service": "转客服" // 转接客服消息类型
}, },
// 定义客服消息类型的映射关系
KefuMsgType: { KefuMsgType: {
"text": "文本消息", "text": "文本消息", // 文本消息类型
"image": "图片消息", "image": "图片消息", // 图片消息类型
"voice": "语音消息", "voice": "语音消息", // 语音消息类型
"video": "视频消息", "video": "视频消息", // 视频消息类型
"music": "音乐消息", "music": "音乐消息", // 音乐消息类型
"news": "文章链接", "news": "文章链接", // 文章链接消息类型
"mpnews": "公众号图文消息", "mpnews": "公众号图文消息", // 公众号图文消息类型
"wxcard": "卡券消息", "wxcard": "卡券消息", // 卡券消息类型
"miniprogrampage": "小程序消息", "miniprogrampage": "小程序消息", // 小程序消息类型
"msgmenu": "菜单消息" "msgmenu": "菜单消息" // 菜单消息类型
} }
}, },
// 定义用于修改状态的 mutations目前为空
mutations: { mutations: {
} }

@ -1,15 +1,23 @@
// 导出一个默认的模块对象
export default { export default {
// 启用命名空间使得该模块的状态和getters、actions、mutations是注册在全局命名空间下的子模块
namespaced: true, namespaced: true,
// 定义模块的初始状态
state: { state: {
id: 0, id: 0, // 初始化 id 为 0
name: '' name: '' // 初始化 name 为空字符串
}, },
// 定义用于修改状态的 mutations
mutations: { mutations: {
// 更新 id 的 mutation
updateId(state, id) { updateId(state, id) {
state.id = id state.id = id; // 将传入的 id 赋值给 state 中的 id
}, },
// 更新 name 的 mutation
updateName(state, name) { updateName(state, name) {
state.name = name state.name = name; // 将传入的 name 赋值给 state 中的 name
} }
} }
} }

Loading…
Cancel
Save