夜良king 2022-12-07 10:45:25 +08:00
commit 29091739d4
6 changed files with 15 additions and 14 deletions

View File

@ -5,25 +5,21 @@ import { upLoadFile } from "@/api/common";
export const initEditor = { export const initEditor = {
height: "400px", height: "400px",
language: "zh_CN", language: "zh_CN",
menubar: "file edit insert view format table", // 菜单:指定应该出现哪些菜单 menubar: "file edit view format table", // 菜单:指定应该出现哪些菜单
toolbar: toobar, // 分组工具栏控件 toolbar: toobar, // 分组工具栏控件
plugins: plugins, // 插件(比如: advlist | link | image | preview等) plugins: plugins, // 插件(比如: advlist | link | image | preview等)
object_resizing: false, // 是否禁用表格图片大小调整 object_resizing: false, // 是否禁用表格图片大小调整
end_container_on_empty_block: true, // enter键 分块 end_container_on_empty_block: true, // enter键 分块
powerpaste_word_import: "merge", // 是否保留word粘贴样式 clean | merge powerpaste_word_import: "merge", // 是否保留word粘贴样式 clean | merge
code_dialog_height: 450, // 代码框高度 、宽度
code_dialog_width: 1000,
advlist_bullet_styles: "square", // 无序列表 有序列表 advlist_bullet_styles: "square", // 无序列表 有序列表
maxSize: "2097152", // 设置图片大小 maxSize: "2097152", // 设置图片大小
accept: "image/jpeg, image/png", // 设置图片上传规则 accept: "image/jpeg, image/png", // 设置图片上传规则
images_upload_handler: async function (blobInfo, success, failure) { images_upload_handler: async function (blobInfo, success, failure) {
console.log("请求")
const formData = new FormData(); const formData = new FormData();
formData.append("file", blobInfo.blob()); formData.append("file", blobInfo.blob());
try { try {
const res = await upLoadFile(formData); const res = await upLoadFile(formData);
if (res.result) { if (res.result) {
success(res.result) success(res.result)
} else { } else {
failure("上传文件有误请稍后重试"); failure("上传文件有误请稍后重试");
@ -33,7 +29,7 @@ export const initEditor = {
} }
}, },
// init_instance_callback: function (editor) { // init_instance_callback: function (editor) {
// var freeTiny = document.querySelector(".tox .tox-notification--in"); // var freeTiny = document.querySelector(".tox .tox-notification--in .tox-notification .tox-notification--warning .tox .tox-notification--warning .tox-notifications-container");
// freeTiny.style.display = "none"; // freeTiny.style.display = "none";
// }, // },
content_style: ` content_style: `

View File

@ -1,2 +1,2 @@
const toolbar = ['searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample', 'hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor '] const toolbar = ['searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript', 'hr bullist numlist link charmap preview pagebreak insertdatetime table emoticons forecolor backcolor ']
export default toolbar export default toolbar

View File

@ -369,4 +369,9 @@ export const editOtherUser = (id, params) => {
return putRequest(`/clerk/${id}`,params); return putRequest(`/clerk/${id}`,params);
}; };
// /**
// * 搜索部门 先加入此api防止运行warn
// */
// export const searchDepartment = (params) => {
// return getRequest("/permission/department/search", params);
// };

View File

@ -535,6 +535,7 @@
prop="intro" prop="intro"
style="width: 100%" style="width: 100%"
> >
<Alert class='editor-alert' type="warning">将文件夹下的图片进行拖拽到文本框内即可完成单/多图片上传</Alert>
<editor <editor
ref="editor" ref="editor"
v-model="baseInfoForm.intro" v-model="baseInfoForm.intro"
@ -1954,7 +1955,9 @@ export default {
.ivu-select .ivu-select-dropdown { .ivu-select .ivu-select-dropdown {
overflow: hidden !important; overflow: hidden !important;
} }
.editor-alert{
text-align: left;
}
/* .tox-notifications-container{ /* .tox-notifications-container{
display: none !important; display: none !important;
} */ } */

View File

@ -5,20 +5,17 @@ import { upLoadFileMethods } from "@/api/common";
export const initEditor = { export const initEditor = {
height: "400px", height: "400px",
language: "zh_CN", language: "zh_CN",
menubar: "file edit insert view format table", // 菜单:指定应该出现哪些菜单 menubar: "file edit view format table", // 菜单:指定应该出现哪些菜单
toolbar: toobar, // 分组工具栏控件 toolbar: toobar, // 分组工具栏控件
plugins: plugins, // 插件(比如: advlist | link | image | preview等) plugins: plugins, // 插件(比如: advlist | link | image | preview等)
object_resizing: false, // 是否禁用表格图片大小调整 object_resizing: false, // 是否禁用表格图片大小调整
end_container_on_empty_block: true, // enter键 分块 end_container_on_empty_block: true, // enter键 分块
powerpaste_word_import: "merge", // 是否保留word粘贴样式 clean | merge powerpaste_word_import: "merge", // 是否保留word粘贴样式 clean | merge
code_dialog_height: 450, // 代码框高度 、宽度
code_dialog_width: 1000,
advlist_bullet_styles: "square", // 无序列表 有序列表 advlist_bullet_styles: "square", // 无序列表 有序列表
maxSize: "2097152", // 设置图片大小 maxSize: "2097152", // 设置图片大小
accept: "image/jpeg, image/png", // 设置图片上传规则 accept: "image/jpeg, image/png", // 设置图片上传规则
images_upload_handler: async function (blobInfo, success, failure) { images_upload_handler: async function (blobInfo, success, failure) {
const formData = new FormData(); const formData = new FormData();
console.log("请求")
formData.append("file", blobInfo.blob()); formData.append("file", blobInfo.blob());
try { try {
const res = await upLoadFileMethods(formData); const res = await upLoadFileMethods(formData);

View File

@ -1,2 +1,2 @@
const toolbar = ['searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample', 'hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor '] const toolbar = ['searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript', 'hr bullist numlist link charmap preview pagebreak insertdatetime table emoticons forecolor backcolor ']
export default toolbar export default toolbar