Skip to content

Commit 550eb57

Browse files
committed
fix: Style optimization
1 parent db2fdfc commit 550eb57

File tree

7 files changed

+92
-70
lines changed

7 files changed

+92
-70
lines changed
Lines changed: 15 additions & 0 deletions
Loading

frontend/src/components/layout/Person.vue

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<script lang="ts" setup>
22
import { ref, computed } from 'vue'
3-
import Default_avatar from '@/assets/workspace/default_avatar.png'
4-
import Default_avatar_blue from '@/assets/blue/Default-avatar_blue.png'
3+
import Default_avatar_custom from '@/assets/img/Default-avatar.svg'
54
import icon_admin_outlined from '@/assets/svg/icon_admin_outlined.svg'
65
import icon_info_outlined_1 from '@/assets/svg/icon_info_outlined_1.svg'
76
import { useAppearanceStoreWithOut } from '@/stores/appearance'
@@ -90,23 +89,18 @@ const logout = () => {
9089
<el-popover trigger="click" popper-class="system-person" :placement="collapse ? 'right' : 'top'">
9190
<template #reference>
9291
<button class="person" :title="name" :class="collapse && 'collapse'">
93-
<img
94-
class="default-avatar"
95-
:src="appearanceStore.isBlue ? Default_avatar_blue : Default_avatar"
96-
width="32px"
97-
height="32px"
98-
/>
92+
<el-icon size="32">
93+
<Default_avatar_custom></Default_avatar_custom>
94+
</el-icon>
9995
<span v-if="!collapse" class="name ellipsis">{{ name }}</span>
10096
</button></template
10197
>
10298
<div class="popover">
10399
<div class="popover-content">
104100
<div class="info">
105-
<img
106-
:src="appearanceStore.isBlue ? Default_avatar_blue : Default_avatar"
107-
width="40px"
108-
height="40px"
109-
/>
101+
<el-icon class="avatar-custom" size="40">
102+
<Default_avatar_custom></Default_avatar_custom>
103+
</el-icon>
110104
<div :title="name" class="top ellipsis">{{ name }}</div>
111105
<div :title="account" class="bottom ellipsis">{{ account }}</div>
112106
</div>
@@ -278,7 +272,7 @@ const logout = () => {
278272
padding: 8px;
279273
margin-bottom: 4px;
280274
281-
img {
275+
.avatar-custom {
282276
float: left;
283277
margin: 3px 8px 0 7px;
284278
}

frontend/src/style.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,3 +351,7 @@ strong {
351351
.icon-primary_60.icon-primary_60 {
352352
color: var(--ed-color-primary-60);
353353
}
354+
355+
.ed-checkbox {
356+
--ed-checkbox-font-weight: 400 !important;
357+
}

frontend/src/views/system/appearance/Person.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const account = computed(() => userStore.getAccount)
4141
<div :title="account" class="bottom ellipsis">{{ account }}</div>
4242
</div>
4343
<div class="popover-item">
44-
<el-icon size="16">
44+
<el-icon style="color: #646a73" size="16">
4545
<icon_admin_outlined></icon_admin_outlined>
4646
</el-icon>
4747
<div class="datasource-name">{{ $t('common.system_manage') }}</div>

frontend/src/views/system/embedded/SetUi.vue

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ import { type UploadUserFile, ElMessage } from 'element-plus-secondary'
55
import { useI18n } from 'vue-i18n'
66
import { request } from '@/utils/request'
77
import { setCurrentColor } from '@/utils/utils'
8-
import { useAppearanceStoreWithOut } from '@/stores/appearance'
98
import { cloneDeep } from 'lodash-es'
109
11-
const appearanceStore = useAppearanceStoreWithOut()
1210
const { t } = useI18n()
1311
const currentId = ref()
1412
interface SqlBotForm {
@@ -86,7 +84,7 @@ const init = () => {
8684
floatIcon.value = rawData.float_icon
8785
8886
for (const key in sqlBotForm) {
89-
if (Object.prototype.hasOwnProperty.call(sqlBotForm, key)) {
87+
if (Object.prototype.hasOwnProperty.call(sqlBotForm, key) && rawData[key]) {
9088
sqlBotForm[key] = rawData[key]
9189
}
9290
}
@@ -100,7 +98,8 @@ const giveUp = () => {
10098
resetSqlBotForm(false)
10199
init()
102100
}
103-
const showSaveButton = ref(true)
101+
102+
const emits = defineEmits(['refresh'])
104103
const saveHandler = () => {
105104
const param = buildParam()
106105
const url = '/system/assistant/ui'
@@ -113,12 +112,8 @@ const saveHandler = () => {
113112
.then((res) => {
114113
if (!res) {
115114
ElMessage.success(t('system.setting_successfully'))
116-
appearanceStore.setLoaded(false)
117-
appearanceStore.setAppearance()
118-
showSaveButton.value = false
119-
nextTick(() => {
120-
showSaveButton.value = true
121-
})
115+
dialogVisible.value = false
116+
emits('refresh')
122117
}
123118
})
124119
}
@@ -159,6 +154,10 @@ const resetSqlBotForm = (reset2Default?: boolean) => {
159154
if (reset2Default) {
160155
logo.value = ''
161156
floatIcon.value = ''
157+
nextTick(() => {
158+
setPageCustomColor(sqlBotForm.theme)
159+
setPageHeaderFontColor(sqlBotForm.header_font_color)
160+
})
162161
}
163162
}
164163
@@ -203,13 +202,10 @@ const clearFiles = (array?: string[]) => {
203202
204203
const open = (row: any) => {
205204
console.log(JSON.parse(row.configuration))
206-
// rawData = JSON.parse(row.configuration)
207-
// init()
205+
rawData = JSON.parse(row.configuration)
208206
currentId.value = row.id
209207
dialogVisible.value = true
210-
nextTick(() => {
211-
setPageCustomColor('#1CBA90')
212-
})
208+
init()
213209
}
214210
defineExpose({
215211
open,

frontend/src/views/system/embedded/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ const saveHandler = () => {
941941
</div>
942942
</template>
943943
</el-drawer>
944-
<SetUi ref="setUiRef"></SetUi>
944+
<SetUi ref="setUiRef" @refresh="handleSearch"></SetUi>
945945
</template>
946946

947947
<style lang="less" scoped>

frontend/src/views/system/workspace/index.vue

Lines changed: 52 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -316,46 +316,54 @@ const handleCurrentChange = (val: number) => {
316316
</el-input>
317317

318318
<div class="list-content">
319-
<div
320-
v-for="ele in tableListWithSearch"
321-
:key="ele.name"
322-
class="model"
323-
:class="currentTable.name === ele.name && 'isActive'"
324-
:title="ele.name"
325-
@click="clickTable(ele)"
326-
>
327-
<el-icon size="16">
328-
<icon_form_outlined></icon_form_outlined>
329-
</el-icon>
330-
<span class="name">{{ ele.name }}</span>
331-
332-
<el-popover
333-
trigger="click"
334-
:teleported="false"
335-
popper-class="popover-card"
336-
placement="bottom"
319+
<el-scrollbar>
320+
<div
321+
v-for="ele in tableListWithSearch"
322+
:key="ele.name"
323+
class="model"
324+
:class="currentTable.name === ele.name && 'isActive'"
325+
:title="ele.name"
326+
@click="clickTable(ele)"
337327
>
338-
<template #reference>
339-
<el-icon class="more" size="16" style="margin-left: auto; color: #646a73" @click.stop>
340-
<icon_more_outlined></icon_more_outlined>
341-
</el-icon>
342-
</template>
343-
<div class="content">
344-
<div class="item" @click.stop="addWorkspace(ele)">
345-
<el-icon size="16">
346-
<rename></rename>
347-
</el-icon>
348-
{{ $t('dashboard.rename') }}
349-
</div>
350-
<div class="item" @click.stop="delWorkspace(ele)">
351-
<el-icon size="16">
352-
<delIcon></delIcon>
328+
<el-icon size="16">
329+
<icon_form_outlined></icon_form_outlined>
330+
</el-icon>
331+
<span class="name">{{ ele.name }}</span>
332+
333+
<el-popover
334+
trigger="click"
335+
:teleported="false"
336+
popper-class="popover-card"
337+
placement="bottom"
338+
>
339+
<template #reference>
340+
<el-icon
341+
class="more"
342+
size="16"
343+
style="margin-left: auto; color: #646a73"
344+
@click.stop
345+
>
346+
<icon_more_outlined></icon_more_outlined>
353347
</el-icon>
354-
{{ $t('dashboard.delete') }}
348+
</template>
349+
<div class="content">
350+
<div class="item" @click.stop="addWorkspace(ele)">
351+
<el-icon size="16">
352+
<rename></rename>
353+
</el-icon>
354+
{{ $t('dashboard.rename') }}
355+
</div>
356+
<div class="item" @click.stop="delWorkspace(ele)">
357+
<el-icon size="16">
358+
<delIcon></delIcon>
359+
</el-icon>
360+
{{ $t('dashboard.delete') }}
361+
</div>
355362
</div>
356-
</div>
357-
</el-popover>
358-
</div>
363+
</el-popover>
364+
</div>
365+
</el-scrollbar>
366+
359367
<div v-if="!!keyword && !tableListWithSearch.length" class="no-result">
360368
{{ $t('workspace.relevant_content_found') }}
361369
</div>
@@ -576,6 +584,7 @@ const handleCurrentChange = (val: number) => {
576584
padding: 8px 16px;
577585
height: 100%;
578586
border-right: 1px solid #1f232926;
587+
position: relative;
579588
.select-table_top {
580589
height: 40px;
581590
display: flex;
@@ -616,7 +625,11 @@ const handleCurrentChange = (val: number) => {
616625
617626
.list-content {
618627
height: calc(100% - 100px);
619-
overflow-y: auto;
628+
position: absolute;
629+
bottom: 0;
630+
left: 0;
631+
width: 100%;
632+
padding-left: 16px;
620633
621634
.more {
622635
display: none;
@@ -655,7 +668,7 @@ const handleCurrentChange = (val: number) => {
655668
color: #646a73;
656669
}
657670
.model {
658-
width: 100%;
671+
width: calc(100% - 16px);
659672
height: 40px;
660673
display: flex;
661674
align-items: center;

0 commit comments

Comments
 (0)