diff --git a/apps/web-antd/src/components/table-action/index.ts b/apps/web-antd/src/components/table-action/index.ts new file mode 100644 index 00000000..7dad46ea --- /dev/null +++ b/apps/web-antd/src/components/table-action/index.ts @@ -0,0 +1,2 @@ +export { default as TableAction } from './table-action.vue'; +export * from './typing'; diff --git a/apps/web-antd/src/components/table-action/table-action.vue b/apps/web-antd/src/components/table-action/table-action.vue new file mode 100644 index 00000000..bb0c08f4 --- /dev/null +++ b/apps/web-antd/src/components/table-action/table-action.vue @@ -0,0 +1,267 @@ + + + + diff --git a/apps/web-antd/src/components/table-action/typing.ts b/apps/web-antd/src/components/table-action/typing.ts new file mode 100644 index 00000000..4e9e52a6 --- /dev/null +++ b/apps/web-antd/src/components/table-action/typing.ts @@ -0,0 +1,27 @@ +import type { ButtonProps } from 'ant-design-vue/es/button/buttonTypes'; +import type { TooltipProps } from 'ant-design-vue/es/tooltip/Tooltip'; + +export interface PopConfirm { + title: string; + okText?: string; + cancelText?: string; + confirm: () => void; + cancel?: () => void; + icon?: string; + disabled?: boolean; +} + +export interface ActionItem extends ButtonProps { + onClick?: () => void; + label?: string; + color?: 'error' | 'success' | 'warning'; + icon?: string; + popConfirm?: PopConfirm; + disabled?: boolean; + divider?: boolean; + // 权限编码控制是否显示 + auth?: string[]; + // 业务控制是否显示 + ifShow?: ((action: ActionItem) => boolean) | boolean; + tooltip?: string | TooltipProps; +} diff --git a/apps/web-antd/src/locales/langs/en-US/page.json b/apps/web-antd/src/locales/langs/en-US/page.json index e889bfc1..00a8c90b 100644 --- a/apps/web-antd/src/locales/langs/en-US/page.json +++ b/apps/web-antd/src/locales/langs/en-US/page.json @@ -23,7 +23,8 @@ "cancel": "Cancel", "confirm": "Confirm", "reset": "Reset", - "search": "Search" + "search": "Search", + "more": "More" }, "tenant": { "placeholder": "Please select tenant", diff --git a/apps/web-antd/src/locales/langs/zh-CN/page.json b/apps/web-antd/src/locales/langs/zh-CN/page.json index a7781960..eefc4924 100644 --- a/apps/web-antd/src/locales/langs/zh-CN/page.json +++ b/apps/web-antd/src/locales/langs/zh-CN/page.json @@ -23,7 +23,8 @@ "cancel": "取消", "confirm": "确认", "reset": "重置", - "search": "搜索" + "search": "搜索", + "more": "更多" }, "tenant": { "placeholder": "请选择租户",