This commit is contained in:
zhaofang
2022-09-27 20:24:23 +08:00
parent 021f02ece5
commit 88c2061094
7 changed files with 490 additions and 39 deletions

View File

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

View File

@@ -20,8 +20,9 @@
</div>
</div>
<!-- 我的笔记 -->
<div class="mycote-content" v-if="notetab == 2">
<div v-if="noteList.length > 0">
<div v-if="notetab == 2">
<div class="mycote-content" v-show="!isEdit">
<div v-if="noteList.length > 0">
<div style="border-bottom:1px solid #4444;padding-bottom:25px;" v-for="note in noteList"
:key="note.id">
<span class="mycote-time">{{note.sysCreateTime}}
@@ -53,23 +54,45 @@
</div>
</div>
<h6 class="mycote-dibu">已经到底啦</h6>
</div>
<div class="my-nonote" v-else>
<img src="../../../public/images/no-note.png" alt="" />
<h6 style="color: #666666;font-size: 14px;">你还没有记录此课程的笔记哦</h6>
</div>
</div>
<div class="my-nonote" v-else>
<img src="../../../public/images/no-note.png" alt="" />
<h6 style="color: #666666;font-size: 14px;">你还没有记录此课程的笔记哦</h6>
<div v-show="isEdit">
<p style="margin-top:37px">
<span style="font-size: 14px;color: #333333;margin-left:10px;">{{mynoteData.sysCreateTime}}</span>
<span class="sm">{{mynoteData.openType == 1?'公开':'私密'}}</span>
<svg-icon style="float:right;font-size:26px;margin-top:16px" icon-class="spot"></svg-icon>
</p>
<div class="newcote-content" style="margin-top:10px;height:436px">
<div class="newcote-time" v-if="mynoteData.playTime != 0">
<img src="../../../public/images/coteplay.png" />
{{formatSeconds(mynoteData.playTime)}}
<img src="../../../public/images/cotedetel.png" @click="timeDel()" />
</div>
<div class="newcote-text">
<el-input type="textarea" :autofocus="true" placeholder="好记性不如烂笔头,记录些什么吧~"
v-model="mynoteData.content" maxlength="200" :autosize="{ minRows: 18, maxRows: 20}"
show-word-limit>
</el-input>
</div>
</div>
</div>
</div>
<div class="newcote-bottom" v-if="notetab == 1">
<div class="newcote-bottom" v-if="notetab == 1 || isEdit">
<span style="cursor: pointer;" @click="videoLocation"> <img src="../../../public/images/playtime.png"
alt=""> 视频位置</span>
<el-radio v-model="mynoteData.openType" :label="9">公开</el-radio>
<el-radio v-model="mynoteData.openType" :label="1">私密</el-radio>
<el-button size="small" v-show="isEdit" @click="isEdit = false">取消</el-button>
<el-button type="primary" size="small" @click="saveNote()">保存</el-button>
</div>
</div>
<div class="animation-box" :class="inAnimation?'animation':''" @animationend="inAnimation=false">
<div class="box-text">
<img src="../../../public/images/success-note.png" />笔记保存成功U币+2
<img src="../../../public/images/success-note.png" />{{inAnimationText}}
</div>
</div>
</div>
@@ -93,6 +116,8 @@ export default {
name: 'MyNote',
data() {
return {
inAnimationText:'笔记保存成功U币+2',
isEdit:false,
courseId:'',
inAnimation: false,
radio: '1',
@@ -161,8 +186,10 @@ export default {
}, 10000);
},
noteEdit(note) {
console.log(note,'note');
this.isEdit = true;
this.mynoteData = note;
this.notetabType(1);
// this.notetabType(1);
},
noteDel(note) {
this.$confirm('您确定要删除这条笔记吗?', '删除提示', {
@@ -205,10 +232,31 @@ export default {
return;
}
this.mynoteData.courseId = this.courseId;
console.log(this.mynoteData,'this.mynoteData');
apiNote.save(this.mynoteData).then(res => {
if(this.isEdit) {
apiNote.update(this.mynoteData).then(res=>{
if(res.status == 200) {
this.inAnimationText = '笔记编辑成功';
this.inAnimation = true;
this.isEdit = false;
setTimeout(() => {
this.getMyNote();
this.mynoteData = {
type: 1, //我发布的是1 我导入的是2
content: '',
playTime: '',
courseId: '',// 课程id
contentId: '',//课程内容id
courseName: '',// 课程名称
openType: 1,// 1表不公开 9表完全公开
};
}, 2000)
}
})
} else {
apiNote.save(this.mynoteData).then(res => {
if (res.status == 200) {
if (!this.mynoteData.id) {
this.inAnimationText = '笔记保存成功U币+2';
this.inAnimation = true;
if(this.mynoteData.openType != 9){
return
@@ -245,6 +293,9 @@ export default {
}, 2000)
}
})
}
console.log(this.mynoteData,'this.mynoteData');
}
},
beforeDestroy() {
@@ -341,7 +392,17 @@ export default {
padding: 0;
}
}
.sm {
width: 50px;
height: 22px;
border-radius: 10px;
border: 1px solid #3379FB;
color: #3379FB;
font-size: 12px;
line-height: 50px;
margin-left: 20px;
padding: 3px 10px;
}
.newcote-content {
margin: 30px 0px;
box-sizing: border-box;
@@ -373,17 +434,7 @@ export default {
font-size: 14px;
padding-bottom: 20px;
.sm {
width: 50px;
height: 22px;
border-radius: 10px;
border: 1px solid #3379FB;
color: #3379FB;
font-size: 12px;
line-height: 50px;
margin-left: 20px;
padding: 3px 10px;
}
.more {
margin-top: 12px;

View File

@@ -0,0 +1,255 @@
<template>
<div class="upload-file">
<!-- <el-upload
:action="uploadFileUrl"
:before-upload="handleBeforeUpload"
:file-list="fileList"
:limit="limit"
:multiple="limit>1"
:on-error="handleUploadError"
:on-exceed="handleExceed"
:on-success="handleUploadSuccess"
:show-file-list="showList"
:data="data"
:headers="headers"
class="upload-file-uploader"
ref="upload"
>
<el-button :icon="loading ? 'el-icon-upload2':''" :size="size" type="primary" :loading="isLoading">{{text}}</el-button>
<div class="el-upload__tip" slot="tip" v-if="showTip">
请上传
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
的文件
</div>
</el-upload> -->
<el-upload
class="upload-demo"
drag
:multiple="limit>1"
:action="uploadFileUrl"
:before-upload="handleBeforeUpload"
:on-success="handleUploadSuccess"
:show-file-list="showList"
:on-error="handleUploadError"
:on-exceed="handleExceed"
:on-remove="handleUploadRemove"
:data="data"
:headers="headers"
: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>
</el-upload>
<!-- 文件列表 -->
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
<li :key="file.uid" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in list">
<el-link :href="file.url" :underline="false" target="_blank">
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
</el-link>
<div class="ele-upload-list__item-content-action">
<el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
</div>
</li>
</transition-group>
</div>
</template>
<script>
import { getToken } from "@/utils/token";
export default {
props: {
// 值
value: [String, Object, Array],
showList: {
type: Boolean,
default: false
},
url:{
type: String,
default: '/xboe/sys/xuploader/file/upload'
},
limit:{
type:Number,
default:1
},
dir:{
type:String,
default:'files'
},
text:{
type:String,
default:'选择文件并上传'
},
size:{
type:String,
default:'small'
},
// 大小限制(MB)
fileSize: {
type: Number,
default: 1024,
},
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType: {
type: Array,
default: () => ["doc", "xls", "ppt","docx", "xlsx", "pptx","png","txt", "pdf","jpg","gif","bmp","mp4","mp3"],
},
// 是否显示提示
isShowTip: {
type: Boolean,
default: true
},
loading: {
type: Boolean,
default: false
},
},
data() {
return {
uploadFileUrl: process.env.VUE_APP_BASE_API + this.url, // 上传的图片服务器地址
headers: {
'XBOE-Access-Token': getToken(),
},
isLoading:false,
fileList: [],
data:{
dir:this.dir
}
};
},
computed: {
// 是否显示提示
showTip() {
return this.isShowTip && (this.fileType || this.fileSize);
},
// 列表
list() {
let temp = 1;
if (this.value) {
// 首先将值转为数组
const list = Array.isArray(this.value) ? this.value : [this.value];
// 然后将数组转为对象数组
return list.map((item) => {
if (typeof item === "string") {
item = { name: item, url: item };
}
item.uid = item.uid || new Date().getTime() + temp++;
return item;
});
} else {
this.fileList = [];
return [];
}
},
},
methods: {
handleUploadRemove(file) {
console.log(file,'file');
this.$emit("remove",file);
},
// 上传前校检格式和大小
handleBeforeUpload(file) {
// 校检文件类型
if (this.fileType) {
let fileExtension = "";
if (file.name.lastIndexOf(".") > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
}
const isTypeOk = this.fileType.some((type) => {
if (file.type.indexOf(type) > -1) return true;
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
return false;
});
if (!isTypeOk) {
//this.$message.error(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`);
this.$message({message:`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`,type:'error',offset:100})
//this.$message.error(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`);
return false;
}
}
// 校检文件大小
if (this.fileSize) {
const isLt = file.size / 1024 / 1024 < this.fileSize;
if (!isLt) {
this.$message({message:`上传文件大小不能超过 ${this.fileSize} MB!`,type:'error',offset:100})
//this.$message.error(`上传文件大小不能超过 ${this.fileSize} MB!`);
return false;
}
}
if(this.loading) {
this.isLoading = true;
}
return true;
},
// 文件个数超出
handleExceed(res) {
this.$message({message:`只允许上传单个文件`,type:'error',offset:100});
},
// 上传失败
handleUploadError(err) {
this.isLoading = false;
this.$message({message:"上传失败, 请重试",type:'error',offset:100});
},
// 上传成功回调
handleUploadSuccess(res, file) {
if(res.status == 200) {
this.fileList = [];
this.isLoading = false;
this.$message({message:"上传成功",type:'success',offset:100});
} else {
this.isLoading = false;
this.fileList = [];
this.$message({message:"上传失败",type:'error',offset:100});
}
this.$emit("success", res);
},
// 删除文件
handleDelete(index) {
this.fileList.splice(index, 1);
this.$emit("remove", '');
},
// 获取文件名称
getFileName(name) {
if (name.lastIndexOf("/") > -1) {
return name.slice(name.lastIndexOf("/") + 1).toLowerCase();
} else {
return "";
}
}
},
created() {
this.fileList = this.list;
},
};
</script>
<style scoped lang="scss">
.el-upload__tip{
margin-top: 10px;
text-align: center;
}
.upload-file-uploader {
margin-bottom: 5px;
}
.upload-file-list .el-upload-list__item {
border: 1px solid #e4e7ed;
line-height: 2;
margin-bottom: 10px;
position: relative;
}
.upload-file-list .ele-upload-list__item-content {
display: flex;
justify-content: space-between;
align-items: center;
color: inherit;
}
.ele-upload-list__item-content-action .el-link {
margin-right: 10px;
}
</style>

View File

@@ -0,0 +1 @@
<svg t="1664267771455" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4746" width="200" height="200"><path d="M729.6 411.2L446.4 694.4c-43.2 43.2-115.2 43.2-158.4 0s-43.2-115.2 0-158.4l334.4-334.4c72-72 188.8-72 260.8 0s72 188.8 0 260.8L524.8 819.2c-99.2 99.2-262.4 99.2-361.6 0s-99.2-262.4 0-361.6L468.8 150.4c3.2-3.2 6.4-4.8 8-8l3.2-3.2c12.8-12.8 32-12.8 44.8 0 12.8 12.8 12.8 32 0 44.8-4.8 3.2-8 6.4-11.2 11.2L208 502.4c-75.2 75.2-75.2 196.8 0 272s196.8 75.2 272 0l305.6-305.6 11.2-11.2 40-40c46.4-46.4 46.4-123.2 0-169.6s-123.2-46.4-169.6 0L332.8 580.8c-19.2 19.2-19.2 49.6 0 67.2 19.2 19.2 49.6 19.2 67.2 0l283.2-283.2c12.8-12.8 32-12.8 44.8 0 12.8 14.4 12.8 33.6 1.6 46.4z" fill="#767677" p-id="4747"></path></svg>

After

Width:  |  Height:  |  Size: 765 B

View File

@@ -0,0 +1 @@
<svg t="1664267941963" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5068" width="200" height="200"><path d="M563.456 447.808c39.744-18.432 78.336-37.056 114.624-55.36 36.288-18.56 65.344-32.256 86.784-40.832 21.504-8.384 38.72-12.864 51.776-12.864 21.504 0 40.064 7.04 55.808 21.76C888.192 374.848 896 393.088 896 414.528c0 12.288-3.904 25.216-11.584 38.4-7.616 13.248-15.872 21.76-24.448 25.472-79.488 31.232-167.104 54.208-262.528 68.416 17.344 15.744 38.592 37.184 63.872 63.552 25.28 26.752 38.592 40.832 39.616 42.624 9.344 12.864 22.208 28.928 38.848 48 16.64 19.2 28.16 34.048 34.624 44.864 6.464 10.944 9.728 23.808 9.728 39.232 0 19.712-7.36 37.056-22.208 51.776-14.656 14.848-33.92 22.272-57.344 22.272s-49.6-18.304-79.04-54.528c-29.248-36.224-67.072-101.696-113.28-195.968-46.784 84.864-78.336 141.12-94.208 168.256-16.064 26.88-31.488 47.424-46.208 61.376-14.848 13.824-31.68 20.864-50.88 20.864-22.784 0-41.792-7.808-57.024-23.552-14.784-15.744-22.528-32.704-22.528-50.432 0-16.64 3.008-29.248 9.216-37.76 56.704-76.992 115.776-144.192 177.536-200.576-51.776-8.128-97.92-17.152-138.56-26.88-40.704-10.048-83.968-24.32-129.472-43.52-7.488-3.776-14.656-12.288-21.76-25.472C131.456 437.888 128 425.6 128 414.528c0-21.44 7.808-39.616 23.552-54.016 15.744-14.656 33.728-21.76 54.144-21.76 14.848 0 33.216 4.48 55.488 13.376C283.264 361.152 311.424 374.016 345.6 390.912c34.24 16.96 73.28 35.904 116.992 56.896C454.592 408.96 447.936 364.352 442.688 314.304 437.44 264.064 434.88 229.696 434.88 211.136c0-22.784 7.232-42.176 21.632-58.688C471.168 136.128 489.6 128 512.448 128c22.4 0 40.512 8.128 55.04 24.448 14.592 16.512 21.76 38.144 21.76 65.28 0 7.36-1.216 21.952-3.328 43.968-1.92 21.952-5.248 48.32-9.152 79.36C572.736 372.16 568.256 407.872 563.456 447.808z" p-id="5069" fill="#d81e06"></path></svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1 @@
<svg t="1664268265567" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9347" width="200" height="200"><path d="M516.563 472.36l0.005 0.004c0.243 0.243 0.478 0.491 0.705 0.745l149.036 149.085c7.094 7.096 7.181 18.545 0.263 25.748l-0.263 0.269c-7.098 7.095-18.542 7.18-25.74 0.262l-0.268-0.262-118.91-118.948v300.345c0 10.158-8.234 18.392-18.391 18.392-10.157 0-18.392-8.234-18.392-18.392V530.35L367.291 647.704c-7.18 7.182-18.822 7.183-26.003 0.004l-0.005-0.005c-7.182-7.185-7.182-18.832 0-26.017L490.56 472.363c7.18-7.181 18.822-7.183 26.004-0.004zM509.473 142c134.866 0 245.729 102.802 258.547 234.343l0.334 3.751 1.466 0.155c99.756 11.357 177.493 95.287 179.153 197.717l0.027 3.346c0 110.649-88.774 200.557-198.964 202.344l-3.345 0.027h-29.138c-16.506 0-29.887-13.384-29.887-29.895 0-16.275 13.001-29.513 29.181-29.888l0.706-0.008h29.138c78.72 0 142.536-63.835 142.536-142.58 0-77.957-62.546-141.301-140.18-142.56l-2.356-0.02h-7.361c-16.344 0-29.61-13.12-29.882-29.38l-0.004-0.708 0.035-5.49c0.003-0.43 0.005-0.86 0.005-1.29 0-109.392-87.766-198.279-196.703-200.046l-3.308-0.026h-18.831c-109.358 0-198.218 87.792-199.984 196.763l-0.027 3.308v6.974c0 16.275-13 29.512-29.18 29.887l-0.706 0.008h-1.436c-78.72 0-142.536 63.835-142.536 142.58 0 77.957 62.546 141.302 140.18 142.56l2.356 0.02h5.271c16.506 0 29.887 13.385 29.887 29.896 0 16.275-13.001 29.512-29.181 29.887l-0.706 0.008h-5.27C147.576 783.683 57 693.08 57 581.313c0-101.708 75.007-185.892 172.706-200.221l1.993-0.278 0.02-0.264C242.443 248.407 352 144.214 486.346 142.035l4.296-0.035h18.831z" fill="#9d9d9d" p-id="9348"></path></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -1,25 +1,25 @@
<template>
<div style="padding: 38px 42px;">
<div class="note-info-index" style="padding: 38px 42px;">
<div class="note-hear">
<h3>我的笔记</h3>
<div>
<el-dropdown style="margin-left:15px">
<el-dropdown style="margin-left:15px" @command="exportCommand">
<el-button>
导出<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>PDF</el-dropdown-item>
<el-dropdown-item>Excel</el-dropdown-item>
<el-dropdown-item command="1">PDF</el-dropdown-item>
<el-dropdown-item command="2">Excel</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-dropdown style="margin-left:15px">
<el-dropdown style="margin-left:15px" @command="importCommand">
<el-button>
导入<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>图片</el-dropdown-item>
<el-dropdown-item>Txt</el-dropdown-item>
<el-dropdown-item>Word</el-dropdown-item>
<el-dropdown-item command="3">图片</el-dropdown-item>
<el-dropdown-item command="1">Txt</el-dropdown-item>
<el-dropdown-item command="2">Word</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
@@ -65,8 +65,9 @@
<div class="note-all-info" v-for="(item,idx) in datalist" :key="idx">
<div class="all-title">
<h3> {{ item.courseName }} </h3>
<div v-if="item.type==2">导入</div>
<div v-if="item.playTime != ''"><img src="../../../public/images/coteplay.png" alt=""> {{ getHMS(item.playTime) }} </div>
<span style="margin-left:34px">{{item.openType == 9?'公开':'私密'}}</span>
<span style="margin-left:14px">{{item.openType == 9?'公开':'私密'}}</span>
<h6>{{ item.sysUpdateTime }}</h6>
</div>
<div class="all-content">
@@ -76,7 +77,7 @@
<div class="all-footer">
<div>
<div class="textbut-box">
<interactBar 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">
<svg-icon icon-class="notedel" ></svg-icon> 删除</el-button>
<el-button @click="edit(item)" class="textbut" type="text">
@@ -98,7 +99,32 @@
</el-pagination>
</div>
</div>
<file-upload dir="files" :showList="true" :value="imageShowUrl" :limit="5" @success="handleUploadSuccess" @remove="handleRemoveSuccess"></file-upload>
<!-- 导入 -->
<el-dialog
:visible.sync="importDialogVisible"
width="785px"
:before-close="handleClose">
<div class="import-info">
<p class="import-info-tip">导入笔记</p>
<div class="import-info-enclosure">
<label class="label"><svg-icon style="font-size:12px;margin-right:5px" icon-class="red-start"></svg-icon>标题</label>
<el-input
type="text"
placeholder="请输入内容"
v-model="noteFile.courseName"
maxlength="20"
show-word-limit/>
</div>
<div class="import-info-enclosure">
<label class="label" style="width:66px"><svg-icon style="font-size:16px;margin-right:5px" icon-class="enclisure"></svg-icon>附件</label>
<file-upload dir="files" :fileType="fileType" :showList="true" :value="imageShowUrl" :limit="limit" @success="handleUploadSuccess" @remove="handleRemoveSuccess"></file-upload>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="importDialogVisible = false"> </el-button>
<el-button type="primary" @click="noteSave()"> </el-button>
</span>
</el-dialog>
<el-dialog
width="860px"
title="王明"
@@ -149,11 +175,29 @@
<script>
import apiNote from '@/api/phase2/note.js';
import interactBar from '@/components/Portal/interactBar.vue';
import FileUpload from '@/components/FileUpload/index.vue';
import FileUpload from '@/components/NoteUpload/index.vue';
import { mapGetters } from 'vuex';
export default {
components:{interactBar,FileUpload},
computed: {
...mapGetters(['userInfo'])
},
data(){
return{
noteFile:{
contentType:null,
type:2,
courseName:'',
filePath:'',
fileName:'',
openType:1,
},
fileType:[],
filType:null,
limit:1,
uploadFileUrl: process.env.VUE_APP_BASE_API + '/xboe/sys/xuploader/file/upload',
text:'',
importDialogVisible:false,
imageShowUrl:'',
count:0,
fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
@@ -190,11 +234,82 @@ export default {
this.allcoures();
},
methods: {
handleRemoveSuccess() {
exportCommand(e) {
let ids = this.datalist.map(item=>{
if(item.contentType !=3) {
return item.id;
}
})
console.log(ids,'contentType');
let data = {
// name:this.userInfo.name,
// sign:'abcd',
ids:["1017809571512426496","1017807633689452544"],
// author:'/upload/2022/5/979502964375564288.png',//this.userInfo.avatar,
}
if(e == '1') {
apiNote.exportPdf(data).then(res=>{
})
} 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);
})
}
console.log(e,'e');
},
noteSave() {
if(this.noteFile.courseName == '') {
this.$message.warning('请填写标题!');
return
}
this.noteFile.contentType =this.filType;
apiNote.save(this.noteFile).then(res=>{
if(res.status == 200) {
this.$message.success('导入笔记成功');
this.importDialogVisible = false;
this.noteData(this.num);
}
})
},
handleBeforeUpload() {
},
handleUploadSuccess() {
importCommand(e){
this.importDialogVisible = true;
this.filType = e;
if(e == '3') {
this.limit = 9;
this.fileType = ["png","jpg"];
} else if(e == '1'){
this.fileType = ["txt"];
} else {
this.fileType = ["doc","docx"];
}
},
handleRemoveSuccess(file) {
if(this.filType == 1) {
// this.noteFile.filePath.replace(file.response.result.filePath+',','');
} else {
this.noteFile.filePath ='';
this.noteFile.fileName = '';
}
},
handleUploadSuccess(file) {
if(this.filType == 3) {
this.noteFile.fileName = '图片';
this.noteFile.filePath += file.result.filePath;
} else {
this.noteFile.filePath = file.result.filePath;
this.noteFile.fileName = file.result.displayName;
}
},
handleCommand(e) {
this.courseId = e;
@@ -238,6 +353,7 @@ export default {
publish(){
this.ordertime = !this.ordertime;
this.orderType = !this.orderType;
this.orderField = 'sysCreateTime';
this.noteData(this.num)
},
thumbs(){
@@ -297,6 +413,32 @@ export default {
</script>
<style lang="scss" scoped>
.note-info-index{
::v-deep .el-upload-dragger{
width: 500px;
height: 168px;
}
.import-info{
padding: 0 74px;
}
.import-info-tip{
font-size: 18px;
font-weight: 600;
color: #333333;
margin-bottom: 34px;
}
.import-info-enclosure{
display: flex;
margin-bottom: 27px;
.label{
width: 72px;
font-size: 16px;
color: #666666;
font-weight: 400;
}
}
}
.el-select-dropdown__item{
width: 140px !important;
}