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>
@include app('textarea') {
min-height: 108px;
.stop {
width: 100px;
height: 30px;

1
src/utils/axios/index.ts

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

2
src/views/conversation/index.vue

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

16
src/views/repository/index.vue

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

6
src/views/role/index.vue

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

6
src/views/textToImage/index.vue

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

22
src/views/visualAnalysis/index.vue

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

Loading…
Cancel
Save