Commit 9ebff2787e3ef824716c61dbdca49ea231caf4c5

Authored by xingyu
1 parent 6f1ff729

perf: post

yudao-ui-admin-vue3/src/views/system/post/PostModal.vue renamed to yudao-ui-admin-vue3/src/views/system/post/PostForm.vue
1 1 <template>
2 2 <!-- 弹窗 -->
3   - <XModal id="postModel" :loading="modelLoading" v-model="modelVisible" :title="modelTitle">
  3 + <XModal id="PostForm" :loading="modelLoading" v-model="modelVisible" :title="modelTitle">
4 4 <!-- 表单:添加/修改 -->
5 5 <Form
6 6 ref="formRef"
... ... @@ -35,7 +35,7 @@ import { rules, allSchemas } from &#39;./post.data&#39;
35 35 const { t } = useI18n() // 国际化
36 36 const message = useMessage() // 消息弹窗
37 37  
38   -const emit = defineEmits(['success', 'openModal'])
  38 +const emit = defineEmits(['success'])
39 39  
40 40 // 弹窗相关的变量
41 41 const modelVisible = ref(false) // 是否显示弹出层
... ... @@ -81,9 +81,9 @@ const submitForm = async () =&gt; {
81 81 message.success(t('common.updateSuccess'))
82 82 }
83 83 modelVisible.value = false
  84 + emit('success')
84 85 } finally {
85 86 actionLoading.value = false
86   - emit('success')
87 87 }
88 88 }
89 89 })
... ...
yudao-ui-admin-vue3/src/views/system/post/index.vue
... ... @@ -42,13 +42,13 @@
42 42 </template>
43 43 </XTable>
44 44 </ContentWrap>
45   - <PostModal ref="modalRef" @success="success" />
  45 + <PostForm ref="modalRef" @success="reload()" />
46 46 </template>
47 47 <script setup lang="ts" name="Post">
48 48 // 业务相关的 import
49 49 import * as PostApi from '@/api/system/post'
50 50 import { allSchemas } from './post.data'
51   -import PostModal from './PostModal.vue'
  51 +import PostForm from './PostForm.vue'
52 52  
53 53 const { t } = useI18n() // 国际化
54 54 const modalRef = ref()
... ... @@ -63,8 +63,4 @@ const [registerTable, { reload, deleteData, exportList }] = useXTable({
63 63 const openModal = (type: string, rowId?: number) => {
64 64 modalRef.value.openModal(type, rowId)
65 65 }
66   -
67   -const success = () => {
68   - reload()
69   -}
70 66 </script>
... ...