import { PureComponent, ReactNode } from "react"; import "../style/CrossRotate.css"; /** * 旋转交差组件需要的最小元素定义规范 */ export interface CrossRotateFieldItem { key: string; title: string; } /** * 模型旋转-交叉字段属性设置 */ export interface FieldsContainerProps { title: string; fields: CrossRotateFieldItem[]; cRef: (self: FieldsContainer) => void; } export interface FieldsContainerState { values: CrossRotateFieldItem[]; _options: TinperListItem[]; checkValues: TinperListItem[]; } /** * tinper-bee 中 list 对象需要的选项对象格式 */ interface TinperListItem { label: string; value: string; } /** * 模型旋转-交叉字段每组对象(如:待选字段、已选字段、值字段等) */ declare class FieldsContainer extends PureComponent { state: { values: never[]; _options: never[]; checkValues: never[]; }; constructor(props: FieldsContainerProps); private fieldItems2TinperListItems; private tinperListItems2FieldItems; componentDidMount(): void; private onChange; getValue: () => CrossRotateFieldItem[]; getOptions: () => { value: string; label: string; }[]; render(): ReactNode; } /** * ok回调函数返回的参数类型,用于接收组件的回调函数获取当前组件各个组的字段信息 */ export interface ICrossRotateDetail { fields: CrossRotateFieldItem[]; valueFields: CrossRotateFieldItem[]; colFields: CrossRotateFieldItem[]; rowFields: CrossRotateFieldItem[]; } /** * 旋转-交叉字段设置属性 * fields: 所有待选字段集合 * rowFields: 行字段集合 * colFields: 列字段集合 * valueFields: 数值字段集合 * title: 旋转交叉标题 * show: 是否弹窗显示 */ export interface CrossRotateProp { fields: CrossRotateFieldItem[]; rowFields: CrossRotateFieldItem[]; colFields: CrossRotateFieldItem[]; valueFields: CrossRotateFieldItem[]; show: boolean; title: string; /** * 确定回调事件 * ok({ fields, valueFields, colFields, rowFields}) */ ok: (param: ICrossRotateDetail) => void; /** * 删除转置关系回调 * remove() */ remove: () => void; /** * 关闭转置设置对话框 */ close: () => void; /** * 删除已有的行列互换设置,获取最新的字段信息 */ refresh?: () => CrossRotateFieldItem[]; } /** * 字段集合行列互换设置对话框 * * 弹出行列互换设置对话框,组件组织方式是 CrossRotate(ReactNode) 1..n FieldsContainer(ReactNode) 1..n CrossRotateFieldItem(PlainObject) * */ declare class CrossRotate extends PureComponent { state: { fields: any; rowFields: CrossRotateFieldItem[]; colFields: CrossRotateFieldItem[]; valueFields: CrossRotateFieldItem[]; body: string; valueContainerKey: string; colContainerKey: string; show: boolean; }; private fieldsRef; private rowFieldsRef; private colFieldsRef; private valueFieldsRef; private containerKey; private fields; componentWillReceiveProps(nextProps: CrossRotateProp): void; /** * 增加行字段 */ private _rightRow; /** * 移除行字段 */ private _leftRow; /** * 增加列字段 */ private _rightCol; /** * 移除列字段 */ private _leftCol; /** * 增加值字段 */ private _rightValue; /** * 移除值字段 */ private _leftValue; /** * 对话框删除按钮事件 */ private _remove; /** * 对话框确认按钮事件 */ private _ok; /** * 重新加载字段信息 */ private _refresh; private _close; render(): JSX.Element; } export default CrossRotate;