From fa4b44748da02da874b463a3632440353b8e404d Mon Sep 17 00:00:00 2001 From: wangqing Date: Wed, 18 Nov 2020 18:42:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E8=A1=A8=E5=8D=95=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintignore | 1 + .stylelintignore | 1 + src/api/index.js | 1 - src/assets/styles/home.scss | 25 +- src/components/generator/config.js | 23 +- src/components/tinymce/README.md | 3 + src/components/tinymce/config.js | 8 + src/components/tinymce/example/Index.vue | 38 ++ src/components/tinymce/index.js | 3 + src/components/tinymce/index.vue | 89 +++++ src/components/tinymce/package.json | 28 ++ src/components/tinymce/zh_CN.js | 420 +++++++++++++++++++++++ src/utils/index.js | 14 + src/utils/loadTinymce.js | 26 ++ src/views/form/index.vue | 42 ++- src/views/project/create.vue | 2 +- 16 files changed, 696 insertions(+), 28 deletions(-) create mode 100644 src/components/tinymce/README.md create mode 100644 src/components/tinymce/config.js create mode 100644 src/components/tinymce/example/Index.vue create mode 100644 src/components/tinymce/index.js create mode 100644 src/components/tinymce/index.vue create mode 100644 src/components/tinymce/package.json create mode 100644 src/components/tinymce/zh_CN.js create mode 100644 src/utils/loadTinymce.js diff --git a/.eslintignore b/.eslintignore index b46a6ea..f563a2c 100644 --- a/.eslintignore +++ b/.eslintignore @@ -6,3 +6,4 @@ vue.config.js src/utils/sign.js src/views/form/ src/utils/ +src/components/parser diff --git a/.stylelintignore b/.stylelintignore index a19b94c..21cc331 100644 --- a/.stylelintignore +++ b/.stylelintignore @@ -5,3 +5,4 @@ src/theme/ src/utils/sign.js src/views/form/ src/utils/ +src/components/parser diff --git a/src/api/index.js b/src/api/index.js index 081d3e0..6d2403f 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -75,7 +75,6 @@ api.interceptors.response.use( * 则代码如下 */ const res = response.data - console.log(res) if (res.code === 200) { return Promise.resolve(res) } else if (res.code === 500) { diff --git a/src/assets/styles/home.scss b/src/assets/styles/home.scss index 5852634..bdc7415 100644 --- a/src/assets/styles/home.scss +++ b/src/assets/styles/home.scss @@ -51,9 +51,12 @@ $lighterBlue: #409eff; width: 260px; position: absolute; left: 0; - top: 0; + top: 20px; height: 100vh; } +.el-menu.el-menu--horizontal { + border-bottom: none; +} .left-scrollbar { //height: calc(100vh - 42px); height: calc(100vh - 142px); @@ -67,9 +70,11 @@ $lighterBlue: #409eff; .center-scrollbar { height: calc(100vh - 42px); overflow: hidden; - border-left: 1px solid #f1e8e8; - border-right: 1px solid #f1e8e8; + //border-left: 1px solid #f1e8e8; + //border-right: 1px solid #f1e8e8; + margin: 3px; box-sizing: border-box; + border: 2px solid rgba(255, 255, 255, 100); } .center-board { height: 100vh; @@ -274,12 +279,22 @@ $lighterBlue: #409eff; } } } -.form-name-title:hover { +.form-name-text:hover { text-align: center; border: 1px dashed #7b7b7b; } -.form-name-title { +.form-name-text { + padding: 6px 10px; border: 1px dashed transparent; width: 80%; line-height: 30px; } +.form-name-text input { + border: none; + background-color: transparent; +} +[contenteditable]:focus { + outline: none; + background-color: #f4f4f4; + border: 1px solid #f4f4f4; +} diff --git a/src/components/generator/config.js b/src/components/generator/config.js index 3d79226..e7adf07 100644 --- a/src/components/generator/config.js +++ b/src/components/generator/config.js @@ -9,13 +9,16 @@ export const formConf = { gutter: 15, disabled: false, span: 24, + title: '问卷名称', + description: '为了给您提供更好的服务,希望您能抽出几分钟时间,将您的感受和建议告诉我们,我们非常重视每位\n' + + '用户的宝贵意见,期待您的参与!现在我们就马上开始吧!', formBtns: true } // 输入型组件 【左面板】 export const inputComponents = [ { - // 组件的自定义配置 + // 组件的自定义配置 __config__: { label: '单行文本', labelWidth: null, @@ -38,7 +41,7 @@ export const inputComponents = [ }, // 其余的为可直接写在组件标签上的属性 placeholder: '请输入', - style: { width: '100%' }, + style: {width: '100%'}, clearable: true, 'prefix-icon': '', 'suffix-icon': '', @@ -68,7 +71,7 @@ export const inputComponents = [ minRows: 4, maxRows: 4 }, - style: { width: '100%' }, + style: {width: '100%'}, maxlength: null, 'show-word-limit': false, readonly: false, @@ -95,7 +98,7 @@ export const inputComponents = [ }, placeholder: '请输入', 'show-password': true, - style: { width: '100%' }, + style: {width: '100%'}, clearable: true, 'prefix-icon': '', 'suffix-icon': '', @@ -175,7 +178,7 @@ export const selectComponents = [ }] }, placeholder: '请选择', - style: { width: '100%' }, + style: {width: '100%'}, clearable: true, disabled: false, filterable: false, @@ -211,7 +214,7 @@ export const selectComponents = [ }] }], placeholder: '请选择', - style: { width: '100%' }, + style: {width: '100%'}, props: { props: { multiple: false, @@ -350,7 +353,7 @@ export const selectComponents = [ document: 'https://element.eleme.cn/#/zh-CN/component/time-picker' }, placeholder: '请选择', - style: { width: '100%' }, + style: {width: '100%'}, disabled: false, clearable: true, 'picker-options': { @@ -374,7 +377,7 @@ export const selectComponents = [ changeTag: true, document: 'https://element.eleme.cn/#/zh-CN/component/time-picker' }, - style: { width: '100%' }, + style: {width: '100%'}, disabled: false, clearable: true, 'is-range': true, @@ -401,7 +404,7 @@ export const selectComponents = [ }, placeholder: '请选择', type: 'date', - style: { width: '100%' }, + style: {width: '100%'}, disabled: false, clearable: true, format: 'yyyy-MM-dd', @@ -423,7 +426,7 @@ export const selectComponents = [ changeTag: true, document: 'https://element.eleme.cn/#/zh-CN/component/date-picker' }, - style: { width: '100%' }, + style: {width: '100%'}, type: 'daterange', 'range-separator': '至', 'start-placeholder': '开始日期', diff --git a/src/components/tinymce/README.md b/src/components/tinymce/README.md new file mode 100644 index 0000000..65c01e2 --- /dev/null +++ b/src/components/tinymce/README.md @@ -0,0 +1,3 @@ +## 简介 +富文本编辑器tinymce的一个vue版本封装。使用cdn动态脚本引入的方式加载。 + diff --git a/src/components/tinymce/config.js b/src/components/tinymce/config.js new file mode 100644 index 0000000..c9ae848 --- /dev/null +++ b/src/components/tinymce/config.js @@ -0,0 +1,8 @@ +/* eslint-disable max-len */ + +export const plugins = [ + 'advlist anchor autolink autosave code codesample directionality emoticons fullscreen hr image imagetools insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table template textpattern visualblocks visualchars wordcount' +] +export const toolbar = [ + 'code searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote removeformat subscript superscript codesample hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen' +] diff --git a/src/components/tinymce/example/Index.vue b/src/components/tinymce/example/Index.vue new file mode 100644 index 0000000..36c836c --- /dev/null +++ b/src/components/tinymce/example/Index.vue @@ -0,0 +1,38 @@ + + + diff --git a/src/components/tinymce/index.js b/src/components/tinymce/index.js new file mode 100644 index 0000000..1e83179 --- /dev/null +++ b/src/components/tinymce/index.js @@ -0,0 +1,3 @@ +import Index from './index.vue' + +export default Index diff --git a/src/components/tinymce/index.vue b/src/components/tinymce/index.vue new file mode 100644 index 0000000..ef29d6d --- /dev/null +++ b/src/components/tinymce/index.vue @@ -0,0 +1,89 @@ +