Skip to content

Commit a954319

Browse files
committed
refactor: eslint
1 parent 9c58877 commit a954319

File tree

2 files changed

+115
-1
lines changed

2 files changed

+115
-1
lines changed

frontend/src/i18n/zh-CN.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
"delete_resource_warn": "确定删除该{0}吗?",
3030
"delete_success": "删除成功",
3131
"new_folder": "新建目录",
32-
"new_dashboard": "新建仪表板"
32+
"new_dashboard": "新建仪表板",
33+
"add_chart": "添加图表",
34+
"chart_selected": "已选{0}"
3335
},
3436
"qa": {
3537
"New Conversation": "开启新问数",
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
<template>
2+
<el-drawer
3+
v-model="dialogShow"
4+
direction="btt"
5+
size="90%"
6+
trigger="click"
7+
:title="t('dashboard.add_chart')"
8+
modal-class="custom-drawer"
9+
@closed="handleClose()"
10+
>
11+
<div>Preview</div>
12+
13+
<template #footer>
14+
<el-row class="multiplexing-footer">
15+
<el-col class="adapt-count">
16+
<span>{{ t('dashboard.chart_selected', [selectComponentCount]) }} </span>
17+
</el-col>
18+
<el-button class="close-button" @click="dialogShow = false">{{
19+
t('common.cancel')
20+
}}</el-button>
21+
<el-button
22+
type="primary"
23+
:disabled="!selectComponentCount"
24+
class="confirm-button"
25+
@click="saveMultiplexing"
26+
>{{ t('common.save') }}</el-button
27+
>
28+
</el-row>
29+
</template>
30+
</el-drawer>
31+
</template>
32+
33+
<script setup lang="ts">
34+
import { computed, reactive, ref } from 'vue'
35+
import { useI18n } from 'vue-i18n'
36+
const dialogShow = ref(false)
37+
const curDvType = ref('dashboard')
38+
const { t } = useI18n()
39+
const selectComponentCount = computed(() => Object.keys(state.curMultiplexingComponents).length)
40+
const state = reactive({
41+
curMultiplexingComponents: {},
42+
})
43+
const dialogInit = (dvType = 'dashboard') => {
44+
curDvType.value = dvType
45+
dialogShow.value = true
46+
state.curMultiplexingComponents = {}
47+
}
48+
49+
const saveMultiplexing = () => {
50+
dialogShow.value = false
51+
}
52+
const handleClose = () => {}
53+
defineExpose({
54+
dialogInit,
55+
})
56+
</script>
57+
58+
<style lang="less" scoped>
59+
.close-button {
60+
position: absolute;
61+
top: 18px;
62+
right: 120px;
63+
}
64+
.confirm-button {
65+
position: absolute;
66+
top: 18px;
67+
right: 20px;
68+
}
69+
.multiplexing-area {
70+
width: 100%;
71+
height: 100%;
72+
}
73+
.multiplexing-footer {
74+
position: relative;
75+
}
76+
77+
.adapt-count {
78+
position: absolute;
79+
top: 18px;
80+
left: 20px;
81+
color: #646a73;
82+
font-size: 14px;
83+
font-weight: 400;
84+
line-height: 22px;
85+
}
86+
87+
.adapt-select {
88+
position: absolute;
89+
top: 18px;
90+
right: 220px;
91+
}
92+
.adapt-text {
93+
font-size: 14px;
94+
font-weight: 400;
95+
color: #1f2329;
96+
line-height: 22px;
97+
}
98+
</style>
99+
100+
<style lang="less">
101+
.custom-drawer {
102+
.ed-drawer__footer {
103+
height: 64px !important;
104+
padding: 0 !important;
105+
box-shadow: 0 -1px 0px #d7d7d7 !important;
106+
}
107+
108+
.ed-drawer__body {
109+
padding: 0 0 64px 0 !important;
110+
}
111+
}
112+
</style>

0 commit comments

Comments
 (0)