refactor(图表): URL 字段聚合方式限制

This commit is contained in:
wisonic 2024-08-15 11:23:17 +08:00
parent 04f04fc986
commit 3dc5722fff
6 changed files with 22 additions and 41 deletions

View File

@ -274,7 +274,7 @@ public class ChartViewManege {
dto.setDatePattern("date_sub");
dto.setChartType("bar");
if (dto.getId() == -1L || dto.getDeType() == 0 || dto.getDeType() == 1) {
if (dto.getId() == -1L || dto.getDeType() == 0 || dto.getDeType() == 1 || dto.getDeType() == 7) {
dto.setSummary("count");
} else {
dto.setSummary("sum");

View File

@ -1305,7 +1305,7 @@ public class ChartDataBuild {
}
if (i == ele.length) break;
ChartViewFieldDTO chartViewFieldDTO = fields.get(i);
if (chartViewFieldDTO.getDeType() == 0 || chartViewFieldDTO.getDeType() == 1 || chartViewFieldDTO.getDeType() == 5) {
if (chartViewFieldDTO.getDeType() == 0 || chartViewFieldDTO.getDeType() == 1 || chartViewFieldDTO.getDeType() == 5 || chartViewFieldDTO.getDeType() == 7) {
d.put(fields.get(i).getDataeaseName(), StringUtils.isEmpty(ele[i]) ? "" : ele[i]);
} else if (chartViewFieldDTO.getDeType() == 2 || chartViewFieldDTO.getDeType() == 3 || chartViewFieldDTO.getDeType() == 4) {
d.put(fields.get(i).getDataeaseName(), StringUtils.isEmpty(ele[i]) ? null : new BigDecimal(ele[i]).setScale(8, RoundingMode.HALF_UP));

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1723456468440" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1514" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M578.133 675.627c-3.306-3.307-8.746-3.307-12.053 0L442.133 799.573c-57.386 57.387-154.24 63.467-217.6 0-63.466-63.466-57.386-160.213 0-217.6L348.48 458.027c3.307-3.307 3.307-8.747 0-12.054l-42.453-42.453c-3.307-3.307-8.747-3.307-12.054 0L170.027 527.467c-90.24 90.24-90.24 236.266 0 326.4s236.266 90.24 326.4 0L620.373 729.92c3.307-3.307 3.307-8.747 0-12.053l-42.24-42.24z m275.84-505.6c-90.24-90.24-236.266-90.24-326.4 0L403.52 293.973c-3.307 3.307-3.307 8.747 0 12.054l42.347 42.346c3.306 3.307 8.746 3.307 12.053 0l123.947-123.946c57.386-57.387 154.24-63.467 217.6 0 63.466 63.466 57.386 160.213 0 217.6L675.52 565.973c-3.307 3.307-3.307 8.747 0 12.054l42.453 42.453c3.307 3.307 8.747 3.307 12.054 0l123.946-123.947c90.134-90.24 90.134-236.266 0-326.506z" p-id="1515"></path><path d="M616.64 362.987c-3.307-3.307-8.747-3.307-12.053 0l-241.6 241.493c-3.307 3.307-3.307 8.747 0 12.053l42.24 42.24c3.306 3.307 8.746 3.307 12.053 0L658.773 417.28c3.307-3.307 3.307-8.747 0-12.053l-42.133-42.24z" p-id="1516"></path></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -383,6 +383,7 @@ import icon_moreVertical_outlined from '@/assets/svg/icon_more-vertical_outlined
import icon_more_outlined from '@/assets/svg/icon_more_outlined.svg'
import icon_newItem_outlined from '@/assets/svg/icon_new-item_outlined.svg'
import icon_number_outlined from '@/assets/svg/icon_number_outlined.svg'
import icon_url_outlined from '@/assets/svg/icon_url_outlined.svg'
import icon_operationAnalysis_outlined from '@/assets/svg/icon_operation-analysis_outlined.svg'
import icon_ordeList_outlined from '@/assets/svg/icon_orde-list_outlined.svg'
import icon_organization_outlined from '@/assets/svg/icon_organization_outlined.svg'
@ -1054,6 +1055,7 @@ const iconMap = {
icon_more_outlined: icon_more_outlined,
'icon_new-item_outlined': icon_newItem_outlined,
icon_number_outlined: icon_number_outlined,
icon_url_outlined: icon_url_outlined,
'icon_operation-analysis_outlined': icon_operationAnalysis_outlined,
'icon_orde-list_outlined': icon_ordeList_outlined,
icon_organization_outlined: icon_organization_outlined,

View File

@ -426,12 +426,7 @@ onMounted(() => {
>
<el-dropdown-item
class="menu-item-padding"
v-if="
item.id !== '-1' &&
item.deType !== 0 &&
item.deType !== 1 &&
item.deType !== 5
"
v-if="item.id !== '-1' && ![0, 1, 5, 7].includes(item.deType)"
:command="beforeSummary('sum')"
>
<span
@ -446,12 +441,7 @@ onMounted(() => {
</el-dropdown-item>
<el-dropdown-item
class="menu-item-padding"
v-if="
item.id !== '-1' &&
item.deType !== 0 &&
item.deType !== 1 &&
item.deType !== 5
"
v-if="item.id !== '-1' && ![0, 1, 5, 7].includes(item.deType)"
:command="beforeSummary('avg')"
>
<span
@ -466,12 +456,7 @@ onMounted(() => {
</el-dropdown-item>
<el-dropdown-item
class="menu-item-padding"
v-if="
item.id !== '-1' &&
item.deType !== 0 &&
item.deType !== 1 &&
item.deType !== 5
"
v-if="item.id !== '-1' && ![0, 1, 5, 7].includes(item.deType)"
:command="beforeSummary('max')"
>
<span
@ -486,12 +471,7 @@ onMounted(() => {
</el-dropdown-item>
<el-dropdown-item
class="menu-item-padding"
v-if="
item.id !== '-1' &&
item.deType !== 0 &&
item.deType !== 1 &&
item.deType !== 5
"
v-if="item.id !== '-1' && ![0, 1, 5, 7].includes(item.deType)"
:command="beforeSummary('min')"
>
<span
@ -506,12 +486,7 @@ onMounted(() => {
</el-dropdown-item>
<el-dropdown-item
class="menu-item-padding"
v-if="
item.id !== '-1' &&
item.deType !== 0 &&
item.deType !== 1 &&
item.deType !== 5
"
v-if="item.id !== '-1' && ![0, 1, 5, 7].includes(item.deType)"
:command="beforeSummary('stddev_pop')"
>
<span
@ -526,12 +501,7 @@ onMounted(() => {
</el-dropdown-item>
<el-dropdown-item
class="menu-item-padding"
v-if="
item.id !== '-1' &&
item.deType !== 0 &&
item.deType !== 1 &&
item.deType !== 5
"
v-if="item.id !== '-1' && ![0, 1, 5, 7].includes(item.deType)"
:command="beforeSummary('var_pop')"
>
<span

View File

@ -70,6 +70,11 @@ const options = computed(() => {
label: t('data_set.numeric_value_decimal'),
icon: 'icon_number_outlined',
value: 'float'
},
{
label: 'URL',
icon: 'icon_url_outlined',
value: 'url'
}
]
},
@ -147,13 +152,13 @@ const handleChange = () => {
<template #default="{ data }">
<div class="flex-align-center icon">
<el-icon v-if="data.icon">
<icon
<Icon
:className="
['text', 'location', 'value', 'float', 'time'].includes(data.value) &&
['text', 'location', 'value', 'float', 'time', 'url'].includes(data.value) &&
`field-icon-${fieldType[['float', 'value'].includes(data.value) ? 2 : 0]}`
"
:name="data.icon"
></icon>
></Icon>
</el-icon>
<span>
{{ data.label }}
@ -199,6 +204,9 @@ const handleChange = () => {
border-right: none;
&:nth-child(2) {
margin-top: 32px;
> div {
height: 210px;
}
}
&:nth-child(3) {
margin-top: 64px;