mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 09:17:06 +08:00
fix(Smart Query): The color value after selecting in the drop-down list is the current main color
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M3.99983 2.50017H12.4544C13.0318 2.50017 13.4998 2.97987 13.4998 3.5716V8.00017H20.9472C21.5286 8.00017 21.9998 8.51185 21.9998 9.14303V14.8573C21.9998 15.4885 21.5286 16.0002 20.9472 16.0002H15.9998V20.4287C15.9998 21.0205 15.5521 21.5002 14.9998 21.5002H3.99983V22.5C3.99983 22.7761 3.77597 23 3.49983 23H2.49983C2.22369 23 1.99983 22.7761 1.99983 22.5V1.5C1.99983 1.22386 2.22369 1 2.49983 1H3.49983C3.77597 1 3.99983 1.22386 3.99983 1.5V2.50017ZM3.99983 19.5002H13.9998V16.0002H3.99983V19.5002ZM3.99983 14.0002H19.9998V10.0002H3.99983V14.0002ZM3.99983 8.00017H11.4998V4.50017H3.99983V8.00017Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 732 B After Width: | Height: | Size: 721 B |
@@ -1,4 +1,4 @@
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0.713135 21.4739V1.80273C0.713135 1.52659 0.936992 1.30273 1.21313 1.30273H2.26008C2.53623 1.30273 2.76008 1.52659 2.76008 1.80273V20.5523H22.5686C22.8447 20.5523 23.0686 20.7761 23.0686 21.0523V22.0992C23.0686 22.3754 22.8447 22.5992 22.5686 22.5992H1.83907C1.54045 22.5992 1.25407 22.4806 1.04291 22.2694C0.83176 22.0583 0.713135 21.7725 0.713135 21.4739Z" fill="currentColor"/>
|
||||
<path d="M4.19544 18.3911C3.96872 18.2313 3.91539 17.9175 4.07659 17.6918L8.90155 10.9358C8.97757 10.8235 9.07516 10.7274 9.18865 10.6531C9.30213 10.5788 9.42925 10.5278 9.56262 10.5031C9.69599 10.4784 9.83293 10.4804 9.96551 10.5091C10.0981 10.5377 10.2236 10.5925 10.3349 10.6701L15.7191 14.2624L20.9481 8.16625C21.1291 7.95528 21.4474 7.93239 21.6567 8.11531L22.4497 8.80844C22.6562 8.98892 22.6788 9.30208 22.5003 9.51031L16.6806 16.2998C16.5179 16.4883 16.2919 16.611 16.0452 16.6449C15.7984 16.6788 15.5478 16.6215 15.3402 16.4839L10.0275 12.9315L5.77196 18.8941C5.61221 19.118 5.30171 19.1708 5.07694 19.0124L4.19544 18.3911Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -1,4 +1,4 @@
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 21.3333C17.1547 21.3333 21.3333 17.1547 21.3333 12C18.2222 12 15.1111 12 12 12C12 8.26667 12 5.15556 12 2.66667C6.84534 2.66667 2.66666 6.84534 2.66666 12C2.66666 17.1547 6.84534 21.3333 12 21.3333ZM10.1667 12.7667C10.1667 13.3558 10.6442 13.8333 11.2333 13.8333H19.3333C18.5063 17.0465 15.4713 19.3333 12 19.3333C7.88562 19.3333 4.66666 15.9961 4.66666 11.8817C4.66666 8.41043 6.95354 5.49367 10.1667 4.66667V12.7667Z" fill="currentColor"/>
|
||||
<path d="M14.8938 10C14.4002 10 14 9.59984 14 9.10621V2C18.2226 2.41925 21.5807 5.77735 22 10H14.8938ZM16 4.66667V8H19.3333C18.7209 6.4875 17.5125 5.27905 16 4.66667Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 748 B After Width: | Height: | Size: 737 B |
@@ -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;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ const handleDefaultChatChange = (val: any) => {
|
||||
@click="handleDefaultChatChange(ele)"
|
||||
>
|
||||
<el-icon style="color: #646a73" size="16">
|
||||
<component :is="ele.icon" />
|
||||
<component :is="ele.icon" :class="chartType === ele.value && 'icon-primary'" />
|
||||
</el-icon>
|
||||
<div class="model-name">{{ ele.name }}</div>
|
||||
<el-icon size="16" class="done">
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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({
|
||||
</el-form>
|
||||
<div v-show="activeStep === 2" v-loading="tableListLoading" class="select-data_table">
|
||||
<div class="title">
|
||||
{{ $t('ds.form.choose_tables') }} ({{ checkList.length }}/ {{ tableList.length }})
|
||||
{{ $t('ds.form.choose_tables') }} ({{ checkTableList.length }}/ {{ tableList.length }})
|
||||
</div>
|
||||
<el-input
|
||||
v-model="keywords"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { ref, computed } from 'vue'
|
||||
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 LOGO from '@/assets/embedded/LOGO.png'
|
||||
import LOGO from '@/assets/svg/logo-custom_small.svg'
|
||||
import disable_answer from '@/assets/embedded/disable.png'
|
||||
import icon_close_outlined from '@/assets/svg/icon_close_outlined.svg'
|
||||
import icon_magnify_outlined from '@/assets/svg/icon_magnify_outlined.svg'
|
||||
@@ -19,7 +19,7 @@ const basePath = import.meta.env.VITE_API_BASE_URL
|
||||
const baseUrl = basePath + '/system/assistant/picture/'
|
||||
|
||||
const pageLogo = computed(() => {
|
||||
return !props.logo ? LOGO : props.logo.startsWith('blob') ? props.logo : baseUrl + props.logo
|
||||
return props.logo.startsWith('blob') ? props.logo : baseUrl + props.logo
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -29,7 +29,10 @@ const pageLogo = computed(() => {
|
||||
<el-icon size="20">
|
||||
<icon_sidebar_outlined></icon_sidebar_outlined>
|
||||
</el-icon>
|
||||
<img :src="pageLogo" class="logo" width="30px" height="30px" alt="" />
|
||||
<el-icon v-if="!props.logo" class="logo" size="30">
|
||||
<LOGO></LOGO>
|
||||
</el-icon>
|
||||
<img v-else :src="pageLogo" class="logo" width="30px" height="30px" alt="" />
|
||||
<span class="title">{{ name }}</span>
|
||||
|
||||
<el-tooltip effect="dark" :content="$t('embedded.new_conversation')" placement="top">
|
||||
@@ -47,7 +50,10 @@ const pageLogo = computed(() => {
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="center">
|
||||
<img :src="pageLogo" class="logo" width="30px" height="30px" alt="" />
|
||||
<el-icon v-if="!props.logo" class="logo" size="30">
|
||||
<LOGO></LOGO>
|
||||
</el-icon>
|
||||
<img v-else :src="pageLogo" class="logo" width="30px" height="30px" alt="" />
|
||||
<div class="i-am">{{ welcome }}</div>
|
||||
<div class="i-can">{{ welcomeDesc }}</div>
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,10 @@
|
||||
<el-icon size="20" @click="openHistory">
|
||||
<icon_sidebar_outlined></icon_sidebar_outlined>
|
||||
</el-icon>
|
||||
<img :src="logo || LOGO" class="logo" width="30px" height="30px" alt="" />
|
||||
<el-icon v-if="!logo" class="logo" size="30">
|
||||
<LOGO></LOGO>
|
||||
</el-icon>
|
||||
<img v-else :src="logo" class="logo" width="30px" height="30px" alt="" />
|
||||
<span class="title">{{ customSet.name || $t('embedded.intelligent_customer_service') }}</span>
|
||||
|
||||
<el-tooltip effect="dark" :content="$t('embedded.new_conversation')" placement="top">
|
||||
@@ -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)
|
||||
|
||||
@@ -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]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -767,7 +767,7 @@ const saveHandler = () => {
|
||||
<template #label>
|
||||
<div class="title-content">
|
||||
<span class="title-form">{{ t('embedded.interface_credentials') }}</span>
|
||||
<span class="add" @click="initCertificate(null)">
|
||||
<span class="add btn" @click="initCertificate(null)">
|
||||
<el-icon size="16">
|
||||
<icon_add_outlined></icon_add_outlined>
|
||||
</el-icon>
|
||||
@@ -1215,11 +1215,18 @@ const saveHandler = () => {
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
.add {
|
||||
.btn {
|
||||
height: 26px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 4px;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background-color: #1f23291a;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -383,7 +383,7 @@ defineExpose({
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
background: #d2f1e9;
|
||||
background: var(--ed-color-primary-80, #d2f1e9);
|
||||
border-radius: 4px;
|
||||
padding-left: 10px;
|
||||
.icon-span {
|
||||
|
||||
Reference in New Issue
Block a user