| @@ -105,7 +105,8 @@ | |||||
| <p style="margin-left: 5px;">公开内容</p> | <p style="margin-left: 5px;">公开内容</p> | ||||
| </template> | </template> | ||||
| </van-field> | </van-field> | ||||
| <vue-html5-editor :content="content" :height="400" @change="updateData" style="margin-top: 10px;"></vue-html5-editor> | |||||
| <vue-html5-editor :content="form.openContent" :height="400" @change="updateData" style="margin-top: 10px;"></vue-html5-editor> | |||||
| <van-field v-model="form.remark" placeholder="请输入备注" input-align="right" :border="false" > | <van-field v-model="form.remark" placeholder="请输入备注" input-align="right" :border="false" > | ||||
| <template #label> | <template #label> | ||||
| @@ -139,7 +140,8 @@ | |||||
| openAt:this.format(new Date(),'yyyy-MM-dd'), | openAt:this.format(new Date(),'yyyy-MM-dd'), | ||||
| openPic:'', | openPic:'', | ||||
| openFile:'', | openFile:'', | ||||
| otherName:'' | |||||
| otherName:'', | |||||
| openContent:'' | |||||
| }, | }, | ||||
| openPic:[], | openPic:[], | ||||
| otherGkTypeOptions:[], | otherGkTypeOptions:[], | ||||
| @@ -170,8 +172,10 @@ | |||||
| }, | }, | ||||
| methods: { | methods: { | ||||
| updateData(e = ''){ | updateData(e = ''){ | ||||
| this.content = e; | |||||
| console.info(e); | |||||
| let c1 = e.replace(/<img width="100%"/g, '<img'); | |||||
| let c2 = c1.replace(/<img/g, '<img width="100%"'); | |||||
| this.form.openContent = c2; | |||||
| console.log() | |||||
| }, | }, | ||||
| onSubmit(){ | onSubmit(){ | ||||
| var that = this; | var that = this; | ||||
| @@ -201,6 +205,7 @@ | |||||
| this.openFile2.splice(index,1); | this.openFile2.splice(index,1); | ||||
| }, | }, | ||||
| afterRead(file) { | afterRead(file) { | ||||
| console.log(file) | |||||
| // 此时可以自行将文件上传至服务器 | // 此时可以自行将文件上传至服务器 | ||||
| file.map(res=>{ | file.map(res=>{ | ||||
| this.openPic.push(res.file); | this.openPic.push(res.file); | ||||
| @@ -96,6 +96,16 @@ | |||||
| <!-- <img src="../../assets/images/sunVillage_info/addFile.png" width="120" />--> | <!-- <img src="../../assets/images/sunVillage_info/addFile.png" width="120" />--> | ||||
| <!-- </van-uploader>--> | <!-- </van-uploader>--> | ||||
| </div> | </div> | ||||
| <van-field readonly input-align="right" :border="false" > | |||||
| <template #label> | |||||
| <img src="../../assets/images/sunVillage_info/add_tit_icon_05.png" width="18"> | |||||
| <p style="margin-left: 5px;">公开内容</p> | |||||
| </template> | |||||
| </van-field> | |||||
| <div id="openContent"></div> | |||||
| <van-field readonly v-model="form.remark" placeholder="备注" input-align="right" :border="false" > | <van-field readonly v-model="form.remark" placeholder="备注" input-align="right" :border="false" > | ||||
| <template #label> | <template #label> | ||||
| <img src="../../assets/images/sunVillage_info/add_tit_icon_05.png" width="18"> | <img src="../../assets/images/sunVillage_info/add_tit_icon_05.png" width="18"> | ||||
| @@ -189,6 +199,7 @@ | |||||
| this.openPic[i] = {url:'/api'+rrr} | this.openPic[i] = {url:'/api'+rrr} | ||||
| }) | }) | ||||
| } | } | ||||
| document.getElementById('openContent').innerHTML = res.data.openContent | |||||
| that.form = res.data; | that.form = res.data; | ||||
| }) | }) | ||||
| }, | }, | ||||
| @@ -99,6 +99,16 @@ | |||||
| <img src="../../assets/images/sunVillage_info/addFile.png" width="120" /> | <img src="../../assets/images/sunVillage_info/addFile.png" width="120" /> | ||||
| </van-uploader> | </van-uploader> | ||||
| </div> | </div> | ||||
| <van-field readonly input-align="right" :border="false" > | |||||
| <template #label> | |||||
| <img src="../../assets/images/sunVillage_info/add_tit_icon_05.png" width="18"> | |||||
| <p style="margin-left: 5px;">公开内容</p> | |||||
| </template> | |||||
| </van-field> | |||||
| <vue-html5-editor :content="form.openContent" :height="400" @change="updateData" style="margin-top: 10px;"></vue-html5-editor> | |||||
| <van-field v-model="form.remark" placeholder="请输入备注" input-align="right" :border="false" > | <van-field v-model="form.remark" placeholder="请输入备注" input-align="right" :border="false" > | ||||
| <template #label> | <template #label> | ||||
| <img src="../../assets/images/sunVillage_info/add_tit_icon_05.png" width="18"> | <img src="../../assets/images/sunVillage_info/add_tit_icon_05.png" width="18"> | ||||
| @@ -158,6 +168,12 @@ | |||||
| this.getDetail(); | this.getDetail(); | ||||
| }, | }, | ||||
| methods: { | methods: { | ||||
| updateData(e = ''){ | |||||
| let c1 = e.replace(/<img width="100%"/g, '<img'); | |||||
| let c2 = c1.replace(/<img/g, '<img width="100%"'); | |||||
| this.form.openContent = c2; | |||||
| console.log() | |||||
| }, | |||||
| getDetail(id){ | getDetail(id){ | ||||
| otherPublicDetail(this.queryParams).then((res) => { | otherPublicDetail(this.queryParams).then((res) => { | ||||
| var that = this ; | var that = this ; | ||||