Commit f3777f63 by YunaiV

【代码优化】AI:将对话、聊天挪到 index 目录下,更模块化

parent 4acd379d
...@@ -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'
......
...@@ -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() // 路由
......
...@@ -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'
......
...@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment