import {iTableCellRenderScope} from "../../table/utils/table.utils"; import {RenderNode, tScopeSlotsType, tSlotsType} from "@peryl/react-compose"; import {tPlcType} from "./plc.utils"; export type PlcRenderFunction = (scope: iTableCellRenderScope) => RenderNode /*渲染列标题单元格*/ export type PlcPropsHead = (scope: { plc: tPlcType }) => RenderNode /*非编辑单元格*/ export type PlcPropsDefault = PlcRenderFunction /*合计行单元格*/ export type PlcPropsSummary = PlcRenderFunction /*编辑单元格*/ export type PlcPropsEdit = PlcRenderFunction /*表单内容*/ export type PlcPropsForm = PlcRenderFunction /** * plc插槽类型 * @author 韦胜健 * @date 2022.10.29 19:02 */ export type tPlcSlots = Record RenderNode) & { isExist: () => boolean }> /** * plc标准作用域插槽配置选项 * @author 韦胜健 * @date 2022.10.29 19:02 */ export const PlcScopeSlotsOptions = { head: {} as PlcPropsHead, // 列标题渲染函数 normal: {} as PlcPropsDefault, // 列内容默认渲染函数 summary: {} as PlcPropsSummary, // 列内容在合计行上的渲染函数 edit: {} as PlcPropsEdit, // 列内容在编辑状态下的渲染函数 form: {} as PlcPropsForm, // 表单编辑时渲染的内容 }; /** * plc标准作用域插槽类型 * @author 韦胜健 * @date 2022.10.29 19:02 */ export type tPlcScopeSlots = tScopeSlotsType /** * 列分组作用域插槽配置 * @author 韦胜健 * @date 2022.10.29 19:19 */ export const PlcGroupScopeSlotsOptions = { head: {} as PlcPropsHead, // 列标题渲染函数 }; export type tPlcGroupScopeSlots = tScopeSlotsType /** * PlcGroup插槽配置 * @author 韦胜健 * @date 2022.10.29 19:21 */ export const PlcGroupSlotsOptions = ['default'] as const; export type tPlcSlotsType = tSlotsType