Skip to content

Commit 76e9983

Browse files
committed
feat(System appearance): Adjust global color to support technology blue
1 parent be00cc0 commit 76e9983

File tree

6 files changed

+80
-23
lines changed

6 files changed

+80
-23
lines changed

frontend/src/components/layout/LayoutDsl.vue

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ import icon_moments_categories_outlined from '@/assets/svg/icon_moments-categori
99
import icon_side_fold_outlined from '@/assets/svg/icon_side-fold_outlined.svg'
1010
import icon_side_expand_outlined from '@/assets/svg/icon_side-expand_outlined.svg'
1111
import { useRoute, useRouter } from 'vue-router'
12+
import { useAppearanceStoreWithOut } from '@/stores/appearance'
13+
import logo_blue from '@/assets/blue/LOGO-blue.png'
14+
import logo_fold_blue from '@/assets/blue/LOGO-head_blue.png'
15+
import { useEmitt } from '@/utils/useEmitt'
1216
1317
const router = useRouter()
1418
const collapse = ref(false)
15-
import { useEmitt } from '@/utils/useEmitt'
19+
const appearanceStore = useAppearanceStoreWithOut()
1620
1721
const handleCollapseChange = (val: any = true) => {
1822
collapse.value = val
@@ -37,8 +41,20 @@ const showSysmenu = computed(() => {
3741
<template>
3842
<div class="system-layout">
3943
<div class="left-side" :class="collapse && 'left-side-collapse'">
40-
<LOGO_fold v-if="collapse" style="margin: 0 0 6px 5px"></LOGO_fold>
41-
<LOGO v-else style="margin-bottom: 6px"></LOGO>
44+
<template v-if="appearanceStore.isBlue">
45+
<img
46+
v-if="collapse"
47+
width="30"
48+
height="30"
49+
:src="logo_fold_blue"
50+
style="margin: 0 0 6px 5px"
51+
/>
52+
<img v-else width="130" height="31" :src="logo_blue" style="margin-bottom: 6px" />
53+
</template>
54+
<template v-else>
55+
<LOGO_fold v-if="collapse" style="margin: 0 0 6px 5px"></LOGO_fold>
56+
<LOGO v-else style="margin-bottom: 6px"></LOGO>
57+
</template>
4258
<Workspace v-if="!showSysmenu" :collapse="collapse"></Workspace>
4359
<Menu :collapse="collapse"></Menu>
4460
<div class="bottom">

frontend/src/components/layout/Person.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script lang="ts" setup>
22
import { ref, computed } from 'vue'
33
import Default_avatar from '@/assets/workspace/default_avatar.png'
4+
import Default_avatar_blue from '@/assets/blue/Default-avatar_blue.png'
45
import icon_admin_outlined from '@/assets/svg/icon_admin_outlined.svg'
56
import icon_info_outlined_1 from '@/assets/svg/icon_info_outlined_1.svg'
67
import { useAppearanceStoreWithOut } from '@/stores/appearance'
@@ -89,14 +90,23 @@ const logout = () => {
8990
<el-popover trigger="click" popper-class="system-person" :placement="collapse ? 'right' : 'top'">
9091
<template #reference>
9192
<button class="person" :title="name" :class="collapse && 'collapse'">
92-
<img class="default-avatar" :src="Default_avatar" width="32px" height="32px" />
93+
<img
94+
class="default-avatar"
95+
:src="appearanceStore.isBlue ? Default_avatar_blue : Default_avatar"
96+
width="32px"
97+
height="32px"
98+
/>
9399
<span v-if="!collapse" class="name ellipsis">{{ name }}</span>
94100
</button></template
95101
>
96102
<div class="popover">
97103
<div class="popover-content">
98104
<div class="info">
99-
<img :src="Default_avatar" width="40px" height="40px" />
105+
<img
106+
:src="appearanceStore.isBlue ? Default_avatar_blue : Default_avatar"
107+
width="40px"
108+
height="40px"
109+
/>
100110
<div :title="name" class="top ellipsis">{{ name }}</div>
101111
<div :title="account" class="bottom ellipsis">{{ account }}</div>
102112
</div>

frontend/src/stores/appearance.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ export const useAppearanceStore = defineStore('appearanceStore', {
9494
getThemeColor(): string {
9595
return this.themeColor!
9696
},
97+
isBlue(): boolean {
98+
return this.themeColor! === 'blue'
99+
},
97100
getCustomColor(): string {
98101
return this.customColor!
99102
},
@@ -290,7 +293,11 @@ export const useAppearanceStore = defineStore('appearanceStore', {
290293
this.themeColor = data.themeColor
291294
this.customColor = data.customColor
292295
const currentColor =
293-
this.themeColor === 'custom' && this.customColor ? this.customColor : '#1CBA90'
296+
this.themeColor === 'custom' && this.customColor
297+
? this.customColor
298+
: this.isBlue
299+
? '#3370ff'
300+
: '#1CBA90'
294301
document.documentElement.style.setProperty('--ed-color-primary', currentColor)
295302
document.documentElement.style.setProperty('--van-blue', currentColor)
296303
document.documentElement.style.setProperty(
@@ -305,6 +312,20 @@ export const useAppearanceStore = defineStore('appearanceStore', {
305312
.mix(new colorTree('ffffff'), new colorTree(currentColor.substr(1)), { value: 15 })
306313
.toRGB()
307314
)
315+
316+
document.documentElement.style.setProperty(
317+
'--ed-color-primary-60',
318+
colorFunctions
319+
.mix(new colorTree('ffffff'), new colorTree(currentColor.substr(1)), { value: 60 })
320+
.toRGB()
321+
)
322+
323+
document.documentElement.style.setProperty(
324+
'--ed-color-primary-80',
325+
colorFunctions
326+
.mix(new colorTree('ffffff'), new colorTree(currentColor.substr(1)), { value: 80 })
327+
.toRGB()
328+
)
308329
document.documentElement.style.setProperty('--ed-color-primary-1a', `${currentColor}1a`)
309330
document.documentElement.style.setProperty('--ed-color-primary-14', `${currentColor}14`)
310331
document.documentElement.style.setProperty('--ed-color-primary-33', `${currentColor}33`)

frontend/src/views/chat/ChatListContainer.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -304,14 +304,14 @@ function onChatRenamed(chat: Chat) {
304304
font-size: 16px;
305305
font-weight: 500;
306306
307-
--ed-button-text-color: rgba(28, 186, 144, 1);
308-
--ed-button-bg-color: rgba(28, 186, 144, 0.1);
309-
--ed-button-border-color: rgba(164, 227, 211, 1);
310-
--ed-button-hover-bg-color: rgba(210, 241, 233, 1);
311-
--ed-button-hover-text-color: rgba(28, 186, 144, 1);
312-
--ed-button-hover-border-color: rgba(28, 186, 144, 1);
313-
--ed-button-active-bg-color: rgba(164, 227, 211, 1);
314-
--ed-button-active-border-color: rgba(28, 186, 144, 1);
307+
--ed-button-text-color: var(--ed-color-primary, rgba(28, 186, 144, 1));
308+
--ed-button-bg-color: var(--ed-color-primary-1a, #1cba901a);
309+
--ed-button-border-color: var(--ed-color-primary-60, #a4e3d3);
310+
--ed-button-hover-bg-color: var(--ed-color-primary-80, #d2f1e9);
311+
--ed-button-hover-text-color: var(--ed-color-primary, rgba(28, 186, 144, 1));
312+
--ed-button-hover-border-color: var(--ed-color-primary, rgba(28, 186, 144, 1));
313+
--ed-button-active-bg-color: var(--ed-color-primary-60, #a4e3d3);
314+
--ed-button-active-border-color: var(--ed-color-primary, rgba(28, 186, 144, 1));
315315
}
316316
317317
.search {

frontend/src/views/chat/index.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,15 +1124,15 @@ onMounted(() => {
11241124
line-height: 24px;
11251125
font-weight: 500;
11261126
1127-
--ed-button-text-color: rgba(28, 186, 144, 1);
1128-
--ed-button-hover-text-color: rgba(28, 186, 144, 1);
1129-
--ed-button-active-text-color: rgba(28, 186, 144, 1);
1127+
--ed-button-text-color: var(--ed-color-primary, rgba(28, 186, 144, 1));
1128+
--ed-button-hover-text-color: var(--ed-color-primary, rgba(28, 186, 144, 1));
1129+
--ed-button-active-text-color: var(--ed-color-primary, rgba(28, 186, 144, 1));
11301130
--ed-button-bg-color: rgba(248, 249, 250, 1);
1131-
--ed-button-hover-bg-color: rgba(28, 186, 144, 0.1);
1131+
--ed-button-hover-bg-color: var(--ed-color-primary-1a, #1cba901a);
11321132
--ed-button-border-color: rgba(217, 220, 223, 1);
1133-
--ed-button-hover-border-color: rgba(28, 186, 144, 1);
1133+
--ed-button-hover-border-color: var(--ed-color-primary, rgba(28, 186, 144, 1));
11341134
--ed-button-active-bg-color: rgba(28, 186, 144, 0.2);
1135-
--ed-button-active-border-color: rgba(28, 186, 144, 1);
1135+
--ed-button-active-border-color: var(--ed-color-primary, rgba(28, 186, 144, 1));
11361136
}
11371137
}
11381138
}

frontend/src/views/login/index.vue

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<template>
22
<div class="login-container">
33
<div class="login-left">
4-
<img :src="appearanceStore.getBg || login_image" alt="" />
4+
<img :src="bg" alt="" />
55
</div>
66
<div class="login-content">
77
<div class="login-right">
8-
<img width="227" height="52" :src="appearanceStore.getLogin || aboutBg" alt="" />
8+
<img width="227" height="52" :src="loginBg" alt="" />
99
<div class="welcome">
1010
{{ appearanceStore.slogan || $t('common.intelligent_questioning_platform') }}
1111
</div>
@@ -49,13 +49,15 @@
4949
</template>
5050

5151
<script lang="ts" setup>
52-
import { ref } from 'vue'
52+
import { ref, computed } from 'vue'
5353
import { useRouter } from 'vue-router'
5454
import { useUserStore } from '@/stores/user'
5555
import { useI18n } from 'vue-i18n'
5656
import aboutBg from '@/assets/embedded/LOGO-about.png'
5757
import login_image from '@/assets/embedded/login_image.png'
5858
import { useAppearanceStoreWithOut } from '@/stores/appearance'
59+
import logo from '@/assets/blue/LOGO-blue.png'
60+
import loginImage from '@/assets/blue/login-image_blue.png'
5961
6062
const router = useRouter()
6163
const userStore = useUserStore()
@@ -67,6 +69,14 @@ const loginForm = ref({
6769
password: '',
6870
})
6971
72+
const bg = computed(() => {
73+
return appearanceStore.isBlue ? loginImage : appearanceStore.getBg || login_image
74+
})
75+
76+
const loginBg = computed(() => {
77+
return appearanceStore.isBlue ? logo : appearanceStore.getLogin || aboutBg
78+
})
79+
7080
const rules = {
7181
username: [{ required: true, message: t('common.your_account_email_address'), trigger: 'blur' }],
7282
password: [{ required: true, message: t('common.the_correct_password'), trigger: 'blur' }],

0 commit comments

Comments
 (0)