From 392e94277b93e9ece10824057f926528ed235959 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Mon, 1 Sep 2025 11:15:37 +0800 Subject: [PATCH] fix(Smart Query): The color value after selecting in the drop-down list is the current main color --- .../assets/svg/chart/icon_bar_outlined.svg | 2 +- .../src/assets/svg/chart/icon_chart-line.svg | 2 +- .../assets/svg/chart/icon_pie_outlined.svg | 2 +- frontend/src/style.less | 6 ++++- .../views/chat/chat-block/ChartPopover.vue | 2 +- frontend/src/views/chat/index.vue | 2 +- .../views/dashboard/common/ResourceTree.vue | 7 +++-- frontend/src/views/ds/DatasourceForm.vue | 23 ++++++++-------- .../src/views/embedded/AssistantPreview.vue | 14 +++++++--- frontend/src/views/embedded/index.vue | 27 +++++++++++++++---- frontend/src/views/embedded/page.vue | 2 +- frontend/src/views/system/embedded/SetUi.vue | 15 ++++++++++- frontend/src/views/system/embedded/iframe.vue | 11 ++++++-- frontend/src/views/system/user/UserImport.vue | 2 +- 14 files changed, 84 insertions(+), 33 deletions(-) diff --git a/frontend/src/assets/svg/chart/icon_bar_outlined.svg b/frontend/src/assets/svg/chart/icon_bar_outlined.svg index 2fecb922..5b34a326 100644 --- a/frontend/src/assets/svg/chart/icon_bar_outlined.svg +++ b/frontend/src/assets/svg/chart/icon_bar_outlined.svg @@ -1,3 +1,3 @@ - + diff --git a/frontend/src/assets/svg/chart/icon_chart-line.svg b/frontend/src/assets/svg/chart/icon_chart-line.svg index 4899f0b1..0f3f6780 100644 --- a/frontend/src/assets/svg/chart/icon_chart-line.svg +++ b/frontend/src/assets/svg/chart/icon_chart-line.svg @@ -1,4 +1,4 @@ - + diff --git a/frontend/src/assets/svg/chart/icon_pie_outlined.svg b/frontend/src/assets/svg/chart/icon_pie_outlined.svg index 3efd2a8c..1b5fb283 100644 --- a/frontend/src/assets/svg/chart/icon_pie_outlined.svg +++ b/frontend/src/assets/svg/chart/icon_pie_outlined.svg @@ -1,4 +1,4 @@ - + diff --git a/frontend/src/style.less b/frontend/src/style.less index 9969d7dd..e55662f9 100644 --- a/frontend/src/style.less +++ b/frontend/src/style.less @@ -216,7 +216,7 @@ strong { } .ed-button.is-plain:active { - background-color: #a4e3d3 !important; + background-color: var(--ed-color-primary-60, #a4e3d3) !important; } .ed-drawer__footer { @@ -409,3 +409,7 @@ strong { } } } + +.ed-dropdown__popper { + --ed-dropdown-menuItem-hover-fill: #1f23291a !important; +} diff --git a/frontend/src/views/chat/chat-block/ChartPopover.vue b/frontend/src/views/chat/chat-block/ChartPopover.vue index cd4cb29e..b115c2ee 100644 --- a/frontend/src/views/chat/chat-block/ChartPopover.vue +++ b/frontend/src/views/chat/chat-block/ChartPopover.vue @@ -66,7 +66,7 @@ const handleDefaultChatChange = (val: any) => { @click="handleDefaultChatChange(ele)" > - +
{{ ele.name }}
diff --git a/frontend/src/views/chat/index.vue b/frontend/src/views/chat/index.vue index b12fccbe..0cbae1d3 100644 --- a/frontend/src/views/chat/index.vue +++ b/frontend/src/views/chat/index.vue @@ -382,7 +382,7 @@ import icon_sidebar_outlined from '@/assets/svg/icon_sidebar_outlined.svg' import icon_replace_outlined from '@/assets/svg/icon_replace_outlined.svg' import icon_screen_outlined from '@/assets/svg/icon_screen_outlined.svg' import icon_start_outlined from '@/assets/svg/icon_start_outlined.svg' -import logo_fold from '@/assets/LOGO-fold.svg' +import logo_fold from '@/assets/svg/logo-custom_small.svg' import logo from '@/assets/LOGO.svg' import icon_send_filled from '@/assets/svg/icon_send_filled.svg' import { useAssistantStore } from '@/stores/assistant' diff --git a/frontend/src/views/dashboard/common/ResourceTree.vue b/frontend/src/views/dashboard/common/ResourceTree.vue index 018208b5..bce90f43 100644 --- a/frontend/src/views/dashboard/common/ResourceTree.vue +++ b/frontend/src/views/dashboard/common/ResourceTree.vue @@ -482,11 +482,11 @@ defineExpose({ &:hover, &:focus { - background: #d2f1e9; + background: var(--ed-color-primary-80, #d2f1e9); } &:active { - background: #a4e3d3; + background: var(--ed-color-primary-60, #a4e3d3); } } } @@ -626,6 +626,9 @@ defineExpose({ border-radius: 4px; padding: 0 8px !important; } + .ed-dropdown-menu__item:not(.is-disabled):not(.selected):hover { + color: #1f2329; + } } .menu-outer-dv_popper { min-width: 140px; diff --git a/frontend/src/views/ds/DatasourceForm.vue b/frontend/src/views/ds/DatasourceForm.vue index 6541c5ef..c846864f 100644 --- a/frontend/src/views/ds/DatasourceForm.vue +++ b/frontend/src/views/ds/DatasourceForm.vue @@ -130,6 +130,7 @@ const close = () => { const initForm = (item: any, editTable: boolean = false) => { isEditTable.value = false + keywords.value = '' dsFormRef.value!.clearValidate() if (item) { dialogTitle.value = editTable ? t('ds.form.title.choose_tables') : t('ds.form.title.edit') @@ -228,15 +229,15 @@ const save = async (formEl: FormInstance | undefined) => { if (valid) { const list = tableList.value .filter((ele: any) => { - return checkList.value.includes(ele.tableName) + return checkTableList.value.includes(ele.tableName) }) .map((ele: any) => { return { table_name: ele.tableName, table_comment: ele.tableComment } }) - if (checkList.value.length > 30) { + if (checkTableList.value.length > 30) { const excessive = await ElMessageBox.confirm(t('common.excessive_tables_selected'), { - tip: t('common.to_continue_saving', { msg: checkList.value.length }), + tip: t('common.to_continue_saving', { msg: checkTableList.value.length }), confirmButtonText: t('common.save'), cancelButtonText: t('common.cancel'), confirmButtonType: 'primary', @@ -434,7 +435,7 @@ const tableListWithSearch = computed(() => { watch(keywords, () => { const tableNameArr = tableListWithSearch.value.map((ele: any) => ele.tableName) - checkList.value = checkTableList.filter((ele) => tableNameArr.includes(ele)) + checkList.value = checkTableList.value.filter((ele) => tableNameArr.includes(ele)) const checkedCount = checkList.value.length checkAll.value = checkedCount === tableListWithSearch.value.length isIndeterminate.value = checkedCount > 0 && checkedCount < tableListWithSearch.value.length @@ -460,7 +461,7 @@ const setFile = (file: any) => { const checkAll = ref(false) const isIndeterminate = ref(false) -let checkTableList = [] as any[] +const checkTableList = ref([] as any[]) const handleCheckAllChange = (val: any) => { checkList.value = val @@ -473,9 +474,9 @@ const handleCheckAllChange = (val: any) => { : [] isIndeterminate.value = false const tableNameArr = tableListWithSearch.value.map((ele: any) => ele.tableName) - checkTableList = val - ? [...new Set([...tableNameArr, ...checkTableList])] - : checkTableList.filter((ele) => !tableNameArr.includes(ele)) + checkTableList.value = val + ? [...new Set([...tableNameArr, ...checkTableList.value])] + : checkTableList.value.filter((ele) => !tableNameArr.includes(ele)) } const handleCheckedTablesChange = (value: any[]) => { @@ -483,8 +484,8 @@ const handleCheckedTablesChange = (value: any[]) => { checkAll.value = checkedCount === tableListWithSearch.value.length isIndeterminate.value = checkedCount > 0 && checkedCount < tableListWithSearch.value.length const tableNameArr = tableListWithSearch.value.map((ele: any) => ele.tableName) - checkTableList = [ - ...new Set([...checkTableList.filter((ele) => !tableNameArr.includes(ele)), ...value]), + checkTableList.value = [ + ...new Set([...checkTableList.value.filter((ele) => !tableNameArr.includes(ele)), ...value]), ] } @@ -693,7 +694,7 @@ defineExpose({
- {{ $t('ds.form.choose_tables') }} ({{ checkList.length }}/ {{ tableList.length }}) + {{ $t('ds.form.choose_tables') }} ({{ checkTableList.length }}/ {{ tableList.length }})
{ - return !props.logo ? LOGO : props.logo.startsWith('blob') ? props.logo : baseUrl + props.logo + return props.logo.startsWith('blob') ? props.logo : baseUrl + props.logo }) @@ -29,7 +29,10 @@ const pageLogo = computed(() => { - + + {{ name }} @@ -47,7 +50,10 @@ const pageLogo = computed(() => {
- + +
{{ welcome }}
{{ welcomeDesc }}
diff --git a/frontend/src/views/embedded/index.vue b/frontend/src/views/embedded/index.vue index dfaed1b2..1be397bf 100644 --- a/frontend/src/views/embedded/index.vue +++ b/frontend/src/views/embedded/index.vue @@ -4,7 +4,10 @@ - + + {{ customSet.name || $t('embedded.intelligent_customer_service') }} @@ -29,16 +32,19 @@ import { onBeforeMount, nextTick, onBeforeUnmount, ref, onMounted, reactive } from 'vue' import ChatComponent from '@/views/chat/index.vue' import { request } from '@/utils/request' -import LOGO from '@/assets/embedded/LOGO.png' +import LOGO from '@/assets/svg/logo-custom_small.svg' import icon_sidebar_outlined from '@/assets/embedded/icon_sidebar_outlined_nofill.svg' import icon_new_chat_outlined from '@/assets/svg/icon_new_chat_outlined.svg' +import { useAppearanceStoreWithOut } from '@/stores/appearance' import { useRoute } from 'vue-router' import { assistantApi } from '@/api/assistant' import { useAssistantStore } from '@/stores/assistant' import { setCurrentColor } from '@/utils/utils' import { useI18n } from 'vue-i18n' + const { t } = useI18n() const assistantStore = useAssistantStore() +const appearanceStore = useAppearanceStoreWithOut() const route = useRoute() const chatRef = ref() @@ -111,12 +117,12 @@ const logo = ref() const basePath = import.meta.env.VITE_API_BASE_URL const baseUrl = basePath + '/system/assistant/picture/' const setPageCustomColor = (val: any) => { - const ele = document.querySelector('.sqlbot-assistant-container') as HTMLElement + const ele = document.querySelector('body') as HTMLElement setCurrentColor(val, ele) } const setPageHeaderFontColor = (val: any) => { - const ele = document.querySelector('.sqlbot-assistant-container') as HTMLElement + const ele = document.querySelector('body') as HTMLElement ele.style.setProperty('--ed-text-color-primary', val) } onBeforeMount(async () => { @@ -159,11 +165,22 @@ onBeforeMount(async () => { } for (const key in customSet) { - if (Object.prototype.hasOwnProperty.call(customSet, key) && rawData[key]) { + if (Object.prototype.hasOwnProperty.call(customSet, key)) { customSet[key] = rawData[key] } } + if (!rawData.theme) { + const { customColor, themeColor } = appearanceStore + const currentColor = + themeColor === 'custom' && customColor + ? customColor + : themeColor === 'blue' + ? '#3370ff' + : '#1CBA90' + customSet.theme = currentColor || customSet.theme + } + nextTick(() => { setPageCustomColor(customSet.theme) setPageHeaderFontColor(customSet.header_font_color) diff --git a/frontend/src/views/embedded/page.vue b/frontend/src/views/embedded/page.vue index 699f0984..bf44133b 100644 --- a/frontend/src/views/embedded/page.vue +++ b/frontend/src/views/embedded/page.vue @@ -150,7 +150,7 @@ onBeforeMount(async () => { } for (const key in customSet) { - if (Object.prototype.hasOwnProperty.call(customSet, key) && rawData[key]) { + if (Object.prototype.hasOwnProperty.call(customSet, key)) { customSet[key] = rawData[key] } } diff --git a/frontend/src/views/system/embedded/SetUi.vue b/frontend/src/views/system/embedded/SetUi.vue index f2a01e87..c58c8e5b 100644 --- a/frontend/src/views/system/embedded/SetUi.vue +++ b/frontend/src/views/system/embedded/SetUi.vue @@ -6,8 +6,10 @@ import { useI18n } from 'vue-i18n' import { request } from '@/utils/request' import { setCurrentColor } from '@/utils/utils' import { cloneDeep } from 'lodash-es' +import { useAppearanceStoreWithOut } from '@/stores/appearance' const { t } = useI18n() +const appearanceStore = useAppearanceStoreWithOut() const currentId = ref() interface SqlBotForm { name: string @@ -85,11 +87,22 @@ const init = () => { floatIcon.value = rawData.float_icon for (const key in sqlBotForm) { - if (Object.prototype.hasOwnProperty.call(sqlBotForm, key) && rawData[key]) { + if (Object.prototype.hasOwnProperty.call(sqlBotForm, key)) { sqlBotForm[key] = rawData[key] } } + if (!rawData.theme) { + const { customColor, themeColor } = appearanceStore + const currentColor = + themeColor === 'custom' && customColor + ? customColor + : themeColor === 'blue' + ? '#3370ff' + : '#1CBA90' + sqlBotForm.theme = currentColor || sqlBotForm.theme + } + nextTick(() => { setPageCustomColor(sqlBotForm.theme) setPageHeaderFontColor(sqlBotForm.header_font_color) diff --git a/frontend/src/views/system/embedded/iframe.vue b/frontend/src/views/system/embedded/iframe.vue index 33be8ee1..7cf445f9 100644 --- a/frontend/src/views/system/embedded/iframe.vue +++ b/frontend/src/views/system/embedded/iframe.vue @@ -767,7 +767,7 @@ const saveHandler = () => {