This commit is contained in:
@fawn-nine
2023-11-08 17:30:42 +08:00
parent 4c00a03fc9
commit a0ce741c5c
2 changed files with 67 additions and 8 deletions

View File

@@ -134,25 +134,30 @@
></el-input>
</el-form-item>
<el-form-item label="定位" prop="position">
<el-input
<!-- <el-input
type="textarea"
v-model="form.position"
placeholder="请输入定位"
></el-input>
></el-input> -->
<quill-editor v-model="form.position" ref="myQuillEditor2" :options="editorOption" class="shangpin_editor"> </quill-editor>
</el-form-item>
<el-form-item label="主治" prop="indication">
<el-input
<!-- <el-input
type="textarea"
v-model="form.indication"
placeholder="请输入主治"
></el-input>
></el-input> -->
<quill-editor v-model="form.indication" ref="myQuillEditor" :options="editorOption"
class="shangpin_editor"> </quill-editor>
</el-form-item>
<el-form-item label="配伍" prop="compatibility">
<el-input
<!-- <el-input
type="textarea"
v-model="form.compatibility"
placeholder="请输入配伍"
></el-input>
></el-input> -->
<quill-editor v-model="form.compatibility" ref="myQuillEditor1" :options="editorOption"
class="shangpin_editor"> </quill-editor>
</el-form-item>
<el-form-item label="文献" prop="literature">
<el-input
@@ -173,6 +178,29 @@
<script>
import global from "../../common/common.vue"; //引入共用组间
import {
quillEditor
} from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
const toolbarOptions = [
// ['bold', 'italic', 'underline', 'strike'], // 加粗,斜体,下划线,删除线
// ['blockquote', 'code-block'], //引用,代码块
// [{ 'header': 1 }, { 'header': 2 }], // 几级标题
// [{ 'list': 'ordered' }, { 'list': 'bullet' }], // 有序列表,无序列表
// [{ 'script': 'sub' }, { 'script': 'super' }], // 下角标,上角标
// [{ 'indent': '-1' }, { 'indent': '+1' }], // 缩进
// [{ 'direction': 'rtl' }], // 文字输入方向
// [{ 'size': ['small', false, 'large', 'huge'] }], // 字体大小
// [{ 'header': [1, 2, 3, 4, 5, 6, false] }],// 标题
// /[{ 'color': [] }, { 'background': [] }], // 颜色选择
// [{ 'font': ['SimSun', 'SimHei', 'Microsoft-YaHei', 'KaiTi', 'FangSong', 'Arial'] }],// 字体
// [{ 'align': [] }], // 居中
// ['clean'], // 清除样式,
// ['link', 'image'], // 上传图片、上传视频
]
export default {
data() {
return {
@@ -181,6 +209,32 @@ export default {
dataForm: {
key: ""
},
// 富文本编辑器配置
editorOption: {
modules: {
toolbar:false,
// history: {
// delay: 1000,
// maxStack: 50,
// userOnly: false
// },
// toolbar: {
// container: toolbarOptions,
// handlers: {
// image: function (value) {
// if (value) {
// // 调用element的图片上传组件
// document.querySelector('.avatar-uploader input').click()
// } else {
// this.quill.format('image', false)
// }
// }
// }
// },
},
placeholder: '请输入..',
},
form: {
id: null, // 穴位内容id
title: "",
@@ -232,6 +286,9 @@ export default {
this.getDataList();
this.getCatTreeList();
},
components: {
quillEditor
},
methods: {
getDetail(item) {
this.form.id = item;
@@ -267,6 +324,7 @@ export default {
});
}
} else {
this.fileList = []
}
})
.catch(({ e }) => {
@@ -303,6 +361,7 @@ export default {
// console.log("关闭了");
this.$nextTick(() => {
this.$refs["form"].resetFields();
this.form.imageList = []
// this.$refs["form"].clearValidate()
this.form.id = null
});

View File

@@ -253,8 +253,8 @@ export default {
delFlag: '',
novel: '',
canListen: false,
clockIn: 0,
teachIn: '0',
clockIn: 2,
teachIn: 0,
},
splitsTypeList:[],
dataRule: {