Compare commits

..

2 Commits

Author SHA1 Message Date
sexygoat
2140efbacf fix: bug
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m28s
2026-04-23 16:08:07 +08:00
sexygoat
8cc86369a2 fix: bug 2026-04-23 16:03:54 +08:00
2 changed files with 33 additions and 21 deletions

View File

@@ -164,6 +164,8 @@
actions?: ((row: any) => TableAction[]) | null
/** 操作列宽度 */
actionsWidth?: number
/** 直接显示的操作按钮数量默认2个 */
inlineActionsCount?: number
}
const props = withDefaults(defineProps<TableProps>(), {
@@ -192,7 +194,8 @@
treeProps: undefined,
defaultExpandAll: false,
actions: null,
actionsWidth: 140
actionsWidth: 140,
inlineActionsCount: 2
})
/*
@@ -371,8 +374,8 @@
)
}
// 如果操作数量 <= 3,直接显示所有按钮
if (actionList.length <= 3) {
// 如果操作数量 <= inlineActionsCount,直接显示所有按钮
if (actionList.length <= props.inlineActionsCount) {
return h(
'div',
{ style: 'display: flex; gap: 8px;' },
@@ -390,19 +393,21 @@
)
}
// 如果操作数量 > 3显示第一个 + 更多下拉菜单
const firstAction = actionList[0]
const moreActions = actionList.slice(1)
// 如果操作数量 > inlineActionsCount显示前 inlineActionsCount 个 + 更多下拉菜单
const inlineActions = actionList.slice(0, props.inlineActionsCount)
const moreActions = actionList.slice(props.inlineActionsCount)
return h('div', { style: 'display: flex; gap: 12px; align-items: center;' }, [
h(
ElButton,
{
type: firstAction.type === 'danger' ? 'danger' : 'primary',
link: true,
onClick: () => firstAction.handler(row)
},
() => firstAction.label
...inlineActions.map((action) =>
h(
ElButton,
{
type: action.type === 'danger' ? 'danger' : 'primary',
link: true,
onClick: () => action.handler(row)
},
() => action.label
)
),
h(
ElDropdown,

View File

@@ -35,7 +35,8 @@
:total="pagination.total"
:marginTop="10"
:actions="getActions"
:actionsWidth="250"
:actionsWidth="230"
:inlineActionsCount="2"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
>
@@ -302,7 +303,6 @@
} from '@/types/api'
import type { SearchFormItem } from '@/types'
import { useCheckedColumns } from '@/composables/useCheckedColumns'
import { useUserStore } from '@/store/modules/user'
import { formatDateTime } from '@/utils/business/format'
import { RoutesAlias } from '@/router/routesAlias'
import { useAuth } from '@/composables/useAuth'
@@ -848,8 +848,9 @@
: undefined,
remark: approveForm.remark || undefined
}
await RefundService.approveRefund(currentRefund.value.id, data)
const refundId = currentRefund.value?.id
if (!refundId) return
await RefundService.approveRefund(refundId, data)
ElMessage.success('审批通过成功')
approveDialogVisible.value = false
await getTableData()
@@ -883,7 +884,9 @@
if (valid) {
rejectLoading.value = true
try {
await RefundService.rejectRefund(currentRefund.value.id, rejectForm)
const refundId = currentRefund.value?.id
if (!refundId) return
await RefundService.rejectRefund(refundId, rejectForm)
ElMessage.success('审批拒绝成功')
rejectDialogVisible.value = false
await getTableData()
@@ -917,7 +920,9 @@
if (valid) {
returnLoading.value = true
try {
await RefundService.returnRefund(currentRefund.value.id, returnForm)
const refundId = currentRefund.value?.id
if (!refundId) return
await RefundService.returnRefund(refundId, returnForm)
ElMessage.success('退回成功')
returnDialogVisible.value = false
await getTableData()
@@ -957,6 +962,8 @@
if (valid) {
resubmitLoading.value = true
try {
const refundId = currentRefund.value?.id
if (!refundId) return
const data: ResubmitRefundRequest = {
requested_refund_amount: resubmitForm.requested_refund_amount
? resubmitForm.requested_refund_amount * 100
@@ -967,7 +974,7 @@
refund_reason: resubmitForm.refund_reason || undefined
}
await RefundService.resubmitRefund(currentRefund.value.id, data)
await RefundService.resubmitRefund(refundId, data)
ElMessage.success('重新提交成功')
resubmitDialogVisible.value = false
await getTableData()