This commit is contained in:
xingyu4j
2022-11-16 10:28:28 +08:00
parent c40076c5bb
commit d485b8289d
16 changed files with 95 additions and 95 deletions

View File

@ -83,10 +83,10 @@ const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗
// 列表相关的变量
const xGrid = ref<VxeGridInstance>() // grid Ref
const { gridOptions, reloadList, delList } = useVxeGrid<ErrorCodeApi.ErrorCodeVO>({
const { gridOptions, reloadList, deleteData } = useVxeGrid<ErrorCodeApi.ErrorCodeVO>({
allSchemas: allSchemas,
getListApi: ErrorCodeApi.getErrorCodePageApi,
delListApi: ErrorCodeApi.deleteErrorCodeApi
deleteApi: ErrorCodeApi.deleteErrorCodeApi
})
// 弹窗相关的变量
const dialogVisible = ref(false) // 是否显示弹出层
@ -110,23 +110,23 @@ const handleCreate = () => {
// 修改操作
const handleUpdate = async (rowId: number) => {
setDialogTile('update')
// 设置数据
const res = await ErrorCodeApi.getErrorCodeApi(rowId)
unref(formRef)?.setValues(res)
setDialogTile('update')
}
// 详情操作
const handleDetail = async (rowId: number) => {
setDialogTile('detail')
// 设置数据
const res = await ErrorCodeApi.getErrorCodeApi(rowId)
detailRef.value = res
setDialogTile('detail')
}
// 删除操作
const handleDelete = async (rowId: number) => {
delList(xGrid, rowId)
await deleteData(xGrid, rowId)
}
// 提交新增/修改的表单
@ -150,7 +150,7 @@ const submitForm = async () => {
} finally {
actionLoading.value = false
// 刷新列表
reloadList(xGrid)
await reloadList(xGrid)
}
}
})