-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
} | ||
|
||
export interface AIViewTable extends AITable { | ||
viewApply: (action: AIViewAction) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
扩展里应该包含 view 和 viewApply
src/app/types/view.ts
Outdated
} | ||
|
||
export enum ViewActionName { | ||
updateRowHeight = 'update_row_height' |
There was a problem hiding this comment.
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];
}
src/app/action/view.ts
Outdated
import { AITableView, ViewActionName } from '../types/view'; | ||
import { AIViewTable } from '../types/view'; | ||
|
||
export function updateRowHeight(aiTable: AIViewTable, view: AITableView, key: string, value: any) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 函数名为 setView
- 这个函数应该接收的值为 aiTable, newView 以及 path,在函数内部构建 AIViewAction
src/app/action/view.ts
Outdated
} | ||
|
||
export const applyView = (aiTable: AITable, options: any) => { | ||
const view = options.view; |
There was a problem hiding this comment.
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
No description provided.