禅道bug修复
This commit is contained in:
parent
8521290ee4
commit
261c091754
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 })
|
||||
|
|
|
|||
Loading…
Reference in New Issue