#I1XRJM markdown粘贴图片使用文件方式上传保存
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
ENV = 'development'
|
||||
|
||||
# base api
|
||||
VUE_APP_BASE_API = 'http://local.zyplayer.com:8083/zyplayer-doc-manage'
|
||||
# VUE_APP_BASE_API = 'http://doc.zyplayer.com/zyplayer-doc-manage'
|
||||
# VUE_APP_BASE_API = 'http://local.zyplayer.com:8083/zyplayer-doc-manage'
|
||||
VUE_APP_BASE_API = 'http://doc.zyplayer.com/zyplayer-doc-manage'
|
||||
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div style="padding: 10px;" class="page-edit-vue">
|
||||
<el-row type="border-card">
|
||||
<div style="height: 100%;" class="page-edit-vue">
|
||||
<el-row type="border-card" style="height: 100%;overflow: auto;padding: 20px;box-sizing: border-box;">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="16">
|
||||
<template v-if="pageId">
|
||||
@@ -29,7 +29,9 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-input v-model="wikiPageEdit.pageTitle" placeholder="请输入标题" class="page-title-input"></el-input>
|
||||
<mavon-editor v-show="wikiPageEdit.editorType===2" v-model="markdownContent" @save="createWikiSave(0)" :toolbars="toolbars" placeholder="请录入文档内容" class="page-content-editor"/>
|
||||
<mavon-editor v-show="wikiPageEdit.editorType===2" ref="mavonEditor" v-model="markdownContent" :toolbars="toolbars"
|
||||
@save="createWikiSave(0)" @imgAdd="addMarkdownImage"
|
||||
placeholder="请录入文档内容" class="page-content-editor"/>
|
||||
<div v-show="wikiPageEdit.editorType===1" id="newPageContentDiv" class="page-content-editor"></div>
|
||||
</el-row>
|
||||
</div>
|
||||
@@ -40,6 +42,7 @@
|
||||
import pageApi from '../../common/api/page'
|
||||
import {mavonEditor, markdownIt} from 'mavon-editor'
|
||||
import 'mavon-editor/dist/css/index.css'
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: ['spaceId'],
|
||||
@@ -91,7 +94,8 @@
|
||||
/* 2.2.1 */
|
||||
subfield: true, // 单双栏模式
|
||||
preview: true, // 预览
|
||||
}
|
||||
},
|
||||
fileUploadUrl: process.env.VUE_APP_BASE_API + '/zyplayer-doc-wiki/page/file/wangEditor/upload',
|
||||
};
|
||||
},
|
||||
components: {
|
||||
@@ -225,6 +229,27 @@
|
||||
this.cleanPage();
|
||||
}
|
||||
},
|
||||
addMarkdownImage(pos, file) {
|
||||
let formData = new FormData();
|
||||
formData.append('files', file);
|
||||
axios({
|
||||
url: this.fileUploadUrl,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {'Content-Type': 'multipart/form-data'},
|
||||
timeout: 10000,
|
||||
withCredentials: true
|
||||
}).then(res => {
|
||||
let urlArr = res.data.data || [];
|
||||
if (urlArr.length > 0) {
|
||||
this.$refs.mavonEditor.$img2Url(pos, urlArr[0]);
|
||||
} else {
|
||||
this.$message.warning("上传失败,返回数据为空");
|
||||
}
|
||||
}).catch(e => {
|
||||
this.$message.warning("上传失败:" + e.message);
|
||||
});
|
||||
},
|
||||
initEditor() {
|
||||
this.editor = new WangEditor('#newPageContentDiv');
|
||||
this.editor.customConfig.uploadImgServer = process.env.VUE_APP_BASE_API + '/zyplayer-doc-wiki/page/file/wangEditor/upload';
|
||||
|
||||
@@ -575,6 +575,8 @@
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
/*覆盖样式*/
|
||||
.el-main{overflow: hidden;}
|
||||
.page-show-vue {height: 100%;}
|
||||
.page-show-vue .icon-collapse{float: left;font-size: 25px;color: #aaa;margin-top: 8px;cursor: pointer;}
|
||||
.page-show-vue .icon-collapse:hover{color: #eee;}
|
||||
|
||||
@@ -1 +1 @@
|
||||
::-webkit-scrollbar{width:6px;height:9px;-webkit-appearance:none}::-webkit-scrollbar-thumb{background:#ddd;border-radius:10px}::-webkit-scrollbar-track-piece{background:#eee}body,html{margin:0;padding:0}#app,.el-container,.el-menu,.global-layout-vue,body,html{height:100%}.el-header{background-color:#1d4e89!important;color:#333;line-height:40px;text-align:right;height:40px!important}.icon-collapse{float:left;font-size:25px;color:#aaa;margin-top:8px;cursor:pointer}.icon-collapse:hover{color:#eee}.head-icon{margin-right:15px;font-size:16px;cursor:pointer;color:#fff}.header-user-message .page-info-box{text-align:right;margin-top:10px}#app[data-v-3799a29f],body[data-v-3799a29f],html[data-v-3799a29f]{margin:0;padding:0;height:100%}pre[data-v-3799a29f]{margin:0;white-space:pre-wrap;font-size:14px;font-family:auto}.el-menu[data-v-3799a29f]{-webkit-box-sizing:border-box;box-sizing:border-box;border-right:0;margin-right:3px}.el-header[data-v-3799a29f]{background-color:#409eff;color:#333;line-height:40px;text-align:right;height:40px!important}.doc-body-box[data-v-3799a29f]{overflow-x:hidden;overflow-y:auto;width:100%;padding:10px;border-left:1px solid #f1f1f1;-webkit-box-sizing:border-box;box-sizing:border-box}.el-tree[data-v-3799a29f]{margin-right:3px}.logo[data-v-3799a29f]{border-bottom:1px solid #f1f1f1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:5px 10px;width:260px;height:40px;line-height:40px;font-size:25px;color:#666;text-align:center}.icon-collapse[data-v-3799a29f]{float:left;font-size:25px;color:#aaa;cursor:pointer;position:fixed}.icon-collapse[data-v-3799a29f]:hover{color:#ccc}.comment-box .head[data-v-3799a29f]{float:left;background-color:#ccc;border-radius:50%;margin-right:10px;width:45px;height:45px;line-height:45px;text-align:center;color:#fff}.build-info[data-v-3799a29f]{position:fixed;bottom:0;left:0;background:#fafafa;width:240px;text-align:center;padding:5px 0;color:#aaa;font-size:12px}.build-info span[data-v-3799a29f]{color:#4183c4;cursor:pointer}
|
||||
::-webkit-scrollbar{width:6px;height:9px;-webkit-appearance:none}::-webkit-scrollbar-thumb{background:#ddd;border-radius:10px}::-webkit-scrollbar-track-piece{background:#eee}body,html{margin:0;padding:0}#app,.el-container,.el-menu,.global-layout-vue,body,html{height:100%}.el-header{background-color:#1d4e89!important;color:#333;line-height:40px;text-align:right;height:40px!important}.icon-collapse{float:left;font-size:25px;color:#aaa;margin-top:8px;cursor:pointer}.icon-collapse:hover{color:#eee}.head-icon{margin-right:15px;font-size:16px;cursor:pointer;color:#fff}.header-user-message .page-info-box{text-align:right;margin-top:10px}#app[data-v-8f7ddbbc],body[data-v-8f7ddbbc],html[data-v-8f7ddbbc]{margin:0;padding:0;height:100%}pre[data-v-8f7ddbbc]{margin:0;white-space:pre-wrap;font-size:14px;font-family:auto}.el-menu[data-v-8f7ddbbc]{-webkit-box-sizing:border-box;box-sizing:border-box;border-right:0;margin-right:3px}.el-header[data-v-8f7ddbbc]{background-color:#409eff;color:#333;line-height:40px;text-align:right;height:40px!important}.doc-body-box[data-v-8f7ddbbc]{overflow-x:hidden;overflow-y:auto;width:100%;padding:10px;border-left:1px solid #f1f1f1;-webkit-box-sizing:border-box;box-sizing:border-box}.el-tree[data-v-8f7ddbbc]{margin-right:3px}.logo[data-v-8f7ddbbc]{border-bottom:1px solid #f1f1f1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:5px 10px;width:260px;height:40px;line-height:40px;font-size:25px;color:#666;text-align:center}.icon-collapse[data-v-8f7ddbbc]{float:left;font-size:25px;color:#aaa;cursor:pointer;position:fixed}.icon-collapse[data-v-8f7ddbbc]:hover{color:#ccc}.comment-box .head[data-v-8f7ddbbc]{float:left;background-color:#ccc;border-radius:50%;margin-right:10px;width:45px;height:45px;line-height:45px;text-align:center;color:#fff}.build-info[data-v-8f7ddbbc]{position:fixed;bottom:0;left:0;background:#fafafa;width:240px;text-align:center;padding:5px 0;color:#aaa;font-size:12px}.build-info span[data-v-8f7ddbbc]{color:#4183c4;cursor:pointer}
|
||||
@@ -1 +0,0 @@
|
||||
.page-show-vue{height:100%}.page-show-vue .icon-collapse{float:left;font-size:25px;color:#aaa;margin-top:8px;cursor:pointer}.page-show-vue .icon-collapse:hover{color:#eee}.page-show-vue .wiki-title{font-size:20px;text-align:center;font-weight:700}.page-show-vue .create-user-time{margin-right:20px}.page-show-vue .wiki-author{font-size:14px;color:#888;padding:20px 0;height:40px;line-height:40px}.page-show-vue .wiki-content{font-size:14px}.page-show-vue .wiki-content.w-e-text{overflow-y:auto}.page-show-vue .wiki-content.w-e-text img{cursor:auto}.page-show-vue .wiki-content.w-e-text img:hover{-webkit-box-shadow:unset;box-shadow:unset}.page-show-vue .upload-page-file .el-upload-list{display:none}.page-show-vue .is-link{color:#1e88e5;cursor:pointer}.page-show-vue #newPageContentDiv .w-e-text-container{height:600px!important}.page-show-vue .head{float:left;background-color:#ccc;border-radius:50%;margin-right:10px;width:45px;height:45px;line-height:45px;text-align:center;color:#fff}.page-show-vue .el-tabs__header{margin:0}.page-show-vue .el-tabs__nav-wrap{padding:0 20px}.page-show-vue .close-action-tab{position:absolute;right:15px;top:12px;cursor:pointer;z-index:1}.page-show-vue .action-tab-box{height:calc(100vh - 120px);overflow:auto;padding:20px 10px}.page-show-vue .action-box-empty{text-align:center;padding-top:30px;color:#888;font-size:14px}.page-show-vue .history-item{height:55px;line-height:25px;cursor:pointer;vertical-align:middle}.page-show-vue .history-loading-status{margin-left:5px;color:#67c23a}.page-show-vue .history-loading-status.el-icon-circle-close{color:#f56c6c}.page-show-vue .el-timeline{-webkit-padding-start:0;padding-inline-start:0}.page-show-vue .comment-user-name{margin-bottom:10px}.page-show-vue .comment-content{padding:0;color:#666;margin:0;white-space:pre-wrap;word-wrap:break-word;line-height:20px}.page-show-vue .comment-input-box{position:absolute;bottom:0;width:100%;background:#fff;border-top:1px solid #f1f1f1}.page-show-vue .comment-input-box textarea{resize:none;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;border:0;outline:none!important;padding:10px}.page-show-vue .comment-card .comment-user-name .el-icon-delete{color:#888;font-size:13px;cursor:pointer;float:right;display:none}.page-show-vue .comment-card:hover .comment-user-name .el-icon-delete{display:inline-block}
|
||||
@@ -0,0 +1 @@
|
||||
.el-main{overflow:hidden}.page-show-vue{height:100%}.page-show-vue .icon-collapse{float:left;font-size:25px;color:#aaa;margin-top:8px;cursor:pointer}.page-show-vue .icon-collapse:hover{color:#eee}.page-show-vue .wiki-title{font-size:20px;text-align:center;font-weight:700}.page-show-vue .create-user-time{margin-right:20px}.page-show-vue .wiki-author{font-size:14px;color:#888;padding:20px 0;height:40px;line-height:40px}.page-show-vue .wiki-content{font-size:14px}.page-show-vue .wiki-content.w-e-text{overflow-y:auto}.page-show-vue .wiki-content.w-e-text img{cursor:auto}.page-show-vue .wiki-content.w-e-text img:hover{-webkit-box-shadow:unset;box-shadow:unset}.page-show-vue .upload-page-file .el-upload-list{display:none}.page-show-vue .is-link{color:#1e88e5;cursor:pointer}.page-show-vue #newPageContentDiv .w-e-text-container{height:600px!important}.page-show-vue .head{float:left;background-color:#ccc;border-radius:50%;margin-right:10px;width:45px;height:45px;line-height:45px;text-align:center;color:#fff}.page-show-vue .el-tabs__header{margin:0}.page-show-vue .el-tabs__nav-wrap{padding:0 20px}.page-show-vue .close-action-tab{position:absolute;right:15px;top:12px;cursor:pointer;z-index:1}.page-show-vue .action-tab-box{height:calc(100vh - 120px);overflow:auto;padding:20px 10px}.page-show-vue .action-box-empty{text-align:center;padding-top:30px;color:#888;font-size:14px}.page-show-vue .history-item{height:55px;line-height:25px;cursor:pointer;vertical-align:middle}.page-show-vue .history-loading-status{margin-left:5px;color:#67c23a}.page-show-vue .history-loading-status.el-icon-circle-close{color:#f56c6c}.page-show-vue .el-timeline{-webkit-padding-start:0;padding-inline-start:0}.page-show-vue .comment-user-name{margin-bottom:10px}.page-show-vue .comment-content{padding:0;color:#666;margin:0;white-space:pre-wrap;word-wrap:break-word;line-height:20px}.page-show-vue .comment-input-box{position:absolute;bottom:0;width:100%;background:#fff;border-top:1px solid #f1f1f1}.page-show-vue .comment-input-box textarea{resize:none;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;border:0;outline:none!important;padding:10px}.page-show-vue .comment-card .comment-user-name .el-icon-delete{color:#888;font-size:13px;cursor:pointer;float:right;display:none}.page-show-vue .comment-card:hover .comment-user-name .el-icon-delete{display:inline-block}
|
||||
@@ -1 +1 @@
|
||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=favicon-wiki.png><title>WIKI文档管理系统</title><link href=css/chunk-009efa60.c1509684.css rel=prefetch><link href=css/chunk-0741282a.1750663f.css rel=prefetch><link href=css/chunk-07e56bb7.63072588.css rel=prefetch><link href=css/chunk-32cc5643.5a5b2ca1.css rel=prefetch><link href=css/chunk-34407190.57bbfb51.css rel=prefetch><link href=css/chunk-4b763d50.7e74e765.css rel=prefetch><link href=css/chunk-5544a2b8.b3d0f39b.css rel=prefetch><link href=css/chunk-578c28a7.83c6d32d.css rel=prefetch><link href=css/chunk-5dc97978.ec6236ec.css rel=prefetch><link href=js/chunk-009efa60.dbe73c24.js rel=prefetch><link href=js/chunk-0741282a.d128d142.js rel=prefetch><link href=js/chunk-07e56bb7.e67dab8e.js rel=prefetch><link href=js/chunk-2d207ece.20edf665.js rel=prefetch><link href=js/chunk-2d20f55a.217546ad.js rel=prefetch><link href=js/chunk-32cc5643.fcf57a84.js rel=prefetch><link href=js/chunk-34407190.0d583c2d.js rel=prefetch><link href=js/chunk-4b763d50.1adcb2f6.js rel=prefetch><link href=js/chunk-5544a2b8.6714a421.js rel=prefetch><link href=js/chunk-578c28a7.6a10864d.js rel=prefetch><link href=js/chunk-5dc97978.14484106.js rel=prefetch><link href=css/app.e1e856e7.css rel=preload as=style><link href=css/chunk-vendors.43fc3011.css rel=preload as=style><link href=js/app.9c54b8f0.js rel=preload as=script><link href=js/chunk-vendors.4d2ae4cf.js rel=preload as=script><link href=css/chunk-vendors.43fc3011.css rel=stylesheet><link href=css/app.e1e856e7.css rel=stylesheet></head><body><noscript><strong>We're sorry but zyplayer-wiki-ui doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.4d2ae4cf.js></script><script src=js/app.9c54b8f0.js></script></body></html>
|
||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=favicon-wiki.png><title>WIKI文档管理系统</title><link href=css/chunk-009efa60.c1509684.css rel=prefetch><link href=css/chunk-0741282a.1750663f.css rel=prefetch><link href=css/chunk-07e56bb7.e552ef8f.css rel=prefetch><link href=css/chunk-32cc5643.5a5b2ca1.css rel=prefetch><link href=css/chunk-34407190.57bbfb51.css rel=prefetch><link href=css/chunk-4b763d50.7e74e765.css rel=prefetch><link href=css/chunk-5544a2b8.17d2b8a1.css rel=prefetch><link href=css/chunk-578c28a7.83c6d32d.css rel=prefetch><link href=css/chunk-5dc97978.ec6236ec.css rel=prefetch><link href=js/chunk-009efa60.dbe73c24.js rel=prefetch><link href=js/chunk-0741282a.d128d142.js rel=prefetch><link href=js/chunk-07e56bb7.d7a0ff3a.js rel=prefetch><link href=js/chunk-2d207ece.20edf665.js rel=prefetch><link href=js/chunk-2d20f55a.217546ad.js rel=prefetch><link href=js/chunk-32cc5643.fcf57a84.js rel=prefetch><link href=js/chunk-34407190.69ced152.js rel=prefetch><link href=js/chunk-4b763d50.c28900a5.js rel=prefetch><link href=js/chunk-5544a2b8.774dc497.js rel=prefetch><link href=js/chunk-578c28a7.54a578cc.js rel=prefetch><link href=js/chunk-5dc97978.1238356c.js rel=prefetch><link href=css/app.d1dc89b9.css rel=preload as=style><link href=css/chunk-vendors.43fc3011.css rel=preload as=style><link href=js/app.075210d5.js rel=preload as=script><link href=js/chunk-vendors.4d2ae4cf.js rel=preload as=script><link href=css/chunk-vendors.43fc3011.css rel=stylesheet><link href=css/app.d1dc89b9.css rel=stylesheet></head><body><noscript><strong>We're sorry but zyplayer-wiki-ui doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.4d2ae4cf.js></script><script src=js/app.075210d5.js></script></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user