feat:修改富文本框

This commit is contained in:
zty 2025-04-18 15:06:40 +08:00
parent 710d6b02c4
commit d8f2b391c5
2 changed files with 28 additions and 22 deletions

View File

@ -70,7 +70,7 @@
</el-upload>
</el-form-item>
<el-form-item label="备注" prop="art_remark" v-show="is_show">
<tinymce v-model="userinfo.art_remark" :height="400" width="90%"/>
<tinymce v-if="showEditor" v-model="userinfo.art_remark" :height="400" width="90%"/>
</el-form-item>
</el-form>
@ -132,6 +132,7 @@ export default {
dialogVisible: false,
dialogType: 'new',
dialogType2: 'new',
showEditor: true,
dialogVisible2: false,
childCompy: {},
userinfo: {},
@ -180,13 +181,17 @@ export default {
})
},
handleEdit(scope) {
this.userinfo = Object.assign({}, scope.row) // copy obj
this.dialogType = 'edit'
this.dialogVisible = true
this.showEditor = false
this.$nextTick(() => {
this.$refs['commonForm'].clearValidate()
this.userinfo = JSON.parse(JSON.stringify(scope.row))
this.showEditor = true
this.dialogVisible = true
this.$nextTick(() => {
this.$refs.commonForm && this.$refs.commonForm.clearValidate()
})
},
})
},
handleDelete(scope) {
this.$confirm('确认删数据吗?将丢失数据!', '警告', {
confirmButtonText: '确认',

View File

@ -84,9 +84,12 @@
<el-button size="small" type="primary" v-else>点击上传</el-button>
</el-upload>
</el-form-item>
<el-form-item label="备注" prop="remark" v-show="is_show">
<tinymce v-model="companydata.remark" :height="400" width="90%"/>
<el-form-item label="备注" prop="remark">
<tinymce
v-if="showEditor"
v-model="companydata.remark"
:height="400"
width="90%"/>
</el-form-item>
</el-form>
<div style="text-align:right;">
@ -215,13 +218,6 @@ export default {
data() {
return {
upUrl: upUrl(),
banner: {
id: "",
name: "",
url:"",
sort:0,
path:""
},
upHeaders: { Authorization: "JWT " + getToken() },
listQuery: Object.assign({}, listQuery),
listQuery2: Object.assign({}, listQuery2),
@ -232,11 +228,11 @@ export default {
dialogVisible: false,
dialogType: 'new',
dialogType2: 'new',
showEditor: true,
dialogVisible2: false,
childCompy: {},
companydata: {},
companyOption: [],
}
},
computed: {},
@ -288,13 +284,18 @@ export default {
})
},
handleEdit(scope) {
this.companydata = Object.assign({}, scope.row) // copy obj
this.dialogType = 'edit'
this.dialogVisible = true
this.showEditor = false
this.$nextTick(() => {
this.$refs['commonForm'].clearValidate()
this.companydata = JSON.parse(JSON.stringify(scope.row))
this.showEditor = true
this.dialogVisible = true
this.$nextTick(() => {
this.$refs.commonForm && this.$refs.commonForm.clearValidate()
})
},
})
},
handleDelete(scope) {
this.$confirm('确认删数据吗?将丢失数据!', '警告', {
confirmButtonText: '确认',