Skip to content

Commit 71529c1

Browse files
committed
refactor: dashboard init
1 parent 7cd0f91 commit 71529c1

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

frontend/src/style.less

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ a {
3434
color: #646cff;
3535
text-decoration: inherit;
3636
}
37+
3738
a:hover {
3839
color: #535bf2;
3940
}
@@ -62,9 +63,11 @@ body {
6263
color: #213547;
6364
background-color: #ffffff;
6465
}
66+
6567
a:hover {
6668
color: #747bff;
6769
}
70+
6871
button {
6972
background-color: #f9f9f9;
7073
}
@@ -109,7 +112,6 @@ body {
109112
}
110113

111114

112-
113115
.hover-icon {
114116
cursor: pointer;
115117
height: 24px !important;
@@ -131,4 +133,7 @@ body {
131133
}
132134
}
133135

134-
136+
.tox-toolbar__primary {
137+
min-width: 780px !important;
138+
flex-wrap: wrap !important;
139+
}

frontend/src/views/dashboard/components/sq-text/index.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,18 @@ const props = defineProps({
5050
type: Boolean,
5151
default: false,
5252
},
53+
showPosition: {
54+
type: String,
55+
required: false,
56+
default: 'preview',
57+
},
5358
})
5459
55-
const { configItem } = toRefs(props)
56-
const tinymceId = 'vue-tinymce-' + +new Date() + ((Math.random() * 1000).toFixed(0) + '')
60+
const { configItem, showPosition } = toRefs(props)
61+
const tinymceId = 'tinymce-view-' + configItem.value.id + '-' + showPosition.value
5762
const init = reactive({
5863
selector: tinymceId,
64+
toolbar_items_size: 'small',
5965
language_url: '/tinymce-sqlbot-private/langs/zh_CN.js',
6066
language: 'zh_CN',
6167
skin_url: '/tinymce-sqlbot-private/skins/ui/oxide',
@@ -86,12 +92,6 @@ const isDisabled = computed(() => props.disabled || !configItem.value.editing)
8692
8793
const setEdit = () => {
8894
configItem.value.editing = true
89-
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
90-
const ed = tinymce.editors[tinymceId]
91-
ed.setContent(configItem.value.propValue)
92-
nextTick(() => {
93-
editCursor()
94-
})
9595
}
9696
9797
const editCursor = () => {

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ const baseParams = computed(() => {
6969
<template>
7070
<div class="editor-main">
7171
<Toolbar :base-params="baseParams" @add-component="addComponent"></Toolbar>
72-
<DashboardEditor ref="dashboardEditorRef" :canvas-component-data="componentData">
72+
<DashboardEditor
73+
v-if="dataInitState"
74+
ref="dashboardEditorRef"
75+
:canvas-component-data="componentData"
76+
>
7377
</DashboardEditor>
7478
</div>
7579
</template>

0 commit comments

Comments
 (0)