Skip to content

Commit 026f030

Browse files
Kinplemelonysfscream
authored andcommitted
fix(rule): fix the logic for judging the type of data source
1 parent 9a24847 commit 026f030

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/hooks/Rule/rule/useRule.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ export const useRuleUtils = (): {
109109
return bridgeType as BridgeType
110110
}
111111

112+
/**
113+
* @param value if type is source, value is source id
114+
*/
112115
const getTestTargetEvent = (
113116
type: RuleInputType,
114117
value: string,

src/hooks/Rule/useSQLAvailablePlaceholder.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ export default (): {
8585
: checkIsTopic(item)
8686
? RuleInputType.Topic
8787
: RuleInputType.Event
88-
const targetEvent = getTestTargetEvent(itemType, item, totalEventList.value)
88+
const value =
89+
itemType === RuleInputType.Bridge ? item.replace(ruleInputBridgeReg, '') : item
90+
const targetEvent = getTestTargetEvent(itemType, value, totalEventList.value)
8991
if (targetEvent) {
9092
targetEvent.columns.forEach((item) => set.add(item))
9193
}

0 commit comments

Comments
 (0)