feat: gant block table configure

This commit is contained in:
katherinehhh 2023-01-30 10:24:13 +08:00
parent 636ad912f9
commit 3b6b84f8c3
2 changed files with 41 additions and 81 deletions

View File

@ -456,7 +456,7 @@ export const Gantt: any = (props) => {
return ( return (
<div> <div>
<Toolbar /> <Toolbar />
<div className={styles.wrapper} onKeyDown={handleKeyDown} tabIndex={0} ref={wrapperRef}> <div>
<TableBlockProvider <TableBlockProvider
service={ctx.service} service={ctx.service}
{...ctx} {...ctx}
@ -466,42 +466,44 @@ export const Gantt: any = (props) => {
> >
<RecursionField name={'table'} schema={fieldSchema.properties.table} /> <RecursionField name={'table'} schema={fieldSchema.properties.table} />
</TableBlockProvider> </TableBlockProvider>
<TaskGantt <div className={styles.wrapper} onKeyDown={handleKeyDown} tabIndex={0} ref={wrapperRef}>
gridProps={gridProps} <TaskGantt
calendarProps={calendarProps} gridProps={gridProps}
barProps={barProps} calendarProps={calendarProps}
ganttHeight={ganttHeight} barProps={barProps}
scrollY={scrollY} ganttHeight={ganttHeight}
scrollX={scrollX}
ref={verticalGanttContainerRef}
/>
{ganttEvent.changedTask && (
<Tooltip
arrowIndent={arrowIndent}
rowHeight={rowHeight}
svgContainerHeight={svgContainerHeight}
svgContainerWidth={svgContainerWidth}
fontFamily={fontFamily}
fontSize={fontSize}
scrollX={scrollX}
scrollY={scrollY} scrollY={scrollY}
task={ganttEvent.changedTask} scrollX={scrollX}
headerHeight={headerHeight} ref={verticalGanttContainerRef}
taskListWidth={taskListWidth}
TooltipContent={TooltipContent}
rtl={rtl}
svgWidth={svgWidth}
/> />
)}
<VerticalScroll {ganttEvent.changedTask && (
ganttFullHeight={ganttFullHeight} <Tooltip
ganttHeight={ganttHeight} arrowIndent={arrowIndent}
headerHeight={headerHeight} rowHeight={rowHeight}
scroll={scrollY} svgContainerHeight={svgContainerHeight}
onScroll={handleScrollY} svgContainerWidth={svgContainerWidth}
rtl={rtl} fontFamily={fontFamily}
/> fontSize={fontSize}
scrollX={scrollX}
scrollY={scrollY}
task={ganttEvent.changedTask}
headerHeight={headerHeight}
taskListWidth={taskListWidth}
TooltipContent={TooltipContent}
rtl={rtl}
svgWidth={svgWidth}
/>
)}
<VerticalScroll
ganttFullHeight={ganttFullHeight}
ganttHeight={ganttHeight}
headerHeight={headerHeight}
scroll={scrollY}
onScroll={handleScrollY}
rtl={rtl}
/>
</div>
</div> </div>
<HorizontalScroll <HorizontalScroll
svgWidth={svgWidth} svgWidth={svgWidth}

View File

@ -1056,15 +1056,16 @@ export const createGanttBlockSchema = (options) => {
'x-initializer': 'GanttActionInitializers', 'x-initializer': 'GanttActionInitializers',
properties: {}, properties: {},
}, },
table:{ table: {
type: 'array', type: 'array',
'x-decorator': 'div', 'x-decorator': 'div',
'x-decorator-props': { 'x-decorator-props': {
style: { style: {
display: 'inline-block', float: 'left',
width: '35%',
}, },
}, },
'x-initializer': 'TableColumnInitializers', 'x-initializer': 'TableColumnInitializers',
'x-component': 'TableV2', 'x-component': 'TableV2',
'x-component-props': { 'x-component-props': {
@ -1076,49 +1077,6 @@ export const createGanttBlockSchema = (options) => {
pagination: false, pagination: false,
}, },
}, },
// event: {
// type: 'void',
// 'x-component': 'Gantt.Event',
// properties: {
// drawer: {
// type: 'void',
// 'x-component': 'Action.Drawer',
// 'x-component-props': {
// className: 'nb-action-popup',
// },
// title: '{{ t("View record") }}',
// properties: {
// tabs: {
// type: 'void',
// 'x-component': 'Tabs',
// 'x-component-props': {},
// 'x-initializer': 'TabPaneInitializers',
// properties: {
// tab1: {
// type: 'void',
// title: '{{t("Details")}}',
// 'x-component': 'Tabs.TabPane',
// 'x-designer': 'Tabs.Designer',
// 'x-component-props': {},
// properties: {
// grid: {
// type: 'void',
// 'x-component': 'Grid',
// 'x-initializer-props': {
// actionInitializers: 'GanttFormActionInitializers',
// },
// 'x-initializer': 'RecordBlockInitializers',
// properties: {},
// },
// },
// },
// },
// },
// },
// },
// },
// },
}, },
}, },
}, },