diff --git a/index.html b/index.html
index e988787d..b3f185e4 100644
--- a/index.html
+++ b/index.html
@@ -7,7 +7,7 @@
HuLa
-
+
diff --git a/src/hooks/useChatMain.ts b/src/hooks/useChatMain.ts
index 9ba343e3..23ee90bd 100644
--- a/src/hooks/useChatMain.ts
+++ b/src/hooks/useChatMain.ts
@@ -115,7 +115,7 @@ export const useChatMain = (activeItem?: SessionItem) => {
...commonMenuList.value,
{
label: '另存为',
- icon: 'download',
+ icon: 'Importing',
click: (item: any) => {
console.log(item)
}
@@ -142,7 +142,7 @@ export const useChatMain = (activeItem?: SessionItem) => {
...commonMenuList.value,
{
label: '另存为',
- icon: 'download',
+ icon: 'Importing',
click: (item: any) => {
console.log(item)
}
diff --git a/src/hooks/useMsgInput.ts b/src/hooks/useMsgInput.ts
index 798947f5..941d8fde 100644
--- a/src/hooks/useMsgInput.ts
+++ b/src/hooks/useMsgInput.ts
@@ -72,7 +72,7 @@ export const useMsgInput = (messageInputDom: Ref) => {
})
}
},
- { label: '另存为', icon: 'download', disabled: true },
+ { label: '另存为', icon: 'Importing', disabled: true },
{ label: '全部选择', icon: 'check-one' }
])
diff --git a/src/router/index.ts b/src/router/index.ts
index 1f8ff446..049b51c0 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -46,6 +46,11 @@ const routes: Array = [
name: 'robot',
component: () => import('@/views/home-window/robot/index.vue'),
children: [
+ {
+ path: '/welcome',
+ name: 'welcome',
+ component: () => import('@/views/home-window/robot/views/Welcome.vue')
+ },
{
path: '/chat',
name: 'chat',
diff --git a/src/styles/scss/chat-main.scss b/src/styles/scss/chat-main.scss
index 6d008e18..63ce38a3 100644
--- a/src/styles/scss/chat-main.scss
+++ b/src/styles/scss/chat-main.scss
@@ -75,7 +75,7 @@
}
/** emoji回复气泡的样式 */
.emoji-reply-bubble {
- @apply relative rounded-50px p-[4px_8px] cursor-pointer select-none bg-#13987F66 text-14px w-fit border-(1px solid #13987F);
+ @apply relative rounded-50px p-[4px_8px] cursor-pointer select-none bg-#13987F66 text-14px w-fit border-(1px solid #13987F) shadow-md;
}
/** 跳转到回复内容时候显示的样式 */
.active-reply {
diff --git a/src/views/home-window/robot/layout/Left.vue b/src/views/home-window/robot/layout/Left.vue
index c1829139..7f39bedf 100644
--- a/src/views/home-window/robot/layout/Left.vue
+++ b/src/views/home-window/robot/layout/Left.vue
@@ -199,6 +199,26 @@ const add = () => {
const deleteChat = (item: any) => {
// 根据key找到items中对应的下标
const index = chatList.value.indexOf(item)
+
+ /**
+ * 删除最后一个元素后触发新增元素的函数
+ * @param isActive 是否选中新增的元素
+ */
+ function triggeringAdd(isActive?: boolean) {
+ if (chatList.value.length === 0) {
+ nextTick(() => {
+ add()
+ // 选择新增的元素
+ if (isActive) {
+ handleActive(chatList.value[0])
+ window.$message.success(`已删除 ${item.title}`, {
+ icon: () => h(NIcon, null, { default: () => h('svg', null, [h('use', { href: '#face' })]) })
+ })
+ }
+ })
+ }
+ }
+
// 如果找到了对应的元素,则移除
if (index !== -1) {
const removeItem = chatList.value.splice(index, 1)[0]
@@ -208,22 +228,15 @@ const deleteChat = (item: any) => {
activeItem.value = chatList.value[index].id
handleActive(chatList.value[index])
} else {
- // 如果是最后一个元素则触发新增
- if (chatList.value.length === 0) {
- nextTick(() => {
- add()
- // 选择新增的元素
- handleActive(chatList.value[0])
- window.$message.success(`已删除 ${item.title}`, {
- icon: () => h(NIcon, null, { default: () => h('svg', null, [h('use', { href: '#face' })]) })
- })
- })
- }
+ // 如果选中chatList,并且是最后一个元素则触发新增
+ triggeringAdd(true)
// 如果我们删除的是最后一个元素,则需要选中前一个元素
activeItem.value = chatList.value[chatList.value.length - 1].id
handleActive(chatList.value[chatList.value.length - 1])
}
}
+ // 如果是最后一个元素则触发新增
+ triggeringAdd()
window.$message.success(`已删除 ${item.title}`, {
icon: () => h(NIcon, null, { default: () => h('svg', null, [h('use', { href: '#face' })]) })
})
@@ -231,8 +244,10 @@ const deleteChat = (item: any) => {
}
onMounted(() => {
- /** 默认选择第一个聊天内容 */
- handleActive(chatList.value[0])
+ // /** 默认选择第一个聊天内容 */
+ // handleActive(chatList.value[0])
+ /** 刚加载的时候默认跳转到欢迎页面 */
+ router.push('/welcome')
Mitt.on('update-chat-title', (e) => {
chatList.value.filter((item) => {
if (item.id === e.id) {
diff --git a/src/views/home-window/robot/views/Chat.vue b/src/views/home-window/robot/views/Chat.vue
index c11f1dc2..5692ee75 100644
--- a/src/views/home-window/robot/views/Chat.vue
+++ b/src/views/home-window/robot/views/Chat.vue
@@ -1,5 +1,6 @@
+
diff --git a/src/views/home-window/robot/views/Welcome.vue b/src/views/home-window/robot/views/Welcome.vue
new file mode 100644
index 00000000..b9deb549
--- /dev/null
+++ b/src/views/home-window/robot/views/Welcome.vue
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+ 你可以尝试使用以下功能:
+
+
+ {{ item.title }}
+
+
+
+
+
+
+
+
+
diff --git a/src/views/home-window/robot/views/chatSettings/config.tsx b/src/views/home-window/robot/views/chatSettings/config.tsx
index 71576fa7..42ea24cc 100644
--- a/src/views/home-window/robot/views/chatSettings/config.tsx
+++ b/src/views/home-window/robot/views/chatSettings/config.tsx
@@ -1,35 +1,46 @@
import pkg from '~/package.json'
-import { Button, Select, Slider, Switch } from './model.tsx'
+import { Button, Select, Slider, Switch, Input, InputNumber } from './model.tsx'
+import { NFlex } from 'naive-ui'
+type ConfigItemType = 'system' | 'record' | 'identity' | 'cueWords' | 'APIAddress' | 'model' | 'clear'
type ChatConfig = {
- system: {
+ [key in ConfigItemType]: {
title: string
description?: string
features: JSX.Element
}[]
}
+/** chat 设置面板配置 */
export const content: ChatConfig = {
system: [
{
title: `当前版本:${pkg.version}`,
description: '已是最新版本',
- features: Button('检查更新', 'refresh')
+ features:
},
{
title: '发送键',
- features: Select([
- { label: 'Enter', value: 'Enter' },
- { label: 'Ctrl + Enter', value: 'Ctrl+Enter' }
- ])
+ features: (
+
+ )
},
{
title: '主题',
- features: Select([
- { label: '亮色', value: 'light' },
- { label: '暗黑模式', value: 'dark' },
- { label: '跟随系统', value: 'auto' }
- ])
+ features: (
+
+ )
},
{
title: '字体大小',
@@ -39,7 +50,150 @@ export const content: ChatConfig = {
{
title: '自动生成标题',
description: '根据对话内容生成合适的标题',
- features: Switch()
+ features:
+ }
+ ],
+ record: [
+ {
+ title: '云端数据',
+ description: '还没有进行同步',
+ features:
+ },
+ {
+ title: '本地数据',
+ description: '1 次对话,0条消息,0条提示词,0个身份',
+ features: (
+
+
+
+
+ )
+ }
+ ],
+ identity: [
+ {
+ title: '身份启动页',
+ description: '新建聊天时,展示身份启动页',
+ features:
+ },
+ {
+ title: '隐藏内置身份',
+ description: '在所有身份列表中隐藏内置身份',
+ features:
+ }
+ ],
+ cueWords: [
+ {
+ title: '禁用提示词自动补全',
+ description: '在输入框开头输入/即可触发自动补全',
+ features:
+ },
+ {
+ title: '自定义提示词列表',
+ description: '内置 285 条,用户定义0条',
+ features:
+ }
+ ],
+ APIAddress: [
+ {
+ title: '模型服务商',
+ description: '切换不同的服务商',
+ features: (
+
+ )
+ },
+ {
+ title: '接口地址',
+ description: '除默认地址外,必须包含 http(s)://',
+ features:
+ },
+ {
+ title: 'API Key',
+ description: '使用自定义 OpenAI key 统过密码访问限制',
+ features:
+ }
+ ],
+ model: [
+ {
+ title: '模型(model)',
+ features: (
+
+ )
+ },
+ {
+ title: '随机性(temperature)',
+ description: '值越大,回复越随机',
+ features:
+ },
+ {
+ title: '核采样(top_p)',
+ description: '与随机性类似,但不要和随机性一起更改',
+ features:
+ },
+ {
+ title: '单次回复限制(max_tokens)',
+ description: '单次交互所用的最大 Token 数',
+ features:
+ },
+ {
+ title: '话题新鲜度(presence_penalty)',
+ description: '值越大,越有可能扩展到新话题',
+ features:
+ },
+ {
+ title: '频率惩罚度(frequency_penalty)',
+ description: '值越大,越有可能降低重复字词',
+ features:
+ },
+ {
+ title: '注入系统级提示信息',
+ description: '强制给每次请求的消息列表开头添加一个模拟 ChatGPT 的系统提示',
+ features:
+ },
+ {
+ title: '用户输入预处理',
+ description: '用户最新的一条消息会埴充到此模板',
+ features:
+ },
+ {
+ title: '附带历史消息数',
+ description: '每次请求携带的历史消息数',
+ features:
+ },
+ {
+ title: '历史消息长度压缩阈值',
+ description: '当未压缩的历史消息超过该值时,将进行压缩',
+ features:
+ },
+ {
+ title: '历史摘要',
+ description: '自动压缩聊天记录并作为上下文发送',
+ features:
+ }
+ ],
+ clear: [
+ {
+ title: '重置所有设置',
+ description: '重置所有设置项回默认值',
+ features:
+ },
+ {
+ title: '清除所有数据',
+ description: '清除所有聊天、设置数据',
+ features:
}
]
}
diff --git a/src/views/home-window/robot/views/chatSettings/index.vue b/src/views/home-window/robot/views/chatSettings/index.vue
index 821f5411..252fd032 100644
--- a/src/views/home-window/robot/views/chatSettings/index.vue
+++ b/src/views/home-window/robot/views/chatSettings/index.vue
@@ -14,24 +14,28 @@
-
-
-
-
-
- {{ item.title }}
- {{ item.description }}
+
+
+
+
+
+
+
+ {{ item.title }}
+ {{ item.description }}
+
+
+
+
+
+
-
-
-
-
-
+
-
+