|
@@ -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)
|
|
|
}
|
|
|
}
|
|
|
})
|