合并分支

This commit is contained in:
nisen
2023-08-01 17:37:08 +08:00
parent adc5ed7afb
commit cf5a7ee4f8
22 changed files with 3525 additions and 2139 deletions

View File

@@ -17,15 +17,16 @@
</el-radio-group> -->
</div>
<div>
<el-button style="margin-left: 25px;" :disabled="disabledReadAll" :class="{navbut:!disabledReadAll}" type="text" @click="isReadChooseList">设置已读</el-button>
<el-button style="margin-left: 25px;" :disabled="disabledReadAll" :class="{ navbut: !disabledReadAll }"
type="text" @click="isReadChooseList">设置已读</el-button>
<el-button class="navbut" type="text" @click="delChooseList">删除所选</el-button>
</div>
</div>
<div style="background-color: #FFFFFF;min-height: 600px;">
<p style="line-height:30px;text-align: center;">{{showMessage}}</p>
<p style="line-height:30px;text-align: center;">{{ showMessage }}</p>
<!-- 临时增加上线一段时间后删除 开始
<!-- 临时增加上线一段时间后删除 开始
<div class="msg-list">
<a href="javascript:void(0);">
<div class="msg-top">
@@ -45,16 +46,16 @@
<div class="msg-list">
<a href="javascript:void(0);">
<div class="msg-top">
<div>
<span style="padding-right: 10px;"><el-checkbox disabled></el-checkbox></span>
<span @click="showMsgDg()">系统消息</span>
<div class="msg-top">
<div>
<span style="padding-right: 10px;"><el-checkbox disabled></el-checkbox></span>
<span @click="showMsgDg()">系统消息</span>
</div>
</div>
</div>
<div class="msg-body" @click="dialogMsgVisible=true">
<div class="msg-body-content">新功能说明</div>
</div>
<div class="msg-time">2022-12-30 11:23:33</div>
<div class="msg-body" @click="dialogMsgVisible = true">
<div class="msg-body-content">新功能说明</div>
</div>
<div class="msg-time">2022-12-30 11:23:33</div>
</a>
</div>
@@ -78,40 +79,43 @@
<div class="msg-list" v-for="(item, index) in data" :key="index">
<div class="msg-list" v-for="(item, index) in data" :key="index">
<div class="msg-top">
<div>
<span style="padding-right: 10px;"><el-checkbox v-model="item.checked" @change="setCheckAll(item)"></el-checkbox></span>
<span v-if="!item.isRead" style="font-size:12px;padding:5px 7px; border-radius: 2px;background: #FF6562;color: #fff;margin-right: 5px">未读</span>
<span v-else style="font-size:14px;padding:5px 7px; background: #eee; border-radius: 2px; color: #666666;margin-right: 5px">已读</span>
<span style="padding-right: 10px;"><el-checkbox v-model="item.checked"
@change="setCheckAll(item)"></el-checkbox></span>
<span v-if="!item.isRead"
style="font-size:12px;padding:5px 7px; border-radius: 2px;background: #FF6562;color: #fff;margin-right: 5px">未读</span>
<span v-else
style="font-size:14px;padding:5px 7px; background: #eee; border-radius: 2px; color: #666666;margin-right: 5px">已读</span>
<!-- <a :href="returnRouter(item)"> -->
<span style="cursor: pointer;" @click="returnRouter(item)">{{ item.title }}</span>
<span style="cursor: pointer;" @click="returnRouter(item)">{{ item.title }}</span>
</div>
</div>
<div class="msg-body">
<!-- <a :href="returnRouter(item)"> -->
<div style="cursor: pointer;" @click="returnRouter(item)" class="msg-body-content" v-if="item.content">{{item.tip}}-{{ item.content }}</div>
<div style="cursor: pointer;" @click="returnRouter(item)" class="msg-body-content" v-else>{{item.tip}}</div>
<!-- </a> -->
<div class="msg-body-but">
<el-button type="danger" plain @click="delItem(item)">删除</el-button>
<!-- <a :href="returnRouter(item)"> -->
<div v-if="item.refType !== '99'">
<div style="cursor: pointer;" @click="returnRouter(item)" class="msg-body-content" v-if="item.content">
{{ item.tip }}-{{ item.content }}</div>
<div style="cursor: pointer;" @click="returnRouter(item)" class="msg-body-content" v-else>{{ item.tip }}
</div>
</div>
<div v-else :class="!item.isRead ? 'infoActive' : ''" style="cursor: pointer;" @click="goRouter(item)"
class="msg-body-content">管理员{{ item.acceptName }}向您推荐了案例{{ item.content }}点击查看>>>
</div>
<!-- </a> -->
<div v-if="item.refType !== '99'" class="msg-body-but">
<el-button type="danger" plain @click="delItem(item)">删除</el-button>
</div>
</div>
<div class="msg-time">{{ item.msgTime }}</div>
</div>
</div>
<div style="text-align: center;margin-top: 50px" v-if="total > queryData.pageSize">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="queryData.pageIndex"
:page-sizes="[2, 4, 6, 8]"
:page-size="queryData.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
></el-pagination>
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:current-page="queryData.pageIndex" :page-sizes="[2, 4, 6, 8]" :page-size="queryData.pageSize"
layout="total, sizes, prev, pager, next, jumper" :total="total"></el-pagination>
</div>
<!-- <div class="pagination-div" v-if="queryData.pageIndex < totalPages"><span class="pag-text" @click="loadMore()">加载更多</span></div> -->
</div>
@@ -122,21 +126,21 @@
<!-- 对话框 -->
<el-dialog :visible.sync="dialogMsgVisible" title="新功能说明" width="30%" append-to-body>
<div>
教师端<br/>
1支持个人授课记录/案例记录查询<br/>
2支持个人修改/完善教师介绍并在个人主页中展示<br/>
<br/>
<br/>
管理员端<br/>
1新增学习路径图功能<br/>
2新增学习项目功能<br/>
3新增课程库功能<br/>
4升级案例管理设置优秀案例等<br/>
5升级考试功能试题及提干支持图片修改已发布考试的部分信息等)<br/>
6课件支持 Scorm 格式<br/>
及上述功能配套的学员端功能<br/>
<br/>
<br/>
教师端<br />
1支持个人授课记录/案例记录查询<br />
2支持个人修改/完善教师介绍并在个人主页中展示<br />
<br />
<br />
管理员端<br />
1新增学习路径图功能<br />
2新增学习项目功能<br />
3新增课程库功能<br />
4升级案例管理设置优秀案例等<br />
5升级考试功能试题及提干支持图片修改已发布考试的部分信息等)<br />
6课件支持 Scorm 格式<br />
及上述功能配套的学员端功能<br />
<br />
<br />
我们会在1月份提供线上操作培训及详细的使用手册便于大家熟悉和使用新增功能
</div>
<template #footer>
@@ -147,13 +151,6 @@
</el-dialog>
</div>
</template>
<script>
@@ -162,6 +159,7 @@ import portalHeader from '@/components/PortalHeader.vue';
import portalFooter from '@/components/PortalFooter.vue';
import GuideBox from '@/components/Portal/guideBox.vue'
import apiMessage from '@/api/system/message.js';
import apiCase from '@/api/modules/cases.js';
export default {
name: 'answer',
components: {
@@ -174,21 +172,21 @@ export default {
},
data() {
return {
dialogMsgVisible:false,
dialogMsgVisible: false,
queryData: {
pageIndex: 1,
pageSize: 6,
isRead: null
},
disabledReadAll:false,
disabledReadAll: false,
total: 0,
checkAll: false,
data: [],
totalPages: '',
checkedIds:[],
checkedIds: [],
isIndeterminate: false,
url: '',
showMessage:'暂无消息'
showMessage: '暂无消息'
};
},
mounted() {
@@ -209,10 +207,10 @@ export default {
this.isReadChooseList();
},
methods: {
showMsgDg(){
showMsgDg() {
this.dialogMsgVisible = true;
},
jumResearch(){
jumResearch() {
this.$router.push('/user/research');
// return this.webBaseUrl + '/src/views/user/myResearch.vue';
},
@@ -223,27 +221,27 @@ export default {
this.checkAll = false;
this.isIndeterminate = false;
}
this.disabledReadAll=false;
this.disabledReadAll = false;
apiMessage.list(this.queryData).then(res => {
if (res.status == 200) {
this.totalPages = res.result.totalPages;
this.total = res.result.count;
let allRead=true;
let allRead = true;
res.result.list.forEach(item => {
let name = this.filterContent(item.content);
let num = name.slice(1,name.length);
let num = name.slice(1, name.length);
item.tip = name[0];
item.content = num.join('-');
item.checked = false;
if(!item.isRead){
allRead=false;
if (!item.isRead) {
allRead = false;
}
this.data.push(item);
});
if(allRead){
this.disabledReadAll=true;
if (allRead) {
this.disabledReadAll = true;
}
if(this.total == 0){this.showMessage = '暂无消息';}
if (this.total == 0) { this.showMessage = '暂无消息'; }
this.showMessage = this.total <= 0 ? '暂无消息' : '';
} else {
this.$message.error('获取数据失败');
@@ -275,9 +273,9 @@ export default {
// }
// },
setCheckAll(item) {
if(item.checked){
if (item.checked) {
this.checkedIds.push(item.id);
}else{
} else {
let obj = this.checkedIds.indexOf(item.id);
this.checkedIds.splice(obj, 1)
}
@@ -293,6 +291,7 @@ export default {
this.checkAll = item.checked;
}
},
//改变已读状态的操作
isReadChooseList() {
if (this.data.length == 0) return;
@@ -302,8 +301,8 @@ export default {
ids.push(this.data[i].id);
}
}
if(this.checkedIds.length>0){
apiMessage.updateIsRead(this.checkedIds).then(res => {
if (this.checkedIds.length > 0) {
apiMessage.updateIsRead(this.checkedIds).then(res => {
if (res.status == 200) {
this.$store.dispatch('refrashMsg');
this.queryMessage(true)
@@ -313,7 +312,7 @@ export default {
return;
}
if(this.checkAll){
if (this.checkAll) {
apiMessage.updateIsRead(ids).then(res => {
if (res.status == 200) {
this.$store.dispatch('refrashMsg');
@@ -324,11 +323,17 @@ export default {
}
},
delChooseList() {
// 全选的时候不能删除案例
if (this.data.some((item) => item.refType == '99' && item.checked)) {
this.$message.error('推荐案例不能删除,请重新选择');
return;
}
let list = this.data.filter(item => item.checked).map(v => v.id);
if (list.length == 0) {
this.$message.error('请先选择要删除的消息');
return;
}
this.$confirm('您确定要删除所选消息吗?', '删除提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@@ -367,42 +372,59 @@ export default {
},
// 弹出新功能引导页弹窗事件(临时)
showGuideDialog(){
showGuideDialog() {
this.$refs.guide.guideCollection = true;
},
// 点击案例
async goRouter(item) {
console.log(item);
apiMessage.updateIsRead([item.id]).then(res => {
if (res.status == 200) {
this.$store.dispatch('refrashMsg');
item.isRead = true;
}
});
//需要跳转
if (item.pageUrl && item.pageUrl.length > 10) {
await apiCase.startReadTimer(item.refId)
this.$router.push('/case/detail?id=' + item.pageParams);
} else {
this.$router.push('/case?recommendId=' + item.refId);
}
},
// 跳转详情事件11
returnRouter(item) {
apiMessage.updateIsRead([item.id]).then(res => {
if (res.status == 200) {
this.$store.dispatch('refrashMsg');
// this.queryMessage(true)
item.isRead = true;
}
if (res.status == 200) {
this.$store.dispatch('refrashMsg');
// this.queryMessage(true)
item.isRead = true;
}
});
if(item.pageUrl && item.pageUrl.length>10){
if (item.pageUrl && item.pageUrl.length > 10) {
location.href = item.pageUrl;
}else{
if(item.pageType && item.pageParams){
if(item.pageType==1){
this.$router.push('/course/studyindex?id='+ item.pageParams);
}else if(item.pageType==2){
this.$router.push('/article/detail?id='+ item.pageParams);
}else if(item.pageType==3){
this.$router.push('/case/detail?id='+ item.pageParams);
}else if(item.pageType==4){
this.$router.push('/qa/answer?id='+ item.pageParams);
}
}else{
if (item.refType == 2) {
this.$router.push('/article/detail?id='+ item.refId);
}else if(item.refType==3){
this.$router.push('/case/detail?id='+ item.refId);
}else if (item.refType == 4||item.refType == 5) {
this.$router.push('/qa/answer?id='+ item.refId);
} else if (item.refType == 1){
this.$router.push('/course/studyindex?id='+ item.refId);
}
} else {
if (item.pageType && item.pageParams) {
if (item.pageType == 1) {
this.$router.push('/course/studyindex?id=' + item.pageParams);
} else if (item.pageType == 2) {
this.$router.push('/article/detail?id=' + item.pageParams);
} else if (item.pageType == 3) {
this.$router.push('/case/detail?id=' + item.pageParams);
} else if (item.pageType == 4) {
this.$router.push('/qa/answer?id=' + item.pageParams);
}
} else {
if (item.refType == 2) {
this.$router.push('/article/detail?id=' + item.refId);
} else if (item.refType == 3) {
this.$router.push('/case/detail?id=' + item.refId);
} else if (item.refType == 4 || item.refType == 5) {
this.$router.push('/qa/answer?id=' + item.refId);
} else if (item.refType == 1) {
this.$router.push('/course/studyindex?id=' + item.refId);
}
}
}
@@ -413,7 +435,11 @@ export default {
</script>
<style lang="scss" scoped>
.navbut{
.infoActive {
color: #0078FC !important;
}
.navbut {
width: 110px;
height: 30px;
border-radius: 2px;
@@ -421,8 +447,9 @@ export default {
text-align: center;
border: 1px solid #0078FC;
padding: 0;
color: #0078FC ;
color: #0078FC;
}
.msg-nav {
display: flex;
// justify-content: space-between;
@@ -431,62 +458,72 @@ export default {
background-color: #ffffff;
padding: 5px 10px;
}
.msg-list {
border-bottom: 1px solid rgb(237, 237, 237);
margin-top: 10px;
line-height: 26px;
background-color: #ffffff;
padding: 5px 10px;
&:first-of-type {
padding-top: 15px;
}
.msg-top {
display: flex;
justify-content: space-between;
line-height: 30px;
}
.msg-body {
padding: 10px 10px 10px 25px;
display: flex;
width: 100%;
.msg-body-content{
.msg-body-content {
flex: 1;
word-break:break-all;
word-break: break-all;
color: #727272;
a:hover {
color: #409eff;
}
}
.msg-body-but{
.msg-body-but {
margin-left: auto;
button{
width: 88px;
height: 32px;
background-color: #fff;
border-radius: 16px;
padding: 0;
color: #F52F3E;
line-height: 32px;
text-align: center;
border: 1px solid #F52F3E;
button {
width: 88px;
height: 32px;
background-color: #fff;
border-radius: 16px;
padding: 0;
color: #F52F3E;
line-height: 32px;
text-align: center;
border: 1px solid #F52F3E;
}
button:hover{
background-color: rgba(255,101,98,0.13);
color: #F52F3E;
button:hover {
background-color: rgba(255, 101, 98, 0.13);
color: #F52F3E;
}
}
}
.msg-time {
color: #a5a5a5;
font-size: 14px;
padding-left: 25px;
}
}
.messageList {
> p {
>p {
display: flex;
justify-content: space-between;
border-bottom: 1px solid rgb(219, 219, 219);
@@ -494,9 +531,11 @@ export default {
margin: 0;
align-items: center;
}
.messageItem:not(:first-child) {
padding-top: 10px;
}
.messageItem {
// width: 100%;
padding-bottom: 10px;
@@ -504,12 +543,15 @@ export default {
display: flex;
justify-content: space-between;
align-items: center;
.el-checkbox {
margin-right: 5px;
}
.el-button {
margin-left: auto;
}
// margin-bottom: 10px;
p {
margin: 0;
@@ -517,24 +559,29 @@ export default {
justify-content: space-between;
align-items: center;
}
p:first-of-type {
> span {
>span {
display: flex;
justify-content: flex-start;
align-items: center;
span:first-of-type {
font-size: 12px;
}
}
> span:last-of-type {
>span:last-of-type {
font-size: 14px;
color: #b7b7b7;
margin-left: 5px;
}
}
p:last-of-type {
font-size: 14px;
text-indent: 3em;
span:last-of-type {
font-size: 14px;
color: #b7b7b7;
@@ -542,6 +589,7 @@ export default {
}
}
}
.pagination-div {
cursor: pointer;
}