差异接口调用优化

This commit is contained in:
JenniferW 2025-12-12 11:02:56 +08:00
parent ace301a637
commit 777d2bf8b3
1 changed files with 14 additions and 5 deletions

View File

@ -849,6 +849,8 @@ const handleSemicolon = (e) => {
handleInput(currentInput.value, { skipDifference: true });
//
triggerRealTimeSearch();
//
fetchDifferenceRecommendations();
}, 0);
};
@ -1174,9 +1176,7 @@ const handleInput = (value, options = {}) => {
if (currentPart) {
scheduleSearchHint(currentPart);
}
if (!options.skipDifference && normalizedValue.trim()) {
scheduleDifferenceFetch();
}
// differenceWords
};
const fetchSearchHints = async (keyword) => {
@ -1350,11 +1350,18 @@ const selectSuggestion = (item) => {
//
currentInput.value = parts.join(";").replace(/;;+/g, ";").trim();
//
const hasAddedSemicolon = item.type === "value" && parts[targetIndex].trim().endsWith(";");
//
setTimeout(() => {
handleInput(currentInput.value, { skipDifference: true });
//
triggerRealTimeSearch();
//
if (hasAddedSemicolon) {
fetchDifferenceRecommendations();
}
}, 0);
//
@ -1672,6 +1679,8 @@ const addPreciseCondition = (index) => {
if (!exists) {
preciseConditions.value.push({ ...condition, originalIndex: index });
executeSearch({ page: 1 });
//
fetchDifferenceRecommendations();
}
};
@ -1706,7 +1715,7 @@ const triggerRealTimeSearch = () => {
//
syncPreciseConditionsIndex();
scheduleSearchExecution(1);
scheduleDifferenceFetch();
//
}
};
@ -1730,7 +1739,7 @@ const removeCondition = (index) => {
//
executeSearch({ page: 1 });
scheduleDifferenceFetch();
//
//
if (selectedConditionIndex.value === index) {