From 29f243f40750f85d4848bd3d9dd23c3534c813f6 Mon Sep 17 00:00:00 2001
From: Lambert Lee <33386249+azlis@users.noreply.github.com>
Date: Fri, 27 Jan 2023 23:49:48 +0800
Subject: [PATCH] update the table component excel dmos (#403)
Co-authored-by: Argo @((MarkupString)Localizer["P3"].Value) @((MarkupString)Localizer["TablesExcelTips"].Value)
-
+
+
+
-namespace BootstrapBlazor.Shared.Samples.Table;
+ OnQueryAsync
callback",
- "P3": "When using the List<TItem>
generic collection as a data source, you need to follow the steps below to set",
- "P4": "1. Set the data source",
- "P5": "Set the Items
property of the Table
component or the OnQueryAsync
callback delegate method",
- "P6": "2. Handle the new logic",
- "P7": "Set the OnAddAsync
callback delegate function to handle the New logic",
- "P8": "The code here is sample code",
- "P8A": "custom address",
- "P9": "output log information",
- "P10": "Collection value change notification column",
- "P11": "Type",
- "P12": "3. Handle delete logic",
- "P13": "Set the OnDeleteAsync
callback delegate function to handle the delete logic",
- "P14": "The code here is sample code",
- "P15": "output log information",
- "P16": "Collection value change notification column",
- "P17": "Type",
- "P18": "4. Handle the update logic",
- "P19": "Set the OnSaveAsync
callback delegate function to handle the cell update logic",
- "P20": "After all cells in the component are edited and updated, the OnSaveAsync
callback delegate will be automatically triggered, and the parameter is the current update model TItem
",
- "P21": "The code here is sample code",
- "P22": "Cell Change Notification Class: Foo",
- "P23": "value: cell",
- "P24": "Individually control how cells are rendered by editing the template",
- "P25": "Advanced usage",
- "P26": "IsFixedHeader
fixed header height is set to Height='500px'
",
- "P27": "Name
is not editable display avatar"
+ "TablesExcel": "Table Excel",
+ "TablesExcelDescription": "Commonly used for large data sheet maintenance",
+ "TablesExcelOnQueryTitle": "binding collection",
+ "TablesExcelOnQueryIntro": "Get data collection through OnQueryAsync
callback",
+ "TablesExcelTips": "When using the List<TItem>
generic collection as a data source, you need to follow the steps below to set",
+ "TablesExcelSetDataSourceTitle": "1. Set the data source",
+ "TablesExcelSetDataSourceDescription": "Set the Items
property of the Table
component or the OnQueryAsync
callback delegate method",
+ "TablesExcelNewLogicTitle": "2. Handle the new logic",
+ "TablesExcelNewLogicDescription": "Set the OnAddAsync
callback delegate function to handle the New logic",
+ "TablesExcelNewLogicNote1": "The code here is sample code",
+ "TablesExcelNewLogicNote1Address": "custom address",
+ "TablesExcelNewLogicNote2": "output log information",
+ "TablesExcelNewLogicNote2Log1": "Collection value change notification column",
+ "TablesExcelNewLogicNote2Log2": "Type",
+ "TablesExcelDeleteLogicTitle": "3. Handle delete logic",
+ "TablesExcelDeleteLogicDescription": "Set the OnDeleteAsync
callback delegate function to handle the delete logic",
+ "TablesExcelDeleteLogicNote1": "The code here is sample code",
+ "TablesExcelDeleteLogicNote2": "output log information",
+ "TablesExcelDeleteLogicNote2Log1": "Collection value change notification column",
+ "TablesExcelDeleteLogicNote2Log2": "Type",
+ "TablesExcelUpdateLogicTitle": "4. Handle the update logic",
+ "TablesExcelUpdateLogicDescription1": "Set the OnSaveAsync
callback delegate function to handle the cell update logic",
+ "TablesExcelUpdateLogicDescription2": "After all cells in the component are edited and updated, the OnSaveAsync
callback delegate will be automatically triggered, and the parameter is the current update model TItem
",
+ "TablesExcelUpdateLogicNote": "The code here is sample code",
+ "TablesExcelUpdateLogicLog1": "Cell Change Notification Class: Foo",
+ "TablesExcelUpdateLogicLog2": "value: cell",
+ "TablesExcelCellRenderTitle": "Individually control how cells are rendered by editing the template",
+ "TablesExcelCellRenderIntro": "Advanced usage",
+ "TablesExcelCellRenderTips1": "IsFixedHeader
fixed header height is set to Height='500px'
",
+ "TablesExcelCellRenderTips2": "Name
is not editable display avatar"
},
"BootstrapBlazor.Shared.Samples.Table.TablesDynamicExcel": {
"H1": "Excel-DataTable",
diff --git a/src/BootstrapBlazor.Shared/Locales/zh.json b/src/BootstrapBlazor.Shared/Locales/zh.json
index f4613e2e1..56a300c61 100644
--- a/src/BootstrapBlazor.Shared/Locales/zh.json
+++ b/src/BootstrapBlazor.Shared/Locales/zh.json
@@ -5465,36 +5465,36 @@
"TablesSelectionNormalButtonText": "清除选择"
},
"BootstrapBlazor.Shared.Samples.Table.TablesExcel": {
- "H1": "Table 表格",
- "H2": "常用于大数据单表维护",
- "P1": "绑定集合",
- "P2": "通过 OnQueryAsync
回调获得数据集合",
- "P3": "使用 List<TItem>
泛型集合作为数据源时,需要按照下面的步骤进行设置",
- "P4": "1. 设置数据源",
- "P5": "设置 Table
组件的 Items
属性或者 OnQueryAsync
回调委托方法",
- "P6": "2. 处理新建逻辑",
- "P7": "设置 OnAddAsync
回调委托函数处理 新建 逻辑",
- "P8": "此处代码为示例代码",
- "P8A": "自定义地址",
- "P9": "输出日志信息",
- "P10": "集合值变化通知 列",
- "P11": "类型",
- "P12": "3. 处理删除逻辑",
- "P13": "设置 OnDeleteAsync
回调委托函数处理 删除 逻辑",
- "P14": "此处代码为示例代码",
- "P15": "输出日志信息",
- "P16": "集合值变化通知 列",
- "P17": "类型",
- "P18": "4. 处理更新逻辑",
- "P19": "设置 OnSaveAsync
回调委托函数处理单元格 更新 逻辑",
- "P20": "组件内部所有单元格编辑更新后会自动触发 OnSaveAsync
回调委托,参数是当前更新模型 TItem
",
- "P21": "此处代码为示例代码",
- "P22": "单元格变化通知 类: Foo ",
- "P23": "值: 单元格",
- "P24": "通过编辑模板单独控制单元格渲染方式",
- "P25": "高级用法",
- "P26": "IsFixedHeader
固定表头 高度设定为 Height='500px'
",
- "P27": "Name
不可编辑显示头像"
+ "TablesExcel": "Table 表格",
+ "TablesExcelDescription": "常用于大数据单表维护",
+ "TablesExcelOnQueryTitle": "绑定集合",
+ "TablesExcelOnQueryIntro": "通过 OnQueryAsync
回调获得数据集合",
+ "TablesExcelTips": "使用 List<TItem>
泛型集合作为数据源时,需要按照下面的步骤进行设置",
+ "TablesExcelSetDataSourceTitle": "1. 设置数据源",
+ "TablesExcelSetDataSourceDescription": "设置 Table
组件的 Items
属性或者 OnQueryAsync
回调委托方法",
+ "TablesExcelNewLogicTitle": "2. 处理新建逻辑",
+ "TablesExcelNewLogicDescription": "设置 OnAddAsync
回调委托函数处理 新建 逻辑",
+ "TablesExcelNewLogicNote1": "此处代码为示例代码",
+ "TablesExcelNewLogicNote1Address": "自定义地址",
+ "TablesExcelNewLogicNote2": "输出日志信息",
+ "TablesExcelNewLogicNote2Log1": "集合值变化通知 列",
+ "TablesExcelNewLogicNote2Log2": "类型",
+ "TablesExcelDeleteLogicTitle": "3. 处理删除逻辑",
+ "TablesExcelDeleteLogicDescription": "设置 OnDeleteAsync
回调委托函数处理 删除 逻辑",
+ "TablesExcelDeleteLogicNote1": "此处代码为示例代码",
+ "TablesExcelDeleteLogicNote2": "输出日志信息",
+ "TablesExcelDeleteLogicNote2Log1": "集合值变化通知 列",
+ "TablesExcelDeleteLogicNote2Log2": "类型",
+ "TablesExcelUpdateLogicTitle": "4. 处理更新逻辑",
+ "TablesExcelUpdateLogicDescription1": "设置 OnSaveAsync
回调委托函数处理单元格 更新 逻辑",
+ "TablesExcelUpdateLogicDescription2": "组件内部所有单元格编辑更新后会自动触发 OnSaveAsync
回调委托,参数是当前更新模型 TItem
",
+ "TablesExcelUpdateLogicNote": "此处代码为示例代码",
+ "TablesExcelUpdateLogicLog1": "单元格变化通知 类: Foo ",
+ "TablesExcelUpdateLogicLog2": "值: 单元格",
+ "TablesExcelCellRenderTitle": "通过编辑模板单独控制单元格渲染方式",
+ "TablesExcelCellRenderIntro": "高级用法",
+ "TablesExcelCellRenderTips1": "IsFixedHeader
固定表头 高度设定为 Height='500px'
",
+ "TablesExcelCellRenderTips2": "Name
不可编辑显示头像"
},
"BootstrapBlazor.Shared.Samples.Table.TablesDynamicExcel": {
"H1": "Table 表格",
diff --git a/src/BootstrapBlazor.Shared/Samples/Table/TablesExcel.razor b/src/BootstrapBlazor.Shared/Samples/Table/TablesExcel.razor
index 9c6a9331d..bb10600c7 100644
--- a/src/BootstrapBlazor.Shared/Samples/Table/TablesExcel.razor
+++ b/src/BootstrapBlazor.Shared/Samples/Table/TablesExcel.razor
@@ -1,30 +1,20 @@
@page "/tables/excel"
+@inject IStringLocalizer@Localizer["H1"]
-@Localizer["H2"]
+@Localizer["TablesExcelTitle"]
+@Localizer["TablesExcelDescription"]
-
-
-
-
protected override void OnInitialized() @@ -35,80 +25,55 @@ }
-
private Task<Foo> OnAddAsync() { - // @Localizer["P8"] - var foo = new Foo() { DateTime = DateTime.Now, Address = $"@Localizer["P8A"] {DateTime.Now.Second}" }; + // @Localizer["TablesExcelNewLogicNote1"] + var foo = new Foo() { DateTime = DateTime.Now, Address = $"@Localizer["TablesExcelNewLogicNote1Address"] {DateTime.Now.Second}" }; Items.Insert(0, foo); - // @Localizer["P9"] - Trace.Log($"@Localizer["P10"]: {Items.Count} - @Localizer["P11"]: Add"); + // @Localizer["TablesExcelNewLogicNote2"] + Trace.Log($"@Localizer["TablesExcelNewLogicNote2Log1"]: {Items.Count} - @Localizer["TablesExcelNewLogicNote2Log2"]: Add"); return Task.FromResult(foo); }
-
private Task<bool> OnDeleteAsync(IEnumerable<Foo> items) { - // @Localizer["P14"] + // @Localizer["TablesExcelDeleteLogicNote1"] Items.RemoveAll(i => items.Contains(i)); - // @Localizer["P15"] - Trace.Log($"@Localizer["P16"]: {Items.Count} - @Localizer["P17"]: Delete"); + // @Localizer["TablesExcelDeleteLogicNote2"] + Trace.Log($"@Localizer["TablesExcelDeleteLogicNote2Log1"]: {Items.Count} - @Localizer["TablesExcelDeleteLogicNote2Log2"]: Delete"); return Task.FromResult(true); }
-
private Task<bool> OnDeleteAsync(Foo item, ItemChangedType changedType) { - // @Localizer["P21"] - Trace.Log($"@Localizer["P22"] - @Localizer["P23"]"); + // @Localizer["TablesExcelUpdateLogicNote"] + Trace.Log($"@Localizer["TablesExcelUpdateLogicLog1"] - @Localizer["TablesExcelUpdateLogicLog2"]"); return Task.FromResult(true); }-