|
@@ -196,8 +196,10 @@
|
|
|
<button
|
|
<button
|
|
|
class="start-identify-btn"
|
|
class="start-identify-btn"
|
|
|
@click="startIdentification"
|
|
@click="startIdentification"
|
|
|
- :disabled="isIdentifying"
|
|
|
|
|
- :class="{ 'btn-disabled': isIdentifying }"
|
|
|
|
|
|
|
+ :disabled="isStartIdentifyDisabled"
|
|
|
|
|
+ :class="{ 'btn-disabled': isStartIdentifyDisabled }"
|
|
|
|
|
+ :aria-disabled="isStartIdentifyDisabled"
|
|
|
|
|
+ :title="startIdentifyButtonTitle"
|
|
|
>
|
|
>
|
|
|
<img
|
|
<img
|
|
|
:src="
|
|
:src="
|
|
@@ -1074,6 +1076,7 @@ const deleteTargetItem = ref(null);
|
|
|
const isUploading = ref(false);
|
|
const isUploading = ref(false);
|
|
|
const isDragOver = ref(false);
|
|
const isDragOver = ref(false);
|
|
|
const isIdentifying = ref(false);
|
|
const isIdentifying = ref(false);
|
|
|
|
|
+const isStartIdentifyLocked = ref(false);
|
|
|
|
|
|
|
|
const detectionResult = ref(null);
|
|
const detectionResult = ref(null);
|
|
|
const annotatedImageUrl = ref("");
|
|
const annotatedImageUrl = ref("");
|
|
@@ -1122,6 +1125,13 @@ const shouldShowRemarkSection = computed(() => {
|
|
|
return true;
|
|
return true;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+const isStartIdentifyDisabled = computed(
|
|
|
|
|
+ () => isStartIdentifyLocked.value || isIdentifying.value
|
|
|
|
|
+);
|
|
|
|
|
+const startIdentifyButtonTitle = computed(() =>
|
|
|
|
|
+ isStartIdentifyDisabled.value ? "识别进行中,请稍候" : "开始识别"
|
|
|
|
|
+);
|
|
|
|
|
+
|
|
|
const scenarios = {
|
|
const scenarios = {
|
|
|
tunnel: { name: "隧道工程", color: "#3366E6" },
|
|
tunnel: { name: "隧道工程", color: "#3366E6" },
|
|
|
simple_supported_bridge: { name: "桥梁工程", color: "#22B850" },
|
|
simple_supported_bridge: { name: "桥梁工程", color: "#22B850" },
|
|
@@ -1487,6 +1497,7 @@ const createNewChat = () => {
|
|
|
isUploading.value = false;
|
|
isUploading.value = false;
|
|
|
isDragOver.value = false;
|
|
isDragOver.value = false;
|
|
|
isIdentifying.value = false;
|
|
isIdentifying.value = false;
|
|
|
|
|
+ isStartIdentifyLocked.value = false;
|
|
|
annotatedImageUrl.value = "";
|
|
annotatedImageUrl.value = "";
|
|
|
previewImageUrl.value = "";
|
|
previewImageUrl.value = "";
|
|
|
exampleImages.value = {};
|
|
exampleImages.value = {};
|
|
@@ -1648,8 +1659,10 @@ const uploadFileToServer = async (file) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const startIdentification = async () => {
|
|
const startIdentification = async () => {
|
|
|
|
|
+ let releaseStartIdentifyLock = true;
|
|
|
|
|
+
|
|
|
try {
|
|
try {
|
|
|
- if (isIdentifying.value) {
|
|
|
|
|
|
|
+ if (isStartIdentifyDisabled.value) {
|
|
|
ElMessage.warning("识别正在进行中,请勿重复点击");
|
|
ElMessage.warning("识别正在进行中,请勿重复点击");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -1660,6 +1673,8 @@ const startIdentification = async () => {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ isStartIdentifyLocked.value = true;
|
|
|
|
|
+
|
|
|
try {
|
|
try {
|
|
|
const latestRecordResponse = await apis.getLatestRecognitionRecord(
|
|
const latestRecordResponse = await apis.getLatestRecognitionRecord(
|
|
|
{}
|
|
{}
|
|
@@ -1742,9 +1757,11 @@ const startIdentification = async () => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
isTransitioning.value = true;
|
|
isTransitioning.value = true;
|
|
|
|
|
+ releaseStartIdentifyLock = false;
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
currentView.value = "detail";
|
|
currentView.value = "detail";
|
|
|
isTransitioning.value = false;
|
|
isTransitioning.value = false;
|
|
|
|
|
+ isStartIdentifyLocked.value = false;
|
|
|
showScanningEffect.value = true;
|
|
showScanningEffect.value = true;
|
|
|
showAnalysisPrompt.value = true;
|
|
showAnalysisPrompt.value = true;
|
|
|
}, 1000);
|
|
}, 1000);
|
|
@@ -1785,9 +1802,11 @@ const startIdentification = async () => {
|
|
|
response.data?.result_image_url ||
|
|
response.data?.result_image_url ||
|
|
|
annotatedImageUrl.value;
|
|
annotatedImageUrl.value;
|
|
|
isTransitioning.value = true;
|
|
isTransitioning.value = true;
|
|
|
|
|
+ releaseStartIdentifyLock = false;
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
currentView.value = "detail";
|
|
currentView.value = "detail";
|
|
|
isTransitioning.value = false;
|
|
isTransitioning.value = false;
|
|
|
|
|
+ isStartIdentifyLocked.value = false;
|
|
|
showScanningEffect.value = true;
|
|
showScanningEffect.value = true;
|
|
|
showAnalysisPrompt.value = true;
|
|
showAnalysisPrompt.value = true;
|
|
|
}, 1000);
|
|
}, 1000);
|
|
@@ -1808,6 +1827,9 @@ const startIdentification = async () => {
|
|
|
isDragOver.value = false;
|
|
isDragOver.value = false;
|
|
|
} finally {
|
|
} finally {
|
|
|
isIdentifying.value = false;
|
|
isIdentifying.value = false;
|
|
|
|
|
+ if (releaseStartIdentifyLock) {
|
|
|
|
|
+ isStartIdentifyLocked.value = false;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|