Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f3777f63
authored
Jul 07, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码优化】AI:将对话、聊天挪到 index 目录下,更模块化
parent
4acd379d
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
27 additions
and
12 deletions
+27
-12
src/views/ai/chat/index/ChatEmpty.vue
+0
-0
src/views/ai/chat/index/Conversation.vue
+1
-1
src/views/ai/chat/index/Message.vue
+0
-0
src/views/ai/chat/index/MessageLoading.vue
+0
-0
src/views/ai/chat/index/MessageNewChat.vue
+0
-0
src/views/ai/chat/index/components/ChatConversationUpdateForm.vue
+0
-0
src/views/ai/chat/index/components/Header.vue
+0
-0
src/views/ai/chat/index/index.vue
+1
-1
src/views/ai/chat/index/role/RoleCategoryList.vue
+0
-0
src/views/ai/chat/index/role/RoleList.vue
+0
-0
src/views/ai/chat/index/role/index.vue
+1
-1
src/views/ai/image/index/ImageDetailDrawer.vue
+0
-0
src/views/ai/image/index/ImageTask.vue
+0
-0
src/views/ai/image/index/ImageTaskCard.vue
+0
-0
src/views/ai/image/index/dall3/index.vue
+0
-0
src/views/ai/image/index/index.vue
+0
-0
src/views/ai/image/index/midjourney/index.vue
+0
-0
src/views/ai/image/index/stable-diffusion/index.vue
+24
-9
src/views/ai/utils/utils.ts
+0
-0
No files found.
src/views/ai/chat/ChatEmpty.vue
→
src/views/ai/chat/
index/
ChatEmpty.vue
View file @
f3777f63
File moved
src/views/ai/chat/Conversation.vue
→
src/views/ai/chat/
index/
Conversation.vue
View file @
f3777f63
...
@@ -98,7 +98,7 @@
...
@@ -98,7 +98,7 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ChatConversationApi
,
ChatConversationVO
}
from
'@/api/ai/chat/conversation'
import
{
ChatConversationApi
,
ChatConversationVO
}
from
'@/api/ai/chat/conversation'
import
{
ref
}
from
'vue'
import
{
ref
}
from
'vue'
import
Role
from
'
@/views/ai/chat
/role/index.vue'
import
Role
from
'
.
/role/index.vue'
import
{
Bottom
,
Top
}
from
'@element-plus/icons-vue'
import
{
Bottom
,
Top
}
from
'@element-plus/icons-vue'
import
roleAvatarDefaultImg
from
'@/assets/ai/gpt.svg'
import
roleAvatarDefaultImg
from
'@/assets/ai/gpt.svg'
...
...
src/views/ai/chat/Message.vue
→
src/views/ai/chat/
index/
Message.vue
View file @
f3777f63
File moved
src/views/ai/chat/MessageLoading.vue
→
src/views/ai/chat/
index/
MessageLoading.vue
View file @
f3777f63
File moved
src/views/ai/chat/MessageNewChat.vue
→
src/views/ai/chat/
index/
MessageNewChat.vue
View file @
f3777f63
File moved
src/views/ai/chat/components/ChatConversationUpdateForm.vue
→
src/views/ai/chat/
index/
components/ChatConversationUpdateForm.vue
View file @
f3777f63
File moved
src/views/ai/chat/components/Header.vue
→
src/views/ai/chat/
index/
components/Header.vue
View file @
f3777f63
File moved
src/views/ai/chat/index.vue
→
src/views/ai/chat/index
/index
.vue
View file @
f3777f63
...
@@ -111,7 +111,7 @@ import MessageLoading from './MessageLoading.vue'
...
@@ -111,7 +111,7 @@ import MessageLoading from './MessageLoading.vue'
import
MessageNewChat
from
'./MessageNewChat.vue'
import
MessageNewChat
from
'./MessageNewChat.vue'
import
{
ChatMessageApi
,
ChatMessageVO
}
from
'@/api/ai/chat/message'
import
{
ChatMessageApi
,
ChatMessageVO
}
from
'@/api/ai/chat/message'
import
{
ChatConversationApi
,
ChatConversationVO
}
from
'@/api/ai/chat/conversation'
import
{
ChatConversationApi
,
ChatConversationVO
}
from
'@/api/ai/chat/conversation'
import
ChatConversationUpdateForm
from
'
@/views/ai/chat
/components/ChatConversationUpdateForm.vue'
import
ChatConversationUpdateForm
from
'
.
/components/ChatConversationUpdateForm.vue'
import
{
Download
,
Top
}
from
'@element-plus/icons-vue'
import
{
Download
,
Top
}
from
'@element-plus/icons-vue'
const
route
=
useRoute
()
// 路由
const
route
=
useRoute
()
// 路由
...
...
src/views/ai/chat/role/RoleCategoryList.vue
→
src/views/ai/chat/
index/
role/RoleCategoryList.vue
View file @
f3777f63
File moved
src/views/ai/chat/role/RoleList.vue
→
src/views/ai/chat/
index/
role/RoleList.vue
View file @
f3777f63
File moved
src/views/ai/chat/role/index.vue
→
src/views/ai/chat/
index/
role/index.vue
View file @
f3777f63
...
@@ -68,7 +68,7 @@
...
@@ -68,7 +68,7 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ref
}
from
'vue'
import
{
ref
}
from
'vue'
import
Header
from
'
@/views/ai/chat
/components/Header.vue'
import
Header
from
'
./..
/components/Header.vue'
import
RoleList
from
'./RoleList.vue'
import
RoleList
from
'./RoleList.vue'
import
ChatRoleForm
from
'@/views/ai/model/chatRole/ChatRoleForm.vue'
import
ChatRoleForm
from
'@/views/ai/model/chatRole/ChatRoleForm.vue'
import
RoleCategoryList
from
'./RoleCategoryList.vue'
import
RoleCategoryList
from
'./RoleCategoryList.vue'
...
...
src/views/ai/image/ImageDetailDrawer.vue
→
src/views/ai/image/
index/
ImageDetailDrawer.vue
View file @
f3777f63
File moved
src/views/ai/image/ImageTask.vue
→
src/views/ai/image/
index/
ImageTask.vue
View file @
f3777f63
File moved
src/views/ai/image/ImageTaskCard.vue
→
src/views/ai/image/
index/
ImageTaskCard.vue
View file @
f3777f63
File moved
src/views/ai/image/dall3/index.vue
→
src/views/ai/image/
index/
dall3/index.vue
View file @
f3777f63
File moved
src/views/ai/image/index.vue
→
src/views/ai/image/index
/index
.vue
View file @
f3777f63
File moved
src/views/ai/image/midjourney/index.vue
→
src/views/ai/image/
index/
midjourney/index.vue
View file @
f3777f63
File moved
src/views/ai/image/stable-diffusion/index.vue
→
src/views/ai/image/
index/
stable-diffusion/index.vue
View file @
f3777f63
...
@@ -47,8 +47,18 @@
...
@@ -47,8 +47,18 @@
<el-text
tag=
"b"
>
CLIP
</el-text>
<el-text
tag=
"b"
>
CLIP
</el-text>
</div>
</div>
<el-space
wrap
class=
"group-item-body"
>
<el-space
wrap
class=
"group-item-body"
>
<el-select
v-model=
"selectClipGuidancePreset"
placeholder=
"Select"
size=
"large"
style=
"width: 350px"
>
<el-select
<el-option
v-for=
"item in clipGuidancePresets"
:key=
"item.key"
:label=
"item.name"
:value=
"item.key"
/>
v-model=
"selectClipGuidancePreset"
placeholder=
"Select"
size=
"large"
style=
"width: 350px"
>
<el-option
v-for=
"item in clipGuidancePresets"
:key=
"item.key"
:label=
"item.name"
:value=
"item.key"
/>
</el-select>
</el-select>
</el-space>
</el-space>
</div>
</div>
...
@@ -58,7 +68,12 @@
...
@@ -58,7 +68,12 @@
</div>
</div>
<el-space
wrap
class=
"group-item-body"
>
<el-space
wrap
class=
"group-item-body"
>
<el-select
v-model=
"selectStylePreset"
placeholder=
"Select"
size=
"large"
style=
"width: 350px"
>
<el-select
v-model=
"selectStylePreset"
placeholder=
"Select"
size=
"large"
style=
"width: 350px"
>
<el-option
v-for=
"item in stylePresets"
:key=
"item.key"
:label=
"item.name"
:value=
"item.key"
/>
<el-option
v-for=
"item in stylePresets"
:key=
"item.key"
:label=
"item.name"
:value=
"item.key"
/>
</el-select>
</el-select>
</el-space>
</el-space>
</div>
</div>
...
@@ -120,8 +135,8 @@
...
@@ -120,8 +135,8 @@
</div>
</div>
</
template
>
</
template
>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ImageApi
,
ImageDrawReqVO
,
ImageVO
}
from
'@/api/ai/image'
import
{
ImageApi
,
ImageDrawReqVO
,
ImageVO
}
from
'@/api/ai/image'
import
{
hasChinese
}
from
'../../utils/common-
utils'
import
{
hasChinese
}
from
'@/views/ai/utils/
utils'
// image 模型
// image 模型
interface
ImageModelVO
{
interface
ImageModelVO
{
...
@@ -190,7 +205,7 @@ const sampler = ref<ImageModelVO[]>([
...
@@ -190,7 +205,7 @@ const sampler = ref<ImageModelVO[]>([
{
{
key
:
'K_LMS'
,
key
:
'K_LMS'
,
name
:
'K_LMS'
name
:
'K_LMS'
}
,
}
])
])
// 风格
// 风格
...
@@ -266,7 +281,7 @@ const stylePresets = ref<ImageModelVO[]>([
...
@@ -266,7 +281,7 @@ const stylePresets = ref<ImageModelVO[]>([
{
{
key
:
'tile-texture'
,
key
:
'tile-texture'
,
name
:
'tile-texture'
name
:
'tile-texture'
}
,
}
])
])
// 文本提示相匹配的图像(clip_guidance_preset) 简称 CLIP
// 文本提示相匹配的图像(clip_guidance_preset) 简称 CLIP
...
@@ -301,7 +316,7 @@ const clipGuidancePresets = ref<ImageModelVO[]>([
...
@@ -301,7 +316,7 @@ const clipGuidancePresets = ref<ImageModelVO[]>([
{
{
key
:
'SLOWEST'
,
key
:
'SLOWEST'
,
name
:
'SLOWEST'
name
:
'SLOWEST'
}
,
}
])
])
const
steps
=
ref
<
number
>
(
20
)
// 迭代步数
const
steps
=
ref
<
number
>
(
20
)
// 迭代步数
...
@@ -352,7 +367,7 @@ const handleGenerateImage = async () => {
...
@@ -352,7 +367,7 @@ const handleGenerateImage = async () => {
scale
:
scale
.
value
,
// 引导系数
scale
:
scale
.
value
,
// 引导系数
sampler
:
selectSampler
.
value
,
// 采样算法
sampler
:
selectSampler
.
value
,
// 采样算法
clipGuidancePreset
:
selectClipGuidancePreset
.
value
,
// 文本提示相匹配的图像 CLIP
clipGuidancePreset
:
selectClipGuidancePreset
.
value
,
// 文本提示相匹配的图像 CLIP
stylePreset
:
selectStylePreset
.
value
,
// 风格
stylePreset
:
selectStylePreset
.
value
// 风格
}
}
}
as
ImageDrawReqVO
}
as
ImageDrawReqVO
await
ImageApi
.
drawImage
(
form
)
await
ImageApi
.
drawImage
(
form
)
...
...
src/views/ai/utils/
common-
utils.ts
→
src/views/ai/utils/utils.ts
View file @
f3777f63
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment