diff --git a/.github/ISSUE_TEMPLATE/----.md b/.github/ISSUE_TEMPLATE/----.md index 7a56df6669..271ee1c842 100644 --- a/.github/ISSUE_TEMPLATE/----.md +++ b/.github/ISSUE_TEMPLATE/----.md @@ -7,4 +7,7 @@ assignees: xuwei-fit2cloud, yayanpei-fit2cloud --- +DataEase 版本: + + **请描述您的需求或者改进建议.** diff --git a/.github/ISSUE_TEMPLATE/bug---.md b/.github/ISSUE_TEMPLATE/bug---.md index 58994bde2f..4d870d9915 100644 --- a/.github/ISSUE_TEMPLATE/bug---.md +++ b/.github/ISSUE_TEMPLATE/bug---.md @@ -3,7 +3,7 @@ name: Bug 提交 about: 提交产品缺陷帮助我们更好的改进 title: "[Bug]" labels: 状态:待处理 -assignees: BBchicken-9527, Shenguobin0102, zrfit +assignees: BBchicken-9527, Shenguobin0102 --- 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-backend/src/main/java/io/dataease/dataset/server/DatasetTreeServer.java b/core/core-backend/src/main/java/io/dataease/dataset/server/DatasetTreeServer.java index 48bb4628f5..83f88fa2ce 100644 --- a/core/core-backend/src/main/java/io/dataease/dataset/server/DatasetTreeServer.java +++ b/core/core-backend/src/main/java/io/dataease/dataset/server/DatasetTreeServer.java @@ -6,7 +6,6 @@ import io.dataease.api.dataset.dto.DatasetTableDTO; import io.dataease.api.dataset.dto.SqlVariableDetails; import io.dataease.api.dataset.union.DatasetGroupInfoDTO; import io.dataease.api.dataset.vo.DataSetBarVO; -import io.dataease.commons.constants.OptConstants; import io.dataease.constant.LogOT; import io.dataease.constant.LogST; import io.dataease.dataset.manage.DatasetGroupManage; @@ -44,11 +43,13 @@ public class DatasetTreeServer implements DatasetTreeApi { return datasetGroupManage.save(dto, false); } + @DeLog(id = "#p0.id", ot = LogOT.MODIFY, st = LogST.DATASET) @Override public DatasetNodeDTO move(DatasetGroupInfoDTO dto) throws Exception { return datasetGroupManage.move(dto); } + @DeLog(id = "#p0", ot = LogOT.DELETE, st = LogST.DATASET) @Override public void delete(Long id) { datasetGroupManage.delete(id); diff --git a/core/core-backend/src/main/java/io/dataease/datasource/manage/DataSourceManage.java b/core/core-backend/src/main/java/io/dataease/datasource/manage/DataSourceManage.java index 8b0da25485..d898bc849a 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/manage/DataSourceManage.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/manage/DataSourceManage.java @@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import io.dataease.api.ds.vo.DatasourceDTO; import io.dataease.commons.constants.OptConstants; import io.dataease.constant.DataSourceType; +import io.dataease.constant.LogOT; +import io.dataease.constant.LogST; import io.dataease.datasource.dao.auto.entity.CoreDatasource; import io.dataease.datasource.dao.auto.mapper.CoreDatasourceMapper; import io.dataease.datasource.dao.ext.mapper.DataSourceExtMapper; @@ -12,6 +14,7 @@ import io.dataease.datasource.dao.ext.po.DataSourceNodePO; import io.dataease.datasource.dto.DatasourceNodeBO; import io.dataease.exception.DEException; import io.dataease.license.config.XpackInteract; +import io.dataease.log.DeLog; import io.dataease.model.BusiNodeRequest; import io.dataease.model.BusiNodeVO; import io.dataease.operation.manage.CoreOptRecentManage; @@ -25,7 +28,6 @@ import org.springframework.stereotype.Component; import java.util.ArrayList; import java.util.List; -import java.util.stream.Collectors; @Component public class DataSourceManage { @@ -71,12 +73,14 @@ public class DataSourceManage { return TreeUtils.mergeTree(nodes, BusiNodeVO.class, false); } + @DeLog(id = "#p0.id", pid = "#p0.pid", ot = LogOT.CREATE, st = LogST.DATASOURCE) @XpackInteract(value = "datasourceResourceTree", before = false) public void innerSave(CoreDatasource coreDatasource) { coreDatasourceMapper.insert(coreDatasource); - coreOptRecentManage.saveOpt(coreDatasource.getId(), OptConstants.OPT_RESOURCE_TYPE.DATASOURCE,OptConstants.OPT_TYPE.NEW); + coreOptRecentManage.saveOpt(coreDatasource.getId(), OptConstants.OPT_RESOURCE_TYPE.DATASOURCE, OptConstants.OPT_TYPE.NEW); } + @DeLog(id = "#p0.id", ot = LogOT.MODIFY, st = LogST.DATASOURCE) @XpackInteract(value = "datasourceResourceTree", before = false) public void innerEdit(CoreDatasource coreDatasource) { UpdateWrapper updateWrapper = new UpdateWrapper<>(); @@ -84,9 +88,10 @@ public class DataSourceManage { coreDatasource.setUpdateTime(System.currentTimeMillis()); coreDatasource.setUpdateBy(AuthUtils.getUser().getUserId()); coreDatasourceMapper.update(coreDatasource, updateWrapper); - coreOptRecentManage.saveOpt(coreDatasource.getId(), OptConstants.OPT_RESOURCE_TYPE.DATASOURCE,OptConstants.OPT_TYPE.UPDATE); + coreOptRecentManage.saveOpt(coreDatasource.getId(), OptConstants.OPT_RESOURCE_TYPE.DATASOURCE, OptConstants.OPT_TYPE.UPDATE); } + @DeLog(id = "#p0.id", ot = LogOT.MODIFY, st = LogST.DATASOURCE) @XpackInteract(value = "datasourceResourceTree", before = false) public void innerEditStatus(CoreDatasource coreDatasource) { UpdateWrapper updateWrapper = new UpdateWrapper<>(); @@ -94,6 +99,7 @@ public class DataSourceManage { coreDatasourceMapper.update(coreDatasource, updateWrapper); } + @DeLog(id = "#p0.id", ot = LogOT.MODIFY, st = LogST.DATASOURCE) @XpackInteract(value = "datasourceResourceTree", before = false) public void move(DatasourceDTO dataSourceDTO) { Long id = dataSourceDTO.getId(); @@ -106,6 +112,6 @@ public class DataSourceManage { sourceData.setPid(dataSourceDTO.getPid()); sourceData.setName(dataSourceDTO.getName()); coreDatasourceMapper.updateById(sourceData); - coreOptRecentManage.saveOpt(sourceData.getId(), OptConstants.OPT_RESOURCE_TYPE.DATASOURCE,OptConstants.OPT_TYPE.UPDATE); + coreOptRecentManage.saveOpt(sourceData.getId(), OptConstants.OPT_RESOURCE_TYPE.DATASOURCE, OptConstants.OPT_TYPE.UPDATE); } } diff --git a/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java b/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java index ee875b83aa..a9bfac4eb8 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java @@ -14,6 +14,8 @@ import io.dataease.api.ds.vo.*; import io.dataease.commons.constants.TaskStatus; import io.dataease.commons.utils.CommonThreadPool; import io.dataease.constant.DataSourceType; +import io.dataease.constant.LogOT; +import io.dataease.constant.LogST; import io.dataease.dataset.dto.DatasourceSchemaDTO; import io.dataease.dataset.manage.DatasetDataManage; import io.dataease.dataset.utils.TableUtils; @@ -35,6 +37,7 @@ import io.dataease.i18n.Translator; import io.dataease.job.sechedule.CheckDsStatusJob; import io.dataease.job.sechedule.ScheduleManager; import io.dataease.license.config.XpackInteract; +import io.dataease.log.DeLog; import io.dataease.model.BusiNodeRequest; import io.dataease.model.BusiNodeVO; import io.dataease.system.dao.auto.entity.CoreSysSetting; @@ -136,7 +139,7 @@ public class DatasourceServer implements DatasourceApi { dataSourceManage.move(dataSourceDTO); } case "rename" -> { - if(StringUtils.isEmpty(dataSourceDTO.getName())){ + if (StringUtils.isEmpty(dataSourceDTO.getName())) { DEException.throwException("名称不能为空!"); } CoreDatasource datasource = datasourceMapper.selectById(dataSourceDTO.getId()); @@ -550,6 +553,7 @@ public class DatasourceServer implements DatasourceApi { return datasourceDTO; } + @DeLog(id = "#p0", ot = LogOT.DELETE, st = LogST.DATASOURCE) @Override @XpackInteract(value = "datasourceResourceTree", before = false) public void delete(Long datasourceId) throws DEException { 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); } } 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-backend/src/main/java/io/dataease/visualization/server/DataVisualizationServer.java b/core/core-backend/src/main/java/io/dataease/visualization/server/DataVisualizationServer.java index 4d251d107e..81b527fc19 100644 --- a/core/core-backend/src/main/java/io/dataease/visualization/server/DataVisualizationServer.java +++ b/core/core-backend/src/main/java/io/dataease/visualization/server/DataVisualizationServer.java @@ -17,8 +17,10 @@ import io.dataease.chart.manage.ChartViewManege; import io.dataease.commons.constants.DataVisualizationConstants; import io.dataease.commons.constants.OptConstants; import io.dataease.constant.CommonConstants; +import io.dataease.constant.LogOT; import io.dataease.exception.DEException; import io.dataease.license.config.XpackInteract; +import io.dataease.log.DeLog; import io.dataease.model.BusiNodeRequest; import io.dataease.model.BusiNodeVO; import io.dataease.operation.manage.CoreOptRecentManage; @@ -89,6 +91,17 @@ public class DataVisualizationServer implements DataVisualizationApi { @Resource private VisualizationWatermarkMapper watermarkMapper; + @DeLog(id = "#p0", ot = LogOT.READ, stExp = "#p1") + @Override + public DataVisualizationVO findCopyResource(Long dvId, String busiFlag) { + DataVisualizationVO result = findById(dvId, busiFlag); + if(result !=null && result.getPid() == -1){ + return result; + }else{ + return null; + } + } + @Override @XpackInteract(value = "dataVisualizationServer", original = true) public DataVisualizationVO findById(Long dvId, String busiFlag) { @@ -111,6 +124,7 @@ public class DataVisualizationServer implements DataVisualizationApi { return null; } + @DeLog(id = "#p0.id", pid = "#p0.pid", ot = LogOT.CREATE, stExp = "#p0.type") @Override @Transactional public String saveCanvas(DataVisualizationBaseRequest request) { @@ -123,11 +137,13 @@ public class DataVisualizationServer implements DataVisualizationApi { visualizationInfo.setSelfWatermarkStatus(0); } Long newDvId = coreVisualizationManage.innerSave(visualizationInfo); + request.setId(newDvId); //保存视图信 chartDataManage.saveChartViewFromVisualization(request.getComponentData(), newDvId, request.getCanvasViewInfo()); return newDvId.toString(); } + @DeLog(id = "#p0.id", ot = LogOT.MODIFY, stExp = "#p0.type") @Override @Transactional public void updateCanvas(DataVisualizationBaseRequest request) { @@ -168,6 +184,7 @@ public class DataVisualizationServer implements DataVisualizationApi { * @Description: 更新基础信息; * 为什么单独接口:1.基础信息更新频繁数据且数据载量较小;2.防止出现更新过多信息的情况,造成视图的误删等操作 */ + @DeLog(id = "#p0.id", ot = LogOT.MODIFY, stExp = "#p0.type") @Override @Transactional public void updateBase(DataVisualizationBaseRequest request) { @@ -181,6 +198,7 @@ public class DataVisualizationServer implements DataVisualizationApi { /** * @Description: 逻辑删除可视化信息;将delete_flag 置为0 */ + @DeLog(id = "#p0", ot = LogOT.DELETE, stExp = "#p1") @Transactional @Override public void deleteLogic(Long dvId, String busiFlag) { @@ -193,6 +211,7 @@ public class DataVisualizationServer implements DataVisualizationApi { return coreVisualizationManage.tree(request); } + @DeLog(id = "#p0.id", pid = "#p0.pid", ot = LogOT.MODIFY, stExp = "#p0.type") @Transactional @Override public void move(DataVisualizationBaseRequest request) { diff --git a/core/core-frontend/src/api/visualization/dataVisualization.ts b/core/core-frontend/src/api/visualization/dataVisualization.ts index c322c48ebc..4cc7e31538 100644 --- a/core/core-frontend/src/api/visualization/dataVisualization.ts +++ b/core/core-frontend/src/api/visualization/dataVisualization.ts @@ -16,6 +16,10 @@ export interface Panel { updateBy: string } +export const findCopyResource = async (dvId, busiFlag): Promise => { + return request.get({ url: '/dataVisualization/findCopyResource/' + dvId + '/' + busiFlag }) +} + export const findById = async (dvId, busiFlag): Promise => { let busiFlagResult = busiFlag if (!busiFlagResult) { 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/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/components/data-visualization/canvas/ComponentWrapper.vue b/core/core-frontend/src/components/data-visualization/canvas/ComponentWrapper.vue index 59655240de..bc343811f0 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/ComponentWrapper.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/ComponentWrapper.vue @@ -133,7 +133,10 @@ const componentBackgroundStyle = computed(() => { innerPadding, borderRadius } = config.value.commonBackground - const style = { padding: innerPadding + 'px', borderRadius: borderRadius + 'px' } + const style = { + padding: innerPadding * deepScale.value + 'px', + borderRadius: borderRadius + 'px' + } let colorRGBA = '' if (backgroundColorSelect && backgroundColor) { colorRGBA = backgroundColor diff --git a/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue b/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue index 6b55cce64d..7c6dba19d4 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue @@ -141,7 +141,7 @@ const restore = () => { cellWidth.value = canvasWidth / pcMatrixCount.value.x cellHeight.value = canvasHeight / pcMatrixCount.value.y scaleWidth.value = isMainCanvas(canvasId.value) - ? scaleWidth.value * 1.5 + ? scaleWidth.value * 1.2 : outerScale.value * 100 } else { changeRefComponentsSizeWithScale( 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/common/CommonAttr.vue b/core/core-frontend/src/custom-component/common/CommonAttr.vue index 75314390db..7a805481d9 100644 --- a/core/core-frontend/src/custom-component/common/CommonAttr.vue +++ b/core/core-frontend/src/custom-component/common/CommonAttr.vue @@ -102,6 +102,12 @@ onMounted(() => { }) }) }) +const stopEvent = e => { + if (e && e.code === 'Enter') { + e.stopPropagation() + e.preventDefault() + } +}
- - - - - + + + + + + + + + + + + + + + + - - + +
+ ≤{{ 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..790f56f570 --- /dev/null +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/IndicatorValueSelector.vue @@ -0,0 +1,650 @@ + + + + + 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(() => { -