Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT]删除对话的时候,能直接把垃圾桶变成确认删除吗? #781

Open
SupernovaCooper opened this issue Apr 8, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@SupernovaCooper
Copy link

Is your feature request related to a problem? / 你想要的功能和什么问题相关?

删除对话的时候,能直接把垃圾桶变成确认删除吗?不然还得去屏幕中央点击对话框确认。。。有多条数据要删除的时候非常麻烦,又没有快捷键。。。

Describe the solution you'd like. / 你想要的解决方案是什么?

点击垃圾桶之后,垃圾桶直接变成对号,再点一次确认删除就好,不需要弹出对话框,鼠标也不用来回移动了,效率更高。

Describe alternatives you've considered. / 你考虑过的其他方案是什么?

No response

Additional context / 其他信息

No response

@SupernovaCooper SupernovaCooper added the enhancement New feature or request label Apr 8, 2024
@divideByInfiniteLoop
Copy link

小妙招,把窗口最小化,让对话框靠中间一点。
5fwe1

@DevBuddyConnor
Copy link

我对该问题进行了详细分析,并提出了以下解决方案:

问题描述:在删除对话时,当前的流程需要用户点击垃圾桶图标后,再到屏幕中央点击对话框中的确认按钮才能完成删除。这导致了如果用户有多条数据要删除,整个过程变得非常麻烦,且没有快捷键支持。

解决方案:
为了简化删除对话的流程并提高用户操作的效率,我建议以下代码修改方案。我们可以在点击垃圾桶图标时,不直接发送删除事件,而是切换图标并等待用户的再次确认。

以下是修改后的建议代码(位于src/components/ChatDrawer/ChatDrawerItem.vue文件):

<template>
  <!-- 省略其他部分... -->
  <template #append v-if="props.currentChatIndex === props.chat.index">
    <v-btn
      v-if="!deleteConfirmation"
      flat
      size="x-small"
      icon="mdi-delete-outline"
      @click="deleteConfirmation = true"
      style="margin: 0; background-color: transparent"
    ></v-btn>
    <v-btn
      v-else
      flat
      size="x-small"
      icon="mdi-check"
      @click="confirmHideChat"
      style="margin: 0; background-color: transparent"
    ></v-btn>
  </template>
  <!-- 省略其他部分... -->
</template>

<script setup>
import { ref } from 'vue';
// 省略其他部分...

const deleteConfirmation = ref(false);

async function confirmHideChat() {
  emit("hideChat");
  deleteConfirmation.value = false;
}

// 省略其他部分...
</script>

在这个修改中,我们引入了一个新的响应式变量deleteConfirmation来控制删除确认流程。当用户第一次点击垃圾桶图标时,我们切换该状态,并替换图标为对号图标(mdi-check)。如果此时用户再次点击,会调用confirmHideChat函数处理删除逻辑,并重置deleteConfirmation的状态。这将简化用户操作流程并提高效率。

请确保在实施这些更改后对相关逻辑进行充分的测试,以确保功能的正确性和稳定性。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants