mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-06-10 14:13:01 +08:00
feat(data-source): 迭代器容器内容支持显示条件配置
This commit is contained in:
parent
ef04fd31f0
commit
ecfaff2e0d
@ -222,7 +222,7 @@ class DataSourceManager extends EventEmitter {
|
|||||||
const [dsId, ...keys] = dataSourceField;
|
const [dsId, ...keys] = dataSourceField;
|
||||||
const ds = this.get(dsId);
|
const ds = this.get(dsId);
|
||||||
if (!ds) return items;
|
if (!ds) return items;
|
||||||
return compliedIteratorItems(itemData, items, dsId, keys, this.app.platform !== 'editor');
|
return compliedIteratorItems(itemData, items, dsId, keys, this.app.platform === 'editor');
|
||||||
}
|
}
|
||||||
|
|
||||||
public destroy() {
|
public destroy() {
|
||||||
|
@ -223,7 +223,7 @@ export const compliedIteratorItems = (
|
|||||||
return items.map((item) => {
|
return items.map((item) => {
|
||||||
const ctxData = createIteratorContentData(itemData, dsId, keys);
|
const ctxData = createIteratorContentData(itemData, dsId, keys);
|
||||||
|
|
||||||
if (condDeps[item.id]?.keys.length) {
|
if (condDeps[item.id]?.keys.length && !inEditor) {
|
||||||
item.condResult = compliedConditions(item, ctxData);
|
item.condResult = compliedConditions(item, ctxData);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,10 +231,6 @@ export const compliedIteratorItems = (
|
|||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!inEditor) {
|
|
||||||
item.condResult = compliedConditions(item, itemData);
|
|
||||||
}
|
|
||||||
|
|
||||||
return compiledNode(
|
return compiledNode(
|
||||||
(value: any) => compiledNodeField(value, ctxData),
|
(value: any) => compiledNodeField(value, ctxData),
|
||||||
cloneDeep(item),
|
cloneDeep(item),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user