Browse Source

fix:优化会话、文生图、角色、知识库、图像分析的布局;修改图像分析ui切换;

dxj
李朋徽 1 year ago
parent
commit
76747cc21d
  1. 1
      src/components/AppTextarea/index.vue
  2. 1
      src/utils/axios/index.ts
  3. 2
      src/views/conversation/index.vue
  4. 16
      src/views/repository/index.vue
  5. 6
      src/views/role/index.vue
  6. 6
      src/views/textToImage/index.vue
  7. 22
      src/views/visualAnalysis/index.vue

1
src/components/AppTextarea/index.vue

@ -101,7 +101,6 @@ function stopMessage() {
<style lang="scss" scoped> <style lang="scss" scoped>
@include app('textarea') { @include app('textarea') {
min-height: 108px;
.stop { .stop {
width: 100px; width: 100px;
height: 30px; height: 30px;

1
src/utils/axios/index.ts

@ -29,6 +29,7 @@ const notDecryptWhiteList = [
'/open-chat/chat/stopGenerate', '/open-chat/chat/stopGenerate',
'/hulk-system/hulk-resource/oss/endpoint/put-file', '/hulk-system/hulk-resource/oss/endpoint/put-file',
'/open-gpts/gpts/getQanythingStreamChat', '/open-gpts/gpts/getQanythingStreamChat',
'/open-gpts/gpts/getImageVision',
] ]
/** /**

2
src/views/conversation/index.vue

@ -454,7 +454,7 @@ onBeforeRouteLeave(() => {
<!-- 发送框 --> <!-- 发送框 -->
<AppTextarea <AppTextarea
class="pl-52 pr-32 mt-10" class="pl-44 pr-24 mt-10"
:btn-loading="sendBtnLoading" :btn-loading="sendBtnLoading"
:is-stop="false" :is-stop="false"
@send="handleSend" @send="handleSend"

16
src/views/repository/index.vue

@ -426,6 +426,7 @@ onBeforeRouteLeave(() => {
> >
</AppConversationDefault> </AppConversationDefault>
<div class="h-full flex flex-col">
<!-- 消息列表 --> <!-- 消息列表 -->
<AppMessage <AppMessage
v-if="!conversationDefaultShow && appMessageShow" v-if="!conversationDefaultShow && appMessageShow"
@ -438,16 +439,17 @@ onBeforeRouteLeave(() => {
@reload-message="reloadMessage" @reload-message="reloadMessage"
> >
</AppMessage> </AppMessage>
</Spin>
<!-- 发送框 --> <!-- 发送框 -->
<AppTextarea <AppTextarea
class="pl-52 pr-32 mt-10" class="pl-44 pr-24 mt-10"
:btn-loading="sendBtnLoading" :btn-loading="sendBtnLoading"
:is-stop="false" :is-stop="false"
@send="handleSend" @send="handleSend"
@stop-message="stopMessageFun" @stop-message="stopMessageFun"
></AppTextarea> ></AppTextarea>
</div>
</Spin>
<Modal v-model:open="fileModelShow" :footer="false"> <Modal v-model:open="fileModelShow" :footer="false">
<AppRepositoryFile></AppRepositoryFile> <AppRepositoryFile></AppRepositoryFile>
@ -459,10 +461,10 @@ onBeforeRouteLeave(() => {
<style lang="scss" scoped> <style lang="scss" scoped>
.file-box { .file-box {
position: absolute; position: absolute;
bottom: 130px; bottom: 125px;
left: 10px; left: 10px;
width: 60px; width: 55px;
height: 60px; height: 55px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
@ -473,8 +475,8 @@ onBeforeRouteLeave(() => {
border-radius: 32px; border-radius: 32px;
cursor: pointer; cursor: pointer;
.icon { .icon {
width: 22px; width: 20px;
height: 22px; height: 20px;
} }
} }
</style> </style>

6
src/views/role/index.vue

@ -426,6 +426,7 @@ onBeforeRouteLeave(() => {
> >
</AppRoleDefault> </AppRoleDefault>
<div class="h-full flex flex-col">
<!-- 消息列表 --> <!-- 消息列表 -->
<AppMessage <AppMessage
v-if="!conversationDefaultShow && appMessageShow" v-if="!conversationDefaultShow && appMessageShow"
@ -438,15 +439,16 @@ onBeforeRouteLeave(() => {
@reload-message="reloadMessage" @reload-message="reloadMessage"
> >
</AppMessage> </AppMessage>
</Spin>
<!-- 发送框 --> <!-- 发送框 -->
<AppTextarea <AppTextarea
v-if="!conversationDefaultShow" v-if="!conversationDefaultShow"
class="pl-52 pr-32 mt-10" class="pl-44 pr-24 mt-10"
:btn-loading="sendBtnLoading" :btn-loading="sendBtnLoading"
@send="handleSend" @send="handleSend"
></AppTextarea> ></AppTextarea>
</div>
</Spin>
</template> </template>
</AppContainerBox> </AppContainerBox>
</template> </template>

6
src/views/textToImage/index.vue

@ -386,6 +386,7 @@ onBeforeRouteLeave(() => {
> >
</AppConversationDefault> </AppConversationDefault>
<div class="h-full flex flex-col">
<!-- 消息列表 --> <!-- 消息列表 -->
<AppMessage <AppMessage
v-if="!conversationDefaultShow && appMessageShow" v-if="!conversationDefaultShow && appMessageShow"
@ -398,14 +399,15 @@ onBeforeRouteLeave(() => {
@reload-message="reloadMessage" @reload-message="reloadMessage"
> >
</AppMessage> </AppMessage>
</Spin>
<!-- 发送框 --> <!-- 发送框 -->
<AppTextarea <AppTextarea
class="pl-52 pr-32 mt-10" class="pl-44 pr-24 mt-10"
:btn-loading="sendBtnLoading" :btn-loading="sendBtnLoading"
@send="handleSend" @send="handleSend"
></AppTextarea> ></AppTextarea>
</div>
</Spin>
</template> </template>
</AppContainerBox> </AppContainerBox>
</template> </template>

22
src/views/visualAnalysis/index.vue

@ -2,7 +2,6 @@
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue' import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
import { onBeforeRouteLeave } from 'vue-router' import { onBeforeRouteLeave } from 'vue-router'
import { Button, Image, Spin, UploadDragger, message } from 'ant-design-vue' import { Button, Image, Spin, UploadDragger, message } from 'ant-design-vue'
import type { UploadChangeParam, UploadProps } from 'ant-design-vue'
import { SvgIcon } from '@/components/SvgIcon' import { SvgIcon } from '@/components/SvgIcon'
import { AppTextarea } from '@/components/AppTextarea' import { AppTextarea } from '@/components/AppTextarea'
import { AppContainerBox } from '@/components/AppContainerBox' import { AppContainerBox } from '@/components/AppContainerBox'
@ -141,6 +140,7 @@ async function handleSubMenuChange(index: number, item?: SubMenuItem) {
// item // item
if (item) { if (item) {
getHistoryMessage() getHistoryMessage()
fileList.value = []
} }
} }
@ -176,6 +176,7 @@ async function handleSend(value: string) {
return return
} }
sendMessage(conversationData.value.id, value) sendMessage(conversationData.value.id, value)
fileList.value = []
} }
} }
@ -260,7 +261,7 @@ async function sendMessage(conversationId: string, question: string): Promise<vo
messageStore.setMessageStatus(MessageStatusEnum.LOADING) messageStore.setMessageStatus(MessageStatusEnum.LOADING)
messageStore.setMessagePushItem({ messageStore.setMessagePushItem({
messageType: MessageTypeEnum.USER, messageType: MessageTypeEnum.USER,
content: question, content: `${question}![Picture](${fileList.value[0]})`,
time: String(new Date().getTime()), time: String(new Date().getTime()),
avatar: '', avatar: '',
}) })
@ -323,9 +324,9 @@ function handleModel(index: number) {
* @description: 图片上传前的处理 * @description: 图片上传前的处理
*/ */
function handleBeforeUpload(file: File) { function handleBeforeUpload(file: File) {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/gif'
if (!isJpgOrPng) { if (!isJpgOrPng) {
message.error('只能上传JPG、PNG格式图片!') message.error('只能上传JPG、JPEG、PNG、GIF格式图片!')
} }
const isLt10M = file.size / 1024 / 1024 < 10 const isLt10M = file.size / 1024 / 1024 < 10
if (!isLt10M) { if (!isLt10M) {
@ -435,22 +436,22 @@ onBeforeRouteLeave(() => {
> >
</AppConversationDefault> </AppConversationDefault>
<div class="h-full flex flex-col">
<!-- 消息列表 --> <!-- 消息列表 -->
<AppMessage <AppMessage
v-if="!conversationDefaultShow && appMessageShow" v-if="!conversationDefaultShow && appMessageShow"
ref="appMessageRef" ref="appMessageRef"
class="pl-27 pr-5" class="pl-27 pr-5"
height="calc(100% - 160px)" height="calc(100% - 200px)"
:el-index="elIndex" :el-index="elIndex"
:list="messageList" :list="messageList"
@on-scroll-top="onScrollTop" @on-scroll-top="onScrollTop"
@reload-message="reloadMessage" @reload-message="reloadMessage"
> >
</AppMessage> </AppMessage>
</Spin>
<!-- 发送框 --> <!-- 发送框 -->
<div v-if="!fileList.length" class="upload-box absolute right-0 bottom-5 pl-52 pr-32 mt-10s w-full"> <div v-if="!fileList.length" class="upload-box absolute right-0 bottom-5 pl-44 pr-24 mt-10s w-full">
<UploadDragger <UploadDragger
name="file" name="file"
:multiple="false" :multiple="false"
@ -472,8 +473,7 @@ onBeforeRouteLeave(() => {
v-else v-else
class="w-full" class="w-full"
> >
<div class="absolute left-0 bottom-35 pl-52 pr-32 mt-10 "> <div class="pl-44 pr-24 mt-2">
已上传图片
<Image <Image
class="rounded" class="rounded"
:width="60" :width="60"
@ -483,11 +483,13 @@ onBeforeRouteLeave(() => {
></Image> ></Image>
</div> </div>
<AppTextarea <AppTextarea
class="pl-52 pr-32 mt-10 " class="pl-44 pr-24 mt-2"
:btn-loading="sendBtnLoading" :btn-loading="sendBtnLoading"
@send="handleSend" @send="handleSend"
></AppTextarea> ></AppTextarea>
</div> </div>
</div>
</Spin>
</template> </template>
</AppContainerBox> </AppContainerBox>
</template> </template>

Loading…
Cancel
Save