提交 4173243b authored 作者: matian's avatar matian

updates

上级 6fb8d8d8
......@@ -128,10 +128,10 @@ const handleCancel = () => {
}
// 确认
const handleConfirm = async (formEl: FormInstance | undefined) => {
loading.value = true
if (!formEl) return
await formEl.validate(valid => {
if (valid) {
loading.value = true
form.files = JSON.stringify(form.files)
const params: any = Object.assign({}, form)
createPosts(params).then(() => {
......
......@@ -18,7 +18,7 @@ interface Emits {
(e: 'update:isShowReplyDialog', isShowReplyDialog: boolean): void
(e: 'create'): void
}
const loading = ref(false)
const form: any = reactive({
content: '',
files: []
......@@ -65,9 +65,13 @@ const handleConfirm = async (formEl: FormInstance | undefined) => {
if (!formEl) return
await formEl.validate(valid => {
if (valid) {
loading.value = true
form.files = JSON.stringify(form.files)
const params: any = Object.assign({ discussion_id: props.discussionId, reply_type: '1', reply_id: '' }, form)
replyPosts(params).then(() => {
loading.value = false
emit('update:isShowReplyDialog', false)
emit('create')
})
......@@ -109,7 +113,7 @@ const handleConfirm = async (formEl: FormInstance | undefined) => {
<template #footer>
<span>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleConfirm(ruleFormRef)">确认</el-button>
<el-button type="primary" @click="handleConfirm(ruleFormRef)" :loading="loading">确认</el-button>
</span>
</template>
</el-dialog>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论