个人中心我的笔记bug修改

This commit is contained in:
zhaofang
2022-09-29 15:53:05 +08:00
parent 06c9623e53
commit 97d9ed507a
4 changed files with 151 additions and 61 deletions

View File

@@ -39,7 +39,7 @@
:limit="limit">
<svg-icon style="font-size:52px;margin-right:5px;margin-top:20px" icon-class="up-char"></svg-icon>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">支持拓展名支持扩展名.txt/.dox/.docx/.png/.jpg, 图片支持批量上传最多9张</div>
<div class="el-upload__tip" slot="tip">支持拓展名支持扩展名<span v-for="ty in fileType">{{ty}},</span> 图片支持批量上传最多9张</div>
</el-upload>
<!-- 文件列表 -->

View File

@@ -466,7 +466,6 @@ export default {
if (rs.status === 200) {
let type = toContentType(rs.result.fileType);
// ["doc", "xls", "ppt","docx", "xlsx", "pptx","png","txt", "pdf","jpg","gif","bmp","mp4","mp3"]
console.log(type, 'type');
if(rs.result.displayName.length > 100){
this.$message.error('文件名称请不要超过100个字符');
return;

View File

@@ -40,6 +40,7 @@
全部课程<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown" style="height: 150px;overflow-y: auto !important;">
<el-dropdown-item command="">全部</el-dropdown-item>
<el-dropdown-item v-for="cou in couresna" :command="cou.courseId">{{cou.courseName}}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
@@ -131,45 +132,46 @@
</el-dialog>
<el-dialog
width="860px"
title="王明"
class="export-dialog"
:close-on-click-modal="false"
:visible.sync="dialogVisible">
<div class="Exportbox">
<div class="Export-info" style="border-bottom: 1px solid #ddd;padding-bottom:30px;margin-bottom:35px">
<div class="all-title">
<h3> 高效能人士的7个习惯</h3>
<div><img src="../../../public/images/coteplay.png" alt="">8:40</div>
<h6>2022/05/21 16:28</h6>
</div>
<div class="all-content">
我见过的策划们不管是甲方企业的还是广告代理都经常犯三大错误找一个营销理论做策略时直接向上套不管是什么行业企业处在什么发展阶段都要照着这个理论的要求做策略时直接向上套不管是什么行业企业处在什么来实不管是么行业企业处在什什么行业企业处在发展发发发施营销传播写PPT时 也要照着这个理论的框架来写施营销传播写PPT时 也要照着这个理论的框架来写施营销传播写PPT时 也要照论
</div>
<div class="export-dialog-top">
<div class="export-dialog-left">
<author-img :avatar="userInfo.avatar" :aid="userInfo.aid" :sex="userInfo.sex"></author-img>
<div class="userInfo-info">
<p><span style="font-weight: 500;font-size: 22px;">{{userInfo.name}}</span><span style="font-size: 12px;margin-left:10px">{{userInfo.departFullName}}</span></p>
<p>{{userInfo.sign}}</p>
</div>
</div>
<div class="export-dialog-right">
<p>累计导出{{datalist.length}}</p>
<p style="margin-top:10px">导出时间{{formatDate(new Date())}}</p>
</div>
</div>
<div class="export-dialog-body">
<div class="Export-info" style="" v-for="(item,idx) in datalist" :key="idx">
<div class="all-title">
<h3> {{item.courseName}}</h3>
<div v-if="item.playTime != ''"><img src="../../../public/images/coteplay.png" alt="">{{item.playTime}}</div>
<h6>{{item.sysCreateTime}}</h6>
</div>
<div class="all-content">
<span v-if="item.contentType != 3">{{ item.content }}</span>
<div v-else>
<template v-for="img in item.content">
<img style="max-height:145px;max-width:140px" :src="fileBaseUrl + img" alt=""/>
</template>
</div>
</div>
</div>
</div>
</div>
<div class="Export-info" style="border-bottom: 1px solid #ddd;padding-bottom:30px;margin-bottom:35px">
<div class="all-title">
<h3> 高效能人士的7个习惯</h3>
<div><img src="../../../public/images/coteplay.png" alt="">8:40</div>
<h6>2022/05/21 16:28</h6>
</div>
<div class="all-content">
我见过的策划们不管是甲方企业的还是广告代理都经常犯三大错误找一个营销理论做策略时直接向上套不管是什么行业企业处在什么发展阶段都要照着这个理论的要求做策略时直接向上套不管是什么行业企业处在什么来实不管是么行业企业处在什什么行业企业处在发展发发发施营销传播写PPT时 也要照着这个理论的框架来写施营销传播写PPT时 也要照着这个理论的框架来写施营销传播写PPT时 也要照论
</div>
</div>
<div class="Export-info" style="border-bottom: 1px solid #ddd;padding-bottom:30px;margin-bottom:35px">
<div class="all-title">
<h3> 高效能人士的7个习惯</h3>
<div><img src="../../../public/images/coteplay.png" alt="">8:40</div>
<h6>2022/05/21 16:28</h6>
</div>
<div class="all-content">
我见过的策划们不管是甲方企业的还是广告代理都经常犯三大错误找一个营销理论做策略时直接向上套不管是什么行业企业处在什么发展阶段都要照着这个理论的要求做策略时直接向上套不管是什么行业企业处在什么来实不管是么行业企业处在什什么行业企业处在发展发发发施营销传播写PPT时 也要照着这个理论的框架来写施营销传播写PPT时 也要照着这个理论的框架来写施营销传播写PPT时 也要照论
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="dialogVisible = false"> </el-button>
<el-button class="footer-btn" style="color: #387DF7;" plain @click="dialogVisible = false"> </el-button>
<!-- <el-button @click="dialogVisible = false"> </el-button> -->
<el-button class="footer-btn" style="margin-right:36px" type="primary" @click="exportStart()"> </el-button>
</span>
</el-dialog>
@@ -180,14 +182,17 @@
import apiNote from '@/api/phase2/note.js';
import interactBar from '@/components/Portal/interactBar.vue';
import FileUpload from '@/components/NoteUpload/index.vue';
import AuthorImg from '@/components/Portal/authorImg.vue';
import { mapGetters } from 'vuex';
import {formatDate} from '@/utils/tools.js'
export default {
components:{interactBar,FileUpload},
components:{interactBar,FileUpload,AuthorImg},
computed: {
...mapGetters(['userInfo'])
},
data(){
return{
formatDate,
noteFile:{
contentType:null,
type:2,
@@ -243,31 +248,54 @@ export default {
},
methods: {
exportCommand(e) {
this.exportType = e;
this.dialogVisible = true;
},
exportStart(){
let ids = this.datalist.map(item=>{
if(item.contentType !=3) {
return item.id;
}
})
let data = {
// name:this.userInfo.name,
// sign:'abcd',
ids:["1017809571512426496","1017807633689452544"],
// author:'/upload/2022/5/979502964375564288.png',//this.userInfo.avatar,
name:this.userInfo.name,
sign:'abcd',
ids:ids,
author:this.userInfo.avatar,//this.userInfo.avatar,
}
if(e == '1') {
if(this.exportType == '1') {
apiNote.exportPdf(data).then(res=>{
if(res.status) {
this.$message.error('导出失败');
} else {
const link = document.createElement('a');// 创建a标签
let blob = new Blob([res],{type: 'application/vnd.ms-pdf;charset=UTF-8'}); // 设置文件类型
link.style.display = "none";
link.href = URL.createObjectURL(blob); // 创建URL
link.setAttribute("download", "我的笔记.xls");
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
this.dialogVisible = false;
}
})
} else {
apiNote.exportExcel(ids).then(res=>{
const link = document.createElement('a');// 创建a标签
let blob = new Blob([res],{type: 'application/vnd.ms-excel;charset=UTF-8'}); // 设置文件类型
link.style.display = "none";
link.href = URL.createObjectURL(blob); // 创建URL
link.setAttribute("download", "我的笔记.xls");
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
if(res.status) {
this.$message.error('导出失败');
} else {
const link = document.createElement('a');// 创建a标签
let blob = new Blob([res],{type: 'application/vnd.ms-excel;charset=UTF-8'}); // 设置文件类型
link.style.display = "none";
link.href = URL.createObjectURL(blob); // 创建URL
link.setAttribute("download", "我的笔记.xls");
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
this.dialogVisible = false;
}
})
}
},
@@ -299,6 +327,9 @@ export default {
importCommand(e){
this.importDialogVisible = true;
this.upNoteFile.contentType = e;
this.noteFile.filePath = '';
this.noteFile.fileName = '';
this.upNoteFile.content = [];
if(e == '3') {
this.upNoteFile.limit = 9;
this.upNoteFile.fileType = ["png","jpg"];
@@ -336,9 +367,14 @@ export default {
this.courseId = e;
this.noteData(this.num);
},
Time(){
this.startTime = this.Filtertime[0];
this.endTime = this.Filtertime[1];
Time(val){
if(this.Filtertime && this.Filtertime.length > 0) {
this.startTime = this.Filtertime[0];
this.endTime = this.Filtertime[1];
} else {
this.startTime ='';
this.endTime = '';
}
this.noteData(this.num);
},
open(item) {
@@ -417,19 +453,16 @@ export default {
const hour = parseInt(time / 3600) < 10 ? '0' + parseInt(time / 3600) : parseInt(time / 3600)
const min = parseInt(time % 3600 / 60) < 10 ? '0' + parseInt(time % 3600 / 60) : parseInt(time % 3600 / 60)
const sec = parseInt(time % 3600 % 60) < 10 ? '0' + parseInt(time % 3600 % 60) : parseInt(time % 3600 % 60)
// console.log(hour + ':' + min + ':' + sec)
return hour + ':' + min + ':' + sec
},
handleSizeChange(val) {
this.paegSize = val;
this.pageIndex = 1;
this.noteData(this.num);
console.log(`每页 ${val}`);
},
handleCurrentChange(val) {
this.pageIndex = val;
this.noteData(this.num);
console.log(`当前页: ${val}`);
}
}
@@ -437,12 +470,57 @@ export default {
</script>
<style lang="scss" scoped>
.footer-btn{
width: 140px;
height: 40px;
border-radius: 4px;
border: 1px solid #387DF7;
}
::v-deep .note-sift{
.el-dropdown-menu{
}
}
::v-deep .export-dialog{
.el-dialog__header{
display: none;
}
.el-dialog__body{
padding: 0;
}
.export-dialog-top{
height: 90px;
background: linear-gradient(128deg, #70B0FF 0%, #4B7CFF 15%, #4678FF 39%, #7599FF 76%, rgba(1,72,228,0.85) 100%);
box-shadow: 14px 12px 14px 2px rgba(0,0,0,0.03);
padding: 16px 46px 16px 56px;
color: #fff;
display: flex;
justify-content: space-between;
.export-dialog-left{
display: flex;
// ::v-deep .item-author .el-avatar{
// width: 60px !important;
// height: 60px !important;
// }
.el-avatar{
width: 60px;
height: 60px;
}
.userInfo-info{
margin-left: 40px;
}
}
.export-dialog-right{
text-align: right;
}
}
.export-dialog-body{
margin: 40px 13px 0 53px;
padding-right: 36px;
height: 500px;
overflow-y: auto;
}
}
.note-info-index{
::v-deep .el-upload-dragger{
width: 500px;
@@ -497,9 +575,14 @@ export default {
.el-popper{
margin-top: 5px;
}
.Export-info{
border-bottom: 1px solid #ddd;
padding-bottom:30px;
margin-bottom:35px
}
.Export-info:last-child{
border: none;
}
::v-deep.dr-dialog{
max-width: 870px !important;

View File

@@ -85,7 +85,7 @@ export default {
this.notedetail();
this.timer = setInterval(()=>{
this.savedata(1);
},30000 *10);
},30000);
},
methods:{
imgDel(index) {
@@ -93,6 +93,8 @@ export default {
},
comeback(){
this.$router.go(-1);
clearImmediate(this.timer);
this.timer = null;
},
notedetail(){
apiNote.detail(this.id).then(res=>{
@@ -112,7 +114,11 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.imgContent = item.beforeContent;
if(this.editdata.contentType == 3) {
this.imgContent = item.beforeContent;
} else {
this.editdata.content = item.beforeContent;
}
}).catch(() => {
this.$message({
type: 'info',
@@ -158,6 +164,7 @@ export default {
if(res.status == 200) {
sessionStorage.setItem('isShowTip','');
if(num ==1) {//自动保存
this.editdata.sysVersion +=1;
this.isShowTip = '笔记自动保存成功';
setTimeout(()=>{
this.isShowTip = '';
@@ -181,6 +188,7 @@ export default {
},
beforeDestroy() {
clearImmediate(this.timer);
this.timer = null;
},
}