Skip to content

Commit

Permalink
improvement (#15018)
Browse files Browse the repository at this point in the history
  • Loading branch information
ly109974 authored Oct 12, 2023
1 parent 1f67e68 commit d983e36
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,31 +184,31 @@ export default defineComponent({
? t('project.workflow.down_line')
: t('project.workflow.up_line'),
trigger: () => (
<NButton
size='small'
type={releaseState === 'ONLINE' ? 'warning' : 'error'}
tag='div'
circle
class='btn-publish'
>
<NPopconfirm onPositiveClick={this.handleReleaseWorkflow}>
{{
default: () =>
releaseState === 'ONLINE'
? t('project.workflow.confirm_to_offline')
: t('project.workflow.confirm_to_online'),
trigger: () => (
<NPopconfirm onPositiveClick={this.handleReleaseWorkflow}>
{{
default: () =>
releaseState === 'ONLINE'
? t('project.workflow.confirm_to_offline')
: t('project.workflow.confirm_to_online'),
trigger: () => (
<NButton
size='small'
type={releaseState === 'ONLINE' ? 'warning' : 'error'}
tag='div'
circle
class='btn-publish'
>
<NIcon>
{releaseState === 'ONLINE' ? (
<DownloadOutlined />
) : (
<UploadOutlined />
)}
</NIcon>
)
}}
</NPopconfirm>
</NButton>
</NButton>
)
}}
</NPopconfirm>
)
}}
</NTooltip>
Expand Down Expand Up @@ -253,33 +253,28 @@ export default defineComponent({
{{
default: () => t('project.workflow.delete'),
trigger: () => (
<NButton
size='small'
type='error'
tag='div'
circle
<NPopconfirm
disabled={releaseState === 'ONLINE'}
class='btn-delete'
onPositiveClick={this.handleDeleteWorkflow}
>
<NPopconfirm
disabled={releaseState === 'ONLINE'}
onPositiveClick={this.handleDeleteWorkflow}
>
{{
default: () => t('project.workflow.delete_confirm'),
icon: () => (
<NIcon>
<InfoCircleFilled />
</NIcon>
),
trigger: () => (
{{
default: () => t('project.workflow.delete_confirm'),
trigger: () => (
<NButton
size='small'
type='error'
tag='div'
circle
disabled={releaseState === 'ONLINE'}
class='btn-delete'
>
<NIcon>
<DeleteOutlined />
</NIcon>
)
}}
</NPopconfirm>
</NButton>
</NButton>
)
}}
</NPopconfirm>
)
}}
</NTooltip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { NSpace, NTooltip, NButton, NIcon, NPopconfirm } from 'naive-ui'
import {
DeleteOutlined,
FormOutlined,
InfoCircleFilled,
SyncOutlined,
CloseOutlined,
CloseCircleOutlined,
Expand Down Expand Up @@ -250,35 +249,30 @@ export default defineComponent({
{{
default: () => t('project.workflow.delete'),
trigger: () => (
<NButton
tag='div'
size='small'
type='error'
circle
disabled={
(state !== 'SUCCESS' &&
state !== 'FAILURE' &&
state !== 'STOP' &&
state !== 'PAUSE') ||
this.row?.disabled
}
>
<NPopconfirm onPositiveClick={this.handleDeleteInstance}>
{{
default: () => t('project.workflow.delete_confirm'),
icon: () => (
<NIcon>
<InfoCircleFilled />
</NIcon>
),
trigger: () => (
<NPopconfirm onPositiveClick={this.handleDeleteInstance}>
{{
default: () => t('project.workflow.delete_confirm'),
trigger: () => (
<NButton
tag='div'
size='small'
type='error'
circle
disabled={
(state !== 'SUCCESS' &&
state !== 'FAILURE' &&
state !== 'STOP' &&
state !== 'PAUSE') ||
this.row?.disabled
}
>
<NIcon>
<DeleteOutlined />
</NIcon>
)
}}
</NPopconfirm>
</NButton>
</NButton>
)
}}
</NPopconfirm>
)
}}
</NTooltip>
Expand Down
30 changes: 16 additions & 14 deletions dolphinscheduler-ui/src/views/projects/workflow/instance/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,22 @@ export default defineComponent({
{{
default: () => t('project.workflow.delete'),
trigger: () => (
<NButton
tag='div'
type='primary'
disabled={this.checkedRowKeys.length <= 0}
style='position: absolute; bottom: 10px; left: 10px;'
class='btn-delete-all'
>
<NPopconfirm onPositiveClick={this.handleBatchDelete}>
{{
default: () => t('project.workflow.delete_confirm'),
trigger: () => t('project.workflow.delete')
}}
</NPopconfirm>
</NButton>
<NPopconfirm onPositiveClick={this.handleBatchDelete}>
{{
default: () => t('project.workflow.delete_confirm'),
trigger: () => (
<NButton
tag='div'
type='primary'
disabled={this.checkedRowKeys.length <= 0}
style='position: absolute; bottom: 10px; left: 10px;'
class='btn-delete-all'
>
t('project.workflow.delete')
</NButton>
)
}}
</NPopconfirm>
)
}}
</NTooltip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
DownloadOutlined,
FormOutlined,
EditOutlined,
InfoCircleFilled,
UploadOutlined
} from '@vicons/antd'
import _ from 'lodash'
Expand Down Expand Up @@ -222,32 +221,27 @@ export default defineComponent({
{{
default: () => t('resource.file.delete'),
trigger: () => (
<NButton size='tiny' type='error' circle class='btn-delete'>
<NPopconfirm
positive-text={t('resource.file.confirm')}
negative-text={t('resource.file.cancel')}
onPositiveClick={() => {
this.handleDeleteFile({
fullName: this.row.fullName,
tenantCode: this.row.user_name
})
}}
>
{{
default: () => t('resource.file.delete_confirm'),
icon: () => (
<NIcon>
<InfoCircleFilled />
</NIcon>
),
trigger: () => (
<NPopconfirm
positive-text={t('resource.file.confirm')}
negative-text={t('resource.file.cancel')}
onPositiveClick={() => {
this.handleDeleteFile({
fullName: this.row.fullName,
tenantCode: this.row.user_name
})
}}
>
{{
default: () => t('resource.file.delete_confirm'),
trigger: () => (
<NButton size='tiny' type='error' circle class='btn-delete'>
<NIcon>
<DeleteOutlined />
</NIcon>
)
}}
</NPopconfirm>
</NButton>
</NButton>
)
}}
</NPopconfirm>
)
}}
</NTooltip>
Expand Down

0 comments on commit d983e36

Please sign in to comment.