perf: post

This commit is contained in:
xingyu 2023-02-02 10:55:24 +08:00
parent 6f1ff72927
commit 9ebff2787e
2 changed files with 5 additions and 9 deletions

View File

@ -1,6 +1,6 @@
<template>
<!-- 弹窗 -->
<XModal id="postModel" :loading="modelLoading" v-model="modelVisible" :title="modelTitle">
<XModal id="PostForm" :loading="modelLoading" v-model="modelVisible" :title="modelTitle">
<!-- 表单添加/修改 -->
<Form
ref="formRef"
@ -35,7 +35,7 @@ import { rules, allSchemas } from './post.data'
const { t } = useI18n() //
const message = useMessage() //
const emit = defineEmits(['success', 'openModal'])
const emit = defineEmits(['success'])
//
const modelVisible = ref(false) //
@ -81,9 +81,9 @@ const submitForm = async () => {
message.success(t('common.updateSuccess'))
}
modelVisible.value = false
emit('success')
} finally {
actionLoading.value = false
emit('success')
}
}
})

View File

@ -42,13 +42,13 @@
</template>
</XTable>
</ContentWrap>
<PostModal ref="modalRef" @success="success" />
<PostForm ref="modalRef" @success="reload()" />
</template>
<script setup lang="ts" name="Post">
// import
import * as PostApi from '@/api/system/post'
import { allSchemas } from './post.data'
import PostModal from './PostModal.vue'
import PostForm from './PostForm.vue'
const { t } = useI18n() //
const modalRef = ref()
@ -63,8 +63,4 @@ const [registerTable, { reload, deleteData, exportList }] = useXTable({
const openModal = (type: string, rowId?: number) => {
modalRef.value.openModal(type, rowId)
}
const success = () => {
reload()
}
</script>