-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 展示
- 隐藏
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
@@ -89,12 +146,12 @@ import {
seeArticle,
updateArticleStatus,
} from "@/api/pages";
-import editor from "@/views/my-components/lili/editor";
-
+import Editor from "@tinymce/tinymce-vue";
+import { initEditor } from "@/views/lili-components/editor/config";
export default {
name: "article",
components: {
- editor,
+ editor: Editor,
},
props: {
selected: {
@@ -104,6 +161,7 @@ export default {
},
data() {
return {
+ initEditor: initEditor,
selectedIndex: 99999, // 已选下标
loading: true, // 表单加载状态
modalType: 0, // 添加或编辑标识
@@ -150,7 +208,7 @@ export default {
title: "是否显示",
key: "openStatus",
width: 100,
- slot: "openStatusSlot"
+ slot: "openStatusSlot",
},
{
title: "排序",
@@ -170,7 +228,10 @@ export default {
{
props: {
size: "small",
- type: this.selectedIndex == params.index ? "primary" : "default",
+ type:
+ this.selectedIndex == params.index
+ ? "primary"
+ : "default",
},
style: {
marginRight: "5px",
@@ -389,11 +450,11 @@ export default {
add() {
this.modalType = 0;
this.modalTitle = "添加文章";
- this.treeValue = '';
+ this.treeValue = "";
this.form = {
sort: 1,
- content:''
+ content: "",
};
this.$refs.form.resetFields();
delete this.form.id;
@@ -403,9 +464,9 @@ export default {
edit(data) {
this.modalType = 1;
this.modalTitle = "编辑文章";
- this.treeValue = '';
+ this.treeValue = "";
this.form = {
- content:''
+ content: "",
};
this.$refs.form.resetFields();
@@ -415,7 +476,7 @@ export default {
this.form.categoryId = res.result.categoryId;
this.treeValue = data.articleCategoryName;
this.form.id = data.id;
- this.form.content =res.result.content;
+ this.form.content = res.result.content;
this.form.title = res.result.title;
this.form.sort = res.result.sort;
this.form.openStatus = res.result.openStatus;
diff --git a/manager/src/views/privacy-content/index.vue b/manager/src/views/privacy-content/index.vue
index d794ef7c..744e6e6a 100644
--- a/manager/src/views/privacy-content/index.vue
+++ b/manager/src/views/privacy-content/index.vue
@@ -15,7 +15,13 @@
-
+
+
@@ -33,12 +39,12 @@ import {
updatePrivacy,
getPrivacy,
} from "@/api/pages";
-import editor from "@/views/my-components/lili/editor";
-
+import Editor from "@tinymce/tinymce-vue";
+import { initEditor } from "@/views/lili-components/editor/config";
export default {
name: "privacy",
- components: {
- editor,
+ components: {
+ editor: Editor,
},
props: {
selected: {
@@ -48,6 +54,7 @@ export default {
},
data() {
return {
+ initEditor,
loading: false, // 表单加载状态
modalVisible: false, // 添加或编辑显示
treeDataDefault: [],
diff --git a/manager/vue.config.js b/manager/vue.config.js
index 2a3ea716..cb688fee 100644
--- a/manager/vue.config.js
+++ b/manager/vue.config.js
@@ -22,7 +22,6 @@ let externals = {
"view-design": "iview",
"vue-lazyload": "VueLazyload",
"js-cookie": "Cookies",
- wangeditor: "wangEditor",
"sockjs-client": "SockJS",
"@antv/g2": "G2",
dplayer: "DPlayer"
@@ -41,7 +40,7 @@ let cdn = {
"https://cdn.pickmall.cn/cdn/vue-lazyload.min.js",
"https://cdn.pickmall.cn/cdn/js.cookie.min.js",
"https://cdn.pickmall.cn/cdn/DPlayer.min.js",
- "https://cdn.pickmall.cn/cdn/wangEditor.min.js",
+
"https://cdn.pickmall.cn/cdn/sockjs.min.js",
"https://gw.alipayobjects.com/os/lib/antv/g2/4.1.24/dist/g2.min.js"
]
diff --git a/seller/package.json b/seller/package.json
index 563d30f4..c61804ba 100644
--- a/seller/package.json
+++ b/seller/package.json
@@ -12,6 +12,7 @@
"dependencies": {
"@amap/amap-jsapi-loader": "0.0.7",
"@antv/g2": "^4.1.14",
+ "@tinymce/tinymce-vue": "^3.2.0",
"axios": "^0.21.1",
"js-cookie": "^2.2.1",
"node-sass": "^4.14.1",
@@ -26,7 +27,6 @@
"vue-router": "^3.1.3",
"vuedraggable": "^2.23.2",
"vuex": "^3.4.0",
- "wangeditor": "^4.6.13",
"xss": "^1.0.7"
},
"devDependencies": {
diff --git a/seller/src/App.vue b/seller/src/App.vue
index 6377d61c..c9a73dcd 100644
--- a/seller/src/App.vue
+++ b/seller/src/App.vue
@@ -38,4 +38,7 @@ body {
.ivu-tag {
cursor: pointer;
}
+.tox-notifications-container{
+ display: none !important;
+}
diff --git a/seller/src/api/common.js b/seller/src/api/common.js
index da6e0c46..0b024239 100644
--- a/seller/src/api/common.js
+++ b/seller/src/api/common.js
@@ -1,4 +1,4 @@
-import {commonUrl, getRequest} from '@/libs/axios';
+import { commonUrl, getRequest, uploadFileRequest ,uploadFile} from "@/libs/axios";
// 通过id获取子地区
export const getChildRegion = (id) => {
@@ -10,15 +10,18 @@ export const getRegion = (params) => {
return getRequest(`${commonUrl}/common/common/region/region`, params);
};
-
-
// 获取IM接口前缀
-export function getIMDetail () {
+export function getIMDetail() {
return getRequest(`${commonUrl}/common/common/IM`);
}
-
//获取图片logo
-export function getBaseSite () {
+export function getBaseSite() {
return getRequest(`${commonUrl}/common/common/site`);
}
+
+// 上传文件
+export const upLoadFileMethods = (bold) => {
+ console.log(bold)
+ return uploadFileRequest(uploadFile, bold);
+};
diff --git a/seller/src/libs/axios.js b/seller/src/libs/axios.js
index b96ffada..7642288c 100644
--- a/seller/src/libs/axios.js
+++ b/seller/src/libs/axios.js
@@ -318,13 +318,16 @@ export const uploadFileRequest = (url, params) => {
return service({
method: "post",
url: `${url}`,
- params: params,
+ data: params,
headers: {
- accessToken: accessToken
+ accessToken: accessToken,
+ 'Content-Type': 'multipart/form-data'
}
});
};
+
+
/**
* 无需token验证的请求 避免旧token过期导致请求失败
* @param {*} url
diff --git a/seller/src/views/goods/goods-seller/goodsOperationSec.vue b/seller/src/views/goods/goods-seller/goodsOperationSec.vue
index 4a2f7183..60ad4f12 100644
--- a/seller/src/views/goods/goods-seller/goodsOperationSec.vue
+++ b/seller/src/views/goods/goods-seller/goodsOperationSec.vue
@@ -530,17 +530,30 @@
>
-
-
+
+
@@ -684,13 +697,15 @@ import * as API_GOODS from "@/api/goods";
import * as API_Shop from "@/api/shops";
import cloneObj from "@/utils/index";
import vuedraggable from "vuedraggable";
-import editor from "@/views/my-components/lili/editor";
+import Editor from "@tinymce/tinymce-vue";
+import { initEditor } from "@/views/lili-components/editor/config";
import { uploadFile } from "@/libs/axios";
import { regular } from "@/utils";
export default {
+ name: "goodsOperationSec",
components: {
- editor,
+ editor: Editor,
vuedraggable,
},
props: {
@@ -717,6 +732,7 @@ export default {
};
return {
regular,
+ initEditor,
total: 0,
global: 0,
accessToken: "", //令牌token
@@ -1460,7 +1476,8 @@ export default {
cost: skus[index].cost,
price: skus[index].price,
[cloneTemp[0].name]: specItem.value,
- images: skus[index].images || this.baseInfoForm.goodsGalleryFiles || [],
+ images:
+ skus[index].images || this.baseInfoForm.goodsGalleryFiles || [],
};
if (specItem.value !== "") {
obj.id = skus[index].id;
@@ -1882,4 +1899,7 @@ export default {
.ivu-select .ivu-select-dropdown {
overflow: hidden !important;
}
-
\ No newline at end of file
+/* .tox-notifications-container{
+ display: none !important;
+} */
+
diff --git a/seller/src/views/lili-components/editor/config.js b/seller/src/views/lili-components/editor/config.js
new file mode 100644
index 00000000..1ac5df20
--- /dev/null
+++ b/seller/src/views/lili-components/editor/config.js
@@ -0,0 +1,60 @@
+import plugins from "./plugins";
+import toobar from "./toolbar";
+import { upLoadFileMethods } from "@/api/common";
+
+export const initEditor = {
+ height: "400px",
+ language: "zh_CN",
+ menubar: "file edit insert view format table", // 菜单:指定应该出现哪些菜单
+ toolbar: toobar, // 分组工具栏控件
+ plugins: plugins, // 插件(比如: advlist | link | image | preview等)
+ object_resizing: false, // 是否禁用表格图片大小调整
+ end_container_on_empty_block: true, // enter键 分块
+ powerpaste_word_import: "merge", // 是否保留word粘贴样式 clean | merge
+ code_dialog_height: 450, // 代码框高度 、宽度
+ code_dialog_width: 1000,
+ advlist_bullet_styles: "square", // 无序列表 有序列表
+ maxSize: "2097152", // 设置图片大小
+ accept: "image/jpeg, image/png", // 设置图片上传规则
+ images_upload_handler: async function (blobInfo, success, failure) {
+ const formData = new FormData();
+ console.log("请求")
+ formData.append("file", blobInfo.blob());
+ try {
+ const res = await upLoadFileMethods(formData);
+ if (res.result) {
+ success(res.result)
+ } else {
+ failure("上传文件有误请稍后重试");
+ }
+ } catch (e) {
+ failure('上传出错')
+ }
+ },
+ // init_instance_callback: function (editor) {
+ // var freeTiny = document.querySelector(".tox .tox-notification--in .tox-notification .tox-notification--warning .tox .tox-notification--warning .tox-notifications-container");
+ // freeTiny.style.display = "none";
+ // },
+ content_style: `
+ * { padding:0; margin:0; }
+
+ html, body height:100%; }
+
+ img { max-width:100%; display:block;height:auto; }
+
+ a { text-decoration: none; }
+
+ iframe{ width: 100%; }
+
+ p { line-height:1.6; margin: 0px; }
+
+ table{ word-wrap:break-word; word-break:break-all; max-width:100%; border:none; border-color:#999; }
+
+ .mce-object-iframe{ width:100%; box-sizing:border-box; margin:0; padding:0; }
+
+ ul,ol{ list-style-position:inside; }
+ `, // 设置样式
+ statusbar: false, // 隐藏编辑器底部的状态栏
+ elementpath: false, // 禁用编辑器底部的状态栏
+ paste_data_images: true, // 允许粘贴图像
+};
diff --git a/seller/src/views/lili-components/editor/plugins.js b/seller/src/views/lili-components/editor/plugins.js
new file mode 100644
index 00000000..c78e47ea
--- /dev/null
+++ b/seller/src/views/lili-components/editor/plugins.js
@@ -0,0 +1,4 @@
+const plugins = [
+ 'advlist anchor autolink autosave code codesample colorpicker colorpicker contextmenu directionality emoticons fullscreen hr image imagetools importcss insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table template textcolor textpattern visualblocks visualchars wordcount'
+]
+export default plugins
diff --git a/seller/src/views/lili-components/editor/toolbar.js b/seller/src/views/lili-components/editor/toolbar.js
new file mode 100644
index 00000000..f3c483d4
--- /dev/null
+++ b/seller/src/views/lili-components/editor/toolbar.js
@@ -0,0 +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 ']
+export default toolbar
diff --git a/seller/src/views/my-components/lili/editor.vue b/seller/src/views/my-components/lili/editor.vue
deleted file mode 100644
index 03d8e3c9..00000000
--- a/seller/src/views/my-components/lili/editor.vue
+++ /dev/null
@@ -1,234 +0,0 @@
-