Chart Select cümlesi ve diğer özellikler eklendi.
This commit is contained in:
parent
531b924f5e
commit
565357ba3e
19 changed files with 317 additions and 158 deletions
|
|
@ -89,6 +89,8 @@ public class SelectRequestDto
|
||||||
/// <summary> Grid uzerinde kullanici tarafli bir degisiklik var mi
|
/// <summary> Grid uzerinde kullanici tarafli bir degisiklik var mi
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
public bool Chart { get; set; } = false;
|
||||||
|
|
||||||
public bool IsChanged()
|
public bool IsChanged()
|
||||||
{
|
{
|
||||||
if (!Sort.IsNullOrEmpty() ||
|
if (!Sort.IsNullOrEmpty() ||
|
||||||
|
|
|
||||||
|
|
@ -88,16 +88,16 @@ public class ListFormJsonRowAppService : PlatformAppService
|
||||||
listForm.ExtraFilterJson = CreateRow(listForm.ExtraFilterJson, ObjectMapper.Map<ExtraFilterEditDto, ExtraFilter>(model.ItemExtraFilter));
|
listForm.ExtraFilterJson = CreateRow(listForm.ExtraFilterJson, ObjectMapper.Map<ExtraFilterEditDto, ExtraFilter>(model.ItemExtraFilter));
|
||||||
break;
|
break;
|
||||||
case ListFormEditTabs.ChartSeries.GeneralJsonRow:
|
case ListFormEditTabs.ChartSeries.GeneralJsonRow:
|
||||||
listForm.SeriesJson = CreateRow(listForm.SeriesJson, ObjectMapper.Map<ChartSeriesDto, ChartSeries>(model.ItemChartSeries));
|
listForm.SeriesJson = CreateRow<ChartSeriesDto>(listForm.SeriesJson, model.ItemChartSeries);
|
||||||
break;
|
break;
|
||||||
case ListFormEditTabs.ChartAxis.ValueAxisJsonRow:
|
case ListFormEditTabs.ChartAxis.ValueAxisJsonRow:
|
||||||
listForm.ValueAxisJson = CreateRow(listForm.ValueAxisJson, ObjectMapper.Map<ChartValueAxisDto, ChartValueAxis>(model.ItemChartValueAxis));
|
listForm.ValueAxisJson = CreateRow<ChartValueAxisDto>(listForm.ValueAxisJson, model.ItemChartValueAxis);
|
||||||
break;
|
break;
|
||||||
case ListFormEditTabs.ChartPanes.PanesJsonRow:
|
case ListFormEditTabs.ChartPanes.PanesJsonRow:
|
||||||
listForm.PanesJson = CreateRow(listForm.PanesJson, ObjectMapper.Map<ChartPanesDto, ChartPanes>(model.ItemChartPanes));
|
listForm.PanesJson = CreateRow<ChartPanesDto>(listForm.PanesJson, model.ItemChartPanes);
|
||||||
break;
|
break;
|
||||||
case ListFormEditTabs.ChartAnnotations.GeneralJsonRow:
|
case ListFormEditTabs.ChartAnnotations.GeneralJsonRow:
|
||||||
listForm.AnnotationsJson = CreateRow(listForm.AnnotationsJson, ObjectMapper.Map<ChartAnnotationDto, ChartAnnotation>(model.ItemChartAnnotation));
|
listForm.AnnotationsJson = CreateRow<ChartAnnotationDto>(listForm.AnnotationsJson, model.ItemChartAnnotation);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new UserFriendlyException(L[AppErrorCodes.ParameterNotValid]);
|
throw new UserFriendlyException(L[AppErrorCodes.ParameterNotValid]);
|
||||||
|
|
@ -142,16 +142,16 @@ public class ListFormJsonRowAppService : PlatformAppService
|
||||||
listForm.ExtraFilterJson = UpdateRow(listForm.ExtraFilterJson, ObjectMapper.Map<ExtraFilterEditDto, ExtraFilter>(model.ItemExtraFilter), model.Index);
|
listForm.ExtraFilterJson = UpdateRow(listForm.ExtraFilterJson, ObjectMapper.Map<ExtraFilterEditDto, ExtraFilter>(model.ItemExtraFilter), model.Index);
|
||||||
break;
|
break;
|
||||||
case ListFormEditTabs.ChartSeries.GeneralJsonRow:
|
case ListFormEditTabs.ChartSeries.GeneralJsonRow:
|
||||||
listForm.SeriesJson = UpdateRow(listForm.SeriesJson, ObjectMapper.Map<ChartSeriesDto, ChartSeries>(model.ItemChartSeries), model.Index);
|
listForm.SeriesJson = UpdateRow<ChartSeriesDto>(listForm.SeriesJson, model.ItemChartSeries, model.Index);
|
||||||
break;
|
break;
|
||||||
case ListFormEditTabs.ChartAxis.ValueAxisJsonRow:
|
case ListFormEditTabs.ChartAxis.ValueAxisJsonRow:
|
||||||
listForm.ValueAxisJson = UpdateRow(listForm.ValueAxisJson, ObjectMapper.Map<ChartValueAxisDto, ChartValueAxis>(model.ItemChartValueAxis), model.Index);
|
listForm.ValueAxisJson = UpdateRow<ChartValueAxisDto>(listForm.ValueAxisJson, model.ItemChartValueAxis, model.Index);
|
||||||
break;
|
break;
|
||||||
case ListFormEditTabs.ChartPanes.PanesJsonRow:
|
case ListFormEditTabs.ChartPanes.PanesJsonRow:
|
||||||
listForm.PanesJson = UpdateRow(listForm.PanesJson, ObjectMapper.Map<ChartPanesDto, ChartPanes>(model.ItemChartPanes), model.Index);
|
listForm.PanesJson = UpdateRow<ChartPanesDto>(listForm.PanesJson, model.ItemChartPanes, model.Index);
|
||||||
break;
|
break;
|
||||||
case ListFormEditTabs.ChartAnnotations.GeneralJsonRow:
|
case ListFormEditTabs.ChartAnnotations.GeneralJsonRow:
|
||||||
listForm.AnnotationsJson = UpdateRow(listForm.AnnotationsJson, ObjectMapper.Map<ChartAnnotationDto, ChartAnnotation>(model.ItemChartAnnotation), model.Index);
|
listForm.AnnotationsJson = UpdateRow<ChartAnnotationDto>(listForm.AnnotationsJson, model.ItemChartAnnotation, model.Index);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new UserFriendlyException(L[AppErrorCodes.ParameterNotValid]);
|
throw new UserFriendlyException(L[AppErrorCodes.ParameterNotValid]);
|
||||||
|
|
@ -232,6 +232,7 @@ public class ListFormJsonRowAppService : PlatformAppService
|
||||||
JsonSerializer.Deserialize<List<T>>(json);
|
JsonSerializer.Deserialize<List<T>>(json);
|
||||||
listData.Add(input);
|
listData.Add(input);
|
||||||
return JsonSerializer.Serialize(listData);
|
return JsonSerializer.Serialize(listData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private string UpdateRow<T>(string json, T input, int index)
|
private string UpdateRow<T>(string json, T input, int index)
|
||||||
|
|
|
||||||
|
|
@ -183,6 +183,10 @@ public class ListFormSelectAppService : PlatformAppService, IListFormSelectAppSe
|
||||||
{
|
{
|
||||||
result.TotalCount = await dynamicDataRepository.ExecuteScalarAsync<int>(selectQueryManager.TotalCountQuery, connectionString, param);
|
result.TotalCount = await dynamicDataRepository.ExecuteScalarAsync<int>(selectQueryManager.TotalCountQuery, connectionString, param);
|
||||||
}
|
}
|
||||||
|
else if(queryParams.Chart && !string.IsNullOrEmpty(selectQueryManager.ChartQuery))
|
||||||
|
{
|
||||||
|
result.Data = await dynamicDataRepository.QueryAsync(selectQueryManager.ChartQuery, connectionString, param);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result.Data = await dynamicDataRepository.QueryAsync(selectQueryManager.SelectQuery, connectionString, param);
|
result.Data = await dynamicDataRepository.QueryAsync(selectQueryManager.SelectQuery, connectionString, param);
|
||||||
|
|
|
||||||
|
|
@ -9,13 +9,15 @@ namespace Kurs.Platform.Queries;
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Break : ValueObject
|
public class Break : ValueObject
|
||||||
{
|
{
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("StartValue")]
|
[JsonPropertyName("StartValue")]
|
||||||
public int StartValue { get; private set; }
|
public int StartValue { get; private set; }
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("EndValue")]
|
[JsonPropertyName("EndValue")]
|
||||||
public int EndValue { get; private set; }
|
public int EndValue { get; private set; }
|
||||||
|
|
||||||
protected Break() { } // Json buradan set edecek
|
public Break() { } // JSON için gerekli
|
||||||
|
|
||||||
protected override IEnumerable<object> GetAtomicValues()
|
protected override IEnumerable<object> GetAtomicValues()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,21 +4,22 @@ using Volo.Abp.Domain.Values;
|
||||||
|
|
||||||
namespace Kurs.Platform.Queries;
|
namespace Kurs.Platform.Queries;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Break style tanımı
|
|
||||||
/// </summary>
|
|
||||||
public class BreakStyle : ValueObject
|
public class BreakStyle : ValueObject
|
||||||
{
|
{
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("Color")]
|
[JsonPropertyName("Color")]
|
||||||
public string Color { get; private set; }
|
public string Color { get; private set; }
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("Line")]
|
[JsonPropertyName("Line")]
|
||||||
public string Line { get; private set; }
|
public string Line { get; private set; }
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("Width")]
|
[JsonPropertyName("Width")]
|
||||||
public int Width { get; private set; }
|
public int Width { get; private set; }
|
||||||
|
|
||||||
protected BreakStyle() { }
|
// JSON deserialization için parametresiz public ctor bırak
|
||||||
|
public BreakStyle() { }
|
||||||
|
|
||||||
protected override IEnumerable<object> GetAtomicValues()
|
protected override IEnumerable<object> GetAtomicValues()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,34 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
using Volo.Abp.Domain.Values;
|
using Volo.Abp.Domain.Values;
|
||||||
|
|
||||||
namespace Kurs.Platform.Queries;
|
namespace Kurs.Platform.Queries;
|
||||||
|
|
||||||
public class ChartAnnotation : ValueObject
|
public class ChartAnnotation : ValueObject
|
||||||
{
|
{
|
||||||
public string Argument { get; private set; }
|
[JsonInclude] public string Argument { get; private set; }
|
||||||
public ChartBorder Border { get; private set; }
|
[JsonInclude] public ChartBorder Border { get; private set; } = new();
|
||||||
public string Color { get; private set; } = "#ffffff";
|
[JsonInclude] public string Color { get; private set; } = "#ffffff";
|
||||||
public string Description { get; private set; }
|
[JsonInclude] public string Description { get; private set; }
|
||||||
public ChartFont Font { get; private set; }
|
[JsonInclude] public ChartFont Font { get; private set; } = new();
|
||||||
public int Height { get; private set; } = -1;
|
[JsonInclude] public int Height { get; private set; } = -1;
|
||||||
public string Image { get; private set; }
|
[JsonInclude] public string Image { get; private set; }
|
||||||
public string Name { get; private set; }
|
[JsonInclude] public string Name { get; private set; }
|
||||||
public int OffsetX { get; private set; } = -1;
|
[JsonInclude] public int OffsetX { get; private set; } = -1;
|
||||||
public int OffsetY { get; private set; } = -1;
|
[JsonInclude] public int OffsetY { get; private set; } = -1;
|
||||||
public int PaddingLeftRight { get; private set; } = 10;
|
[JsonInclude] public int PaddingLeftRight { get; private set; } = 10;
|
||||||
public int PaddingTopBottom { get; private set; } = 10;
|
[JsonInclude] public int PaddingTopBottom { get; private set; } = 10;
|
||||||
public string Series { get; private set; }
|
[JsonInclude] public string Series { get; private set; }
|
||||||
public string Text { get; private set; }
|
[JsonInclude] public string Text { get; private set; }
|
||||||
public bool TooltipEnabled { get; private set; } = true;
|
[JsonInclude] public bool TooltipEnabled { get; private set; } = true;
|
||||||
public string Type { get; private set; }
|
[JsonInclude] public string Type { get; private set; }
|
||||||
public string Value { get; private set; }
|
[JsonInclude] public string Value { get; private set; }
|
||||||
public int Width { get; private set; }
|
[JsonInclude] public int Width { get; private set; }
|
||||||
public string WordWrap { get; private set; } = "normal";
|
[JsonInclude] public string WordWrap { get; private set; } = "normal";
|
||||||
public int X { get; private set; }
|
[JsonInclude] public int X { get; private set; }
|
||||||
public int Y { get; private set; }
|
[JsonInclude] public int Y { get; private set; }
|
||||||
|
|
||||||
|
public ChartAnnotation() { }
|
||||||
|
|
||||||
protected override IEnumerable<object> GetAtomicValues()
|
protected override IEnumerable<object> GetAtomicValues()
|
||||||
{
|
{
|
||||||
|
|
@ -52,4 +55,3 @@ public class ChartAnnotation : ValueObject
|
||||||
yield return Y;
|
yield return Y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,16 +9,19 @@ namespace Kurs.Platform.Queries;
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ChartAxisGrid : ValueObject
|
public class ChartAxisGrid : ValueObject
|
||||||
{
|
{
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("Color")]
|
[JsonPropertyName("Color")]
|
||||||
public string Color { get; private set; }
|
public string Color { get; private set; }
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("Visible")]
|
[JsonPropertyName("Visible")]
|
||||||
public bool Visible { get; private set; }
|
public bool Visible { get; private set; }
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("Width")]
|
[JsonPropertyName("Width")]
|
||||||
public int Width { get; private set; }
|
public int Width { get; private set; }
|
||||||
|
|
||||||
protected ChartAxisGrid() { }
|
public ChartAxisGrid() { } // JSON için gerekli
|
||||||
|
|
||||||
protected override IEnumerable<object> GetAtomicValues()
|
protected override IEnumerable<object> GetAtomicValues()
|
||||||
{
|
{
|
||||||
|
|
@ -27,3 +30,4 @@ public class ChartAxisGrid : ValueObject
|
||||||
yield return Width;
|
yield return Width;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,28 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
using Volo.Abp.Domain.Values;
|
using Volo.Abp.Domain.Values;
|
||||||
|
|
||||||
namespace Kurs.Platform.Queries;
|
namespace Kurs.Platform.Queries;
|
||||||
|
|
||||||
public class ChartBorder : ValueObject
|
public class ChartBorder : ValueObject
|
||||||
{
|
{
|
||||||
|
[JsonInclude]
|
||||||
public string Color { get; private set; } = "#d3d3d3";
|
public string Color { get; private set; } = "#d3d3d3";
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
public int CornerRadius { get; private set; } = 0;
|
public int CornerRadius { get; private set; } = 0;
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
public string DashStyle { get; private set; } = "solid";
|
public string DashStyle { get; private set; } = "solid";
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
public bool Visible { get; private set; }
|
public bool Visible { get; private set; }
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
public int Width { get; private set; } = 1;
|
public int Width { get; private set; } = 1;
|
||||||
|
|
||||||
|
public ChartBorder() { } // JSON deserialize için parametresiz public ctor
|
||||||
|
|
||||||
protected override IEnumerable<object> GetAtomicValues()
|
protected override IEnumerable<object> GetAtomicValues()
|
||||||
{
|
{
|
||||||
yield return Color;
|
yield return Color;
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,24 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
using Volo.Abp.Domain.Values;
|
using Volo.Abp.Domain.Values;
|
||||||
|
|
||||||
namespace Kurs.Platform.Queries;
|
namespace Kurs.Platform.Queries;
|
||||||
|
|
||||||
public class ChartFont : ValueObject
|
public class ChartFont : ValueObject
|
||||||
{
|
{
|
||||||
|
[JsonInclude]
|
||||||
public string Color { get; private set; } = "#FFFFFF";
|
public string Color { get; private set; } = "#FFFFFF";
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
public string Family { get; private set; } = "\"Segoe UI\", \"Helvetica Neue\", \"Trebuchet MS\", Verdana, sans-serif";
|
public string Family { get; private set; } = "\"Segoe UI\", \"Helvetica Neue\", \"Trebuchet MS\", Verdana, sans-serif";
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
public int Size { get; private set; } = 12;
|
public int Size { get; private set; } = 12;
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
public int Weight { get; private set; } = 400;
|
public int Weight { get; private set; } = 400;
|
||||||
|
|
||||||
// EF Core + JSON için korumalı ctor
|
public ChartFont() { }
|
||||||
protected ChartFont() { }
|
|
||||||
|
|
||||||
protected override IEnumerable<object> GetAtomicValues()
|
protected override IEnumerable<object> GetAtomicValues()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
using Volo.Abp.Domain.Values;
|
using Volo.Abp.Domain.Values;
|
||||||
|
|
||||||
namespace Kurs.Platform.Queries;
|
namespace Kurs.Platform.Queries;
|
||||||
|
|
||||||
public class ChartLabel : ValueObject
|
public class ChartLabel : ValueObject
|
||||||
{
|
{
|
||||||
public string BackgroundColor { get; private set; } = "#f05b41";
|
[JsonInclude] public string BackgroundColor { get; private set; } = "#f05b41";
|
||||||
public string CustomizeText { get; private set; }
|
[JsonInclude] public string CustomizeText { get; private set; }
|
||||||
public ChartFont Font { get; private set; }
|
[JsonInclude] public ChartFont Font { get; private set; } = new();
|
||||||
public bool Visible { get; private set; }
|
[JsonInclude] public bool Visible { get; private set; }
|
||||||
public string Format { get; private set; }
|
[JsonInclude] public string Format { get; private set; }
|
||||||
|
|
||||||
// EF Core + JSON için korumalı ctor
|
public ChartLabel() { }
|
||||||
protected ChartLabel() { }
|
|
||||||
|
|
||||||
protected override IEnumerable<object> GetAtomicValues()
|
protected override IEnumerable<object> GetAtomicValues()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,50 +6,91 @@ namespace Kurs.Platform.Queries;
|
||||||
|
|
||||||
public class ChartSeries : ValueObject
|
public class ChartSeries : ValueObject
|
||||||
{
|
{
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("ArgumentField")]
|
[JsonPropertyName("ArgumentField")]
|
||||||
public string ArgumentField { get; private set; } = "arg";
|
public string ArgumentField { get; private set; } = "arg";
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("Axis")]
|
[JsonPropertyName("Axis")]
|
||||||
public string Axis { get; private set; }
|
public string Axis { get; private set; }
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("BarOverlapGroup")]
|
[JsonPropertyName("BarOverlapGroup")]
|
||||||
public string BarOverlapGroup { get; private set; }
|
public string BarOverlapGroup { get; private set; }
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("BarPadding")]
|
[JsonPropertyName("BarPadding")]
|
||||||
public int BarPadding { get; private set; }
|
public int BarPadding { get; private set; }
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("BarWidth")]
|
[JsonPropertyName("BarWidth")]
|
||||||
public int BarWidth { get; private set; }
|
public int BarWidth { get; private set; }
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("Color")]
|
[JsonPropertyName("Color")]
|
||||||
public string Color { get; private set; }
|
public string Color { get; private set; }
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("CornerRadius")]
|
[JsonPropertyName("CornerRadius")]
|
||||||
public int CornerRadius { get; private set; } = 0;
|
public int CornerRadius { get; private set; } = 0;
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("DashStyle")]
|
[JsonPropertyName("DashStyle")]
|
||||||
public string DashStyle { get; private set; } = "solid";
|
public string DashStyle { get; private set; } = "solid";
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("IgnoreEmptyPoints")]
|
[JsonPropertyName("IgnoreEmptyPoints")]
|
||||||
public bool IgnoreEmptyPoints { get; private set; } = false;
|
public bool IgnoreEmptyPoints { get; private set; } = false;
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("Name")]
|
[JsonPropertyName("Name")]
|
||||||
public string Name { get; private set; }
|
public string Name { get; private set; }
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("Pane")]
|
[JsonPropertyName("Pane")]
|
||||||
public string Pane { get; private set; }
|
public string Pane { get; private set; }
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("RangeValue1Field")]
|
[JsonPropertyName("RangeValue1Field")]
|
||||||
public string RangeValue1Field { get; private set; } = "val1";
|
public string RangeValue1Field { get; private set; } = "val1";
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("RangeValue2Field")]
|
[JsonPropertyName("RangeValue2Field")]
|
||||||
public string RangeValue2Field { get; private set; } = "val2";
|
public string RangeValue2Field { get; private set; } = "val2";
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("SelectionMode")]
|
[JsonPropertyName("SelectionMode")]
|
||||||
public string SelectionMode { get; private set; } = "none";
|
public string SelectionMode { get; private set; } = "none";
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("ShowInLegend")]
|
[JsonPropertyName("ShowInLegend")]
|
||||||
public bool ShowInLegend { get; private set; } = true;
|
public bool ShowInLegend { get; private set; } = true;
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("Type")]
|
[JsonPropertyName("Type")]
|
||||||
public string Type { get; private set; }
|
public string Type { get; private set; }
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("ValueField")]
|
[JsonPropertyName("ValueField")]
|
||||||
public string ValueField { get; private set; }
|
public string ValueField { get; private set; }
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("SummaryType")]
|
[JsonPropertyName("SummaryType")]
|
||||||
public string SummaryType { get; private set; }
|
public string SummaryType { get; private set; }
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("Visible")]
|
[JsonPropertyName("Visible")]
|
||||||
public bool Visible { get; private set; } = true;
|
public bool Visible { get; private set; } = true;
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("Width")]
|
[JsonPropertyName("Width")]
|
||||||
public int Width { get; private set; } = 2;
|
public int Width { get; private set; } = 2;
|
||||||
[JsonPropertyName("Label")]
|
|
||||||
public ChartLabel Label { get; private set; }
|
|
||||||
|
|
||||||
// EF Core + JSON için korumalı ctor
|
[JsonInclude]
|
||||||
|
[JsonPropertyName("Label")]
|
||||||
|
public ChartLabel Label { get; private set; } = new();
|
||||||
|
|
||||||
|
// JSON + EF Core için parametresiz public ctor
|
||||||
public ChartSeries() { }
|
public ChartSeries() { }
|
||||||
|
|
||||||
protected override IEnumerable<object> GetAtomicValues()
|
protected override IEnumerable<object> GetAtomicValues()
|
||||||
|
|
@ -77,4 +118,3 @@ public class ChartSeries : ValueObject
|
||||||
yield return Label;
|
yield return Label;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,54 +7,56 @@ namespace Kurs.Platform.Queries;
|
||||||
|
|
||||||
public class ChartValueAxis : ValueObject
|
public class ChartValueAxis : ValueObject
|
||||||
{
|
{
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("Grid")]
|
[JsonPropertyName("Grid")]
|
||||||
public ChartAxisGrid Grid { get; private set; }
|
public ChartAxisGrid Grid { get; private set; }
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("Name")]
|
[JsonPropertyName("Name")]
|
||||||
public string Name { get; private set; }
|
public string Name { get; private set; }
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("Position")]
|
[JsonPropertyName("Position")]
|
||||||
public string Position { get; private set; }
|
public string Position { get; private set; } = "left";
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("Title")]
|
[JsonPropertyName("Title")]
|
||||||
public string Title { get; private set; }
|
public string Title { get; private set; }
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("ValueType")]
|
[JsonPropertyName("ValueType")]
|
||||||
public string ValueType { get; private set; }
|
public string ValueType { get; private set; } = "numeric";
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("Visible")]
|
[JsonPropertyName("Visible")]
|
||||||
public bool Visible { get; private set; }
|
public bool Visible { get; private set; } = true;
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("Width")]
|
[JsonPropertyName("Width")]
|
||||||
public int Width { get; private set; }
|
public int Width { get; private set; } = 1;
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("Breaks")]
|
[JsonPropertyName("Breaks")]
|
||||||
public IReadOnlyCollection<Break> Breaks { get; private set; }
|
public List<Break> Breaks { get; private set; } = new();
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("BreakStyle")]
|
[JsonPropertyName("BreakStyle")]
|
||||||
public BreakStyle BreakStyle { get; private set; }
|
public BreakStyle BreakStyle { get; private set; } = new();
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("Type")]
|
[JsonPropertyName("Type")]
|
||||||
public string Type { get; private set; }
|
public string Type { get; private set; }
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("AutoBreaksEnabled")]
|
[JsonPropertyName("AutoBreaksEnabled")]
|
||||||
public bool AutoBreaksEnabled { get; private set; }
|
public bool AutoBreaksEnabled { get; private set; } = true;
|
||||||
|
|
||||||
|
[JsonInclude]
|
||||||
[JsonPropertyName("MaxAutoBreakCount")]
|
[JsonPropertyName("MaxAutoBreakCount")]
|
||||||
public int MaxAutoBreakCount { get; private set; }
|
public int MaxAutoBreakCount { get; private set; } = 2;
|
||||||
|
|
||||||
// 🔑 Bunu bırak yeterli
|
|
||||||
[JsonConstructor]
|
[JsonConstructor]
|
||||||
protected ChartValueAxis()
|
protected ChartValueAxis() { }
|
||||||
{
|
|
||||||
Breaks = [];
|
|
||||||
Position = "left";
|
|
||||||
ValueType = "numeric";
|
|
||||||
Visible = true;
|
|
||||||
Width = 1;
|
|
||||||
AutoBreaksEnabled = true;
|
|
||||||
MaxAutoBreakCount = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override IEnumerable<object> GetAtomicValues()
|
protected override IEnumerable<object> GetAtomicValues()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,9 @@ public class QueryParameters : ValueObject
|
||||||
//select
|
//select
|
||||||
//userData
|
//userData
|
||||||
|
|
||||||
|
//Chart
|
||||||
|
public bool Chart { get; set; } = false;
|
||||||
|
|
||||||
protected override IEnumerable<object> GetAtomicValues()
|
protected override IEnumerable<object> GetAtomicValues()
|
||||||
{
|
{
|
||||||
yield return ListFormCode;
|
yield return ListFormCode;
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ public interface ISelectQueryManager
|
||||||
Dictionary<string, object> SelectQueryParameters { get; }
|
Dictionary<string, object> SelectQueryParameters { get; }
|
||||||
string TotalCountQuery { get; }
|
string TotalCountQuery { get; }
|
||||||
string GroupQuery { get; }
|
string GroupQuery { get; }
|
||||||
|
string ChartQuery { get; }
|
||||||
public string DeleteQuery { get; }
|
public string DeleteQuery { get; }
|
||||||
List<(int Index, string Field, string SelectExpr, string Sort, bool IsExpanded, string GroupInterval)> GroupTuples { get; }
|
List<(int Index, string Field, string SelectExpr, string Sort, bool IsExpanded, string GroupInterval)> GroupTuples { get; }
|
||||||
List<(int Index, string Field, string SelectExpr, string SummaryType)> GroupSummaryTuples { get; }
|
List<(int Index, string Field, string SelectExpr, string SummaryType)> GroupSummaryTuples { get; }
|
||||||
|
|
@ -98,6 +99,7 @@ public class SelectQueryManager : PlatformDomainService, ISelectQueryManager
|
||||||
public string TotalCountQuery { get; private set; }
|
public string TotalCountQuery { get; private set; }
|
||||||
public string GroupQuery { get; private set; }
|
public string GroupQuery { get; private set; }
|
||||||
public string DeleteQuery { get; private set; }
|
public string DeleteQuery { get; private set; }
|
||||||
|
public string ChartQuery { get; private set; }
|
||||||
public List<(int Index, string Field, string SelectExpr, string Sort, bool IsExpanded, string GroupInterval)> GroupTuples { get; private set; } = [];
|
public List<(int Index, string Field, string SelectExpr, string Sort, bool IsExpanded, string GroupInterval)> GroupTuples { get; private set; } = [];
|
||||||
public List<(int Index, string Field, string SelectExpr, string SummaryType)> GroupSummaryTuples { get; private set; } = [];
|
public List<(int Index, string Field, string SelectExpr, string SummaryType)> GroupSummaryTuples { get; private set; } = [];
|
||||||
public List<string> SummaryQueries { get; private set; }
|
public List<string> SummaryQueries { get; private set; }
|
||||||
|
|
@ -186,6 +188,7 @@ public class SelectQueryManager : PlatformDomainService, ISelectQueryManager
|
||||||
TotalCountQuery = GetTotalCountQuery();
|
TotalCountQuery = GetTotalCountQuery();
|
||||||
GroupQuery = GetGroupQuery(listFormFields, queryParams);
|
GroupQuery = GetGroupQuery(listFormFields, queryParams);
|
||||||
DeleteQuery = GetDeleteQuery(queryParams);
|
DeleteQuery = GetDeleteQuery(queryParams);
|
||||||
|
ChartQuery = GetChartQuery(listform, queryParams);
|
||||||
|
|
||||||
#region Total Summary Queries
|
#region Total Summary Queries
|
||||||
if (queryParams != null && !queryParams.TotalSummary.IsNullOrWhiteSpace())
|
if (queryParams != null && !queryParams.TotalSummary.IsNullOrWhiteSpace())
|
||||||
|
|
@ -756,6 +759,58 @@ public class SelectQueryManager : PlatformDomainService, ISelectQueryManager
|
||||||
return $"DELETE \"{TableName}\" FROM {SelectCommand} AS \"{TableName}\" {GetWhereString()}";
|
return $"DELETE \"{TableName}\" FROM {SelectCommand} AS \"{TableName}\" {GetWhereString()}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string GetChartQuery(ListForm listform, QueryParameters queryParams = null)
|
||||||
|
{
|
||||||
|
if (listform == null || string.IsNullOrWhiteSpace(listform.SeriesJson) || queryParams == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
var seriesList = JsonSerializer.Deserialize<List<ChartSeries>>(listform.SeriesJson);
|
||||||
|
|
||||||
|
if (seriesList == null || !seriesList.Any())
|
||||||
|
throw new ArgumentException("Series list is empty!");
|
||||||
|
|
||||||
|
// ArgumentField listesi
|
||||||
|
var argumentFields = seriesList.Select(s => s.ArgumentField).Distinct().ToList();
|
||||||
|
|
||||||
|
// ArgumentField ifadesini oluştur
|
||||||
|
string argumentExpression;
|
||||||
|
if (argumentFields.Count == 1)
|
||||||
|
{
|
||||||
|
// Tek ArgumentField
|
||||||
|
argumentExpression = $"[{argumentFields.First()}]";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Birden fazla → '|' ile birleştir
|
||||||
|
argumentExpression = string.Join(" + '|' + ", argumentFields.Select(f => $"[{f}]"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Select sütunlarını oluştur
|
||||||
|
var selectParts = new List<string> { $"{argumentExpression} AS ArgumentField" };
|
||||||
|
foreach (var series in seriesList)
|
||||||
|
{
|
||||||
|
string sqlFunc = series.SummaryType.ToUpper() switch
|
||||||
|
{
|
||||||
|
"COUNT" => $"COUNT([{series.ValueField}])",
|
||||||
|
"SUM" => $"SUM([{series.ValueField}])",
|
||||||
|
"AVG" => $"AVG([{series.ValueField}])",
|
||||||
|
"MIN" => $"MIN([{series.ValueField}])",
|
||||||
|
"MAX" => $"MAX([{series.ValueField}])",
|
||||||
|
_ => throw new NotSupportedException($"Unsupported SummaryType: {series.SummaryType}")
|
||||||
|
};
|
||||||
|
|
||||||
|
selectParts.Add($"{sqlFunc} AS [{series.Name}]");
|
||||||
|
}
|
||||||
|
|
||||||
|
// SQL cümlesi
|
||||||
|
var sql = $@"
|
||||||
|
SELECT {string.Join(", ", selectParts)}
|
||||||
|
FROM [{listform.SelectCommand}]
|
||||||
|
GROUP BY {argumentExpression}";
|
||||||
|
|
||||||
|
return sql;
|
||||||
|
}
|
||||||
|
|
||||||
private string GetDefaultValue(string strValue)
|
private string GetDefaultValue(string strValue)
|
||||||
{
|
{
|
||||||
return strValue?.Replace(PlatformConsts.DefaultValues.UserId, CurrentUser.Id.ToString())
|
return strValue?.Replace(PlatformConsts.DefaultValues.UserId, CurrentUser.Id.ToString())
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,7 @@ const useListFormCustomDataSource = ({
|
||||||
listFormCode: string,
|
listFormCode: string,
|
||||||
searchParams?: URLSearchParams,
|
searchParams?: URLSearchParams,
|
||||||
cols?: GridColumnData[],
|
cols?: GridColumnData[],
|
||||||
group?: string,
|
chart?: boolean,
|
||||||
groupSummary?: string
|
|
||||||
) => {
|
) => {
|
||||||
const store: any = new CustomStore({
|
const store: any = new CustomStore({
|
||||||
key: gridOptions.keyFieldName,
|
key: gridOptions.keyFieldName,
|
||||||
|
|
@ -34,10 +33,8 @@ const useListFormCustomDataSource = ({
|
||||||
listFormCode,
|
listFormCode,
|
||||||
filter: '',
|
filter: '',
|
||||||
createDeleteQuery: searchParams?.get('createDeleteQuery'),
|
createDeleteQuery: searchParams?.get('createDeleteQuery'),
|
||||||
group,
|
chart,
|
||||||
groupSummary
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// 1. Default filter'ı al
|
// 1. Default filter'ı al
|
||||||
const defaultFilter = searchParams?.get('filter')
|
const defaultFilter = searchParams?.get('filter')
|
||||||
? JSON.parse(searchParams.get('filter')!)
|
? JSON.parse(searchParams.get('filter')!)
|
||||||
|
|
|
||||||
|
|
@ -289,8 +289,10 @@ function JsonRowOpDialogAxis({
|
||||||
</TabList>
|
</TabList>
|
||||||
<div className="pt-4">
|
<div className="pt-4">
|
||||||
<TabContent value="grid">
|
<TabContent value="grid">
|
||||||
|
<div className="grid grid-cols-3 gap-2">
|
||||||
<FormItem
|
<FormItem
|
||||||
label="Visible"
|
label="Visible"
|
||||||
|
className="col-span-1"
|
||||||
invalid={errors.grid?.visible && touched.grid?.visible}
|
invalid={errors.grid?.visible && touched.grid?.visible}
|
||||||
errorMessage={errors.grid?.visible}
|
errorMessage={errors.grid?.visible}
|
||||||
>
|
>
|
||||||
|
|
@ -299,6 +301,7 @@ function JsonRowOpDialogAxis({
|
||||||
|
|
||||||
<FormItem
|
<FormItem
|
||||||
label="Color"
|
label="Color"
|
||||||
|
className="col-span-1"
|
||||||
invalid={errors.grid?.color && touched.grid?.color}
|
invalid={errors.grid?.color && touched.grid?.color}
|
||||||
errorMessage={errors.grid?.color}
|
errorMessage={errors.grid?.color}
|
||||||
>
|
>
|
||||||
|
|
@ -307,15 +310,19 @@ function JsonRowOpDialogAxis({
|
||||||
|
|
||||||
<FormItem
|
<FormItem
|
||||||
label="Width"
|
label="Width"
|
||||||
|
className="col-span-1"
|
||||||
invalid={errors.grid?.width && touched.grid?.width}
|
invalid={errors.grid?.width && touched.grid?.width}
|
||||||
errorMessage={errors.grid?.width}
|
errorMessage={errors.grid?.width}
|
||||||
>
|
>
|
||||||
<Field type="number" name="grid.width" component={Input} />
|
<Field type="number" name="grid.width" component={Input} />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
</div>
|
||||||
</TabContent>
|
</TabContent>
|
||||||
<TabContent value="breakStyle">
|
<TabContent value="breakStyle">
|
||||||
|
<div className="grid grid-cols-4 gap-2">
|
||||||
<FormItem
|
<FormItem
|
||||||
label="Color"
|
label="Color"
|
||||||
|
className="col-span-1"
|
||||||
invalid={errors.breakStyle?.color && touched.breakStyle?.color}
|
invalid={errors.breakStyle?.color && touched.breakStyle?.color}
|
||||||
errorMessage={errors.breakStyle?.color}
|
errorMessage={errors.breakStyle?.color}
|
||||||
>
|
>
|
||||||
|
|
@ -324,6 +331,7 @@ function JsonRowOpDialogAxis({
|
||||||
|
|
||||||
<FormItem
|
<FormItem
|
||||||
label="Width"
|
label="Width"
|
||||||
|
className="col-span-1"
|
||||||
invalid={errors.breakStyle?.width && touched.breakStyle?.width}
|
invalid={errors.breakStyle?.width && touched.breakStyle?.width}
|
||||||
errorMessage={errors.breakStyle?.width}
|
errorMessage={errors.breakStyle?.width}
|
||||||
>
|
>
|
||||||
|
|
@ -332,6 +340,7 @@ function JsonRowOpDialogAxis({
|
||||||
|
|
||||||
<FormItem
|
<FormItem
|
||||||
label="Line"
|
label="Line"
|
||||||
|
className="col-span-2"
|
||||||
invalid={errors.breakStyle?.line && touched.breakStyle?.line}
|
invalid={errors.breakStyle?.line && touched.breakStyle?.line}
|
||||||
errorMessage={errors.breakStyle?.line}
|
errorMessage={errors.breakStyle?.line}
|
||||||
>
|
>
|
||||||
|
|
@ -352,6 +361,7 @@ function JsonRowOpDialogAxis({
|
||||||
)}
|
)}
|
||||||
</Field>
|
</Field>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
</div>
|
||||||
</TabContent>
|
</TabContent>
|
||||||
<TabContent value="breaks">
|
<TabContent value="breaks">
|
||||||
<FieldArray name="breaks">
|
<FieldArray name="breaks">
|
||||||
|
|
@ -369,8 +379,8 @@ function JsonRowOpDialogAxis({
|
||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div key={index}>
|
<div key={index} className="flex gap-2">
|
||||||
<FormItem layout="inline" label="Start Value">
|
<FormItem label="Start Value">
|
||||||
<Field
|
<Field
|
||||||
invalid={startValueFeedBack.invalid}
|
invalid={startValueFeedBack.invalid}
|
||||||
name={`breaks[${index}].startValue`}
|
name={`breaks[${index}].startValue`}
|
||||||
|
|
@ -379,7 +389,7 @@ function JsonRowOpDialogAxis({
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<FormItem layout="inline" label="End Value">
|
<FormItem label="End Value">
|
||||||
<Field
|
<Field
|
||||||
invalid={endValueFeedBack.invalid}
|
invalid={endValueFeedBack.invalid}
|
||||||
name={`breaks[${index}].endValue`}
|
name={`breaks[${index}].endValue`}
|
||||||
|
|
@ -391,7 +401,8 @@ function JsonRowOpDialogAxis({
|
||||||
<Button
|
<Button
|
||||||
shape="circle"
|
shape="circle"
|
||||||
type="button"
|
type="button"
|
||||||
size="sm"
|
className="mt-7"
|
||||||
|
size="xs"
|
||||||
icon={<FaMinus />}
|
icon={<FaMinus />}
|
||||||
onClick={() => remove(index)}
|
onClick={() => remove(index)}
|
||||||
/>
|
/>
|
||||||
|
|
@ -401,8 +412,8 @@ function JsonRowOpDialogAxis({
|
||||||
: null}
|
: null}
|
||||||
<div>
|
<div>
|
||||||
<Button
|
<Button
|
||||||
|
size="xs"
|
||||||
type="button"
|
type="button"
|
||||||
className="ltr:mr-2 rtl:ml-2"
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
push({
|
push({
|
||||||
startValue: 0,
|
startValue: 0,
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,8 @@ import { usePermission } from '@/utils/hooks/usePermission'
|
||||||
import { Button } from '@/components/ui'
|
import { Button } from '@/components/ui'
|
||||||
import { ROUTES_ENUM } from '@/routes/route.constant'
|
import { ROUTES_ENUM } from '@/routes/route.constant'
|
||||||
import { usePWA } from '@/utils/hooks/usePWA'
|
import { usePWA } from '@/utils/hooks/usePWA'
|
||||||
import { FaInfoCircle } from 'react-icons/fa'
|
import { FaInfoCircle, FaSyncAlt } from 'react-icons/fa'
|
||||||
|
import { buildSeriesDto } from './Utils'
|
||||||
|
|
||||||
interface ChartProps extends CommonProps, Meta {
|
interface ChartProps extends CommonProps, Meta {
|
||||||
listFormCode: string
|
listFormCode: string
|
||||||
|
|
@ -22,6 +23,7 @@ interface ChartProps extends CommonProps, Meta {
|
||||||
level?: number
|
level?: number
|
||||||
refreshData?: () => Promise<void>
|
refreshData?: () => Promise<void>
|
||||||
gridDto?: GridDto
|
gridDto?: GridDto
|
||||||
|
refreshGridDto: () => Promise<void>
|
||||||
}
|
}
|
||||||
|
|
||||||
const Chart = (props: ChartProps) => {
|
const Chart = (props: ChartProps) => {
|
||||||
|
|
@ -40,18 +42,12 @@ const Chart = (props: ChartProps) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!gridDto) return
|
if (!gridDto) return
|
||||||
|
|
||||||
// console.log(
|
|
||||||
// gridDto.gridOptions?.seriesDto?.map((s) => `${s.argumentField} asc false`).join(', '),
|
|
||||||
// )
|
|
||||||
// console.log(gridDto.gridOptions?.seriesDto?.map((s) => `${s.valueField} count`).join(', '))
|
|
||||||
|
|
||||||
const dataSource = createSelectDataSource(
|
const dataSource = createSelectDataSource(
|
||||||
gridDto.gridOptions,
|
gridDto.gridOptions,
|
||||||
listFormCode,
|
listFormCode,
|
||||||
searchParams,
|
searchParams,
|
||||||
// [],
|
[],
|
||||||
// gridDto.gridOptions?.seriesDto?.map((s) => `${s.argumentField} asc false`).join(', '),
|
true,
|
||||||
// gridDto.gridOptions?.seriesDto?.map((s) => `${s.valueField} count`).join(', '),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
|
|
@ -83,13 +79,8 @@ const Chart = (props: ChartProps) => {
|
||||||
valueAxis: gridDto.gridOptions.valueAxisDto,
|
valueAxis: gridDto.gridOptions.valueAxisDto,
|
||||||
tooltip: gridDto.gridOptions.tooltipDto,
|
tooltip: gridDto.gridOptions.tooltipDto,
|
||||||
|
|
||||||
series: gridDto.gridOptions.seriesDto,
|
series: buildSeriesDto(gridDto.gridOptions.seriesDto),
|
||||||
// gridDto.gridOptions.seriesDto?.length > 0
|
|
||||||
// ? gridDto.gridOptions.seriesDto.map((s) => ({
|
|
||||||
// argumentField: 'key',
|
|
||||||
// valueField: 'summary',
|
|
||||||
// }))
|
|
||||||
// : undefined,
|
|
||||||
panes: gridDto.gridOptions.panesDto?.length > 0 ? gridDto.gridOptions.panesDto : undefined,
|
panes: gridDto.gridOptions.panesDto?.length > 0 ? gridDto.gridOptions.panesDto : undefined,
|
||||||
commonSeriesSettings: gridDto.gridOptions.commonSeriesSettingsDto,
|
commonSeriesSettings: gridDto.gridOptions.commonSeriesSettingsDto,
|
||||||
commonPaneSettings: gridDto.gridOptions.commonPaneSettingsDto,
|
commonPaneSettings: gridDto.gridOptions.commonPaneSettingsDto,
|
||||||
|
|
@ -115,9 +106,20 @@ const Chart = (props: ChartProps) => {
|
||||||
></Helmet>
|
></Helmet>
|
||||||
)}
|
)}
|
||||||
{_listFormCode && chartOptions && (
|
{_listFormCode && chartOptions && (
|
||||||
<div className="p-1 bg-white dark:bg-neutral-800 dark:border-neutral-700 ">
|
<div className="p-1 bg-white dark:bg-neutral-800 dark:border-neutral-700 h-full">
|
||||||
<div className="flex justify-end items-center">
|
<div className="flex justify-end items-center h-full">
|
||||||
<div className="relative pb-1 flex gap-1 border-b-1">
|
<div className="relative pb-1 flex gap-1 border-b-1">
|
||||||
|
<Button
|
||||||
|
size="xs"
|
||||||
|
variant={'default'}
|
||||||
|
className="text-sm"
|
||||||
|
onClick={async () => {
|
||||||
|
await props.refreshGridDto()
|
||||||
|
}}
|
||||||
|
title="Reset Grid State"
|
||||||
|
>
|
||||||
|
<FaSyncAlt className="w-3 h-3" />
|
||||||
|
</Button>
|
||||||
{checkPermission(gridDto?.gridOptions.permissionDto.u) && (
|
{checkPermission(gridDto?.gridOptions.permissionDto.u) && (
|
||||||
<Button
|
<Button
|
||||||
size="xs"
|
size="xs"
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ const List = () => {
|
||||||
setViewMode('chart')
|
setViewMode('chart')
|
||||||
setStates({ listFormCode, layout: 'chart' })
|
setStates({ listFormCode, layout: 'chart' })
|
||||||
}}
|
}}
|
||||||
title="Pivot Görünümü"
|
title="Grafik Görünümü"
|
||||||
>
|
>
|
||||||
<FaChartArea className="w-4 h-4" />
|
<FaChartArea className="w-4 h-4" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
@ -172,6 +172,7 @@ const List = () => {
|
||||||
filter={searchParams.toString()}
|
filter={searchParams.toString()}
|
||||||
isSubForm={true}
|
isSubForm={true}
|
||||||
gridDto={gridDto}
|
gridDto={gridDto}
|
||||||
|
refreshGridDto={refreshGridDto}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
</Container>
|
</Container>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import { DataType } from 'devextreme/common'
|
import { DataType } from 'devextreme/common'
|
||||||
import { PivotGridDataType } from 'devextreme/ui/pivot_grid/data_source'
|
import { PivotGridDataType } from 'devextreme/ui/pivot_grid/data_source'
|
||||||
import { MULTIVALUE_DELIMITER } from '../../constants/app.constant'
|
import { MULTIVALUE_DELIMITER } from '../../constants/app.constant'
|
||||||
|
import { ChartSeriesDto } from '@/proxy/admin/charts/models'
|
||||||
|
|
||||||
export interface GridExtraFilterState {
|
export interface GridExtraFilterState {
|
||||||
fieldName: string
|
fieldName: string
|
||||||
|
|
@ -134,6 +135,7 @@ export function getLoadOptions(loadOptions: any, params: any) {
|
||||||
'searchValue',
|
'searchValue',
|
||||||
'select',
|
'select',
|
||||||
'userData',
|
'userData',
|
||||||
|
'chart',
|
||||||
].forEach(function (i) {
|
].forEach(function (i) {
|
||||||
//if (i in loadOptions && isNotEmpty(loadOptions[i])) {
|
//if (i in loadOptions && isNotEmpty(loadOptions[i])) {
|
||||||
// params[i] = JSON.stringify(loadOptions[i]);
|
// params[i] = JSON.stringify(loadOptions[i]);
|
||||||
|
|
@ -243,3 +245,14 @@ export function setFormEditingExtraItemValues(values: any) {
|
||||||
|
|
||||||
return values
|
return values
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function buildSeriesDto(seriesList: ChartSeriesDto[]) {
|
||||||
|
if (!seriesList || seriesList.length === 0) return []
|
||||||
|
|
||||||
|
// her seri için dto oluştur
|
||||||
|
return seriesList.map((s) => ({
|
||||||
|
...s,
|
||||||
|
argumentField: 'ArgumentField',
|
||||||
|
valueField: s.name,
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue