|
@@ -33,17 +33,7 @@
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="消息内容:" prop="content">
|
|
|
- <quill-editor
|
|
|
- class="editor"
|
|
|
- v-model="content"
|
|
|
- ref="myQuillEditor"
|
|
|
- :content="value"
|
|
|
- :options="editorOption"
|
|
|
- @blur="onEditorBlur($event)"
|
|
|
- @focus="onEditorFocus($event)"
|
|
|
- @change="onEditorChange($event)"
|
|
|
- >
|
|
|
- </quill-editor>
|
|
|
+ <editor v-model="message.content" :min-height="192"/>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
|
@@ -58,18 +48,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import Quill from 'quill' // 引入编辑器
|
|
|
-import { submitMessage } from '../../api/message/message.js'
|
|
|
-// 自定义字体大小
|
|
|
-const Size = Quill.import('attributors/style/size')
|
|
|
-Size.whitelist = ['10px', '12px', '16px', '18px', '20px', '30px', '32px']
|
|
|
-Quill.register(Size, true)
|
|
|
-
|
|
|
-// 自定义字体类型
|
|
|
-var fonts = ['SimSun', 'SimHei', 'Microsoft-YaHei', 'KaiTi', 'FangSong', 'Arial', 'sans-serif']
|
|
|
-var Font = Quill.import('formats/font')
|
|
|
-Font.whitelist = fonts
|
|
|
-Quill.register(Font, true)
|
|
|
+import {submitMessage} from '../../api/message/message.js'
|
|
|
|
|
|
export default {
|
|
|
|
|
@@ -82,10 +61,9 @@ Quill.register(Font, true)
|
|
|
date1:'',
|
|
|
date2:'',
|
|
|
receivedUsers: '',
|
|
|
- content: 'lxx这是 vue-quill-editor 的内容',
|
|
|
+ content: '请输入内容',
|
|
|
cnt : 1
|
|
|
},
|
|
|
- content: `11111111<p>这是 vue-quill-editor 的内容!</p>`, //双向数据绑定数据
|
|
|
rules: {
|
|
|
messageTitle: [
|
|
|
{ required: true, message: '请输入消息标题', trigger: 'blur' }
|
|
@@ -106,29 +84,7 @@ Quill.register(Font, true)
|
|
|
{ required: true, message: '请导入内容' , trigger: 'blur' }
|
|
|
]
|
|
|
},
|
|
|
-
|
|
|
- // 富文本编辑器配置
|
|
|
- editorOption: {
|
|
|
- modules: {
|
|
|
- toolbar: [
|
|
|
- ['bold', 'italic', 'underline', 'strike'], // 加粗 斜体 下划线 删除线
|
|
|
- ['blockquote', 'code-block'], // 引用 代码块
|
|
|
- [{ header: 1 }, { header: 2 }], // 1、2 级标题
|
|
|
- [{ list: 'ordered' }, { list: 'bullet' }], // 有序、无序列表
|
|
|
- [{ script: 'sub' }, { script: 'super' }], // 上标/下标
|
|
|
- [{ indent: '-1' }, { indent: '+1' }], // 缩进
|
|
|
- [{ direction: 'rtl' }], // 文本方向
|
|
|
- [{ size: ['12px', false, '16px', '18px', '20px', '30px'] }], // 字体大小
|
|
|
- [{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
|
|
|
- [{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
|
|
|
- [{ font: [false, 'SimSun', 'SimHei', 'Microsoft-YaHei', 'KaiTi', 'FangSong', 'Arial'] }], // 字体种类
|
|
|
- [{ align: [] }], // 对齐方式
|
|
|
- ['clean'], // 清除文本格式
|
|
|
- ['link', 'image', 'video'] // 链接、图片、视频
|
|
|
- ],
|
|
|
- placeholder: '请输入正文'
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -152,7 +108,7 @@ Quill.register(Font, true)
|
|
|
console.log( "-****date1" , this.message.date1);
|
|
|
console.log( "-****date2" , this.message.date2);
|
|
|
console.log( "-****content" , this.message.content);
|
|
|
- console.log( "lxzhen-****content" , this.content);
|
|
|
+ // console.log( "lxzhen-****content" , this.content);
|
|
|
var dateTime = this.message.date1;
|
|
|
function add0(m){return m<10?'0'+m:m }
|
|
|
function format(shijianchuo)
|