This commit is contained in:
daihh
2022-09-28 12:32:38 +08:00
4 changed files with 42 additions and 74 deletions

View File

@@ -141,6 +141,19 @@ const postJson=function(baseURL,url,postData){
}) })
} }
// 导出文件请求定义
const postJsonToFile=function(baseURL,url,postData){
return request({
baseURL,
url: url,
method: 'post',
data:postData,
headers:{'Content-Type':'application/json;charset=utf-8'},
responseType: 'blob'
})
}
/** /**
* put请求 * put请求
*/ */
@@ -174,6 +187,7 @@ export default {
get, get,
post, post,
postJson, postJson,
postJsonToFile,
put, put,
putJson, putJson,
} }

View File

@@ -110,7 +110,7 @@ const ids=function (data){
* } * }
* */ * */
const exportExcel=function (data){ const exportExcel=function (data){
return ajax.postJson(baseURL,'/xboe/subgroup/m/noteinfo/exportExcel',data); return ajax.postJsonToFile(baseURL,'/xboe/subgroup/m/noteinfo/exportExcel',data);
} }
/** /**

View File

@@ -22,7 +22,7 @@
<el-dropdown-item command="2">Word</el-dropdown-item> <el-dropdown-item command="2">Word</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div> </div>
</div> </div>
<div class="note-sift"> <div class="note-sift">
@@ -34,7 +34,7 @@
type="daterange" type="daterange"
start-placeholder="开始" start-placeholder="开始"
end-placeholder="结束"> end-placeholder="结束">
</el-date-picker> </el-date-picker>
<el-dropdown @command="handleCommand"> <el-dropdown @command="handleCommand">
<el-button> <el-button>
全部课程<i class="el-icon-arrow-down el-icon--right"></i> 全部课程<i class="el-icon-arrow-down el-icon--right"></i>
@@ -44,12 +44,12 @@
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<el-button @click="publish" class="el-buttons"> <el-button @click="publish" class="el-buttons">
发布时间 修改时间
<i v-if="ordertime" class="el-icon-bottom"></i> <i v-if="ordertime" class="el-icon-bottom"></i>
<i v-else class="el-icon-upload2"></i> <i v-else class="el-icon-upload2"></i>
</el-button> </el-button>
<el-button @click="thumbs" class="el-buttons"> <el-button @click="thumbs" class="el-buttons">
点赞次数 点赞次数
<i v-if="orderpiss" class="el-icon-bottom"></i> <i v-if="orderpiss" class="el-icon-bottom"></i>
<i v-else class="el-icon-upload2"></i> <i v-else class="el-icon-upload2"></i>
</el-button> </el-button>
@@ -84,7 +84,7 @@
<interactBar v-if="item.type == 1" nodeWidth="60px" :readonly="true" :type="6" :data="item" :shares="false" :comments="false" :answers="true" :clickAnswer="true" :views="false"></interactBar> <interactBar v-if="item.type == 1" nodeWidth="60px" :readonly="true" :type="6" :data="item" :shares="false" :comments="false" :answers="true" :clickAnswer="true" :views="false"></interactBar>
<el-button @click="open(item)" style=" margin-right: 10px;" class="textbut" type="text"> <el-button @click="open(item)" style=" margin-right: 10px;" class="textbut" type="text">
<svg-icon icon-class="notedel" ></svg-icon>删除</el-button> <svg-icon icon-class="notedel" ></svg-icon>删除</el-button>
<el-button @click="edit(item)" class="textbut" type="text"> <el-button @click="edit(item)" class="textbut" type="text">
<svg-icon icon-class="noteedit" ></svg-icon> 编辑</el-button> <svg-icon icon-class="noteedit" ></svg-icon> 编辑</el-button>
</div> </div>
</div> </div>
@@ -202,7 +202,7 @@ export default {
contentType:null, contentType:null,
limit:1, limit:1,
}, },
uploadFileUrl: process.env.VUE_APP_BASE_API + '/xboe/sys/xuploader/file/upload', uploadFileUrl: process.env.VUE_APP_BASE_API + '/xboe/sys/xuploader/file/upload',
text:'', text:'',
importDialogVisible:false, importDialogVisible:false,
@@ -234,7 +234,7 @@ export default {
orderpiss:true, orderpiss:true,
Filtertime:[], Filtertime:[],
} }
}, },
mounted(){ mounted(){
@@ -261,7 +261,7 @@ export default {
} else { } else {
apiNote.exportExcel(ids).then(res=>{ apiNote.exportExcel(ids).then(res=>{
const link = document.createElement('a');// 创建a标签 const link = document.createElement('a');// 创建a标签
let blob = new Blob([res],{type: 'application/vnd.ms-excel;charset=UTF-8'}); // 设置文件类型 let blob = new Blob([res],{type: 'application/vnd.ms-excel;charset=UTF-8'}); // 设置文件类型
link.style.display = "none"; link.style.display = "none";
link.href = URL.createObjectURL(blob); // 创建URL link.href = URL.createObjectURL(blob); // 创建URL
link.setAttribute("download", "我的笔记.xls"); link.setAttribute("download", "我的笔记.xls");
@@ -275,15 +275,15 @@ export default {
if(this.noteFile.courseName == '') { if(this.noteFile.courseName == '') {
this.$message.warning('请填写标题!'); this.$message.warning('请填写标题!');
return return
}
this.noteFile.contentType = this.upNoteFile.contentType;
if(this.upNoteFile.content.length > 0) {
this.noteFile.filePath = this.upNoteFile.content.join();
} }
if(this.noteFile.filePath == '') { if(this.noteFile.filePath == '') {
this.$message.warning('您还没有上传文件!'); this.$message.warning('您还没有上传文件!');
return return
} }
this.noteFile.contentType = this.upNoteFile.contentType;
if(this.upNoteFile.content.length > 0) {
this.noteFile.filePath = this.upNoteFile.content.join();
}
apiNote.save(this.noteFile).then(res=>{ apiNote.save(this.noteFile).then(res=>{
if(res.status == 200) { if(res.status == 200) {
this.$message.success('导入笔记成功'); this.$message.success('导入笔记成功');
@@ -357,14 +357,14 @@ export default {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消删除' message: '已取消删除'
}); });
}); });
}, },
couresitem(item){ couresitem(item){
this.courseId = item.courseId; this.courseId = item.courseId;
this.noteData(this.num) this.noteData(this.num)
}, },
allcoures(){ allcoures(){
apiNote.course().then(res=>{ apiNote.course().then(res=>{
this.couresna = res.result this.couresna = res.result
@@ -383,9 +383,9 @@ export default {
this.noteData(this.num) this.noteData(this.num)
}, },
handleClose(done) { handleClose(done) {
}, },
edit(item){ edit(item){
this.$router.push({ path: `/user/Noteedit?id=${item.id}` }); this.$router.push({ path: `/user/Noteedit?id=${item.id}` });
@@ -412,7 +412,7 @@ export default {
this.datalist = res.result.list; this.datalist = res.result.list;
this.count = res.result.count; this.count = res.result.count;
} }
}) })
}, },
@@ -463,7 +463,7 @@ export default {
font-size: 16px; font-size: 16px;
color: #666666; color: #666666;
font-weight: 400; font-weight: 400;
} }
} }
} }
@@ -473,7 +473,7 @@ export default {
.el-input--medium .el-input__inner{ .el-input--medium .el-input__inner{
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
} }
.el-dropdown-menu--medium .el-dropdown-menu__item{ .el-dropdown-menu--medium .el-dropdown-menu__item{
width: 100% !important; width: 100% !important;
// height: 30px !important; // height: 30px !important;
@@ -490,7 +490,7 @@ export default {
li{ li{
text-align: center; text-align: center;
} }
} }
.el-popper{ .el-popper{
margin-top: 5px; margin-top: 5px;
@@ -573,7 +573,7 @@ export default {
font-size: 12px; font-size: 12px;
font-weight: 400; font-weight: 400;
color: #6E7B84 !important; color: #6E7B84 !important;
} }
.note-all{ .note-all{
width: 100%; width: 100%;
@@ -598,7 +598,7 @@ export default {
margin-right: 23px; margin-right: 23px;
} }
} }
} }
} }
.tabcontent{ .tabcontent{
@@ -674,4 +674,4 @@ export default {
} }
} }
} }
</style> </style>

View File

@@ -11,17 +11,11 @@
<h3> {{ editdata.courseName }} </h3> <h3> {{ editdata.courseName }} </h3>
<div v-if="editdata.playTime != ''"><img src="../../../public/images/coteplay.png" alt="">8:40</div> <div v-if="editdata.playTime != ''"><img src="../../../public/images/coteplay.png" alt="">8:40</div>
</div> </div>
<div class="note-text" v-if="editdata.contentType != 3"> <div class="note-text">
<!-- <input style="vertical-align:top;outline:none;" type="textarea" :rows="4" v-model="editdata.content"> --> <!-- <input style="vertical-align:top;outline:none;" type="textarea" :rows="4" v-model="editdata.content"> -->
<textarea v-model="editdata.content" name="" id="" cols="" rows="16" style="vertical-align:top;outline:none;width:100%;border:none; font-size: 14px;font-weight: 400;color: #333333;" maxlength="200" <textarea v-model="editdata.content" name="" id="" cols="" rows="16" style="vertical-align:top;outline:none;width:100%;border:none; font-size: 14px;font-weight: 400;color: #333333;" maxlength="200"
show-word-limit></textarea> show-word-limit></textarea>
</div> </div>
<div class="note-text" v-else>
<div class="img-box" v-for="(img,index) in imgContent">
<img :src="fileBaseUrl + img" alt=""/>
<span class="del-icon"><i class="el-icon-delete" @click="imgDel(index)"></i></span>
</div>
</div>
</div> </div>
<div class="edit-footer"> <div class="edit-footer">
<el-radio-group v-model="editdata.openType"> <el-radio-group v-model="editdata.openType">
@@ -46,14 +40,9 @@
</div> </div>
<span class="pointer" @click="restore(item)"> <i class="el-icon-refresh-left"></i> 还原</span> <span class="pointer" @click="restore(item)"> <i class="el-icon-refresh-left"></i> 还原</span>
</div> </div>
<div class="hist-text" v-if="editdata.contentType != 3"> <div class="hist-text">
{{ item.beforeContent }} {{ item.beforeContent }}
</div> </div>
<div class="hist-text" v-else>
<template class="img-box" v-for="(before,index) in item.beforeContent">
<img style="width:40px;height:65px;margin-right:10px" :src="fileBaseUrl + before" alt=""/>
</template>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -65,8 +54,6 @@ import apiNote from '@/api/phase2/note.js'
export default { export default {
data () { data () {
return { return {
imgContent:[],
fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
isShowList:false, isShowList:false,
isShowTip:'', isShowTip:'',
radio: '1', radio: '1',
@@ -88,21 +75,14 @@ export default {
},30000 *10); },30000 *10);
}, },
methods:{ methods:{
imgDel(index) {
this.imgContent.splice(index,1);
},
comeback(){ comeback(){
this.$router.go(-1); this.$router.go(-1);
}, },
notedetail(){ notedetail(){
apiNote.detail(this.id).then(res=>{ apiNote.detail(this.id).then(res=>{
if(res.result.contentType == 3 && res.result.content != '') {
this.imgContent = res.result.content.split(',');
}
this.editdata = res.result; this.editdata = res.result;
this.editdata.openTypeBackups = res.result.openType; this.editdata.openTypeBackups = res.result.openType;
this.histId = res.result.id; this.histId = res.result.id;
this.hist(); this.hist();
}) })
}, },
@@ -112,7 +92,7 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.imgContent = item.beforeContent; this.editdata.content = item.beforeContent;
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
@@ -131,12 +111,6 @@ export default {
}, },
hist(){ hist(){
apiNote.history(this.histId).then(res=>{ apiNote.history(this.histId).then(res=>{
if(this.editdata.contentType == 3) {
res.result.forEach(item=>{
item.beforeContent = item.beforeContent.split(',');
})
}
this.histdata = res.result this.histdata = res.result
}) })
}, },
@@ -150,9 +124,6 @@ export default {
} }
if(num == 1) { if(num == 1) {
this.editdata.isAuto = true; this.editdata.isAuto = true;
}
if(this.imgContent.length > 0) {
this.editdata.content = this.imgContent.join();
} }
apiNote.update(this.editdata).then(res=>{ apiNote.update(this.editdata).then(res=>{
if(res.status == 200) { if(res.status == 200) {
@@ -285,23 +256,6 @@ export default {
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
display: flex;
flex-wrap: wrap;
.img-box{
position: relative;
// display: flex;
.del-icon{
display: inline-block;
position: absolute;
top:0;
right:20px;
}
}
img{
width: 140px;
height: 175px;
margin-right: 23px;
}
input{ input{
border: none; border: none;
font-size: 14px; font-size: 14px;