From 59612e4734d506c240998fc0a4cd72c16aec97ea Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 16 May 2024 14:06:43 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E7=BB=84=E4=BB=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=97=B4=E8=B7=9D=E7=BB=84=E4=BB=B6=E7=AD=89?= =?UTF-8?q?=20=20#9542?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/package.json | 1 + .../src/custom-component/rich-text/DeRichTextView.vue | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/core-frontend/package.json b/core/core-frontend/package.json index 9741a9d41d..673abee0e9 100644 --- a/core/core-frontend/package.json +++ b/core/core-frontend/package.json @@ -18,6 +18,7 @@ "@antv/l7plot": "^0.5.5", "@antv/s2": "^1.49.0", "@codemirror/lang-sql": "^6.4.0", + "@npkg/tinymce-plugins": "^0.0.7", "@tinymce/tinymce-vue": "^5.1.0", "@vueuse/core": "^9.13.0", "ace-builds": "^1.15.3", diff --git a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue index bc2b408be1..ddf80cccb3 100644 --- a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue +++ b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue @@ -47,6 +47,7 @@ import 'tinymce/plugins/contextmenu' // contextmenu import 'tinymce/plugins/directionality' import 'tinymce/plugins/nonbreaking' import 'tinymce/plugins/pagebreak' +import '@npkg/tinymce-plugins/letterspacing' import './plugins' //自定义插件 import { computed, nextTick, reactive, ref, toRefs, watch, onMounted, PropType } from 'vue' import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot' @@ -124,7 +125,7 @@ const init = ref({ 'vertical-content advlist autolink link image lists charmap media wordcount table contextmenu directionality pagebreak', // 插件 // 工具栏 toolbar: - 'undo redo |fontselect fontsizeselect |forecolor backcolor bold italic |underline strikethrough link| formatselect |' + + 'undo redo |letterspacing fontselect fontsizeselect |forecolor backcolor bold italic |underline strikethrough link| formatselect |' + 'top-align center-align bottom-align | alignleft aligncenter alignright | bullist numlist |' + ' blockquote subscript superscript removeformat | table image | fullscreen ' + '| bdmap indent2em lineheight formatpainter axupimgs', From 49529b63a1e2e3266195e3a13f8d5f1a535d6610 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 16 May 2024 18:09:07 +0800 Subject: [PATCH 2/3] =?UTF-8?q?refactor(=E5=9B=BE=E7=89=87):=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=AF=8C=E6=96=87=E6=9C=ACToolbar=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/custom-component/rich-text/DeRichTextView.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue index ddf80cccb3..19f2d33aed 100644 --- a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue +++ b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue @@ -122,10 +122,10 @@ const init = ref({ skin_url: formatDataEaseBi('./tinymce-dataease-private/skins/ui/oxide'), // 皮肤 content_css: formatDataEaseBi('./tinymce-dataease-private/skins/content/default/content.css'), plugins: - 'vertical-content advlist autolink link image lists charmap media wordcount table contextmenu directionality pagebreak', // 插件 + 'vertical-content advlist autolink link image lists charmap media wordcount table contextmenu directionality pagebreak letterspacing', // 插件 // 工具栏 toolbar: - 'undo redo |letterspacing fontselect fontsizeselect |forecolor backcolor bold italic |underline strikethrough link| formatselect |' + + 'undo redo | fontselect fontsizeselect |forecolor backcolor bold italic letterspacing |underline strikethrough link| formatselect |' + 'top-align center-align bottom-align | alignleft aligncenter alignright | bullist numlist |' + ' blockquote subscript superscript removeformat | table image | fullscreen ' + '| bdmap indent2em lineheight formatpainter axupimgs', From d9a72fb3a69cc6f8c5e5ac887eda7ed10fd91adc Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 16 May 2024 19:41:24 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat(=E5=9B=BE=E8=A1=A8):=20=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E3=80=81=E8=BF=87=E6=BB=A4=E7=BB=84=E4=BB=B6=E7=AD=89?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E7=9B=B4=E6=8E=A5=E5=9C=A8=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=8C=BA=E4=BF=AE=E6=94=B9=E6=A0=87=E9=A2=98?= =?UTF-8?q?=20#8867?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/chart/components/editor/index.vue | 65 ++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/core/core-frontend/src/views/chart/components/editor/index.vue b/core/core-frontend/src/views/chart/components/editor/index.vue index f8ef28dcc3..04670bc946 100644 --- a/core/core-frontend/src/views/chart/components/editor/index.vue +++ b/core/core-frontend/src/views/chart/components/editor/index.vue @@ -59,6 +59,9 @@ const snapshotStore = snapshotStoreWithOut() const dvMainStore = dvMainStoreWithOut() const { canvasCollapse, curComponent, componentData, editMode } = storeToRefs(dvMainStore) const router = useRouter() +let componentNameEdit = ref(false) +let inputComponentName = ref('') +let componentNameInput = ref(null) const { t } = useI18n() const loading = ref(false) @@ -93,6 +96,35 @@ const editCalcField = ref(false) const isCalcFieldAdd = ref(true) const calcEdit = ref() const route = useRoute() + +const onComponentNameChange = () => { + snapshotStore.recordSnapshotCache() +} + +const closeEditComponentName = () => { + componentNameEdit.value = false + if (!inputComponentName.value || !inputComponentName.value.trim()) { + return + } + if (inputComponentName.value.trim() === view.value.title) { + return + } + if (inputComponentName.value.trim().length > 64 || inputComponentName.value.trim().length < 2) { + ElMessage.warning('名称字段长度2-64个字符') + editComponentName() + return + } + view.value.title = inputComponentName.value + inputComponentName.value = '' +} + +const editComponentName = () => { + componentNameEdit.value = true + inputComponentName.value = view.value.title + nextTick(() => { + componentNameInput.value.focus() + }) +} const toolTip = computed(() => { return props.themes === 'dark' ? 'ndark' : 'dark' }) @@ -1511,7 +1543,9 @@ const drop = (ev: MouseEvent, type = 'xAxis') => {
- {{ view.title }} + {{ + view.title + }} @@ -2897,6 +2931,15 @@ const drop = (ev: MouseEvent, type = 'xAxis') => {
+ + +