|
|
@@ -1,12 +1,17 @@
|
|
|
<template>
|
|
|
<div class="dialog-input-actions">
|
|
|
<div class="dialog-input-action-left">
|
|
|
- <!-- <div>联网查询</div> -->
|
|
|
- <a-tooltip :content="$t('conversation.file_upload_message')" position="top">
|
|
|
+ <div class="action-left-item-btn connect-internet" @click="handleSwitchChange">
|
|
|
+ <a-switch class="chat-connect-network-switch" :default-checked="default_switch" :model-value="cur_switch" />
|
|
|
+
|
|
|
+ <span class="search-from-network" :class="search_text_klass">{{ $t('conversation.online_search') }}</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- <a-tooltip :content="$t('conversation.file_upload_message')" position="top">
|
|
|
<div v-if="enable_file_upload" class="action-left-item-btn" @click="handleFileUpload">
|
|
|
<img src="../../../assets/file-upload.png" />
|
|
|
</div>
|
|
|
- </a-tooltip>
|
|
|
+ </a-tooltip> -->
|
|
|
</div>
|
|
|
|
|
|
<div class="dialog-input-action-right">
|
|
|
@@ -14,18 +19,28 @@
|
|
|
<div v-if="enable_frequent_question" class="action-right-item-btn" @click="handleQuestionDefine">
|
|
|
<img src="../../../assets/question-define.png" />
|
|
|
</div>
|
|
|
- </a-tooltip>
|
|
|
+ </a-tooltip> -->
|
|
|
|
|
|
- <a-tooltip content="文件上传" position="top">
|
|
|
+ <div v-if="enable_frequent_question" class="action-right-item-btn" @click="handleQuestionDefine">
|
|
|
+ <img src="../../../assets/question-define.png" />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- <a-tooltip content="文件上传" position="top">
|
|
|
<div v-if="enable_file_upload" class="action-right-item-btn" @click="handleFileUpload">
|
|
|
<img src="../../../assets/file-upload.png" />
|
|
|
</div>
|
|
|
- </a-tooltip>
|
|
|
+ </a-tooltip> -->
|
|
|
|
|
|
- <a-tooltip content="语音识别" position="top">
|
|
|
+ <!-- <a-tooltip content="语音识别" position="top">
|
|
|
<div v-if="enable_voice_recognition" class="action-right-item-btn" @click="handleVoiceRecognize">语音识别</div>
|
|
|
</a-tooltip> -->
|
|
|
|
|
|
+ <a-tooltip :content="$t('conversation.file_upload_message')" position="top">
|
|
|
+ <div v-if="enable_file_upload" class="action-right-item-btn" @click="handleFileUpload">
|
|
|
+ <img src="../../../assets/file-upload.png" />
|
|
|
+ </div>
|
|
|
+ </a-tooltip>
|
|
|
+
|
|
|
<a-tooltip :content="$t('conversation.input_message')" position="top">
|
|
|
<div class="action-right-item-btn submit-input-btn" @click="handleSubmit">
|
|
|
{{ $t('conversation.input_confirm') }}
|
|
|
@@ -36,6 +51,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
+import { ref, computed } from 'vue';
|
|
|
+
|
|
|
const props = defineProps({
|
|
|
/**
|
|
|
* 是否禁用操作
|
|
|
@@ -105,6 +122,23 @@ const props = defineProps({
|
|
|
|
|
|
const emit = defineEmits(['fileUpload', 'questionDefine', 'voiceRecognize', 'submit']);
|
|
|
|
|
|
+// 联网搜索开关
|
|
|
+const default_switch = ref(true);
|
|
|
+const cur_switch = ref(true);
|
|
|
+const search_text_klass = computed(() => {
|
|
|
+ return {
|
|
|
+ 'is-connnected': cur_switch.value,
|
|
|
+ 'not-connnected': !cur_switch.value
|
|
|
+ };
|
|
|
+});
|
|
|
+const handleSwitchChange = (val) => {
|
|
|
+ if (cur_switch.value) {
|
|
|
+ cur_switch.value = false;
|
|
|
+ } else {
|
|
|
+ cur_switch.value = true;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
const handleQuestionDefine = () => {
|
|
|
emit('questionDefine');
|
|
|
};
|
|
|
@@ -144,9 +178,28 @@ const handleSubmit = () => {
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
|
|
|
+.connect-internet {
|
|
|
+ /* color: #707379; */
|
|
|
+ color: var(--color-text-3);
|
|
|
+}
|
|
|
+.search-from-network {
|
|
|
+ display: inline-block;
|
|
|
+ margin-left: 5px;
|
|
|
+}
|
|
|
+.is-connnected {
|
|
|
+ color: var(--color-text-1);
|
|
|
+}
|
|
|
+.not-connnected {
|
|
|
+ color: var(--color-text-3);
|
|
|
+}
|
|
|
+
|
|
|
.action-right-item-btn {
|
|
|
- margin-left: 10px;
|
|
|
+ margin-left: 17px;
|
|
|
cursor: pointer;
|
|
|
+
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
}
|
|
|
|
|
|
.action-left-item-btn img {
|
|
|
@@ -159,8 +212,24 @@ const handleSubmit = () => {
|
|
|
.submit-input-btn {
|
|
|
background-color: rgb(var(--primary-6));
|
|
|
color: #fff;
|
|
|
- padding: 5px 15px;
|
|
|
- border-radius: 15px;
|
|
|
+ /* padding: 5px 15px; */
|
|
|
+ /* border-radius: 15px; */
|
|
|
font-size: 14px;
|
|
|
+
|
|
|
+ width: 73px;
|
|
|
+ height: 31px;
|
|
|
+ border-radius: 40px;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 31px;
|
|
|
+}
|
|
|
+</style>
|
|
|
+
|
|
|
+<style>
|
|
|
+.arco-switch.arco-switch-type-circle.arco-switch-checked.chat-connect-network-switch {
|
|
|
+ background-color: var(--color-fill-2);
|
|
|
+}
|
|
|
+
|
|
|
+.arco-switch.arco-switch-type-circle.arco-switch-checked.chat-connect-network-switch .arco-switch-handle {
|
|
|
+ background-color: rgb(var(--primary-6));
|
|
|
}
|
|
|
</style>
|