diff --git a/index.html b/index.html index fb46ba00..3f9cb902 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,8 @@ + + Vite App diff --git a/package.json b/package.json index d4a612d8..c2757f79 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "i18next": "^21.6.7", "intro.js": "^4.3.0", "lodash-es": "^4.17.21", + "marked": "^4.0.10", "mockjs": "^1.1.0", "pinia": "^2.0.9", "sortablejs": "^1.14.0", @@ -51,6 +52,7 @@ "@types/core-js": "^2.5.5", "@types/intro.js": "^3.0.2", "@types/lodash-es": "^4.17.5", + "@types/marked": "^4.0.1", "@types/node": "^17.0.10", "@types/sortablejs": "^1.10.7", "@typescript-eslint/eslint-plugin": "^5.10.0", diff --git a/src/locales/en/modules/route.ts b/src/locales/en/modules/route.ts index c6bf82a5..4a25d7c0 100644 --- a/src/locales/en/modules/route.ts +++ b/src/locales/en/modules/route.ts @@ -12,6 +12,7 @@ const route = { editor: 'Editor', editor_logicFlow: 'LogicFlow', editor_richText: 'RichText Editor', + editor_markdown: 'Markdown', userInfo: 'UserInfo', userList: 'UserList', userDateil: 'UserDateil', diff --git a/src/locales/zh-ch/modules/route.ts b/src/locales/zh-ch/modules/route.ts index 1c5192e3..71188856 100644 --- a/src/locales/zh-ch/modules/route.ts +++ b/src/locales/zh-ch/modules/route.ts @@ -10,8 +10,9 @@ const route = { echarts_bar: '柱状图', echarts_map: '地图', editor: '编辑器', - editor_logicFlow: '流程图', + editor_logicFlow: '流程图编辑器', editor_richText: '富文本编辑器', + editor_markdown: 'Markdown', userInfo: '用户管理', userList: '用户列表', userDateil: '用户详情', diff --git a/src/router/modules/otherRoute/otherRoute.ts b/src/router/modules/otherRoute/otherRoute.ts index c1c9e41c..da531cbb 100644 --- a/src/router/modules/otherRoute/otherRoute.ts +++ b/src/router/modules/otherRoute/otherRoute.ts @@ -94,6 +94,12 @@ const safeManagerRoutes: Array = [ component: () => import('@/views/editor/richText/index.vue'), meta: { title: t('route.pathName.editor_richText') }, }, + { + path: 'markdown', + name: 'RtMarkdown', + component: () => import('@/views/editor/markdown/index.vue'), + meta: { title: t('route.pathName.editor_markdown') }, + }, { path: 'logic-flow', name: 'RtLogicFlow', diff --git a/src/styles/mycolor.module.scss b/src/styles/mycolor.module.scss new file mode 100644 index 00000000..8f7ae01d --- /dev/null +++ b/src/styles/mycolor.module.scss @@ -0,0 +1,6 @@ +$-fagfa: red; + +:export { + // 主题背景颜色 + mainBgColor: #{$main-bg-color}; // 首选背景颜色 +} diff --git a/src/views/editor/markdown/index.vue b/src/views/editor/markdown/index.vue new file mode 100644 index 00000000..56f5fa5c --- /dev/null +++ b/src/views/editor/markdown/index.vue @@ -0,0 +1,35 @@ + + + + diff --git a/src/views/editor/richText/index.vue b/src/views/editor/richText/index.vue index cf80cded..957e3e05 100644 --- a/src/views/editor/richText/index.vue +++ b/src/views/editor/richText/index.vue @@ -9,7 +9,9 @@ import wangeDitor from 'wangeditor'; import i18next from 'i18next'; import { useI18n } from '@/hooks/web/useI18n'; + import ment from '@/styles/mycolor.module.scss'; + console.log(ment.mainBgColor); const editorELRef = ref({} as HTMLElement); const editor = ref({} as wangeDitor); const html = ref(''); @@ -17,9 +19,10 @@ function init() { editor.value = new wangeDitor(unref(editorELRef)); + console.log(editor.value.config); editor.value.config.lang = locale.value === 'zh-ch' ? 'zh-ch' : 'en'; - editor.value.i18next = i18next; editor.value.config.height = 500; + editor.value.i18next = i18next; Object.assign(editor.value.config, { onchange() { html.value = editor.value.txt.html() as string; diff --git a/src/views/useradmin/userlist/index.vue b/src/views/useradmin/userlist/index.vue index fe3ca9c2..4fcd150f 100644 --- a/src/views/useradmin/userlist/index.vue +++ b/src/views/useradmin/userlist/index.vue @@ -16,6 +16,8 @@