markdown修复

master
yujialong 1 year ago
parent ce8cd2d0a7
commit 288164f0f4
  1. 31
      src/components/quill/index.vue
  2. 21
      src/pages/product/list/index.vue
  3. 11
      src/pages/project/add/index.vue

@ -2,12 +2,12 @@
<div>
<el-radio-group v-if="!readonly"
class="type-radio"
v-model="type"
v-model="editorType"
@change="typeChange">
<el-radio :label="0">富文本</el-radio>
<el-radio :label="1">markdown</el-radio>
<el-radio label="0">富文本</el-radio>
<el-radio label="1">markdown</el-radio>
</el-radio-group>
<div v-show="!type"
<div v-show="editorType == 0"
class="quill"
ref="quill"
:class="classes">
@ -26,10 +26,13 @@
</div>
<mavon-editor class="md"
v-model="mdVal"
v-show="type"
v-show="editorType == 1"
ref="md"
:ishljs="true"
:subfield="false"
:editable="false"
:toolbarsFlag="false"
:boxShadowStyle="none"
@change="mdChange"
@imgAdd="imgAdd" />
</div>
@ -87,6 +90,11 @@ export default {
type: Number,
default: 0
},
//
type: {
type: String,
default: '0'
},
},
data () {
const that = this
@ -94,7 +102,7 @@ export default {
headers: {
token: util.local.get(Setting.tokenKey)
},
type: 0,
editorType: '0',
mdVal: '',
Quill: null,
currentValue: "",
@ -144,17 +152,23 @@ export default {
},
watch: {
type: {
handler (val) {
this.editorType = val
},
immediate: true
},
value: {
handler (val) {
if (!this.type) {
if (this.type == 0) {
if (val !== this.currentValue) {
this.currentValue = val;
if (this.Quill) {
this.Quill.pasteHTML(this.value);
}
}
if (!this.mdVal) this.mdVal = val
}
if (!this.mdVal) this.mdVal = val
},
immediate: true
}
@ -179,6 +193,7 @@ export default {
methods: {
//
typeChange (val) {
this.$emit('update:type', val)
if (!this.mdVal) this.mdVal = this.value
},

@ -47,19 +47,14 @@
</div>
<div class="filter">
<dl v-if="curTab == 1">
<dt>学科类别</dt>
<dt>学科专业</dt>
<div class="vals">
<dd :class="{active: categoryId === ''}"
@click="catetoryClick('')">全部</dd>
<dd :class="{active: categoryId === 1}"
style="margin-right: 20px"
@click="catetoryClick(1)">不限</dd>
<dd v-for="(item, i) in category"
:key="i"
:class="{active: categoryId === item.value}"
@click="categoryClick(item, 1)">{{ item.label }}</dd>
<!-- <div v-for="(item, i) in category"
<div v-for="(item, i) in category"
:key="i"
:class="['category-item', {active: item.disciplineId == categoryId}]">
<span class="name"
@ -70,8 +65,8 @@
:options="item.list"
:props="{ checkStrictly: true }"
placeholder=""
@change="id => categoryChange(id, item, i)"></el-cascader> -->
<!-- </div> -->
@change="id => categoryChange(id, item, i)"></el-cascader>
</div>
</div>
</dl>
<dl v-if="curTab == 3">
@ -430,14 +425,6 @@ export default {
e.val = []
})
},
categoryClick (item, i) {
this.clearCategory()
item.val = val
this[i === 1 ? 'categoryId' : i === 2 ? 'professionalCategoryId' : 'professionalId'] = item.disciplineId
this.professionalCategoryId = val[0] || ''
this.professionalId = val[1] || ''
this.initData()
},
categoryChange (val, item, i) {
const name = this.$refs['category' + i][0].getCheckedNodes()[0].pathLabels
console.log("🚀 ~ file: index.vue:431 ~ categoryChange ~ val, item:", val, item, name)

@ -73,6 +73,7 @@
<quill :border="true"
:readonly="isDetail"
v-model="projectManage.experimentTarget"
:type.sync="projectManage.experimentTargetType"
:minHeight="150"
:height="150" />
</el-form-item>
@ -89,6 +90,7 @@
<quill :border="true"
:readonly="isDetail"
v-model="projectManage.experimentDescription"
:type.sync="projectManage.experimentDescriptionType"
:minHeight="150"
:height="150"
:index="1" />
@ -213,6 +215,7 @@
<quill :border="true"
:readonly="isDetail"
v-model="projectManage.experimentHint"
:type.sync="projectManage.experimentHintType"
:minHeight="150"
:height="150"
:index="3" />
@ -311,7 +314,10 @@ export default {
experimentDescription: "", //
state: 0, // (0稿 1)
isOpen: 0, // (0 1 0)
isDel: 0 // (0 1 0)
isDel: 0, // (0 1 0)
experimentTargetType: '0',
experimentDescriptionType: '0',
experimentHintType: '0',
},
projectJudgmentData: [], //()
selectedProjectJudgment: [], //
@ -426,6 +432,9 @@ export default {
this.mallIds = [mallId]
systemId && this.mallIds.push(systemId)
}
if (!projectManage.experimentDescriptionType) projectManage.experimentDescriptionType = '0'
if (!projectManage.experimentHintType) projectManage.experimentHintType = '0'
if (!projectManage.experimentTargetType) projectManage.experimentTargetType = '0'
this.projectManage = projectManage;
this.originName = projectManage.projectName
this.projectJudgmentData = projectJudgmentVos;

Loading…
Cancel
Save