Commit 09bc9796 authored by 罗林杰's avatar 罗林杰

修改bug

parent b7e91831
......@@ -584,6 +584,13 @@ export default {
},
// 保存方法
submit() {
let details = this.form.details
// 将 HTML 换行转换为纯文本换行
details = details.replace(/<br\s*\/?>/gi, '\n') // 替换 <br> 标签为 \n
details = details.replace(/<\/p>/gi, '\n') // 替换 </p> 标签为 \n
details = details.replace(/<p[^>]*>/gi, '') // 移除 <p> 标签
// 更新表单数据
this.form.details = details
this.$refs.deviceFormRef.validate(valid => {
if (valid) {
if (this.form.businessId !== null) {
......
......@@ -421,7 +421,13 @@ export default {
// 拷贝form
const form = JSON.parse(JSON.stringify(this.form))
// 转换时间格式
let details = this.form.details
// 将 HTML 换行转换为纯文本换行
details = details.replace(/<br\s*\/?>/gi, '\n') // 替换 <br> 标签为 \n
details = details.replace(/<\/p>/gi, '\n') // 替换 </p> 标签为 \n
details = details.replace(/<p[^>]*>/gi, '') // 移除 <p> 标签
// 更新表单数据
this.form.details = details
this.$refs.deviceFormRef.validate(valid => {
if (valid) {
if (this.form.businessId !== null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment