diff --git a/core/core-backend/src/main/java/io/dataease/map/manage/MapManage.java b/core/core-backend/src/main/java/io/dataease/map/manage/MapManage.java index a5dcb5efef..2e6894c3d3 100644 --- a/core/core-backend/src/main/java/io/dataease/map/manage/MapManage.java +++ b/core/core-backend/src/main/java/io/dataease/map/manage/MapManage.java @@ -109,6 +109,7 @@ public class MapManage { @CacheEvict(cacheNames = WORLD_MAP_CACHE, key = "'world_map'") @Transactional public void saveMapGeo(GeometryNodeCreator request, MultipartFile file) { + validateCode(request.getCode()); if (ObjectUtils.isEmpty(file) || file.isEmpty()) { DEException.throwException("geometry file is require"); } @@ -154,6 +155,7 @@ public class MapManage { @CacheEvict(cacheNames = WORLD_MAP_CACHE, key = "'world_map'") @Transactional public void deleteGeo(String code) { + validateCode(code); if (!StringUtils.startsWith(code, GEO_PREFIX)) { DEException.throwException("内置Geometry,禁止删除"); } @@ -209,5 +211,20 @@ public class MapManage { return code.substring(0, 3); } + public void validateCode(String code) { + if (StringUtils.isBlank(code)) DEException.throwException("区域编码不能为空"); + String busiGeoCode = getBusiGeoCode(code); + if (!isNumeric(busiGeoCode)) { + DEException.throwException("有效区域编码只能是数字"); + } + } + public boolean isNumeric(String str) { + for (int i = str.length(); --i >= 0; ) { + int chr = str.charAt(i); + if (chr < 48 || chr > 57) + return false; + } + return true; + } } diff --git a/core/core-frontend/package.json b/core/core-frontend/package.json index fa3826efb5..33959a098e 100644 --- a/core/core-frontend/package.json +++ b/core/core-frontend/package.json @@ -24,7 +24,7 @@ "axios": "^1.3.3", "crypto-js": "^4.1.1", "dayjs": "^1.11.9", - "element-plus-secondary": "^0.5.3", + "element-plus-secondary": "^0.5.4", "element-resize-detector": "^1.2.4", "file-saver": "^2.0.5", "html-to-image": "^1.11.11", diff --git a/core/core-frontend/src/assets/img/mobile-bg-pc.png b/core/core-frontend/src/assets/img/mobile-bg-pc.png index 8dff8e5464..32f19c9b08 100644 Binary files a/core/core-frontend/src/assets/img/mobile-bg-pc.png and b/core/core-frontend/src/assets/img/mobile-bg-pc.png differ diff --git a/core/core-frontend/src/layout/components/HeaderSystem.vue b/core/core-frontend/src/layout/components/HeaderSystem.vue index cb332a4623..a1a60c1a1a 100644 --- a/core/core-frontend/src/layout/components/HeaderSystem.vue +++ b/core/core-frontend/src/layout/components/HeaderSystem.vue @@ -92,7 +92,9 @@ const navigate = computed(() => appearanceStore.getNavigate) border-color: #1f232926 !important; } - .system, + .system { + color: #000 !important; + } .de-logo { color: #3371ff !important; } diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index 0e89056ecf..77b4fa2582 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -642,6 +642,7 @@ export default { table_header_font_color: '表头字体', table_item_font_color: '表格字体', table_show_index: '显示序号', + table_header_sort: '开启表头排序', stripe: '斑马纹', start_angle: '起始角度', end_angle: '结束角度', diff --git a/core/core-frontend/src/models/chart/chart-attr.d.ts b/core/core-frontend/src/models/chart/chart-attr.d.ts index c7101a3a17..b1ef1c42ac 100644 --- a/core/core-frontend/src/models/chart/chart-attr.d.ts +++ b/core/core-frontend/src/models/chart/chart-attr.d.ts @@ -221,6 +221,10 @@ declare interface ChartTableHeaderAttr { * 序号表头名称 */ indexLabel: string + /** + * 表头排序开关 + */ + tableHeaderSort: boolean } /** * 单元格属性 diff --git a/core/core-frontend/src/pages/index/main.ts b/core/core-frontend/src/pages/index/main.ts index fb5753fff9..3d5194e584 100644 --- a/core/core-frontend/src/pages/index/main.ts +++ b/core/core-frontend/src/pages/index/main.ts @@ -3,6 +3,7 @@ import '../../assets/font/index.css' import '@/style/index.less' import '@/plugins/svg-icon' import 'normalize.css/normalize.css' +import '@antv/s2/dist/style.min.css' import App from './App.vue' import { setupI18n } from '@/plugins/vue-i18n' import { setupStore } from '@/store' diff --git a/core/core-frontend/src/pages/lib/main.ts b/core/core-frontend/src/pages/lib/main.ts index b86abdfbc1..a4a0de8867 100644 --- a/core/core-frontend/src/pages/lib/main.ts +++ b/core/core-frontend/src/pages/lib/main.ts @@ -1,6 +1,7 @@ import '@/style/index.less' import '@/plugins/svg-icon' import 'normalize.css/normalize.css' +import '@antv/s2/dist/style.min.css' import { setupI18n } from '@/plugins/vue-i18n' import { setupStore } from '@/store' import { setupElementPlus } from '@/plugins/element-plus' diff --git a/core/core-frontend/src/pages/mobile/main.ts b/core/core-frontend/src/pages/mobile/main.ts index 9d1af0c023..0bca0e26da 100644 --- a/core/core-frontend/src/pages/mobile/main.ts +++ b/core/core-frontend/src/pages/mobile/main.ts @@ -3,6 +3,7 @@ import '../../assets/font/index.css' import '@/style/index.less' import '@/plugins/svg-icon' import 'normalize.css/normalize.css' +import '@antv/s2/dist/style.min.css' import App from './App.vue' import { setupI18n } from '@/plugins/vue-i18n' import { setupStore } from '@/store' diff --git a/core/core-frontend/src/pages/panel/main.ts b/core/core-frontend/src/pages/panel/main.ts index 544f2485ee..388a7a8585 100644 --- a/core/core-frontend/src/pages/panel/main.ts +++ b/core/core-frontend/src/pages/panel/main.ts @@ -58,6 +58,7 @@ import '../../assets/font/index.css' import '@/style/index.less' import '@/plugins/svg-icon' import 'normalize.css/normalize.css' +import '@antv/s2/dist/style.min.css' import AppElement from './App.vue' import { setupI18n } from '@/plugins/vue-i18n' import { setupStore } from '@/store' diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableHeaderSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableHeaderSelector.vue index 75a204bdb5..3e36bd1a51 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableHeaderSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableHeaderSelector.vue @@ -236,6 +236,21 @@ onMounted(() => { @blur="changeTableHeader('indexLabel')" /> + + + {{ t('chart.table_header_sort') }} + + 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 25f252ee40..67adf97127 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 @@ -329,7 +329,8 @@ export const DEFAULT_TABLE_HEADER: ChartTableHeaderAttr = { tableHeaderBgColor: '#6D9A49', tableHeaderFontColor: '#000000', tableTitleFontSize: 12, - tableTitleHeight: 36 + tableTitleHeight: 36, + tableHeaderSort: false } export const DEFAULT_TABLE_CELL: ChartTableCellAttr = { tableFontColor: '#000000', diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/waterfall.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/waterfall.ts index eac9a7ac46..a584f2d57b 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/waterfall.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/waterfall.ts @@ -127,37 +127,6 @@ export class Waterfall extends G2PlotChartView { fill: setGradientColor(hexColorToRGBA(totalColorRgba, alpha), gradient, 270) } }, - legend: { - items: [ - { - name: '增加', - value: '', - marker: { - style: { - fill: setGradientColor(hexColorToRGBA(risingColorRgba, alpha), gradient, 270) - } - } - }, - { - name: '减少', - value: '', - marker: { - style: { - fill: setGradientColor(hexColorToRGBA(fallingColorRgba, alpha), gradient, 270) - } - } - }, - { - name: '合计', - value: '', - marker: { - style: { - fill: setGradientColor(hexColorToRGBA(totalColorRgba, alpha), gradient, 270) - } - } - } - ] - }, risingFill: setGradientColor(hexColorToRGBA(risingColorRgba, alpha), gradient, 270), fallingFill: setGradientColor(hexColorToRGBA(fallingColorRgba, alpha), gradient, 270) } @@ -256,9 +225,55 @@ export class Waterfall extends G2PlotChartView { } } + protected configLegend(chart: Chart, options: WaterfallOptions): WaterfallOptions { + const tmp = super.configLegend(chart, options) + if (!tmp.legend) { + return tmp + } + const customAttr = parseJson(chart.customAttr) + const { colors, gradient, alpha } = customAttr.basicStyle + const [risingColorRgba, fallingColorRgba, totalColorRgba] = colors + return { + ...tmp, + legend: { + ...tmp.legend, + items: [ + { + name: '增加', + value: '', + marker: { + style: { + fill: setGradientColor(hexColorToRGBA(risingColorRgba, alpha), gradient, 270) + } + } + }, + { + name: '减少', + value: '', + marker: { + style: { + fill: setGradientColor(hexColorToRGBA(fallingColorRgba, alpha), gradient, 270) + } + } + }, + { + name: '合计', + value: '', + marker: { + style: { + fill: setGradientColor(hexColorToRGBA(totalColorRgba, alpha), gradient, 270) + } + } + } + ] + } + } + } + protected setupOptions(chart: Chart, options: WaterfallOptions): WaterfallOptions { return flow( this.configTheme, + this.configLegend, this.configBasicStyle, this.configLabel, this.configTooltip, diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/map/bubble-map.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/map/bubble-map.ts index 4b91a38aa6..3e29e29b28 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/map/bubble-map.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/map/bubble-map.ts @@ -91,9 +91,6 @@ export class BubbleMap extends L7PlotChartView { active: { stroke: 'green', lineWidth: 1 } }, tooltip: {}, - zoom: { - position: 'bottomright' - }, legend: false, // 禁用线上地图数据 customFetchGeoData: () => null @@ -101,6 +98,7 @@ export class BubbleMap extends L7PlotChartView { options = this.setupOptions(chart, options, drawOption, geoJson) const view = new Choropleth(container, options) const dotLayer = this.getDotLayer(chart, geoJson, drawOption) + this.configZoomButton(view) view.once('loaded', () => { view.addLayer(dotLayer) view.on('fillAreaLayer:click', (ev: MapMouseEvent) => { diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts index 572b2ef3d2..d0fdd4c801 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts @@ -90,9 +90,6 @@ export class Map extends L7PlotChartView { active: { stroke: 'green', lineWidth: 1 } }, tooltip: {}, - zoom: { - position: 'bottomright' - }, legend: { position: 'bottomleft' }, @@ -101,6 +98,7 @@ export class Map extends L7PlotChartView { } options = this.setupOptions(chart, options, drawOption, geoJson) const view = new Choropleth(container, options) + this.configZoomButton(view) view.once('loaded', () => { view.on('fillAreaLayer:click', (ev: MapMouseEvent) => { const data = ev.feature.properties 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 63239b5133..1db0b12ea3 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 @@ -16,6 +16,10 @@ export class TableInfo extends S2ChartView { properties = TABLE_EDITOR_PROPERTY propertyInner = { ...TABLE_EDITOR_PROPERTY_INNER, + 'table-header-selector': [ + ...TABLE_EDITOR_PROPERTY_INNER['table-header-selector'], + 'tableHeaderSort' + ], 'basic-style-selector': [ 'tableColumnMode', 'tableBorderColor', @@ -101,7 +105,10 @@ export class TableInfo extends S2ChartView { height: containerDom.offsetHeight, showSeriesNumber: customAttr.tableHeader.showIndex, style: this.configStyle(chart), - conditions: this.configConditions(chart) + conditions: this.configConditions(chart), + tooltip: { + getContainer: () => containerDom + } } // 开启序号之后,第一列就是序号列,修改 label 即可 if (s2Options.showSeriesNumber) { @@ -128,6 +135,8 @@ export class TableInfo extends S2ChartView { } // tooltip this.configTooltip(s2Options) + // header interaction + this.configHeaderInteraction(chart, s2Options) // 开始渲染 const newChart = new TableSheet(containerDom, s2DataConfig, s2Options) 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 ba5ee4075a..deb547c9c9 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 @@ -13,7 +13,13 @@ const { t } = useI18n() */ export class TableNormal extends S2ChartView { properties = TABLE_EDITOR_PROPERTY - propertyInner = TABLE_EDITOR_PROPERTY_INNER + propertyInner = { + ...TABLE_EDITOR_PROPERTY_INNER, + 'table-header-selector': [ + ...TABLE_EDITOR_PROPERTY_INNER['table-header-selector'], + 'tableHeaderSort' + ] + } axis: AxisType[] = ['xAxis', 'yAxis', 'drill', 'filter'] axisConfig: AxisConfig = { xAxis: { @@ -102,7 +108,10 @@ export class TableNormal extends S2ChartView { height: containerDom.offsetHeight, showSeriesNumber: customAttr.tableHeader.showIndex, style: this.configStyle(chart), - conditions: this.configConditions(chart) + conditions: this.configConditions(chart), + tooltip: { + getContainer: () => containerDom + } } // 开启序号之后,第一列就是序号列,修改 label 即可 if (s2Options.showSeriesNumber) { @@ -122,6 +131,8 @@ export class TableNormal extends S2ChartView { } // tooltip this.configTooltip(s2Options) + // header interaction + this.configHeaderInteraction(chart, s2Options) // 开始渲染 const newChart = new TableSheet(containerDom, s2DataConfig, s2Options) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts index 8a79f602ec..5638684ecd 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts @@ -83,7 +83,7 @@ export class TablePivot extends S2ChartView { columns.push(ele.dataeaseName) meta.push({ field: ele.dataeaseName, - name: ele.name, + name: ele.chartShowName ?? ele.name, formatter: value => { if (!f) { return value diff --git a/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts b/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts index dd1216f852..22d6887aaf 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts @@ -21,6 +21,11 @@ import { LIST_CLASS } from '@antv/l7plot-component/dist/esm/legend/category/constants' import substitute from '@antv/util/esm/substitute' +import { Plot as L7Plot } from '@antv/l7plot/dist/esm/core/plot' +import type { PlotOptions } from '@antv/l7plot/dist/esm/types' +import { Zoom } from '@antv/l7' +import { createL7Icon } from '@antv/l7-component/es/utils/icon' +import { DOM } from '@antv/l7-utils' export function getPadding(chart: Chart): number[] { if (chart.drill) { @@ -814,3 +819,47 @@ export function configL7Legend(): LegendOptions { } } } +class CustomZoom extends Zoom { + resetButtonGroup(container) { + DOM.clearChildren(container) + this['zoomInButton'] = this['createButton']( + this.controlOption.zoomInText, + this.controlOption.zoomInTitle, + 'l7-button-control', + container, + this.zoomIn + ) + const resetBtnIconText = createL7Icon('l7-icon-round') + this['createButton'](resetBtnIconText, 'Reset', 'l7-button-control', container, () => { + this.mapsService.setZoomAndCenter( + this.controlOption['initZoom'], + this.controlOption['center'] + ) + }) + if (this.controlOption.showZoom) { + this['zoomNumDiv'] = this['createButton']( + '0', + '', + 'l7-button-control l7-control-zoom__number', + container + ) + } + this['zoomOutButton'] = this['createButton']( + this.controlOption.zoomOutText, + this.controlOption.zoomOutTitle, + 'l7-button-control', + container, + this.zoomOut + ) + this['updateDisabled']() + } +} +export function configL7Zoom(plot: L7Plot) { + plot.once('loaded', () => { + const zoomOptions = { + initZoom: plot.scene.getZoom(), + center: plot.scene.getCenter() + } as any + plot.scene.addControl(new CustomZoom(zoomOptions)) + }) +} diff --git a/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts b/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts index b26c3825d7..fad100cce5 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts @@ -632,24 +632,60 @@ class SortTooltip extends BaseTooltip { left: `${this.position?.x}px`, top: `${this.position?.y}px`, pointerEvents: enterable ? 'all' : 'none', - zIndex: 9999 + zIndex: 9999, + position: 'absolute' }, visible: true }) } } -export function configTooltip(option: S2Options) { +const SORT_DEFAULT = + '' +const SORT_UP = + '' +const SORT_DOWN = + '' + +function svg2Base64(svg) { + return `data:image/svg+xml;charset=utf-8;base64,${btoa(svg)}` +} + +export function configHeaderInteraction(chart: Chart, option: S2Options) { + const { tableHeaderFontColor, tableHeaderSort } = parseJson(chart.customAttr).tableHeader + if (!tableHeaderSort) { + return + } + const iconColor = tableHeaderFontColor ?? '#666' + const sortDefault = svg2Base64(SORT_DEFAULT.replace('{fill}', iconColor)) + const sortUp = svg2Base64(SORT_UP.replace('{fill}', iconColor)) + const sortDown = svg2Base64(SORT_DOWN.replace('{fill}', iconColor)) + // 防止缓存 + const randomSuffix = Math.random() const sortIconMap = { - asc: 'SortUp', - desc: 'SortDown' - } - option.tooltip = { - ...option.tooltip, - renderTooltip: sheet => new SortTooltip(sheet) + asc: `customSortUp${randomSuffix}`, + desc: `customSortDown${randomSuffix}` } + option.customSVGIcons = [ + { + name: `customSortDefault${randomSuffix}`, + svg: sortDefault + }, + { + name: `customSortUp${randomSuffix}`, + svg: sortUp + }, + { + name: `customSortDown${randomSuffix}`, + svg: sortDown + } + ] option.headerActionIcons = [ { - iconNames: ['GroupAsc', 'SortUp', 'SortDown'], + iconNames: [ + `customSortDefault${randomSuffix}`, + `customSortUp${randomSuffix}`, + `customSortDown${randomSuffix}` + ], belongsCell: 'colCell', displayCondition: (meta, iconName) => { if (meta.field === SERIES_NUMBER_FIELD) { @@ -660,7 +696,7 @@ export function configTooltip(option: S2Options) { if (sortType) { return iconName === sortIconMap[sortType] } - return iconName === 'GroupAsc' + return iconName === `customSortDefault${randomSuffix}` }, onClick: props => { const { meta, event } = props @@ -677,6 +713,16 @@ export function configTooltip(option: S2Options) { ] } +export function configTooltip(option: S2Options) { + option.tooltip = { + ...option.tooltip, + adjustPosition: ({ event }) => { + return getTooltipPosition(event) + }, + renderTooltip: sheet => new SortTooltip(sheet) + } +} + export function copyContent(s2Instance, event, fieldMeta) { event.preventDefault() const cell = s2Instance.getCell(event.target) @@ -706,3 +752,30 @@ export function copyContent(s2Instance, event, fieldMeta) { copyString(content, true) } } + +function getTooltipPosition(event) { + const s2Instance = event.s2Instance + const { x, y } = event + const result = { x: x + 15, y: y + 10 } + if (!s2Instance) { + return result + } + const { height, width } = s2Instance.getCanvasElement().getBoundingClientRect() + const { offsetHeight, offsetWidth } = s2Instance.tooltip.getContainer() + if (offsetWidth > width) { + result.x = 0 + } + if (offsetHeight > height) { + result.y = 0 + } + if (!(result.x || result.y)) { + return result + } + if (result.x && result.x + offsetWidth > width) { + result.x -= result.x + offsetWidth - width + } + if (result.y && result.y + offsetHeight > height) { + result.y -= offsetHeight + 15 + } + return result +} diff --git a/core/core-frontend/src/views/chart/components/js/panel/types/impl/l7plot.ts b/core/core-frontend/src/views/chart/components/js/panel/types/impl/l7plot.ts index 0f1ae019ba..ca02b8003a 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/types/impl/l7plot.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/types/impl/l7plot.ts @@ -6,7 +6,8 @@ import { configL7Label, configL7Legend, configL7Style, - configL7Tooltip + configL7Tooltip, + configL7Zoom } from '@/views/chart/components/js/panel/common/common_antv' import { AntVAbstractChartView, @@ -73,6 +74,10 @@ export abstract class L7PlotChartView< options.source.data = data return options } + + protected configZoomButton(plot: P) { + configL7Zoom(plot) + } protected constructor(name: string, defaultData?: any[]) { super(ChartLibraryType.L7_PLOT, name) this.defaultData = defaultData diff --git a/core/core-frontend/src/views/chart/components/js/panel/types/impl/s2.ts b/core/core-frontend/src/views/chart/components/js/panel/types/impl/s2.ts index 73c91e30e2..deba6536b0 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/types/impl/s2.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/types/impl/s2.ts @@ -5,6 +5,7 @@ import { } from '@/views/chart/components/js/panel/types' import { S2Theme, SpreadSheet, Style, S2Options } from '@antv/s2' import { + configHeaderInteraction, configTooltip, getConditions, getCustomTheme, @@ -44,6 +45,10 @@ export abstract class S2ChartView

extends AntVAbstractCha configTooltip(option) } + protected configHeaderInteraction(chart: Chart, option: S2Options) { + configHeaderInteraction(chart, option) + } + protected configConditions(chart: Chart) { return getConditions(chart) } diff --git a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue index 3f3c9841f0..8bfbdac94f 100644 --- a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue +++ b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue @@ -404,7 +404,7 @@ const autoHeightStyle = computed(() => { @trackClick="trackClick" />

-
+
diff --git a/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue b/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue index 881f2e5015..b95073cb59 100644 --- a/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue +++ b/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue @@ -208,8 +208,14 @@ const save = () => { 开启移动端 - - + + @@ -296,7 +302,26 @@ const save = () => { .mobile-save { display: flex; align-items: center; + .switch-pc { + &::after { + content: ''; + border-radius: 4px; + display: none; + position: absolute; + width: calc(100% + 10px); + height: calc(100% + 10px); + top: -5px; + left: -5px; + } + &:hover { + &::after { + display: block; + background: rgba(255, 255, 255, 0.1); + } + } + position: relative; + } .open-mobile-line { background: #ffffff4d; width: 1px; @@ -349,7 +374,7 @@ const save = () => { .mobile-header { margin-top: 20px; - height: 44px; + height: 43px; display: flex; img { height: 100%; diff --git a/core/core-frontend/src/views/mobile/directory/index.vue b/core/core-frontend/src/views/mobile/directory/index.vue index a622eb04fa..bb465b1b78 100644 --- a/core/core-frontend/src/views/mobile/directory/index.vue +++ b/core/core-frontend/src/views/mobile/directory/index.vue @@ -81,6 +81,13 @@ const dataClick = val => { directId.value.push(val.id) } +const handleDir = index => { + if (index === directId.value.length - 1) return + directId.value = directId.value.slice(0, index + 1) + directName.value = directName.value.slice(0, index + 1) + activeDirectName.value = directName.value[directName.value.length - 1] +} + const getTree = async () => { const request = { busiFlag: 'dashboard' } as BusiTreeRequest await interactiveStore.setInteractive(request) @@ -127,8 +134,10 @@ onMounted(() => {
-
- {{ ele }} +
+ {{ + ele + }} @@ -168,16 +177,20 @@ onMounted(() => { padding: 12px 16px; color: #646a73; display: flex; + width: 100%; + overflow-x: auto; align-items: center; & > div { display: flex; align-items: center; + white-space: nowrap; } .label { font-size: 14px; font-weight: 400; line-height: 20px; + max-width: 250px; } .ed-icon { diff --git a/core/core-frontend/src/views/mobile/personal/index.vue b/core/core-frontend/src/views/mobile/personal/index.vue index a1019b0679..db60c608cc 100644 --- a/core/core-frontend/src/views/mobile/personal/index.vue +++ b/core/core-frontend/src/views/mobile/personal/index.vue @@ -48,11 +48,47 @@ const findName = () => { } } } + +let directIdCopy = [] +let directNameCopy = [] + +const dfsOrgTree = (arr, depth) => { + arr.forEach(item => { + const { name, id } = item + if (depth <= directIdCopy.length) { + if (depth < directIdCopy.length) { + directIdCopy = directIdCopy.slice(0, depth) + directNameCopy = directNameCopy.slice(0, depth) + } + directIdCopy.splice(directIdCopy.length - 1, 1, id) + directNameCopy.splice(directNameCopy.length - 1, 1, name) + } else { + directIdCopy.push(id) + directNameCopy.push(name) + } + + let nextDepth = depth + 1 + + if (id === userStore.getOid) { + directName.value = [...directNameCopy] + directId.value = [...directIdCopy] + nextDepth = 999 + } + if (item?.children?.length && nextDepth !== 999) { + dfsOrgTree(item?.children, nextDepth) + } + }) +} + onMounted(() => { mountedOrg().then(res => { orgOption = res.data as OrgTreeNode[] tableData.value = res.data as OrgTreeNode[] findName() + dfsOrgTree(orgOption, 1) + directName.value.pop() + directId.value.pop() + activeDirectName.value = directName.value[directName.value.length - 1] }) }) @@ -84,6 +120,13 @@ const orgCellClick = (type, val) => { } } +const handleDir = index => { + if (index === directId.value.length - 1) return + directId.value = directId.value.slice(0, index + 1) + directName.value = directName.value.slice(0, index + 1) + activeDirectName.value = directName.value[directName.value.length - 1] +} + const tableData = ref([]) const directName = ref([]) const directId = ref([]) @@ -134,8 +177,13 @@ const activeTableData = computed(() => { @click-left="onClickLeft" />
-
- {{ ele }} +
+ {{ ele }} @@ -202,6 +250,14 @@ const activeTableData = computed(() => { display: flex; align-items: center; + & > div { + white-space: nowrap; + } + + .ellipsis { + max-width: 250px; + } + .active { color: var(--ed-color-primary); } diff --git a/core/core-frontend/src/views/share/share/ShareGrid.vue b/core/core-frontend/src/views/share/share/ShareGrid.vue index d1037b2256..1729e041bf 100644 --- a/core/core-frontend/src/views/share/share/ShareGrid.vue +++ b/core/core-frontend/src/views/share/share/ShareGrid.vue @@ -230,8 +230,8 @@ watch( align-items: center; } .main-color { - font-size: 21.33px; - padding: 5.33px; + font-size: 18px; + padding: 3px; margin-right: 12px; border-radius: 4px; color: #fff; 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 2ce8e3a3fb..80c22e0cb8 100644 --- a/core/core-frontend/src/views/visualized/data/dataset/index.vue +++ b/core/core-frontend/src/views/visualized/data/dataset/index.vue @@ -1,6 +1,6 @@