mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2026-06-04 10:58:33 +08:00
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:
parent
3cde69f6f9
commit
a520626ef6
@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -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([])));
|
||||||
|
|||||||
@ -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[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user