diff --git a/README.md b/README.md
index 82e1b09f..56a67335 100644
--- a/README.md
+++ b/README.md
@@ -503,7 +503,7 @@ vite-plugin-svg-icons 使用说明:https://github.com/anncwb/vite-plugin-svg-i
**安装**
```
-npm i vite-plugin-svg-icons -D
+npm i -D vite-plugin-svg-icons
```
@@ -550,4 +550,20 @@ router.afterEach(() => {
NProgress.done()
})
-```
\ No newline at end of file
+```
+
+## TinyMCE 富文本编辑器
+
+**官网:** http://tinymce.ax-z.cn/integrations/integrate-index.php
+
+**安装**
+
+```
+npm i -S tinymce
+
+npm i -S @tinymce/tinymce-vue
+
+npm i -D @types/tinymce
+```
+
+
diff --git a/package.json b/package.json
index 1c803cbf..bd620750 100644
--- a/package.json
+++ b/package.json
@@ -8,6 +8,7 @@
},
"dependencies": {
"@element-plus/icons": "0.0.11",
+ "@tinymce/tinymce-vue": "^4.0.5",
"axios": "^0.24.0",
"element-plus": "^1.2.0-beta.6",
"nprogress": "^0.2.0",
@@ -15,6 +16,7 @@
"path-to-regexp": "^6.2.0",
"pinia": "^2.0.9",
"screenfull": "^6.0.0",
+ "tinymce": "^5.10.2",
"vue": "^3.2.16",
"vue-router": "^4.0.12"
},
@@ -22,6 +24,7 @@
"@types/node": "^16.11.7",
"@types/nprogress": "^0.2.0",
"@types/path-browserify": "^1.0.0",
+ "@types/tinymce": "^4.6.4",
"@vitejs/plugin-vue": "^1.9.3",
"sass": "^1.43.4",
"typescript": "^4.4.3",
diff --git a/src/components/Tinymce/Index.vue b/src/components/Tinymce/Index.vue
new file mode 100644
index 00000000..4ec6849e
--- /dev/null
+++ b/src/components/Tinymce/Index.vue
@@ -0,0 +1,255 @@
+
+
+
+
+
+
+
diff --git a/src/components/Tinymce/components/EditorImage.vue b/src/components/Tinymce/components/EditorImage.vue
new file mode 100644
index 00000000..b20a4f30
--- /dev/null
+++ b/src/components/Tinymce/components/EditorImage.vue
@@ -0,0 +1,152 @@
+
+
+
+ 上传
+
+
+
+
+ Click upload
+
+
+
+ Cancel
+
+
+ Confirm
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Tinymce/config.ts b/src/components/Tinymce/config.ts
new file mode 100644
index 00000000..937d7511
--- /dev/null
+++ b/src/components/Tinymce/config.ts
@@ -0,0 +1,8 @@
+// Import plugins that you want to use
+// Detail plugins list see: https://www.tiny.cloud/apps/#core-plugins
+// Custom builds see: https://www.tiny.cloud/get-tiny/custom-builds/
+export const plugins = ['advlist anchor autolink autoresize autosave charmap code codesample directionality emoticons fullpage fullscreen help hr image imagetools insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table template textpattern visualblocks visualchars wordcount']
+
+// Here is the list of toolbar control components
+// Details see: https://www.tinymce.com/docs/advanced/editor-control-identifiers/#toolbarcontrols
+export const toolbar = ['searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample help', 'hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons charmap forecolor backcolor fullpage fullscreen']
diff --git a/src/views/pms/goods/components/GoodsCategory.vue b/src/views/pms/goods/components/GoodsCategory.vue
index 53845286..a6a0665e 100644
--- a/src/views/pms/goods/components/GoodsCategory.vue
+++ b/src/views/pms/goods/components/GoodsCategory.vue
@@ -20,7 +20,7 @@
@@ -32,8 +32,10 @@ import {ElCascaderPanel, ElMessage} from "element-plus";
const emit = defineEmits(['next'])
const props = defineProps({
- goodsId: Number,
- categoryId: Number
+ modelValue: {
+ type: Object,
+ default:{ }
+ }
})
const state = reactive({
@@ -44,15 +46,11 @@ const state = reactive({
const {categoryOptions, pathLabels, categoryId} = toRefs(state)
-onMounted(() => {
- loadData()
-})
-
function loadData() {
listCascadeCategories({}).then(response => {
state.categoryOptions = response.data
- if (props.goodsId) {
- state.categoryId = props.categoryId as any
+ if (props.modelValue.id) {
+ state.categoryId = props.modelValue.categoryId
nextTick(() => {
handleCategoryChange()
})
@@ -67,8 +65,7 @@ function handleCategoryChange() {
state.categoryId = checkNode.value
}
-
-function onNextStepClick() {
+function handleNext() {
if (!state.categoryId) {
ElMessage.warning('请选择商品分类')
return false
@@ -76,6 +73,11 @@ function onNextStepClick() {
emit('next' )
}
+
+onMounted(() => {
+ loadData()
+})
+
--->