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>
|
<template>
|
||||||
<!-- 弹窗 -->
|
<!-- 弹窗 -->
|
||||||
<XModal id="postModel" :loading="modelLoading" v-model="modelVisible" :title="modelTitle">
|
<XModal id="PostForm" :loading="modelLoading" v-model="modelVisible" :title="modelTitle">
|
||||||
<!-- 表单:添加/修改 -->
|
<!-- 表单:添加/修改 -->
|
||||||
<Form
|
<Form
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
@ -35,7 +35,7 @@ import { rules, allSchemas } from './post.data'
|
|||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
const emit = defineEmits(['success', 'openModal'])
|
const emit = defineEmits(['success'])
|
||||||
|
|
||||||
// 弹窗相关的变量
|
// 弹窗相关的变量
|
||||||
const modelVisible = ref(false) // 是否显示弹出层
|
const modelVisible = ref(false) // 是否显示弹出层
|
||||||
@ -81,9 +81,9 @@ const submitForm = async () => {
|
|||||||
message.success(t('common.updateSuccess'))
|
message.success(t('common.updateSuccess'))
|
||||||
}
|
}
|
||||||
modelVisible.value = false
|
modelVisible.value = false
|
||||||
|
emit('success')
|
||||||
} finally {
|
} finally {
|
||||||
actionLoading.value = false
|
actionLoading.value = false
|
||||||
emit('success')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
@ -42,13 +42,13 @@
|
|||||||
</template>
|
</template>
|
||||||
</XTable>
|
</XTable>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
<PostModal ref="modalRef" @success="success" />
|
<PostForm ref="modalRef" @success="reload()" />
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts" name="Post">
|
<script setup lang="ts" name="Post">
|
||||||
// 业务相关的 import
|
// 业务相关的 import
|
||||||
import * as PostApi from '@/api/system/post'
|
import * as PostApi from '@/api/system/post'
|
||||||
import { allSchemas } from './post.data'
|
import { allSchemas } from './post.data'
|
||||||
import PostModal from './PostModal.vue'
|
import PostForm from './PostForm.vue'
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const modalRef = ref()
|
const modalRef = ref()
|
||||||
@ -63,8 +63,4 @@ const [registerTable, { reload, deleteData, exportList }] = useXTable({
|
|||||||
const openModal = (type: string, rowId?: number) => {
|
const openModal = (type: string, rowId?: number) => {
|
||||||
modalRef.value.openModal(type, rowId)
|
modalRef.value.openModal(type, rowId)
|
||||||
}
|
}
|
||||||
|
|
||||||
const success = () => {
|
|
||||||
reload()
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user