Skip to content

Commit

Permalink
fix(table): fix table actionColOptions not work
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Oct 20, 2020
1 parent f96d6b2 commit 5a6db8c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
6 changes: 5 additions & 1 deletion src/components/Form/src/BasicForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,11 @@
}
}
advanceState.actionSpan = (realItemColSum % BASIC_COL_LEN) + unref(getEmptySpanRef);
getAdvanced(props.actionColOptions || { span: BASIC_COL_LEN }, itemColSum, true);
getAdvanced(
unref(getActionPropsRef).actionColOptions || { span: BASIC_COL_LEN },
itemColSum,
true
);
emit('advanced-change');
}
function getAdvanced(itemCol: Partial<ColEx>, itemColSum = 0, isLastAction = false) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Form/src/FormAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ export default defineComponent({
const advancedSpanObj = showAdvancedButton ? { span: actionSpan < 6 ? 24 : actionSpan } : {};
const actionColOpt: Partial<ColEx> = {
span: showAdvancedButton ? 6 : 4,
...actionColOptions,
...advancedSpanObj,
...actionColOptions,
};
return actionColOpt;
});
Expand Down
20 changes: 10 additions & 10 deletions src/components/Form/src/types/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export interface FormProps {
// 空白行span
emptySpan?: number | Partial<ColEx>;
// 表单内部组件大小
size: 'default' | 'small' | 'large';
size?: 'default' | 'small' | 'large';
// 是否禁用
disabled?: boolean;
// 时间区间字段映射成多个
Expand All @@ -62,25 +62,25 @@ export interface FormProps {
// 超过指定行数自动收起
autoAdvancedLine?: number;
// 是否显示操作按钮
showActionButtonGroup: boolean;
showActionButtonGroup?: boolean;

// 重置按钮配置
resetButtonOptions: Partial<BasicButtonProps>;
resetButtonOptions?: Partial<BasicButtonProps>;

// 确认按钮配置
submitButtonOptions: Partial<BasicButtonProps>;
submitButtonOptions?: Partial<BasicButtonProps>;

// 操作列配置
actionColOptions: Partial<ColEx>;
actionColOptions?: Partial<ColEx>;

// 显示重置按钮
showResetButton: boolean;
showResetButton?: boolean;
// 显示确认按钮
showSubmitButton: boolean;
showSubmitButton?: boolean;

resetFunc: () => Promise<void>;
submitFunc: () => Promise<void>;
transformDateFunc: (date: any) => string;
resetFunc?: () => Promise<void>;
submitFunc?: () => Promise<void>;
transformDateFunc?: (date: any) => string;
colon?: boolean;
}
export interface FormSchema {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Table/src/types/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export interface BasicTableProps<T = any> {
// 使用搜索表单
useSearchForm?: boolean;
// 表单配置
formConfig?: FormProps;
formConfig?: Partial<FormProps>;
// 列配置
columns: BasicColumn[];
// 是否显示序号列
Expand Down

0 comments on commit 5a6db8c

Please sign in to comment.