提交
This commit is contained in:
1 parent
59fafb92d5
commit
6abfb6e251
1512 files changed
+1565614
-275592
No files matched your search
@@ -0,0 +1,57 @@
|
||||
import type { Component } from 'vue'
|
||||
import { Delete, Download, Edit, Filter } from '@element-plus/icons-vue'
|
||||
import type { ListToolbarOverflowItem } from '@/components/business/list-toolbar-overflow/types'
|
||||
|
||||
type ClickOpts = {
|
||||
disabled?: boolean
|
||||
loading?: boolean
|
||||
label?: string
|
||||
icon?: Component
|
||||
onClick: () => void
|
||||
}
|
||||
|
||||
export function overflowEditItem(opts: ClickOpts): ListToolbarOverflowItem {
|
||||
return {
|
||||
key: 'edit',
|
||||
label: opts.label ?? '编辑',
|
||||
icon: opts.icon ?? Edit,
|
||||
disabled: opts.disabled,
|
||||
loading: opts.loading,
|
||||
onClick: opts.onClick
|
||||
}
|
||||
}
|
||||
|
||||
export function overflowDeleteItem(opts: ClickOpts): ListToolbarOverflowItem {
|
||||
return {
|
||||
key: 'delete',
|
||||
label: opts.label ?? '删除',
|
||||
icon: opts.icon ?? Delete,
|
||||
type: 'danger',
|
||||
disabled: opts.disabled,
|
||||
loading: opts.loading,
|
||||
onClick: opts.onClick
|
||||
}
|
||||
}
|
||||
|
||||
export function overflowClearFiltersItem(
|
||||
hasActive: boolean,
|
||||
onClear: () => void
|
||||
): ListToolbarOverflowItem {
|
||||
return {
|
||||
key: 'clearFilters',
|
||||
label: '清空列过滤',
|
||||
icon: Filter,
|
||||
hidden: !hasActive,
|
||||
onClick: onClear
|
||||
}
|
||||
}
|
||||
|
||||
export function overflowExportPlaceholder(
|
||||
label = '导出'
|
||||
): ListToolbarOverflowItem {
|
||||
return {
|
||||
key: 'export',
|
||||
label,
|
||||
icon: Download
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user