Merge branch 'main' of http://18.167.251.121:10003/aidlab/FiDA_Front
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 212 B After Width: | Height: | Size: 271 B |
@@ -132,7 +132,7 @@ export default {
|
|||||||
confirm: 'Confirm',
|
confirm: 'Confirm',
|
||||||
styleTitle: 'Settings',
|
styleTitle: 'Settings',
|
||||||
createProject: 'Create Project',
|
createProject: 'Create Project',
|
||||||
trendingReport: 'Trending Report'
|
trendingReport: 'Trending report'
|
||||||
},
|
},
|
||||||
area: {
|
area: {
|
||||||
unitedStates: 'United States',
|
unitedStates: 'United States',
|
||||||
|
|||||||
@@ -101,7 +101,8 @@
|
|||||||
}
|
}
|
||||||
handleSendMessage({
|
handleSendMessage({
|
||||||
text: initialData.text,
|
text: initialData.text,
|
||||||
images: initialData.images
|
images: initialData.images,
|
||||||
|
tempImages: initialData.tempImages
|
||||||
})
|
})
|
||||||
// 更新 configParams
|
// 更新 configParams
|
||||||
|
|
||||||
@@ -438,7 +439,8 @@
|
|||||||
.agent-container {
|
.agent-container {
|
||||||
// width: 39%;
|
// width: 39%;
|
||||||
// width: 63.4rem;
|
// width: 63.4rem;
|
||||||
flex: 1;
|
// flex: 1;
|
||||||
|
width: 634px;
|
||||||
margin-right: 2.7rem;
|
margin-right: 2.7rem;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 2rem;
|
border-radius: 2rem;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<div class="message-txt markdown-body">
|
<div class="message-txt markdown-body">
|
||||||
<div v-html="formatMessage"></div>
|
<div v-html="formatMessage"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="operate flex" :class="{ 'is-user': content.isUser }">
|
<div class="operate flex" v-show="isLast" :class="{ 'is-user': content.isUser }">
|
||||||
<template v-if="content.isUser">
|
<template v-if="content.isUser">
|
||||||
<SvgIcon name="copy" size="16" color="#000" @click.stop="handleCopyText" />
|
<SvgIcon name="copy" size="16" color="#000" @click.stop="handleCopyText" />
|
||||||
</template>
|
</template>
|
||||||
@@ -82,6 +82,7 @@
|
|||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
content: Object
|
content: Object
|
||||||
|
isLast: Boolean
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const imageList = computed(() => {
|
const imageList = computed(() => {
|
||||||
@@ -135,24 +136,47 @@
|
|||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
const handleCopyText = () => {
|
const handleCopyText = () => {
|
||||||
navigator.clipboard
|
const text = props.content.text
|
||||||
.writeText(props.content.text)
|
if (navigator.clipboard) {
|
||||||
.then(() => {
|
navigator.clipboard
|
||||||
// console.log('Text copied to clipboard');
|
.writeText(props.content.text)
|
||||||
ElMessage({
|
.then(() => {
|
||||||
message: t('agent.copySuccess'),
|
// console.log('Text copied to clipboard');
|
||||||
type: 'success',
|
ElMessage({
|
||||||
offset: 300
|
message: t('agent.copySuccess'),
|
||||||
|
type: 'success',
|
||||||
|
offset: 300
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
.catch((err) => {
|
||||||
.catch((err) => {
|
console.error('Could not copy text: ', err)
|
||||||
console.error('Could not copy text: ', err)
|
ElMessage({
|
||||||
ElMessage({
|
message: t('agent.copyFailed'),
|
||||||
message: t('agent.copyFailed'),
|
type: 'error',
|
||||||
type: 'error',
|
offset: 300
|
||||||
offset: 300
|
})
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
var textarea = document.createElement('textarea')
|
||||||
|
document.body.appendChild(textarea)
|
||||||
|
// 隐藏此输入框
|
||||||
|
textarea.style.position = 'fixed'
|
||||||
|
textarea.style.clip = 'rect(0 0 0 0)'
|
||||||
|
textarea.style.top = '10px'
|
||||||
|
// 赋值
|
||||||
|
textarea.value = text
|
||||||
|
// 选中
|
||||||
|
textarea.select()
|
||||||
|
// 复制
|
||||||
|
document.execCommand('copy', true)
|
||||||
|
// 移除输入框
|
||||||
|
document.body.removeChild(textarea)
|
||||||
|
ElMessage({
|
||||||
|
message: t('agent.copySuccess'),
|
||||||
|
type: 'success',
|
||||||
|
offset: 300
|
||||||
})
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const toggleThinkingCollapsed = () => {
|
const toggleThinkingCollapsed = () => {
|
||||||
@@ -186,6 +210,8 @@
|
|||||||
height: 4.4rem;
|
height: 4.4rem;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: 0.1rem solid #e5dfdf;
|
border: 0.1rem solid #e5dfdf;
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
.thumb-icon {
|
.thumb-icon {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -218,7 +244,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.loading-gif {
|
.loading-gif {
|
||||||
width: 13.7rem;
|
// width: 18.7rem;
|
||||||
|
height: 10rem;
|
||||||
|
position: relative;
|
||||||
|
margin-left: -2.4rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.thinking {
|
.thinking {
|
||||||
@@ -247,6 +276,7 @@
|
|||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
.message-txt {
|
.message-txt {
|
||||||
|
user-select: text;
|
||||||
ul {
|
ul {
|
||||||
list-style-position: inside;
|
list-style-position: inside;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="agent-list flex flex-col flex-1" ref="listContainer">
|
<div class="agent-list flex flex-col flex-1" ref="listContainer">
|
||||||
<Item v-for="message in messageList" :key="message.id" :content="message" @regenerate="$emit('regenerate', message)" />
|
<Item
|
||||||
|
v-for="(message, index) in messageList"
|
||||||
|
:key="message.id"
|
||||||
|
:content="message"
|
||||||
|
:is-last="index === messageList.length - 1"
|
||||||
|
@regenerate="$emit('regenerate', message)"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -9,8 +15,8 @@
|
|||||||
import Item from './Item.vue'
|
import Item from './Item.vue'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
messageList: Array<any>
|
messageList: Array<any>
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const emit = defineEmits(['regenerate'])
|
const emit = defineEmits(['regenerate'])
|
||||||
|
|
||||||
@@ -24,9 +30,13 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(() => props.messageList, () => {
|
watch(
|
||||||
scrollToBottom()
|
() => props.messageList,
|
||||||
}, { deep: true })
|
() => {
|
||||||
|
scrollToBottom()
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
)
|
||||||
|
|
||||||
defineExpose({ scrollToBottom })
|
defineExpose({ scrollToBottom })
|
||||||
</script>
|
</script>
|
||||||
@@ -34,10 +44,10 @@
|
|||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.agent-list {
|
.agent-list {
|
||||||
row-gap: 3.2rem;
|
row-gap: 3.2rem;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
// 隐藏滚动条
|
// 隐藏滚动条
|
||||||
&::-webkit-scrollbar {
|
&::-webkit-scrollbar {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -106,7 +106,8 @@
|
|||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
height: min-content;
|
height: min-content;
|
||||||
> .btn {
|
> .btn {
|
||||||
padding: 1.5rem 1.45rem;
|
padding: 0 1.45rem;
|
||||||
|
line-height: 4rem;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
border-radius: 3rem;
|
border-radius: 3rem;
|
||||||
@@ -140,7 +141,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.preview-wrapper {
|
.preview-wrapper {
|
||||||
width: 56%;
|
// width: 56%;
|
||||||
|
flex: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -717,6 +717,10 @@
|
|||||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
img {
|
||||||
|
width: 1.65rem;
|
||||||
|
height: 1.86rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.el-select {
|
.el-select {
|
||||||
width: 13.9rem;
|
width: 13.9rem;
|
||||||
@@ -728,6 +732,7 @@
|
|||||||
border: 0.1rem solid rgba(0, 0, 0, 0.1);
|
border: 0.1rem solid rgba(0, 0, 0, 0.1);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
|
min-height: initial;
|
||||||
.el-select__placeholder {
|
.el-select__placeholder {
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
@@ -876,6 +881,7 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
position: relative;
|
position: relative;
|
||||||
border: none;
|
border: none;
|
||||||
|
|
||||||
.checked-item-icon {
|
.checked-item-icon {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
@@ -889,28 +895,24 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 1.4rem;
|
border-radius: 1.4rem;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.fida-style-popover-item.is-selected {
|
|
||||||
// background-color: #e3f2fd;
|
|
||||||
border: 0.3rem solid #000;
|
|
||||||
.fida-option-label {
|
.fida-option-label {
|
||||||
background-color: none;
|
font-weight: 500;
|
||||||
|
font-size: 1.2rem;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
padding: 0.5rem;
|
||||||
|
position: absolute;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
background-color: rgba(0, 0, 0, 0.3);
|
||||||
|
border-radius: 1.4rem;
|
||||||
|
}
|
||||||
|
&.is-selected {
|
||||||
|
border: 0.3rem solid #000;
|
||||||
|
.fida-option-label {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// border-color: #2196f3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fida-style-popover-item .fida-option-label {
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 1.2rem;
|
|
||||||
color: #fff;
|
|
||||||
text-align: center;
|
|
||||||
padding: 0.5rem;
|
|
||||||
position: absolute;
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
background-color: rgba(0, 0, 0, 0.3);
|
|
||||||
border-radius: 1.4rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.fida-style-popover-footer {
|
.fida-style-popover-footer {
|
||||||
@@ -1021,7 +1023,7 @@
|
|||||||
width: 21.8rem;
|
width: 21.8rem;
|
||||||
height: 4.4rem;
|
height: 4.4rem;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
border: 0.11rem solid #0000001a;
|
border: 0.11rem solid #bfbfbf;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 1.8rem;
|
font-size: 1.8rem;
|
||||||
column-gap: 0;
|
column-gap: 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user