Browse Source

修改富文本组件数据报错问题

master
邓宏 1 month ago
parent
commit
6fc06507b0
  1. 4
      src/components/wangeditor.vue
  2. 14
      src/view/center/company/info.vue

4
src/components/wangeditor.vue

@ -43,7 +43,7 @@ import {Editor, Toolbar} from '@wangeditor/editor-for-vue'
var {getters}=inject("store")
var editorRef=shallowRef()
window.e=editorRef
var toolbarKeys=[
'headerSelect','|',
{
@ -107,7 +107,7 @@ import {Editor, Toolbar} from '@wangeditor/editor-for-vue'
}
watch(()=>[props.modelValue,editorRef.value], n=>{
if(n[1]){
if(n[0] && n[1]){
n[1].setHtml(n[0])
}
},{immediate:true})

14
src/view/center/company/info.vue

@ -139,14 +139,6 @@
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item label="经营类型">
<el-checkbox-group v-model="formData.businessType">
<el-checkbox label="0">种植</el-checkbox>
<el-checkbox label="1">养殖</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col> -->
<el-col :span="12">
<el-form-item label="企业法人" prop="legalPerson">
<el-input placeholder="请输入" v-model="formData.legalPerson" :maxlength="4" show-word-limit/>
@ -259,9 +251,9 @@ import {district} from '@/config/utils'
if(await dispatch('data/getCompany')){
formData.value={
...getters['data/companyInfo'],
pic: getters['data/companyInfo']?.pic?.split(',').filter(v=>v)||[],
region: getters['data/companyInfo']?.region.replace(/\d+,\d+,(\d+)/,'$1'),
businessType:getters['data/companyInfo']?.businessType?.split(',').filter(v=>v)||[],
pic: getters['data/companyInfo']?.pic?.split(',').filter?.(v=>v)||[],
region: getters['data/companyInfo']?.region?.replace?.(/\d+,\d+,(\d+)/,'$1'),
businessType:getters['data/companyInfo']?.businessType?.split?.(',')?.filter?.(v=>v)||[],
}
}else{
msg.error('获取企业详情失败!')

Loading…
Cancel
Save