mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-19 21:06:06 +08:00
feat(dep,schema): 添加组件没用数据源或者代码块的配置key
This commit is contained in:
parent
ee06c26ca5
commit
3f7d03959c
@ -1,3 +1,4 @@
|
|||||||
|
import { NODE_NO_CODE_BLOCK_KEY, NODE_NO_DATA_SOURCE_KEY } from '@tmagic/schema';
|
||||||
import { isObject } from '@tmagic/utils';
|
import { isObject } from '@tmagic/utils';
|
||||||
|
|
||||||
import type Target from './Target';
|
import type Target from './Target';
|
||||||
@ -189,6 +190,19 @@ export default class Watcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public collectItem(node: TargetNode, target: Target, depExtendedData: DepExtendedData = {}, deep = false) {
|
public collectItem(node: TargetNode, target: Target, depExtendedData: DepExtendedData = {}, deep = false) {
|
||||||
|
const dataSourceTargetTypes: string[] = [
|
||||||
|
DepTargetType.DATA_SOURCE,
|
||||||
|
DepTargetType.DATA_SOURCE_COND,
|
||||||
|
DepTargetType.DATA_SOURCE_METHOD,
|
||||||
|
];
|
||||||
|
if (node[NODE_NO_DATA_SOURCE_KEY] && dataSourceTargetTypes.includes(target.type)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (node[NODE_NO_CODE_BLOCK_KEY] && target.type === DepTargetType.CODE_BLOCK) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const collectTarget = (config: Record<string | number, any>, prop = '') => {
|
const collectTarget = (config: Record<string | number, any>, prop = '') => {
|
||||||
const doCollect = (key: string, value: any) => {
|
const doCollect = (key: string, value: any) => {
|
||||||
const keyIsItems = key === this.childrenProp;
|
const keyIsItems = key === this.childrenProp;
|
||||||
|
@ -47,6 +47,8 @@ export enum NodeType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const NODE_CONDS_KEY = 'displayConds';
|
export const NODE_CONDS_KEY = 'displayConds';
|
||||||
|
export const NODE_NO_DATA_SOURCE_KEY = '__tmagic_node_no_data_source';
|
||||||
|
export const NODE_NO_CODE_BLOCK_KEY = '__tmagic_node_no_code_block';
|
||||||
|
|
||||||
export type Id = string | number;
|
export type Id = string | number;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user