refactor: temporarily remove images uploading feature

This commit is contained in:
yanglbme 2020-08-03 23:44:11 +08:00
parent a5a254c0d1
commit 563c3855a6
3 changed files with 28 additions and 28 deletions

View File

@ -1,14 +1,14 @@
<template>
<el-container class="top is-dark">
<!-- 图片上传 -->
<el-upload class="header__item" action="https://imgkr.com/api/files/upload"
<!-- <el-upload class="header__item" action="https://imgkr.com/api/files/upload"
:headers="{'Content-Type': 'multipart/form-data'}"
:show-file-list="false" :multiple="true" accept=".jpg,.jpeg,.png,.gif" name="file"
:before-upload="beforeUpload">
<el-tooltip :effect="effect" content="上传图片" placement="bottom-start">
<i class="el-icon-upload" size="medium"></i>
</el-tooltip>
</el-upload>
</el-upload> -->
<!-- 下载文本文档 -->
<el-tooltip class="header__item" :effect="effect" content="下载编辑框Markdown文档" placement="bottom-start">
<i class="el-icon-download" size="medium" @click="$emit('downLoad')"></i>

View File

@ -33,10 +33,10 @@ export default {
data() {
return {
list: [
{
text: '上传图片',
key: 'insertPic'
},
// {
// text: '',
// key: 'insertPic'
// },
{
text: '插入表格',
key: 'insertTable'

View File

@ -123,28 +123,28 @@ export default {
});
//
this.editor.on('paste', (cm, e) => {
if (!(e.clipboardData && e.clipboardData.items) || this.isImgLoading) {
return;
}
for (let i = 0, len = e.clipboardData.items.length; i < len; ++i) {
let item = e.clipboardData.items[i]
if (item.kind === 'file') {
this.isImgLoading = true;
const pasteFile = item.getAsFile()
uploadImgFile(pasteFile).then(res=> {
this.uploaded(res)
}).catch(err=> {
this.$message({
showClose: true,
message: err,
type: 'error'
});
});
this.isImgLoading = false;
}
}
});
// this.editor.on('paste', (cm, e) => {
// if (!(e.clipboardData && e.clipboardData.items) || this.isImgLoading) {
// return;
// }
// for (let i = 0, len = e.clipboardData.items.length; i < len; ++i) {
// let item = e.clipboardData.items[i]
// if (item.kind === 'file') {
// this.isImgLoading = true;
// const pasteFile = item.getAsFile()
// uploadImgFile(pasteFile).then(res=> {
// this.uploaded(res)
// }).catch(err=> {
// this.$message({
// showClose: true,
// message: err,
// type: 'error'
// });
// });
// this.isImgLoading = false;
// }
// }
// });
this.editor.on('mousedown', () => {
this.$store.commit('setRightClickMenuVisible', false);