|
|
@@ -379,7 +379,7 @@ Vue.component('spaceEditor', {
|
|
|
// 编辑器需要的 js 文件
|
|
|
jsUrl: [
|
|
|
'/apps/space/plug-in/ckeditor5/build/ckeditor.js',
|
|
|
- '/apps/space/plug-in/ckeditor5/src/plugins/upload/src/myUploadAdapter.js?v=20260628-pdf'
|
|
|
+ '/apps/space/plug-in/ckeditor5/src/plugins/upload/src/myUploadAdapter.js?v=20260719-image-src'
|
|
|
],
|
|
|
// 标识,全部为 true 则代表全部加载完成
|
|
|
jsUrlFlag: [],
|
|
|
@@ -393,6 +393,7 @@ Vue.component('spaceEditor', {
|
|
|
previewLoading: false,
|
|
|
videoPlaybackSyncTimer: undefined,
|
|
|
activePdf: null,
|
|
|
+ uploadedImageUrls: [],
|
|
|
pdfFloatToolbarStyle: null,
|
|
|
_emitEditorHtmlTimer: undefined,
|
|
|
_enhancePdfTimer: undefined,
|
|
|
@@ -722,14 +723,20 @@ Vue.component('spaceEditor', {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ var missingImageIndex = 0;
|
|
|
for (var imageIndex = 0; imageIndex < outputImages.length; imageIndex++) {
|
|
|
if (outputImages[imageIndex].getAttribute("src")) {
|
|
|
continue;
|
|
|
}
|
|
|
- var src = editorImages[imageIndex] || modelImages[imageIndex] || "";
|
|
|
+ var src = editorImages[imageIndex]
|
|
|
+ || modelImages[imageIndex]
|
|
|
+ || (this.uploadedImageUrls ? this.uploadedImageUrls[missingImageIndex] : "")
|
|
|
+ || (this.uploadedImageUrls ? this.uploadedImageUrls[imageIndex] : "")
|
|
|
+ || "";
|
|
|
if (src) {
|
|
|
outputImages[imageIndex].setAttribute("src", src);
|
|
|
}
|
|
|
+ missingImageIndex++;
|
|
|
}
|
|
|
|
|
|
return wrapper.innerHTML;
|
|
|
@@ -1056,15 +1063,32 @@ Vue.component('spaceEditor', {
|
|
|
});
|
|
|
},
|
|
|
getUploadOptions: function () {
|
|
|
+ var _this = this;
|
|
|
return {
|
|
|
imageQuality: this.imageQuality,
|
|
|
imageMaxWidth: 1920,
|
|
|
imageMaxSize: 20 * 1024 * 1024,
|
|
|
videoMaxSize: 1024 * 1024 * 1024,
|
|
|
pdfMaxSize: 100 * 1024 * 1024,
|
|
|
- fileMaxSize: 10 * 1024 * 1024
|
|
|
+ fileMaxSize: 10 * 1024 * 1024,
|
|
|
+ onUploaded: function (url, file) {
|
|
|
+ var isImage = file && (
|
|
|
+ (file.type && file.type.indexOf("image/") === 0)
|
|
|
+ || /\.(jpg|jpeg|png|gif|bmp|webp|svg)$/i.test(file.name || "")
|
|
|
+ );
|
|
|
+ if (isImage) {
|
|
|
+ _this.rememberUploadedImageUrl(url);
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
+ rememberUploadedImageUrl: function (url) {
|
|
|
+ var src = this.normalizeEditorMediaUrl(url);
|
|
|
+ if (!src) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.uploadedImageUrls.push(src);
|
|
|
+ },
|
|
|
myCustomUploadAdapterPlugin: function (editor) {
|
|
|
this.installUploadAdapter(editor);
|
|
|
},
|