1
0
mirror of synced 2026-03-24 03:38:34 +08:00

feat(data-source,runtime): 数据源编译组件时新增一个参数控制是否要编辑子元素

编译时只需要关注组件本身的配置,子组件有自己的依赖,不需要由父组件来控制,但是在编辑器中就需要,因为为了不改动到编辑器中的dsl,编译后的配置是不会保存起来的,所以容器编译时需要把子组件也一同编译
This commit is contained in:
roymondchen
2024-03-11 20:21:10 +08:00
parent a3b41caf06
commit c68d4e05de
5 changed files with 21 additions and 12 deletions

View File

@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { cloneDeep, union } from 'lodash-es';
import { union } from 'lodash-es';
import type { AppCore } from '@tmagic/schema';
import { getDepNodeIds, getNodes } from '@tmagic/utils';
@@ -62,9 +62,11 @@ export const createDataSourceManager = (app: AppCore, useMock?: boolean, initial
dataSourceManager.emit(
'update-data',
getNodes(nodeIds, dsl.items).map((node) => {
const newNode = cloneDeep(node);
newNode.condResult = dataSourceManager.compliedConds(newNode);
return dataSourceManager.compiledNode(newNode);
if (app.platform !== 'editor') {
node.condResult = dataSourceManager.compliedConds(node);
}
return dataSourceManager.compiledNode(node);
}),
sourceId,
changeEvent,