diff --git a/src/views/paper/article/index.vue b/src/views/paper/article/index.vue index 8bfd8af..4168618 100644 --- a/src/views/paper/article/index.vue +++ b/src/views/paper/article/index.vue @@ -140,9 +140,6 @@ const toolbarConfig = { showLinkImg: false, uploadImgShowBase64: true, excludeKeys: [ - 'insertVideo', // 删除视频 - 'uploadVideo', - 'group-video', 'insertImage',// 删除网络图片上传 'insertLink',// 删除链接 'insertTable',// 删除表格 @@ -172,6 +169,25 @@ const editorConfig = { koiNoticeError('图片限制为1M,请调整好再上传!'); } }, + }, + uploadVideo: { + maxFileSize: 50 * 1024 * 1024, + server: import.meta.env.VITE_WEB_BASE_API + '/api/common/upload', + fieldName: 'file', + meta: { + association_id: 0, + }, + customInsert(res, insertFn) { // TS 语法 + // customInsert(res, insertFn) { // JS 语法 + // res 即服务端的返回结果 + console.log(res); + // 从 res 中找到 url alt href ,然后插入图片 + insertFn(res.data.fullurl, '', '') + }, onError: (file, err, res) => { + if (err.message.indexOf('exceeds maximum allowed size') !== -1) { + koiNoticeError('视频限制为50M,请调整好再上传!'); + } + }, } } } diff --git a/src/views/paper/article/update.vue b/src/views/paper/article/update.vue index 6affb44..ea571bc 100644 --- a/src/views/paper/article/update.vue +++ b/src/views/paper/article/update.vue @@ -4,16 +4,17 @@
请在图片边框内选定区域
- -
+ +
image + @click="handleClick" + style="cursor: crosshair; position: relative; user-select: none; width: 100%; height: auto;" + @load="onImageLoad" /> + style="position: absolute; top: 0; left: 0; pointer-events: none;">
@@ -21,29 +22,29 @@ - + - + - + - + 重新选择 - + - + - + + @onCreated="handleCreated" /> @@ -59,24 +60,24 @@