ChatALL icon indicating copy to clipboard operation
ChatALL copied to clipboard

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

Open SupernovaCooper opened this issue 10 months ago • 2 comments

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 avatar Apr 08 '24 13:04 SupernovaCooper

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

divideByInfiniteLoop avatar Apr 09 '24 12:04 divideByInfiniteLoop

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

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

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

以下是修改后的建议代码(位于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的状态。这将简化用户操作流程并提高效率。

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

DevBuddyConnor avatar Apr 10 '24 15:04 DevBuddyConnor