This commit is contained in:
dzc committed 2025-04-09 12:40:42 +08:00
commit 24b5dfe141
2 files changed
+26 -21

No files matched your search

+1 -1
View File
@@ -75,7 +75,7 @@ export function useTable(options?: BasicTableProps) {
current: 1, current: 1,
size: 10, size: 10,
total: 0, total: 0,
pageSizes: [1, 10, 20, 50, 100, 200], pageSizes: [10, 20, 50, 100, 200, 500],
layout: "total, sizes, prev, pager, next, jumper", layout: "total, sizes, prev, pager, next, jumper",
} as Pagination, } as Pagination,
// 当前选中的数据项,默认为空数组 // 当前选中的数据项,默认为空数组
+25 -20
View File
@@ -80,12 +80,15 @@ const openDialog = async (id: string) => {
form.id = "" form.id = ""
// 重置表单数据 // 重置表单数据
dataFormRef.value?.resetFields() nextTick(() => {
dataFormRef.value?.resetFields()
form.walletTypeId = ""
})
// 获取walletRechargeApply信息 // 获取walletRechargeApply信息
if (id) { if (id) {
form.id = id form.id = id
getwalletRechargeApplyData(id) await getwalletRechargeApplyData(id)
} }
const res = await getWalletTypeSimple() const res = await getWalletTypeSimple()
@@ -102,30 +105,32 @@ const onSubmit = async () => {
const valid = await dataFormRef.value.validate().catch(() => {}) const valid = await dataFormRef.value.validate().catch(() => {})
if (!valid) return false if (!valid) return false
try { // try {
loading.value = true // loading.value = true
form.id ? await putObj(form) : await addObj(form) // form.id ? await putObj(form) : await addObj(form)
useMessage().success(form.id ? "修改成功" : "添加成功") // useMessage().success(form.id ? "修改成功" : "添加成功")
visible.value = false // visible.value = false
emit("refresh") // emit("refresh")
} catch (err: any) { // } catch (err: any) {
useMessage().error(err.msg) // useMessage().error(err.msg)
} finally { // } finally {
loading.value = false // loading.value = false
} // }
} }
// 初始化表单数据 // 初始化表单数据
const getwalletRechargeApplyData = (id: string) => { const getwalletRechargeApplyData = async (id: string) => {
// 获取数据 // 获取数据
loading.value = true loading.value = true
getObj(id) try {
.then((res: any) => { const res = await getObj(id)
if (res.code == 0) {
Object.assign(form, res.data) Object.assign(form, res.data)
}) }
.finally(() => { } catch (err: any) {
loading.value = false } finally {
}) loading.value = false
}
} }
// 暴露变量 // 暴露变量