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

pull/473/head
YunaiV 2024-07-07 17:22:16 +08:00
parent 4acd379d50
commit f3777f6334
19 changed files with 27 additions and 12 deletions

View File

@ -98,7 +98,7 @@
<script setup lang="ts">
import { ChatConversationApi, ChatConversationVO } from '@/api/ai/chat/conversation'
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 roleAvatarDefaultImg from '@/assets/ai/gpt.svg'

View File

@ -111,7 +111,7 @@ import MessageLoading from './MessageLoading.vue'
import MessageNewChat from './MessageNewChat.vue'
import { ChatMessageApi, ChatMessageVO } from '@/api/ai/chat/message'
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'
const route = useRoute() //

View File

@ -68,7 +68,7 @@
<script setup lang="ts">
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 ChatRoleForm from '@/views/ai/model/chatRole/ChatRoleForm.vue'
import RoleCategoryList from './RoleCategoryList.vue'

View File

@ -47,8 +47,18 @@
<el-text tag="b">CLIP</el-text>
</div>
<el-space wrap class="group-item-body">
<el-select 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
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-space>
</div>
@ -58,7 +68,12 @@
</div>
<el-space wrap class="group-item-body">
<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-space>
</div>
@ -120,8 +135,8 @@
</div>
</template>
<script setup lang="ts">
import {ImageApi, ImageDrawReqVO, ImageVO} from '@/api/ai/image'
import {hasChinese} from '../../utils/common-utils'
import { ImageApi, ImageDrawReqVO, ImageVO } from '@/api/ai/image'
import { hasChinese } from '@/views/ai/utils/utils'
// image
interface ImageModelVO {
@ -190,7 +205,7 @@ const sampler = ref<ImageModelVO[]>([
{
key: 'K_LMS',
name: 'K_LMS'
},
}
])
//
@ -266,7 +281,7 @@ const stylePresets = ref<ImageModelVO[]>([
{
key: 'tile-texture',
name: 'tile-texture'
},
}
])
// (clip_guidance_preset) CLIP
@ -301,7 +316,7 @@ const clipGuidancePresets = ref<ImageModelVO[]>([
{
key: 'SLOWEST',
name: 'SLOWEST'
},
}
])
const steps = ref<number>(20) //
@ -352,7 +367,7 @@ const handleGenerateImage = async () => {
scale: scale.value, //
sampler: selectSampler.value, //
clipGuidancePreset: selectClipGuidancePreset.value, // CLIP
stylePreset: selectStylePreset.value, //
stylePreset: selectStylePreset.value //
}
} as ImageDrawReqVO
await ImageApi.drawImage(form)