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 <template> 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 <Form 5 <Form
6 ref="formRef" 6 ref="formRef"
@@ -35,7 +35,7 @@ import { rules, allSchemas } from &#39;./post.data&#39; @@ -35,7 +35,7 @@ import { rules, allSchemas } from &#39;./post.data&#39;
35 const { t } = useI18n() // 国际化 35 const { t } = useI18n() // 国际化
36 const message = useMessage() // 消息弹窗 36 const message = useMessage() // 消息弹窗
37 37
38 -const emit = defineEmits(['success', 'openModal']) 38 +const emit = defineEmits(['success'])
39 39
40 // 弹窗相关的变量 40 // 弹窗相关的变量
41 const modelVisible = ref(false) // 是否显示弹出层 41 const modelVisible = ref(false) // 是否显示弹出层
@@ -81,9 +81,9 @@ const submitForm = async () =&gt; { @@ -81,9 +81,9 @@ const submitForm = async () =&gt; {
81 message.success(t('common.updateSuccess')) 81 message.success(t('common.updateSuccess'))
82 } 82 }
83 modelVisible.value = false 83 modelVisible.value = false
  84 + emit('success')
84 } finally { 85 } finally {
85 actionLoading.value = false 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,13 +42,13 @@
42 </template> 42 </template>
43 </XTable> 43 </XTable>
44 </ContentWrap> 44 </ContentWrap>
45 - <PostModal ref="modalRef" @success="success" /> 45 + <PostForm ref="modalRef" @success="reload()" />
46 </template> 46 </template>
47 <script setup lang="ts" name="Post"> 47 <script setup lang="ts" name="Post">
48 // 业务相关的 import 48 // 业务相关的 import
49 import * as PostApi from '@/api/system/post' 49 import * as PostApi from '@/api/system/post'
50 import { allSchemas } from './post.data' 50 import { allSchemas } from './post.data'
51 -import PostModal from './PostModal.vue' 51 +import PostForm from './PostForm.vue'
52 52
53 const { t } = useI18n() // 国际化 53 const { t } = useI18n() // 国际化
54 const modalRef = ref() 54 const modalRef = ref()
@@ -63,8 +63,4 @@ const [registerTable, { reload, deleteData, exportList }] = useXTable({ @@ -63,8 +63,4 @@ const [registerTable, { reload, deleteData, exportList }] = useXTable({
63 const openModal = (type: string, rowId?: number) => { 63 const openModal = (type: string, rowId?: number) => {
64 modalRef.value.openModal(type, rowId) 64 modalRef.value.openModal(type, rowId)
65 } 65 }
66 -  
67 -const success = () => {  
68 - reload()  
69 -}  
70 </script> 66 </script>