Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(action): add aiPlugin #18

Merged
merged 3 commits into from
Jul 26, 2024
Merged

feat(action): add aiPlugin #18

merged 3 commits into from
Jul 26, 2024

Conversation

cmm-va
Copy link
Contributor

@cmm-va cmm-va commented Jul 25, 2024

No description provided.

}

export interface AIViewTable extends AITable {
viewApply: (action: AIViewAction) => void;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

扩展里应该包含 view 和 viewApply

}

export enum ViewActionName {
updateRowHeight = 'update_row_height'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不需要 updateRowHeight ,统一用 set_view 修改 view 中的属性
涉及到修改的,需要保存前一个值:

export interface AIViewAction {
type: ViewActionName.SetView;
view: AITableView;
newView: AITableView;
path: [number];
}

import { AITableView, ViewActionName } from '../types/view';
import { AIViewTable } from '../types/view';

export function updateRowHeight(aiTable: AIViewTable, view: AITableView, key: string, value: any) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 函数名为 setView
  2. 这个函数应该接收的值为 aiTable, newView 以及 path,在函数内部构建 AIViewAction

}

export const applyView = (aiTable: AITable, options: any) => {
const view = options.view;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修改 view 时,应该和 records 和 fields 一样,通过 signal 的方式修改。参考 GeneralActions.transform

@huanhuanwa huanhuanwa merged commit 024fa5f into develop Jul 26, 2024
1 check passed
@huanhuanwa huanhuanwa deleted the #custom-action branch July 26, 2024 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants