From 5547eb4ee870d27fbeed8ed095c371dd8c341f74 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Tue, 21 Nov 2023 19:17:53 +0800 Subject: [PATCH] =?UTF-8?q?fix(dep):=20=E6=95=B0=E6=8D=AE=E6=BA=90?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E6=94=B6=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/dep/src/utils.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/dep/src/utils.ts b/packages/dep/src/utils.ts index 13804c42..a3890b73 100644 --- a/packages/dep/src/utils.ts +++ b/packages/dep/src/utils.ts @@ -40,14 +40,20 @@ export const createDataSourceTarget = (ds: DataSourceSchema, initialDeps: DepDat // 关联数据源对象,如:{ isBindDataSource: true, dataSourceId: 'xxx'} // 或者在模板在使用数据源,如:`xxx${id.field}xxx` if ( - (value?.isBindDataSource && value.dataSourceId) || + (value?.isBindDataSource && value.dataSourceId && value.dataSourceId === ds.id) || (typeof value === 'string' && value.includes(`${ds.id}`) && /\$\{([\s\S]+?)\}/.test(value)) ) { + console.log('value', value, ds.id); return true; } // 指定数据源的字符串模板,如:{ isBindDataSourceField: true, dataSourceId: 'id', template: `xxx${field}xxx`} - if (value?.isBindDataSourceField && value.dataSourceId && typeof value.template === 'string') { + if ( + value?.isBindDataSourceField && + value.dataSourceId && + value.dataSourceId === ds.id && + typeof value.template === 'string' + ) { return true; }