添加意见反馈
This commit is contained in:
1 parent
2bd27ed70d
commit
6b2ab65436
16 files changed
+853
-37
No files matched your search
@@ -1,4 +1,4 @@
|
||||
|
||||
|
||||
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
@@ -19,6 +19,7 @@ import { useRoute, useRouter } from 'vue-router';
|
||||
import { config } from '../config';
|
||||
import FilePreviewModal from '../components/FilePreviewModal.vue';
|
||||
import ThemeToggleButton from '../components/ThemeToggleButton.vue';
|
||||
import GeneralFeedbackDialog from '../components/GeneralFeedbackDialog.vue';
|
||||
import { useGlobalMessageDialog } from '../composables/useGlobalMessageDialog';
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
@@ -375,6 +376,17 @@ const copiedIndex = ref<number | null>(null);
|
||||
const { messages, isThinking, conversationId, sendMessage } = useChat();
|
||||
const input = ref('');
|
||||
const currentAgent = ref<any>(null);
|
||||
const showGeneralFeedbackDialog = ref(false);
|
||||
const currentGeneralFeedbackChatLogId = computed(() => {
|
||||
for (let i = messages.value.length - 1; i >= 0; i--) {
|
||||
const msg: any = messages.value[i];
|
||||
if (msg?.role === 'assistant') {
|
||||
const id = Number(msg?.chat_log_id);
|
||||
if (Number.isInteger(id) && id > 0) return id;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
interface ChatHistoryItem {
|
||||
id: number;
|
||||
@@ -654,6 +666,12 @@ const submitFeedback = async () => {
|
||||
<Plus class="h-4 w-4" />
|
||||
{{ $t('chat.newChat') }}
|
||||
</button>
|
||||
<button
|
||||
@click="showGeneralFeedbackDialog = true"
|
||||
class="inline-flex items-center gap-1 rounded-xl border border-[#8cbce8] bg-[#eef6ff] px-2 py-1.5 text-[11px] font-semibold text-[#2f73b2] transition-colors hover:bg-[#e3f1ff] md:px-3 md:py-2 md:text-xs"
|
||||
>
|
||||
{{ '\u610f\u89c1\u53cd\u9988' }}
|
||||
</button>
|
||||
<ThemeToggleButton />
|
||||
</div>
|
||||
</header>
|
||||
@@ -918,4 +936,11 @@ const submitFeedback = async () => {
|
||||
:agent-id="agentId"
|
||||
:auth-headers="getAuthHeaders()"
|
||||
/>
|
||||
<GeneralFeedbackDialog
|
||||
v-model="showGeneralFeedbackDialog"
|
||||
:auth-headers="getAuthHeaders()"
|
||||
source-page="chat"
|
||||
:chat-log-id="currentGeneralFeedbackChatLogId"
|
||||
@submitted="showMessageDialog('success', '\u53cd\u9988\u63d0\u4ea4\u6210\u529f')"
|
||||
/>
|
||||
</template>
|
||||
Reference in new issue
Block a user