forked from github/dataease
Merge pull request #12618 from dataease/pr@dev-v2@chart-fix
fix(图表): 优化图表的必选字段
This commit is contained in:
commit
5a10a3e2c6
@ -1881,6 +1881,7 @@ const deleteChartFieldItem = id => {
|
|||||||
<el-row v-if="showAxis('area')" class="padding-lr drag-data">
|
<el-row v-if="showAxis('area')" class="padding-lr drag-data">
|
||||||
<span class="data-area-label">
|
<span class="data-area-label">
|
||||||
{{ t('chart.area') }}
|
{{ t('chart.area') }}
|
||||||
|
<i class="required"></i>
|
||||||
</span>
|
</span>
|
||||||
<div class="area-tree-select">
|
<div class="area-tree-select">
|
||||||
<el-tree-select
|
<el-tree-select
|
||||||
@ -1906,6 +1907,10 @@ const deleteChartFieldItem = id => {
|
|||||||
<div class="form-draggable-title">
|
<div class="form-draggable-title">
|
||||||
<span>
|
<span>
|
||||||
{{ chartViewInstance.axisConfig.xAxis.name }}
|
{{ chartViewInstance.axisConfig.xAxis.name }}
|
||||||
|
<i
|
||||||
|
v-if="!chartViewInstance.axisConfig.xAxis?.allowEmpty"
|
||||||
|
class="required"
|
||||||
|
></i>
|
||||||
</span>
|
</span>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
:effect="toolTip"
|
:effect="toolTip"
|
||||||
@ -1966,6 +1971,10 @@ const deleteChartFieldItem = id => {
|
|||||||
<div class="form-draggable-title">
|
<div class="form-draggable-title">
|
||||||
<span>
|
<span>
|
||||||
{{ chartViewInstance.axisConfig.xAxisExt.name }}
|
{{ chartViewInstance.axisConfig.xAxisExt.name }}
|
||||||
|
<i
|
||||||
|
v-if="!chartViewInstance.axisConfig.xAxisExt?.allowEmpty"
|
||||||
|
class="required"
|
||||||
|
></i>
|
||||||
</span>
|
</span>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
:effect="toolTip"
|
:effect="toolTip"
|
||||||
@ -2024,6 +2033,10 @@ const deleteChartFieldItem = id => {
|
|||||||
<div class="form-draggable-title">
|
<div class="form-draggable-title">
|
||||||
<span>
|
<span>
|
||||||
{{ chartViewInstance.axisConfig.flowMapStartName.name }}
|
{{ chartViewInstance.axisConfig.flowMapStartName.name }}
|
||||||
|
<i
|
||||||
|
v-if="!chartViewInstance.axisConfig.flowMapStartName?.allowEmpty"
|
||||||
|
class="required"
|
||||||
|
></i>
|
||||||
</span>
|
</span>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
:effect="toolTip"
|
:effect="toolTip"
|
||||||
@ -2084,6 +2097,10 @@ const deleteChartFieldItem = id => {
|
|||||||
<div class="form-draggable-title">
|
<div class="form-draggable-title">
|
||||||
<span>
|
<span>
|
||||||
{{ chartViewInstance.axisConfig.flowMapEndName.name }}
|
{{ chartViewInstance.axisConfig.flowMapEndName.name }}
|
||||||
|
<i
|
||||||
|
v-if="!chartViewInstance.axisConfig.flowMapEndName?.allowEmpty"
|
||||||
|
class="required"
|
||||||
|
></i>
|
||||||
</span>
|
</span>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
:effect="toolTip"
|
:effect="toolTip"
|
||||||
@ -2144,6 +2161,10 @@ const deleteChartFieldItem = id => {
|
|||||||
<div class="form-draggable-title">
|
<div class="form-draggable-title">
|
||||||
<span>
|
<span>
|
||||||
{{ chartViewInstance.axisConfig.extStack.name }}
|
{{ chartViewInstance.axisConfig.extStack.name }}
|
||||||
|
<i
|
||||||
|
v-if="!chartViewInstance.axisConfig.extStack?.allowEmpty"
|
||||||
|
class="required"
|
||||||
|
></i>
|
||||||
</span>
|
</span>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
:effect="toolTip"
|
:effect="toolTip"
|
||||||
@ -2201,6 +2222,10 @@ const deleteChartFieldItem = id => {
|
|||||||
<div class="form-draggable-title">
|
<div class="form-draggable-title">
|
||||||
<span>
|
<span>
|
||||||
{{ chartViewInstance.axisConfig.extColor.name }}
|
{{ chartViewInstance.axisConfig.extColor.name }}
|
||||||
|
<i
|
||||||
|
v-if="!chartViewInstance.axisConfig.extColor?.allowEmpty"
|
||||||
|
class="required"
|
||||||
|
></i>
|
||||||
</span>
|
</span>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
:effect="toolTip"
|
:effect="toolTip"
|
||||||
@ -2264,6 +2289,10 @@ const deleteChartFieldItem = id => {
|
|||||||
<span class="data-area-label">
|
<span class="data-area-label">
|
||||||
<span style="margin-right: 4px">
|
<span style="margin-right: 4px">
|
||||||
{{ chartViewInstance.axisConfig.yAxis.name }}
|
{{ chartViewInstance.axisConfig.yAxis.name }}
|
||||||
|
<i
|
||||||
|
v-if="!chartViewInstance.axisConfig.yAxis?.allowEmpty"
|
||||||
|
class="required"
|
||||||
|
></i>
|
||||||
</span>
|
</span>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
v-if="chartViewInstance.axisConfig.yAxis.tooltip"
|
v-if="chartViewInstance.axisConfig.yAxis.tooltip"
|
||||||
@ -2346,6 +2375,10 @@ const deleteChartFieldItem = id => {
|
|||||||
<div class="form-draggable-title">
|
<div class="form-draggable-title">
|
||||||
<span>
|
<span>
|
||||||
{{ chartViewInstance.axisConfig.extBubble.name }}
|
{{ chartViewInstance.axisConfig.extBubble.name }}
|
||||||
|
<i
|
||||||
|
v-if="!chartViewInstance.axisConfig.extBubble?.allowEmpty"
|
||||||
|
class="required"
|
||||||
|
></i>
|
||||||
</span>
|
</span>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
:effect="toolTip"
|
:effect="toolTip"
|
||||||
@ -2404,6 +2437,10 @@ const deleteChartFieldItem = id => {
|
|||||||
<div class="form-draggable-title">
|
<div class="form-draggable-title">
|
||||||
<span>
|
<span>
|
||||||
{{ chartViewInstance.axisConfig.yAxisExt.name }}
|
{{ chartViewInstance.axisConfig.yAxisExt.name }}
|
||||||
|
<i
|
||||||
|
v-if="!chartViewInstance.axisConfig.yAxisExt?.allowEmpty"
|
||||||
|
class="required"
|
||||||
|
></i>
|
||||||
</span>
|
</span>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
:effect="toolTip"
|
:effect="toolTip"
|
||||||
@ -2466,6 +2503,10 @@ const deleteChartFieldItem = id => {
|
|||||||
<div class="form-draggable-title">
|
<div class="form-draggable-title">
|
||||||
<span>
|
<span>
|
||||||
{{ chartViewInstance.axisConfig.yAxis.name }}
|
{{ chartViewInstance.axisConfig.yAxis.name }}
|
||||||
|
<i
|
||||||
|
v-if="!chartViewInstance.axisConfig.yAxis?.allowEmpty"
|
||||||
|
class="required"
|
||||||
|
></i>
|
||||||
</span>
|
</span>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
:effect="toolTip"
|
:effect="toolTip"
|
||||||
@ -2541,6 +2582,10 @@ const deleteChartFieldItem = id => {
|
|||||||
<div class="form-draggable-title">
|
<div class="form-draggable-title">
|
||||||
<span>
|
<span>
|
||||||
{{ chartViewInstance.axisConfig.yAxisExt.name }}
|
{{ chartViewInstance.axisConfig.yAxisExt.name }}
|
||||||
|
<i
|
||||||
|
v-if="!chartViewInstance.axisConfig.yAxisExt?.allowEmpty"
|
||||||
|
class="required"
|
||||||
|
></i>
|
||||||
</span>
|
</span>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
:effect="toolTip"
|
:effect="toolTip"
|
||||||
@ -2618,6 +2663,10 @@ const deleteChartFieldItem = id => {
|
|||||||
<span class="data-area-label">
|
<span class="data-area-label">
|
||||||
<span style="margin-right: 4px">
|
<span style="margin-right: 4px">
|
||||||
{{ chartViewInstance.axisConfig.extBubble.name }}
|
{{ chartViewInstance.axisConfig.extBubble.name }}
|
||||||
|
<i
|
||||||
|
v-if="!chartViewInstance.axisConfig.extBubble?.allowEmpty"
|
||||||
|
class="required"
|
||||||
|
></i>
|
||||||
</span>
|
</span>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
v-if="chartViewInstance.axisConfig.extBubble.tooltip"
|
v-if="chartViewInstance.axisConfig.extBubble.tooltip"
|
||||||
@ -4189,6 +4238,14 @@ span {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
:deep(.required::after) {
|
||||||
|
content: '*';
|
||||||
|
color: var(--ed-color-danger);
|
||||||
|
margin-left: 4px;
|
||||||
|
font-family: var(--de-custom_font, 'PingFang');
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-draggable-title {
|
.form-draggable-title {
|
||||||
@ -4201,6 +4258,15 @@ span {
|
|||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:deep(.required::after) {
|
||||||
|
content: '*';
|
||||||
|
color: var(--ed-color-danger);
|
||||||
|
margin-left: 2px;
|
||||||
|
font-family: var(--de-custom_font, 'PingFang');
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
.remove-icon {
|
.remove-icon {
|
||||||
color: #646a73;
|
color: #646a73;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
@ -92,6 +92,10 @@ export class Bar extends G2PlotChartView<ColumnOptions, Column> {
|
|||||||
axis: AxisType[] = [...BAR_AXIS_TYPE]
|
axis: AxisType[] = [...BAR_AXIS_TYPE]
|
||||||
axisConfig = {
|
axisConfig = {
|
||||||
...this['axisConfig'],
|
...this['axisConfig'],
|
||||||
|
xAxis: {
|
||||||
|
name: `${t('chart.drag_block_type_axis')} / ${t('chart.dimension')}`,
|
||||||
|
type: 'd'
|
||||||
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
name: `${t('chart.drag_block_value_axis')} / ${t('chart.quota')}`,
|
name: `${t('chart.drag_block_value_axis')} / ${t('chart.quota')}`,
|
||||||
type: 'q'
|
type: 'q'
|
||||||
|
@ -310,7 +310,8 @@ export class HorizontalStackBar extends HorizontalBar {
|
|||||||
extStack: {
|
extStack: {
|
||||||
name: `${t('chart.stack_item')} / ${t('chart.dimension')}`,
|
name: `${t('chart.stack_item')} / ${t('chart.dimension')}`,
|
||||||
type: 'd',
|
type: 'd',
|
||||||
limit: 1
|
limit: 1,
|
||||||
|
allowEmpty: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
propertyInner = {
|
propertyInner = {
|
||||||
|
@ -23,6 +23,10 @@ const DEFAULT_DATA = []
|
|||||||
*/
|
*/
|
||||||
export class RangeBar extends G2PlotChartView<BarOptions, Bar> {
|
export class RangeBar extends G2PlotChartView<BarOptions, Bar> {
|
||||||
axisConfig = {
|
axisConfig = {
|
||||||
|
xAxis: {
|
||||||
|
name: `${t('chart.drag_block_type_axis')} / ${t('chart.dimension')}`,
|
||||||
|
type: 'd'
|
||||||
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
name: `${t('chart.drag_block_value_start')} / ${t('chart.time_dimension_or_quota')}`,
|
name: `${t('chart.drag_block_value_start')} / ${t('chart.time_dimension_or_quota')}`,
|
||||||
limit: 1,
|
limit: 1,
|
||||||
|
@ -298,7 +298,8 @@ export class StackArea extends Area {
|
|||||||
extStack: {
|
extStack: {
|
||||||
name: `${t('chart.stack_item')} / ${t('chart.dimension')}`,
|
name: `${t('chart.stack_item')} / ${t('chart.dimension')}`,
|
||||||
type: 'd',
|
type: 'd',
|
||||||
limit: 1
|
limit: 1,
|
||||||
|
allowEmpty: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
protected configLabel(chart: Chart, options: AreaOptions): AreaOptions {
|
protected configLabel(chart: Chart, options: AreaOptions): AreaOptions {
|
||||||
|
@ -49,7 +49,8 @@ export class Line extends G2PlotChartView<LineOptions, G2Line> {
|
|||||||
xAxisExt: {
|
xAxisExt: {
|
||||||
name: `${t('chart.chart_group')} / ${t('chart.dimension')}`,
|
name: `${t('chart.chart_group')} / ${t('chart.dimension')}`,
|
||||||
type: 'd',
|
type: 'd',
|
||||||
limit: 1
|
limit: 1,
|
||||||
|
allowEmpty: true
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
name: `${t('chart.drag_block_value_axis')} / ${t('chart.quota')}`,
|
name: `${t('chart.drag_block_value_axis')} / ${t('chart.quota')}`,
|
||||||
|
@ -20,9 +20,9 @@ const { t } = useI18n()
|
|||||||
const DEFAULT_DATA = []
|
const DEFAULT_DATA = []
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 区间条形图
|
* 桑基图
|
||||||
*/
|
*/
|
||||||
export class RangeBar extends G2PlotChartView<SankeyOptions, Sankey> {
|
export class SankeyBar extends G2PlotChartView<SankeyOptions, Sankey> {
|
||||||
axisConfig = {
|
axisConfig = {
|
||||||
xAxis: {
|
xAxis: {
|
||||||
name: `${t('chart.drag_block_type_axis_start')} / ${t('chart.dimension')}`,
|
name: `${t('chart.drag_block_type_axis_start')} / ${t('chart.dimension')}`,
|
||||||
@ -32,7 +32,8 @@ export class RangeBar extends G2PlotChartView<SankeyOptions, Sankey> {
|
|||||||
xAxisExt: {
|
xAxisExt: {
|
||||||
name: `${t('chart.drag_block_type_axis_end')} / ${t('chart.dimension')}`,
|
name: `${t('chart.drag_block_type_axis_end')} / ${t('chart.dimension')}`,
|
||||||
limit: 1,
|
limit: 1,
|
||||||
type: 'd'
|
type: 'd',
|
||||||
|
allowEmpty: true
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
name: `${t('chart.chart_data')} / ${t('chart.quota')}`,
|
name: `${t('chart.chart_data')} / ${t('chart.quota')}`,
|
||||||
|
@ -81,7 +81,8 @@ export class Scatter extends G2PlotChartView<ScatterOptions, G2Scatter> {
|
|||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
...this['axisConfig'].yAxis,
|
...this['axisConfig'].yAxis,
|
||||||
limit: undefined
|
limit: undefined,
|
||||||
|
allowEmpty: false
|
||||||
},
|
},
|
||||||
extBubble: {
|
extBubble: {
|
||||||
name: `${t('chart.bubble_size')} / ${t('chart.quota')}`,
|
name: `${t('chart.bubble_size')} / ${t('chart.quota')}`,
|
||||||
|
Loading…
Reference in New Issue
Block a user