mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-26 17:21:53 +08:00
perf: post
This commit is contained in:
parent
6f1ff72927
commit
9ebff2787e
@ -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')
|
||||
}
|
||||
}
|
||||
})
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user