Grid ve Form itemları için PlaceHolder tanımlaması
This commit is contained in:
parent
9fb838dcba
commit
8d4f3ea0b6
12 changed files with 51 additions and 4 deletions
|
|
@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Sozsoft.Platform.Enums;
|
|
||||||
using Volo.Abp.Application.Dtos;
|
using Volo.Abp.Application.Dtos;
|
||||||
|
|
||||||
namespace Sozsoft.Platform.ListForms;
|
namespace Sozsoft.Platform.ListForms;
|
||||||
|
|
@ -14,6 +13,7 @@ public class ColumnFormatDto : AuditedEntityDto<Guid>
|
||||||
|
|
||||||
public string FieldName { get; set; }
|
public string FieldName { get; set; }
|
||||||
public string CaptionName { get; set; }
|
public string CaptionName { get; set; }
|
||||||
|
public string PlaceHolder { get; set; }
|
||||||
public bool ReadOnly { get; set; }
|
public bool ReadOnly { get; set; }
|
||||||
public bool Visible { get; set; } // select sorgusuna dahildir fakat ekranda gosterilmez, kolon secicinin icerisinde bulunur
|
public bool Visible { get; set; } // select sorgusuna dahildir fakat ekranda gosterilmez, kolon secicinin icerisinde bulunur
|
||||||
public bool IsActive { get; set; } // sadece isActive olan alanlar sorguya dahil edilir
|
public bool IsActive { get; set; } // sadece isActive olan alanlar sorguya dahil edilir
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ public class ListFormFieldsAppService : CrudAppService<
|
||||||
entity.FieldName = updateInput.FieldName;
|
entity.FieldName = updateInput.FieldName;
|
||||||
entity.CultureName = updateInput.CultureName;
|
entity.CultureName = updateInput.CultureName;
|
||||||
entity.CaptionName = updateInput.CaptionName;
|
entity.CaptionName = updateInput.CaptionName;
|
||||||
|
entity.PlaceHolder = updateInput.PlaceHolder;
|
||||||
entity.BandName = updateInput.BandName;
|
entity.BandName = updateInput.BandName;
|
||||||
entity.IsActive = updateInput.IsActive;
|
entity.IsActive = updateInput.IsActive;
|
||||||
entity.Visible = updateInput.Visible;
|
entity.Visible = updateInput.Visible;
|
||||||
|
|
@ -128,6 +129,7 @@ public class ListFormFieldsAppService : CrudAppService<
|
||||||
{
|
{
|
||||||
item.FieldName = input.FieldName;
|
item.FieldName = input.FieldName;
|
||||||
item.CaptionName = input.CaptionName;
|
item.CaptionName = input.CaptionName;
|
||||||
|
item.PlaceHolder = input.PlaceHolder;
|
||||||
item.BandName = input.BandName;
|
item.BandName = input.BandName;
|
||||||
item.SourceDbType = input.SourceDbType;
|
item.SourceDbType = input.SourceDbType;
|
||||||
item.Alignment = input.Alignment;
|
item.Alignment = input.Alignment;
|
||||||
|
|
@ -251,6 +253,7 @@ public class ListFormFieldsAppService : CrudAppService<
|
||||||
{
|
{
|
||||||
field.BandName = sourceField.BandName;
|
field.BandName = sourceField.BandName;
|
||||||
field.CaptionName = sourceField.CaptionName;
|
field.CaptionName = sourceField.CaptionName;
|
||||||
|
field.PlaceHolder = sourceField.PlaceHolder;
|
||||||
field.SourceDbType = sourceField.SourceDbType;
|
field.SourceDbType = sourceField.SourceDbType;
|
||||||
}
|
}
|
||||||
if (input.CopiedFields.All || input.CopiedFields.Options)
|
if (input.CopiedFields.All || input.CopiedFields.Options)
|
||||||
|
|
|
||||||
|
|
@ -4914,6 +4914,12 @@
|
||||||
"en": "Field Name",
|
"en": "Field Name",
|
||||||
"tr": "Alan Adı"
|
"tr": "Alan Adı"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "ListForms.ListFormFieldEdit.PlaceHolder",
|
||||||
|
"en": "Place Holder",
|
||||||
|
"tr": "Yer Tutucu"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"resourceName": "Platform",
|
"resourceName": "Platform",
|
||||||
"key": "ListForms.ListFormFieldEdit.DetailsBandName",
|
"key": "ListForms.ListFormFieldEdit.DetailsBandName",
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ public class ListFormField : FullAuditedEntity<Guid>
|
||||||
public string CultureName { get; set; } // Bu tanım hangi dil için (“tr”, “en”)
|
public string CultureName { get; set; } // Bu tanım hangi dil için (“tr”, “en”)
|
||||||
public string FieldName { get; set; } // Kaynaktaki sutun adi
|
public string FieldName { get; set; } // Kaynaktaki sutun adi
|
||||||
public string CaptionName { get; set; } // Sutun basligi
|
public string CaptionName { get; set; } // Sutun basligi
|
||||||
|
public string PlaceHolder { get; set; } // Sutun placeholder'i
|
||||||
public bool? Visible { get; set; } // Liste üzerinde gösterilecek mi? Yoksa eklenebilir sütunların arasında mı duracak. select sorgusuna dahildir
|
public bool? Visible { get; set; } // Liste üzerinde gösterilecek mi? Yoksa eklenebilir sütunların arasında mı duracak. select sorgusuna dahildir
|
||||||
public bool? IsActive { get; set; } = true; // Sadece IsActive olan alanlar sorguya dahil edilir
|
public bool? IsActive { get; set; } = true; // Sadece IsActive olan alanlar sorguya dahil edilir
|
||||||
public int? Width { get; set; } // Sütunun listedeki genişliği
|
public int? Width { get; set; } // Sütunun listedeki genişliği
|
||||||
|
|
|
||||||
|
|
@ -365,6 +365,7 @@ public class PlatformDbContext :
|
||||||
b.Property(a => a.CultureName).HasMaxLength(10).IsRequired();
|
b.Property(a => a.CultureName).HasMaxLength(10).IsRequired();
|
||||||
b.Property(a => a.FieldName).IsRequired().HasMaxLength(128);
|
b.Property(a => a.FieldName).IsRequired().HasMaxLength(128);
|
||||||
b.Property(a => a.CaptionName).HasMaxLength(256);
|
b.Property(a => a.CaptionName).HasMaxLength(256);
|
||||||
|
b.Property(a => a.PlaceHolder).HasMaxLength(256);
|
||||||
|
|
||||||
// Varsayılan değerler
|
// Varsayılan değerler
|
||||||
b.Property(a => a.AllowSearch).HasDefaultValue(false);
|
b.Property(a => a.AllowSearch).HasDefaultValue(false);
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
|
||||||
namespace Sozsoft.Platform.Migrations
|
namespace Sozsoft.Platform.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(PlatformDbContext))]
|
[DbContext(typeof(PlatformDbContext))]
|
||||||
[Migration("20260317181749_Initial")]
|
[Migration("20260330120142_Initial")]
|
||||||
partial class Initial
|
partial class Initial
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|
@ -2656,6 +2656,10 @@ namespace Sozsoft.Platform.Migrations
|
||||||
b.Property<string>("PivotSettingsJson")
|
b.Property<string>("PivotSettingsJson")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("PlaceHolder")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("nvarchar(256)");
|
||||||
|
|
||||||
b.Property<string>("RoleId")
|
b.Property<string>("RoleId")
|
||||||
.HasMaxLength(256)
|
.HasMaxLength(256)
|
||||||
.HasColumnType("nvarchar(256)");
|
.HasColumnType("nvarchar(256)");
|
||||||
|
|
@ -2031,6 +2031,7 @@ namespace Sozsoft.Platform.Migrations
|
||||||
CultureName = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: false),
|
CultureName = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: false),
|
||||||
FieldName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
FieldName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
||||||
CaptionName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
CaptionName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
||||||
|
PlaceHolder = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
||||||
Visible = table.Column<bool>(type: "bit", nullable: true, defaultValue: true),
|
Visible = table.Column<bool>(type: "bit", nullable: true, defaultValue: true),
|
||||||
IsActive = table.Column<bool>(type: "bit", nullable: true, defaultValue: true),
|
IsActive = table.Column<bool>(type: "bit", nullable: true, defaultValue: true),
|
||||||
Width = table.Column<int>(type: "int", nullable: true, defaultValue: 100),
|
Width = table.Column<int>(type: "int", nullable: true, defaultValue: 100),
|
||||||
|
|
@ -2653,6 +2653,10 @@ namespace Sozsoft.Platform.Migrations
|
||||||
b.Property<string>("PivotSettingsJson")
|
b.Property<string>("PivotSettingsJson")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("PlaceHolder")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("nvarchar(256)");
|
||||||
|
|
||||||
b.Property<string>("RoleId")
|
b.Property<string>("RoleId")
|
||||||
.HasMaxLength(256)
|
.HasMaxLength(256)
|
||||||
.HasColumnType("nvarchar(256)");
|
.HasColumnType("nvarchar(256)");
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,7 @@ export interface ColumnFilterDto {
|
||||||
export interface ColumnFormatDto extends AuditedEntityDto<string> {
|
export interface ColumnFormatDto extends AuditedEntityDto<string> {
|
||||||
fieldName?: string
|
fieldName?: string
|
||||||
captionName?: string
|
captionName?: string
|
||||||
|
placeHolder?: string
|
||||||
readOnly: boolean
|
readOnly: boolean
|
||||||
visible: boolean
|
visible: boolean
|
||||||
isActive: boolean
|
isActive: boolean
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import { tooltipFormatListOptions } from '@/proxy/admin/list-form/options'
|
||||||
const schema = object().shape({
|
const schema = object().shape({
|
||||||
fieldName: string().required().max(100),
|
fieldName: string().required().max(100),
|
||||||
captionName: string(),
|
captionName: string(),
|
||||||
|
placeHolder: string(),
|
||||||
bandName: string(),
|
bandName: string(),
|
||||||
sourceDbType: number().required(),
|
sourceDbType: number().required(),
|
||||||
})
|
})
|
||||||
|
|
@ -53,6 +54,13 @@ function FormFieldTabDetails({
|
||||||
>
|
>
|
||||||
<Field type="text" name="captionName" component={Input} />
|
<Field type="text" name="captionName" component={Input} />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
<FormItem
|
||||||
|
label={translate('::ListForms.ListFormFieldEdit.PlaceHolder')}
|
||||||
|
invalid={errors.placeHolder && touched.placeHolder}
|
||||||
|
errorMessage={errors.placeHolder}
|
||||||
|
>
|
||||||
|
<Field type="text" name="placeHolder" component={Input} />
|
||||||
|
</FormItem>
|
||||||
<FormItem
|
<FormItem
|
||||||
label={translate('::ListForms.ListFormFieldEdit.DetailsBandName')}
|
label={translate('::ListForms.ListFormFieldEdit.DetailsBandName')}
|
||||||
invalid={errors.bandName && touched.bandName}
|
invalid={errors.bandName && touched.bandName}
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,10 @@ const FormDevExpress = (props: {
|
||||||
}}
|
}}
|
||||||
></TagBoxEditorComponent>
|
></TagBoxEditorComponent>
|
||||||
)}
|
)}
|
||||||
label={{ text: translate('::' + formItem.colData?.captionName), className: 'font-semibold' }}
|
label={{
|
||||||
|
text: translate('::' + formItem.colData?.captionName),
|
||||||
|
className: 'font-semibold',
|
||||||
|
}}
|
||||||
></SimpleItemDx>
|
></SimpleItemDx>
|
||||||
) : formItem.editorType2 === PlatformEditorTypes.dxGridBox ? (
|
) : formItem.editorType2 === PlatformEditorTypes.dxGridBox ? (
|
||||||
<SimpleItemDx
|
<SimpleItemDx
|
||||||
|
|
@ -199,7 +202,10 @@ const FormDevExpress = (props: {
|
||||||
}}
|
}}
|
||||||
></GridBoxEditorComponent>
|
></GridBoxEditorComponent>
|
||||||
)}
|
)}
|
||||||
label={{ text: translate('::' + formItem.colData?.captionName), className: 'font-semibold' }}
|
label={{
|
||||||
|
text: translate('::' + formItem.colData?.captionName),
|
||||||
|
className: 'font-semibold',
|
||||||
|
}}
|
||||||
></SimpleItemDx>
|
></SimpleItemDx>
|
||||||
) : (
|
) : (
|
||||||
<SimpleItemDx
|
<SimpleItemDx
|
||||||
|
|
@ -216,6 +222,9 @@ const FormDevExpress = (props: {
|
||||||
showClearButton: true,
|
showClearButton: true,
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
|
...(formItem.colData?.placeHolder
|
||||||
|
? { placeholder: translate('::' + formItem.colData.placeHolder) }
|
||||||
|
: {}),
|
||||||
buttons: (formItem.editorOptions?.buttons || []).map((btn: any) => {
|
buttons: (formItem.editorOptions?.buttons || []).map((btn: any) => {
|
||||||
if (btn?.options?.onClick && typeof btn.options.onClick === 'string') {
|
if (btn?.options?.onClick && typeof btn.options.onClick === 'string') {
|
||||||
const origClick = eval(`(${btn.options.onClick})`)
|
const origClick = eval(`(${btn.options.onClick})`)
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,7 @@ import { useListFormCustomDataSource } from './useListFormCustomDataSource'
|
||||||
import { useListFormColumns } from './useListFormColumns'
|
import { useListFormColumns } from './useListFormColumns'
|
||||||
import { Loading } from '@/components/shared'
|
import { Loading } from '@/components/shared'
|
||||||
import { useStoreState } from '@/store'
|
import { useStoreState } from '@/store'
|
||||||
|
import { placeholder } from '@babel/types'
|
||||||
|
|
||||||
interface GridProps {
|
interface GridProps {
|
||||||
listFormCode: string
|
listFormCode: string
|
||||||
|
|
@ -924,6 +925,14 @@ const Grid = (props: GridProps) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Her item'a placeholder olarak captionName ekle
|
||||||
|
if (listFormField?.placeHolder) {
|
||||||
|
editorOptions = {
|
||||||
|
...editorOptions,
|
||||||
|
placeholder: translate('::' + listFormField.placeHolder),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Set defaultValue for @AUTONUMBER fields
|
// Set defaultValue for @AUTONUMBER fields
|
||||||
if (
|
if (
|
||||||
typeof listFormField?.defaultValue === 'string' &&
|
typeof listFormField?.defaultValue === 'string' &&
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue