Skip to content

Commit 4e08fae

Browse files
feat: 应用对话显示应用图标
feat: 应用对话显示应用图标
2 parents 6de62d9 + 08cd3c9 commit 4e08fae

File tree

5 files changed

+115
-15
lines changed

5 files changed

+115
-15
lines changed

ui/src/views/application-workflow/index.vue

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,29 @@
5858
>
5959
<div class="workflow-debug-header" :class="!isDefaultTheme ? 'custom-header' : ''">
6060
<div class="flex-between">
61-
<h4 class="ml-24">
62-
{{ detail?.name || $t('views.application.applicationForm.form.appName.label') }}
63-
</h4>
61+
<div class="flex align-center">
62+
<div class="mr-12 ml-24">
63+
<AppAvatar
64+
v-if="isAppIcon(detail?.icon)"
65+
shape="square"
66+
:size="32"
67+
style="background: none"
68+
>
69+
<img :src="detail?.icon" alt="" />
70+
</AppAvatar>
71+
<AppAvatar
72+
v-else-if="detail?.name"
73+
:name="detail?.name"
74+
pinyinColor
75+
shape="square"
76+
:size="32"
77+
/>
78+
</div>
79+
80+
<h4>
81+
{{ detail?.name || $t('views.application.applicationForm.form.appName.label') }}
82+
</h4>
83+
</div>
6484
<div class="mr-16">
6585
<el-button link @click="enlarge = !enlarge">
6686
<AppIcon
@@ -89,6 +109,7 @@ import Workflow from '@/workflow/index.vue'
89109
import { menuNodes } from '@/workflow/common/data'
90110
import { iconComponent } from '@/workflow/icons/utils'
91111
import applicationApi from '@/api/application'
112+
import { isAppIcon } from '@/utils/application'
92113
import { MsgSuccess, MsgConfirm, MsgError } from '@/utils/message'
93114
import { datetimeFormat } from '@/utils/time'
94115
import useStore from '@/stores'

ui/src/views/application/ApplicationSetting.vue

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,31 @@
273273
{{ $t('views.application.applicationForm.form.apptest') }}
274274
</h4>
275275
<div class="dialog-bg">
276-
<h4 class="p-24">
277-
{{
278-
applicationForm?.name || $t('views.application.applicationForm.form.appName.label')
279-
}}
280-
</h4>
276+
<div class="flex align-center p-24">
277+
<div class="mr-12">
278+
<AppAvatar
279+
v-if="isAppIcon(applicationForm?.icon)"
280+
shape="square"
281+
:size="32"
282+
style="background: none"
283+
>
284+
<img :src="applicationForm?.icon" alt="" />
285+
</AppAvatar>
286+
<AppAvatar
287+
v-else-if="applicationForm?.name"
288+
:name="applicationForm?.name"
289+
pinyinColor
290+
shape="square"
291+
:size="32"
292+
/>
293+
</div>
294+
295+
<h4>
296+
{{
297+
applicationForm?.name || $t('views.application.applicationForm.form.appName.label')
298+
}}
299+
</h4>
300+
</div>
281301
<div class="scrollbar-height">
282302
<AiChat :data="applicationForm"></AiChat>
283303
</div>
@@ -312,6 +332,7 @@ import AddDatasetDialog from './component/AddDatasetDialog.vue'
312332
import CreateModelDialog from '@/views/template/component/CreateModelDialog.vue'
313333
import SelectProviderDialog from '@/views/template/component/SelectProviderDialog.vue'
314334
import applicationApi from '@/api/application'
335+
import { isAppIcon } from '@/utils/application'
315336
import type { FormInstance, FormRules } from 'element-plus'
316337
import type { ApplicationFormType } from '@/api/type/application'
317338
import type { Provider } from '@/api/type/model'

ui/src/views/chat/base/index.vue

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
11
<template>
22
<div class="chat layout-bg" v-loading="loading">
33
<div class="chat__header" :class="!isDefaultTheme ? 'custom-header' : ''">
4-
<div class="chat-width">
5-
<h2 class="ml-24">{{ applicationDetail?.name }}</h2>
4+
<div class="chat-width flex align-center">
5+
<div class="mr-12 ml-24">
6+
<AppAvatar
7+
v-if="isAppIcon(applicationDetail?.icon)"
8+
shape="square"
9+
:size="32"
10+
style="background: none"
11+
>
12+
<img :src="applicationDetail?.icon" alt="" />
13+
</AppAvatar>
14+
<AppAvatar
15+
v-else-if="applicationDetail?.name"
16+
:name="applicationDetail?.name"
17+
pinyinColor
18+
shape="square"
19+
:size="32"
20+
/>
21+
</div>
22+
23+
<h2>{{ applicationDetail?.name }}</h2>
624
</div>
725
</div>
826
<div class="chat__main chat-width">
@@ -18,6 +36,7 @@
1836
<script setup lang="ts">
1937
import { ref, onMounted, computed } from 'vue'
2038
import { useRoute } from 'vue-router'
39+
import { isAppIcon } from '@/utils/application'
2140
import useStore from '@/stores'
2241
const route = useRoute()
2342
const {

ui/src/views/chat/embed/index.vue

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
11
<template>
22
<div class="chat-embed layout-bg" v-loading="loading">
33
<div class="chat-embed__header" :class="!isDefaultTheme ? 'custom-header' : ''">
4-
<div class="chat-width">
5-
<h4 class="ml-24">{{ applicationDetail?.name }}</h4>
4+
<div class="chat-width flex align-center">
5+
<div class="mr-12 ml-24">
6+
<AppAvatar
7+
v-if="isAppIcon(applicationDetail?.icon)"
8+
shape="square"
9+
:size="32"
10+
style="background: none"
11+
>
12+
<img :src="applicationDetail?.icon" alt="" />
13+
</AppAvatar>
14+
<AppAvatar
15+
v-else-if="applicationDetail?.name"
16+
:name="applicationDetail?.name"
17+
pinyinColor
18+
shape="square"
19+
:size="32"
20+
/>
21+
</div>
22+
23+
<h4>{{ applicationDetail?.name }}</h4>
624
</div>
725
</div>
826
<div class="chat-embed__main">
@@ -81,6 +99,7 @@
8199
<script setup lang="ts">
82100
import { ref, onMounted, reactive, nextTick, computed } from 'vue'
83101
import { useRoute } from 'vue-router'
102+
import { isAppIcon } from '@/utils/application'
84103
import useStore from '@/stores'
85104
const route = useRoute()
86105
const {

ui/src/views/chat/pc/index.vue

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
11
<template>
22
<div class="chat-pc layout-bg" :class="classObj" v-loading="loading">
33
<div class="chat-pc__header" :class="!isDefaultTheme ? 'custom-header' : ''">
4-
<h4 class="ml-24">{{ applicationDetail?.name }}</h4>
4+
<div class="flex align-center">
5+
<div class="mr-12 ml-24">
6+
<AppAvatar
7+
v-if="isAppIcon(applicationDetail?.icon)"
8+
shape="square"
9+
:size="32"
10+
style="background: none"
11+
>
12+
<img :src="applicationDetail?.icon" alt="" />
13+
</AppAvatar>
14+
<AppAvatar
15+
v-else-if="applicationDetail?.name"
16+
:name="applicationDetail?.name"
17+
pinyinColor
18+
shape="square"
19+
:size="32"
20+
/>
21+
</div>
22+
23+
<h4>{{ applicationDetail?.name }}</h4>
24+
</div>
525
</div>
626
<div class="flex">
727
<div class="chat-pc__left border-r">
@@ -108,6 +128,7 @@ import { reactive, ref, onMounted, nextTick, computed } from 'vue'
108128
import { useRoute } from 'vue-router'
109129
import { marked } from 'marked'
110130
import { saveAs } from 'file-saver'
131+
import { isAppIcon } from '@/utils/application'
111132
import useStore from '@/stores'
112133
113134
import useResize from '@/layout/hooks/useResize'
@@ -204,10 +225,9 @@ function getAppProfile() {
204225
.asyncGetAppProfile(loading)
205226
.then((res: any) => {
206227
applicationDetail.value = res.data
207-
if (res.data?.show_history) {
228+
if (res.data?.show_history) {
208229
getChatLog(applicationDetail.value.id)
209230
}
210-
211231
})
212232
.catch(() => {
213233
applicationAvailable.value = false

0 commit comments

Comments
 (0)