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

View File

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

View File

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