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