```
新增错误提示对话框以提升用户操作反馈 在工具页面,当工具绑定操作失败时,用户将看到一个错误提示对话框,而不是控制台日志。这提高了用户操作的可见性和应用的用户友好性。 ```
This commit is contained in:
parent
f238e45581
commit
5ae5f37556
@ -45,6 +45,21 @@
|
|||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<v-dialog v-model="bindFailed.show" max-width="290" persistent>
|
||||||
|
<v-card>
|
||||||
|
<v-card-title class="headline">操作失败</v-card-title>
|
||||||
|
<v-card-text>{{ bindFailed.message }}</v-card-text>
|
||||||
|
<v-card-actions>
|
||||||
|
<v-spacer></v-spacer>
|
||||||
|
<v-btn color="green darken-1" @click="bindFailed.show = false"
|
||||||
|
>好的</v-btn
|
||||||
|
>
|
||||||
|
</v-card-actions>
|
||||||
|
</v-card>
|
||||||
|
</v-dialog>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -61,7 +76,10 @@ import {
|
|||||||
const assistantId = router.currentRoute.value.params.id as number;
|
const assistantId = router.currentRoute.value.params.id as number;
|
||||||
const assistant: Ref<ApiV1AssistantsPost200Response> = ref({});
|
const assistant: Ref<ApiV1AssistantsPost200Response> = ref({});
|
||||||
const tools: Ref<ApiV1ToolsGet200Response> = ref({});
|
const tools: Ref<ApiV1ToolsGet200Response> = ref({});
|
||||||
|
const bindFailed = ref({
|
||||||
|
show: false,
|
||||||
|
message: "绑定失败",
|
||||||
|
});
|
||||||
const bindedTools: Ref<ApiV1AssistantsIdToolsGet200Response> = ref({});
|
const bindedTools: Ref<ApiV1AssistantsIdToolsGet200Response> = ref({});
|
||||||
|
|
||||||
function getAssistant() {
|
function getAssistant() {
|
||||||
@ -104,7 +122,8 @@ function bindTool(toolId: number) {
|
|||||||
refresh();
|
refresh();
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.log(e);
|
bindFailed.value.show = true;
|
||||||
|
bindFailed.value.message = e.response.data.error;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user