禅道bug修复

This commit is contained in:
BianLzhaoMin 2026-01-04 10:27:34 +08:00
parent 8521290ee4
commit 261c091754
2 changed files with 36 additions and 0 deletions

View File

@ -200,6 +200,11 @@
"
:link="action.link !== false"
:plain="action.plain"
:disabled="
typeof action.disabled === 'function'
? action.disabled(row)
: action.disabled
"
@click="handleAction(action, row, $index)"
v-hasPermi="action.permission"
>
@ -218,6 +223,11 @@
"
:link="action.link !== false"
:plain="action.plain"
:disabled="
typeof action.disabled === 'function'
? action.disabled(row)
: action.disabled
"
@click="handleAction(action, row, $index)"
>
{{ action.label }}
@ -243,6 +253,11 @@
<el-dropdown-item
v-if="action.permission"
:command="{ action, row, index: $index }"
:disabled="
typeof action.disabled === 'function'
? action.disabled(row)
: action.disabled
"
v-hasPermi="action.permission"
>
{{ action.label }}
@ -251,6 +266,11 @@
<el-dropdown-item
v-else
:command="{ action, row, index: $index }"
:disabled="
typeof action.disabled === 'function'
? action.disabled(row)
: action.disabled
"
>
{{ action.label }}
</el-dropdown-item>
@ -507,6 +527,12 @@ const handlePaginationChange = (pagination) => {
//
const handleAction = (action, row, index) => {
//
const isDisabled =
typeof action.disabled === 'function' ? action.disabled(row) : action.disabled
if (isDisabled) {
return
}
if (action.handler && typeof action.handler === 'function') {
action.handler(row, index)
} else {

View File

@ -175,6 +175,14 @@ const initTableColumns = computed(() => {
if (tableType.value !== '0') return [...tableColumns.value, ...processedTableColumns_2.value]
})
//
const isBeforeToday = (dayPlan) => {
if (!dayPlan) return false
const planDate = dayjs(dayPlan)
const today = dayjs().startOf('day')
return planDate.isBefore(today)
}
//
const actionColumns = computed(() => [
{
@ -202,6 +210,7 @@ const actionColumns = computed(() => [
type: 'primary',
link: true,
permission: ['plan:dailyPlan:edit'], // 使 v-hasPermi
disabled: (row) => isBeforeToday(row.dayPlan), //
handler: (row) => {
router.push({
path: '/plan/dailyPlanEdit/index',
@ -222,6 +231,7 @@ const actionColumns = computed(() => [
type: 'danger',
link: true,
permission: ['plan:dailyPlan:remove'], // 使 v-hasPermi
disabled: (row) => isBeforeToday(row.dayPlan), //
handler: (row) => {
proxy.$modal.confirm('是否确认删除该日计划?').then(async () => {
const result = await delDailyPlanAPI({ dayPlanId: row.dayPlanId })