|
|
@ -84,13 +84,11 @@ |
|
|
<el-form v-if="!replyForm.reply" ref="replyForm" :model="replyForm" :rules="replyRules" size="small"> |
|
|
<el-form v-if="!replyForm.reply" ref="replyForm" :model="replyForm" :rules="replyRules" size="small"> |
|
|
<el-form-item label="回复内容" prop="reply"> |
|
|
<el-form-item label="回复内容" prop="reply"> |
|
|
<el-input |
|
|
<el-input |
|
|
v-model="replyForm.reply" |
|
|
|
|
|
|
|
|
v-model="editReply" |
|
|
type="textarea" |
|
|
type="textarea" |
|
|
rows="5" |
|
|
rows="5" |
|
|
placeholder="请输入回复内容" |
|
|
placeholder="请输入回复内容" |
|
|
style="width: 762px;" |
|
|
style="width: 762px;" |
|
|
:readonly="!!replyForm.reply" |
|
|
|
|
|
:style="{ backgroundColor: replyForm.reply ? '#f5f7fa' : '#fff' }" |
|
|
|
|
|
/> |
|
|
/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
@ -180,6 +178,8 @@ export default { |
|
|
id: null, |
|
|
id: null, |
|
|
reply: '' |
|
|
reply: '' |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 专门用于编辑输入的变量 |
|
|
|
|
|
editReply: '', |
|
|
replyRules: { |
|
|
replyRules: { |
|
|
reply: [{ required: true, message: '请输入回复内容', trigger: 'blur' }] |
|
|
reply: [{ required: true, message: '请输入回复内容', trigger: 'blur' }] |
|
|
}, |
|
|
}, |
|
|
@ -227,20 +227,23 @@ export default { |
|
|
}, |
|
|
}, |
|
|
handleReply(row) { |
|
|
handleReply(row) { |
|
|
this.replyForm = { ...row } |
|
|
this.replyForm = { ...row } |
|
|
|
|
|
this.editReply = '' |
|
|
this.replyVisible = true |
|
|
this.replyVisible = true |
|
|
}, |
|
|
}, |
|
|
onRowDblclick(row) { |
|
|
onRowDblclick(row) { |
|
|
this.replyForm = { ...row } |
|
|
|
|
|
this.replyVisible = true |
|
|
|
|
|
|
|
|
this.handleReply(row) |
|
|
}, |
|
|
}, |
|
|
async submitReply() { |
|
|
async submitReply() { |
|
|
if (this.replyForm.reply) return |
|
|
|
|
|
await this.$refs.replyForm.validate() |
|
|
|
|
|
|
|
|
// 校验输入内容 |
|
|
|
|
|
if (!this.editReply.trim()) { |
|
|
|
|
|
this.$message.warning('请输入回复内容') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
this.replyLoading = true |
|
|
this.replyLoading = true |
|
|
try { |
|
|
try { |
|
|
const params = { |
|
|
const params = { |
|
|
id: this.replyForm.id, |
|
|
id: this.replyForm.id, |
|
|
reply: this.replyForm.reply |
|
|
|
|
|
|
|
|
reply: this.editReply |
|
|
} |
|
|
} |
|
|
await FetchReplyReaderMessage(params) |
|
|
await FetchReplyReaderMessage(params) |
|
|
this.$message.success('回复成功') |
|
|
this.$message.success('回复成功') |
|
|
@ -259,6 +262,7 @@ export default { |
|
|
if (this.$refs.replyForm) { |
|
|
if (this.$refs.replyForm) { |
|
|
this.$refs.replyForm.clearValidate() |
|
|
this.$refs.replyForm.clearValidate() |
|
|
} |
|
|
} |
|
|
|
|
|
this.editReply = '' |
|
|
this.replyVisible = false |
|
|
this.replyVisible = false |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|