From 96a62b5aec1f70119aceb0db1a6a3b0342f5d205 Mon Sep 17 00:00:00 2001 From: wayne Date: Thu, 28 Dec 2023 21:18:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=81=E8=AE=B8=E6=92=A4=E9=94=80=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Database/Update/3.9.3/MsSql.sql | 7 ++ Database/Update/3.9.3/MySql.sql | 5 + Database/Update/3.9.3/Sqlite.sql | 5 + Database/Update/3.9.3/package.zip | Bin 0 -> 853 bytes Database/index.json | 4 + .../ViewPort/Descriptor/SelectDescriptor.cs | 2 +- src/ZKEACMS.WebHost/Locale/zh-CN.yml | 3 +- src/ZKEACMS.WebHost/Locale/zh-TW.yml | 3 +- src/ZKEACMS.WebHost/Views/Page/Design.cshtml | 2 + src/ZKEACMS.WebHost/Views/Page/Index.cshtml | 21 ++-- .../Views/Page/PageZones.cshtml | 4 +- src/ZKEACMS.WebHost/wwwroot/css/admin.css | 25 +++-- src/ZKEACMS.WebHost/wwwroot/css/admin.min.css | 2 +- src/ZKEACMS.WebHost/wwwroot/js/PageDesign.js | 7 +- .../wwwroot/js/PageDesign.min.js | 2 +- src/ZKEACMS/Constant.cs | 12 ++- src/ZKEACMS/Controllers/WidgetController.cs | 17 +++- src/ZKEACMS/Filter/WidgetAttribute.cs | 92 +++++++++--------- src/ZKEACMS/MetaData/WidgetMetaData.cs | 2 +- src/ZKEACMS/Page/PageService.cs | 21 ++-- 20 files changed, 150 insertions(+), 86 deletions(-) create mode 100644 Database/Update/3.9.3/MsSql.sql create mode 100644 Database/Update/3.9.3/MySql.sql create mode 100644 Database/Update/3.9.3/Sqlite.sql create mode 100644 Database/Update/3.9.3/package.zip diff --git a/Database/Update/3.9.3/MsSql.sql b/Database/Update/3.9.3/MsSql.sql new file mode 100644 index 00000000..83cfac7c --- /dev/null +++ b/Database/Update/3.9.3/MsSql.sql @@ -0,0 +1,7 @@ +if not exists(select 1 from DataDictionary where DicName=N'WidgetStatus') +begin + insert into DataDictionary(DicName,Title,DicValue,[Order],Pid,IsSystem,[Status]) + select N'WidgetStatus',N'Visible',1,1,0,1,1 union all + select N'WidgetStatus',N'Hidden',2,2,0,1,1 union all + select N'WidgetStatus',N'Deleted',3,3,0,1,1 +end \ No newline at end of file diff --git a/Database/Update/3.9.3/MySql.sql b/Database/Update/3.9.3/MySql.sql new file mode 100644 index 00000000..2e34be62 --- /dev/null +++ b/Database/Update/3.9.3/MySql.sql @@ -0,0 +1,5 @@ +delete from `DataDictionary` where `DicName`='WidgetStatus'; +insert into `DataDictionary`(`DicName`,`Title`,`DicValue`,`Order`,`Pid`,`IsSystem`,`Status`) +select 'WidgetStatus','Visible',1,1,0,1,1 union all +select 'WidgetStatus','Hidden',2,2,0,1,1 union all +select 'WidgetStatus','Deleted',3,3,0,1,1 \ No newline at end of file diff --git a/Database/Update/3.9.3/Sqlite.sql b/Database/Update/3.9.3/Sqlite.sql new file mode 100644 index 00000000..3f36d1a6 --- /dev/null +++ b/Database/Update/3.9.3/Sqlite.sql @@ -0,0 +1,5 @@ +delete from DataDictionary where DicName='WidgetStatus'; +insert into DataDictionary(DicName,Title,DicValue,[Order],Pid,IsSystem,[Status]) +select 'WidgetStatus','Visible',1,1,0,1,1 union all +select 'WidgetStatus','Hidden',2,2,0,1,1 union all +select 'WidgetStatus','Deleted',3,3,0,1,1 \ No newline at end of file diff --git a/Database/Update/3.9.3/package.zip b/Database/Update/3.9.3/package.zip new file mode 100644 index 0000000000000000000000000000000000000000..a0f2d67ea148195d61bc0198dedb24c91a89f722 GIT binary patch literal 853 zcmWIWW@Zs#U|`^2NSQGwoXPW^=V2hvgOP!O6G;0O2N&k(6&L1A?c3PJ;B=y2+?YEOXr;^&;oFaKt zR9sX!Z`r!?$Q$Up+FImmzpnm}CMWx7+Ww;-b#(PSFMfJvUpad+d;k7cp>hu;aA<81I}=2y0`r_F~X=cU};xyhkme*oO4Z&uC;pPHl2x(Vn* zLzqu1p+4=MaGvXs0nf4b&3m2mLth-UcmKGpIWA|wz>a__6%PE z7nYw2@f?3Xwc6yBbMtW=(KL&DacF|(2DO}~&beaOxm_L@UXy<8sQ;Alt>g+7=iEu% zHisuDOgi9jR@}C#*z5honD;g-d$NC*N$a|NlZ{&UI;5=gK=JQe>yB4W`>}1-k@QuQ zMAdApCS;wO^(AymqjPKFJM}G2*@_;f$$w9a9L`@8QhbfUmJ#8x9-zk_uTn2w2lSXC z&|_Rc8tARel2lL}_DTa_C)&*h zd95N$oYm2eL*>I$@uL0rcp`|4{Gcea)w5+BnLrDe*1dnp~`O($!n~ zijMCM)=x}tmi#ng&u8DRGtHo^b(?PD&Tnlst(_60{Rk?8O-xRSN9?RCrC-(bY`+rDdj$74BpsyI2L>O= data = new Dictionary(); IDataDictionaryService dicService = ServiceLocator.GetService(); - var dicts = dicService.Get(m => m.DicName == this.SourceKey); + var dicts = dicService.Get(m => m.DicName == this.SourceKey).OrderBy(m => m.Order); foreach (DataDictionaryEntity item in dicts) { data[item.DicValue] = item.Title; diff --git a/src/ZKEACMS.WebHost/Locale/zh-CN.yml b/src/ZKEACMS.WebHost/Locale/zh-CN.yml index f5762e01..a00db3c3 100644 --- a/src/ZKEACMS.WebHost/Locale/zh-CN.yml +++ b/src/ZKEACMS.WebHost/Locale/zh-CN.yml @@ -1541,4 +1541,5 @@ View Video Category: 查看视频类别 Manage Video Category: 管理视频类别 Video(Embed): 视频(嵌入) Name already exists: 名称已存在 -Please upload video or input video code: 请上传视频或者输入视频代码 \ No newline at end of file +Please upload video or input video code: 请上传视频或者输入视频代码 +Deleted: 已删除 \ No newline at end of file diff --git a/src/ZKEACMS.WebHost/Locale/zh-TW.yml b/src/ZKEACMS.WebHost/Locale/zh-TW.yml index 32fce54b..8acac839 100644 --- a/src/ZKEACMS.WebHost/Locale/zh-TW.yml +++ b/src/ZKEACMS.WebHost/Locale/zh-TW.yml @@ -1542,4 +1542,5 @@ View Video Category: 查看視頻類別 Manage Video Category: 管理視頻類別 Video(Embed): 視頻(嵌入) Name already exists: 名稱已存在 -Please upload video or input video code: 請上傳視頻或者輸入視頻程式碼 \ No newline at end of file +Please upload video or input video code: 請上傳視頻或者輸入視頻程式碼 +Deleted: 已删除 \ No newline at end of file diff --git a/src/ZKEACMS.WebHost/Views/Page/Design.cshtml b/src/ZKEACMS.WebHost/Views/Page/Design.cshtml index d9e376b5..616b23b9 100644 --- a/src/ZKEACMS.WebHost/Views/Page/Design.cshtml +++ b/src/ZKEACMS.WebHost/Views/Page/Design.cshtml @@ -28,6 +28,8 @@ { foreach (var widgetPart in Model.ZoneWidgets[zoneId].OrderBy(m => m.Widget.Position).ThenBy(m => m.Widget.WidgetName)) { + if (widgetPart.Widget.Status == (int)WidgetStatus.Deleted) continue; + if (widgetPart.Widget.ID.IsNotNullAndWhiteSpace()) { @await Html.DesignWidget(new DesignWidgetViewModel(widgetPart, Model.Page.ID)) diff --git a/src/ZKEACMS.WebHost/Views/Page/Index.cshtml b/src/ZKEACMS.WebHost/Views/Page/Index.cshtml index 967eb103..d94787ec 100644 --- a/src/ZKEACMS.WebHost/Views/Page/Index.cshtml +++ b/src/ZKEACMS.WebHost/Views/Page/Index.cshtml @@ -107,7 +107,7 @@ @using (Script.AtFoot()) { - +