feat(editor): getPropsConfig 支持传入 node 参数并修正 CondOpSelectConfig 类型

- props service 的 getPropsConfig 增加可选 data 参数以传递当前节点信息
- 修正 CondOpSelectConfig 的 type 字段为 'cond-op-select'

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
roymondchen 2026-05-07 16:24:17 +08:00
parent 3cde69f6f9
commit a520626ef6
3 changed files with 4 additions and 4 deletions

View File

@ -115,7 +115,7 @@ const init = async () => {
} }
const type = node.value.type || (node.value.items ? 'container' : 'text'); const type = node.value.type || (node.value.items ? 'container' : 'text');
curFormConfig.value = await propsService.getPropsConfig(type); curFormConfig.value = await propsService.getPropsConfig(type, { node: node.value });
values.value = node.value; values.value = node.value;
}; };

View File

@ -117,9 +117,9 @@ class Props extends BaseService {
* @param type * @param type
* @returns * @returns
*/ */
public async getPropsConfig(type: string): Promise<FormConfig> { public async getPropsConfig(type: string, data?: { node?: MNode | null }): Promise<FormConfig> {
if (type === 'area') { if (type === 'area') {
return await this.getPropsConfig('button'); return await this.getPropsConfig('button', data);
} }
return cloneDeep(this.state.propsConfigMap[toLine(type)] || (await this.fillConfig([]))); return cloneDeep(this.state.propsConfigMap[toLine(type)] || (await this.fillConfig([])));

View File

@ -66,7 +66,7 @@ export interface CodeSelectColConfig extends FormItem {
} }
export interface CondOpSelectConfig extends FormItem { export interface CondOpSelectConfig extends FormItem {
type: 'cond-op'; type: 'cond-op-select';
parentFields?: string[]; parentFields?: string[];
} }