ListFormField AllowEditing
This commit is contained in:
parent
2468e46bfb
commit
66a3261e2c
12 changed files with 33 additions and 61 deletions
|
|
@ -1,9 +0,0 @@
|
|||
namespace Sozsoft.Platform.ListForms;
|
||||
|
||||
public class ColumnEditingDto
|
||||
{
|
||||
public bool AllowEditing { get; set; } = true;
|
||||
//public bool AllowInserting { get; set; } = true;
|
||||
//public object DefaultValue { get; set; }
|
||||
}
|
||||
|
||||
|
|
@ -79,6 +79,7 @@ public class ColumnFormatDto : AuditedEntityDto<Guid>
|
|||
/// <summary> butun alanlarda OR ile arama yaptigi icin varsayilan ozelligi kapatildi, bilincli olarak acilmalidir
|
||||
/// </summary>
|
||||
public bool AllowSearch { get; set; } = false;
|
||||
public bool AllowEditing { get; set; } = true;
|
||||
public string ColumnCssClass { get; set; } // Sutuna css sinif ismi
|
||||
//[TextArea]
|
||||
public string ColumnCssValue { get; set; } // Sutuna ait css sinifinin icerigi
|
||||
|
|
@ -163,19 +164,6 @@ public class ColumnFormatDto : AuditedEntityDto<Guid>
|
|||
set { GroupSummaryJson = JsonSerializer.Serialize(value); }
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public string EditingJson { get; set; }
|
||||
public ColumnEditingDto ColumnEditingDto
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(EditingJson))
|
||||
return JsonSerializer.Deserialize<ColumnEditingDto>(EditingJson);
|
||||
return new ColumnEditingDto();
|
||||
}
|
||||
set { EditingJson = JsonSerializer.Serialize(value); }
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public string LookupJson { get; set; }
|
||||
public LookupDto LookupDto
|
||||
|
|
|
|||
|
|
@ -55,8 +55,8 @@ public class ListFormFieldsAppService : CrudAppService<
|
|||
entity.BandName = updateInput.BandName;
|
||||
entity.IsActive = updateInput.IsActive;
|
||||
entity.Visible = updateInput.Visible;
|
||||
entity.EditingJson = JsonSerializer.Serialize(updateInput.ColumnEditingDto);
|
||||
entity.AllowSearch = updateInput.AllowSearch;
|
||||
entity.AllowEditing = updateInput.AllowEditing;
|
||||
entity.ListOrderNo = updateInput.ListOrderNo;
|
||||
entity.SourceDbType = updateInput.SourceDbType;
|
||||
entity.Width = updateInput.Width;
|
||||
|
|
@ -146,8 +146,8 @@ public class ListFormFieldsAppService : CrudAppService<
|
|||
item.SortIndex = input.SortIndex;
|
||||
item.IsActive = input.IsActive;
|
||||
item.Visible = input.Visible;
|
||||
item.EditingJson = input.EditingJson;
|
||||
item.AllowSearch = input.AllowSearch;
|
||||
item.AllowEditing = input.AllowEditing;
|
||||
}
|
||||
else if (input.EditType == ListFormFieldEditTabs.CustomizationForm)
|
||||
{
|
||||
|
|
@ -262,14 +262,12 @@ public class ListFormFieldsAppService : CrudAppService<
|
|||
field.IsActive = sourceField.IsActive;
|
||||
field.Visible = sourceField.Visible;
|
||||
field.AllowSearch = sourceField.AllowSearch;
|
||||
field.EditingJson = sourceField.EditingJson;
|
||||
field.AllowEditing = sourceField.AllowEditing;
|
||||
}
|
||||
else if (input.CopiedFields.All || input.CopiedFields.Permission)
|
||||
{
|
||||
field.PermissionJson = sourceField.PermissionJson;
|
||||
}
|
||||
else if (input.CopiedFields.All || input.CopiedFields.Lookup)
|
||||
field.EditingJson = sourceField.LookupJson;
|
||||
else if (input.CopiedFields.All || input.CopiedFields.Customization)
|
||||
field.ColumnCustomizationJson = sourceField.ColumnCustomizationJson;
|
||||
else if (input.CopiedFields.All || input.CopiedFields.Filtering)
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ public class ListFormField : FullAuditedEntity<Guid>
|
|||
|
||||
public string SortDirection { get; set; } // Sortindex varsa alacagi degerler asc, desc
|
||||
public bool? AllowSearch { get; set; }
|
||||
public bool? AllowEditing { get; set; }
|
||||
public string BandName { get; set; }
|
||||
|
||||
public string ColumnFilterJson { get; set; }
|
||||
|
|
@ -33,7 +34,6 @@ public class ListFormField : FullAuditedEntity<Guid>
|
|||
public string ColumnCssClass { get; set; } // Sutuna css sinif ismi
|
||||
public string ColumnCssValue { get; set; } // Sutuna ait css sinifinin icerigi
|
||||
public string JoinTableJson { get; set; } // kolon farkli bir tablodan gelecek ise ona ait gerekli ayarlar
|
||||
public string EditingJson { get; set; }
|
||||
public string LookupJson { get; set; }
|
||||
public string ValidationRuleJson { get; set; }
|
||||
public string ColumnStylingJson { get; set; }
|
||||
|
|
|
|||
|
|
@ -358,6 +358,7 @@ public class PlatformDbContext :
|
|||
|
||||
// Varsayılan değerler
|
||||
b.Property(a => a.AllowSearch).HasDefaultValue(false);
|
||||
b.Property(a => a.AllowEditing).HasDefaultValue(true);
|
||||
b.Property(a => a.IsActive).HasDefaultValue(true);
|
||||
b.Property(a => a.Visible).HasDefaultValue(true);
|
||||
b.Property(a => a.ListOrderNo).HasDefaultValue(30);
|
||||
|
|
@ -373,7 +374,6 @@ public class PlatformDbContext :
|
|||
b.Property(a => a.TotalSummaryJson).HasColumnType("text");
|
||||
b.Property(a => a.GroupSummaryJson).HasColumnType("text");
|
||||
b.Property(a => a.JoinTableJson).HasColumnType("text");
|
||||
b.Property(a => a.EditingJson).HasColumnType("text");
|
||||
b.Property(a => a.LookupJson).HasColumnType("text");
|
||||
b.Property(a => a.ValidationRuleJson).HasColumnType("text");
|
||||
b.Property(a => a.ColumnStylingJson).HasColumnType("text");
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
|
|||
namespace Sozsoft.Platform.Migrations
|
||||
{
|
||||
[DbContext(typeof(PlatformDbContext))]
|
||||
[Migration("20260311115619_Initial")]
|
||||
[Migration("20260315193224_Initial")]
|
||||
partial class Initial
|
||||
{
|
||||
/// <inheritdoc />
|
||||
|
|
@ -2449,6 +2449,11 @@ namespace Sozsoft.Platform.Migrations
|
|||
.HasColumnType("nvarchar(20)")
|
||||
.HasDefaultValue("left");
|
||||
|
||||
b.Property<bool?>("AllowEditing")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(true);
|
||||
|
||||
b.Property<bool?>("AllowSearch")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
|
|
@ -2503,9 +2508,6 @@ namespace Sozsoft.Platform.Migrations
|
|||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<string>("EditingJson")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("EditorOptions")
|
||||
.HasColumnType("text");
|
||||
|
||||
|
|
@ -1989,6 +1989,7 @@ namespace Sozsoft.Platform.Migrations
|
|||
SortIndex = table.Column<int>(type: "int", nullable: true),
|
||||
SortDirection = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
|
||||
AllowSearch = table.Column<bool>(type: "bit", nullable: true, defaultValue: false),
|
||||
AllowEditing = table.Column<bool>(type: "bit", nullable: true, defaultValue: true),
|
||||
BandName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
|
||||
ColumnFilterJson = table.Column<string>(type: "text", nullable: true),
|
||||
ColumnHeaderJson = table.Column<string>(type: "text", nullable: true),
|
||||
|
|
@ -1999,7 +2000,6 @@ namespace Sozsoft.Platform.Migrations
|
|||
ColumnCssClass = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
|
||||
ColumnCssValue = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
||||
JoinTableJson = table.Column<string>(type: "text", nullable: true),
|
||||
EditingJson = table.Column<string>(type: "text", nullable: true),
|
||||
LookupJson = table.Column<string>(type: "text", nullable: true),
|
||||
ValidationRuleJson = table.Column<string>(type: "text", nullable: true),
|
||||
ColumnStylingJson = table.Column<string>(type: "text", nullable: true),
|
||||
|
|
@ -2446,6 +2446,11 @@ namespace Sozsoft.Platform.Migrations
|
|||
.HasColumnType("nvarchar(20)")
|
||||
.HasDefaultValue("left");
|
||||
|
||||
b.Property<bool?>("AllowEditing")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(true);
|
||||
|
||||
b.Property<bool?>("AllowSearch")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
|
|
@ -2500,9 +2505,6 @@ namespace Sozsoft.Platform.Migrations
|
|||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<string>("EditingJson")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("EditorOptions")
|
||||
.HasColumnType("text");
|
||||
|
||||
|
|
|
|||
|
|
@ -186,10 +186,6 @@ export interface ColumnCustomizationDto {
|
|||
allowReordering: boolean
|
||||
}
|
||||
|
||||
export interface ColumnEditingDto {
|
||||
allowEditing: boolean
|
||||
}
|
||||
|
||||
export interface ColumnFilterDto {
|
||||
allowFiltering: boolean
|
||||
filterOperations: string[]
|
||||
|
|
@ -211,6 +207,7 @@ export interface ColumnFormatDto extends AuditedEntityDto<string> {
|
|||
sortIndex: number
|
||||
sortDirection?: string
|
||||
allowSearch: boolean
|
||||
allowEditing: boolean
|
||||
columnCssClass?: string
|
||||
columnCssValue?: string
|
||||
bandName?: string
|
||||
|
|
@ -226,8 +223,6 @@ export interface ColumnFormatDto extends AuditedEntityDto<string> {
|
|||
columnTotalSummaryDto: ColumnTotalSummaryDto
|
||||
groupSummaryJson?: string
|
||||
columnGroupSummaryDto: ColumnTotalSummaryDto
|
||||
editingJson?: string
|
||||
columnEditingDto: ColumnEditingDto
|
||||
lookupJson?: string
|
||||
lookupDto: LookupDto
|
||||
validationRuleJson?: string
|
||||
|
|
|
|||
|
|
@ -187,31 +187,31 @@ const WizardStep2 = ({
|
|||
translate('::ListForms.Wizard.Step2.StoredProcedures') ||
|
||||
'Stored Procedures',
|
||||
options: dbObjects.storedProcedures.map((p) => ({
|
||||
label: p.procedureName,
|
||||
value: p.procedureName,
|
||||
label: p.objectName,
|
||||
value: p.objectName,
|
||||
__type: SelectCommandTypeEnum.StoredProcedure,
|
||||
__schema: p.schemaName,
|
||||
__rawName: p.procedureName,
|
||||
__rawName: p.objectName,
|
||||
})),
|
||||
},
|
||||
{
|
||||
label: translate('::ListForms.Wizard.Step2.Views') || 'Views',
|
||||
options: dbObjects.views.map((v) => ({
|
||||
label: v.viewName,
|
||||
value: v.viewName,
|
||||
label: v.objectName,
|
||||
value: v.objectName,
|
||||
__type: SelectCommandTypeEnum.View,
|
||||
__schema: v.schemaName,
|
||||
__rawName: v.viewName,
|
||||
__rawName: v.objectName,
|
||||
})),
|
||||
},
|
||||
{
|
||||
label: translate('::ListForms.Wizard.Step2.Functions') || 'Functions',
|
||||
options: dbObjects.functions.map((f) => ({
|
||||
label: f.functionName,
|
||||
value: f.functionName,
|
||||
label: f.objectName,
|
||||
value: f.objectName,
|
||||
__type: SelectCommandTypeEnum.TableValuedFunction,
|
||||
__schema: f.schemaName,
|
||||
__rawName: f.functionName,
|
||||
__rawName: f.objectName,
|
||||
})),
|
||||
},
|
||||
]
|
||||
|
|
|
|||
|
|
@ -16,12 +16,8 @@ const schema = object().shape({
|
|||
sortIndex: number(),
|
||||
isActive: bool().required(),
|
||||
visible: bool().required(),
|
||||
columnEditingDto: object()
|
||||
.shape({
|
||||
allowEditing: bool().required(),
|
||||
})
|
||||
.required(),
|
||||
allowSearch: bool().required(),
|
||||
allowEditing: bool().required(),
|
||||
})
|
||||
|
||||
function FormFieldTabOptions({
|
||||
|
|
@ -102,12 +98,12 @@ function FormFieldTabOptions({
|
|||
>
|
||||
<Field name="visible" component={Checkbox} />
|
||||
</FormItem>
|
||||
<FormItem label={translate('::ListForms.ListFormEdit.EditingAllowEditing')}>
|
||||
<Field name="columnEditingDto.allowEditing" component={Checkbox} />
|
||||
</FormItem>
|
||||
<FormItem label={translate('::ListForms.ListFormFieldEdit.HeaderingAllowSearch')}>
|
||||
<Field name="allowSearch" component={Checkbox} />
|
||||
</FormItem>
|
||||
<FormItem label={translate('::ListForms.ListFormEdit.EditingAllowEditing')}>
|
||||
<Field name="allowEditing" component={Checkbox} />
|
||||
</FormItem>
|
||||
|
||||
<Button block variant="solid" loading={isSubmitting} type="submit">
|
||||
{isSubmitting ? translate('::SavingWithThreeDot') : translate('::Save')}
|
||||
|
|
|
|||
|
|
@ -539,7 +539,7 @@ const useListFormColumns = ({
|
|||
}
|
||||
}
|
||||
|
||||
column.allowEditing = colData.columnEditingDto?.allowEditing
|
||||
column.allowEditing = colData?.allowEditing
|
||||
|
||||
// #region lookup ayarlari
|
||||
if (colData.lookupDto?.dataSourceType) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue