mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-01-31 22:11:57 +08:00
Compare commits
1 Commits
f7dea91190
...
b992005e5d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b992005e5d |
@@ -5,9 +5,9 @@
|
|||||||
"author": "若依",
|
"author": "若依",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vue-cli-service serve",
|
"dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
|
||||||
"build:prod": "vue-cli-service build",
|
"build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
|
||||||
"build:stage": "vue-cli-service build --mode staging",
|
"build:stage": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode staging",
|
||||||
"preview": "node build/index.js --preview",
|
"preview": "node build/index.js --preview",
|
||||||
"lint": "eslint --ext .js,.vue src"
|
"lint": "eslint --ext .js,.vue src"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from "axios";
|
|
||||||
import Quill from "quill";
|
import Quill from "quill";
|
||||||
import "quill/dist/quill.core.css";
|
import "quill/dist/quill.core.css";
|
||||||
import "quill/dist/quill.snow.css";
|
import "quill/dist/quill.snow.css";
|
||||||
@@ -136,7 +135,6 @@ export default {
|
|||||||
this.quill.format("image", false);
|
this.quill.format("image", false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.Quill.root.addEventListener('paste', this.handlePasteCapture, true);
|
|
||||||
}
|
}
|
||||||
this.Quill.clipboard.dangerouslyPasteHTML(this.currentValue);
|
this.Quill.clipboard.dangerouslyPasteHTML(this.currentValue);
|
||||||
this.Quill.on("text-change", (delta, oldDelta, source) => {
|
this.Quill.on("text-change", (delta, oldDelta, source) => {
|
||||||
@@ -194,29 +192,8 @@ export default {
|
|||||||
handleUploadError() {
|
handleUploadError() {
|
||||||
this.$message.error("图片插入失败");
|
this.$message.error("图片插入失败");
|
||||||
},
|
},
|
||||||
// 复制粘贴图片处理
|
},
|
||||||
handlePasteCapture(e) {
|
};
|
||||||
const clipboard = e.clipboardData || window.clipboardData;
|
|
||||||
if (clipboard && clipboard.items) {
|
|
||||||
for (let i = 0; i < clipboard.items.length; i++) {
|
|
||||||
const item = clipboard.items[i];
|
|
||||||
if (item.type.indexOf('image') !== -1) {
|
|
||||||
e.preventDefault();
|
|
||||||
const file = item.getAsFile();
|
|
||||||
this.insertImage(file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
insertImage(file) {
|
|
||||||
const formData = new FormData();
|
|
||||||
formData.append("file", file);
|
|
||||||
axios.post(this.uploadUrl, formData, { headers: { "Content-Type": "multipart/form-data", Authorization: this.headers.Authorization } }).then(res => {
|
|
||||||
this.handleUploadSuccess(res.data);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
Reference in New Issue
Block a user