mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 10:18:42 +08:00 
			
		
		
		
	refactor: reloadList
This commit is contained in:
		| @@ -83,9 +83,10 @@ const { t } = useI18n() // 国际化 | ||||
| const message = useMessage() // 消息弹窗 | ||||
| // 列表相关的变量 | ||||
| const xGrid = ref<VxeGridInstance>() // grid Ref | ||||
| const { gridOptions } = useVxeGrid<ErrorCodeApi.ErrorCodeVO>({ | ||||
| const { gridOptions, reloadList, delList } = useVxeGrid<ErrorCodeApi.ErrorCodeVO>({ | ||||
|   allSchemas: allSchemas, | ||||
|   getListApi: ErrorCodeApi.getErrorCodePageApi | ||||
|   getListApi: ErrorCodeApi.getErrorCodePageApi, | ||||
|   delListApi: ErrorCodeApi.deleteErrorCodeApi | ||||
| }) | ||||
| // 弹窗相关的变量 | ||||
| const dialogVisible = ref(false) // 是否显示弹出层 | ||||
| @@ -125,16 +126,7 @@ const handleDetail = async (rowId: number) => { | ||||
|  | ||||
| // 删除操作 | ||||
| const handleDelete = async (rowId: number) => { | ||||
|   message | ||||
|     .delConfirm() | ||||
|     .then(async () => { | ||||
|       await ErrorCodeApi.deleteErrorCodeApi(rowId) | ||||
|       message.success(t('common.delSuccess')) | ||||
|     }) | ||||
|     .finally(() => { | ||||
|       // 刷新列表 | ||||
|       xGrid.value?.commitProxy('query') | ||||
|     }) | ||||
|   delList(xGrid, rowId) | ||||
| } | ||||
|  | ||||
| // 提交新增/修改的表单 | ||||
| @@ -158,7 +150,7 @@ const submitForm = async () => { | ||||
|       } finally { | ||||
|         actionLoading.value = false | ||||
|         // 刷新列表 | ||||
|         xGrid.value?.commitProxy('query') | ||||
|         reloadList(xGrid) | ||||
|       } | ||||
|     } | ||||
|   }) | ||||
|   | ||||
| @@ -42,7 +42,7 @@ const { t } = useI18n() // 国际化 | ||||
| const message = useMessage() // 消息弹窗 | ||||
| // 列表相关的变量 | ||||
| const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref | ||||
| const { gridOptions } = useVxeGrid<LoginLogVO>({ | ||||
| const { gridOptions, getSearchData } = useVxeGrid<LoginLogVO>({ | ||||
|   allSchemas: allSchemas, | ||||
|   getListApi: getLoginLogPageApi | ||||
| }) | ||||
| @@ -61,10 +61,7 @@ const handleDetail = async (row: LoginLogVO) => { | ||||
| // 导出操作 | ||||
| const handleExport = async () => { | ||||
|   message.exportConfirm().then(async () => { | ||||
|     const queryParams = Object.assign( | ||||
|       {}, | ||||
|       JSON.parse(JSON.stringify(xGrid.value?.getRefMaps().refForm.value.data)) // TODO @星语:这个有没办法,封装个 util 获取哈? | ||||
|     ) | ||||
|     const queryParams = await getSearchData(xGrid) | ||||
|     const res = await exportLoginLogApi(queryParams) | ||||
|     download.excel(res, '登录列表.xls') | ||||
|   }) | ||||
|   | ||||
| @@ -82,9 +82,10 @@ const { t } = useI18n() // 国际化 | ||||
| const message = useMessage() // 消息弹窗 | ||||
| // 列表相关的变量 | ||||
| const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref | ||||
| const { gridOptions } = useVxeGrid<NoticeApi.NoticeVO>({ | ||||
| const { gridOptions, reloadList, delList } = useVxeGrid<NoticeApi.NoticeVO>({ | ||||
|   allSchemas: allSchemas, | ||||
|   getListApi: NoticeApi.getNoticePageApi | ||||
|   getListApi: NoticeApi.getNoticePageApi, | ||||
|   delListApi: NoticeApi.deleteNoticeApi | ||||
| }) | ||||
| // 弹窗相关的变量 | ||||
| const dialogVisible = ref(false) // 是否显示弹出层 | ||||
| @@ -124,16 +125,7 @@ const handleDetail = async (rowId: number) => { | ||||
|  | ||||
| // 删除操作 | ||||
| const handleDelete = async (rowId: number) => { | ||||
|   message | ||||
|     .delConfirm() | ||||
|     .then(async () => { | ||||
|       await NoticeApi.deleteNoticeApi(rowId) | ||||
|       message.success(t('common.delSuccess')) | ||||
|     }) | ||||
|     .finally(() => { | ||||
|       // 刷新列表 | ||||
|       xGrid.value?.commitProxy('query') | ||||
|     }) | ||||
|   delList(xGrid, rowId) | ||||
| } | ||||
|  | ||||
| // 提交新增/修改的表单 | ||||
| @@ -157,7 +149,7 @@ const submitForm = async () => { | ||||
|       } finally { | ||||
|         actionLoading.value = false | ||||
|         // 刷新列表 | ||||
|         xGrid.value?.commitProxy('query') | ||||
|         reloadList(xGrid) | ||||
|       } | ||||
|     } | ||||
|   }) | ||||
|   | ||||
| @@ -94,9 +94,10 @@ const message = useMessage() // 消息弹窗 | ||||
|  | ||||
| // 列表相关的变量 | ||||
| const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref | ||||
| const { gridOptions } = useVxeGrid<ClientApi.OAuth2ClientVO>({ | ||||
| const { gridOptions, reloadList, delList } = useVxeGrid<ClientApi.OAuth2ClientVO>({ | ||||
|   allSchemas: allSchemas, | ||||
|   getListApi: ClientApi.getOAuth2ClientPageApi | ||||
|   getListApi: ClientApi.getOAuth2ClientPageApi, | ||||
|   delListApi: ClientApi.deleteOAuth2ClientApi | ||||
| }) | ||||
| // 弹窗相关的变量 | ||||
| const dialogVisible = ref(false) // 是否显示弹出层 | ||||
| @@ -135,16 +136,7 @@ const handleDetail = async (rowId: number) => { | ||||
|  | ||||
| // 删除操作 | ||||
| const handleDelete = async (rowId: number) => { | ||||
|   message | ||||
|     .delConfirm() | ||||
|     .then(async () => { | ||||
|       await ClientApi.deleteOAuth2ClientApi(rowId) | ||||
|       message.success(t('common.delSuccess')) | ||||
|     }) | ||||
|     .finally(() => { | ||||
|       // 刷新列表 | ||||
|       xGrid.value?.commitProxy('query') | ||||
|     }) | ||||
|   delList(xGrid, rowId) | ||||
| } | ||||
|  | ||||
| // 提交新增/修改的表单 | ||||
| @@ -168,7 +160,7 @@ const submitForm = async () => { | ||||
|       } finally { | ||||
|         actionLoading.value = false | ||||
|         // 刷新列表 | ||||
|         xGrid.value?.commitProxy('query') | ||||
|         reloadList(xGrid) | ||||
|       } | ||||
|     } | ||||
|   }) | ||||
|   | ||||
| @@ -39,7 +39,7 @@ const { t } = useI18n() // 国际化 | ||||
| const message = useMessage() // 消息弹窗 | ||||
| // 列表相关的变量 | ||||
| const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref | ||||
| const { gridOptions } = useVxeGrid<TokenApi.OAuth2TokenVO>({ | ||||
| const { gridOptions, reloadList } = useVxeGrid<TokenApi.OAuth2TokenVO>({ | ||||
|   allSchemas: allSchemas, | ||||
|   getListApi: TokenApi.getAccessTokenPageApi | ||||
| }) | ||||
| @@ -65,7 +65,7 @@ const handleForceLogout = (rowId: number) => { | ||||
|     }) | ||||
|     .finally(() => { | ||||
|       // 刷新列表 | ||||
|       xGrid.value?.commitProxy('query') | ||||
|       reloadList(xGrid) | ||||
|     }) | ||||
| } | ||||
| </script> | ||||
|   | ||||
| @@ -90,7 +90,7 @@ const { t } = useI18n() // 国际化 | ||||
| const message = useMessage() // 消息弹窗 | ||||
| // 列表相关的变量 | ||||
| const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref | ||||
| const { gridOptions, getList, delList, getSearchData } = useVxeGrid<PostApi.PostVO>({ | ||||
| const { gridOptions, reloadList, delList, getSearchData } = useVxeGrid<PostApi.PostVO>({ | ||||
|   allSchemas: allSchemas, | ||||
|   getListApi: PostApi.getPostPageApi, | ||||
|   delListApi: PostApi.deletePostApi | ||||
| @@ -163,7 +163,7 @@ const submitForm = async () => { | ||||
|       } finally { | ||||
|         actionLoading.value = false | ||||
|         // 刷新列表 | ||||
|         getList(xGrid) | ||||
|         reloadList(xGrid) | ||||
|       } | ||||
|     } | ||||
|   }) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 xingyu4j
					xingyu4j