Skip to content

Commit ae0b2e1

Browse files
committed
refactor: dashboard canvas update
1 parent bf5c0af commit ae0b2e1

File tree

10 files changed

+74
-47
lines changed

10 files changed

+74
-47
lines changed

frontend/src/assets/svg/dv-tab.svg

Lines changed: 4 additions & 2 deletions
Loading
Lines changed: 3 additions & 2 deletions
Loading
Lines changed: 3 additions & 3 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

frontend/src/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"password_reset_successful": "Password reset successful"
3333
},
3434
"dashboard": {
35+
"add_view": "Add Chart",
3536
"delete_dashboard_warn": "Delete This Dashboard: {0}",
3637
"rename_dashboard": "Rename Dashboard",
3738
"dashboard_name": "Dashboard Name",

frontend/src/i18n/zh-CN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"password_reset_successful": "重置密码成功"
3535
},
3636
"dashboard": {
37+
"add_view": "添加图表",
3738
"delete_dashboard_warn": "是否删除仪表板:{0}",
3839
"rename_dashboard": "重命名仪表板",
3940
"dashboard_name": "仪表板名称",

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,11 @@ const propsTree = {
124124
isLeaf: (node) => !node.children?.length,
125125
}
126126
127-
const showPid = computed(() => {
128-
return state.opt && ['newLeaf'].includes(state.opt) && state.parentSelect
129-
})
127+
// const showPid = computed(() => {
128+
// return state.opt && ['newLeaf'].includes(state.opt) && state.parentSelect
129+
// })
130+
131+
const showPid = false
130132
131133
const saveResource = () => {
132134
const params = {

frontend/src/views/dashboard/components/button-label/ComponentButtonLabel.vue

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,42 +26,42 @@ const emits = defineEmits(['customClick'])
2626
</template>
2727
<style lang="less" scoped>
2828
.flex-align-center {
29+
display: flex;
30+
justify-content: center;
31+
align-items: center;
2932
& + & {
30-
margin-left: 4px;
33+
margin-left: 12px;
3134
}
3235
}
3336
3437
.group_inner {
35-
padding: 8px;
38+
padding: 4px;
3639
display: flex;
3740
cursor: pointer;
38-
flex-direction: column;
41+
justify-content: center;
3942
align-items: center;
4043
border-radius: 4px;
41-
color: #a6a6a6;
44+
color: #1f2329;
4245
4346
span {
4447
float: left;
45-
font-size: 12px;
46-
margin-top: 8px;
47-
line-height: 12px;
48+
font-size: 14px;
49+
margin-left: 4px;
4850
}
4951
5052
&:hover {
51-
background: rgba(235, 235, 235, 0.1);
52-
color: #fff;
53+
background: rgba(31, 35, 41, 0.1);
5354
}
5455
5556
&:active {
56-
color: #fff;
57-
background: rgba(235, 235, 235, 0.2);
57+
background: rgba(31, 35, 41, 0.1);
5858
}
5959
}
6060
6161
.group-right-border {
62-
border-color: rgba(255, 255, 255, 0.15);
63-
margin: 0 2px 0 6px;
64-
height: 40px;
62+
border-color: rgba(31, 35, 41, 0.15);
63+
margin: 0 4px 0 16px;
64+
height: 14px;
6565
}
6666
6767
.inner-active {

frontend/src/views/dashboard/editor/Toolbar.vue

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { useI18n } from 'vue-i18n'
1111
import { snapshotStoreWithOut } from '@/stores/dashboard/snapshot.ts'
1212
import icon_undo_outlined from '@/assets/svg/icon_undo_outlined.svg'
1313
import icon_redo_outlined from '@/assets/svg/icon_redo_outlined.svg'
14-
import icon_left_outlined from '@/assets/svg/icon_left_outlined.svg'
14+
import icon_arrow_left_outlined from '@/assets/svg/icon_arrow-left_outlined.svg'
1515
import { saveDashboardResource } from '@/views/dashboard/utils/canvasUtils.ts'
1616
import ChatChartSelection from '@/views/dashboard/editor/ChatChartSelection.vue'
1717
@@ -142,7 +142,7 @@ const addChatChart = (views: any) => {
142142
<div class="toolbar-main">
143143
<el-icon class="custom-el-icon back-icon" @click="backToMain()">
144144
<Icon name="icon_left_outlined">
145-
<icon_left_outlined class="toolbar-hover-icon toolbar-icon" />
145+
<icon_arrow_left_outlined class="toolbar-hover-icon toolbar-icon" />
146146
</Icon>
147147
</el-icon>
148148
<div class="left-area">
@@ -181,9 +181,10 @@ const addChatChart = (views: any) => {
181181
<div class="core-toolbar">
182182
<component-button-label
183183
:icon-name="dvView"
184-
:title="t('dashboard.view')"
184+
:title="t('dashboard.add_view')"
185185
themes="light"
186186
is-label
187+
show-split-line
187188
@custom-click="openViewDialog"
188189
></component-button-label>
189190
<component-button-label
@@ -234,12 +235,12 @@ const addChatChart = (views: any) => {
234235
height: 56px;
235236
display: flex;
236237
align-items: center;
237-
background: #d1ddf6;
238-
padding-left: 8px;
238+
background: #fff;
239+
padding-left: 24px;
240+
border-bottom: 1px solid rgba(31, 35, 41, 0.15);
239241
240242
.left-area {
241-
margin-top: 8px;
242-
margin-left: 14px;
243+
margin-left: 12px;
243244
width: 300px;
244245
display: flex;
245246
flex-direction: column;
@@ -252,18 +253,18 @@ const addChatChart = (views: any) => {
252253
width: 300px;
253254
overflow: hidden;
254255
cursor: pointer;
255-
color: #fff;
256+
color: #1f2329;
256257
257258
input {
258259
position: absolute;
259260
left: 0;
260261
width: 100%;
261-
color: #fff;
262-
background-color: #d1ddf6;
262+
background-color: #f5f6f7;
263263
outline: none;
264-
border: 1px solid #295acc;
264+
font-size: 16px;
265+
border: 1px solid #1cba90;
265266
border-radius: 4px;
266-
padding: 0 4px;
267+
padding-left: 4px;
267268
height: 100%;
268269
}
269270
}
@@ -300,6 +301,10 @@ const addChatChart = (views: any) => {
300301
color: #fff;
301302
}
302303
304+
.back-icon {
305+
margin-top: 8px;
306+
}
307+
303308
.toolbar-hover-icon {
304309
cursor: pointer;
305310
font-size: 18px !important;

frontend/src/views/dashboard/editor/index.vue

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,23 +75,35 @@ const baseParams = computed(() => {
7575
</script>
7676

7777
<template>
78-
<div class="editor-main">
79-
<Toolbar :base-params="baseParams" @add-component="addComponent"></Toolbar>
80-
<DashboardEditor
81-
v-if="dataInitState"
82-
ref="dashboardEditorInnerRef"
83-
:canvas-component-data="componentData"
84-
:canvas-view-info="canvasViewInfo"
85-
>
86-
</DashboardEditor>
78+
<div class="editor-content">
79+
<div class="editor-main">
80+
<Toolbar :base-params="baseParams" @add-component="addComponent"></Toolbar>
81+
<DashboardEditor
82+
v-if="dataInitState"
83+
ref="dashboardEditorInnerRef"
84+
:canvas-component-data="componentData"
85+
:canvas-view-info="canvasViewInfo"
86+
>
87+
</DashboardEditor>
88+
</div>
8789
</div>
8890
</template>
8991

9092
<style scoped lang="less">
91-
.editor-main {
92-
position: relative;
93+
.editor-content {
94+
padding: 12px;
9395
width: 100vw;
9496
height: 100vh;
97+
background: #fff;
98+
overflow: hidden;
99+
}
100+
.editor-main {
101+
border-radius: 12px;
102+
position: relative;
95103
background: #f5f6f7;
104+
box-shadow: 0px 4px 8px 0px rgba(31, 35, 41, 0.1);
105+
overflow: hidden;
106+
width: 100%;
107+
height: 100%;
96108
}
97109
</style>

0 commit comments

Comments
 (0)