mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-17 14:56:44 +08:00
修改笔记
This commit is contained in:
@@ -329,13 +329,14 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.mynoteData.content = this.content_new; // 赋值笔记内容
|
this.mynoteData.content = this.content_new; //赋值笔记内容
|
||||||
|
let curOpenType=this.mynoteData.openType;
|
||||||
apiNote.save(this.mynoteData).then(res => {
|
apiNote.save(this.mynoteData).then(res => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
if (!this.mynoteData.id) {
|
if (!this.mynoteData.id) {
|
||||||
this.inAnimationText = '笔记保存成功,U币+5';
|
this.inAnimationText = '笔记保存成功,U币+5';
|
||||||
this.inAnimation = true;
|
this.inAnimation = true;
|
||||||
this.editRadio = 9; // 重置默认笔记公开状态
|
this.editRadio = 9; //重置默认笔记公开状态
|
||||||
this.mynoteData.openType = 9;
|
this.mynoteData.openType = 9;
|
||||||
if(this.mynoteData.openType != 9){
|
if(this.mynoteData.openType != 9){
|
||||||
return
|
return
|
||||||
@@ -359,8 +360,8 @@ export default {
|
|||||||
// 是编辑新增
|
// 是编辑新增
|
||||||
let event = {
|
let event = {
|
||||||
key: "PublishNote",//后台的事件key
|
key: "PublishNote",//后台的事件key
|
||||||
title: '编辑了笔记',//事件的标题
|
title: '发布了笔记',//事件的标题
|
||||||
parameters: "",//用户自定义参数 name:value,name:value
|
parameters: "openType:"+curOpenType,//用户自定义参数 name:value,name:value
|
||||||
content: "编辑了笔记",//this.mynoteData.content,//事件的内容
|
content: "编辑了笔记",//this.mynoteData.content,//事件的内容
|
||||||
objId: res.result.id,//关联的id
|
objId: res.result.id,//关联的id
|
||||||
objType: "6",//关联的类型
|
objType: "6",//关联的类型
|
||||||
|
|||||||
@@ -362,8 +362,35 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
exportRecord() {
|
exportRecord() {
|
||||||
let urlPre = window.location.protocol + '//' + window.location.host;
|
let downUrl='';
|
||||||
window.open(urlPre + '/xboe/m/stat/usercoinrecord/export?aid=' + this.userInfo.aid)
|
|
||||||
|
let curHost=window.location.host;
|
||||||
|
console.log(window.location.host,'window.location.host');
|
||||||
|
// if(curHost=='localhost' || curHost='127.0.0.1'){
|
||||||
|
// downUrl=process.env.VUE_APP_BOE_WEB_URL+process.env.VUE_APP_CESOURCE_BASE_API+'/xboe/m/stat/usercoinrecord/export?aid=' + this.userInfo.aid;
|
||||||
|
// }else{
|
||||||
|
// //let urlPre = window.location.protocol + '//' + window.location.host;
|
||||||
|
// downUrl=process.env.VUE_APP_CESOURCE_BASE_API+'/xboe/m/stat/usercoinrecord/export?aid=' + this.userInfo.aid;
|
||||||
|
// }
|
||||||
|
|
||||||
|
downUrl=process.env.VUE_APP_BOE_WEB_URL+process.env.VUE_APP_CESOURCE_BASE_API+'/xboe/m/stat/usercoinrecord/export?aid=' + this.userInfo.aid;
|
||||||
|
|
||||||
|
const el = document.createElement('a');
|
||||||
|
el.style.display = 'none';
|
||||||
|
el.setAttribute('target', '_blank');
|
||||||
|
/**
|
||||||
|
* download的属性是HTML5新增的属性
|
||||||
|
* href属性的地址必须是非跨域的地址,如果引用的是第三方的网站或者说是前后端分离的项目(调用后台的接口),这时download就会不起作用。
|
||||||
|
* 此时,如果是下载浏览器无法解析的文件,例如.exe,.xlsx..那么浏览器会自动下载,但是如果使用浏览器可以解析的文件,比如.txt,.png,.pdf....浏览器就会采取预览模式
|
||||||
|
* 所以,对于.txt,.png,.pdf等的预览功能我们就可以直接不设置download属性(前提是后端响应头的Content-Type: application/octet-stream,如果为application/pdf浏览器则会判断文件为 pdf ,自动执行预览的策略)
|
||||||
|
*/
|
||||||
|
el.setAttribute('download', '我的U币记录');
|
||||||
|
el.href = downUrl;
|
||||||
|
console.log(el);
|
||||||
|
document.body.appendChild(el);
|
||||||
|
el.click();
|
||||||
|
document.body.removeChild(el);
|
||||||
|
|
||||||
},
|
},
|
||||||
initChat(chatData) {
|
initChat(chatData) {
|
||||||
this.chart = echarts.init(this.$refs.chart);
|
this.chart = echarts.init(this.$refs.chart);
|
||||||
|
|||||||
Reference in New Issue
Block a user