|
@@ -1,10 +1,10 @@
|
|
|
-<template lang="html">
|
|
|
- <div class="editor" >
|
|
|
- <div ref="toolbar" class="toolbar">
|
|
|
- </div>
|
|
|
- <div ref="editor" class="text">
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+<template lang="html">
|
|
|
+ <div class="editor" ref="editorBox">
|
|
|
+ <div ref="toolbar" class="toolbar">
|
|
|
+ </div>
|
|
|
+ <div ref="editor" class="text">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
@@ -104,10 +104,14 @@ export default {
|
|
|
this.editor.config.customUploadImg = function (files, insert) {
|
|
|
const loading = Loading.service({
|
|
|
lock: true,
|
|
|
+ fullscreen: true,
|
|
|
background: "rgba(0, 0, 0, 0.7)",
|
|
|
+ target: that.$refs.editorBox,
|
|
|
});
|
|
|
+ let BOX = document.querySelector(".el-loading-mask");
|
|
|
+ BOX.style.zIndex = "99999999";//固定一个最大值,是字符串
|
|
|
// 图片自定义上传方法
|
|
|
- for (var i = 0; i < files.length; i++) {
|
|
|
+ for (let i = 0; i < files.length; i++) {
|
|
|
var file = files[i];
|
|
|
var credentials = {
|
|
|
accessKeyId: "AKIATLPEDU37QV5CHLMH",
|
|
@@ -147,7 +151,9 @@ export default {
|
|
|
// console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
|
|
|
})
|
|
|
.send(function (err, data) {
|
|
|
- loading.close();
|
|
|
+ if (i == files.length - 1) {
|
|
|
+ loading.close();
|
|
|
+ }
|
|
|
if (err) {
|
|
|
that.$message.error("上传失败");
|
|
|
} else {
|
|
@@ -189,9 +195,11 @@ export default {
|
|
|
position: relative;
|
|
|
z-index: 0;
|
|
|
}
|
|
|
+
|
|
|
.toolbar {
|
|
|
border: 1px solid #ccc;
|
|
|
}
|
|
|
+
|
|
|
.text {
|
|
|
border: 1px solid #ccc;
|
|
|
height: 230px;
|
|
@@ -199,26 +207,26 @@ export default {
|
|
|
}
|
|
|
|
|
|
/* table 样式 */
|
|
|
-.editor >>> table {
|
|
|
+.editor>>>table {
|
|
|
border-top: 1px solid #ccc;
|
|
|
border-left: 1px solid #ccc;
|
|
|
}
|
|
|
|
|
|
-.editor >>> table td,
|
|
|
-.editor >>> table th {
|
|
|
+.editor>>>table td,
|
|
|
+.editor>>>table th {
|
|
|
border-bottom: 1px solid #ccc;
|
|
|
border-right: 1px solid #ccc;
|
|
|
padding: 20px 5px;
|
|
|
max-width: 0px;
|
|
|
}
|
|
|
|
|
|
-.editor >>> table th {
|
|
|
+.editor>>>table th {
|
|
|
border-bottom: 2px solid #ccc;
|
|
|
text-align: center;
|
|
|
}
|
|
|
|
|
|
/* blockquote 样式 */
|
|
|
-.editor >>> blockquote {
|
|
|
+.editor>>>blockquote {
|
|
|
display: block;
|
|
|
border-left: 8px solid #d0e5f2;
|
|
|
padding: 5px 10px;
|
|
@@ -229,7 +237,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
/* code 样式 */
|
|
|
-.editor >>> code {
|
|
|
+.editor>>>code {
|
|
|
display: inline-block;
|
|
|
*display: inline;
|
|
|
*zoom: 1;
|
|
@@ -239,28 +247,29 @@ export default {
|
|
|
margin: 0 3px;
|
|
|
}
|
|
|
|
|
|
-.editor >>> pre code {
|
|
|
+.editor>>>pre code {
|
|
|
display: block;
|
|
|
}
|
|
|
|
|
|
/* ul ol 样式 */
|
|
|
-.editor >>> ul,
|
|
|
+.editor>>>ul,
|
|
|
ol {
|
|
|
margin: 10px 0 10px 20px;
|
|
|
}
|
|
|
|
|
|
-.editor >>> .w-e-text p,
|
|
|
-.editor >>> .w-e-text h1,
|
|
|
-.editor >>> .w-e-text h2,
|
|
|
-.editor >>> .w-e-text h3,
|
|
|
-.editor >>> .w-e-text h4,
|
|
|
-.editor >>> .w-e-text h5,
|
|
|
-.editor >>> .w-e-text table,
|
|
|
-.editor >>> .w-e-text pre {
|
|
|
+.editor>>>.w-e-text p,
|
|
|
+.editor>>>.w-e-text h1,
|
|
|
+.editor>>>.w-e-text h2,
|
|
|
+.editor>>>.w-e-text h3,
|
|
|
+.editor>>>.w-e-text h4,
|
|
|
+.editor>>>.w-e-text h5,
|
|
|
+.editor>>>.w-e-text table,
|
|
|
+.editor>>>.w-e-text pre {
|
|
|
line-height: 1.15;
|
|
|
margin: 5px 0 !important;
|
|
|
}
|
|
|
-.editor >>> .w-e-text-container .placeholder {
|
|
|
+
|
|
|
+.editor>>>.w-e-text-container .placeholder {
|
|
|
font-size: 14px;
|
|
|
color: #757575;
|
|
|
}
|