From 7c117335ffa4847e0450e4ad2eccec22bde19212 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 18 Jan 2024 12:13:11 +0800 Subject: [PATCH 01/28] =?UTF-8?q?perf:=20=E5=90=8C=E6=AD=A5=E6=B8=B8?= =?UTF-8?q?=E7=A6=BB=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/ResourceMonitorManage.java | 6 ++--- core/core-frontend/src/views/about/index.vue | 22 ++++++++++++------- de-xpack | 2 +- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/rmonitor/manage/ResourceMonitorManage.java b/core/core-backend/src/main/java/io/dataease/rmonitor/manage/ResourceMonitorManage.java index 920e90cd3b..d234616ea9 100644 --- a/core/core-backend/src/main/java/io/dataease/rmonitor/manage/ResourceMonitorManage.java +++ b/core/core-backend/src/main/java/io/dataease/rmonitor/manage/ResourceMonitorManage.java @@ -44,7 +44,7 @@ public class ResourceMonitorManage { if (CollectionUtils.isNotEmpty(dsFreeResources)) { List dsBos = dsFreeResources.stream().map(node -> { PerMonitorNodeBO bo = BeanUtils.copyBean(new PerMonitorNodeBO(), node); - bo.setLeaf(StringUtils.equals("folder", node.getType())); + bo.setLeaf(!StringUtils.equals("folder", node.getType())); return bo; }).collect(Collectors.toList()); List dsTree = TreeUtils.mergeTree(dsBos, PerMonitorNodeBO.class, false); @@ -55,7 +55,7 @@ public class ResourceMonitorManage { if (CollectionUtils.isNotEmpty(datasetFreeResources)) { List datasetBos = datasetFreeResources.stream().map(node -> { PerMonitorNodeBO bo = BeanUtils.copyBean(new PerMonitorNodeBO(), node); - bo.setLeaf(StringUtils.equals("folder", node.getNodeType())); + bo.setLeaf(!StringUtils.equals("folder", node.getNodeType())); return bo; }).collect(Collectors.toList()); List datasetTree = TreeUtils.mergeTree(datasetBos, PerMonitorNodeBO.class, false); @@ -69,7 +69,7 @@ public class ResourceMonitorManage { List freeResource = entry.getValue(); List visualBos = freeResource.stream().map(node -> { PerMonitorNodeBO bo = BeanUtils.copyBean(new PerMonitorNodeBO(), node); - bo.setLeaf(StringUtils.equals("folder", node.getNodeType())); + bo.setLeaf(!StringUtils.equals("folder", node.getNodeType())); return bo; }).collect(Collectors.toList()); result.put(convertBusiFlag(entry.getKey()), TreeUtils.mergeTree(visualBos, PerMonitorNodeBO.class, false)); diff --git a/core/core-frontend/src/views/about/index.vue b/core/core-frontend/src/views/about/index.vue index 8c2f319fe6..b9390fa23b 100644 --- a/core/core-frontend/src/views/about/index.vue +++ b/core/core-frontend/src/views/about/index.vue @@ -11,7 +11,7 @@ import { syncFreeApi, delFreeApi } from '@/api/about' -import { ElMessage, ElMessageBox } from 'element-plus-secondary' +import { ElMessage, ElMessageBox, Action } from 'element-plus-secondary' import { useI18n } from '@/hooks/web/useI18n' import { useEmitt } from '@/hooks/web/useEmitt' const dialogVisible = ref(false) @@ -141,14 +141,20 @@ const checkFree = () => { message: h('div', { class: 'free-sync-tip-box' }, childrenDomList), showClose: false, cancelButtonText: '删除', - confirmButtonText: '同步' + cancelButtonClass: 'free-cancel-bt', + showCancelButton: false, + preButtonType: 'danger', + preButtonText: '删除', + showPreButton: true, + confirmButtonText: '同步', + callback: (action: Action) => { + if (action === 'confirm') { + syncFree() + } else { + delFree + } + } }) - .then(() => { - syncFree() - }) - .catch(() => { - delFree() - }) } }) } diff --git a/de-xpack b/de-xpack index e71e615287..2012e4fb3c 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit e71e6152874ed49933d3befeee6ea2c9310a94f4 +Subproject commit 2012e4fb3c3169330cc70b09e4e77d144b22031b From 24f9fc46f2da7e593b6c95a0ed1f0be927d51501 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Thu, 18 Jan 2024 12:25:38 +0800 Subject: [PATCH 02/28] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE-=E6=A0=87?= =?UTF-8?q?=E9=A2=98):=20=E6=A0=87=E9=A2=98=E5=AD=97=E4=BD=93=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F=E9=BB=98=E8=AE=A416#6729?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/models/chart/chart-style.d.ts | 2 +- .../src/views/chart/components/editor/util/chart.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/core-frontend/src/models/chart/chart-style.d.ts b/core/core-frontend/src/models/chart/chart-style.d.ts index f48e097cdb..24c288e67b 100644 --- a/core/core-frontend/src/models/chart/chart-style.d.ts +++ b/core/core-frontend/src/models/chart/chart-style.d.ts @@ -43,7 +43,7 @@ declare interface ChartTextStyle { /** * 字体大小 */ - fontSize: string + fontSize: number /** * 颜色 */ diff --git a/core/core-frontend/src/views/chart/components/editor/util/chart.ts b/core/core-frontend/src/views/chart/components/editor/util/chart.ts index 75b406991e..7deaff1404 100644 --- a/core/core-frontend/src/views/chart/components/editor/util/chart.ts +++ b/core/core-frontend/src/views/chart/components/editor/util/chart.ts @@ -333,7 +333,7 @@ export const DEFAULT_TABLE_CELL: ChartTableCellAttr = { } export const DEFAULT_TITLE_STYLE: ChartTextStyle = { show: true, - fontSize: '18', + fontSize: 16, color: '#ffffff', hPosition: 'left', vPosition: 'top', @@ -349,7 +349,7 @@ export const DEFAULT_TITLE_STYLE: ChartTextStyle = { export const DEFAULT_TITLE_STYLE_BASE: ChartTextStyle = { show: true, - fontSize: '18', + fontSize: 16, hPosition: 'left', vPosition: 'top', isItalic: false, From ec4d3006f7cc3324de3f1284225cc1e8d8daf4d0 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 18 Jan 2024 13:59:29 +0800 Subject: [PATCH 03/28] =?UTF-8?q?refactor:=20=E5=AF=8C=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E5=AF=8C=E6=96=87=E6=9C=AC=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=E7=BC=96=E8=BE=91=E7=8A=B6=E6=80=81=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E8=81=9A=E7=84=A6=E5=9C=A8=E6=96=87=E6=A1=A3=E6=9C=AB?= =?UTF-8?q?=E5=B0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rich-text/DeRichTextView.vue | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) 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 8d39d7496d..b3928e573d 100644 --- a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue +++ b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue @@ -293,9 +293,29 @@ const reShow = () => { editShow.value = false nextTick(() => { editShow.value = true + editCursor() }) } +const editCursor = () => { + setTimeout(() => { + const myDiv = document.getElementById(tinymceId) + // 让光标聚焦到文本末尾 + const range = document.createRange() + const sel = window.getSelection() + if (myDiv.childNodes) { + range.setStart(myDiv.childNodes[myDiv.childNodes.length - 1], 1) + range.collapse(false) + sel.removeAllRanges() + sel.addRange(range) + } + // 对于一些浏览器,可能需要设置光标到最后的另一种方式 + if (myDiv.focus) { + myDiv.focus() + } + }, 100) +} + const calcData = (view: Chart, callback) => { isError.value = false if (view.tableId || view['dataFrom'] === 'template') { From 0a30b031874c53b5e4f70dac6337e57c58aab8d6 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Thu, 18 Jan 2024 15:49:13 +0800 Subject: [PATCH 04/28] =?UTF-8?q?feat:=20=E6=95=B0=E6=8D=AE=E6=BA=90?= =?UTF-8?q?=E3=80=81=E6=95=B0=E6=8D=AE=E9=9B=86=E8=BF=87=E6=BB=A4=E6=98=AF?= =?UTF-8?q?=E5=8C=BA=E5=88=86=E5=A4=A7=E5=B0=8F=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/views/visualized/data/dataset/index.vue | 2 +- .../src/views/visualized/data/datasource/index.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/views/visualized/data/dataset/index.vue b/core/core-frontend/src/views/visualized/data/dataset/index.vue index 142fe6429d..b7c35f3ae3 100644 --- a/core/core-frontend/src/views/visualized/data/dataset/index.vue +++ b/core/core-frontend/src/views/visualized/data/dataset/index.vue @@ -455,7 +455,7 @@ watch(nickName, (val: string) => { const filterNode = (value: string, data: BusiTreeNode) => { if (!value) return true - return data.name?.toLocaleLowerCase().includes(value.toLocaleLowerCase()) + return data.name?.includes(value) } const getMenuList = (val: boolean) => { diff --git a/core/core-frontend/src/views/visualized/data/datasource/index.vue b/core/core-frontend/src/views/visualized/data/datasource/index.vue index a9a8c418c3..3730d8d41d 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/index.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/index.vue @@ -535,7 +535,7 @@ const nodeCollapse = data => { const filterNode = (value: string, data: BusiTreeNode) => { if (!value) return true - return data.name?.toLocaleLowerCase().includes(value.toLocaleLowerCase()) + return data.name?.includes(value) } const editDatasource = (editType?: number) => { From 5e5abc7db155ecd12068c20dff9d49ad4d4338a0 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 18 Jan 2024 16:01:10 +0800 Subject: [PATCH 05/28] =?UTF-8?q?style:=20=E6=97=A5=E5=BF=97=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=85=A5=E5=8F=A3=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/assets/svg/toolbox-log.svg | 6 ++++++ core/core-frontend/src/layout/components/ToolboxCfg.vue | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 core/core-frontend/src/assets/svg/toolbox-log.svg diff --git a/core/core-frontend/src/assets/svg/toolbox-log.svg b/core/core-frontend/src/assets/svg/toolbox-log.svg new file mode 100644 index 0000000000..14d4bb3484 --- /dev/null +++ b/core/core-frontend/src/assets/svg/toolbox-log.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/core/core-frontend/src/layout/components/ToolboxCfg.vue b/core/core-frontend/src/layout/components/ToolboxCfg.vue index 9b0d8a8d21..28fadec780 100644 --- a/core/core-frontend/src/layout/components/ToolboxCfg.vue +++ b/core/core-frontend/src/layout/components/ToolboxCfg.vue @@ -43,8 +43,8 @@ onMounted(() => { :show-arrow="false" popper-class="toolbox-top-popover" placement="bottom-end" - width="112" - trigger="hover" + width="208" + trigger="click" > { From 4890307b65428f6155e5ee9a87d5ff6f1118e8fb Mon Sep 17 00:00:00 2001 From: taojinlong Date: Thu, 18 Jan 2024 16:55:50 +0800 Subject: [PATCH 06/28] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81db2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/visualized/data/datasource/form/option.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/core-frontend/src/views/visualized/data/datasource/form/option.ts b/core/core-frontend/src/views/visualized/data/datasource/form/option.ts index 9bbcd6cdeb..a5d81cc45d 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/form/option.ts +++ b/core/core-frontend/src/views/visualized/data/datasource/form/option.ts @@ -2,6 +2,12 @@ import { useI18n } from '@/hooks/web/useI18n' const { t } = useI18n() export const dsTypes = [ + { + type: 'db2', + name: 'Db2', + catalog: 'OLTP', + extraParams: '' + }, { type: 'mysql', name: 'MySQL', From 29f47068ddcfd253220e47c0f291dfb0a8c78a2b Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Thu, 18 Jan 2024 17:31:15 +0800 Subject: [PATCH 07/28] =?UTF-8?q?fix(=E8=A7=86=E5=9B=BE-=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?):=20=E6=A8=AA=E5=90=91=E6=8B=96=E5=8A=A8=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E6=9D=A1=E8=A1=A8=E5=A4=B4=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= =?UTF-8?q?#7510?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/panel/charts/table/table-info.ts | 19 +++++++++++-------- .../js/panel/charts/table/table-normal.ts | 16 ++++++++++------ 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts index 3bd043522b..5598694315 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts @@ -1,4 +1,4 @@ -import { DataCell, S2Event, S2Options, TableSheet } from '@antv/s2/esm/index' +import { S2Event, S2Options, TableColCell, TableDataCell, TableSheet } from '@antv/s2/esm/index' import { formatterItem, valueFormatter } from '../../../formatter' import { parseJson } from '../../../util' import { S2ChartView, S2DrawOptions } from '../../types/impl/s2' @@ -104,22 +104,25 @@ export class TableInfo extends S2ChartView { } // 开启序号之后,第一列就是序号列,修改 label 即可 if (s2Options.showSeriesNumber) { - s2Options.colCell = node => { + s2Options.colCell = (node, sheet, config) => { if (node.colIndex === 0) { - if (!customAttr.tableHeader.indexLabel) { - node.label = ' ' - } else { - node.label = customAttr.tableHeader.indexLabel + let indexLabel = customAttr.tableHeader.indexLabel + if (!indexLabel) { + indexLabel = '' } + const cell = new TableColCell(node, sheet, config) + const shape = cell.getTextShape() as any + shape.attrs.text = indexLabel + return cell } - return node.belongsCell + return new TableColCell(node, sheet, config) } s2Options.dataCell = viewMeta => { if (viewMeta.colIndex === 0) { viewMeta.fieldValue = pageInfo.pageSize * (pageInfo.currentPage - 1) + viewMeta.rowIndex + 1 } - return new DataCell(viewMeta, viewMeta?.spreadsheet) + return new TableDataCell(viewMeta, viewMeta?.spreadsheet) } } diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts index 0a3392b77b..6cf018e33a 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts @@ -6,6 +6,7 @@ import { getCurrentField } from '@/views/chart/components/js/panel/common/common import { TABLE_EDITOR_PROPERTY, TABLE_EDITOR_PROPERTY_INNER } from './common' import { useI18n } from '@/hooks/web/useI18n' import { isNumber } from 'lodash-es' +import { TableColCell } from '@antv/s2' const { t } = useI18n() /** @@ -106,15 +107,18 @@ export class TableNormal extends S2ChartView { } // 开启序号之后,第一列就是序号列,修改 label 即可 if (s2Options.showSeriesNumber) { - s2Options.colCell = node => { + s2Options.colCell = (node, sheet, config) => { if (node.colIndex === 0) { - if (!customAttr.tableHeader.indexLabel) { - node.label = ' ' - } else { - node.label = customAttr.tableHeader.indexLabel + let indexLabel = customAttr.tableHeader.indexLabel + if (!indexLabel) { + indexLabel = '' } + const cell = new TableColCell(node, sheet, config) + const shape = cell.getTextShape() as any + shape.attrs.text = indexLabel + return cell } - return node.belongsCell + return new TableColCell(node, sheet, config) } } From 4128adf5fc4592b55fa1722a53b178967545d46a Mon Sep 17 00:00:00 2001 From: taojinlong Date: Thu, 18 Jan 2024 17:53:34 +0800 Subject: [PATCH 08/28] =?UTF-8?q?=20fix:=20=E9=99=90=E5=88=B6=20mysql=20?= =?UTF-8?q?=E9=9D=9E=E6=B3=95=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/io/dataease/datasource/type/Mysql.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/core-backend/src/main/java/io/dataease/datasource/type/Mysql.java b/core/core-backend/src/main/java/io/dataease/datasource/type/Mysql.java index fad120d167..b6e0e8e6e4 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/type/Mysql.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/type/Mysql.java @@ -6,6 +6,7 @@ import lombok.Data; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; +import java.net.URLDecoder; import java.util.Arrays; import java.util.List; @@ -25,7 +26,7 @@ public class Mysql extends DatasourceConfiguration { .replace("DATABASE", getDataBase().trim()); } else { for (String illegalParameter : illegalParameters) { - if (getExtraParams().toLowerCase().contains(illegalParameter.toLowerCase())) { + if (getExtraParams().toLowerCase().contains(illegalParameter.toLowerCase()) || URLDecoder.decode(getExtraParams()).contains(illegalParameter.toLowerCase())) { DEException.throwException("Illegal parameter: " + illegalParameter); } } From e38f14b40dc8cbb9079d8f8ebc3fb43b82ace82c Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Thu, 18 Jan 2024 18:53:22 +0800 Subject: [PATCH 09/28] =?UTF-8?q?fix(=E8=A7=86=E5=9B=BE-=E6=B0=B4=E6=B3=A2?= =?UTF-8?q?=E5=9B=BE):=20=E6=95=B0=E5=80=BC=E8=BF=87=E5=A4=A7=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/js/panel/charts/liquid/liquid.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/liquid/liquid.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/liquid/liquid.ts index c9b9143698..766ea58a48 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/liquid/liquid.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/liquid/liquid.ts @@ -112,6 +112,14 @@ export class Liquid extends G2PlotChartView { protected configLabel(chart: Chart, options: LiquidOptions): LiquidOptions { const customAttr = parseJson(chart.customAttr) + const originVal = options.percent + // 数值过大视图会异常,大于 1 无意义 + if (originVal > 1) { + options = { + ...options, + percent: 1 + } + } if (!customAttr.label?.show) { return { ...options, @@ -130,9 +138,8 @@ export class Liquid extends G2PlotChartView { fontSize: label.fontSize.toString() + 'px', color: label.color }, - formatter: function (v) { - const value = v.percent - return valueFormatter(value, labelFormatter) + formatter: () => { + return valueFormatter(originVal, labelFormatter) } } } From 9275c7e352ff93106e5752c7f4d26abcac599d6f Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 19 Jan 2024 17:38:30 +0800 Subject: [PATCH 10/28] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E4=BB=AA=E8=A1=A8=E6=9D=BF=E5=88=9B=E5=BB=BA=E6=9D=83?= =?UTF-8?q?=E9=99=90=EF=BC=8C=E5=9C=A8=E5=B7=A5=E4=BD=9C=E5=8F=B0=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E7=82=B9=E5=87=BB=E4=BD=BF=E7=94=A8=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E6=96=B0=E5=BB=BA=E8=B7=B3=E8=BD=AC=E5=88=B0=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/views/workbranch/index.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/core-frontend/src/views/workbranch/index.vue b/core/core-frontend/src/views/workbranch/index.vue index 44b369f83e..6f8d415a29 100644 --- a/core/core-frontend/src/views/workbranch/index.vue +++ b/core/core-frontend/src/views/workbranch/index.vue @@ -238,11 +238,13 @@ const toTemplateMarket = () => { } const toTemplateMarketAdd = () => { - const params = { - curPosition: 'branchCreate', - templateType: 'all' + if (havePanelAuth.value || haveScreenAuth.value) { + const params = { + curPosition: 'branchCreate', + templateType: 'all' + } + resourceCreateOpt.value.optInit(params) } - resourceCreateOpt.value.optInit(params) } fillCardInfo() From 671dd498a13018ad6051116f6b924b0171450568 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 19 Jan 2024 17:40:27 +0800 Subject: [PATCH 11/28] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F)?= =?UTF-8?q?:=20=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F=E9=94=AE=E7=9B=98?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=BB=84=E4=BB=B6=E7=A7=BB=E5=8A=A8=E5=90=8E?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E8=A7=A6=E5=8F=91=E4=BF=9D=E5=AD=98=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20#7695?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/utils/DeShortcutKey.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/core/core-frontend/src/utils/DeShortcutKey.ts b/core/core-frontend/src/utils/DeShortcutKey.ts index 0a6f846971..fe1994fd6b 100644 --- a/core/core-frontend/src/utils/DeShortcutKey.ts +++ b/core/core-frontend/src/utils/DeShortcutKey.ts @@ -180,6 +180,7 @@ function move(keyCode) { } else if (keyCode === downKey) { curComponent.value.style.top = ++curComponent.value.style.top } + snapshotStore.recordSnapshotCache('key-move') } } From e80444e420f1d295c7ad69eb0200eb3178d8b296 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 19 Jan 2024 18:04:02 +0800 Subject: [PATCH 12/28] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=9C=BA=E6=99=AF=E6=A8=A1=E6=9D=BF=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=87=BA=E7=8E=B0=E5=BA=94=E7=94=A8=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template-market/component/TemplateMarketV2Item.vue | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/core/core-frontend/src/views/template-market/component/TemplateMarketV2Item.vue b/core/core-frontend/src/views/template-market/component/TemplateMarketV2Item.vue index 9de51114a8..dd44ccbb2c 100644 --- a/core/core-frontend/src/views/template-market/component/TemplateMarketV2Item.vue +++ b/core/core-frontend/src/views/template-market/component/TemplateMarketV2Item.vue @@ -5,14 +5,10 @@ - - {{ template.title }} - + {{ template.title }} {{ t('visualization.preview') From ba18375d9c7a40e5c646b1aa40ec08962a628792 Mon Sep 17 00:00:00 2001 From: ulleo Date: Fri, 19 Jan 2024 18:06:33 +0800 Subject: [PATCH 13/28] =?UTF-8?q?feat:=20=E5=9B=BE=E8=A1=A8=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=8C=87=E6=A0=87=E5=8D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/manage/ChartDataManage.java | 16 +- .../src/assets/svg/indicator-dark.svg | 6 + .../src/assets/svg/indicator.svg | 6 + .../components/visualization/SettingMenu.vue | 4 +- .../indicator/DeIndicator.vue | 370 ++++++++++ core/core-frontend/src/locales/zh-CN.ts | 4 + .../src/models/chart/chart-style.d.ts | 32 + .../src/models/chart/editor.d.ts | 2 + core/core-frontend/src/utils/canvasStyle.ts | 7 +- core/core-frontend/src/utils/sizeAdaptor.ts | 4 +- .../components/editor/drag-item/QuotaItem.vue | 6 +- .../editor/drag-label/QuotaLabel.vue | 2 +- .../editor-senior/components/FunctionCfg.vue | 2 +- .../editor-senior/components/Threshold.vue | 100 ++- .../components/dialog/TextThresholdEdit.vue | 140 ++-- .../editor/editor-style/ChartStyle.vue | 47 +- .../components/IndicatorNameSelector.vue | 345 ++++++++++ .../components/IndicatorValueSelector.vue | 632 ++++++++++++++++++ .../editor-style/components/MiscSelector.vue | 2 +- .../views/chart/components/editor/index.vue | 12 + .../chart/components/editor/util/chart.ts | 41 ++ .../js/panel/charts/others/indicator.ts | 64 ++ .../chart/components/js/panel/types/index.ts | 3 +- .../src/views/chart/components/js/util.ts | 2 +- .../views/chart/components/views/index.vue | 8 + 25 files changed, 1756 insertions(+), 101 deletions(-) create mode 100644 core/core-frontend/src/assets/svg/indicator-dark.svg create mode 100644 core/core-frontend/src/assets/svg/indicator.svg create mode 100644 core/core-frontend/src/custom-component/indicator/DeIndicator.vue create mode 100644 core/core-frontend/src/views/chart/components/editor/editor-style/components/IndicatorNameSelector.vue create mode 100644 core/core-frontend/src/views/chart/components/editor/editor-style/components/IndicatorValueSelector.vue create mode 100644 core/core-frontend/src/views/chart/components/js/panel/charts/others/indicator.ts diff --git a/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java b/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java index 0db9a5d4e9..80f2873052 100644 --- a/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java +++ b/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java @@ -208,7 +208,7 @@ public class ChartDataManage { return emptyChartViewDTO(view); } break; - case "text": + case "indicator": case "gauge": case "liquid": xAxis = new ArrayList<>(); @@ -496,7 +496,7 @@ public class ChartDataManage { ExtWhere2Str.extWhere2sqlOjb(sqlMeta, extFilterList, transFields(allFields)); WhereTree2Str.transFilterTrees(sqlMeta, rowPermissionsTree, transFields(allFields)); - if (StringUtils.equalsAnyIgnoreCase(view.getType(), "text", "gauge", "liquid")) { + if (StringUtils.equalsAnyIgnoreCase(view.getType(), "indicator", "gauge", "liquid")) { Quota2SQLObj.quota2sqlObj(sqlMeta, yAxis, transFields(allFields)); querySql = SQLProvider.createQuerySQL(sqlMeta, true, needOrder, view); } else if (StringUtils.containsIgnoreCase(view.getType(), "stack")) { @@ -684,7 +684,7 @@ public class ChartDataManage { mapChart = ChartDataBuild.transScatterData(xAxis, yAxis, view, data, extBubble, isDrill); } else if (StringUtils.containsIgnoreCase(view.getType(), "radar")) { mapChart = ChartDataBuild.transRadarChartData(xAxis, yAxis, view, data, isDrill); - } else if (StringUtils.containsIgnoreCase(view.getType(), "text") + } else if (StringUtils.containsIgnoreCase(view.getType(), "indicator") || StringUtils.containsIgnoreCase(view.getType(), "gauge") || StringUtils.equalsIgnoreCase("liquid", view.getType())) { mapChart = ChartDataBuild.transNormalChartData(xAxis, yAxis, view, data, isDrill); @@ -708,7 +708,7 @@ public class ChartDataManage { mapChart = ChartDataBuild.transScatterDataAntV(xAxis, yAxis, view, data, extBubble, isDrill); } else if (StringUtils.containsIgnoreCase(view.getType(), "radar")) { mapChart = ChartDataBuild.transRadarChartDataAntV(xAxis, yAxis, view, data, isDrill); - } else if (StringUtils.containsIgnoreCase(view.getType(), "text") + } else if (StringUtils.containsIgnoreCase(view.getType(), "indicator") || StringUtils.containsIgnoreCase(view.getType(), "gauge") || StringUtils.equalsIgnoreCase("liquid", view.getType())) { mapChart = ChartDataBuild.transNormalChartData(xAxis, yAxis, view, data, isDrill); @@ -719,6 +719,10 @@ public class ChartDataManage { } else { mapChart = ChartDataBuild.transChartDataAntV(xAxis, yAxis, view, data, isDrill); } + } else if (StringUtils.equalsIgnoreCase(view.getRender(), "custom")) { + if (StringUtils.containsIgnoreCase(view.getType(), "indicator")) { + mapChart = ChartDataBuild.transNormalChartData(xAxis, yAxis, view, data, isDrill); + } } // table组件,明细表,也用于导出数据 Map mapTableNormal = null; @@ -1220,7 +1224,7 @@ public class ChartDataManage { return new ArrayList(); } break; - case "text": + case "indicator": case "gauge": case "liquid": xAxis = new ArrayList<>(); @@ -1276,7 +1280,7 @@ public class ChartDataManage { Table2SQLObj.table2sqlobj(sqlMeta, null, "(" + sql + ")"); WhereTree2Str.transFilterTrees(sqlMeta, rowPermissionsTree, transFields(allFields)); - if (StringUtils.equalsAnyIgnoreCase(view.getType(), "text", "gauge", "liquid")) { + if (StringUtils.equalsAnyIgnoreCase(view.getType(), "indicator", "gauge", "liquid")) { Quota2SQLObj.quota2sqlObj(sqlMeta, yAxis, transFields(allFields)); querySql = SQLProvider.createQuerySQL(sqlMeta, true, needOrder, view); } else if (StringUtils.containsIgnoreCase(view.getType(), "stack")) { diff --git a/core/core-frontend/src/assets/svg/indicator-dark.svg b/core/core-frontend/src/assets/svg/indicator-dark.svg new file mode 100644 index 0000000000..71ec539f93 --- /dev/null +++ b/core/core-frontend/src/assets/svg/indicator-dark.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/core/core-frontend/src/assets/svg/indicator.svg b/core/core-frontend/src/assets/svg/indicator.svg new file mode 100644 index 0000000000..71ec539f93 --- /dev/null +++ b/core/core-frontend/src/assets/svg/indicator.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/core/core-frontend/src/components/visualization/SettingMenu.vue b/core/core-frontend/src/components/visualization/SettingMenu.vue index 2ab8d0feb0..39b0afe1cc 100644 --- a/core/core-frontend/src/components/visualization/SettingMenu.vue +++ b/core/core-frontend/src/components/visualization/SettingMenu.vue @@ -171,7 +171,7 @@ const state = reactive({ 'richTextView', 'liquid', 'gauge', - 'text', + 'indicator', 'label', 'word-cloud', 'flow-map', @@ -181,7 +181,7 @@ const state = reactive({ 'richTextView', 'liquid', 'gauge', - 'text', + 'indicator', 'label', 'word-cloud', 'flow-map', diff --git a/core/core-frontend/src/custom-component/indicator/DeIndicator.vue b/core/core-frontend/src/custom-component/indicator/DeIndicator.vue new file mode 100644 index 0000000000..71c400b65c --- /dev/null +++ b/core/core-frontend/src/custom-component/indicator/DeIndicator.vue @@ -0,0 +1,370 @@ + + + + + diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index e39fa744a9..5288234d4c 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -792,6 +792,7 @@ export default { total: '共', items: '条数据', chart_liquid: '水波图', + chart_indicator: '指标卡', drag_block_progress: '进度指示', liquid_max: '目标值', liquid_outline_border: '边框粗细', @@ -922,6 +923,9 @@ export default { value_formatter_unit: '数量单位', value_formatter_decimal_count: '小数位数', value_formatter_suffix: '单位后缀', + indicator_suffix_placeholder: '请输入1-10个字符', + indicator_suffix: '后缀', + indicator_value: '指标值', value_formatter_thousand_separator: '千分符', value_formatter_example: '示例', unit_none: '无', diff --git a/core/core-frontend/src/models/chart/chart-style.d.ts b/core/core-frontend/src/models/chart/chart-style.d.ts index f48e097cdb..cc7d6690fa 100644 --- a/core/core-frontend/src/models/chart/chart-style.d.ts +++ b/core/core-frontend/src/models/chart/chart-style.d.ts @@ -32,6 +32,38 @@ declare interface ChartStyle { } } +declare interface ChartIndicatorStyle { + show: boolean + fontSize: string + color: string + hPosition: 'left' | 'center' | 'right' + vPosition: 'top' | 'center' | 'bottom' + isItalic: boolean + isBolder: boolean + fontFamily: string + letterSpace: string + fontShadow: boolean + + suffix: string + suffixFontSize: string + suffixColor: string + suffixIsItalic: boolean + suffixIsBolder: boolean + suffixFontFamily: string + suffixLetterSpace: string + suffixFontShadow: boolean +} +declare interface ChartIndicatorNameStyle { + show: boolean + fontSize: string + color: string + isItalic: boolean + isBolder: boolean + fontFamily: string + letterSpace: string + fontShadow: boolean +} + /** * 标题样式设置 */ diff --git a/core/core-frontend/src/models/chart/editor.d.ts b/core/core-frontend/src/models/chart/editor.d.ts index 74d63c7833..084828ee0c 100644 --- a/core/core-frontend/src/models/chart/editor.d.ts +++ b/core/core-frontend/src/models/chart/editor.d.ts @@ -20,6 +20,8 @@ declare type EditorProperty = | 'map-mapping' | 'jump-set' | 'linkage' + | 'indicator-value-selector' + | 'indicator-name-selector' declare type EditorPropertyInner = { [key in EditorProperty]?: string[] } diff --git a/core/core-frontend/src/utils/canvasStyle.ts b/core/core-frontend/src/utils/canvasStyle.ts index c9d1efe1d9..9fc8318a06 100644 --- a/core/core-frontend/src/utils/canvasStyle.ts +++ b/core/core-frontend/src/utils/canvasStyle.ts @@ -124,7 +124,9 @@ export const customAttrTrans = { 'radarSize' // 雷达占比 ], label: ['fontSize'], - tooltip: ['fontSize'] + tooltip: ['fontSize'], + indicator: ['fontSize', 'suffixFontSize'], + indicatorName: ['fontSize'] } export const customStyleTrans = { text: ['fontSize'], @@ -257,7 +259,8 @@ export const THEME_STYLE_TRANS_SLAVE1 = { export const THEME_ATTR_TRANS_MAIN = { label: ['color'], - tooltip: ['color'] + tooltip: ['color'], + indicatorName: ['color'] } export const THEME_ATTR_TRANS_MAIN_SYMBOL = { diff --git a/core/core-frontend/src/utils/sizeAdaptor.ts b/core/core-frontend/src/utils/sizeAdaptor.ts index f83f0fdfdd..250dc6b7f8 100644 --- a/core/core-frontend/src/utils/sizeAdaptor.ts +++ b/core/core-frontend/src/utils/sizeAdaptor.ts @@ -22,7 +22,9 @@ export const customAttrTrans = { textStyle: ['fontSize'] }, slider: ['fontSize'], - graphic: ['fontSize'] + graphic: ['fontSize'], + indicator: ['fontSize', 'suffixFontSize'], + indicatorName: ['fontSize'] } export const customStyleTrans = { text: ['fontSize'], diff --git a/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue b/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue index 203f6c5cff..e756211e0a 100644 --- a/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue +++ b/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue @@ -85,7 +85,9 @@ watch( const showValueFormatter = computed(() => { return ( - (props.chart.type === 'table-normal' || props.chart.type === 'table-info') && + (props.chart.type === 'table-normal' || + props.chart.type === 'table-info' || + props.chart.type === 'indicator') && (props.item.deType === 2 || props.item.deType === 3) ) }) @@ -118,7 +120,7 @@ const isEnableCompare = () => { // 暂时只支持类别轴/维度的时间类型字段 if ( t1.length > 0 && - chart.value.type !== 'text' && + chart.value.type !== 'indicator' && chart.value.type !== 'label' && chart.value.type !== 'gauge' && chart.value.type !== 'liquid' diff --git a/core/core-frontend/src/views/chart/components/editor/drag-label/QuotaLabel.vue b/core/core-frontend/src/views/chart/components/editor/drag-label/QuotaLabel.vue index 8f7d66abf9..7ae53b8c58 100644 --- a/core/core-frontend/src/views/chart/components/editor/drag-label/QuotaLabel.vue +++ b/core/core-frontend/src/views/chart/components/editor/drag-label/QuotaLabel.vue @@ -36,7 +36,7 @@ const props = defineProps({ {{ t('chart.drag_block_gauge_angel') }} - {{ + {{ t('chart.drag_block_label_value') }} {{ diff --git a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/FunctionCfg.vue b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/FunctionCfg.vue index 91961717b0..28c153e383 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/FunctionCfg.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/FunctionCfg.vue @@ -54,7 +54,7 @@ const init = () => { } } const showIgnoreOption = computed(() => { - return !equalsAny(props.chart.type, 'table-pivot', 'table-info') + return !equalsAny(props.chart.type, 'table-pivot', 'table-info', 'indicator') }) const showEmptyDataFieldCtrl = computed(() => { diff --git a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/Threshold.vue b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/Threshold.vue index 6c125d61e2..87acff1bb2 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/Threshold.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/Threshold.vue @@ -91,6 +91,7 @@ const changeLabelThreshold = () => { // check line config for (let i = 0; i < state.thresholdArr.length; i++) { const ele = state.thresholdArr[i] + console.log(ele) if (!ele.term || ele.term === '') { ElMessage.error(t('chart.exp_can_not_empty')) return @@ -109,7 +110,8 @@ const changeLabelThreshold = () => { return } } else { - if (!ele.value) { + console.log(ele.value === undefined) + if (ele.value === undefined) { ElMessage.error(t('chart.value_can_not_empty')) return } @@ -325,30 +327,54 @@ init() - + - + 阈值设置 + + + 已设置 + + + + + + + +
- - - - + + {{ t('chart.indicator_value') }} + +
+ +
- +
{{ t('chart.filter_eq') }} @@ -370,25 +396,31 @@ init() {{ t('chart.filter_between') }} - - +
+
{{ item.value }} {{ item.min }} ≤{{ t('chart.drag_block_label_value') }}≤ {{ item.max }} - - - - - - +
+
+ +
+
diff --git a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/TextThresholdEdit.vue b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/TextThresholdEdit.vue index e4d7effd0e..ae75a0f9a5 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/TextThresholdEdit.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/TextThresholdEdit.vue @@ -2,6 +2,7 @@ import { reactive } from 'vue' import { useI18n } from '@/hooks/web/useI18n' import { COLOR_PANEL } from '../../../util/chart' +import { ElSpace } from 'element-plus-secondary' const { t } = useI18n() @@ -105,62 +106,88 @@ init()
- - - - - + + + + + + + + + + + + + + + + - - + +
+ ≤{{ t('chart.drag_block_label_value') }}≤ +
+ + + +
- - - - - ≤{{ t('chart.drag_block_label_value') }}≤ - - - - +
+
{{ t('chart.textColor') }}
- - +
+ +
- +
@@ -233,4 +260,21 @@ span { width: 28px; height: 28px; } + +.color-title { + color: #646a73; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: 22px; + padding: 0 8px; +} + +.form-item { + height: 28px !important; + margin-bottom: 0 !important; + :deep(.el-form-item__label) { + font-size: 12px; + } +} diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue index 7a4ea13fe8..05a6a4d7df 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue @@ -19,6 +19,8 @@ import TableHeaderSelector from '@/views/chart/components/editor/editor-style/co import TableCellSelector from '@/views/chart/components/editor/editor-style/components/table/TableCellSelector.vue' import TableTotalSelector from '@/views/chart/components/editor/editor-style/components/table/TableTotalSelector.vue' import MiscStyleSelector from '@/views/chart/components/editor/editor-style/components/MiscStyleSelector.vue' +import IndicatorValueSelector from '@/views/chart/components/editor/editor-style/components/IndicatorValueSelector.vue' +import IndicatorNameSelector from '@/views/chart/components/editor/editor-style/components/IndicatorNameSelector.vue' const dvMainStore = dvMainStoreWithOut() const { dvInfo } = storeToRefs(dvMainStore) @@ -83,7 +85,9 @@ const emit = defineEmits([ 'onTableCellChange', 'onTableTotalChange', 'onChangeMiscStyleForm', - 'onExtTooltipChange' + 'onExtTooltipChange', + 'onIndicatorChange', + 'onIndicatorNameChange' ]) const showProperties = (property: EditorProperty) => properties.value?.includes(property) @@ -112,6 +116,14 @@ const onTextChange = (val, prop) => { state.initReady && emit('onTextChange', val, prop) } +const onIndicatorChange = (val, prop) => { + state.initReady && emit('onIndicatorChange', val, prop) +} + +const onIndicatorNameChange = (val, prop) => { + state.initReady && emit('onIndicatorNameChange', val, prop) +} + const onLegendChange = (val, prop) => { state.initReady && emit('onLegendChange', val, prop) } @@ -224,6 +236,39 @@ watch( component-position="component" /> + + + + + + +import { PropType, computed, onMounted, reactive, toRefs, watch, nextTick, ref } from 'vue' +import { useI18n } from '@/hooks/web/useI18n' +import { + COLOR_PANEL, + CHART_FONT_FAMILY, + CHART_FONT_LETTER_SPACE, + DEFAULT_INDICATOR_NAME_STYLE +} from '@/views/chart/components/editor/util/chart' +import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain' +import { storeToRefs } from 'pinia' +import { cloneDeep, defaultsDeep } from 'lodash-es' +import { ElButton, ElIcon } from 'element-plus-secondary' +import Icon from '@/components/icon-custom/src/Icon.vue' +const dvMainStore = dvMainStoreWithOut() +const { batchOptStatus } = storeToRefs(dvMainStore) + +const { t } = useI18n() + +const props = defineProps({ + chart: { + type: Object, + required: true + }, + themes: { + type: String as PropType, + default: 'dark' + }, + propertyInner: { + type: Array + } +}) + +const emit = defineEmits(['onIndicatorNameChange']) +const toolTip = computed(() => { + return props.themes === 'dark' ? 'ndark' : 'dark' +}) +const predefineColors = COLOR_PANEL +const fontFamily = CHART_FONT_FAMILY +const fontLetterSpace = CHART_FONT_LETTER_SPACE + +const state = reactive({ + indicatorNameForm: JSON.parse(JSON.stringify(DEFAULT_INDICATOR_NAME_STYLE)) +}) + +const { chart } = toRefs(props) + +const fontSizeList = computed(() => { + const arr = [] + for (let i = 10; i <= 60; i = i + 2) { + arr.push({ + name: i + '', + value: i + }) + } + return arr +}) + +const changeTitleStyle = prop => { + emit('onIndicatorNameChange', state.indicatorNameForm, prop) +} + +const init = () => { + const customText = defaultsDeep( + cloneDeep(props.chart?.customAttr?.indicatorName), + cloneDeep(DEFAULT_INDICATOR_NAME_STYLE) + ) + + state.indicatorNameForm = cloneDeep(customText) + + //第一次颜色可能赋值失败,单独赋值一次 + nextTick(() => { + state.indicatorNameForm.color = customText.color + }) +} + +onMounted(() => { + init() +}) + +watch( + () => props.chart?.customAttr?.indicatorName, + () => { + init() + }, + { deep: true } +) + + + + + diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/IndicatorValueSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/IndicatorValueSelector.vue new file mode 100644 index 0000000000..936cab9e2d --- /dev/null +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/IndicatorValueSelector.vue @@ -0,0 +1,632 @@ + + + + + diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscSelector.vue index f06bd01af6..f67134680b 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscSelector.vue @@ -577,7 +577,7 @@ onMounted(() => { -