import React from 'react'; import Column, { ColumnConfig } from '../common'; import OperationHelper, { OperationConfig } from '../../../util/operation'; /** * 表格操作配置项 * - type: 操作类型 * - actions: 操作按钮配置 */ export interface OperationColumnConfig extends ColumnConfig { type: 'operation'; actions: Array | []; } declare type ActionConfig = ActionButtonConfig | ActionLinkConfig; export interface ActionButtonConfig { type: 'button'; label: string; level: 'normal' | 'primary' | 'danger'; handle: OperationConfig; } export interface ActionLinkConfig { type: 'link'; label: string; level: 'normal' | 'primary' | 'danger'; handle: OperationConfig; } export interface IButtonProps { label: string; level: 'normal' | 'primary' | 'danger'; onClick: () => void; } export interface IOperationColumn { actions: Array; } export default class OperationColumn extends Column { OperationHelper: typeof OperationHelper; renderComponent: (props: IOperationColumn) => JSX.Element; /** * button组件 * @param props */ renderButtonComponent: (props: IButtonProps) => JSX.Element; /** * link组件 * @param props */ renderLinkComponent: (props: IButtonProps) => JSX.Element; state: { pageAuth: {}; }; /** * 页面权限获取状态 * fulfilled |pending */ pageAuth: { [page: string]: boolean; }; checkPageAuth: (page: string) => void; getValue: () => any; /** * 处理按钮列表按钮项回调 * @param action 按钮项配置 */ handleCallback: (action: ActionConfig, success: boolean) => Promise; render: () => JSX.Element; } export {};