Skip to content

Commit 392e942

Browse files
committed
fix(Smart Query): The color value after selecting in the drop-down list is the current main color
1 parent a0ca17d commit 392e942

File tree

14 files changed

+84
-33
lines changed

14 files changed

+84
-33
lines changed
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 1 deletion
Loading

frontend/src/style.less

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ strong {
216216
}
217217

218218
.ed-button.is-plain:active {
219-
background-color: #a4e3d3 !important;
219+
background-color: var(--ed-color-primary-60, #a4e3d3) !important;
220220
}
221221

222222
.ed-drawer__footer {
@@ -409,3 +409,7 @@ strong {
409409
}
410410
}
411411
}
412+
413+
.ed-dropdown__popper {
414+
--ed-dropdown-menuItem-hover-fill: #1f23291a !important;
415+
}

frontend/src/views/chat/chat-block/ChartPopover.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const handleDefaultChatChange = (val: any) => {
6666
@click="handleDefaultChatChange(ele)"
6767
>
6868
<el-icon style="color: #646a73" size="16">
69-
<component :is="ele.icon" />
69+
<component :is="ele.icon" :class="chartType === ele.value && 'icon-primary'" />
7070
</el-icon>
7171
<div class="model-name">{{ ele.name }}</div>
7272
<el-icon size="16" class="done">

frontend/src/views/chat/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ import icon_sidebar_outlined from '@/assets/svg/icon_sidebar_outlined.svg'
382382
import icon_replace_outlined from '@/assets/svg/icon_replace_outlined.svg'
383383
import icon_screen_outlined from '@/assets/svg/icon_screen_outlined.svg'
384384
import icon_start_outlined from '@/assets/svg/icon_start_outlined.svg'
385-
import logo_fold from '@/assets/LOGO-fold.svg'
385+
import logo_fold from '@/assets/svg/logo-custom_small.svg'
386386
import logo from '@/assets/LOGO.svg'
387387
import icon_send_filled from '@/assets/svg/icon_send_filled.svg'
388388
import { useAssistantStore } from '@/stores/assistant'

frontend/src/views/dashboard/common/ResourceTree.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,11 +482,11 @@ defineExpose({
482482
483483
&:hover,
484484
&:focus {
485-
background: #d2f1e9;
485+
background: var(--ed-color-primary-80, #d2f1e9);
486486
}
487487
488488
&:active {
489-
background: #a4e3d3;
489+
background: var(--ed-color-primary-60, #a4e3d3);
490490
}
491491
}
492492
}
@@ -626,6 +626,9 @@ defineExpose({
626626
border-radius: 4px;
627627
padding: 0 8px !important;
628628
}
629+
.ed-dropdown-menu__item:not(.is-disabled):not(.selected):hover {
630+
color: #1f2329;
631+
}
629632
}
630633
.menu-outer-dv_popper {
631634
min-width: 140px;

frontend/src/views/ds/DatasourceForm.vue

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ const close = () => {
130130
131131
const initForm = (item: any, editTable: boolean = false) => {
132132
isEditTable.value = false
133+
keywords.value = ''
133134
dsFormRef.value!.clearValidate()
134135
if (item) {
135136
dialogTitle.value = editTable ? t('ds.form.title.choose_tables') : t('ds.form.title.edit')
@@ -228,15 +229,15 @@ const save = async (formEl: FormInstance | undefined) => {
228229
if (valid) {
229230
const list = tableList.value
230231
.filter((ele: any) => {
231-
return checkList.value.includes(ele.tableName)
232+
return checkTableList.value.includes(ele.tableName)
232233
})
233234
.map((ele: any) => {
234235
return { table_name: ele.tableName, table_comment: ele.tableComment }
235236
})
236237
237-
if (checkList.value.length > 30) {
238+
if (checkTableList.value.length > 30) {
238239
const excessive = await ElMessageBox.confirm(t('common.excessive_tables_selected'), {
239-
tip: t('common.to_continue_saving', { msg: checkList.value.length }),
240+
tip: t('common.to_continue_saving', { msg: checkTableList.value.length }),
240241
confirmButtonText: t('common.save'),
241242
cancelButtonText: t('common.cancel'),
242243
confirmButtonType: 'primary',
@@ -434,7 +435,7 @@ const tableListWithSearch = computed(() => {
434435
435436
watch(keywords, () => {
436437
const tableNameArr = tableListWithSearch.value.map((ele: any) => ele.tableName)
437-
checkList.value = checkTableList.filter((ele) => tableNameArr.includes(ele))
438+
checkList.value = checkTableList.value.filter((ele) => tableNameArr.includes(ele))
438439
const checkedCount = checkList.value.length
439440
checkAll.value = checkedCount === tableListWithSearch.value.length
440441
isIndeterminate.value = checkedCount > 0 && checkedCount < tableListWithSearch.value.length
@@ -460,7 +461,7 @@ const setFile = (file: any) => {
460461
461462
const checkAll = ref(false)
462463
const isIndeterminate = ref(false)
463-
let checkTableList = [] as any[]
464+
const checkTableList = ref([] as any[])
464465
465466
const handleCheckAllChange = (val: any) => {
466467
checkList.value = val
@@ -473,18 +474,18 @@ const handleCheckAllChange = (val: any) => {
473474
: []
474475
isIndeterminate.value = false
475476
const tableNameArr = tableListWithSearch.value.map((ele: any) => ele.tableName)
476-
checkTableList = val
477-
? [...new Set([...tableNameArr, ...checkTableList])]
478-
: checkTableList.filter((ele) => !tableNameArr.includes(ele))
477+
checkTableList.value = val
478+
? [...new Set([...tableNameArr, ...checkTableList.value])]
479+
: checkTableList.value.filter((ele) => !tableNameArr.includes(ele))
479480
}
480481
481482
const handleCheckedTablesChange = (value: any[]) => {
482483
const checkedCount = value.length
483484
checkAll.value = checkedCount === tableListWithSearch.value.length
484485
isIndeterminate.value = checkedCount > 0 && checkedCount < tableListWithSearch.value.length
485486
const tableNameArr = tableListWithSearch.value.map((ele: any) => ele.tableName)
486-
checkTableList = [
487-
...new Set([...checkTableList.filter((ele) => !tableNameArr.includes(ele)), ...value]),
487+
checkTableList.value = [
488+
...new Set([...checkTableList.value.filter((ele) => !tableNameArr.includes(ele)), ...value]),
488489
]
489490
}
490491
@@ -693,7 +694,7 @@ defineExpose({
693694
</el-form>
694695
<div v-show="activeStep === 2" v-loading="tableListLoading" class="select-data_table">
695696
<div class="title">
696-
{{ $t('ds.form.choose_tables') }} ({{ checkList.length }}/ {{ tableList.length }})
697+
{{ $t('ds.form.choose_tables') }} ({{ checkTableList.length }}/ {{ tableList.length }})
697698
</div>
698699
<el-input
699700
v-model="keywords"

frontend/src/views/embedded/AssistantPreview.vue

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { ref, computed } from 'vue'
33
import icon_sidebar_outlined from '@/assets/embedded/icon_sidebar_outlined_nofill.svg'
44
import icon_new_chat_outlined from '@/assets/svg/icon_new_chat_outlined.svg'
5-
import LOGO from '@/assets/embedded/LOGO.png'
5+
import LOGO from '@/assets/svg/logo-custom_small.svg'
66
import disable_answer from '@/assets/embedded/disable.png'
77
import icon_close_outlined from '@/assets/svg/icon_close_outlined.svg'
88
import icon_magnify_outlined from '@/assets/svg/icon_magnify_outlined.svg'
@@ -19,7 +19,7 @@ const basePath = import.meta.env.VITE_API_BASE_URL
1919
const baseUrl = basePath + '/system/assistant/picture/'
2020
2121
const pageLogo = computed(() => {
22-
return !props.logo ? LOGO : props.logo.startsWith('blob') ? props.logo : baseUrl + props.logo
22+
return props.logo.startsWith('blob') ? props.logo : baseUrl + props.logo
2323
})
2424
</script>
2525

@@ -29,7 +29,10 @@ const pageLogo = computed(() => {
2929
<el-icon size="20">
3030
<icon_sidebar_outlined></icon_sidebar_outlined>
3131
</el-icon>
32-
<img :src="pageLogo" class="logo" width="30px" height="30px" alt="" />
32+
<el-icon v-if="!props.logo" class="logo" size="30">
33+
<LOGO></LOGO>
34+
</el-icon>
35+
<img v-else :src="pageLogo" class="logo" width="30px" height="30px" alt="" />
3336
<span class="title">{{ name }}</span>
3437

3538
<el-tooltip effect="dark" :content="$t('embedded.new_conversation')" placement="top">
@@ -47,7 +50,10 @@ const pageLogo = computed(() => {
4750
</el-icon>
4851
</div>
4952
<div class="center">
50-
<img :src="pageLogo" class="logo" width="30px" height="30px" alt="" />
53+
<el-icon v-if="!props.logo" class="logo" size="30">
54+
<LOGO></LOGO>
55+
</el-icon>
56+
<img v-else :src="pageLogo" class="logo" width="30px" height="30px" alt="" />
5157
<div class="i-am">{{ welcome }}</div>
5258
<div class="i-can">{{ welcomeDesc }}</div>
5359
</div>

frontend/src/views/embedded/index.vue

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
<el-icon size="20" @click="openHistory">
55
<icon_sidebar_outlined></icon_sidebar_outlined>
66
</el-icon>
7-
<img :src="logo || LOGO" class="logo" width="30px" height="30px" alt="" />
7+
<el-icon v-if="!logo" class="logo" size="30">
8+
<LOGO></LOGO>
9+
</el-icon>
10+
<img v-else :src="logo" class="logo" width="30px" height="30px" alt="" />
811
<span class="title">{{ customSet.name || $t('embedded.intelligent_customer_service') }}</span>
912

1013
<el-tooltip effect="dark" :content="$t('embedded.new_conversation')" placement="top">
@@ -29,16 +32,19 @@
2932
import { onBeforeMount, nextTick, onBeforeUnmount, ref, onMounted, reactive } from 'vue'
3033
import ChatComponent from '@/views/chat/index.vue'
3134
import { request } from '@/utils/request'
32-
import LOGO from '@/assets/embedded/LOGO.png'
35+
import LOGO from '@/assets/svg/logo-custom_small.svg'
3336
import icon_sidebar_outlined from '@/assets/embedded/icon_sidebar_outlined_nofill.svg'
3437
import icon_new_chat_outlined from '@/assets/svg/icon_new_chat_outlined.svg'
38+
import { useAppearanceStoreWithOut } from '@/stores/appearance'
3539
import { useRoute } from 'vue-router'
3640
import { assistantApi } from '@/api/assistant'
3741
import { useAssistantStore } from '@/stores/assistant'
3842
import { setCurrentColor } from '@/utils/utils'
3943
import { useI18n } from 'vue-i18n'
44+
4045
const { t } = useI18n()
4146
const assistantStore = useAssistantStore()
47+
const appearanceStore = useAppearanceStoreWithOut()
4248
const route = useRoute()
4349
const chatRef = ref()
4450
@@ -111,12 +117,12 @@ const logo = ref()
111117
const basePath = import.meta.env.VITE_API_BASE_URL
112118
const baseUrl = basePath + '/system/assistant/picture/'
113119
const setPageCustomColor = (val: any) => {
114-
const ele = document.querySelector('.sqlbot-assistant-container') as HTMLElement
120+
const ele = document.querySelector('body') as HTMLElement
115121
setCurrentColor(val, ele)
116122
}
117123
118124
const setPageHeaderFontColor = (val: any) => {
119-
const ele = document.querySelector('.sqlbot-assistant-container') as HTMLElement
125+
const ele = document.querySelector('body') as HTMLElement
120126
ele.style.setProperty('--ed-text-color-primary', val)
121127
}
122128
onBeforeMount(async () => {
@@ -159,11 +165,22 @@ onBeforeMount(async () => {
159165
}
160166
161167
for (const key in customSet) {
162-
if (Object.prototype.hasOwnProperty.call(customSet, key) && rawData[key]) {
168+
if (Object.prototype.hasOwnProperty.call(customSet, key)) {
163169
customSet[key] = rawData[key]
164170
}
165171
}
166172
173+
if (!rawData.theme) {
174+
const { customColor, themeColor } = appearanceStore
175+
const currentColor =
176+
themeColor === 'custom' && customColor
177+
? customColor
178+
: themeColor === 'blue'
179+
? '#3370ff'
180+
: '#1CBA90'
181+
customSet.theme = currentColor || customSet.theme
182+
}
183+
167184
nextTick(() => {
168185
setPageCustomColor(customSet.theme)
169186
setPageHeaderFontColor(customSet.header_font_color)

0 commit comments

Comments
 (0)