mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 02:08:43 +08:00 
			
		
		
		
	refactor: use Dialog
This commit is contained in:
		| @@ -113,8 +113,7 @@ | |||||||
|         </Table> |         </Table> | ||||||
|       </div> |       </div> | ||||||
|     </el-card> |     </el-card> | ||||||
|     <XModal id="dictModel" v-model="dialogVisible" :title="dialogTitle"> |     <Dialog id="dictModel" v-model="dialogVisible" :title="dialogTitle"> | ||||||
|       <template #default> |  | ||||||
|       <Form |       <Form | ||||||
|         v-if="['typeCreate', 'typeUpdate'].includes(actionType)" |         v-if="['typeCreate', 'typeUpdate'].includes(actionType)" | ||||||
|         :schema="DictTypeSchemas.allSchemas.formSchema" |         :schema="DictTypeSchemas.allSchemas.formSchema" | ||||||
| @@ -127,7 +126,6 @@ | |||||||
|         :rules="DictDataSchemas.dictDataRules" |         :rules="DictDataSchemas.dictDataRules" | ||||||
|         ref="dataFormRef" |         ref="dataFormRef" | ||||||
|       /> |       /> | ||||||
|       </template> |  | ||||||
|       <!-- 操作按钮 --> |       <!-- 操作按钮 --> | ||||||
|       <template #footer> |       <template #footer> | ||||||
|         <XButton |         <XButton | ||||||
| @@ -146,7 +144,7 @@ | |||||||
|         /> |         /> | ||||||
|         <XButton :title="t('dialog.close')" @click="dialogVisible = false" /> |         <XButton :title="t('dialog.close')" @click="dialogVisible = false" /> | ||||||
|       </template> |       </template> | ||||||
|     </XModal> |     </Dialog> | ||||||
|   </div> |   </div> | ||||||
| </template> | </template> | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
|   | |||||||
| @@ -38,8 +38,7 @@ | |||||||
|     </vxe-grid> |     </vxe-grid> | ||||||
|   </ContentWrap> |   </ContentWrap> | ||||||
|   <!-- 弹窗 --> |   <!-- 弹窗 --> | ||||||
|   <XModal id="errorCodeModel" v-model="dialogVisible" :title="dialogTitle"> |   <Dialog id="errorCodeModel" v-model="dialogVisible" :title="dialogTitle"> | ||||||
|     <template #default> |  | ||||||
|     <!-- 对话框(添加 / 修改) --> |     <!-- 对话框(添加 / 修改) --> | ||||||
|     <Form |     <Form | ||||||
|       v-if="['create', 'update'].includes(actionType)" |       v-if="['create', 'update'].includes(actionType)" | ||||||
| @@ -53,7 +52,6 @@ | |||||||
|       :schema="allSchemas.detailSchema" |       :schema="allSchemas.detailSchema" | ||||||
|       :data="detailRef" |       :data="detailRef" | ||||||
|     /> |     /> | ||||||
|     </template> |  | ||||||
|     <template #footer> |     <template #footer> | ||||||
|       <!-- 按钮:保存 --> |       <!-- 按钮:保存 --> | ||||||
|       <XButton |       <XButton | ||||||
| @@ -66,7 +64,7 @@ | |||||||
|       <!-- 按钮:关闭 --> |       <!-- 按钮:关闭 --> | ||||||
|       <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" /> |       <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" /> | ||||||
|     </template> |     </template> | ||||||
|   </XModal> |   </Dialog> | ||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
|   | |||||||
| @@ -17,21 +17,20 @@ | |||||||
|     </vxe-grid> |     </vxe-grid> | ||||||
|   </ContentWrap> |   </ContentWrap> | ||||||
|   <!-- 弹窗 --> |   <!-- 弹窗 --> | ||||||
|   <XModal id="postModel" v-model="dialogVisible" :title="dialogTitle"> |   <Dialog id="postModel" v-model="dialogVisible" :title="dialogTitle"> | ||||||
|     <template #default> |  | ||||||
|     <!-- 表单:详情 --> |     <!-- 表单:详情 --> | ||||||
|     <Descriptions :schema="allSchemas.detailSchema" :data="detailRef" /> |     <Descriptions :schema="allSchemas.detailSchema" :data="detailRef" /> | ||||||
|     </template> |  | ||||||
|     <template #footer> |     <template #footer> | ||||||
|       <!-- 按钮:关闭 --> |       <!-- 按钮:关闭 --> | ||||||
|       <XButton :title="t('dialog.close')" @click="dialogVisible = false" /> |       <XButton :title="t('dialog.close')" @click="dialogVisible = false" /> | ||||||
|     </template> |     </template> | ||||||
|   </XModal> |   </Dialog> | ||||||
| </template> | </template> | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| // 全局相关的 import | // 全局相关的 import | ||||||
| import { ref } from 'vue' | import { ref } from 'vue' | ||||||
| import { useI18n } from '@/hooks/web/useI18n' | import { useI18n } from '@/hooks/web/useI18n' | ||||||
|  | import { useMessage } from '@/hooks/web/useMessage' | ||||||
| import { useVxeGrid } from '@/hooks/web/useVxeGrid' | import { useVxeGrid } from '@/hooks/web/useVxeGrid' | ||||||
| import { VxeGridInstance } from 'vxe-table' | import { VxeGridInstance } from 'vxe-table' | ||||||
| // 业务相关的 import | // 业务相关的 import | ||||||
| @@ -40,6 +39,7 @@ import { getLoginLogPageApi, exportLoginLogApi, LoginLogVO } from '@/api/system/ | |||||||
| import download from '@/utils/download' | import download from '@/utils/download' | ||||||
|  |  | ||||||
| const { t } = useI18n() // 国际化 | const { t } = useI18n() // 国际化 | ||||||
|  | const message = useMessage() // 消息弹窗 | ||||||
| // 列表相关的变量 | // 列表相关的变量 | ||||||
| const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref | const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref | ||||||
| const { gridOptions } = useVxeGrid<LoginLogVO>({ | const { gridOptions } = useVxeGrid<LoginLogVO>({ | ||||||
| @@ -59,13 +59,14 @@ const handleDetail = async (row: LoginLogVO) => { | |||||||
| } | } | ||||||
|  |  | ||||||
| // 导出操作 | // 导出操作 | ||||||
| // TODO @星语:导出需要有二次确认哈 |  | ||||||
| const handleExport = async () => { | const handleExport = async () => { | ||||||
|  |   message.exportConfirm().then(async () => { | ||||||
|     const queryParams = Object.assign( |     const queryParams = Object.assign( | ||||||
|       {}, |       {}, | ||||||
|       JSON.parse(JSON.stringify(xGrid.value?.getRefMaps().refForm.value.data)) // TODO @星语:这个有没办法,封装个 util 获取哈? |       JSON.parse(JSON.stringify(xGrid.value?.getRefMaps().refForm.value.data)) // TODO @星语:这个有没办法,封装个 util 获取哈? | ||||||
|     ) |     ) | ||||||
|     const res = await exportLoginLogApi(queryParams) |     const res = await exportLoginLogApi(queryParams) | ||||||
|     download.excel(res, '登录列表.xls') |     download.excel(res, '登录列表.xls') | ||||||
|  |   }) | ||||||
| } | } | ||||||
| </script> | </script> | ||||||
|   | |||||||
| @@ -97,8 +97,7 @@ | |||||||
|     </vxe-table> |     </vxe-table> | ||||||
|   </ContentWrap> |   </ContentWrap> | ||||||
|   <!-- 添加或修改菜单对话框 --> |   <!-- 添加或修改菜单对话框 --> | ||||||
|   <XModal v-model="dialogVisible" id="menuModel" :title="dialogTitle"> |   <Dialog v-model="dialogVisible" id="menuModel" :title="dialogTitle"> | ||||||
|     <template #default> |  | ||||||
|     <!-- 对话框(添加 / 修改) --> |     <!-- 对话框(添加 / 修改) --> | ||||||
|     <el-form |     <el-form | ||||||
|       ref="formRef" |       ref="formRef" | ||||||
| @@ -179,12 +178,7 @@ | |||||||
|         </template> |         </template> | ||||||
|         <el-col :span="12"> |         <el-col :span="12"> | ||||||
|           <el-form-item label="显示排序" prop="sort"> |           <el-form-item label="显示排序" prop="sort"> | ||||||
|               <el-input-number |             <el-input-number v-model="menuForm.sort" controls-position="right" :min="0" clearable /> | ||||||
|                 v-model="menuForm.sort" |  | ||||||
|                 controls-position="right" |  | ||||||
|                 :min="0" |  | ||||||
|                 clearable |  | ||||||
|               /> |  | ||||||
|           </el-form-item> |           </el-form-item> | ||||||
|         </el-col> |         </el-col> | ||||||
|         <el-col :span="12"> |         <el-col :span="12"> | ||||||
| @@ -234,7 +228,6 @@ | |||||||
|         </template> |         </template> | ||||||
|       </el-row> |       </el-row> | ||||||
|     </el-form> |     </el-form> | ||||||
|     </template> |  | ||||||
|     <template #footer> |     <template #footer> | ||||||
|       <!-- 按钮:保存 --> |       <!-- 按钮:保存 --> | ||||||
|       <XButton |       <XButton | ||||||
| @@ -247,7 +240,7 @@ | |||||||
|       <!-- 按钮:关闭 --> |       <!-- 按钮:关闭 --> | ||||||
|       <XButton :loading="actionLoading" @click="dialogVisible = false" :title="t('dialog.close')" /> |       <XButton :loading="actionLoading" @click="dialogVisible = false" :title="t('dialog.close')" /> | ||||||
|     </template> |     </template> | ||||||
|   </XModal> |   </Dialog> | ||||||
| </template> | </template> | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| // 全局相关的 import | // 全局相关的 import | ||||||
|   | |||||||
| @@ -38,8 +38,7 @@ | |||||||
|     </vxe-grid> |     </vxe-grid> | ||||||
|   </ContentWrap> |   </ContentWrap> | ||||||
|   <!-- 弹窗 --> |   <!-- 弹窗 --> | ||||||
|   <XModal id="noticeModel" v-model="dialogVisible" :title="dialogTitle"> |   <Dialog id="noticeModel" v-model="dialogVisible" :title="dialogTitle"> | ||||||
|     <template #default> |  | ||||||
|     <!-- 对话框(添加 / 修改) --> |     <!-- 对话框(添加 / 修改) --> | ||||||
|     <Form |     <Form | ||||||
|       ref="formRef" |       ref="formRef" | ||||||
| @@ -53,7 +52,6 @@ | |||||||
|       :schema="allSchemas.detailSchema" |       :schema="allSchemas.detailSchema" | ||||||
|       :data="detailRef" |       :data="detailRef" | ||||||
|     /> |     /> | ||||||
|     </template> |  | ||||||
|     <template #footer> |     <template #footer> | ||||||
|       <!-- 按钮:保存 --> |       <!-- 按钮:保存 --> | ||||||
|       <XButton |       <XButton | ||||||
| @@ -66,7 +64,7 @@ | |||||||
|       <!-- 按钮:关闭 --> |       <!-- 按钮:关闭 --> | ||||||
|       <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" /> |       <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" /> | ||||||
|     </template> |     </template> | ||||||
|   </XModal> |   </Dialog> | ||||||
| </template> | </template> | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| // 全局相关的 import | // 全局相关的 import | ||||||
|   | |||||||
| @@ -48,8 +48,7 @@ | |||||||
|     </vxe-grid> |     </vxe-grid> | ||||||
|   </ContentWrap> |   </ContentWrap> | ||||||
|   <!-- 弹窗 --> |   <!-- 弹窗 --> | ||||||
|   <XModal id="postModel" v-model="dialogVisible" :title="dialogTitle"> |   <Dialog id="postModel" v-model="dialogVisible" :title="dialogTitle"> | ||||||
|     <template #default> |  | ||||||
|     <!-- 表单:添加/修改 --> |     <!-- 表单:添加/修改 --> | ||||||
|     <Form |     <Form | ||||||
|       ref="formRef" |       ref="formRef" | ||||||
| @@ -64,7 +63,6 @@ | |||||||
|       :schema="allSchemas.detailSchema" |       :schema="allSchemas.detailSchema" | ||||||
|       :data="detailRef" |       :data="detailRef" | ||||||
|     /> |     /> | ||||||
|     </template> |  | ||||||
|     <template #footer> |     <template #footer> | ||||||
|       <!-- 按钮:保存 --> |       <!-- 按钮:保存 --> | ||||||
|       <XButton |       <XButton | ||||||
| @@ -77,7 +75,7 @@ | |||||||
|       <!-- 按钮:关闭 --> |       <!-- 按钮:关闭 --> | ||||||
|       <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" /> |       <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" /> | ||||||
|     </template> |     </template> | ||||||
|   </XModal> |   </Dialog> | ||||||
| </template> | </template> | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| // 全局相关的 import | // 全局相关的 import | ||||||
|   | |||||||
| @@ -25,8 +25,7 @@ | |||||||
|     </vxe-grid> |     </vxe-grid> | ||||||
|   </ContentWrap> |   </ContentWrap> | ||||||
|   <!-- 弹窗 --> |   <!-- 弹窗 --> | ||||||
|   <XModal id="postModel" v-model="dialogVisible" :title="dialogTitle"> |   <Dialog id="postModel" v-model="dialogVisible" :title="dialogTitle"> | ||||||
|     <template #default> |  | ||||||
|     <!-- 对话框(详情) --> |     <!-- 对话框(详情) --> | ||||||
|     <Descriptions :schema="allSchemas.detailSchema" :data="detailRef"> |     <Descriptions :schema="allSchemas.detailSchema" :data="detailRef"> | ||||||
|       <template #resultCode="{ row }"> |       <template #resultCode="{ row }"> | ||||||
| @@ -36,12 +35,11 @@ | |||||||
|         <span>{{ row.duration + 'ms' }}</span> |         <span>{{ row.duration + 'ms' }}</span> | ||||||
|       </template> |       </template> | ||||||
|     </Descriptions> |     </Descriptions> | ||||||
|     </template> |  | ||||||
|     <template #footer> |     <template #footer> | ||||||
|       <!-- 按钮:关闭 --> |       <!-- 按钮:关闭 --> | ||||||
|       <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" /> |       <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" /> | ||||||
|     </template> |     </template> | ||||||
|   </XModal> |   </Dialog> | ||||||
| </template> | </template> | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| // 全局相关的 import | // 全局相关的 import | ||||||
|   | |||||||
| @@ -45,8 +45,7 @@ | |||||||
|     </vxe-grid> |     </vxe-grid> | ||||||
|   </ContentWrap> |   </ContentWrap> | ||||||
|   <!-- 弹窗 --> |   <!-- 弹窗 --> | ||||||
|   <XModal id="postModel" v-model="dialogVisible" :title="dialogTitle"> |   <Dialog id="postModel" v-model="dialogVisible" :title="dialogTitle"> | ||||||
|     <template #default> |  | ||||||
|     <!-- 表单:添加/修改 --> |     <!-- 表单:添加/修改 --> | ||||||
|     <Form |     <Form | ||||||
|       ref="formRef" |       ref="formRef" | ||||||
| @@ -60,7 +59,6 @@ | |||||||
|       :schema="allSchemas.detailSchema" |       :schema="allSchemas.detailSchema" | ||||||
|       :data="detailRef" |       :data="detailRef" | ||||||
|     /> |     /> | ||||||
|     </template> |  | ||||||
|     <template #footer> |     <template #footer> | ||||||
|       <!-- 按钮:保存 --> |       <!-- 按钮:保存 --> | ||||||
|       <XButton |       <XButton | ||||||
| @@ -73,7 +71,7 @@ | |||||||
|       <!-- 按钮:关闭 --> |       <!-- 按钮:关闭 --> | ||||||
|       <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" /> |       <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" /> | ||||||
|     </template> |     </template> | ||||||
|   </XModal> |   </Dialog> | ||||||
| </template> | </template> | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| // 全局相关的 import | // 全局相关的 import | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 xingyu4j
					xingyu4j