From 11fdfd0d502e202863104d5c6038218ea934f9f5 Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 20 May 2022 16:58:54 +0800 Subject: [PATCH 001/350] =?UTF-8?q?Tag=20=E8=AE=BE=E8=AE=A1=E6=97=B6?= =?UTF-8?q?=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WpfControls/DrawingObject/TagDrawingObject.xaml.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/WpfControls/DrawingObject/TagDrawingObject.xaml.cs b/WpfControls/DrawingObject/TagDrawingObject.xaml.cs index 9a3f249..c322372 100644 --- a/WpfControls/DrawingObject/TagDrawingObject.xaml.cs +++ b/WpfControls/DrawingObject/TagDrawingObject.xaml.cs @@ -62,7 +62,12 @@ namespace ElementUI.WpfControls.DrawingObject var isLast = (i == strs.Length - 1); if (isLast) { - item.Margin = new Thickness(0, 0, 0, _cellInfo.WordWrap ? cellType.itemSpace : 0); + var marginRight = 0.0; + if (_cellType.allowAdd && !_cellType.ReadOnly && !_cellType.IsDisabled) + { + marginRight = _cellType.addButtonSettings.space; + } + item.Margin = new Thickness(0, 0, marginRight, _cellInfo.WordWrap ? cellType.itemSpace : 0); } else { @@ -231,7 +236,7 @@ namespace ElementUI.WpfControls.DrawingObject { get { - return new Thickness(_cellType.addButtonSettings.space, 0, 0, _cellInfo.WordWrap ? _cellType.itemSpace : 0); + return new Thickness(0, 0, 0, _cellInfo.WordWrap ? _cellType.itemSpace : 0); } } -- Gitee From 0919795a9f03dd309ec2114e56de582a51ed1e82 Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 20 May 2022 16:59:15 +0800 Subject: [PATCH 002/350] =?UTF-8?q?=E6=A0=91=E5=BD=A2=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=8A=9F=E8=83=BD=E4=B8=8D=E5=B7=A5=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CellTypes/CascaderCellType.cs | 2 +- CellTypes/NavMenuCellType.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CellTypes/CascaderCellType.cs b/CellTypes/CascaderCellType.cs index cde542b..ce63fdb 100644 --- a/CellTypes/CascaderCellType.cs +++ b/CellTypes/CascaderCellType.cs @@ -55,7 +55,7 @@ namespace ElementUI [SRDisplayName(nameof(Resources.CascaderCellType_options))] public List options { get; set; } = new List(); - [SRBindingDataSourceProperty(Columns = nameof(Resources.CascaderCellType_bindingOptions_Columns), IndentLevel = 1, IsIdPidStructure = true)] + [SRBindingDataSourceProperty(Columns = nameof(Resources.CascaderCellType_bindingOptions_Columns), IndentLevel = 1, IsIdPidStructure = true, TreeIdColumnName = "value", TreePidColumnName = "parentValue")] [SRDisplayName(nameof(Resources.CascaderCellType_bindingOptions))] public object bindingOptions { get; set; } [SRDisplayName(nameof(Resources.CascaderCellType_expandTrigger))] diff --git a/CellTypes/NavMenuCellType.cs b/CellTypes/NavMenuCellType.cs index d25215c..37cb79d 100644 --- a/CellTypes/NavMenuCellType.cs +++ b/CellTypes/NavMenuCellType.cs @@ -55,7 +55,7 @@ namespace ElementUI [SRDisplayName(nameof(Resources.NavMenuCellType_options))] public List options { get; set; } = new List(); - [SRBindingDataSourceProperty(Columns = nameof(Resources.NavMenuCellType_bindingOptions_Columns), IndentLevel = 1, IsIdPidStructure = true)] + [SRBindingDataSourceProperty(Columns = nameof(Resources.NavMenuCellType_bindingOptions_Columns), IndentLevel = 1, IsIdPidStructure = true, TreeIdColumnName = "value", TreePidColumnName = "parentValue")] [SRDisplayName(nameof(Resources.NavMenuCellType_bindingOptions))] public object bindingOptions { get; set; } -- Gitee From 153f388aff569033bf2d7c2a43763b7f60be50a1 Mon Sep 17 00:00:00 2001 From: "Edric.Li" Date: Sun, 22 May 2022 15:20:28 +0800 Subject: [PATCH 003/350] Fix FORGUNCY-10015 [FromCN]Setfocus command is not work in EL-input. --- Resources/CellTypes/Input.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Resources/CellTypes/Input.ts b/Resources/CellTypes/Input.ts index 3aff9d3..22a9b93 100644 --- a/Resources/CellTypes/Input.ts +++ b/Resources/CellTypes/Input.ts @@ -49,7 +49,7 @@ ref="elInput" }, methods: { handleBlur() { - self.validate(); + self.validate(); }, handleChange() { self.commitValue(); @@ -82,7 +82,7 @@ ref="elInput" Forguncy.FocusMoveHelper.AllowMoveFocusByEnterKey(inputJqel, false); } } - } + } }; this.createVueApp(option); @@ -105,7 +105,17 @@ ref="elInput" return null; } return value; + } + + public setFocus() { + this.Focus(); + } + + public hasFocus() { + const dom = $(this.vue.$refs.elInput.input); + return dom.length && document.activeElement === dom[0]; } + public Focus() { this.vue.$refs.elInput.focus(); } -- Gitee From a6969443868f32ff6009f128c8187ffc7bf0f907 Mon Sep 17 00:00:00 2001 From: "Edric.Li" Date: Sun, 22 May 2022 23:29:00 +0800 Subject: [PATCH 004/350] feat(el-tag): add InputMaxLength and InputPlaceHolder. --- CellTypes/Tag.cs | 8 ++++++++ Properties/Resources.Designer.cs | 24 +++++++++++++++++++++--- Properties/Resources.resx | 10 ++++++++-- Properties/Resources.zh-CN.resx | 10 ++++++++-- Resources/CellTypes/Tag.ts | 12 +++++++++++- 5 files changed, 56 insertions(+), 8 deletions(-) diff --git a/CellTypes/Tag.cs b/CellTypes/Tag.cs index 15c3e6a..d6db36d 100644 --- a/CellTypes/Tag.cs +++ b/CellTypes/Tag.cs @@ -156,5 +156,13 @@ namespace ElementUI [DefaultValue(20d)] [DoubleProperty(Min = 0)] public double space { get; set; } = 20; + + [SRDisplayName(nameof(Resources.Tag_InputMaxLength))] + [FormulaProperty] + public object InputMaxLength { get; set; } + + [SRDisplayName(nameof(Resources.Tag_InputPlaceholder))] + [FormulaProperty] + public object InputPlaceHolder { get; set; } } } diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index 47e999f..273557f 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -944,7 +944,7 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Week WW. + /// Looks up a localized string similar to [Week] WW. /// public static string Data_DefautWeekFormat { get { @@ -4107,7 +4107,7 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Config Add Button Settings. + /// Looks up a localized string similar to Config Add Tag Settings. /// public static string Tag_addButtonSettings { get { @@ -4178,6 +4178,24 @@ namespace ElementUI.Properties { } } + /// + /// Looks up a localized string similar to Input Max Length. + /// + public static string Tag_InputMaxLength { + get { + return ResourceManager.GetString("Tag_InputMaxLength", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Input Placeholder. + /// + public static string Tag_InputPlaceholder { + get { + return ResourceManager.GetString("Tag_InputPlaceholder", resourceCulture); + } + } + /// /// Looks up a localized string similar to Item Space. /// @@ -4224,7 +4242,7 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Text. + /// Looks up a localized string similar to Button Text. /// public static string Tag_text { get { diff --git a/Properties/Resources.resx b/Properties/Resources.resx index e107f14..53954e4 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -793,13 +793,19 @@ Allow Add - Config Add Button Settings + Config Add Tag Settings Width + + Input Max Length + + + Input Placeholder + - Text + Button Text Space diff --git a/Properties/Resources.zh-CN.resx b/Properties/Resources.zh-CN.resx index f4f86df..6b92ddb 100644 --- a/Properties/Resources.zh-CN.resx +++ b/Properties/Resources.zh-CN.resx @@ -793,13 +793,19 @@ 允许添加标签 - 添加按钮设置 + 添加标签设置 宽度 + + + 文本框最大长度 + + + 文本占位文本 - 文本 + 按钮文本 按钮间距 diff --git a/Resources/CellTypes/Tag.ts b/Resources/CellTypes/Tag.ts index 41ca868..7f04838 100644 --- a/Resources/CellTypes/Tag.ts +++ b/Resources/CellTypes/Tag.ts @@ -13,6 +13,7 @@ namespace ElementCellTypes { separator: string; allowAdd: boolean; addButtonSettings: AddButtonSettings; + } interface item { label: string; @@ -26,6 +27,9 @@ namespace ElementCellTypes { width: number; text: string; space: number; + InputMaxLength: number; + InputPlaceHolder: string; + InputClearable: boolean; } export class TagCellType extends InputCellTypeBase { @@ -99,6 +103,9 @@ namespace ElementCellTypes { {{ item.label }} `; - + const option = { template, data() { return { + maxlength: cellType.addButtonSettings.InputMaxLength, + placeholder: cellType.addButtonSettings.InputPlaceHolder, + clearable: cellType.addButtonSettings.InputClearable, items: [], size: cellType.size === "mini" ? "small" : cellType.size, effect: cellType.effect, -- Gitee From 9dc46eab0a9771890aff46c9015ad580f10ef9b4 Mon Sep 17 00:00:00 2001 From: "Edric.Li" Date: Sun, 22 May 2022 23:44:24 +0800 Subject: [PATCH 005/350] code review issues. --- Resources/CellTypes/Select.ts | 7 +++---- Resources/CellTypes/TabHeader.ts | 8 ++++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Resources/CellTypes/Select.ts b/Resources/CellTypes/Select.ts index 4ed6ae4..0f83841 100644 --- a/Resources/CellTypes/Select.ts +++ b/Resources/CellTypes/Select.ts @@ -268,18 +268,17 @@ namespace ElementCellTypes { const values = []; const set = new Set(this.value.map(toString)); - options.forEach(option=>{ - if(set.has(option.value.toString())){ + options.forEach(option => { + if (set.has(option.value.toString())) { values.push(option.value); } - }) + }); this.value = values; } else { if (!options.find(o => o.value == this.value)) { this.value = ""; } } - self.commitValue(); } }, mounted() { diff --git a/Resources/CellTypes/TabHeader.ts b/Resources/CellTypes/TabHeader.ts index 9613a79..d600f6d 100644 --- a/Resources/CellTypes/TabHeader.ts +++ b/Resources/CellTypes/TabHeader.ts @@ -59,6 +59,7 @@ namespace ElementCellTypes { return { tabs, activeName, + value: null, type: cellType.type === "default" ? undefined : cellType.type, position: cellType.position, stretch: cellType.stretch @@ -66,10 +67,11 @@ namespace ElementCellTypes { }, methods: { getValue() { - return this.activeName; + return this.value; }, setValue(value) { document.documentElement.style.setProperty('--el-transition-duration', "0s"); + this.value = value; this.activeName = value?.toString(); self.setElTransitionDurationProperty(true); @@ -79,13 +81,15 @@ namespace ElementCellTypes { setTimeout(() => { const index = Number(tab.index); + const value = this.tabs[index].Value; if (cellType.ClickCommand?.Commands?.length) { const initValue = {}; initValue[cellType.ClickCommand.ParamProperties["itemIndex"]] = index + 1; - initValue[cellType.ClickCommand.ParamProperties["itemValue"]] = this.tabs[index].Value; + initValue[cellType.ClickCommand.ParamProperties["itemValue"]] = value; initValue[cellType.ClickCommand.ParamProperties["itemText"]] = tab.props.label; self.executeCustomCommandObject(cellType.ClickCommand, initValue); } + this.value = value; self.commitValue(); }, transitionDuration * 1000); }, -- Gitee From 4f5ebab3a597aff568e5c128099efaa799c2f384 Mon Sep 17 00:00:00 2001 From: EdricLi Date: Mon, 23 May 2022 10:34:35 +0800 Subject: [PATCH 006/350] vant support set focus command and code review issues. --- Resources/CellTypes/InputNumber.ts | 15 ++++++++++++--- Resources/CellTypes/Select.ts | 11 ++++++++++- Resources/CellTypes/Tag.ts | 3 --- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/Resources/CellTypes/InputNumber.ts b/Resources/CellTypes/InputNumber.ts index 4abafa0..b106587 100644 --- a/Resources/CellTypes/InputNumber.ts +++ b/Resources/CellTypes/InputNumber.ts @@ -82,10 +82,10 @@ ref="elInput" this.disabled = false; }, blurHandler() { - self.validate(); + self.validate(); }, changedHandler() { - self.validate(); + self.validate(); } }, mounted() { @@ -93,7 +93,7 @@ ref="elInput" self.fontDom = inputJqel; inputJqel.on("input", () => { - self.inputValue = inputJqel.val(); + self.inputValue = inputJqel.val(); }); inputJqel.on("blur", () => { @@ -144,6 +144,15 @@ ref="elInput" public Focus() { this.vue.$refs.elInput.focus(); } + + public setFocus() { + this.Focus(); + } + + public hasFocus() { + const dom = $(this.vue.$refs.elInput.input); + return dom.length && document.activeElement === dom[0]; + } } } diff --git a/Resources/CellTypes/Select.ts b/Resources/CellTypes/Select.ts index 0f83841..02de704 100644 --- a/Resources/CellTypes/Select.ts +++ b/Resources/CellTypes/Select.ts @@ -364,7 +364,16 @@ namespace ElementCellTypes { public Focus() { this.vue.$refs.elInput.focus(); } - + + public setFocus() { + this.Focus(); + } + + public hasFocus() { + const dom = $(".el-input__inner",this.vueContainer); + return dom.length && document.activeElement === dom[0]; + } + public GetSelectedText() { return { SelectedText: this.getSelectedItem().map(item => item.label).join(",") diff --git a/Resources/CellTypes/Tag.ts b/Resources/CellTypes/Tag.ts index 7f04838..2090b13 100644 --- a/Resources/CellTypes/Tag.ts +++ b/Resources/CellTypes/Tag.ts @@ -29,7 +29,6 @@ namespace ElementCellTypes { space: number; InputMaxLength: number; InputPlaceHolder: string; - InputClearable: boolean; } export class TagCellType extends InputCellTypeBase { @@ -105,7 +104,6 @@ namespace ElementCellTypes { Date: Mon, 23 May 2022 10:42:01 +0800 Subject: [PATCH 007/350] update version. --- PluginConfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PluginConfig.json b/PluginConfig.json index e7a3668..768a0ab 100644 --- a/PluginConfig.json +++ b/PluginConfig.json @@ -25,8 +25,8 @@ "name_kr": "엘리멘트UI", "pluginType": "cellType,command", "guid": "2CCB2F02-D923-491E-94E4-72C9BD8C5ABE", - "version": "8.0.1.0", - "dependenceVersion": "8.0.1.0", + "version": "8.0.100.0", + "dependenceVersion": "8.0.100.0", "bundleJavaScript": false, "bundleCSS": true } \ No newline at end of file -- Gitee From 4bb70bf1c1bf51e936c86e3199cadb0ffc1b9746 Mon Sep 17 00:00:00 2001 From: EdricLi Date: Mon, 23 May 2022 10:44:27 +0800 Subject: [PATCH 008/350] Update Resources. --- Properties/Resources.resx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Properties/Resources.resx b/Properties/Resources.resx index 53954e4..664683d 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -1361,7 +1361,7 @@ Can use formula =TEXTJOIN("/",1,valuePath) convert array to string, or use loop When multiple select and searchable, whether to retain the current search keyword after selecting an option - Not Limit + Unlimited No Match -- Gitee From 4e81a981bfcc933f818ad926017ca2bdb254a325 Mon Sep 17 00:00:00 2001 From: EdricLi Date: Mon, 23 May 2022 16:15:06 +0800 Subject: [PATCH 009/350] update version. --- PluginConfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PluginConfig.json b/PluginConfig.json index 768a0ab..e7a3668 100644 --- a/PluginConfig.json +++ b/PluginConfig.json @@ -25,8 +25,8 @@ "name_kr": "엘리멘트UI", "pluginType": "cellType,command", "guid": "2CCB2F02-D923-491E-94E4-72C9BD8C5ABE", - "version": "8.0.100.0", - "dependenceVersion": "8.0.100.0", + "version": "8.0.1.0", + "dependenceVersion": "8.0.1.0", "bundleJavaScript": false, "bundleCSS": true } \ No newline at end of file -- Gitee From 884ba5b9b666ec2fafecc8c566720d9123da436c Mon Sep 17 00:00:00 2001 From: "Edric.Li" Date: Wed, 25 May 2022 09:35:56 +0800 Subject: [PATCH 010/350] update packageTool. --- PackageTool/PluginPackageTool.dll | Bin 9216 -> 9216 bytes PackageTool/PluginPackageTool.exe | Bin 149504 -> 149504 bytes PackageTool/PluginPackageTool.pdb | Bin 0 -> 13964 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 PackageTool/PluginPackageTool.pdb diff --git a/PackageTool/PluginPackageTool.dll b/PackageTool/PluginPackageTool.dll index c151878d1c3a40c0644c5196fae251154f3b0d5b..6a3c45fb056c02bafccc1842d2c955575a5c1dd4 100644 GIT binary patch delta 584 zcmY+BO=uHQ5Xb-Xwwn(UV%juhO{}a23877l2A5j#6l)T{8fl}50bAOr;K696C$aG$ z2nsel#e)P9z354J6mPxgp_fvMP=bO|^bi!=;;9IJ%r3e3V16_2&&)8))C={(+}$qi z@Uw@F`#b1Zeot*<74czF~pKM>@Cc)nab!oJP_P4&oKq>(nAslSKKsKdv?j&on`50Q@kS_6Py= zB0)U};|nVWYLtc#ZjnX^L1qklnQ;s<`!T}IIy~es=jg{#W_{FA&O4k$os}zi#hk_) z5yd?;v4~HYP}9B{Pc}4&G%{@an6}RV+KjzI-PY{)d0PA`yLsqZN5D5;ynEhZfi7)$qdaC)+2VH@od~ z4G&dvSEs6#e6Dg)-inN+I!V<(og{92VQP6bwLbUuX>|YESJUFE&Kr_{BQd^z%t)%E U#ye7h=r6Z8VX1C&lNuSp8x;= delta 608 zcmX|$56?wWTK3kCe8tVtc4TP+FmySQQG5 zP*ku7AB%_wr3Wc`@bpTL_TWV*il8@*9}w`M6pAYMJ9{1$d2?fxG2Jp@YY~%**$WXS2$13OFt$Xe)ovc#6{1%cCoA(tN zJDrj`)4+N4EAu()1|HkA)NdTOK+<65V!S3yoKRQAPH!`l zlt=KR2^wui5T95HV}ep>fU2YrfREXXBvV5NGl@QCyUhbOyKTJ>{j3kz${CvlOtUhM z1!fVJ62Toj#7lg{m{n|;^6YBtL<%~4+8&`!$?J2;+l=$S=2&F*x}_rtbO+M7EO_ diff --git a/PackageTool/PluginPackageTool.exe b/PackageTool/PluginPackageTool.exe index 63c6b84f9e18f5b41952240e2e5260fa48c62cdc..09f80e5918657badc35109077b7463a73be2315c 100644 GIT binary patch delta 202 zcmZpez}YZ?bHWd1VWIHG-&=n(>TY8+-LAQv@w$w^IfDU1B10;JF+&PN8iNUtZ3d)` z8Il<+8H|9eBp^Qt$Tws#1f!l=q<4YVkU z0SK6YI2VW){A6TU@Q@KC!~m1y0kTDaSl|~UgTN!W-1hZX8NYH19KWlqTyjL!Z4uY~Y*KObOkkKa%00B8KivR!s delta 202 zcmZpez}YZ?bHWei1DC`ae{cQGsJo5Pc)R9y#_KZv$qYseCJZSImJEqNoD9T9t=y*Cy^z N`0njn9y0o*0RV%iGim?; diff --git a/PackageTool/PluginPackageTool.pdb b/PackageTool/PluginPackageTool.pdb new file mode 100644 index 0000000000000000000000000000000000000000..36d0d14a24cf5bbc90e817b868f6ee027c75f1e9 GIT binary patch literal 13964 zcmai52V4_N6TgH=Q;K4*C|H3=S40sAAqg#1u|5sS0l|>O6cAJlpn_OIR0InMDj47RM69UTMdjI0^xM7Mg$Q|m{K(b$&&OOKC~(f@AG8Nkio){~)i=OJLN9Xf=ps|W5w zt%iXgfML36gS`&;O~ChtVBZb=ARYX{WB3Quf~VlGRJlWzVLCxP#2A4eq=n}b0O?eK zSP%9&U|$dRPr=@WL_&N?WN_p>o{apmCL>NZWW*R~51HSxB>}AnyA8txY5^G}WEQx8 z6iA2nwIL-qo(!&$!MQFthkxV2PfP8*H@Hlkj|KO7oc0$W|g8f^8Dd0-2=Y6TAt7JtfriN=5OCk0Ba4LWuzd$Tb}EMV zWN5S);fc8NXjCYJ2%IC(2KzI*F*dcLr-^&Ys#wG2n@jqB4GWlhQRi0A^+CuPc0M_; z+nb+9ZmdrB+H}`5Y}pC#JGu=x^cm?z*7jB zK8ZpT@lY~@rW-DjM978QI3t=UI$9(Qk?{q586TDQ^b}#&r=b!lUnHb*r8=`o6ulmO zMw+$^(vSFQNI4t*VO^c2%XWcnSmDuT!vkMK{hAtnM80#>_Q$N$UAYSui3HM~%42^H zcRnWqg_rdGC87ukCmJx;#~9CxkSdm&x=v)>>x|WSr)w=If`uTLj zm)|bro6a7)r1#*kqYJb|VNu<%KB7|n=)p9R1a%XOE%D|~iE*S_QwafXG7x;iny= zP+MyUC)6ekb>P_|0*)|34s40g%n+$aF5#k9(D|&mA~|p(dqgCciRCh@`FtS{2?ZNb ztQ53Qz~^#gpgR$fSjLa$$16{G&{eH~Z%cuLb7a6Jq7gS?98D}oB!C+~8dXzxBGul( z#u`L#LIc%3>?#ip=L=CJIM9toxAdU9hcGOGdEw7-t~K1z*nxC6e}BtRmY)YZG>F(w zP~LTzYdx18IF|uvg6V-ctkV^ogIyO=)eReU1TF{&P`iqh*t>DLs8q@igAN}@moxQt2*isVSdIC)dskGGKg^AfF? z8B3yQ$Jk%%{BD0<)j>XuFO_oy?i?wfONBm$10QE?+=-ZyknZ;uTb|jQ&Q5<)VtP+7 zd7x&XQn%3P`H4`NqQ>s($ch?fxl8#womXo&YQ}hiPL$%(#EcCfK7v4R5V&=owKr`~ z%l7-%%O*bVKmrf3v!(h=fKSNyF~HB2B5gNqc@9N-GYltYJRi?k8?5`wk`!gp85oF0 z@TD?I993yknn);v5cqyQ|{lGt-}cIUoB^CQ8}lBjG7XE{NOP zKAm!DOZVLKRLtCSyK0Vxvf{cXM1wz%6u5Rsgrwx z*oVf7B=f0ms6>RzVOP#Rg`7c<5#pImKM!QPo@ltnJ9Wvw<-dWpL|YokD36yB~yw%YC;q#3L1+7wD`Ix}ovuXrtj9*ZhaGt``SN>u`E^ zd3ZROFmPgv$yJ$<*t0&Os<9x{`i9rb~t9LtKaQEdfVPLM`)k=e(Th0 z8nDV{pLn5n4>p_EeyZoxxI=EI3gmNhvyPw80ANK&%VnG}RbN=lnY#<>IjtxrKQ82= zcV@$w;9h3Q`!zuQL_!8CL?tSJWAAoofqJ%$*fnw0EIa0*+&;H5+ny}afDIC(Ts}v@ zk4K4dyhFxY2f+yjt-G9V|HVp4yJDm;f779Jv{)nrHt_{!6;R!TLXmQ86TK0b;PeCf zg?LZQASanYIde3kIu@E#l)rz?+t2WCj>5 z-*_l({Z!}0H;DPLqcr{bB0cXlO_ANdEhzdA3>FK)l!Nlzq;W!Gpj!A|Tm^Zo++{Vr zh2D#`qhu zhytYbJ!_+$lqRqW%u8le=DoAf$VX|v!lCafVcS36x3F|TH+t`F4ieq*q7UwXNJT2| z%o-7X3AWVxpVNzmh_=(W?TF$Z;ZE0A5vykL5Jlq#NV%bY2xmd{e0IiSw5o9Du_ZVq z?0?V@m{#K^XcUGfBMLI&8`&&y(q7Lj-qnouF}a0BO@kjJ+|KOZG|rzLXsPaul85%I8D~MN%1`i-ioCgu_+MvUNYbuR?`91AO(u zFKlI&aC=zDb1X(^fGYEBrFLH>u|8tJE2cvVjva?r%4Z(*#pV55h8B+=}-n znkT|h*e~1Br_9cUmehA(xbgMpZ5lXWL%~NBfg`UR5;Q{O>!VfeEfsdm)WZHf`WEx)#VCxH|@_oab9zo?R@&>mxHc~Qm_w*>4^eWhSgPSHLz+wmHsJQkGdqhr?EUuPcPG#L0VZ2C*;u z79=hEV*S3*T$6mL_HP|Np#Ccsdq!Jr%+Jw@b6;M+rapVqSJ{7nL7j+@I%URt*lO8g ze&MW)Y`2Y$?RJ|yFB6l62foyf3qmC^d|+uDcF^wm78qf=4Vv;r*ZPUuilr+qhbjy_ zad}Etc#%=E9nOEu$;rj#`f}gR5!bvfM=TvpC?(;%6uN&|cM=(Im4$jy36abPpn1mC(l2H<$2ivyNY8Z9wjS+6g{`s6TD?=Ks5v(+a z3DN_^TLfu5@sH1wrvC1VGrf}n^WUaxgmj6x_iEoXL-fo(4;!advpjPqUaZczkr{%c zS!~$3Vz30j3MB3lkxanH8+z1c*eM7#o4?5PdEvjl`LiR6%=S0tXof14-RQM-IW$gu z{?qt?sC3Vic?EawJJv7LjDhh9zoUfTY>Pb#MKbKPVvDT;+zaN`CJeFI=%E=tQ(5N1 z)pcmSj}7Wc*C#ZOU0ujnRptJ0`M8;+4y;nfC|c7oC_}$|XktMVkFMA}7tzW~=+{A~ zrk19)Ak{JWAZ(*t_uKV1?_B+k7xc-hNGLVb$UrG`LdCQFP^Rkxk10=2&2T#{qfV`1 zX0&L8cu2tNRV`jO?1)Z0#V!N{#4Hj*J_r3X{yT+ZnK-8%OyCej3~0v)2n5XQA6itut95<>1IrUJ$4r zg6szGiF<==^C7P8iXtvPD#fiRn5$zw=3{e*NMAHsB#HCoh{Y%mTALUi@0U;71C<@W zW@^~Nn|yY16Owk*q}iVfn^yQRXj?n79 z$ck3_9j~_X8Dtd8#4*Z-;|;lTWlBEs2u$@Ct~86>-nnjEE%#qd4zb2*{ZL}rHv0UT zC(t&0%kfhA(e>`z*>2X?S7%zP5i(^mqF&WFd~GhQc#L-%b~R$YA7kyagCPd1<`VH2 zvc;&qq^gwF{_PtqU7J?2Wlwm_NRO=VHjhS{Pb5Yx0qK+_7@8$MfE`}-q9A*2!y>m6 z`LPXG&bjVZQ_GjbC#*T|>4tUCGNpP~Qim-1MN2-&Zn-}%j|e|d2CS|JqF~6#;rbP~ zQtVovHrV*D6|92cw+($2<9p9C9-|<}Cx%01u*d>K0-TLHu%AEdcnM`z6_I^k*6;M* z<6yczmiq9Jnuh)zL&eyYdm2ir_6+&SbFp?moVm8m!bp!usiCAU(IeQ?Cl^W>W6Y4n zXMCb%g`7Ua@9Dl>O+p~LK#odP8TGV{bvdxt8RMO2N=GU@SH6l29h@kfr-leZ!Lq%h zUb(_-Mhi?rQmU@3GR-LSIB+93Kh{5E@oxw$xA7P8Rcrm34)$1F%dfka%emQ?wsU^K z%2w89iaJWfoe#=jxS=OR_-dUuARVKf21qn;r3io<3z ztAeYaPez$C4pXz~ADA)M)not&6Xk#>DKrsLn84+^+>6@*%^ehFwLi&ll1E4$Z}`(0 zRXBo#nnt?@_PzKYAeIkSDpDWiS3O79z1j9Rf$Ij*?2;_w$HYos&9+@)j<9z?@cDHY$xMo~2NPQ&{IeIEr^XVbv(8y0p_Md=pz64SOK3LRu*hHs_a zwkFp4E5ic*^&S7Z6LFWW(H}x>h3%C+x&Hi0OD1jE{@MGBmOfAIgkypy9v#`FWKHl| z2r?l*dp+S~2J_SilSXD$SxhGo3)VG6VwH`Qn%X43%7h73U%8>%y|t+O$z8qVM|NKz zmd1o}I)m}+UFT}4e%nQ;O#EQ_Fw^Exw@v#5j-THALnNwd{6L5Uk0yu+>Xma6%<*KT z%IQnBd5ATuOjqmP))k3EIyJ&aq~?;GuZkm3)-P>W^T!oA9;=(iO7opZ6?DS*{T|^j zh!r_-+=<2evxl`y2MGQ4Lw#r+}TXg0y;wO4#I94FxU_;q<=z$<$|MSS9yq z@ru??0)K}p*Ve%HL{o<^Ubz)2z92D#i$G^$W)4$eCd{~0bN za{7-0&Zfhj-_Un2mA9xrt6=P6v+N3%*&pF_Ay>rf$OTU7yuJ!~m`)fbstlF-R=l@c zGNO1-<48 zwEM>4Gu?M?JmIRlCe-|oDs*wc=HNY5upv&fml)Z{@mMFxQp=+JQAPiUi%14iDU^p5 z?3E$x&B9^Wdsj?(FqPM$;XvooMjolyLZ(g=%FURqoRWUDM$5 z02$pO-F1Ck%e(L0%8vh;mugg`ZMnY-!tXjJyi9sE-fQ)tB@eZvH5)p^m5SdAj{>8IYiH&vXEhgrzJtQ_nz6@V^?g8EU(&hv&*Q3`KJ;P512Z%$HKihnTjr}n^J7eCNBq-^6{Kcl;O{e{K z^xFR}@#NWYI0n|tsj5K*pUV1!Vg_N^_7P)$K(IwBr)s*TH7hsce!Of)EirTd4pw%f z=ibLH5Te67k!5MHg7LR*oA8wdeX2%zU8ekO@2R`tFlfBeYw0`l2G`W1+kRROUpPz? zS_)S;xMiA;Zo-}tptA}WvLY{f9SI5Pw|I(Iu{us|(&)GO&{MdC$T?{|YryMB_MY;x z1g-2HG<9`QrQEZcM99XG3?9? zVuc;75~}P4qvG-ZLLFy~YA^nJsoH&&;MO4KHQ}c&V%XqGrvNL-;g)>q{}d}tq_^C7 z_qKSJchN^q-zSB76S^RSInw!3DvUhg0#PiEMyR8{LAf`}S0B@!IF-GA4Sme$4_Rmb z1FcjxY?byI*f#m!c?>+Y|oHF*@Yh>SlfVw!1_ER>NWz{^f+cKvh-mm<|_rqd)~QB@sy~#{{lSZaIP%fOAJ~()E5o<%9yylAJYCA&F!fdqQOZ)&7QDVj ztT*1DSpNVjx%qa>r`O_QwjyF@Q_<#n2SP~+2juwp8xl&Rng}jnPtDCY9o^qrFL6KA zqm9?S^xPax2p^OZarNK9wbI088uEElUDI*)iV z>@3vmpCP+u*_m`_R-9rlYn`UB#pQGi(X-nJW6^f^+nW*}Nj(v9L}h@8$Katmd~Zui4djP~sj6)6uSG0F z9+8kk=Q3*$D^pUNBnJpI}cLYL$<;QjnH_zNR&Co9Sze z#!m8>IVj^#NIH)Xs_sNksNDHt9h6-bd;7h9^;fTA+ba+14wp>U$U*5AjO$5zkVk!x zbq%#`7Yr+DdBY91?&sxlG(x&$DIrc@t|O1Mk@Jrz>k=L6lJvmJqzb zNd-$@z8Hj1<$F6y@x@83v&>?gHe;-pD<;Y5g319gRp^Ut*yG+j9me2XIqDK}HT_EcB1(MQE$d;B(uxB&F>58v2!u`^c zCJSthv+k(1VY&zY;x%rd;lZugv}CX?qrRcgpSIg_m()VH>YO?xTF?n(;4%(-ON-QR z_q&1354^JdKIM^~kq8fh>VY4jp(-4mOEGVU3x`m0%ILP-$$lBbjD45g>v2+D7JN+{ zSFJy4`U19QqB*xdcz*>m@qy1w0b|{pF65otl)5Vdv-y_`f{e)zN*H_Ht6v(L9MTG5 zxyfZBWm){Uk|=ojx*mE-cK+E7rinGK#lbx&nJfEk?+OUwgH%T%iUB*-cp7$jDrWUh zlFG$_gZ)^WO;#AU+Z4Z3M-v#rEd!gdMNHhmzca(C+gK~j?mNG_&zhnRffXxa$hy&5 zE1`nssmvv=^S66s^qCvt6FZK9M>6>G6V4e)TeBBNubqoROS+r;(8|ni$|H0?+2fR0 zK!Jq_u((ruIv{wJdkf~=4i}G6vfomf+ddo&yP0QDkf;m3qaYdSk&r=T-R_791)(5) zD8MoMkika?;M)T5IR^>pN7e=3e}GRl;E54g7wpJ!B;|%d2H!J);vV?K0e;Ido2)w+ zu_GhBRP_Gv$^`gz0|uG`k9^6<5Tri^(e0*9K|&B0LqI=;0zQp!rXT~50Tl4j10fE4 z*P;ux0Uv@unHKO~5BTKtU20BuN#OvUq=aFO2uE;>yF=ogP%Btscv8Vy4n;Cb09tZGK<|ub)^1)T^Do} z_C-Q}(g8Z@fDh?F1nGd3bYLmzz$VgxT+)G~qexRpTvFmBvLcbJC`U-kUy)Wglasv3 zD^`$GV#q0bNvWZv)GB-MRR}2*bm2gZ_nk_fN}oZH{{cCoSaARV literal 0 HcmV?d00001 -- Gitee From a0b3ab3bd2be94459a1be23026d913df24348ecf Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 26 May 2022 10:01:37 +0800 Subject: [PATCH 011/350] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CellTypes/CascaderCellType.cs | 4 +- CellTypes/NavMenuCellType.cs | 135 +++++++++++- ElementUI.csproj | 15 ++ Properties/Resources.Designer.cs | 187 ++++++++++------- Properties/Resources.resx | 15 ++ Properties/Resources.zh-CN.resx | 15 ++ Resources/CellTypes/NavMenu.ts | 20 +- .../CanVisitRoleListEditorSetting.cs | 29 +++ .../EditorSettings/RoleListEditor.xaml | 18 ++ .../EditorSettings/RoleListEditor.xaml.cs | 197 ++++++++++++++++++ .../EditorSettings/RoleSelecotrDialog.xaml | 34 +++ .../EditorSettings/RoleSelecotrDialog.xaml.cs | 196 +++++++++++++++++ 12 files changed, 783 insertions(+), 82 deletions(-) create mode 100644 WpfControls/EditorSettings/CanVisitRoleListEditorSetting.cs create mode 100644 WpfControls/EditorSettings/RoleListEditor.xaml create mode 100644 WpfControls/EditorSettings/RoleListEditor.xaml.cs create mode 100644 WpfControls/EditorSettings/RoleSelecotrDialog.xaml create mode 100644 WpfControls/EditorSettings/RoleSelecotrDialog.xaml.cs diff --git a/CellTypes/CascaderCellType.cs b/CellTypes/CascaderCellType.cs index ce63fdb..9e09200 100644 --- a/CellTypes/CascaderCellType.cs +++ b/CellTypes/CascaderCellType.cs @@ -241,10 +241,10 @@ namespace ElementUI { [SRDisplayName(nameof(Resources.CascaderCellType_value))] [Required] - public string value { get; set; } + public virtual string value { get; set; } [SRDisplayName(nameof(Resources.CascaderCellType_label))] [Required] - public string label { get; set; } + public virtual string label { get; set; } public List children { get; set; } = new List(); diff --git a/CellTypes/NavMenuCellType.cs b/CellTypes/NavMenuCellType.cs index 37cb79d..7183e0b 100644 --- a/CellTypes/NavMenuCellType.cs +++ b/CellTypes/NavMenuCellType.cs @@ -33,10 +33,22 @@ namespace ElementUI } } + public class MenuNodeDesigner : ObjectDesigner + { + public override EditorSetting GetEditorSetting(PropertyDescriptor property, IBuilderContextBase contextBase) + { + if(property.Name == nameof(MenuNode.CanVisitRoleList)) + { + return new CanVisitRoleListEditorSetting(contextBase); + } + return base.GetEditorSetting(property, contextBase); + } + } + [Icon("pack://application:,,,/ElementUI;component/Resources/Images/NavMenu.png")] [OrderWeight((int)Utils.OrderWeight.NavMenu)] [Designer("ElementUI.NavMenuCellTypeDesigner, ElementUI")] - public class NavMenuCellType : ElementCellTypeBase + public class NavMenuCellType : ElementCellTypeBase, ISupportUIPermission { [SRDisplayName(nameof(Resources.NavMenuCellType_SelectCommand))] [SRCustomCommandObject(InitParamProperties = "value|label|parentId", InitParamValues = nameof(Resources.NavMenuCellType_SelectCommand_InitParamValues))] @@ -144,8 +156,90 @@ namespace ElementUI [SRDisplayName(nameof(Resources.NavMenuCellType_activeTextColor))] [ColorProperty] - public string activeTextColor { get; set; } = "Accent 1"; + public string activeTextColor { get; set; } = "Accent 1"; + + [Browsable(false)] + [SaveJsonIgnore] + [PageMetadataJsonIgnore] + public List UIPermissions + { + get + { + if (useBinding) + { + return new List(); + } + var permission = new UIPermission() + { + Scope = UIPermissionScope.Visible, + Enabled = true, + Ignore = true, + AllowRoles = new List() { DefaultRoleManager.FGC_Anonymous }, + Children = GetSubUIPermisison(this.options.OfType().ToList()) + }; + + return new List() { permission }; + } + set + { + //When get server ui permissions will set values + var visiblePermission = value?.FirstOrDefault(item => item.Scope == UIPermissionScope.Visible); + if (visiblePermission == null) + { + return; + } + SetSubUIPermission(this.options?.OfType().ToList(), visiblePermission.Children); + } + } + + private void SetSubUIPermission(List menuItems, List uiPermissions) + { + if (menuItems == null || uiPermissions == null) + { + return; + } + + foreach (var item in menuItems) + { + var permission = uiPermissions.FirstOrDefault(p => p.Name == item.label); + if (permission == null) + { + continue; + } + //Find menu item with same name + item.CanVisitRoleList.Clear(); + var allowRoles = permission.AllowRoles; + if (allowRoles != null) + { + item.CanVisitRoleList.AddRange(allowRoles.Select(r => r)); + } + + SetSubUIPermission(item.children, permission.Children); + } + } + + private List GetSubUIPermisison(List items) + { + var list = new List(); + foreach (var item in items) + { + var itemPermission = new SubUIPermission() + { + Name = item.label, + AllowRoles = item.CanVisitRoleList.Any() ? item.CanVisitRoleList.Select(r => r).ToList() : new List { DefaultRoleManager.FGC_Anonymous }, + }; + + if (item.children?.Any() == true) + { + itemPermission.Children = GetSubUIPermisison(item.children); + } + list.Add(itemPermission); + } + return list; + } + + public override bool GetDesignerPropertyVisible(string propertyName) { if (propertyName == nameof(backgroundColor) || @@ -248,19 +342,52 @@ namespace ElementUI [SRDisplayName(nameof(Resources.NavMenuCellType_PathArray))] public object PathArray { get; set; } } - } + } + + + [Designer("ElementUI.MenuNodeDesigner, ElementUI")] public class MenuNode : TreeNodeBase { + public override string value { get => base.value; set => base.value = value; } + public override string label { get => base.label; set => base.label = value; } + + [SRDisplayName(nameof(Resources.NavMenuCellType_icon))] [IconProperty(SupportUseCellColor = true)] public ImageValue icon { get; set; } - [SRDisplayName(nameof(Resources.NavMenuCellType_notification))] [FormulaProperty] public object notification { get; set; } + private List _canVisitRoleList; + + [PageMetadataJsonIgnore] + [SRDisplayName(nameof(Resources.NavMenuCellType_Permission))] + public List CanVisitRoleList + { + get + { + if (_canVisitRoleList == null) + { + _canVisitRoleList = new List(); + } + + return _canVisitRoleList; + } + set + { + _canVisitRoleList = value; + } + } + [SRDisplayName(nameof(Resources.NavMenuCellType_expend))] public bool expend { get; set; } + } + + public class DefaultRoleManager + { + public static readonly string FGC_Anonymous = "FGC_Anonymous"; + public static readonly string FGC_LoginUser = "FGC_LoginUser"; } } diff --git a/ElementUI.csproj b/ElementUI.csproj index d0a51a9..4321585 100644 --- a/ElementUI.csproj +++ b/ElementUI.csproj @@ -196,6 +196,13 @@ TransferListControl.xaml + + + RoleListEditor.xaml + + + RoleSelecotrDialog.xaml + @@ -397,6 +404,14 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index 47e999f..cb6ce62 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -196,7 +196,7 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to When check 'Show System Avatar' option, AvatarCellType will use cell value as a system user name and try to get avator image of specific user. + /// Looks up a localized string similar to When check 'Show System Avatar' option, AvatarCellType will use cell value as a system user name and try to get avator image of specific user. ///You can use UserInfoView or %CurrentUser% keyword to get user name.. /// public static string AvatarCellType_showSystemAvatar_Description { @@ -287,7 +287,7 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Default behavior is navigate the page with same name of breadcrumb part. + /// Looks up a localized string similar to Default behavior is navigate the page with same name of breadcrumb part. ///Uncheck this option can customize the click behavior by command.. /// public static string Breadcrumb_defaultBehavior_Description { @@ -675,7 +675,7 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to If you do not set a label property name, the value property is considered equal, + /// Looks up a localized string similar to If you do not set a label property name, the value property is considered equal, ///and when using different label properties at multiple levels, you can use the | Separation, e.g. 'provinceName|cityName'. /// public static string CascaderCellType_labelProperty_Description { @@ -766,16 +766,16 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Using a table JSON object tree as a data source for cells, the JSON format example is as follows - ///[ - /// {"value": 1, "label": "Department1", "parentValue": null}, - /// {"value": 2, "label": "Department1-1", "parentValue": 1}, - /// {"value": 3, "label": "Department1-2", "parentValue": 1}, - /// {"value": 4, "label": "Department1-2-1", "parentValue": 3}, - /// {"value": 5, "label": "Department2", "parentValue": null}, - /// {"value": 6, "label": "Department3", "parentValue": null} - ///] - ///The above data assumes tha [rest of string was truncated]";. + /// Looks up a localized string similar to Using a table JSON object tree as a data source for cells, the JSON format example is as follows + ///[ + /// {"value": 1, "label": "Department1", "parentValue": null}, + /// {"value": 2, "label": "Department1-1", "parentValue": 1}, + /// {"value": 3, "label": "Department1-2", "parentValue": 1}, + /// {"value": 4, "label": "Department1-2-1", "parentValue": 3}, + /// {"value": 5, "label": "Department2", "parentValue": null}, + /// {"value": 6, "label": "Department3", "parentValue": null} + ///] + ///The above data assumes that the 'va [rest of string was truncated]";. /// public static string CascaderCellType_SetDataSourceByIdPidTable_Description { get { @@ -802,23 +802,24 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Using a dynamic JSON object tree as a data source for cell, an example of JSON format is as follows - ///[ - /// { - /// "value": 1, - /// "label": "Department1", - /// "children": [ - /// { - /// "value": 2, - /// "label": "Sub-department1" - /// }, - /// { - /// "value": 3, - /// "label": "Sub-department2", - /// "children": [ - /// { - /// "value": 4, - /// "label": "Sub-depa [rest of string was truncated]";. + /// Looks up a localized string similar to Using a dynamic JSON object tree as a data source for cell, an example of JSON format is as follows + ///[ + /// { + /// "value": 1, + /// "label": "Department1", + /// "children": [ + /// { + /// "value": 2, + /// "label": "Sub-department1" + /// }, + /// { + /// "value": 3, + /// "label": "Sub-department2", + /// "children": [ + /// { + /// "value": 4, + /// "label": "Sub-department2-1" + /// [rest of string was truncated]";. /// public static string CascaderCellType_SetDataSourceByObjTree_Description { get { @@ -944,7 +945,7 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Week WW. + /// Looks up a localized string similar to [Week] WW. /// public static string Data_DefautWeekFormat { get { @@ -1142,24 +1143,24 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to [{ - /// value: 'guide', - /// label: 'Guide', - /// "icon": { - /// "Name": "Application/130_list_2.svg", - /// "BuiltIn": true, - /// "UseCellTypeForeColor":true, - /// "Color": "Background 1 -25" - /// }, - /// children: [{ - /// value: 'disciplines', - /// label: 'Disciplines', - /// children: [{ - /// value: 'consistency', - /// label: 'Consistency' - /// }, { - /// value: 'feedback', - /// [rest of string was truncated]";. + /// Looks up a localized string similar to [{ + /// value: 'guide', + /// label: 'Guide', + /// "icon": { + /// "Name": "Application/130_list_2.svg", + /// "BuiltIn": true, + /// "UseCellTypeForeColor":true, + /// "Color": "Background 1 -25" + /// }, + /// children: [{ + /// value: 'disciplines', + /// label: 'Disciplines', + /// children: [{ + /// value: 'consistency', + /// label: 'Consistency' + /// }, { + /// value: 'feedback', + /// lab [rest of string was truncated]";. /// public static string DefaultTreeSource { get { @@ -1563,6 +1564,33 @@ namespace ElementUI.Properties { } } + /// + /// Looks up a localized string similar to Allow Everyone. + /// + public static string MenuItemsEditor_AllRoleCanAccess { + get { + return ResourceManager.GetString("MenuItemsEditor_AllRoleCanAccess", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Anonymous. + /// + public static string MenuItemsEditor_Anonymous { + get { + return ResourceManager.GetString("MenuItemsEditor_Anonymous", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Authenticated Users. + /// + public static string MenuItemsEditor_LoginUser { + get { + return ResourceManager.GetString("MenuItemsEditor_LoginUser", resourceCulture); + } + } + /// /// Looks up a localized string similar to Reload Binding Items. /// @@ -1726,7 +1754,7 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Select path is a array, + /// Looks up a localized string similar to Select path is a array, ///Can use formula =TEXTJOIN("/",1,valuePath) convert array to string, or use loop command access every path part.. /// public static string NavMenuCellType_GetSelectPath_Description { @@ -1825,6 +1853,15 @@ namespace ElementUI.Properties { } } + /// + /// Looks up a localized string similar to UI Permission. + /// + public static string NavMenuCellType_Permission { + get { + return ResourceManager.GetString("NavMenuCellType_Permission", resourceCulture); + } + } + /// /// Looks up a localized string similar to Edit ValueChanged Command. /// @@ -3005,13 +3042,13 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Using a dynamic JSON object as a data source for cells, an example of JSON format is as follows - ///[ - /// {"value": 1, "label": "Banana"}, - /// {"value": 2, "label": "Apple"}, - /// {"value": 3, "label": "Pear"} - ///] - ///The above data assumes that the 'value attribute' is value and the 'label attribute name' is label + /// Looks up a localized string similar to Using a dynamic JSON object as a data source for cells, an example of JSON format is as follows + ///[ + /// {"value": 1, "label": "Banana"}, + /// {"value": 2, "label": "Apple"}, + /// {"value": 3, "label": "Pear"} + ///] + ///The above data assumes that the 'value attribute' is value and the 'label attribute name' is label ///Typically, a JSON data source can be obtained from a web service via an HTTP request command, or from a server-side command. /// public static string SelectCellType_SetDataSourceByObjArray_Description { @@ -3039,12 +3076,12 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Using a dynamic JSON string array as the data source for cells, json format example is as follows - ///[ - /// "Banana", - /// "Apple", - /// "Pear" - ///] + /// Looks up a localized string similar to Using a dynamic JSON string array as the data source for cells, json format example is as follows + ///[ + /// "Banana", + /// "Apple", + /// "Pear" + ///] ///Usually, the data source can be obtained from a web service through an HTTP request command, or it can be obtained through a server-side command. /// public static string SelectCellType_SetDataSourceByStringArray_Description { @@ -4260,8 +4297,8 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to The color of the tag cycles from the first color in the color list. - ///For example, the color list has 3 items, the first three tags will use the first three colors, the fourth will use the first color, and so on. + /// Looks up a localized string similar to The color of the tag cycles from the first color in the color list. + ///For example, the color list has 3 items, the first three tags will use the first three colors, the fourth will use the first color, and so on. ///If you want all tags to be the same color, you can keep one item in the color list. /// public static string TagCellType_ColorList_Description { @@ -4325,8 +4362,8 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to color: node color support color names, such as "red", "black" - ///Supports hexadecimal notation such as "#002316" + /// Looks up a localized string similar to color: node color support color names, such as "red", "black" + ///Supports hexadecimal notation such as "#002316" ///Support rgb or rgba formats such as: "rgb(0,10,100)" or "rgba(0,10,100,0.5)". /// public static string Timeline_bindingOptions_Columns_Description { @@ -4417,14 +4454,14 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Using a dynamic JSON object as a data source for cells, an example of JSON format is as follows - ///[ - /// {"content": "Activity start", "timestamp": "2018-04-15"}, - /// {"content": "Approved", "timestamp": "2018-04-13"}, - /// {"content": "Create Success", "timestamp": "2018-04-11"} - ///] - ///The above data assumes that the 'content attribute' is content and the 'timestamp attribute name' is timestamp - ///Typically, a JSON data source can be obtained from a web service via an HTTP request command, or from a server-side [rest of string was truncated]";. + /// Looks up a localized string similar to Using a dynamic JSON object as a data source for cells, an example of JSON format is as follows + ///[ + /// {"content": "Activity start", "timestamp": "2018-04-15"}, + /// {"content": "Approved", "timestamp": "2018-04-13"}, + /// {"content": "Create Success", "timestamp": "2018-04-11"} + ///] + ///The above data assumes that the 'content attribute' is content and the 'timestamp attribute name' is timestamp + ///Typically, a JSON data source can be obtained from a web service via an HTTP request command, or from a server-side comman [rest of string was truncated]";. /// public static string Timeline_SetDataSource_Description { get { diff --git a/Properties/Resources.resx b/Properties/Resources.resx index e107f14..402eb88 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -2057,5 +2057,20 @@ Typically, a JSON data source can be obtained from a web service via an HTTP req Edit Click Command + + + UI Permission + + + Anonymous + + + Allow Everyone + + + Authenticated Users + + + Edit \ No newline at end of file diff --git a/Properties/Resources.zh-CN.resx b/Properties/Resources.zh-CN.resx index f4f86df..d8bfb43 100644 --- a/Properties/Resources.zh-CN.resx +++ b/Properties/Resources.zh-CN.resx @@ -2136,5 +2136,20 @@ rgb或rgba格式,如 rgb(0,10,100) 或 rgba(0,10,100,0.5) 编辑点击命令 + + + 权限设置 + + + 匿名用户 + + + 全部角色可访问 + + + 登录用户 + + + 编辑 \ No newline at end of file diff --git a/Resources/CellTypes/NavMenu.ts b/Resources/CellTypes/NavMenu.ts index 781daff..99052c2 100644 --- a/Resources/CellTypes/NavMenu.ts +++ b/Resources/CellTypes/NavMenu.ts @@ -77,7 +77,9 @@ namespace ElementCellTypes { if (!cellType.useBinding && cellType.options) { - options = this.generateIndex(cellType.options); + const permission = this.getUIPermission(Forguncy.Plugin.UIPermissionScope.Visible); + options = this.filterOptionsByPermission(cellType.options, permission.Children); + options = this.generateIndex(options); flatOptions = TreeHelper.flat(options); NavMenuCellType.recalcNotice(options, this); @@ -420,6 +422,22 @@ namespace ElementCellTypes { } + private filterOptionsByPermission(options: IMenuNode[], permissions: Forguncy.Plugin.SubUIPermission[]): IMenuNode[] { + if (!permissions) { + return options; + } + return options.filter((option, index) => { + if (permissions[index]) { + const hasPermission = this.checkRoleAuthority(permissions[index].AllowRoles); + if (hasPermission) { + option.children = this.filterOptionsByPermission(option.children, permissions[index].Children); + } + return hasPermission; + } + return true; + }); + } + private getDefaultMenuItemSlot() { return ` diff --git a/WpfControls/EditorSettings/CanVisitRoleListEditorSetting.cs b/WpfControls/EditorSettings/CanVisitRoleListEditorSetting.cs new file mode 100644 index 0000000..560ea00 --- /dev/null +++ b/WpfControls/EditorSettings/CanVisitRoleListEditorSetting.cs @@ -0,0 +1,29 @@ +using GrapeCity.Forguncy.Plugin; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; + +namespace ElementUI.WpfControls +{ + public class CanVisitRoleListEditorSetting : EditorSetting + { + IBuilderContextBase _contextBase; + public CanVisitRoleListEditorSetting(IBuilderContextBase contextBase) + { + _contextBase = contextBase; + } + public override DataTemplate GetDataTemplate() + { + DataTemplate cardLayout = new DataTemplate(); + FrameworkElementFactory spFactory = new FrameworkElementFactory(typeof(RoleListEditor)); + spFactory.SetValue(RoleListEditor.MarginProperty, new Thickness(9, 0, 0, 0)); + spFactory.SetValue(RoleListEditor.RolesProperty, _contextBase.UserServiceInfo.AllRoles); + spFactory.SetValue(RoleListEditor.AuthenticationModeProperty, _contextBase.AuthenticationMode); + cardLayout.VisualTree = spFactory; + return cardLayout; + } + } +} diff --git a/WpfControls/EditorSettings/RoleListEditor.xaml b/WpfControls/EditorSettings/RoleListEditor.xaml new file mode 100644 index 0000000..fa9ce49 --- /dev/null +++ b/WpfControls/EditorSettings/RoleListEditor.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + diff --git a/WpfControls/EditorSettings/RoleListEditor.xaml.cs b/WpfControls/EditorSettings/RoleListEditor.xaml.cs new file mode 100644 index 0000000..2992a7e --- /dev/null +++ b/WpfControls/EditorSettings/RoleListEditor.xaml.cs @@ -0,0 +1,197 @@ +using GrapeCity.Forguncy.Plugin; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace ElementUI.WpfControls +{ + /// + /// Interaction logic for RoleListEditor.xaml + /// + public partial class RoleListEditor : UserControl + { + public RoleListEditor() + { + InitializeComponent(); + + this.DataContextChanged += RoleListEditor_DataContextChanged; + } + + #region Roles + + public static readonly DependencyProperty RolesProperty = + DependencyProperty.Register( + "Roles", + typeof(List), + typeof(RoleListEditor), + new PropertyMetadata(null, OnRolesChangedChunk)); + + public List Roles + { + get { return (List)GetValue(RolesProperty); } + set { SetValue(RolesProperty, value); } + } + + private static void OnRolesChangedChunk(DependencyObject sender, DependencyPropertyChangedEventArgs e) + { + (sender as RoleListEditor).OnRolesChanged(e); + } + List _roles; + protected virtual void OnRolesChanged(DependencyPropertyChangedEventArgs e) + { + _roles = e.NewValue as List; + } + + #endregion + + #region AuthenticationMode + + AuthenticationMode _authenticationMode = AuthenticationMode.Forms; + public static readonly DependencyProperty AuthenticationModeProperty = + DependencyProperty.Register( + "AuthenticationMode", + typeof(AuthenticationMode), + typeof(RoleListEditor), + new PropertyMetadata(AuthenticationMode.Forms, OnAuthenticationModeChangedChunk)); + + public AuthenticationMode AuthenticationMode + { + get { return (AuthenticationMode)GetValue(AuthenticationModeProperty); } + set { SetValue(AuthenticationModeProperty, value); } + } + + private static void OnAuthenticationModeChangedChunk(DependencyObject sender, DependencyPropertyChangedEventArgs e) + { + (sender as RoleListEditor).OnAuthenticationModeChanged(e); + } + protected virtual void OnAuthenticationModeChanged(DependencyPropertyChangedEventArgs e) + { + _authenticationMode = (AuthenticationMode)e.NewValue; + } + + #endregion + + + private void RoleListEditor_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) + { + if (this.DataContext == null) + { + return; + } + + var propertySetting = this.DataContext as IEditorSettingsDataContext; + if (propertySetting == null) + { + return; + } + var value = propertySetting.Value as List; + var viewModel = new RoleListEditorViewModel(); + viewModel.AuthenticationMode = this._authenticationMode; + viewModel.CanVisitRoles = value; + this.root.DataContext = viewModel; + } + + public RoleListEditorViewModel ViewModel + { + get + { + return this.root.DataContext as RoleListEditorViewModel; + } + } + + private void Hyperlink_Click(object sender, RoutedEventArgs e) + { + var dialogWindow = new DialogWindow(); + var control = new RoleSelecotrDialog(ViewModel.CanVisitRoles, _roles, _authenticationMode); + dialogWindow.DialogControl = control; + dialogWindow.Width = 500; + dialogWindow.Height = 300; + dialogWindow.ResizeMode = ResizeMode.CanResize; + if(dialogWindow.ShowDialog() == true) + { + var propertySetting = this.DataContext as IEditorSettingsDataContext; + if (propertySetting == null) + { + return; + } + propertySetting.Value = control.ViewModel.Result; + this.ViewModel.CanVisitRoles = control.ViewModel.Result; + } + } + } + public class RoleListEditorViewModel : ModelBase + { + private string _displayText = Properties.Resources.MenuItemsEditor_Anonymous; + public string DisplayText + { + get + { + return this._displayText; + } + set + { + if (_displayText != value) + { + this._displayText = value; + this.OnPropertyChanged(); + } + } + } + + public AuthenticationMode AuthenticationMode { get; set; } + + private List _canVisitRoles; + public List CanVisitRoles + { + get + { + return this._canVisitRoles; + } + set + { + if (_canVisitRoles != value) + { + this._canVisitRoles = value; + this.OnPropertyChanged(); + } + + var emptyStr = this.AuthenticationMode == AuthenticationMode.Windows ? Properties.Resources.MenuItemsEditor_LoginUser : Properties.Resources.MenuItemsEditor_Anonymous; + if (value?.Any() == true) + { + var list = new List(); + foreach (var item in _canVisitRoles) + { + if(item == DefaultRoleManager.FGC_LoginUser) + { + list.Add(Properties.Resources.MenuItemsEditor_LoginUser); + } + else if(item == DefaultRoleManager.FGC_Anonymous) + { + list.Add(emptyStr); + } + else + { + list.Add(item); + } + } + this.DisplayText = string.Join("\r\n", list.Distinct()); + } + else + { + this.DisplayText = emptyStr; + } + } + } + } +} diff --git a/WpfControls/EditorSettings/RoleSelecotrDialog.xaml b/WpfControls/EditorSettings/RoleSelecotrDialog.xaml new file mode 100644 index 0000000..904397d --- /dev/null +++ b/WpfControls/EditorSettings/RoleSelecotrDialog.xaml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WpfControls/EditorSettings/RoleSelecotrDialog.xaml.cs b/WpfControls/EditorSettings/RoleSelecotrDialog.xaml.cs new file mode 100644 index 0000000..06eb29c --- /dev/null +++ b/WpfControls/EditorSettings/RoleSelecotrDialog.xaml.cs @@ -0,0 +1,196 @@ +using GrapeCity.Forguncy.Plugin; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace ElementUI.WpfControls +{ + /// + /// Interaction logic for RoleSelecotrDialog.xaml + /// + public partial class RoleSelecotrDialog : DialogUserControl + { + public RoleSelecotrDialog(List canVisitroleList, List allRoles, AuthenticationMode authenticationMode) + { + InitializeComponent(); + var viewModel = new RoleSelecotrDialogViewModel(canVisitroleList, allRoles, authenticationMode); + + this.DataContext = viewModel; + } + + public RoleSelecotrDialogViewModel ViewModel + { + get + { + return this.DataContext as RoleSelecotrDialogViewModel; + } + } + } + public class RoleSelecotrDialogViewModel : ModelBase + { + public RoleSelecotrDialogViewModel(List canVisitroleList, List allRoles, AuthenticationMode authenticationMode) + { + var roleList = this.RoleList; + if (canVisitroleList?.Any() != true) + { + canVisitroleList = new List() { DefaultRoleManager.FGC_Anonymous }; + } + if (authenticationMode == AuthenticationMode.Forms || authenticationMode == AuthenticationMode.SecurityProvider) + { + roleList.Add(new RoleInfoViewModel(this) + { + RoleValue = DefaultRoleManager.FGC_Anonymous, + RoleName = Properties.Resources.MenuItemsEditor_Anonymous, + CanVisit = canVisitroleList.FirstOrDefault(item => item == DefaultRoleManager.FGC_Anonymous) != null + }); + } + roleList.Add(new RoleInfoViewModel(this) + { + RoleValue = DefaultRoleManager.FGC_LoginUser, + RoleName = Properties.Resources.MenuItemsEditor_LoginUser, + CanVisit = canVisitroleList.FirstOrDefault(item => item == DefaultRoleManager.FGC_LoginUser || (authenticationMode == AuthenticationMode.Windows && item == DefaultRoleManager.FGC_Anonymous)) != null + }); + + foreach (var role in allRoles) + { + bool canVisit = true; + if (canVisitroleList.FirstOrDefault(item => item == role) == null) + { + canVisit = false; + } + roleList.Add(new RoleInfoViewModel(this) + { + RoleValue = role, + RoleName = role, + CanVisit = canVisit + }); + } + UpdateCheckBoxStatus(); + } + + public List RoleList { get; set; } = new List(); + + private bool? _allRoleCanVisit; + public bool? AllRoleCanVisit + { + get + { + return _allRoleCanVisit; + } + set + { + if (_allRoleCanVisit != value) + { + _allRoleCanVisit = value; + this.OnPropertyChanged(); + foreach (var role in RoleList) + { + role.CanVisit = (bool)value; + } + } + } + } + + internal void UpdateCheckBoxStatus() + { + var allCanVisit = RoleList.All(role => role.CanVisit); + if (allCanVisit) + { + AllRoleCanVisit = true; + } + else + { + var allCantVisit = RoleList.All(role => !role.CanVisit); + if (allCantVisit) + { + _allRoleCanVisit = false; + } + else + { + _allRoleCanVisit = null; + } + } + this.OnPropertyChanged(nameof(AllRoleCanVisit)); + } + + public List Result + { + get + { + return this.RoleList.Where(i => i.CanVisit).Select(i => i.RoleValue).ToList(); + } + } + } + + public class RoleInfoViewModel : ModelBase + { + RoleSelecotrDialogViewModel _owner; + public RoleInfoViewModel(RoleSelecotrDialogViewModel owner) + { + _owner = owner; + } + + private string _roleName; + public string RoleName + { + get + { + return _roleName; + } + set + { + if (_roleName != value) + { + _roleName = value; + this.OnPropertyChanged(); + } + } + } + + private string _roleValue; + public string RoleValue + { + get + { + return _roleValue; + } + set + { + if (_roleValue != value) + { + _roleValue = value; + this.OnPropertyChanged(); + } + } + } + + private bool _canVisit; + public bool CanVisit + { + get + { + return _canVisit; + } + set + { + if (_canVisit != value) + { + _canVisit = value; + this.OnPropertyChanged(); + _owner.UpdateCheckBoxStatus(); + } + } + } + } +} -- Gitee From bf103adfec699bdfdf328f8c31e010b33aeda136 Mon Sep 17 00:00:00 2001 From: EdricLi Date: Thu, 26 May 2022 13:54:04 +0800 Subject: [PATCH 012/350] Fix [FromCN]Query by EL-Calendar date, the result is empty. --- Resources/CellTypes/Calendar.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Resources/CellTypes/Calendar.ts b/Resources/CellTypes/Calendar.ts index 5fb9824..7b56778 100644 --- a/Resources/CellTypes/Calendar.ts +++ b/Resources/CellTypes/Calendar.ts @@ -76,7 +76,16 @@ namespace ElementCellTypes { }, methods: { getValue() { - return Forguncy.ConvertDateToOADate(this.value); + if (this.value !== null) { + const newDate = new Date(this.value.getTime()); + newDate.setHours(0); + newDate.setMinutes(0); + newDate.setSeconds(0); + newDate.setMilliseconds(0); + + return Forguncy.ConvertDateToOADate(newDate); + } + return null; }, setValue(value) { self.cacheOldValue = value ? Forguncy.ConvertOADateToDate(value) : null; -- Gitee From be0b36d3f895c334a1006e9ce2be03de52b4fa14 Mon Sep 17 00:00:00 2001 From: EdricLi Date: Thu, 26 May 2022 14:04:07 +0800 Subject: [PATCH 013/350] Fix FORGUNCY-10146 CLONE - [EL-Steps]The success icon is wrong. --- Resources/CellTypes/Steps.ts | 1 + Resources/customUI.css | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Resources/CellTypes/Steps.ts b/Resources/CellTypes/Steps.ts index 41da9ff..3d930b4 100644 --- a/Resources/CellTypes/Steps.ts +++ b/Resources/CellTypes/Steps.ts @@ -55,6 +55,7 @@ namespace ElementCellTypes { :key="item.title" :title="item.title" :icon="item.iconComponent" + :class="{'custom-icon':item.iconComponent}" :description="item.description" /> diff --git a/Resources/customUI.css b/Resources/customUI.css index 9bff31b..d8841f6 100644 --- a/Resources/customUI.css +++ b/Resources/customUI.css @@ -344,7 +344,7 @@ /* -------------------------Progress End-------------------------*/ /* -------------------------Steps Start-------------------------*/ -.el-steps-custom .el-icon.el-step__icon-inner { +.el-steps-custom .custom-icon .el-icon.el-step__icon-inner { font-size: 24px; } /* -------------------------Steps Start-------------------------*/ \ No newline at end of file -- Gitee From 6ac1e8d7c6d866d3908f65f604a2904cd5ccf049 Mon Sep 17 00:00:00 2001 From: EdricLi Date: Mon, 30 May 2022 14:07:06 +0800 Subject: [PATCH 014/350] Fix FORGUNCY-10173 [FromCN]In EL-NavMenu, the upload icon,text is not align. --- Resources/customUI.css | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Resources/customUI.css b/Resources/customUI.css index d8841f6..d463b18 100644 --- a/Resources/customUI.css +++ b/Resources/customUI.css @@ -320,6 +320,13 @@ top:-14%; } +.el-menu-item .el-icon { + vertical-align: middle; + margin-right: 5px; + width: 24px; + text-align: center; + font-size: 18px; +} /* -------------------------Menu End-------------------------*/ /* -------------------------Pagination Start-------------------------*/ -- Gitee From b3fd37b1212c2408935f6e3ba7ed13a14dca7706 Mon Sep 17 00:00:00 2001 From: EdricLi Date: Wed, 1 Jun 2022 17:11:40 +0800 Subject: [PATCH 015/350] Fix EL-Tag is not support align left. center, rignt. --- CellTypes/Tag.cs | 14 ++++++++++---- Resources/CellTypes/Tag.ts | 10 ++++++---- Resources/customUI.css | 12 ++++++++++++ 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/CellTypes/Tag.cs b/CellTypes/Tag.cs index d6db36d..652689a 100644 --- a/CellTypes/Tag.cs +++ b/CellTypes/Tag.cs @@ -2,12 +2,8 @@ using GrapeCity.Forguncy.CellTypes; using GrapeCity.Forguncy.Commands; using GrapeCity.Forguncy.Plugin; -using System; using System.Collections.Generic; using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows; using ElementUI.Properties; @@ -140,6 +136,16 @@ namespace ElementUI return Resources.Tag; } + public override ForguncyDisabledSettings GetDisabledPropertySettings(ForguncyPageKind pageType) + { + return ForguncyDisabledSettings.Bold | + ForguncyDisabledSettings.Underline | + ForguncyDisabledSettings.Italic | + ForguncyDisabledSettings.TopAlignment | + ForguncyDisabledSettings.MiddleAlignment | + ForguncyDisabledSettings.BottomAlignment; + } + public override bool NeedFormatDefaultValue => false; } diff --git a/Resources/CellTypes/Tag.ts b/Resources/CellTypes/Tag.ts index 2090b13..4bb51b8 100644 --- a/Resources/CellTypes/Tag.ts +++ b/Resources/CellTypes/Tag.ts @@ -13,7 +13,7 @@ namespace ElementCellTypes { separator: string; allowAdd: boolean; addButtonSettings: AddButtonSettings; - + } interface item { label: string; @@ -52,7 +52,7 @@ namespace ElementCellTypes { const colorList = cellType.ColorList; let marginBottom = ""; - const { WordWrap } = this.CellElement.StyleInfo; + const { WordWrap, HorizontalAlignment } = this.CellElement.StyleInfo; if (WordWrap) { marginBottom = ",marginBottom:itemSpace+'px'"; @@ -76,13 +76,15 @@ namespace ElementCellTypes { #${this.uId} .fgc-tag-container-tag-${i} .el-icon:hover{ background-color: ${!isDark ? color : Forguncy.ColorHelper.UpdateTint(color, 30, 128)}; } -` +`; } this.getStyleContainerElement("tags").innerHTML = html; + const horizontalAlignmentClass = "fgc-flex-justify-content-" + ["left", "center", "right"][HorizontalAlignment]; + const template = ` - +
div, .el-input-custom .el-input, -- Gitee From 55c3ade88f592837d69859b0dcd6460b4c09c461 Mon Sep 17 00:00:00 2001 From: EdricLi Date: Wed, 1 Jun 2022 17:34:53 +0800 Subject: [PATCH 016/350] (EL-Tag) Designer supports HorizontalAlignment. --- .../DrawingObject/TagDrawingObject.xaml | 4 ++-- .../DrawingObject/TagDrawingObject.xaml.cs | 23 ++++++++++++++++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/WpfControls/DrawingObject/TagDrawingObject.xaml b/WpfControls/DrawingObject/TagDrawingObject.xaml index e94173e..e609383 100644 --- a/WpfControls/DrawingObject/TagDrawingObject.xaml +++ b/WpfControls/DrawingObject/TagDrawingObject.xaml @@ -30,14 +30,14 @@ - + - + diff --git a/WpfControls/DrawingObject/TagDrawingObject.xaml.cs b/WpfControls/DrawingObject/TagDrawingObject.xaml.cs index c322372..3c4887a 100644 --- a/WpfControls/DrawingObject/TagDrawingObject.xaml.cs +++ b/WpfControls/DrawingObject/TagDrawingObject.xaml.cs @@ -27,6 +27,21 @@ namespace ElementUI.WpfControls.DrawingObject var viewModel = new TagDrawingObjectViewModel(drawingHelper, cellType, cellInfo); viewModel.SeperateStr = cellType.separator; viewModel.SetItems(cellInfo.Text, cellType, drawingHelper); + + switch (cellInfo.HorizontalAlignment) + { + case ForguncyCellHorizontalAlignment.Left: + viewModel.HorizontalAlignment = HorizontalAlignment.Left; + break; + case ForguncyCellHorizontalAlignment.Center: + viewModel.HorizontalAlignment = HorizontalAlignment.Center; + break; + + case ForguncyCellHorizontalAlignment.Right: + viewModel.HorizontalAlignment = HorizontalAlignment.Right; + break; + } + this.DataContext = viewModel; InitializeComponent(); } @@ -94,8 +109,10 @@ namespace ElementUI.WpfControls.DrawingObject } this.Items = itemList; } - public string SeperateStr { get; set; } - + public string SeperateStr { get; set; } + + public HorizontalAlignment HorizontalAlignment { get; set; } + public Visibility NoWrapVisibiliy { get @@ -185,7 +202,7 @@ namespace ElementUI.WpfControls.DrawingObject default: return 20; } - } + } public double GetIconWidth(Tag cellType) { switch (cellType.size) -- Gitee From 8ace76072ff0ccc3e5eaa4906533f90db1f78508 Mon Sep 17 00:00:00 2001 From: "Edric.Li" Date: Thu, 2 Jun 2022 03:55:12 +0000 Subject: [PATCH 017/350] add default pipeline template yaml --- .workflow/BranchPipeline.yml | 53 ++++++++++++++++++++++++++++++++++++ .workflow/MasterPipeline.yml | 51 ++++++++++++++++++++++++++++++++++ .workflow/PRPipeline.yml | 40 +++++++++++++++++++++++++++ 3 files changed, 144 insertions(+) create mode 100644 .workflow/BranchPipeline.yml create mode 100644 .workflow/MasterPipeline.yml create mode 100644 .workflow/PRPipeline.yml diff --git a/.workflow/BranchPipeline.yml b/.workflow/BranchPipeline.yml new file mode 100644 index 0000000..9d2a292 --- /dev/null +++ b/.workflow/BranchPipeline.yml @@ -0,0 +1,53 @@ +version: '1.0' +name: branch-pipeline +displayName: BranchPipeline +stages: + - stage: + name: compile + displayName: 编译 + steps: + - step: build@maven + name: build_maven + displayName: Maven 构建 + # 支持6、7、8、9、10、11六个版本 + jdkVersion: 8 + # 支持2.2.1、3.2.5、3.3.9、3.5.2、3.5.3、3.5.4、3.6.1、3.6.3八个版本 + mavenVersion: 3.3.9 + # 构建命令 + commands: + - mvn -B clean package -Dmaven.test.skip=true + # 非必填字段,开启后表示将构建产物暂存,但不会上传到制品库中,7天后自动清除 + artifacts: + # 构建产物名字,作为产物的唯一标识可向下传递,支持自定义,默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址 + - name: BUILD_ARTIFACT + # 构建产物获取路径,是指代码编译完毕之后构建物的所在路径,如通常jar包在target目录下。当前目录为代码库根目录 + path: + - ./target + - step: publish@general_artifacts + name: publish_general_artifacts + displayName: 上传制品 + # 上游构建任务定义的产物名,默认BUILD_ARTIFACT + dependArtifact: BUILD_ARTIFACT + # 上传到制品库时的制品命名,默认output + artifactName: output + dependsOn: build_maven + - stage: + name: release + displayName: 发布 + steps: + - step: publish@release_artifacts + name: publish_release_artifacts + displayName: '发布' + # 上游上传制品任务的产出 + dependArtifact: output + # 发布制品版本号 + version: '1.0.0.0' + # 是否开启版本号自增,默认开启 + autoIncrement: true +triggers: + push: + branches: + exclude: + - master + include: + - .* diff --git a/.workflow/MasterPipeline.yml b/.workflow/MasterPipeline.yml new file mode 100644 index 0000000..5d926c2 --- /dev/null +++ b/.workflow/MasterPipeline.yml @@ -0,0 +1,51 @@ +version: '1.0' +name: master-pipeline +displayName: MasterPipeline +stages: + - stage: + name: compile + displayName: 编译 + steps: + - step: build@maven + name: build_maven + displayName: Maven 构建 + # 支持6、7、8、9、10、11六个版本 + jdkVersion: 8 + # 支持2.2.1、3.2.5、3.3.9、3.5.2、3.5.3、3.5.4、3.6.1、3.6.3八个版本 + mavenVersion: 3.3.9 + # 构建命令 + commands: + - mvn -B clean package -Dmaven.test.skip=true + # 非必填字段,开启后表示将构建产物暂存,但不会上传到制品库中,7天后自动清除 + artifacts: + # 构建产物名字,作为产物的唯一标识可向下传递,支持自定义,默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址 + - name: BUILD_ARTIFACT + # 构建产物获取路径,是指代码编译完毕之后构建物的所在路径,如通常jar包在target目录下。当前目录为代码库根目录 + path: + - ./target + - step: publish@general_artifacts + name: publish_general_artifacts + displayName: 上传制品 + # 上游构建任务定义的产物名,默认BUILD_ARTIFACT + dependArtifact: BUILD_ARTIFACT + # 上传到制品库时的制品命名,默认output + artifactName: output + dependsOn: build_maven + - stage: + name: release + displayName: 发布 + steps: + - step: publish@release_artifacts + name: publish_release_artifacts + displayName: '发布' + # 上游上传制品任务的产出 + dependArtifact: output + # 发布制品版本号 + version: '1.0.0.0' + # 是否开启版本号自增,默认开启 + autoIncrement: true +triggers: + push: + branches: + include: + - master diff --git a/.workflow/PRPipeline.yml b/.workflow/PRPipeline.yml new file mode 100644 index 0000000..3f7579d --- /dev/null +++ b/.workflow/PRPipeline.yml @@ -0,0 +1,40 @@ +version: '1.0' +name: pr-pipeline +displayName: PRPipeline +stages: + - stage: + name: compile + displayName: 编译 + steps: + - step: build@maven + name: build_maven + displayName: Maven 构建 + # 支持6、7、8、9、10、11六个版本 + jdkVersion: 8 + # 支持2.2.1、3.2.5、3.3.9、3.5.2、3.5.3、3.5.4、3.6.1、3.6.3八个版本 + mavenVersion: 3.3.9 + # 构建命令 + commands: + - mvn -B clean package -Dmaven.test.skip=true + # 非必填字段,开启后表示将构建产物暂存,但不会上传到制品库中,7天后自动清除 + artifacts: + # 构建产物名字,作为产物的唯一标识可向下传递,支持自定义,默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址 + - name: BUILD_ARTIFACT + # 构建产物获取路径,是指代码编译完毕之后构建物的所在路径,如通常jar包在target目录下。当前目录为代码库根目录 + path: + - ./target + - step: publish@general_artifacts + name: publish_general_artifacts + displayName: 上传制品 + # 上游构建任务定义的产物名,默认BUILD_ARTIFACT + dependArtifact: BUILD_ARTIFACT + # 构建产物制品库,默认default,系统默认创建 + artifactRepository: default + # 上传到制品库时的制品命名,默认output + artifactName: output + dependsOn: build_maven +triggers: + pr: + branches: + include: + - master -- Gitee From d1f52944686060d715e5f40ae7a0802ad46d6570 Mon Sep 17 00:00:00 2001 From: EdricLi Date: Thu, 2 Jun 2022 12:29:51 +0800 Subject: [PATCH 018/350] update version --- PluginConfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PluginConfig.json b/PluginConfig.json index e7a3668..34e8be9 100644 --- a/PluginConfig.json +++ b/PluginConfig.json @@ -25,7 +25,7 @@ "name_kr": "엘리멘트UI", "pluginType": "cellType,command", "guid": "2CCB2F02-D923-491E-94E4-72C9BD8C5ABE", - "version": "8.0.1.0", + "version": "8.0.1.1", "dependenceVersion": "8.0.1.0", "bundleJavaScript": false, "bundleCSS": true -- Gitee From e2c6907476bd5542d89d3db215f83922eba77661 Mon Sep 17 00:00:00 2001 From: EdricLi Date: Tue, 7 Jun 2022 10:30:45 +0800 Subject: [PATCH 019/350] Fix FORGUNCY-10304 CLONE - [FromCN]Setting and publishing EL-Date, the browser console reported an error --- Resources/CellTypes/DatePicker.ts | 60 +++++++++++++------------------ Resources/Declaration/vue.d.ts | 1 + 2 files changed, 26 insertions(+), 35 deletions(-) diff --git a/Resources/CellTypes/DatePicker.ts b/Resources/CellTypes/DatePicker.ts index 17ef59a..d160fb6 100644 --- a/Resources/CellTypes/DatePicker.ts +++ b/Resources/CellTypes/DatePicker.ts @@ -91,7 +91,7 @@ ${cellType.type.indexOf("range") !== -1 ? rangeTemplate : ""} if (!this.input) { return null; } - if (this.input.length) { + if (isRange) { return this.input.map(Forguncy.ConvertDateToOADate).join(","); } return Forguncy.ConvertDateToOADate(this.input); @@ -119,7 +119,29 @@ ${cellType.type.indexOf("range") !== -1 ? rangeTemplate : ""} return value; }; - this.input = covertValueToInput(); + this.input = this.getLegalValue(covertValueToInput()); + }, + getLegalValue(value) { + const { isInvalidDate } = this; + + if (!value) { + return null; + } + + if (!isRange) { + return isInvalidDate(value) ? null : value; + } + + if (!(value instanceof Array) || value.length !== 2) { + return []; + } + + + if (isInvalidDate(value[0]) || isInvalidDate(value[1])) { + return []; + } + + return value; }, disable() { this.disabled = true; @@ -165,39 +187,7 @@ ${cellType.type.indexOf("range") !== -1 ? rangeTemplate : ""} self.fontDom = $('input', self.vueContainer) .add(".el-date-editor", self.vueContainer); }, - watch: { - input(value: Date | Date[]) { - const { isInvalidDate } = this; - - const getLegalValue = () => { - - if (!value) { - return null; - } - - if (!isRange) { - return isInvalidDate(value) ? null : value; - } - - if (!(value instanceof Array)) { - return []; - } - - if (isInvalidDate(value[0]) || isInvalidDate(value[1])) { - return []; - } - - return value; - - }; - - const legalValue = getLegalValue(); - - if (legalValue !== value) { - this.input = legalValue; - } - } - } + }; this.createVueApp(option); diff --git a/Resources/Declaration/vue.d.ts b/Resources/Declaration/vue.d.ts index 40b8f17..600b507 100644 --- a/Resources/Declaration/vue.d.ts +++ b/Resources/Declaration/vue.d.ts @@ -3,4 +3,5 @@ declare class Vue { public static h(component:any, props?:any): any; public static createApp(option: any): any; public static defineComponent(option: any): any; + public static toRaw(value: any): any; } \ No newline at end of file -- Gitee From 97be2fe93b1cba27ad2cf893ebfe53541c9e21f9 Mon Sep 17 00:00:00 2001 From: EdricLi Date: Tue, 7 Jun 2022 10:32:11 +0800 Subject: [PATCH 020/350] delete workflow. --- .workflow/BranchPipeline.yml | 53 ------------------------------------ .workflow/MasterPipeline.yml | 51 ---------------------------------- .workflow/PRPipeline.yml | 40 --------------------------- 3 files changed, 144 deletions(-) delete mode 100644 .workflow/BranchPipeline.yml delete mode 100644 .workflow/MasterPipeline.yml delete mode 100644 .workflow/PRPipeline.yml diff --git a/.workflow/BranchPipeline.yml b/.workflow/BranchPipeline.yml deleted file mode 100644 index 9d2a292..0000000 --- a/.workflow/BranchPipeline.yml +++ /dev/null @@ -1,53 +0,0 @@ -version: '1.0' -name: branch-pipeline -displayName: BranchPipeline -stages: - - stage: - name: compile - displayName: 编译 - steps: - - step: build@maven - name: build_maven - displayName: Maven 构建 - # 支持6、7、8、9、10、11六个版本 - jdkVersion: 8 - # 支持2.2.1、3.2.5、3.3.9、3.5.2、3.5.3、3.5.4、3.6.1、3.6.3八个版本 - mavenVersion: 3.3.9 - # 构建命令 - commands: - - mvn -B clean package -Dmaven.test.skip=true - # 非必填字段,开启后表示将构建产物暂存,但不会上传到制品库中,7天后自动清除 - artifacts: - # 构建产物名字,作为产物的唯一标识可向下传递,支持自定义,默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址 - - name: BUILD_ARTIFACT - # 构建产物获取路径,是指代码编译完毕之后构建物的所在路径,如通常jar包在target目录下。当前目录为代码库根目录 - path: - - ./target - - step: publish@general_artifacts - name: publish_general_artifacts - displayName: 上传制品 - # 上游构建任务定义的产物名,默认BUILD_ARTIFACT - dependArtifact: BUILD_ARTIFACT - # 上传到制品库时的制品命名,默认output - artifactName: output - dependsOn: build_maven - - stage: - name: release - displayName: 发布 - steps: - - step: publish@release_artifacts - name: publish_release_artifacts - displayName: '发布' - # 上游上传制品任务的产出 - dependArtifact: output - # 发布制品版本号 - version: '1.0.0.0' - # 是否开启版本号自增,默认开启 - autoIncrement: true -triggers: - push: - branches: - exclude: - - master - include: - - .* diff --git a/.workflow/MasterPipeline.yml b/.workflow/MasterPipeline.yml deleted file mode 100644 index 5d926c2..0000000 --- a/.workflow/MasterPipeline.yml +++ /dev/null @@ -1,51 +0,0 @@ -version: '1.0' -name: master-pipeline -displayName: MasterPipeline -stages: - - stage: - name: compile - displayName: 编译 - steps: - - step: build@maven - name: build_maven - displayName: Maven 构建 - # 支持6、7、8、9、10、11六个版本 - jdkVersion: 8 - # 支持2.2.1、3.2.5、3.3.9、3.5.2、3.5.3、3.5.4、3.6.1、3.6.3八个版本 - mavenVersion: 3.3.9 - # 构建命令 - commands: - - mvn -B clean package -Dmaven.test.skip=true - # 非必填字段,开启后表示将构建产物暂存,但不会上传到制品库中,7天后自动清除 - artifacts: - # 构建产物名字,作为产物的唯一标识可向下传递,支持自定义,默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址 - - name: BUILD_ARTIFACT - # 构建产物获取路径,是指代码编译完毕之后构建物的所在路径,如通常jar包在target目录下。当前目录为代码库根目录 - path: - - ./target - - step: publish@general_artifacts - name: publish_general_artifacts - displayName: 上传制品 - # 上游构建任务定义的产物名,默认BUILD_ARTIFACT - dependArtifact: BUILD_ARTIFACT - # 上传到制品库时的制品命名,默认output - artifactName: output - dependsOn: build_maven - - stage: - name: release - displayName: 发布 - steps: - - step: publish@release_artifacts - name: publish_release_artifacts - displayName: '发布' - # 上游上传制品任务的产出 - dependArtifact: output - # 发布制品版本号 - version: '1.0.0.0' - # 是否开启版本号自增,默认开启 - autoIncrement: true -triggers: - push: - branches: - include: - - master diff --git a/.workflow/PRPipeline.yml b/.workflow/PRPipeline.yml deleted file mode 100644 index 3f7579d..0000000 --- a/.workflow/PRPipeline.yml +++ /dev/null @@ -1,40 +0,0 @@ -version: '1.0' -name: pr-pipeline -displayName: PRPipeline -stages: - - stage: - name: compile - displayName: 编译 - steps: - - step: build@maven - name: build_maven - displayName: Maven 构建 - # 支持6、7、8、9、10、11六个版本 - jdkVersion: 8 - # 支持2.2.1、3.2.5、3.3.9、3.5.2、3.5.3、3.5.4、3.6.1、3.6.3八个版本 - mavenVersion: 3.3.9 - # 构建命令 - commands: - - mvn -B clean package -Dmaven.test.skip=true - # 非必填字段,开启后表示将构建产物暂存,但不会上传到制品库中,7天后自动清除 - artifacts: - # 构建产物名字,作为产物的唯一标识可向下传递,支持自定义,默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址 - - name: BUILD_ARTIFACT - # 构建产物获取路径,是指代码编译完毕之后构建物的所在路径,如通常jar包在target目录下。当前目录为代码库根目录 - path: - - ./target - - step: publish@general_artifacts - name: publish_general_artifacts - displayName: 上传制品 - # 上游构建任务定义的产物名,默认BUILD_ARTIFACT - dependArtifact: BUILD_ARTIFACT - # 构建产物制品库,默认default,系统默认创建 - artifactRepository: default - # 上传到制品库时的制品命名,默认output - artifactName: output - dependsOn: build_maven -triggers: - pr: - branches: - include: - - master -- Gitee From 1271c9baf575855d4e9c6b951bcf548e453acca4 Mon Sep 17 00:00:00 2001 From: "Edric.Li" Date: Tue, 7 Jun 2022 11:45:05 +0000 Subject: [PATCH 021/350] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=EF=BC=8C=E6=B5=8B=E8=AF=95=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=B0=86=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tmp | 1 + 1 file changed, 1 insertion(+) create mode 100644 tmp diff --git a/tmp b/tmp new file mode 100644 index 0000000..e644aa4 --- /dev/null +++ b/tmp @@ -0,0 +1 @@ +测试代码同步,测试完成将删除 \ No newline at end of file -- Gitee From 1b5485f8d0af25625b89713924e82189cd052db6 Mon Sep 17 00:00:00 2001 From: "Edric.Li" Date: Tue, 7 Jun 2022 11:46:18 +0000 Subject: [PATCH 022/350] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20?= =?UTF-8?q?tmp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tmp | 1 - 1 file changed, 1 deletion(-) delete mode 100644 tmp diff --git a/tmp b/tmp deleted file mode 100644 index e644aa4..0000000 --- a/tmp +++ /dev/null @@ -1 +0,0 @@ -测试代码同步,测试完成将删除 \ No newline at end of file -- Gitee From 1fbc2aa6879994e8745032709a4044d6274a54cc Mon Sep 17 00:00:00 2001 From: "Edric.Li" Date: Tue, 7 Jun 2022 11:49:25 +0000 Subject: [PATCH 023/350] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=EF=BC=8C=E5=AE=8C=E6=88=90=E5=B0=86=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- temp | 1 + 1 file changed, 1 insertion(+) create mode 100644 temp diff --git a/temp b/temp new file mode 100644 index 0000000..c6b3b31 --- /dev/null +++ b/temp @@ -0,0 +1 @@ +测试代码同步,完成将删除 \ No newline at end of file -- Gitee From 08bee03074732baf39da99a9b1583b934b3f0976 Mon Sep 17 00:00:00 2001 From: "Edric.Li" Date: Tue, 7 Jun 2022 11:52:27 +0000 Subject: [PATCH 024/350] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20?= =?UTF-8?q?temp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- temp | 1 - 1 file changed, 1 deletion(-) delete mode 100644 temp diff --git a/temp b/temp deleted file mode 100644 index c6b3b31..0000000 --- a/temp +++ /dev/null @@ -1 +0,0 @@ -测试代码同步,完成将删除 \ No newline at end of file -- Gitee From acf9b02f5fe2804d82ea0ec00501b920a8b48c7a Mon Sep 17 00:00:00 2001 From: "Edric.Li" Date: Tue, 7 Jun 2022 12:03:05 +0000 Subject: [PATCH 025/350] add tmp. --- tmp | 1 + 1 file changed, 1 insertion(+) create mode 100644 tmp diff --git a/tmp b/tmp new file mode 100644 index 0000000..e644aa4 --- /dev/null +++ b/tmp @@ -0,0 +1 @@ +测试代码同步,测试完成将删除 \ No newline at end of file -- Gitee From ce9b9c7f73074f4986a061225dc47426b9ca3be8 Mon Sep 17 00:00:00 2001 From: "Edric.Li" Date: Tue, 7 Jun 2022 12:05:01 +0000 Subject: [PATCH 026/350] update tmp. --- tmp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmp b/tmp index e644aa4..97ae6e5 100644 --- a/tmp +++ b/tmp @@ -1 +1 @@ -测试代码同步,测试完成将删除 \ No newline at end of file +测试代码同步,测试完成将删除 \ No newline at end of file -- Gitee From 40e391627de94cd66550e7266be4255bb2a0aa6f Mon Sep 17 00:00:00 2001 From: "Edric.Li" Date: Tue, 7 Jun 2022 12:06:18 +0000 Subject: [PATCH 027/350] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20?= =?UTF-8?q?tmp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tmp | 1 - 1 file changed, 1 deletion(-) delete mode 100644 tmp diff --git a/tmp b/tmp deleted file mode 100644 index 97ae6e5..0000000 --- a/tmp +++ /dev/null @@ -1 +0,0 @@ -测试代码同步,测试完成将删除 \ No newline at end of file -- Gitee From 0d82c0ea1db53a0f8b79bddeebe44b78b7ef855c Mon Sep 17 00:00:00 2001 From: EdricLi Date: Tue, 7 Jun 2022 20:25:25 +0800 Subject: [PATCH 028/350] update plugin tool --- PackageTool/PluginPackageTool.dll | Bin 9216 -> 9216 bytes PackageTool/PluginPackageTool.pdb | Bin 13964 -> 13972 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/PackageTool/PluginPackageTool.dll b/PackageTool/PluginPackageTool.dll index 6a3c45fb056c02bafccc1842d2c955575a5c1dd4..e24c2a365afa52387cc12b2c5316185d0c38205a 100644 GIT binary patch delta 588 zcmZqhXz-ZO!Q!cNy=7ug3FG(4jEw56ET#+$A(IuEbS6hKE@#x9%*Z6nbAg|Mfsp}> z*(L`{7;Fw;s$pS_oqU$fm?M#ip+K9pD0wmmdx2~Y69a>CXfVSS9tH*hpay04P)`>i z{RGH=vw14JC!_xp#;}IV3?NbpOipJ4u~}I`qydmLW5{5B4kY&h#myL&fXU6wuYqhi z1`ufmBm)$HW-?4<@MC^AS(j6q@yldSPEDr&jGIe18yM@^8TlA^7-WDX$O(K5A`Hrm zLJXn|_kki33^|N?4BQONOnMB$3_L(mnn4>#Dl?b>No@viAZZLHt-+)-SlpW-5GWoD z7KsLv$qY3>k!*%#K(d%&Gm{iUH^W?p6Abql5;qrfmvQLxTQKM`7yz*$m}X!u0|g%| zhz|m<0{DV+A1XUcXOQOWJ#QQ_Sw`ds7av^DW+l;gjD~g}_`fnR`UU_4m7xNNBY;s8 zAr8_G0iY-m24Zy}z5tZFFxgRDS+#Ngl3Q`I-<+Bhb~4^sXRrgL%GD~yIX@*e#=R)9 zAk{guq;hhTc$g7XB@+`=CD6W7&RPHT4vNcNxa*#DM&1ml6$>Y=w!6V!$M!D51&5 U@L!cd!C|wY!hXihd{Un{0fV81+W-In delta 570 zcmY+CPiRv?5XQgR*Oxye#I$M5^OcrYLn)zcj17ib5rkNhAlj6gf>^Mn4GJENw)75{&(U)lmLy`~=01SnrB6;-8C4e7J7`|M^<@K9f!dIH z?V=3$YrQoABrDTshJh$IBny?&NnTsL|D_)IOElS{8TUOjZI2Iy)~2bMVdikj_`zIf zKZj=?m9fLR51Kh<+2J!$#~EW+js$!7=A~dt7(y)vUAhsX2*Plf`U(+rW01NK$5(bN z)F_P*{34AQqRbu~VkR-h9Ks|s>+zV!yyu@nh5c#IIqz`+E<2a;g1LlO!p0pmuz}B* zS4*LlKsGjpG%}ornR?9t#)^JIQ+qmo-twiagZGM!=+5`n%a5O=)x8(#`mayf@okD1 zjOG{6=`uequ5!-th~{K(B4KW_+LT8V$-aTL*v8hHnppq+=)l6$MyDRv#Q1Ff%3^i4 zke4?TGo$U2>YsKAAA4c(-G`Cw)i;mr(XDSzj(gfMuC-I|-_Jk5u~O#W0XQdAr}LUr I#NG}510qL=i~s-t diff --git a/PackageTool/PluginPackageTool.pdb b/PackageTool/PluginPackageTool.pdb index 36d0d14a24cf5bbc90e817b868f6ee027c75f1e9..ccf57b2e180c73b57e561e56b9386d10794b8c0a 100644 GIT binary patch delta 289 zcmeClosv7DK!L@WfkD|RCqIdSfuV8!l3Q`I-<+Bhb~4^sXRyQW1OL~F6AH}j7#JDc z7?>EQ1L;LT`W}#e4WwNe85u$tnSd-OeI^DrLna0XAQm?Q8U<8wYqL3{BctIl112!{ zmk|q)R$yRdxNo4&z|2s}sLsH`z{BhS6tOl;0FvJf8-V1V$t#&YaB;d9B^IPQXO>h> zp2KXQA}ph$@T33B>b>cajMaLxCwCuvw{Ozr=FdN7eOub+Ab9t}yMV6AADB(qgwyk? z8hR#cvp8~qnTH$BO)g=H=K^sWc^U;8#Wvq%Db*MAVcZbRxFL^mLlxtOHpUHe88<9v R+^~0ZhKU>#J4g=bQ~>YtSK$Bv delta 281 zcmbP|+mkz?K;e%O1B0?tPJR*t1B2>T;S&$HZg$=GceZ5m;<oYO@H(+A0G-P5B0Gh}ERB?H;Iin+^;eMbn zi2K=y1xPC}urk~*P-kFf$YWGzU}0cob^wZ)7$yM8_l6BXa_i)kOdpt;+?^*cW;Rga z5mi-qFU^(ykB{YG?#KSCI(GANjFMJtd&alnN4Vdkn}0IinN9xAY|6%ykY3!-I@yTD zkps-!({OxpHA_4fh||d0$l1uh`3Xy@zL+cH1|P-^>5LnS88_53ZkWcnVFBZYZJYB= L Date: Wed, 8 Jun 2022 08:43:41 +0800 Subject: [PATCH 029/350] Revert "update plugin tool" This reverts commit 0d82c0ea1db53a0f8b79bddeebe44b78b7ef855c. --- PackageTool/PluginPackageTool.dll | Bin 9216 -> 9216 bytes PackageTool/PluginPackageTool.pdb | Bin 13972 -> 13964 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/PackageTool/PluginPackageTool.dll b/PackageTool/PluginPackageTool.dll index e24c2a365afa52387cc12b2c5316185d0c38205a..6a3c45fb056c02bafccc1842d2c955575a5c1dd4 100644 GIT binary patch delta 570 zcmY+CPiRv?5XQgR*Oxye#I$M5^OcrYLn)zcj17ib5rkNhAlj6gf>^Mn4GJENw)75{&(U)lmLy`~=01SnrB6;-8C4e7J7`|M^<@K9f!dIH z?V=3$YrQoABrDTshJh$IBny?&NnTsL|D_)IOElS{8TUOjZI2Iy)~2bMVdikj_`zIf zKZj=?m9fLR51Kh<+2J!$#~EW+js$!7=A~dt7(y)vUAhsX2*Plf`U(+rW01NK$5(bN z)F_P*{34AQqRbu~VkR-h9Ks|s>+zV!yyu@nh5c#IIqz`+E<2a;g1LlO!p0pmuz}B* zS4*LlKsGjpG%}ornR?9t#)^JIQ+qmo-twiagZGM!=+5`n%a5O=)x8(#`mayf@okD1 zjOG{6=`uequ5!-th~{K(B4KW_+LT8V$-aTL*v8hHnppq+=)l6$MyDRv#Q1Ff%3^i4 zke4?TGo$U2>YsKAAA4c(-G`Cw)i;mr(XDSzj(gfMuC-I|-_Jk5u~O#W0XQdAr}LUr I#NG}510qL=i~s-t delta 588 zcmZqhXz-ZO!Q!cNy=7ug3FG(4jEw56ET#+$A(IuEbS6hKE@#x9%*Z6nbAg|Mfsp}> z*(L`{7;Fw;s$pS_oqU$fm?M#ip+K9pD0wmmdx2~Y69a>CXfVSS9tH*hpay04P)`>i z{RGH=vw14JC!_xp#;}IV3?NbpOipJ4u~}I`qydmLW5{5B4kY&h#myL&fXU6wuYqhi z1`ufmBm)$HW-?4<@MC^AS(j6q@yldSPEDr&jGIe18yM@^8TlA^7-WDX$O(K5A`Hrm zLJXn|_kki33^|N?4BQONOnMB$3_L(mnn4>#Dl?b>No@viAZZLHt-+)-SlpW-5GWoD z7KsLv$qY3>k!*%#K(d%&Gm{iUH^W?p6Abql5;qrfmvQLxTQKM`7yz*$m}X!u0|g%| zhz|m<0{DV+A1XUcXOQOWJ#QQ_Sw`ds7av^DW+l;gjD~g}_`fnR`UU_4m7xNNBY;s8 zAr8_G0iY-m24Zy}z5tZFFxgRDS+#Ngl3Q`I-<+Bhb~4^sXRrgL%GD~yIX@*e#=R)9 zAk{guq;hhTc$g7XB@+`=CD6W7&RPHT4vNcNxa*#DM&1ml6$>Y=w!6V!$M!D51&5 U@L!cd!C|wY!hXihd{Un{0fV81+W-In diff --git a/PackageTool/PluginPackageTool.pdb b/PackageTool/PluginPackageTool.pdb index ccf57b2e180c73b57e561e56b9386d10794b8c0a..36d0d14a24cf5bbc90e817b868f6ee027c75f1e9 100644 GIT binary patch delta 281 zcmbP|+mkz?K;e%O1B0?tPJR*t1B2>T;S&$HZg$=GceZ5m;<oYO@H(+A0G-P5B0Gh}ERB?H;Iin+^;eMbn zi2K=y1xPC}urk~*P-kFf$YWGzU}0cob^wZ)7$yM8_l6BXa_i)kOdpt;+?^*cW;Rga z5mi-qFU^(ykB{YG?#KSCI(GANjFMJtd&alnN4Vdkn}0IinN9xAY|6%ykY3!-I@yTD zkps-!({OxpHA_4fh||d0$l1uh`3Xy@zL+cH1|P-^>5LnS88_53ZkWcnVFBZYZJYB= LEQ1L;LT`W}#e4WwNe85u$tnSd-OeI^DrLna0XAQm?Q8U<8wYqL3{BctIl112!{ zmk|q)R$yRdxNo4&z|2s}sLsH`z{BhS6tOl;0FvJf8-V1V$t#&YaB;d9B^IPQXO>h> zp2KXQA}ph$@T33B>b>cajMaLxCwCuvw{Ozr=FdN7eOub+Ab9t}yMV6AADB(qgwyk? z8hR#cvp8~qnTH$BO)g=H=K^sWc^U;8#Wvq%Db*MAVcZbRxFL^mLlxtOHpUHe88<9v R+^~0ZhKU>#J4g=bQ~>YtSK$Bv -- Gitee From 6fa793c2f5fd6016fd4dcbe6a9ceb451b9a9abbf Mon Sep 17 00:00:00 2001 From: EdricLi Date: Thu, 9 Jun 2022 09:40:07 +0800 Subject: [PATCH 030/350] update vue.d.ts. --- Resources/Declaration/vue.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/Resources/Declaration/vue.d.ts b/Resources/Declaration/vue.d.ts index 600b507..40b8f17 100644 --- a/Resources/Declaration/vue.d.ts +++ b/Resources/Declaration/vue.d.ts @@ -3,5 +3,4 @@ declare class Vue { public static h(component:any, props?:any): any; public static createApp(option: any): any; public static defineComponent(option: any): any; - public static toRaw(value: any): any; } \ No newline at end of file -- Gitee From b85463ced7c3a4e1895816910345eec2996477ff Mon Sep 17 00:00:00 2001 From: EdricLi Date: Thu, 9 Jun 2022 21:40:54 +0800 Subject: [PATCH 031/350] update version --- PluginConfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PluginConfig.json b/PluginConfig.json index 34e8be9..44e89be 100644 --- a/PluginConfig.json +++ b/PluginConfig.json @@ -25,7 +25,7 @@ "name_kr": "엘리멘트UI", "pluginType": "cellType,command", "guid": "2CCB2F02-D923-491E-94E4-72C9BD8C5ABE", - "version": "8.0.1.1", + "version": "8.0.1.2", "dependenceVersion": "8.0.1.0", "bundleJavaScript": false, "bundleCSS": true -- Gitee From 83a2d2c1e7e815ab599f651cd27ecda8e5bc7a51 Mon Sep 17 00:00:00 2001 From: EdricLi Date: Thu, 9 Jun 2022 21:41:36 +0800 Subject: [PATCH 032/350] update vesion --- PluginConfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PluginConfig.json b/PluginConfig.json index 34e8be9..228b744 100644 --- a/PluginConfig.json +++ b/PluginConfig.json @@ -25,7 +25,7 @@ "name_kr": "엘리멘트UI", "pluginType": "cellType,command", "guid": "2CCB2F02-D923-491E-94E4-72C9BD8C5ABE", - "version": "8.0.1.1", + "version": "8.0.3.0", "dependenceVersion": "8.0.1.0", "bundleJavaScript": false, "bundleCSS": true -- Gitee From c80f010ddea87324f97a1dfe853d7179b827076b Mon Sep 17 00:00:00 2001 From: EdricLi Date: Mon, 13 Jun 2022 13:51:43 +0800 Subject: [PATCH 033/350] update CascaderCellType_checkStrictly cn resources. --- Properties/Resources.Designer.cs | 151 +++++++++++++++---------------- 1 file changed, 75 insertions(+), 76 deletions(-) diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index 17530ca..a5abba5 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -196,7 +196,7 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to When check 'Show System Avatar' option, AvatarCellType will use cell value as a system user name and try to get avator image of specific user. + /// Looks up a localized string similar to When check 'Show System Avatar' option, AvatarCellType will use cell value as a system user name and try to get avator image of specific user. ///You can use UserInfoView or %CurrentUser% keyword to get user name.. /// public static string AvatarCellType_showSystemAvatar_Description { @@ -287,7 +287,7 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Default behavior is navigate the page with same name of breadcrumb part. + /// Looks up a localized string similar to Default behavior is navigate the page with same name of breadcrumb part. ///Uncheck this option can customize the click behavior by command.. /// public static string Breadcrumb_defaultBehavior_Description { @@ -675,7 +675,7 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to If you do not set a label property name, the value property is considered equal, + /// Looks up a localized string similar to If you do not set a label property name, the value property is considered equal, ///and when using different label properties at multiple levels, you can use the | Separation, e.g. 'provinceName|cityName'. /// public static string CascaderCellType_labelProperty_Description { @@ -766,16 +766,16 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Using a table JSON object tree as a data source for cells, the JSON format example is as follows - ///[ - /// {"value": 1, "label": "Department1", "parentValue": null}, - /// {"value": 2, "label": "Department1-1", "parentValue": 1}, - /// {"value": 3, "label": "Department1-2", "parentValue": 1}, - /// {"value": 4, "label": "Department1-2-1", "parentValue": 3}, - /// {"value": 5, "label": "Department2", "parentValue": null}, - /// {"value": 6, "label": "Department3", "parentValue": null} - ///] - ///The above data assumes that the 'va [rest of string was truncated]";. + /// Looks up a localized string similar to Using a table JSON object tree as a data source for cells, the JSON format example is as follows + ///[ + /// {"value": 1, "label": "Department1", "parentValue": null}, + /// {"value": 2, "label": "Department1-1", "parentValue": 1}, + /// {"value": 3, "label": "Department1-2", "parentValue": 1}, + /// {"value": 4, "label": "Department1-2-1", "parentValue": 3}, + /// {"value": 5, "label": "Department2", "parentValue": null}, + /// {"value": 6, "label": "Department3", "parentValue": null} + ///] + ///The above data assumes tha [rest of string was truncated]";. /// public static string CascaderCellType_SetDataSourceByIdPidTable_Description { get { @@ -802,24 +802,23 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Using a dynamic JSON object tree as a data source for cell, an example of JSON format is as follows - ///[ - /// { - /// "value": 1, - /// "label": "Department1", - /// "children": [ - /// { - /// "value": 2, - /// "label": "Sub-department1" - /// }, - /// { - /// "value": 3, - /// "label": "Sub-department2", - /// "children": [ - /// { - /// "value": 4, - /// "label": "Sub-department2-1" - /// [rest of string was truncated]";. + /// Looks up a localized string similar to Using a dynamic JSON object tree as a data source for cell, an example of JSON format is as follows + ///[ + /// { + /// "value": 1, + /// "label": "Department1", + /// "children": [ + /// { + /// "value": 2, + /// "label": "Sub-department1" + /// }, + /// { + /// "value": 3, + /// "label": "Sub-department2", + /// "children": [ + /// { + /// "value": 4, + /// "label": "Sub-depa [rest of string was truncated]";. /// public static string CascaderCellType_SetDataSourceByObjTree_Description { get { @@ -1143,24 +1142,24 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to [{ - /// value: 'guide', - /// label: 'Guide', - /// "icon": { - /// "Name": "Application/130_list_2.svg", - /// "BuiltIn": true, - /// "UseCellTypeForeColor":true, - /// "Color": "Background 1 -25" - /// }, - /// children: [{ - /// value: 'disciplines', - /// label: 'Disciplines', - /// children: [{ - /// value: 'consistency', - /// label: 'Consistency' - /// }, { - /// value: 'feedback', - /// lab [rest of string was truncated]";. + /// Looks up a localized string similar to [{ + /// value: 'guide', + /// label: 'Guide', + /// "icon": { + /// "Name": "Application/130_list_2.svg", + /// "BuiltIn": true, + /// "UseCellTypeForeColor":true, + /// "Color": "Background 1 -25" + /// }, + /// children: [{ + /// value: 'disciplines', + /// label: 'Disciplines', + /// children: [{ + /// value: 'consistency', + /// label: 'Consistency' + /// }, { + /// value: 'feedback', + /// [rest of string was truncated]";. /// public static string DefaultTreeSource { get { @@ -1754,7 +1753,7 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Select path is a array, + /// Looks up a localized string similar to Select path is a array, ///Can use formula =TEXTJOIN("/",1,valuePath) convert array to string, or use loop command access every path part.. /// public static string NavMenuCellType_GetSelectPath_Description { @@ -1953,7 +1952,7 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Not Limit. + /// Looks up a localized string similar to Unlimited. /// public static string NoLimit { get { @@ -3042,13 +3041,13 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Using a dynamic JSON object as a data source for cells, an example of JSON format is as follows - ///[ - /// {"value": 1, "label": "Banana"}, - /// {"value": 2, "label": "Apple"}, - /// {"value": 3, "label": "Pear"} - ///] - ///The above data assumes that the 'value attribute' is value and the 'label attribute name' is label + /// Looks up a localized string similar to Using a dynamic JSON object as a data source for cells, an example of JSON format is as follows + ///[ + /// {"value": 1, "label": "Banana"}, + /// {"value": 2, "label": "Apple"}, + /// {"value": 3, "label": "Pear"} + ///] + ///The above data assumes that the 'value attribute' is value and the 'label attribute name' is label ///Typically, a JSON data source can be obtained from a web service via an HTTP request command, or from a server-side command. /// public static string SelectCellType_SetDataSourceByObjArray_Description { @@ -3076,12 +3075,12 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Using a dynamic JSON string array as the data source for cells, json format example is as follows - ///[ - /// "Banana", - /// "Apple", - /// "Pear" - ///] + /// Looks up a localized string similar to Using a dynamic JSON string array as the data source for cells, json format example is as follows + ///[ + /// "Banana", + /// "Apple", + /// "Pear" + ///] ///Usually, the data source can be obtained from a web service through an HTTP request command, or it can be obtained through a server-side command. /// public static string SelectCellType_SetDataSourceByStringArray_Description { @@ -4315,8 +4314,8 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to The color of the tag cycles from the first color in the color list. - ///For example, the color list has 3 items, the first three tags will use the first three colors, the fourth will use the first color, and so on. + /// Looks up a localized string similar to The color of the tag cycles from the first color in the color list. + ///For example, the color list has 3 items, the first three tags will use the first three colors, the fourth will use the first color, and so on. ///If you want all tags to be the same color, you can keep one item in the color list. /// public static string TagCellType_ColorList_Description { @@ -4380,8 +4379,8 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to color: node color support color names, such as "red", "black" - ///Supports hexadecimal notation such as "#002316" + /// Looks up a localized string similar to color: node color support color names, such as "red", "black" + ///Supports hexadecimal notation such as "#002316" ///Support rgb or rgba formats such as: "rgb(0,10,100)" or "rgba(0,10,100,0.5)". /// public static string Timeline_bindingOptions_Columns_Description { @@ -4472,14 +4471,14 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Using a dynamic JSON object as a data source for cells, an example of JSON format is as follows - ///[ - /// {"content": "Activity start", "timestamp": "2018-04-15"}, - /// {"content": "Approved", "timestamp": "2018-04-13"}, - /// {"content": "Create Success", "timestamp": "2018-04-11"} - ///] - ///The above data assumes that the 'content attribute' is content and the 'timestamp attribute name' is timestamp - ///Typically, a JSON data source can be obtained from a web service via an HTTP request command, or from a server-side comman [rest of string was truncated]";. + /// Looks up a localized string similar to Using a dynamic JSON object as a data source for cells, an example of JSON format is as follows + ///[ + /// {"content": "Activity start", "timestamp": "2018-04-15"}, + /// {"content": "Approved", "timestamp": "2018-04-13"}, + /// {"content": "Create Success", "timestamp": "2018-04-11"} + ///] + ///The above data assumes that the 'content attribute' is content and the 'timestamp attribute name' is timestamp + ///Typically, a JSON data source can be obtained from a web service via an HTTP request command, or from a server-side [rest of string was truncated]";. /// public static string Timeline_SetDataSource_Description { get { -- Gitee From d03690bde7cbb87decefff6a55e3670cd72db6ab Mon Sep 17 00:00:00 2001 From: EdricLi Date: Mon, 13 Jun 2022 13:56:59 +0800 Subject: [PATCH 034/350] update CascaderCellType_checkStrictly cn resources. --- Properties/Resources.zh-CN.resx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Properties/Resources.zh-CN.resx b/Properties/Resources.zh-CN.resx index da7048f..1e5041d 100644 --- a/Properties/Resources.zh-CN.resx +++ b/Properties/Resources.zh-CN.resx @@ -208,7 +208,7 @@ 多选下折叠标签 - 严格的遵守父子节点不互相关联 + 允许选择任意一级选项 值返回完整路径 -- Gitee From e06363c7a77be35282a9c7cf94fef7e15a26f6b6 Mon Sep 17 00:00:00 2001 From: Robert Date: Mon, 13 Jun 2022 16:48:17 +0800 Subject: [PATCH 035/350] FORGUNCY-10413 [FromCN]El-Selector's value can't clear after change related selector's item --- Resources/CellTypes/Base.ts | 8 ++++---- Resources/CellTypes/Select.ts | 16 ++++++++++------ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Resources/CellTypes/Base.ts b/Resources/CellTypes/Base.ts index 3c6a900..f2f0ee0 100644 --- a/Resources/CellTypes/Base.ts +++ b/Resources/CellTypes/Base.ts @@ -421,13 +421,13 @@ this.refreshDataWithOption(cellType, bindingDataSourceModel, callBack, options); } - public static refreshDataWithOption(cellType: ElementCellTypeBase, bindingDataSourceModel, callBack, options: Forguncy.Plugin.queryDataOption, watchOnDependenceChange: boolean = true) { + public static refreshDataWithOption(cellType: ElementCellTypeBase, bindingDataSourceModel, callBack, options: Forguncy.Plugin.queryDataOption, watchOnDependenceChange: boolean = true, userAction = false) { cellType.getBindingDataSourceValue(bindingDataSourceModel, options, (dataSource) => { - callBack(dataSource); + callBack(dataSource, userAction); }); if (watchOnDependenceChange) { - cellType.onDependenceCellValueChanged(() => { - this.refreshDataWithOption(cellType, bindingDataSourceModel, callBack, options, false); + cellType.onDependenceCellValueChanged((userAction) => { + this.refreshDataWithOption(cellType, bindingDataSourceModel, callBack, options, false, userAction); }); } } diff --git a/Resources/CellTypes/Select.ts b/Resources/CellTypes/Select.ts index 02de704..75133e6 100644 --- a/Resources/CellTypes/Select.ts +++ b/Resources/CellTypes/Select.ts @@ -36,7 +36,11 @@ namespace ElementCellTypes { export class SelectCellType extends InputCellTypeBase { - public setDataSource(dataSource: any[]) { + public setDataSource(dataSource: any[], userAction: boolean) { + if (userAction) { + this.vue.value = null; + this.commitValue(); + } const cloneDataSource = [...dataSource]; if (this.cellType.AllowAddEmptyItem) { @@ -248,7 +252,7 @@ namespace ElementCellTypes { } this.loading = true; SupportDataSourceCellType.refreshDataWithOption(self, cellType.bindingOptions, dataSource => { - self.setDataSource(dataSource); + self.setDataSource(dataSource, false); this.loading = false; }, queryDataOption, false); }, @@ -294,7 +298,7 @@ namespace ElementCellTypes { if (cellType.useBinding) { if (cellType.filterable && cellType.filterInServer) { - SupportDataSourceCellType.refreshDataWithOption(this, cellType.bindingOptions, dataSource => this.setDataSource(dataSource), this.defaultQueryDataOption); + SupportDataSourceCellType.refreshDataWithOption(this, cellType.bindingOptions, (dataSource, userAction) => this.setDataSource(dataSource, userAction), this.defaultQueryDataOption); } else { self.ReloadBindingItems(); } @@ -318,7 +322,7 @@ namespace ElementCellTypes { public ReloadBindingItems() { const cellType = this.CellElement.CellType; - SupportDataSourceCellType.refreshData(this, cellType.bindingOptions, dataSource => this.setDataSource(dataSource), { + SupportDataSourceCellType.refreshData(this, cellType.bindingOptions, (dataSource, userAction) => this.setDataSource(dataSource, userAction), { distinct: true }); } @@ -340,7 +344,7 @@ namespace ElementCellTypes { "value": i, "label": i, }); - this.setDataSource(objSource); + this.setDataSource(objSource, false); } public SetDataSourceByObjArray(dataSource: any[], valueProperty: string, labelProperty: string) { @@ -358,7 +362,7 @@ namespace ElementCellTypes { "value": i[valueProperty], "label": i[labelProperty], })); - this.setDataSource(objSource); + this.setDataSource(objSource, false); } public Focus() { -- Gitee From 52a6b1ded84e58c8ad4f66d4fc82d07a9aeae85d Mon Sep 17 00:00:00 2001 From: Robert Date: Wed, 15 Jun 2022 17:21:05 +0800 Subject: [PATCH 036/350] =?UTF-8?q?16602=20[el-=E5=AF=BC=E8=88=AA=E8=8F=9C?= =?UTF-8?q?=E5=8D=95]=E7=AA=97=E5=8F=A3=E5=90=8D=E7=A7=B0=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WpfControls/EditorSettings/RoleListEditor.xaml.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WpfControls/EditorSettings/RoleListEditor.xaml.cs b/WpfControls/EditorSettings/RoleListEditor.xaml.cs index 2992a7e..b498b9d 100644 --- a/WpfControls/EditorSettings/RoleListEditor.xaml.cs +++ b/WpfControls/EditorSettings/RoleListEditor.xaml.cs @@ -118,7 +118,8 @@ namespace ElementUI.WpfControls dialogWindow.Width = 500; dialogWindow.Height = 300; dialogWindow.ResizeMode = ResizeMode.CanResize; - if(dialogWindow.ShowDialog() == true) + dialogWindow.Title = Properties.Resources.NavMenuCellType_Permission; + if (dialogWindow.ShowDialog() == true) { var propertySetting = this.DataContext as IEditorSettingsDataContext; if (propertySetting == null) -- Gitee From d4f60f981f787c3890376266d553e6c345fb12dc Mon Sep 17 00:00:00 2001 From: Robert Date: Wed, 15 Jun 2022 18:44:12 +0800 Subject: [PATCH 037/350] =?UTF-8?q?16624=20"[EL-Menu]=E4=B8=BA=E4=BB=80?= =?UTF-8?q?=E4=B9=88=E5=8F=8D=E5=8B=BE=E9=80=89""=E5=85=A8=E9=83=A8?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E5=8F=AF=E8=AE=BF=E9=97=AE""=EF=BC=8C?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=86=8D=E6=89=93=E5=BC=80=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=EF=BC=8C=E4=BC=9A=E9=BB=98=E8=AE=A4=E5=B0=86=E5=8C=BF?= =?UTF-8?q?=E5=90=8D=E7=94=A8=E6=88=B7=E9=80=89=E4=B8=AD=EF=BC=9F"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Properties/Resources.Designer.cs | 158 ++++++++++-------- Properties/Resources.resx | 3 + Properties/Resources.zh-CN.resx | 3 + .../EditorSettings/RoleSelecotrDialog.xaml.cs | 9 + 4 files changed, 99 insertions(+), 74 deletions(-) diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index a5abba5..6614a71 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -69,6 +69,15 @@ namespace ElementUI.Properties { } } + /// + /// Looks up a localized string similar to At least select on item. + /// + public static string AtLeastSelectOneItem { + get { + return ResourceManager.GetString("AtLeastSelectOneItem", resourceCulture); + } + } + /// /// Looks up a localized string similar to Avatar. /// @@ -196,7 +205,7 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to When check 'Show System Avatar' option, AvatarCellType will use cell value as a system user name and try to get avator image of specific user. + /// Looks up a localized string similar to When check 'Show System Avatar' option, AvatarCellType will use cell value as a system user name and try to get avator image of specific user. ///You can use UserInfoView or %CurrentUser% keyword to get user name.. /// public static string AvatarCellType_showSystemAvatar_Description { @@ -287,7 +296,7 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Default behavior is navigate the page with same name of breadcrumb part. + /// Looks up a localized string similar to Default behavior is navigate the page with same name of breadcrumb part. ///Uncheck this option can customize the click behavior by command.. /// public static string Breadcrumb_defaultBehavior_Description { @@ -675,7 +684,7 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to If you do not set a label property name, the value property is considered equal, + /// Looks up a localized string similar to If you do not set a label property name, the value property is considered equal, ///and when using different label properties at multiple levels, you can use the | Separation, e.g. 'provinceName|cityName'. /// public static string CascaderCellType_labelProperty_Description { @@ -766,16 +775,16 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Using a table JSON object tree as a data source for cells, the JSON format example is as follows - ///[ - /// {"value": 1, "label": "Department1", "parentValue": null}, - /// {"value": 2, "label": "Department1-1", "parentValue": 1}, - /// {"value": 3, "label": "Department1-2", "parentValue": 1}, - /// {"value": 4, "label": "Department1-2-1", "parentValue": 3}, - /// {"value": 5, "label": "Department2", "parentValue": null}, - /// {"value": 6, "label": "Department3", "parentValue": null} - ///] - ///The above data assumes tha [rest of string was truncated]";. + /// Looks up a localized string similar to Using a table JSON object tree as a data source for cells, the JSON format example is as follows + ///[ + /// {"value": 1, "label": "Department1", "parentValue": null}, + /// {"value": 2, "label": "Department1-1", "parentValue": 1}, + /// {"value": 3, "label": "Department1-2", "parentValue": 1}, + /// {"value": 4, "label": "Department1-2-1", "parentValue": 3}, + /// {"value": 5, "label": "Department2", "parentValue": null}, + /// {"value": 6, "label": "Department3", "parentValue": null} + ///] + ///The above data assumes that the 'va [rest of string was truncated]";. /// public static string CascaderCellType_SetDataSourceByIdPidTable_Description { get { @@ -802,23 +811,24 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Using a dynamic JSON object tree as a data source for cell, an example of JSON format is as follows - ///[ - /// { - /// "value": 1, - /// "label": "Department1", - /// "children": [ - /// { - /// "value": 2, - /// "label": "Sub-department1" - /// }, - /// { - /// "value": 3, - /// "label": "Sub-department2", - /// "children": [ - /// { - /// "value": 4, - /// "label": "Sub-depa [rest of string was truncated]";. + /// Looks up a localized string similar to Using a dynamic JSON object tree as a data source for cell, an example of JSON format is as follows + ///[ + /// { + /// "value": 1, + /// "label": "Department1", + /// "children": [ + /// { + /// "value": 2, + /// "label": "Sub-department1" + /// }, + /// { + /// "value": 3, + /// "label": "Sub-department2", + /// "children": [ + /// { + /// "value": 4, + /// "label": "Sub-department2-1" + /// [rest of string was truncated]";. /// public static string CascaderCellType_SetDataSourceByObjTree_Description { get { @@ -1142,24 +1152,24 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to [{ - /// value: 'guide', - /// label: 'Guide', - /// "icon": { - /// "Name": "Application/130_list_2.svg", - /// "BuiltIn": true, - /// "UseCellTypeForeColor":true, - /// "Color": "Background 1 -25" - /// }, - /// children: [{ - /// value: 'disciplines', - /// label: 'Disciplines', - /// children: [{ - /// value: 'consistency', - /// label: 'Consistency' - /// }, { - /// value: 'feedback', - /// [rest of string was truncated]";. + /// Looks up a localized string similar to [{ + /// value: 'guide', + /// label: 'Guide', + /// "icon": { + /// "Name": "Application/130_list_2.svg", + /// "BuiltIn": true, + /// "UseCellTypeForeColor":true, + /// "Color": "Background 1 -25" + /// }, + /// children: [{ + /// value: 'disciplines', + /// label: 'Disciplines', + /// children: [{ + /// value: 'consistency', + /// label: 'Consistency' + /// }, { + /// value: 'feedback', + /// lab [rest of string was truncated]";. /// public static string DefaultTreeSource { get { @@ -1753,7 +1763,7 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Select path is a array, + /// Looks up a localized string similar to Select path is a array, ///Can use formula =TEXTJOIN("/",1,valuePath) convert array to string, or use loop command access every path part.. /// public static string NavMenuCellType_GetSelectPath_Description { @@ -3041,13 +3051,13 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Using a dynamic JSON object as a data source for cells, an example of JSON format is as follows - ///[ - /// {"value": 1, "label": "Banana"}, - /// {"value": 2, "label": "Apple"}, - /// {"value": 3, "label": "Pear"} - ///] - ///The above data assumes that the 'value attribute' is value and the 'label attribute name' is label + /// Looks up a localized string similar to Using a dynamic JSON object as a data source for cells, an example of JSON format is as follows + ///[ + /// {"value": 1, "label": "Banana"}, + /// {"value": 2, "label": "Apple"}, + /// {"value": 3, "label": "Pear"} + ///] + ///The above data assumes that the 'value attribute' is value and the 'label attribute name' is label ///Typically, a JSON data source can be obtained from a web service via an HTTP request command, or from a server-side command. /// public static string SelectCellType_SetDataSourceByObjArray_Description { @@ -3075,12 +3085,12 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Using a dynamic JSON string array as the data source for cells, json format example is as follows - ///[ - /// "Banana", - /// "Apple", - /// "Pear" - ///] + /// Looks up a localized string similar to Using a dynamic JSON string array as the data source for cells, json format example is as follows + ///[ + /// "Banana", + /// "Apple", + /// "Pear" + ///] ///Usually, the data source can be obtained from a web service through an HTTP request command, or it can be obtained through a server-side command. /// public static string SelectCellType_SetDataSourceByStringArray_Description { @@ -4314,8 +4324,8 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to The color of the tag cycles from the first color in the color list. - ///For example, the color list has 3 items, the first three tags will use the first three colors, the fourth will use the first color, and so on. + /// Looks up a localized string similar to The color of the tag cycles from the first color in the color list. + ///For example, the color list has 3 items, the first three tags will use the first three colors, the fourth will use the first color, and so on. ///If you want all tags to be the same color, you can keep one item in the color list. /// public static string TagCellType_ColorList_Description { @@ -4379,8 +4389,8 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to color: node color support color names, such as "red", "black" - ///Supports hexadecimal notation such as "#002316" + /// Looks up a localized string similar to color: node color support color names, such as "red", "black" + ///Supports hexadecimal notation such as "#002316" ///Support rgb or rgba formats such as: "rgb(0,10,100)" or "rgba(0,10,100,0.5)". /// public static string Timeline_bindingOptions_Columns_Description { @@ -4471,14 +4481,14 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Using a dynamic JSON object as a data source for cells, an example of JSON format is as follows - ///[ - /// {"content": "Activity start", "timestamp": "2018-04-15"}, - /// {"content": "Approved", "timestamp": "2018-04-13"}, - /// {"content": "Create Success", "timestamp": "2018-04-11"} - ///] - ///The above data assumes that the 'content attribute' is content and the 'timestamp attribute name' is timestamp - ///Typically, a JSON data source can be obtained from a web service via an HTTP request command, or from a server-side [rest of string was truncated]";. + /// Looks up a localized string similar to Using a dynamic JSON object as a data source for cells, an example of JSON format is as follows + ///[ + /// {"content": "Activity start", "timestamp": "2018-04-15"}, + /// {"content": "Approved", "timestamp": "2018-04-13"}, + /// {"content": "Create Success", "timestamp": "2018-04-11"} + ///] + ///The above data assumes that the 'content attribute' is content and the 'timestamp attribute name' is timestamp + ///Typically, a JSON data source can be obtained from a web service via an HTTP request command, or from a server-side comman [rest of string was truncated]";. /// public static string Timeline_SetDataSource_Description { get { diff --git a/Properties/Resources.resx b/Properties/Resources.resx index 828f60e..091c500 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -2078,5 +2078,8 @@ Typically, a JSON data source can be obtained from a web service via an HTTP req Edit + + + At least select on item \ No newline at end of file diff --git a/Properties/Resources.zh-CN.resx b/Properties/Resources.zh-CN.resx index 1e5041d..5bf84b4 100644 --- a/Properties/Resources.zh-CN.resx +++ b/Properties/Resources.zh-CN.resx @@ -2157,5 +2157,8 @@ rgb或rgba格式,如 rgb(0,10,100) 或 rgba(0,10,100,0.5) 编辑 + + + 至少选择一项 \ No newline at end of file diff --git a/WpfControls/EditorSettings/RoleSelecotrDialog.xaml.cs b/WpfControls/EditorSettings/RoleSelecotrDialog.xaml.cs index 06eb29c..dd56550 100644 --- a/WpfControls/EditorSettings/RoleSelecotrDialog.xaml.cs +++ b/WpfControls/EditorSettings/RoleSelecotrDialog.xaml.cs @@ -36,6 +36,15 @@ namespace ElementUI.WpfControls return this.DataContext as RoleSelecotrDialogViewModel; } } + public override bool Validate() + { + if(ViewModel.Result.Count == 0) + { + MessageBox.Show(Properties.Resources.AtLeastSelectOneItem); + return false; + } + return base.Validate(); + } } public class RoleSelecotrDialogViewModel : ModelBase { -- Gitee From 81e475ea38659b16a60646600cb7edb4aed03faa Mon Sep 17 00:00:00 2001 From: Li Xiuliang Date: Sun, 19 Jun 2022 18:49:16 +0800 Subject: [PATCH 038/350] update NavMenuCellType_SelectCommand resource. --- Properties/Resources.Designer.cs | 151 +++++++++++++++---------------- Properties/Resources.resx | 2 +- Properties/Resources.zh-CN.resx | 2 +- 3 files changed, 77 insertions(+), 78 deletions(-) diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index 6614a71..0e4457f 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -205,7 +205,7 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to When check 'Show System Avatar' option, AvatarCellType will use cell value as a system user name and try to get avator image of specific user. + /// Looks up a localized string similar to When check 'Show System Avatar' option, AvatarCellType will use cell value as a system user name and try to get avator image of specific user. ///You can use UserInfoView or %CurrentUser% keyword to get user name.. /// public static string AvatarCellType_showSystemAvatar_Description { @@ -296,7 +296,7 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Default behavior is navigate the page with same name of breadcrumb part. + /// Looks up a localized string similar to Default behavior is navigate the page with same name of breadcrumb part. ///Uncheck this option can customize the click behavior by command.. /// public static string Breadcrumb_defaultBehavior_Description { @@ -684,7 +684,7 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to If you do not set a label property name, the value property is considered equal, + /// Looks up a localized string similar to If you do not set a label property name, the value property is considered equal, ///and when using different label properties at multiple levels, you can use the | Separation, e.g. 'provinceName|cityName'. /// public static string CascaderCellType_labelProperty_Description { @@ -775,16 +775,16 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Using a table JSON object tree as a data source for cells, the JSON format example is as follows - ///[ - /// {"value": 1, "label": "Department1", "parentValue": null}, - /// {"value": 2, "label": "Department1-1", "parentValue": 1}, - /// {"value": 3, "label": "Department1-2", "parentValue": 1}, - /// {"value": 4, "label": "Department1-2-1", "parentValue": 3}, - /// {"value": 5, "label": "Department2", "parentValue": null}, - /// {"value": 6, "label": "Department3", "parentValue": null} - ///] - ///The above data assumes that the 'va [rest of string was truncated]";. + /// Looks up a localized string similar to Using a table JSON object tree as a data source for cells, the JSON format example is as follows + ///[ + /// {"value": 1, "label": "Department1", "parentValue": null}, + /// {"value": 2, "label": "Department1-1", "parentValue": 1}, + /// {"value": 3, "label": "Department1-2", "parentValue": 1}, + /// {"value": 4, "label": "Department1-2-1", "parentValue": 3}, + /// {"value": 5, "label": "Department2", "parentValue": null}, + /// {"value": 6, "label": "Department3", "parentValue": null} + ///] + ///The above data assumes tha [rest of string was truncated]";. /// public static string CascaderCellType_SetDataSourceByIdPidTable_Description { get { @@ -811,24 +811,23 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Using a dynamic JSON object tree as a data source for cell, an example of JSON format is as follows - ///[ - /// { - /// "value": 1, - /// "label": "Department1", - /// "children": [ - /// { - /// "value": 2, - /// "label": "Sub-department1" - /// }, - /// { - /// "value": 3, - /// "label": "Sub-department2", - /// "children": [ - /// { - /// "value": 4, - /// "label": "Sub-department2-1" - /// [rest of string was truncated]";. + /// Looks up a localized string similar to Using a dynamic JSON object tree as a data source for cell, an example of JSON format is as follows + ///[ + /// { + /// "value": 1, + /// "label": "Department1", + /// "children": [ + /// { + /// "value": 2, + /// "label": "Sub-department1" + /// }, + /// { + /// "value": 3, + /// "label": "Sub-department2", + /// "children": [ + /// { + /// "value": 4, + /// "label": "Sub-depa [rest of string was truncated]";. /// public static string CascaderCellType_SetDataSourceByObjTree_Description { get { @@ -1152,24 +1151,24 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to [{ - /// value: 'guide', - /// label: 'Guide', - /// "icon": { - /// "Name": "Application/130_list_2.svg", - /// "BuiltIn": true, - /// "UseCellTypeForeColor":true, - /// "Color": "Background 1 -25" - /// }, - /// children: [{ - /// value: 'disciplines', - /// label: 'Disciplines', - /// children: [{ - /// value: 'consistency', - /// label: 'Consistency' - /// }, { - /// value: 'feedback', - /// lab [rest of string was truncated]";. + /// Looks up a localized string similar to [{ + /// value: 'guide', + /// label: 'Guide', + /// "icon": { + /// "Name": "Application/130_list_2.svg", + /// "BuiltIn": true, + /// "UseCellTypeForeColor":true, + /// "Color": "Background 1 -25" + /// }, + /// children: [{ + /// value: 'disciplines', + /// label: 'Disciplines', + /// children: [{ + /// value: 'consistency', + /// label: 'Consistency' + /// }, { + /// value: 'feedback', + /// [rest of string was truncated]";. /// public static string DefaultTreeSource { get { @@ -1763,7 +1762,7 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Select path is a array, + /// Looks up a localized string similar to Select path is a array, ///Can use formula =TEXTJOIN("/",1,valuePath) convert array to string, or use loop command access every path part.. /// public static string NavMenuCellType_GetSelectPath_Description { @@ -1872,7 +1871,7 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Edit ValueChanged Command. + /// Looks up a localized string similar to Edit Selection Command. /// public static string NavMenuCellType_SelectCommand { get { @@ -3051,13 +3050,13 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Using a dynamic JSON object as a data source for cells, an example of JSON format is as follows - ///[ - /// {"value": 1, "label": "Banana"}, - /// {"value": 2, "label": "Apple"}, - /// {"value": 3, "label": "Pear"} - ///] - ///The above data assumes that the 'value attribute' is value and the 'label attribute name' is label + /// Looks up a localized string similar to Using a dynamic JSON object as a data source for cells, an example of JSON format is as follows + ///[ + /// {"value": 1, "label": "Banana"}, + /// {"value": 2, "label": "Apple"}, + /// {"value": 3, "label": "Pear"} + ///] + ///The above data assumes that the 'value attribute' is value and the 'label attribute name' is label ///Typically, a JSON data source can be obtained from a web service via an HTTP request command, or from a server-side command. /// public static string SelectCellType_SetDataSourceByObjArray_Description { @@ -3085,12 +3084,12 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Using a dynamic JSON string array as the data source for cells, json format example is as follows - ///[ - /// "Banana", - /// "Apple", - /// "Pear" - ///] + /// Looks up a localized string similar to Using a dynamic JSON string array as the data source for cells, json format example is as follows + ///[ + /// "Banana", + /// "Apple", + /// "Pear" + ///] ///Usually, the data source can be obtained from a web service through an HTTP request command, or it can be obtained through a server-side command. /// public static string SelectCellType_SetDataSourceByStringArray_Description { @@ -4324,8 +4323,8 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to The color of the tag cycles from the first color in the color list. - ///For example, the color list has 3 items, the first three tags will use the first three colors, the fourth will use the first color, and so on. + /// Looks up a localized string similar to The color of the tag cycles from the first color in the color list. + ///For example, the color list has 3 items, the first three tags will use the first three colors, the fourth will use the first color, and so on. ///If you want all tags to be the same color, you can keep one item in the color list. /// public static string TagCellType_ColorList_Description { @@ -4389,8 +4388,8 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to color: node color support color names, such as "red", "black" - ///Supports hexadecimal notation such as "#002316" + /// Looks up a localized string similar to color: node color support color names, such as "red", "black" + ///Supports hexadecimal notation such as "#002316" ///Support rgb or rgba formats such as: "rgb(0,10,100)" or "rgba(0,10,100,0.5)". /// public static string Timeline_bindingOptions_Columns_Description { @@ -4481,14 +4480,14 @@ namespace ElementUI.Properties { } /// - /// Looks up a localized string similar to Using a dynamic JSON object as a data source for cells, an example of JSON format is as follows - ///[ - /// {"content": "Activity start", "timestamp": "2018-04-15"}, - /// {"content": "Approved", "timestamp": "2018-04-13"}, - /// {"content": "Create Success", "timestamp": "2018-04-11"} - ///] - ///The above data assumes that the 'content attribute' is content and the 'timestamp attribute name' is timestamp - ///Typically, a JSON data source can be obtained from a web service via an HTTP request command, or from a server-side comman [rest of string was truncated]";. + /// Looks up a localized string similar to Using a dynamic JSON object as a data source for cells, an example of JSON format is as follows + ///[ + /// {"content": "Activity start", "timestamp": "2018-04-15"}, + /// {"content": "Approved", "timestamp": "2018-04-13"}, + /// {"content": "Create Success", "timestamp": "2018-04-11"} + ///] + ///The above data assumes that the 'content attribute' is content and the 'timestamp attribute name' is timestamp + ///Typically, a JSON data source can be obtained from a web service via an HTTP request command, or from a server-side [rest of string was truncated]";. /// public static string Timeline_SetDataSource_Description { get { diff --git a/Properties/Resources.resx b/Properties/Resources.resx index 091c500..953de92 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -394,7 +394,7 @@ Focus - Edit ValueChanged Command + Edit Selection Command Use Binding diff --git a/Properties/Resources.zh-CN.resx b/Properties/Resources.zh-CN.resx index 5bf84b4..18a4a2a 100644 --- a/Properties/Resources.zh-CN.resx +++ b/Properties/Resources.zh-CN.resx @@ -394,7 +394,7 @@ 设置焦点 - 编辑值变更命令 + 编辑选择命令 从数据库生成菜单项目 -- Gitee From 228d40076a393f48a077fa05e3b399878268200e Mon Sep 17 00:00:00 2001 From: Li Xiuliang Date: Tue, 21 Jun 2022 19:00:42 +0800 Subject: [PATCH 039/350] fix input transparent color is invalid. --- Resources/customUI.css | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Resources/customUI.css b/Resources/customUI.css index 71b64a9..db1d2e9 100644 --- a/Resources/customUI.css +++ b/Resources/customUI.css @@ -1,9 +1,9 @@ -.el-input__inner, .el-textarea__inner { +.el-input__inner, .el-input__wrapper, .el-textarea__inner { background-color: transparent; } -.fgc-flex-justify-content-left{ - justify-content:left; +.fgc-flex-justify-content-left { + justify-content: left; } .fgc-flex-justify-content-center { @@ -22,6 +22,11 @@ width: 100%; height: 100%; } + +.el-input-custom .el-input__count-inner, +.el-input-custom .el-input__count { + background-color: transparent !important; +} /* -------------------------Input End-------------------------*/ /* -------------------------Input Number Start-------------------------*/ -- Gitee From a2719fb03d98a94663a4fffb2af872b30a430af5 Mon Sep 17 00:00:00 2001 From: EdricLi Date: Tue, 21 Jun 2022 20:52:28 +0800 Subject: [PATCH 040/350] Fix FORGUNCY-10489 The pop-up page stuck when the maximum value of the EL-InputNumber is empty --- Resources/CellTypes/InputNumber.ts | 34 +++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/Resources/CellTypes/InputNumber.ts b/Resources/CellTypes/InputNumber.ts index b106587..717e80a 100644 --- a/Resources/CellTypes/InputNumber.ts +++ b/Resources/CellTypes/InputNumber.ts @@ -26,6 +26,24 @@ namespace ElementCellTypes { return super.setValueToElement(jelement, value); } + calcMinOrMax(type: "min" | "max", value) { + const calcValue = this.calcNumber(value); + + if (isNaN(calcValue) || calcValue == 0) { + return type === "min" ? -Infinity : Infinity; + } + + return calcValue; + } + + public calcMin(value) { + return this.calcMinOrMax("min", value); + } + + public calcMax(value) { + return this.calcMinOrMax("max", value); + } + public onPageLoaded(info: Forguncy.Plugin.CellTypeInfo) { const self = this; const cellType = this.cellType; @@ -38,7 +56,7 @@ namespace ElementCellTypes { const option = { template: ` { if (this.isFormula(cellType.min)) { - this.vue.min = this.calcNumber(cellType.min); + this.vue.min = this.calcMin(cellType.min); } if (this.isFormula(cellType.max)) { - this.vue.max = this.calcNumber(cellType.max); + this.vue.max = this.calcMax(cellType.max); } if (this.isFormula(cellType.step)) { this.vue.step = this.calcNumber(cellType.step); @@ -133,10 +151,10 @@ ref="elInput" super.onPageLoaded(info); } public SetMinValue(value) { - this.vue.min = Number(value); + this.vue.min = this.calcMin(value); } public SetMaxValue(value) { - this.vue.max = Number(value); + this.vue.max = this.calcMin(value); } public SetStep(value) { this.vue.step = Number(value); @@ -144,7 +162,7 @@ ref="elInput" public Focus() { this.vue.$refs.elInput.focus(); } - + public setFocus() { this.Focus(); } -- Gitee From 4447f474702bcdc5fa220c0a098e38a9197348ed Mon Sep 17 00:00:00 2001 From: EdricLi Date: Wed, 22 Jun 2022 11:06:17 +0800 Subject: [PATCH 041/350] Fix FORGUNCY-10489 The pop-up page stuck when the maximum value of the EL-InputNumber is empty --- Resources/CellTypes/InputNumber.ts | 37 ++++++++++++++---------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/Resources/CellTypes/InputNumber.ts b/Resources/CellTypes/InputNumber.ts index 717e80a..be2a0ee 100644 --- a/Resources/CellTypes/InputNumber.ts +++ b/Resources/CellTypes/InputNumber.ts @@ -26,22 +26,19 @@ namespace ElementCellTypes { return super.setValueToElement(jelement, value); } - calcMinOrMax(type: "min" | "max", value) { - const calcValue = this.calcNumber(value); - - if (isNaN(calcValue) || calcValue == 0) { - return type === "min" ? -Infinity : Infinity; + calcMinOrMax(value) { + const calcValue = this.evaluateFormula(value); + + if (this.isEmpty(calcValue) || isNaN(calcValue)) { + /** + * 只能返回 undefined,切勿改成 null!!!! + * + * 在这里,null和undefined不等价,只有是undefined,组件内部才会使用默认值,Infinity 或者 -Infinity + */ + return undefined; } - return calcValue; - } - - public calcMin(value) { - return this.calcMinOrMax("min", value); - } - - public calcMax(value) { - return this.calcMinOrMax("max", value); + return Number(calcValue); } public onPageLoaded(info: Forguncy.Plugin.CellTypeInfo) { @@ -67,8 +64,8 @@ ref="elInput" data() { return { input: undefined, - min: self.calcMin(cellType.min), - max: self.calcMin(cellType.max), + min: self.calcMinOrMax(cellType.min), + max: self.calcMinOrMax(cellType.max), step: self.calcNumber(cellType.step), stepStrictly: cellType.stepStrictly, precision: cellType.precision, @@ -139,10 +136,10 @@ ref="elInput" this.onDependenceCellValueChanged(() => { if (this.isFormula(cellType.min)) { - this.vue.min = this.calcMin(cellType.min); + this.vue.min = this.calcMinOrMax(cellType.min); } if (this.isFormula(cellType.max)) { - this.vue.max = this.calcMax(cellType.max); + this.vue.max = this.calcMinOrMax(cellType.max); } if (this.isFormula(cellType.step)) { this.vue.step = this.calcNumber(cellType.step); @@ -151,10 +148,10 @@ ref="elInput" super.onPageLoaded(info); } public SetMinValue(value) { - this.vue.min = this.calcMin(value); + this.vue.min = this.calcMinOrMax(value); } public SetMaxValue(value) { - this.vue.max = this.calcMin(value); + this.vue.max = this.calcMinOrMax(value); } public SetStep(value) { this.vue.step = Number(value); -- Gitee From 17321acfac16a49fd684336564413430934d12c2 Mon Sep 17 00:00:00 2001 From: EdricLi Date: Mon, 27 Jun 2022 10:16:52 +0800 Subject: [PATCH 042/350] Fix FORGUNCY-10515 [FromCN]Element selector can't select the item if its value is 0. --- Resources/CellTypes/Select.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Resources/CellTypes/Select.ts b/Resources/CellTypes/Select.ts index 75133e6..aa0b9e9 100644 --- a/Resources/CellTypes/Select.ts +++ b/Resources/CellTypes/Select.ts @@ -38,8 +38,8 @@ namespace ElementCellTypes { public setDataSource(dataSource: any[], userAction: boolean) { if (userAction) { - this.vue.value = null; - this.commitValue(); + this.vue.value = null; + this.commitValue(); } const cloneDataSource = [...dataSource]; if (this.cellType.AllowAddEmptyItem) { @@ -157,7 +157,7 @@ namespace ElementCellTypes { this.setValueInternal(value, true); }, setValueInternal(value, loadNotMathItems = false) { - if (value) { + if (!self.isEmpty(value)) { let arrayValue; if (cellType.multiple) { if (value instanceof Array) { -- Gitee From 5fbc447a7f6bce4b228fd4d37a1562ff38f5a151 Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 15 Jul 2022 17:53:00 +0800 Subject: [PATCH 043/350] =?UTF-8?q?=E6=8A=8A=E8=A1=A8=E6=A0=BC=E5=8A=A0?= =?UTF-8?q?=E5=9B=9E=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CellTypes/TableCellType.cs | 275 +++++++++++++++++++ CellTypes/Utils.cs | 3 +- ElementUI.csproj | 2 + Resources/CellTypes/Table.ts | 170 ++++++++++++ Resources/Declaration/forguncy.Internal.d.ts | 4 +- 5 files changed, 452 insertions(+), 2 deletions(-) create mode 100644 CellTypes/TableCellType.cs create mode 100644 Resources/CellTypes/Table.ts diff --git a/CellTypes/TableCellType.cs b/CellTypes/TableCellType.cs new file mode 100644 index 0000000..cf12259 --- /dev/null +++ b/CellTypes/TableCellType.cs @@ -0,0 +1,275 @@ +using GrapeCity.Forguncy.CellTypes; +using GrapeCity.Forguncy.Commands; +using GrapeCity.Forguncy.Plugin; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Windows.Input; +using ElementUI.Properties; + +namespace ElementUI +{ + public class TableCellTypeDesigner : CellTypeDesigner, ISupportPropertyInitialize + { + public void InitDefaultPropertyValues(IBuilderContext context) + { + this.CellType.actionButtons.Add(new actionButton() + { + Name = "编辑", + }); + this.CellType.actionButtons.Add(new actionButton() + { + Name = "删除", + styleType = "danger", + }); + } + } + + [Icon("pack://application:,,,/ElementUI;component/Resources/Images/Table.png")] + [OrderWeight((int)Utils.OrderWeight.Table)] + [Designer("ElementUI.TableCellTypeDesigner, ElementUI")] + public class TableCellType : ElementCellTypeBase, IPostGenerate + { + [DisplayName("行点击命令...")] + [CustomCommandObject(InitParamProperties = "dataRow", InitParamValues = "行数据")] + public object RowClickCommand { get; set; } + + [DisplayName("行双击命令...")] + [CustomCommandObject(InitParamProperties = "dataRow", InitParamValues = "行数据")] + public object RowDoubleClickCommand { get; set; } + + [BindingDataSourceProperty] + [DisplayName("数据源...")] + public IBindingDataSource bindingOptions { get; set; } + + bool _autoGenerateColumnsByDataSource = true; + [DisplayName("自动根据数据源生成列")] + public bool autoGenerateColumnsByDataSource + { + get + { + return _autoGenerateColumnsByDataSource; + } + set + { + if (_autoGenerateColumnsByDataSource != value) + { + _autoGenerateColumnsByDataSource = value; + if (!value && bindingOptions != null) + { + columns = bindingOptions.Columns.Select(i => + new columnSetting() + { + dataColumnName = i.ColumnName, + label = i.ColumnName + }).OfType().ToList(); + } + } + } + } + + [DisplayName("手动配置表格列...")] + [ObjectListProperty(DefaultName = "表格列", ItemType = typeof(columnSetting), IndentLevel = 1)] + public List columns { get; set; } = new List(); + + [Browsable(false)] + [SaveJsonIgnore] + public IEnumerable bindingColumns { get; set; } + + private string GetDefaultFormat(ForguncyTableColumnType columnType) + { + switch (columnType) + { + case ForguncyTableColumnType.Time: + return "HH:mm"; + case ForguncyTableColumnType.DateTime: + return "yyyy\"年\"m\"月\"d\"日\""; + default: + return null; + } + } + + [DisplayName("表格的尺寸")] + + [ComboProperty(ValueList = "big|medium|small|mini", DisplayList = "大|中|小|迷你")] + public string size { get; set; } = "big"; + + [DisplayName("空数据时显示的文本内容")] + public string emptyText { get; set; } = "暂无数据"; + + [CategoryHeader("控制选项")] + [DisplayName("列的宽度是否自撑开")] + public bool fit { get; set; } = true; + [DisplayName("显示表头")] + public bool showHeader { get; set; } = true; + [DisplayName("高亮当前行")] + public bool highlightCurrentRow { get; set; } + [DisplayName("在表尾显示合计行")] + public bool showSummary { get; set; } + [DisplayName("合计行第一列的文本")] + public string sumText { get; set; } = "合计"; + [DisplayName("斑马纹")] + public bool stripe { get; set; } = true; + [DisplayName("带有纵向边框")] + public bool border { get; set; } = true; + [DisplayName("显示行号")] + public bool showIndexColumn { get; set; } + [DisplayName("显示选择列")] + public bool showSelectColumn { get; set; } + [DisplayName("显示操作按钮")] + public bool showActionButtons { get; set; } + [ObjectListProperty(DefaultName = "按钮", ItemType = typeof(actionButton), IndentLevel = 1)] + [DisplayName("配置操作按钮...")] + public List actionButtons { get; set; } = new List(); + public override bool GetDesignerPropertyVisible(string propertyName) + { + if (propertyName == nameof(actionButtons)) + { + return showActionButtons; + } + if (propertyName == nameof(columns)) + { + return !autoGenerateColumnsByDataSource; + } + if (propertyName == nameof(sumText)) + { + return showSummary; + } + return base.GetDesignerPropertyVisible(propertyName); + } + + public override string ToString() + { + return "表格"; + } + + public void PostGenerate(IBuilderContextBase builderContext) + { + if (!autoGenerateColumnsByDataSource) + { + return; + } + + var columns = new List(); + if (this.bindingOptions?.TableName != null) + { + var tables = new Dictionary(); + + foreach (var item in builderContext.EnumAllTableInfos()) + { + tables[item.TableName] = item; + } + foreach (var item in this.bindingOptions.Columns) + { + var columnSetting = new columnSetting(); + columnSetting.label = item.ColumnName; + columnSetting.dataColumnName = item.ColumnName; + if (item.BindingInfo != null) + { + if (tables.TryGetValue(item.BindingInfo.GetLastTableName(), out var tableInfo)) + { + var column = tableInfo.Columns.FirstOrDefault(i => i.ColumnName == item.BindingInfo.GetLastColumnName()); + if (column != null) + { + columnSetting.formatStr = GetDefaultFormat(column.ColumnType); + } + } + } + columns.Add(columnSetting); + } + } + this.bindingColumns = columns; + } + } + + sealed public class columnSetting : INamedObject + { + public columnSetting() + { + key = Guid.NewGuid().ToString(); + } + [DisplayName("列名")] + public string label { get; set; } + [DisplayName("绑定数据源的列名")] + public string dataColumnName { get; set; } + [DisplayName("列的宽度")] + public string width { get; set; } + [DisplayName("列的最小宽度")] + public string minWidth { get; set; } + [Description("需要在表格上设置‘带有纵向边框’属性为真时起作用")] + [DisplayName("格式字符串")] + [ComboProperty(ValueList = "yyyy\"年\"m\"月\"d\"日\"|yyyy/m/d|HH:mm", IsSelectOnly = false)] + public string formatStr { get; set; } + [ComboProperty(ValueList = "left|center|right", DisplayList = "左|中|右")] + [DisplayName("对齐方式")] + public string align { get; set; } = "left"; + [DisplayName("表头对齐方式")] + [ComboProperty(ValueList = "left|center|right", DisplayList = "左|中|右")] + public string headerAlign { get; set; } = "center"; + [DisplayName("可以通过拖动改变宽度")] + public bool resizable { get; set; } = true; + [DisplayName("当内容过长被隐藏时显示 tooltip")] + public bool showOverflowTooltip { get; set; } = false; + [Browsable(false)] + public string key { get; set; } + string INamedObject.Name + { + get + { + return label; + } + set + { + label = value; + } + } + } + + public enum TableMode + { + [Description("水平")] + horizontal, + [Description("垂直")] + vertical + } + + public class actionButton : ObjectPropertyBase, INamedObject + { + [Required] + [DisplayName("按钮文字")] + public string Name { get; set; } + + [DisplayName("图标")] + public string icon { get; set; } + + [ComboProperty(ValueList = "default|primary|success|warning|danger|info|text", DisplayList = "默认|主要|成功|警告|危险|提示|链接")] + [DisplayName("按钮样式")] + public string styleType { get; set; } + + [ComboProperty(ValueList = "default|round|circle", DisplayList = "默认|圆角|圆形")] + [DisplayName("按钮形状")] + public string shape { get; set; } = "default"; + + [DisplayName("命令...")] + [CustomCommandObject(InitParamProperties = "dataRow", InitParamValues = "行数据")] + public object Commands { get; set; } + + [DisplayName("浅色背景")] + public bool plain { get; set; } + + [DisplayName("只显示图标")] + public bool iconOnly { get; set; } = false; + + public override bool GetDesignerPropertyVisible(string propertyName) + { + if (propertyName == nameof(iconOnly)) + { + return !string.IsNullOrEmpty(this.icon); + } + return base.GetDesignerPropertyVisible(propertyName); + } + } +} diff --git a/CellTypes/Utils.cs b/CellTypes/Utils.cs index 7f707dc..508cf80 100644 --- a/CellTypes/Utils.cs +++ b/CellTypes/Utils.cs @@ -28,7 +28,8 @@ namespace ElementUI Steps, Timeline, Transfer, - BackupTop + BackupTop, + Table }; public static List GetDefaultPermission(params UIPermissionScope[] scopes) diff --git a/ElementUI.csproj b/ElementUI.csproj index 4321585..153eedb 100644 --- a/ElementUI.csproj +++ b/ElementUI.csproj @@ -108,6 +108,7 @@ + @@ -216,6 +217,7 @@ + diff --git a/Resources/CellTypes/Table.ts b/Resources/CellTypes/Table.ts new file mode 100644 index 0000000..703ec5b --- /dev/null +++ b/Resources/CellTypes/Table.ts @@ -0,0 +1,170 @@ +/// +namespace ElementCellTypes { + interface ITableCellTypeParam { + RowClickCommand: Forguncy.Plugin.ICustomCommandObject; + RowDoubleClickCommand: Forguncy.Plugin.ICustomCommandObject; + bindingOptions: any; + bindingColumns: IColumn[]; + autoGenerateColumnsByDataSource: boolean; + columns: IColumn[]; + stripe: boolean; + border: boolean; + size: string; + fit: boolean; + showHeader: boolean; + highlightCurrentRow: boolean; + emptyText: string; + showSummary: boolean; + sumText: string; + showIndexColumn: boolean; + showSelectColumn: boolean; + showActionButtons: boolean; + actionButtons: IActionButton[]; + + } + interface IActionButton { + Name: string; + icon: string; + styleType: string; + shape: string; + Commands: Forguncy.Plugin.ICustomCommandObject; + plain: boolean; + iconOnly: boolean; + } + interface IColumn { + key: string; + dataColumnName: string; + label: string; + width: string; + minWidth: string; + freezeColumn: string; + resizable: boolean; + formatStr: string; + showOverflowTooltip: boolean; + align: string; + headerAlign: string; + } + + export class TableCellType extends ElementCellTypeBase { + public setDataSource(dataSource) { + return this.vue.setOptions(dataSource); + } + + public onPageLoaded(info: Forguncy.Plugin.CellTypeInfo) { + const self = this; + const cellType = this.CellElement.CellType; + const columnCache = {}; + if (cellType.autoGenerateColumnsByDataSource) { + cellType.columns = cellType.bindingColumns; + } + cellType.columns.forEach(c => columnCache[c.key] = c); + const option = { + el: "#" + this.uId, + template: ` + + + + + +`, + data() { + return { + tableData: undefined, + columns: cellType.columns, + border: cellType.border, + emptyText: cellType.emptyText, + fit: cellType.fit, + highlightCurrentRow: cellType.highlightCurrentRow, + showHeader: cellType.showHeader, + showIndexColumn: cellType.showIndexColumn, + showSelectColumn: cellType.showSelectColumn, + showActionButtons: cellType.showActionButtons, + actionButtons: cellType.actionButtons, + showSummary: cellType.showSummary, + size: cellType.size, + stripe: cellType.stripe, + sumText: cellType.sumText, + }; + }, + methods: { + setOptions(options) { + this.tableData = options; + }, + handleFormatter(row, column, cellValue, index) { + if (column.columnKey && columnCache[column.columnKey] && columnCache[column.columnKey]?.formatStr) { + const result = Forguncy.FormatHelper.format(columnCache[column.columnKey]?.formatStr, cellValue); + if (result) { + return result.text; + } + } + return cellValue; + }, + handleRowClick(row) { + this.handleClick(row, cellType.RowClickCommand); + }, + handleActionClick(row, actionButton: IActionButton) { + const commands = actionButton.Commands; + const initParam = {}; + initParam[commands.ParamProperties["dataRow"]] = row; + self.executeCustomCommandObject(commands, initParam); + }, + handleDoubleRowClick(row) { + this.handleClick(row, cellType.RowDoubleClickCommand, "doubleClick"); + }, + handleClick(row, commands: Forguncy.Plugin.ICustomCommandObject, eventType: string) { + if (commands) { + const initParam = {}; + initParam[commands.ParamProperties["dataRow"]] = row; + self.executeCustomCommandObject(commands, initParam, eventType); + } + } + } + }; + this.createVueApp(option); + + SupportDataSourceCellType.refreshData(this, cellType.bindingOptions, dataSource => this.setDataSource(dataSource)); + super.onPageLoaded(info); + } + } +} + +Forguncy.Plugin.CellTypeHelper.registerCellType("ElementUI.TableCellType, ElementUI", ElementCellTypes.TableCellType); \ No newline at end of file diff --git a/Resources/Declaration/forguncy.Internal.d.ts b/Resources/Declaration/forguncy.Internal.d.ts index 2565ef9..e9612da 100644 --- a/Resources/Declaration/forguncy.Internal.d.ts +++ b/Resources/Declaration/forguncy.Internal.d.ts @@ -33,7 +33,9 @@ class ModuleLoader { static getCdnUrl(url: string); } - + class FormatHelper { + static format(formatString: string, value: any): any; + } class PageBuilder { public static get pageLoadingCover(): JQuery; public static get pageLoadingText(): JQuery; -- Gitee From df91145d8db80033221a0727e3043e7eef2ca17c Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 15 Jul 2022 18:11:49 +0800 Subject: [PATCH 044/350] =?UTF-8?q?Revert=20"=E6=8A=8A=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E5=8A=A0=E5=9B=9E=E6=9D=A5"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 45668c0f496834f6b5268bf111be956742207f72. --- CellTypes/TableCellType.cs | 275 ------------------- CellTypes/Utils.cs | 3 +- ElementUI.csproj | 2 - Resources/CellTypes/Table.ts | 170 ------------ Resources/Declaration/forguncy.Internal.d.ts | 4 +- 5 files changed, 2 insertions(+), 452 deletions(-) delete mode 100644 CellTypes/TableCellType.cs delete mode 100644 Resources/CellTypes/Table.ts diff --git a/CellTypes/TableCellType.cs b/CellTypes/TableCellType.cs deleted file mode 100644 index cf12259..0000000 --- a/CellTypes/TableCellType.cs +++ /dev/null @@ -1,275 +0,0 @@ -using GrapeCity.Forguncy.CellTypes; -using GrapeCity.Forguncy.Commands; -using GrapeCity.Forguncy.Plugin; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Windows.Input; -using ElementUI.Properties; - -namespace ElementUI -{ - public class TableCellTypeDesigner : CellTypeDesigner, ISupportPropertyInitialize - { - public void InitDefaultPropertyValues(IBuilderContext context) - { - this.CellType.actionButtons.Add(new actionButton() - { - Name = "编辑", - }); - this.CellType.actionButtons.Add(new actionButton() - { - Name = "删除", - styleType = "danger", - }); - } - } - - [Icon("pack://application:,,,/ElementUI;component/Resources/Images/Table.png")] - [OrderWeight((int)Utils.OrderWeight.Table)] - [Designer("ElementUI.TableCellTypeDesigner, ElementUI")] - public class TableCellType : ElementCellTypeBase, IPostGenerate - { - [DisplayName("行点击命令...")] - [CustomCommandObject(InitParamProperties = "dataRow", InitParamValues = "行数据")] - public object RowClickCommand { get; set; } - - [DisplayName("行双击命令...")] - [CustomCommandObject(InitParamProperties = "dataRow", InitParamValues = "行数据")] - public object RowDoubleClickCommand { get; set; } - - [BindingDataSourceProperty] - [DisplayName("数据源...")] - public IBindingDataSource bindingOptions { get; set; } - - bool _autoGenerateColumnsByDataSource = true; - [DisplayName("自动根据数据源生成列")] - public bool autoGenerateColumnsByDataSource - { - get - { - return _autoGenerateColumnsByDataSource; - } - set - { - if (_autoGenerateColumnsByDataSource != value) - { - _autoGenerateColumnsByDataSource = value; - if (!value && bindingOptions != null) - { - columns = bindingOptions.Columns.Select(i => - new columnSetting() - { - dataColumnName = i.ColumnName, - label = i.ColumnName - }).OfType().ToList(); - } - } - } - } - - [DisplayName("手动配置表格列...")] - [ObjectListProperty(DefaultName = "表格列", ItemType = typeof(columnSetting), IndentLevel = 1)] - public List columns { get; set; } = new List(); - - [Browsable(false)] - [SaveJsonIgnore] - public IEnumerable bindingColumns { get; set; } - - private string GetDefaultFormat(ForguncyTableColumnType columnType) - { - switch (columnType) - { - case ForguncyTableColumnType.Time: - return "HH:mm"; - case ForguncyTableColumnType.DateTime: - return "yyyy\"年\"m\"月\"d\"日\""; - default: - return null; - } - } - - [DisplayName("表格的尺寸")] - - [ComboProperty(ValueList = "big|medium|small|mini", DisplayList = "大|中|小|迷你")] - public string size { get; set; } = "big"; - - [DisplayName("空数据时显示的文本内容")] - public string emptyText { get; set; } = "暂无数据"; - - [CategoryHeader("控制选项")] - [DisplayName("列的宽度是否自撑开")] - public bool fit { get; set; } = true; - [DisplayName("显示表头")] - public bool showHeader { get; set; } = true; - [DisplayName("高亮当前行")] - public bool highlightCurrentRow { get; set; } - [DisplayName("在表尾显示合计行")] - public bool showSummary { get; set; } - [DisplayName("合计行第一列的文本")] - public string sumText { get; set; } = "合计"; - [DisplayName("斑马纹")] - public bool stripe { get; set; } = true; - [DisplayName("带有纵向边框")] - public bool border { get; set; } = true; - [DisplayName("显示行号")] - public bool showIndexColumn { get; set; } - [DisplayName("显示选择列")] - public bool showSelectColumn { get; set; } - [DisplayName("显示操作按钮")] - public bool showActionButtons { get; set; } - [ObjectListProperty(DefaultName = "按钮", ItemType = typeof(actionButton), IndentLevel = 1)] - [DisplayName("配置操作按钮...")] - public List actionButtons { get; set; } = new List(); - public override bool GetDesignerPropertyVisible(string propertyName) - { - if (propertyName == nameof(actionButtons)) - { - return showActionButtons; - } - if (propertyName == nameof(columns)) - { - return !autoGenerateColumnsByDataSource; - } - if (propertyName == nameof(sumText)) - { - return showSummary; - } - return base.GetDesignerPropertyVisible(propertyName); - } - - public override string ToString() - { - return "表格"; - } - - public void PostGenerate(IBuilderContextBase builderContext) - { - if (!autoGenerateColumnsByDataSource) - { - return; - } - - var columns = new List(); - if (this.bindingOptions?.TableName != null) - { - var tables = new Dictionary(); - - foreach (var item in builderContext.EnumAllTableInfos()) - { - tables[item.TableName] = item; - } - foreach (var item in this.bindingOptions.Columns) - { - var columnSetting = new columnSetting(); - columnSetting.label = item.ColumnName; - columnSetting.dataColumnName = item.ColumnName; - if (item.BindingInfo != null) - { - if (tables.TryGetValue(item.BindingInfo.GetLastTableName(), out var tableInfo)) - { - var column = tableInfo.Columns.FirstOrDefault(i => i.ColumnName == item.BindingInfo.GetLastColumnName()); - if (column != null) - { - columnSetting.formatStr = GetDefaultFormat(column.ColumnType); - } - } - } - columns.Add(columnSetting); - } - } - this.bindingColumns = columns; - } - } - - sealed public class columnSetting : INamedObject - { - public columnSetting() - { - key = Guid.NewGuid().ToString(); - } - [DisplayName("列名")] - public string label { get; set; } - [DisplayName("绑定数据源的列名")] - public string dataColumnName { get; set; } - [DisplayName("列的宽度")] - public string width { get; set; } - [DisplayName("列的最小宽度")] - public string minWidth { get; set; } - [Description("需要在表格上设置‘带有纵向边框’属性为真时起作用")] - [DisplayName("格式字符串")] - [ComboProperty(ValueList = "yyyy\"年\"m\"月\"d\"日\"|yyyy/m/d|HH:mm", IsSelectOnly = false)] - public string formatStr { get; set; } - [ComboProperty(ValueList = "left|center|right", DisplayList = "左|中|右")] - [DisplayName("对齐方式")] - public string align { get; set; } = "left"; - [DisplayName("表头对齐方式")] - [ComboProperty(ValueList = "left|center|right", DisplayList = "左|中|右")] - public string headerAlign { get; set; } = "center"; - [DisplayName("可以通过拖动改变宽度")] - public bool resizable { get; set; } = true; - [DisplayName("当内容过长被隐藏时显示 tooltip")] - public bool showOverflowTooltip { get; set; } = false; - [Browsable(false)] - public string key { get; set; } - string INamedObject.Name - { - get - { - return label; - } - set - { - label = value; - } - } - } - - public enum TableMode - { - [Description("水平")] - horizontal, - [Description("垂直")] - vertical - } - - public class actionButton : ObjectPropertyBase, INamedObject - { - [Required] - [DisplayName("按钮文字")] - public string Name { get; set; } - - [DisplayName("图标")] - public string icon { get; set; } - - [ComboProperty(ValueList = "default|primary|success|warning|danger|info|text", DisplayList = "默认|主要|成功|警告|危险|提示|链接")] - [DisplayName("按钮样式")] - public string styleType { get; set; } - - [ComboProperty(ValueList = "default|round|circle", DisplayList = "默认|圆角|圆形")] - [DisplayName("按钮形状")] - public string shape { get; set; } = "default"; - - [DisplayName("命令...")] - [CustomCommandObject(InitParamProperties = "dataRow", InitParamValues = "行数据")] - public object Commands { get; set; } - - [DisplayName("浅色背景")] - public bool plain { get; set; } - - [DisplayName("只显示图标")] - public bool iconOnly { get; set; } = false; - - public override bool GetDesignerPropertyVisible(string propertyName) - { - if (propertyName == nameof(iconOnly)) - { - return !string.IsNullOrEmpty(this.icon); - } - return base.GetDesignerPropertyVisible(propertyName); - } - } -} diff --git a/CellTypes/Utils.cs b/CellTypes/Utils.cs index 508cf80..7f707dc 100644 --- a/CellTypes/Utils.cs +++ b/CellTypes/Utils.cs @@ -28,8 +28,7 @@ namespace ElementUI Steps, Timeline, Transfer, - BackupTop, - Table + BackupTop }; public static List GetDefaultPermission(params UIPermissionScope[] scopes) diff --git a/ElementUI.csproj b/ElementUI.csproj index 153eedb..4321585 100644 --- a/ElementUI.csproj +++ b/ElementUI.csproj @@ -108,7 +108,6 @@ - @@ -217,7 +216,6 @@ - diff --git a/Resources/CellTypes/Table.ts b/Resources/CellTypes/Table.ts deleted file mode 100644 index 703ec5b..0000000 --- a/Resources/CellTypes/Table.ts +++ /dev/null @@ -1,170 +0,0 @@ -/// -namespace ElementCellTypes { - interface ITableCellTypeParam { - RowClickCommand: Forguncy.Plugin.ICustomCommandObject; - RowDoubleClickCommand: Forguncy.Plugin.ICustomCommandObject; - bindingOptions: any; - bindingColumns: IColumn[]; - autoGenerateColumnsByDataSource: boolean; - columns: IColumn[]; - stripe: boolean; - border: boolean; - size: string; - fit: boolean; - showHeader: boolean; - highlightCurrentRow: boolean; - emptyText: string; - showSummary: boolean; - sumText: string; - showIndexColumn: boolean; - showSelectColumn: boolean; - showActionButtons: boolean; - actionButtons: IActionButton[]; - - } - interface IActionButton { - Name: string; - icon: string; - styleType: string; - shape: string; - Commands: Forguncy.Plugin.ICustomCommandObject; - plain: boolean; - iconOnly: boolean; - } - interface IColumn { - key: string; - dataColumnName: string; - label: string; - width: string; - minWidth: string; - freezeColumn: string; - resizable: boolean; - formatStr: string; - showOverflowTooltip: boolean; - align: string; - headerAlign: string; - } - - export class TableCellType extends ElementCellTypeBase { - public setDataSource(dataSource) { - return this.vue.setOptions(dataSource); - } - - public onPageLoaded(info: Forguncy.Plugin.CellTypeInfo) { - const self = this; - const cellType = this.CellElement.CellType; - const columnCache = {}; - if (cellType.autoGenerateColumnsByDataSource) { - cellType.columns = cellType.bindingColumns; - } - cellType.columns.forEach(c => columnCache[c.key] = c); - const option = { - el: "#" + this.uId, - template: ` - - - - - -`, - data() { - return { - tableData: undefined, - columns: cellType.columns, - border: cellType.border, - emptyText: cellType.emptyText, - fit: cellType.fit, - highlightCurrentRow: cellType.highlightCurrentRow, - showHeader: cellType.showHeader, - showIndexColumn: cellType.showIndexColumn, - showSelectColumn: cellType.showSelectColumn, - showActionButtons: cellType.showActionButtons, - actionButtons: cellType.actionButtons, - showSummary: cellType.showSummary, - size: cellType.size, - stripe: cellType.stripe, - sumText: cellType.sumText, - }; - }, - methods: { - setOptions(options) { - this.tableData = options; - }, - handleFormatter(row, column, cellValue, index) { - if (column.columnKey && columnCache[column.columnKey] && columnCache[column.columnKey]?.formatStr) { - const result = Forguncy.FormatHelper.format(columnCache[column.columnKey]?.formatStr, cellValue); - if (result) { - return result.text; - } - } - return cellValue; - }, - handleRowClick(row) { - this.handleClick(row, cellType.RowClickCommand); - }, - handleActionClick(row, actionButton: IActionButton) { - const commands = actionButton.Commands; - const initParam = {}; - initParam[commands.ParamProperties["dataRow"]] = row; - self.executeCustomCommandObject(commands, initParam); - }, - handleDoubleRowClick(row) { - this.handleClick(row, cellType.RowDoubleClickCommand, "doubleClick"); - }, - handleClick(row, commands: Forguncy.Plugin.ICustomCommandObject, eventType: string) { - if (commands) { - const initParam = {}; - initParam[commands.ParamProperties["dataRow"]] = row; - self.executeCustomCommandObject(commands, initParam, eventType); - } - } - } - }; - this.createVueApp(option); - - SupportDataSourceCellType.refreshData(this, cellType.bindingOptions, dataSource => this.setDataSource(dataSource)); - super.onPageLoaded(info); - } - } -} - -Forguncy.Plugin.CellTypeHelper.registerCellType("ElementUI.TableCellType, ElementUI", ElementCellTypes.TableCellType); \ No newline at end of file diff --git a/Resources/Declaration/forguncy.Internal.d.ts b/Resources/Declaration/forguncy.Internal.d.ts index e9612da..2565ef9 100644 --- a/Resources/Declaration/forguncy.Internal.d.ts +++ b/Resources/Declaration/forguncy.Internal.d.ts @@ -33,9 +33,7 @@ class ModuleLoader { static getCdnUrl(url: string); } - class FormatHelper { - static format(formatString: string, value: any): any; - } + class PageBuilder { public static get pageLoadingCover(): JQuery; public static get pageLoadingText(): JQuery; -- Gitee From 3d5f65202ca25087bf2c2f5dc0ec56a47bd8859e Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 15 Jul 2022 18:13:00 +0800 Subject: [PATCH 045/350] =?UTF-8?q?Revert=20"Revert=20"=E6=8A=8A=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E5=8A=A0=E5=9B=9E=E6=9D=A5""?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit df91145d8db80033221a0727e3043e7eef2ca17c. --- CellTypes/TableCellType.cs | 275 +++++++++++++++++++ CellTypes/Utils.cs | 3 +- ElementUI.csproj | 2 + Resources/CellTypes/Table.ts | 170 ++++++++++++ Resources/Declaration/forguncy.Internal.d.ts | 4 +- 5 files changed, 452 insertions(+), 2 deletions(-) create mode 100644 CellTypes/TableCellType.cs create mode 100644 Resources/CellTypes/Table.ts diff --git a/CellTypes/TableCellType.cs b/CellTypes/TableCellType.cs new file mode 100644 index 0000000..cf12259 --- /dev/null +++ b/CellTypes/TableCellType.cs @@ -0,0 +1,275 @@ +using GrapeCity.Forguncy.CellTypes; +using GrapeCity.Forguncy.Commands; +using GrapeCity.Forguncy.Plugin; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Windows.Input; +using ElementUI.Properties; + +namespace ElementUI +{ + public class TableCellTypeDesigner : CellTypeDesigner, ISupportPropertyInitialize + { + public void InitDefaultPropertyValues(IBuilderContext context) + { + this.CellType.actionButtons.Add(new actionButton() + { + Name = "编辑", + }); + this.CellType.actionButtons.Add(new actionButton() + { + Name = "删除", + styleType = "danger", + }); + } + } + + [Icon("pack://application:,,,/ElementUI;component/Resources/Images/Table.png")] + [OrderWeight((int)Utils.OrderWeight.Table)] + [Designer("ElementUI.TableCellTypeDesigner, ElementUI")] + public class TableCellType : ElementCellTypeBase, IPostGenerate + { + [DisplayName("行点击命令...")] + [CustomCommandObject(InitParamProperties = "dataRow", InitParamValues = "行数据")] + public object RowClickCommand { get; set; } + + [DisplayName("行双击命令...")] + [CustomCommandObject(InitParamProperties = "dataRow", InitParamValues = "行数据")] + public object RowDoubleClickCommand { get; set; } + + [BindingDataSourceProperty] + [DisplayName("数据源...")] + public IBindingDataSource bindingOptions { get; set; } + + bool _autoGenerateColumnsByDataSource = true; + [DisplayName("自动根据数据源生成列")] + public bool autoGenerateColumnsByDataSource + { + get + { + return _autoGenerateColumnsByDataSource; + } + set + { + if (_autoGenerateColumnsByDataSource != value) + { + _autoGenerateColumnsByDataSource = value; + if (!value && bindingOptions != null) + { + columns = bindingOptions.Columns.Select(i => + new columnSetting() + { + dataColumnName = i.ColumnName, + label = i.ColumnName + }).OfType().ToList(); + } + } + } + } + + [DisplayName("手动配置表格列...")] + [ObjectListProperty(DefaultName = "表格列", ItemType = typeof(columnSetting), IndentLevel = 1)] + public List columns { get; set; } = new List(); + + [Browsable(false)] + [SaveJsonIgnore] + public IEnumerable bindingColumns { get; set; } + + private string GetDefaultFormat(ForguncyTableColumnType columnType) + { + switch (columnType) + { + case ForguncyTableColumnType.Time: + return "HH:mm"; + case ForguncyTableColumnType.DateTime: + return "yyyy\"年\"m\"月\"d\"日\""; + default: + return null; + } + } + + [DisplayName("表格的尺寸")] + + [ComboProperty(ValueList = "big|medium|small|mini", DisplayList = "大|中|小|迷你")] + public string size { get; set; } = "big"; + + [DisplayName("空数据时显示的文本内容")] + public string emptyText { get; set; } = "暂无数据"; + + [CategoryHeader("控制选项")] + [DisplayName("列的宽度是否自撑开")] + public bool fit { get; set; } = true; + [DisplayName("显示表头")] + public bool showHeader { get; set; } = true; + [DisplayName("高亮当前行")] + public bool highlightCurrentRow { get; set; } + [DisplayName("在表尾显示合计行")] + public bool showSummary { get; set; } + [DisplayName("合计行第一列的文本")] + public string sumText { get; set; } = "合计"; + [DisplayName("斑马纹")] + public bool stripe { get; set; } = true; + [DisplayName("带有纵向边框")] + public bool border { get; set; } = true; + [DisplayName("显示行号")] + public bool showIndexColumn { get; set; } + [DisplayName("显示选择列")] + public bool showSelectColumn { get; set; } + [DisplayName("显示操作按钮")] + public bool showActionButtons { get; set; } + [ObjectListProperty(DefaultName = "按钮", ItemType = typeof(actionButton), IndentLevel = 1)] + [DisplayName("配置操作按钮...")] + public List actionButtons { get; set; } = new List(); + public override bool GetDesignerPropertyVisible(string propertyName) + { + if (propertyName == nameof(actionButtons)) + { + return showActionButtons; + } + if (propertyName == nameof(columns)) + { + return !autoGenerateColumnsByDataSource; + } + if (propertyName == nameof(sumText)) + { + return showSummary; + } + return base.GetDesignerPropertyVisible(propertyName); + } + + public override string ToString() + { + return "表格"; + } + + public void PostGenerate(IBuilderContextBase builderContext) + { + if (!autoGenerateColumnsByDataSource) + { + return; + } + + var columns = new List(); + if (this.bindingOptions?.TableName != null) + { + var tables = new Dictionary(); + + foreach (var item in builderContext.EnumAllTableInfos()) + { + tables[item.TableName] = item; + } + foreach (var item in this.bindingOptions.Columns) + { + var columnSetting = new columnSetting(); + columnSetting.label = item.ColumnName; + columnSetting.dataColumnName = item.ColumnName; + if (item.BindingInfo != null) + { + if (tables.TryGetValue(item.BindingInfo.GetLastTableName(), out var tableInfo)) + { + var column = tableInfo.Columns.FirstOrDefault(i => i.ColumnName == item.BindingInfo.GetLastColumnName()); + if (column != null) + { + columnSetting.formatStr = GetDefaultFormat(column.ColumnType); + } + } + } + columns.Add(columnSetting); + } + } + this.bindingColumns = columns; + } + } + + sealed public class columnSetting : INamedObject + { + public columnSetting() + { + key = Guid.NewGuid().ToString(); + } + [DisplayName("列名")] + public string label { get; set; } + [DisplayName("绑定数据源的列名")] + public string dataColumnName { get; set; } + [DisplayName("列的宽度")] + public string width { get; set; } + [DisplayName("列的最小宽度")] + public string minWidth { get; set; } + [Description("需要在表格上设置‘带有纵向边框’属性为真时起作用")] + [DisplayName("格式字符串")] + [ComboProperty(ValueList = "yyyy\"年\"m\"月\"d\"日\"|yyyy/m/d|HH:mm", IsSelectOnly = false)] + public string formatStr { get; set; } + [ComboProperty(ValueList = "left|center|right", DisplayList = "左|中|右")] + [DisplayName("对齐方式")] + public string align { get; set; } = "left"; + [DisplayName("表头对齐方式")] + [ComboProperty(ValueList = "left|center|right", DisplayList = "左|中|右")] + public string headerAlign { get; set; } = "center"; + [DisplayName("可以通过拖动改变宽度")] + public bool resizable { get; set; } = true; + [DisplayName("当内容过长被隐藏时显示 tooltip")] + public bool showOverflowTooltip { get; set; } = false; + [Browsable(false)] + public string key { get; set; } + string INamedObject.Name + { + get + { + return label; + } + set + { + label = value; + } + } + } + + public enum TableMode + { + [Description("水平")] + horizontal, + [Description("垂直")] + vertical + } + + public class actionButton : ObjectPropertyBase, INamedObject + { + [Required] + [DisplayName("按钮文字")] + public string Name { get; set; } + + [DisplayName("图标")] + public string icon { get; set; } + + [ComboProperty(ValueList = "default|primary|success|warning|danger|info|text", DisplayList = "默认|主要|成功|警告|危险|提示|链接")] + [DisplayName("按钮样式")] + public string styleType { get; set; } + + [ComboProperty(ValueList = "default|round|circle", DisplayList = "默认|圆角|圆形")] + [DisplayName("按钮形状")] + public string shape { get; set; } = "default"; + + [DisplayName("命令...")] + [CustomCommandObject(InitParamProperties = "dataRow", InitParamValues = "行数据")] + public object Commands { get; set; } + + [DisplayName("浅色背景")] + public bool plain { get; set; } + + [DisplayName("只显示图标")] + public bool iconOnly { get; set; } = false; + + public override bool GetDesignerPropertyVisible(string propertyName) + { + if (propertyName == nameof(iconOnly)) + { + return !string.IsNullOrEmpty(this.icon); + } + return base.GetDesignerPropertyVisible(propertyName); + } + } +} diff --git a/CellTypes/Utils.cs b/CellTypes/Utils.cs index 7f707dc..508cf80 100644 --- a/CellTypes/Utils.cs +++ b/CellTypes/Utils.cs @@ -28,7 +28,8 @@ namespace ElementUI Steps, Timeline, Transfer, - BackupTop + BackupTop, + Table }; public static List GetDefaultPermission(params UIPermissionScope[] scopes) diff --git a/ElementUI.csproj b/ElementUI.csproj index 4321585..153eedb 100644 --- a/ElementUI.csproj +++ b/ElementUI.csproj @@ -108,6 +108,7 @@ + @@ -216,6 +217,7 @@ + diff --git a/Resources/CellTypes/Table.ts b/Resources/CellTypes/Table.ts new file mode 100644 index 0000000..703ec5b --- /dev/null +++ b/Resources/CellTypes/Table.ts @@ -0,0 +1,170 @@ +/// +namespace ElementCellTypes { + interface ITableCellTypeParam { + RowClickCommand: Forguncy.Plugin.ICustomCommandObject; + RowDoubleClickCommand: Forguncy.Plugin.ICustomCommandObject; + bindingOptions: any; + bindingColumns: IColumn[]; + autoGenerateColumnsByDataSource: boolean; + columns: IColumn[]; + stripe: boolean; + border: boolean; + size: string; + fit: boolean; + showHeader: boolean; + highlightCurrentRow: boolean; + emptyText: string; + showSummary: boolean; + sumText: string; + showIndexColumn: boolean; + showSelectColumn: boolean; + showActionButtons: boolean; + actionButtons: IActionButton[]; + + } + interface IActionButton { + Name: string; + icon: string; + styleType: string; + shape: string; + Commands: Forguncy.Plugin.ICustomCommandObject; + plain: boolean; + iconOnly: boolean; + } + interface IColumn { + key: string; + dataColumnName: string; + label: string; + width: string; + minWidth: string; + freezeColumn: string; + resizable: boolean; + formatStr: string; + showOverflowTooltip: boolean; + align: string; + headerAlign: string; + } + + export class TableCellType extends ElementCellTypeBase { + public setDataSource(dataSource) { + return this.vue.setOptions(dataSource); + } + + public onPageLoaded(info: Forguncy.Plugin.CellTypeInfo) { + const self = this; + const cellType = this.CellElement.CellType; + const columnCache = {}; + if (cellType.autoGenerateColumnsByDataSource) { + cellType.columns = cellType.bindingColumns; + } + cellType.columns.forEach(c => columnCache[c.key] = c); + const option = { + el: "#" + this.uId, + template: ` + + + + + +`, + data() { + return { + tableData: undefined, + columns: cellType.columns, + border: cellType.border, + emptyText: cellType.emptyText, + fit: cellType.fit, + highlightCurrentRow: cellType.highlightCurrentRow, + showHeader: cellType.showHeader, + showIndexColumn: cellType.showIndexColumn, + showSelectColumn: cellType.showSelectColumn, + showActionButtons: cellType.showActionButtons, + actionButtons: cellType.actionButtons, + showSummary: cellType.showSummary, + size: cellType.size, + stripe: cellType.stripe, + sumText: cellType.sumText, + }; + }, + methods: { + setOptions(options) { + this.tableData = options; + }, + handleFormatter(row, column, cellValue, index) { + if (column.columnKey && columnCache[column.columnKey] && columnCache[column.columnKey]?.formatStr) { + const result = Forguncy.FormatHelper.format(columnCache[column.columnKey]?.formatStr, cellValue); + if (result) { + return result.text; + } + } + return cellValue; + }, + handleRowClick(row) { + this.handleClick(row, cellType.RowClickCommand); + }, + handleActionClick(row, actionButton: IActionButton) { + const commands = actionButton.Commands; + const initParam = {}; + initParam[commands.ParamProperties["dataRow"]] = row; + self.executeCustomCommandObject(commands, initParam); + }, + handleDoubleRowClick(row) { + this.handleClick(row, cellType.RowDoubleClickCommand, "doubleClick"); + }, + handleClick(row, commands: Forguncy.Plugin.ICustomCommandObject, eventType: string) { + if (commands) { + const initParam = {}; + initParam[commands.ParamProperties["dataRow"]] = row; + self.executeCustomCommandObject(commands, initParam, eventType); + } + } + } + }; + this.createVueApp(option); + + SupportDataSourceCellType.refreshData(this, cellType.bindingOptions, dataSource => this.setDataSource(dataSource)); + super.onPageLoaded(info); + } + } +} + +Forguncy.Plugin.CellTypeHelper.registerCellType("ElementUI.TableCellType, ElementUI", ElementCellTypes.TableCellType); \ No newline at end of file diff --git a/Resources/Declaration/forguncy.Internal.d.ts b/Resources/Declaration/forguncy.Internal.d.ts index 2565ef9..e9612da 100644 --- a/Resources/Declaration/forguncy.Internal.d.ts +++ b/Resources/Declaration/forguncy.Internal.d.ts @@ -33,7 +33,9 @@ class ModuleLoader { static getCdnUrl(url: string); } - + class FormatHelper { + static format(formatString: string, value: any): any; + } class PageBuilder { public static get pageLoadingCover(): JQuery; public static get pageLoadingText(): JQuery; -- Gitee From 5dfb8ae7fff587602e9ae62c029c0f86f6cce0e7 Mon Sep 17 00:00:00 2001 From: "Edric.Li" Date: Wed, 3 Aug 2022 06:01:21 +0000 Subject: [PATCH 046/350] Force a code synchronization. --- README.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.en.md b/README.en.md index 948054a..e3b8368 100644 --- a/README.en.md +++ b/README.en.md @@ -33,6 +33,6 @@ Software architecture description 3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) 4. The most valuable open source project [GVP](https://gitee.com/gvp) 5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) \ No newline at end of file -- Gitee From ac368f3d8cb1bf5ea1ec3498977541fa420abedb Mon Sep 17 00:00:00 2001 From: "Edric.Li" Date: Wed, 3 Aug 2022 06:02:38 +0000 Subject: [PATCH 047/350] Force a code synchronization. --- README.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.en.md b/README.en.md index e3b8368..6ea0809 100644 --- a/README.en.md +++ b/README.en.md @@ -33,6 +33,6 @@ Software architecture description 3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) 4. The most valuable open source project [GVP](https://gitee.com/gvp) 5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) \ No newline at end of file -- Gitee From 773571972e5774a540dd84361861cb046dd9ea0c Mon Sep 17 00:00:00 2001 From: "Edric.Li" Date: Wed, 3 Aug 2022 06:13:00 +0000 Subject: [PATCH 048/350] Force a code synchronization. --- README.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.en.md b/README.en.md index 6ea0809..7e927a4 100644 --- a/README.en.md +++ b/README.en.md @@ -13,7 +13,7 @@ Software architecture description 3. xxxx #### Instructions - + 1. xxxx 2. xxxx 3. xxxx -- Gitee From b8717bf4db402f3e36b26db84b65243efe75054d Mon Sep 17 00:00:00 2001 From: "Edric.Li" Date: Wed, 3 Aug 2022 06:18:58 +0000 Subject: [PATCH 049/350] Force a code synchronization. --- README.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.en.md b/README.en.md index 7e927a4..030011a 100644 --- a/README.en.md +++ b/README.en.md @@ -33,6 +33,6 @@ Software architecture description 3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) 4. The most valuable open source project [GVP](https://gitee.com/gvp) 5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) \ No newline at end of file -- Gitee From 12d67e72f621562b1ea11927f4866ee91655afcb Mon Sep 17 00:00:00 2001 From: "Edric.Li" Date: Wed, 3 Aug 2022 06:25:04 +0000 Subject: [PATCH 050/350] update README.en.md. --- README.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.en.md b/README.en.md index 030011a..f86e98a 100644 --- a/README.en.md +++ b/README.en.md @@ -11,7 +11,7 @@ Software architecture description 1. xxxx 2. xxxx 3. xxxx - + #### Instructions 1. xxxx -- Gitee From 088824235c42397f54a9dd4b6e3fc8d1d8768da3 Mon Sep 17 00:00:00 2001 From: "Edric.Li" Date: Wed, 3 Aug 2022 06:26:29 +0000 Subject: [PATCH 051/350] update README.en.md. --- README.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.en.md b/README.en.md index f86e98a..0f411d6 100644 --- a/README.en.md +++ b/README.en.md @@ -8,7 +8,7 @@ Software architecture description #### Installation -1. xxxx +1. xxxxx 2. xxxx 3. xxxx -- Gitee From 53683e720d680b9dad4710450b4e1c9d257e1c80 Mon Sep 17 00:00:00 2001 From: "Edric.Li" Date: Wed, 3 Aug 2022 06:45:32 +0000 Subject: [PATCH 052/350] update README.en.md. --- README.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.en.md b/README.en.md index 0f411d6..3bfd29f 100644 --- a/README.en.md +++ b/README.en.md @@ -4,7 +4,7 @@ 活字格UI组件-ElementPlus插件源代码 #### Software Architecture -Software architecture description +Software architecture description #### Installation -- Gitee From 68635ad9715676671e758e00364c38d20af6565c Mon Sep 17 00:00:00 2001 From: "Edric.Li" Date: Wed, 3 Aug 2022 06:56:54 +0000 Subject: [PATCH 053/350] update README.en.md. --- README.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.en.md b/README.en.md index 3bfd29f..ca887aa 100644 --- a/README.en.md +++ b/README.en.md @@ -9,7 +9,7 @@ Software architecture description #### Installation 1. xxxxx -2. xxxx +2. xxxxX 3. xxxx #### Instructions -- Gitee From 5a00c2b872182e9a4b39a2f3bec7a3dd74f9e9e9 Mon Sep 17 00:00:00 2001 From: Robert Date: Wed, 3 Aug 2022 15:52:29 +0800 Subject: [PATCH 054/350] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PluginConfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PluginConfig.json b/PluginConfig.json index 228b744..768a0ab 100644 --- a/PluginConfig.json +++ b/PluginConfig.json @@ -25,8 +25,8 @@ "name_kr": "엘리멘트UI", "pluginType": "cellType,command", "guid": "2CCB2F02-D923-491E-94E4-72C9BD8C5ABE", - "version": "8.0.3.0", - "dependenceVersion": "8.0.1.0", + "version": "8.0.100.0", + "dependenceVersion": "8.0.100.0", "bundleJavaScript": false, "bundleCSS": true } \ No newline at end of file -- Gitee From 9c161c07962be35ea274e6f9049c83ce0de99a47 Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 4 Aug 2022 11:43:08 +0800 Subject: [PATCH 055/350] FORGUNCY-10967 [ElementUI] Svg images are displayed as img in the navigation menu --- Resources/CellTypes/Base.ts | 28 ++++++++++++++++++++++++---- Resources/CellTypes/NavMenu.ts | 28 +++++++++------------------- 2 files changed, 33 insertions(+), 23 deletions(-) diff --git a/Resources/CellTypes/Base.ts b/Resources/CellTypes/Base.ts index f2f0ee0..e34a7b0 100644 --- a/Resources/CellTypes/Base.ts +++ b/Resources/CellTypes/Base.ts @@ -282,10 +282,30 @@ if (ElementCellTypeBase.isAttachment(src)) { src = Forguncy.Helper.SpecialPath.getUploadImageFolderPathInServer() + encodeURIComponent(src); } - callback({ - icon: src, - isSvg: false - }); + if (src.endsWith(".svg")) { + $.get(src, (data) => { + if (data.documentElement) { + const svg = $(data.documentElement); + Forguncy.ImageHelper.preHandleSvg(svg, null); + callback({ + "icon": svg[0].outerHTML, + isSvg: true + }); + } + else { + callback({ + icon: src, + isSvg: false + }); + } + }); + } + else { + callback({ + icon: src, + isSvg: false + }); + } } } if (!icon?.Name) { diff --git a/Resources/CellTypes/NavMenu.ts b/Resources/CellTypes/NavMenu.ts index 99052c2..ce06ba8 100644 --- a/Resources/CellTypes/NavMenu.ts +++ b/Resources/CellTypes/NavMenu.ts @@ -473,25 +473,15 @@ namespace ElementCellTypes { const nodes = TreeHelper.flat(option); for (const node of nodes) { const menuNode = node; - if (typeof (menuNode.icon) === "string") { - let src = menuNode.icon; - if (this.isAttachment(menuNode.icon)) { - src = Forguncy.Helper.SpecialPath.getUploadImageFolderPathInServer() + encodeURIComponent(menuNode.icon); - } - menuNode.iconSrc = src; - } - else { - if (menuNode && (menuNode.icon)?.Name) { - - cellType.getIcon(menuNode.icon, icon => { - if (icon.isSvg) { - menuNode.svgIcon = icon.icon; - } - else { - menuNode.iconSrc = icon.icon; - } - }); - } + if (menuNode && menuNode.icon) { + cellType.getIcon(menuNode.icon, icon => { + if (icon.isSvg) { + menuNode.svgIcon = icon.icon; + } + else { + menuNode.iconSrc = icon.icon; + } + }); } } } -- Gitee From 3ed51c529b426e764b70581a3308a49785d29c75 Mon Sep 17 00:00:00 2001 From: "Edric.Li" Date: Thu, 4 Aug 2022 07:06:01 +0000 Subject: [PATCH 056/350] update README.md. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b384b1..d587958 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ - 插件会在 设计器的默认安装路径下 获取引用,如果你的设计器是自定义的安装路径,需要更新引用的路径,具体可阅读 [活字格-插件开发-插件开发流程](https://help.grapecity.com.cn/pages/viewpage.action?pageId=56534757)。 #### 分支管理 -- master 是发布的最新版本,和[插件商城](https://marketplace.grapecity.com.cn/ApplicationDetails?productID=SP2203310001&productDetailID=D2203310006&tabName=Tabs_detail) 最新版本对应。 +- master 是发布的最新版本,和[插件商城](https://marketplace.grapecity.com.cn/ApplicationDetails?productID=SP2203310001&productDetailID=D2203310006&tabName=Tabs_detail) 最新版本对应。 - dev 开发人员会在该分支上开发,你可以在此分支获取最新的代码,仅限学习和测试,请勿在生产环境中使用。 -- Gitee From e3bd438fef5f6d468095f79504591e8caef626bf Mon Sep 17 00:00:00 2001 From: RexLi Date: Fri, 5 Aug 2022 13:51:12 +0800 Subject: [PATCH 057/350] add element table --- CellTypes/Common.cs | 14 + CellTypes/PaginationCellType.cs | 49 +- CellTypes/TableCellType.cs | 415 ++++++++--- Properties/Resources.Designer.cs | 645 ++++++++++++++++++ Properties/Resources.resx | 219 ++++++ Properties/Resources.zh-CN.resx | 219 ++++++ Resources/CellTypes/Pagination.ts | 64 +- Resources/CellTypes/Table.ts | 432 +++++++----- Resources/Declaration/forguncy.Internal.d.ts | 13 + Resources/Declaration/forguncy.Plugin.d.ts | 23 +- .../DrawingObject/TableDrawingObject.xaml | 35 + .../DrawingObject/TableDrawingObject.xaml.cs | 354 ++++++++++ 12 files changed, 2221 insertions(+), 261 deletions(-) create mode 100644 WpfControls/DrawingObject/TableDrawingObject.xaml create mode 100644 WpfControls/DrawingObject/TableDrawingObject.xaml.cs diff --git a/CellTypes/Common.cs b/CellTypes/Common.cs index 2feb4a3..7faf007 100644 --- a/CellTypes/Common.cs +++ b/CellTypes/Common.cs @@ -240,6 +240,14 @@ namespace ElementUI set => base.Watermark = value; } } + internal class SRObjectListPropertyAttribute : ObjectListPropertyAttribute + { + public override string DefaultName + { + get => ResourceHelper.GetString(base.DefaultName); + set => base.DefaultName = value; + } + } internal class IconPropertyAttribute : ImageValuePropertyAttribute { public IconPropertyAttribute() @@ -265,4 +273,10 @@ namespace ElementUI return srStr; } } + internal class ComboItem + { + public string Name { get; set; } + + public string Value { get; set; } + } } diff --git a/CellTypes/PaginationCellType.cs b/CellTypes/PaginationCellType.cs index e0f4a7b..76866b9 100644 --- a/CellTypes/PaginationCellType.cs +++ b/CellTypes/PaginationCellType.cs @@ -31,6 +31,12 @@ namespace ElementUI.CellTypes this.CellType.pageSizes.Add(new PageSize() { value = pageSize }); } this.CellType.ListviewName = context.EnumAllListViewInfos(context.PageName).FirstOrDefault()?.ListViewName; + var allCellTypes = context.EnumAllCellTypes(context.PageName); + var firstElementTable = allCellTypes?.FirstOrDefault(cell => cell.GetType() == typeof(TableCellType)); + if (firstElementTable is TableCellType elementTable) + { + this.CellType.ElementTableName = elementTable.ElTableName; + } } public override FrameworkElement GetDrawingControl(ICellInfo cellInfo, IDrawingHelper drawingHelper) @@ -39,6 +45,29 @@ namespace ElementUI.CellTypes var control = new PaginationDrawingControl(cellStyle, this.CellType, drawingHelper); return control; } + + public override EditorSetting GetEditorSetting(PropertyDescriptor property, IBuilderContext builderContext) + { + if (property.Name == nameof(CellType.ElementTableName)) + { + var allElementTableNames = builderContext.EnumAllCellTypes(builderContext.PageName) + ?.Where(cell => cell.GetType() == typeof(TableCellType)) + .Select(cell => new ComboItem() + { + Name = (cell as TableCellType).ElTableName, + Value = (cell as TableCellType).ElTableName + }); + List source = new List(); + source.Add(new ComboItem() { Name = Resources.ElementCellType_None, Value = null }); + if (allElementTableNames != null) + { + source.AddRange(allElementTableNames.Where(x => !string.IsNullOrEmpty(x.Value))); + } + return new ComboEditorSetting(source, nameof(ComboItem.Name), nameof(ComboItem.Value)); + } + + return base.GetEditorSetting(property, builderContext); + } } [Icon("pack://application:,,,/ElementUI;component/Resources/Images/Pagination.png")] @@ -50,10 +79,20 @@ namespace ElementUI.CellTypes [SRDisplayName(nameof(Resources.PaginationCellType_PagingChangeCommands))] public object PagingChangeCommands { get; set; } + [SRDisplayName(nameof(Resources.PaginationCellType_SelectElementTable))] + [BoolProperty] + [DefaultValue(false)] + public bool AttachElementTable { get; set; } + [SRDisplayName(nameof(Resources.PaginationCellType_ListviewName))] [ListviewProperty] public string ListviewName { get; set; } + [DefaultValue(null)] + [SRDisplayName(nameof(Resources.PaginationCellType_ElementTable))] + [SRComboProperty] + public string ElementTableName { get; set; } + [IntProperty(Min = 1)] [SRDisplayName(nameof(Resources.PaginationCellType_pageSize))] [DefaultValue(10)] @@ -130,7 +169,7 @@ namespace ElementUI.CellTypes [RunTimeMethod] [SRDisplayName(nameof(Resources.PaginationCellType_SetTotal))] - public void SetTotal([Required][SRItemDisplayName(nameof(Resources.PaginationCellType_Total_Param))]int total) + public void SetTotal([Required][SRItemDisplayName(nameof(Resources.PaginationCellType_Total_Param))] int total) { } @@ -174,6 +213,14 @@ namespace ElementUI.CellTypes { return this.layout.Any(i => i.layoutItem == "next"); } + if (propertyName == nameof(ListviewName)) + { + return !AttachElementTable; + } + if (propertyName == nameof(ElementTableName)) + { + return AttachElementTable; + } return base.GetDesignerPropertyVisible(propertyName); } } diff --git a/CellTypes/TableCellType.cs b/CellTypes/TableCellType.cs index cf12259..204dbe5 100644 --- a/CellTypes/TableCellType.cs +++ b/CellTypes/TableCellType.cs @@ -9,22 +9,59 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using System.Windows.Input; using ElementUI.Properties; +using System.Windows; +using ElementUI.WpfControls; namespace ElementUI { - public class TableCellTypeDesigner : CellTypeDesigner, ISupportPropertyInitialize + public class TableCellTypeDesigner : CellTypeDesigner, ISupportPropertyInitialize, ICellTypeChecker { public void InitDefaultPropertyValues(IBuilderContext context) { - this.CellType.actionButtons.Add(new actionButton() + this.CellType.actionButtons.Add(new ActionButton() { - Name = "编辑", + Name = Resources.TableCellType_Edit, + type = "button", + styleType = "default", + shape = "default", + iconWidth = 18, + iconHeight = 18 }); - this.CellType.actionButtons.Add(new actionButton() + this.CellType.actionButtons.Add(new ActionButton() { - Name = "删除", + Name = Resources.TableCellType_Delete, styleType = "danger", + type = "button", + shape = "default", + iconWidth = 18, + iconHeight = 18 }); + CellType.autoGenerateColumnsByDataSource = true; + } + + public override FrameworkElement GetDrawingControl(ICellInfo cellInfo, IDrawingHelper drawingHelper) + { + var cellStyle = StyleHelper.CreateStyleViewModel(cellInfo, drawingHelper); + var control = new TableDrawingControl(cellStyle, CellType, drawingHelper); + return control; + } + + public IEnumerable CheckCellTypeErrors(IBuilderContext context) + { + if (string.IsNullOrEmpty(CellType.ElTableName)) + { + yield break; + } + var allElTableCellTypes = context.EnumAllCellTypes(context.PageName).Where(x => x is TableCellType && x != CellType); + var allElTableNames = allElTableCellTypes.Where(x => !string.IsNullOrEmpty((x as TableCellType).ElTableName)).Select(x => (x as TableCellType).ElTableName); + if (allElTableNames.Contains(CellType.ElTableName)) + { + yield return new ForguncyErrorInfo() + { + Message = String.Format(Resources.TableCellType_TableNameDuplicateError, CellType.ElTableName), + ErrorType = ForguncyErrorType.Error + }; + } } } @@ -33,20 +70,29 @@ namespace ElementUI [Designer("ElementUI.TableCellTypeDesigner, ElementUI")] public class TableCellType : ElementCellTypeBase, IPostGenerate { - [DisplayName("行点击命令...")] - [CustomCommandObject(InitParamProperties = "dataRow", InitParamValues = "行数据")] + [SRDisplayName(nameof(Resources.TableCellType_TableName))] + [DefaultValue(null)] + public string ElTableName { get; set; } + + [SRDisplayName(nameof(Resources.TableCellType_RowClickCommand))] + [SRCustomCommandObject(InitParamProperties = "dataRow", InitParamValues = nameof(Resources.TableCellType_RowData))] public object RowClickCommand { get; set; } - [DisplayName("行双击命令...")] - [CustomCommandObject(InitParamProperties = "dataRow", InitParamValues = "行数据")] + [SRDisplayName(nameof(Resources.TableCellType_RowDoubleClickCommand))] + [SRCustomCommandObject(InitParamProperties = "dataRow", InitParamValues = nameof(Resources.TableCellType_RowData))] public object RowDoubleClickCommand { get; set; } + [SRDisplayName(nameof(Resources.TableCellType_CurrentRowChangedCommand))] + [SRCustomCommandObject(InitParamProperties = "dataRow", InitParamValues = nameof(Resources.TableCellType_RowData))] + public object CurrentRowChangedCommand { get; set; } + [BindingDataSourceProperty] - [DisplayName("数据源...")] + [SRDisplayName(nameof(Resources.TableCellType_DataSource))] public IBindingDataSource bindingOptions { get; set; } - bool _autoGenerateColumnsByDataSource = true; - [DisplayName("自动根据数据源生成列")] + bool _autoGenerateColumnsByDataSource; + [DefaultValue(true)] + [SRDisplayName(nameof(Resources.TableCellType_AutoGenerateColumnByDataSource))] public bool autoGenerateColumnsByDataSource { get @@ -61,23 +107,24 @@ namespace ElementUI if (!value && bindingOptions != null) { columns = bindingOptions.Columns.Select(i => - new columnSetting() + new ColumnSetting() { dataColumnName = i.ColumnName, - label = i.ColumnName + label = i.ColumnName, + Owner = bindingOptions.Columns }).OfType().ToList(); } } } } - [DisplayName("手动配置表格列...")] - [ObjectListProperty(DefaultName = "表格列", ItemType = typeof(columnSetting), IndentLevel = 1)] + [SRDisplayName(nameof(Resources.TableCellType_GenerateColumnManually))] + [SRObjectListProperty(DefaultName = nameof(Resources.TableCellType_TableColumn), ItemType = typeof(ColumnSetting), IndentLevel = 1)] public List columns { get; set; } = new List(); [Browsable(false)] [SaveJsonIgnore] - public IEnumerable bindingColumns { get; set; } + public IEnumerable bindingColumns { get; set; } private string GetDefaultFormat(ForguncyTableColumnType columnType) { @@ -86,47 +133,76 @@ namespace ElementUI case ForguncyTableColumnType.Time: return "HH:mm"; case ForguncyTableColumnType.DateTime: - return "yyyy\"年\"m\"月\"d\"日\""; + return Resources.TableCellType_DateTimeFormat; default: return null; } } - [DisplayName("表格的尺寸")] + [SRDisplayName(nameof(Resources.TableCellType_ShowActionButtons))] + [BoolProperty] + [DefaultValue(false)] + public bool showActionButtons { get; set; } = false; - [ComboProperty(ValueList = "big|medium|small|mini", DisplayList = "大|中|小|迷你")] - public string size { get; set; } = "big"; + [SRObjectListProperty(DefaultName = nameof(Resources.TableCellType_Button), ItemType = typeof(ActionButton), IndentLevel = 1)] + [SRDisplayName(nameof(Resources.TableCellType_ConfigActionButtons))] + public List actionButtons { get; set; } = new List(); - [DisplayName("空数据时显示的文本内容")] - public string emptyText { get; set; } = "暂无数据"; + [IntProperty(Min = 0, AllowNull = true)] + [DefaultValue(null)] + [SRDisplayName(nameof(Resources.TableCellType_OperationColumnWidth))] + public int? operationColumnWidth { get; set; } - [CategoryHeader("控制选项")] - [DisplayName("列的宽度是否自撑开")] - public bool fit { get; set; } = true; - [DisplayName("显示表头")] + [SRDisplayName(nameof(Resources.TableCellType_ShowSummary))] + [BoolProperty] + [DefaultValue(false)] + public bool showSummary { get; set; } = false; + + [SRDisplayName(nameof(Resources.TableCellType_SummaryText))] + public string sumText { get; set; } = Resources.TableCellType_Summary; + + [SRDisplayName(nameof(Resources.TableCellType_tableSize))] + [SRComboProperty(ValueList = "large|default|small", DisplayList = nameof(Resources.TableCellType_tableSizeDisplayList))] + public string size { get; set; } = "default"; + + [Browsable(false)] + public string emptyText { get; set; } = Resources.TableCellType_NoData; + + [SRCategoryHeader(nameof(Resources.Category_Options))] + [SRDisplayName(nameof(Resources.TableCellType_ShowHeader))] + [DefaultValue(true)] public bool showHeader { get; set; } = true; - [DisplayName("高亮当前行")] - public bool highlightCurrentRow { get; set; } - [DisplayName("在表尾显示合计行")] - public bool showSummary { get; set; } - [DisplayName("合计行第一列的文本")] - public string sumText { get; set; } = "合计"; - [DisplayName("斑马纹")] - public bool stripe { get; set; } = true; - [DisplayName("带有纵向边框")] + + [SRDisplayName(nameof(Resources.TableCellType_ShowIndexColumn))] + [DefaultValue(false)] + public bool showIndexColumn { get; set; } = false; + + [SRDisplayName(nameof(Resources.TableCellType_ShowSelectColumn))] + [DefaultValue(false)] + public bool showSelectColumn { get; set; } = false; + + [SRDisplayName(nameof(Resources.TableCellType_ColumnAutoSize))] + [DefaultValue(true)] + public bool fit { get; set; } = true; + + [SRDisplayName(nameof(Resources.TableCellType_Border))] + [DefaultValue(true)] public bool border { get; set; } = true; - [DisplayName("显示行号")] - public bool showIndexColumn { get; set; } - [DisplayName("显示选择列")] - public bool showSelectColumn { get; set; } - [DisplayName("显示操作按钮")] - public bool showActionButtons { get; set; } - [ObjectListProperty(DefaultName = "按钮", ItemType = typeof(actionButton), IndentLevel = 1)] - [DisplayName("配置操作按钮...")] - public List actionButtons { get; set; } = new List(); + + [SRDisplayName(nameof(Resources.TableCellType_Stripe))] + [DefaultValue(true)] + public bool stripe { get; set; } = true; + + [SRDisplayName(nameof(Resources.TableCellType_HighlightCurrentRow))] + [DefaultValue(false)] + public bool highlightCurrentRow { get; set; } = false; + + [Browsable(false)] + [SaveJsonIgnore] + public string operationColumnName { get; set; } = Resources.TableCellType_Operations; public override bool GetDesignerPropertyVisible(string propertyName) { - if (propertyName == nameof(actionButtons)) + if (propertyName == nameof(actionButtons) || propertyName == nameof(operationColumnWidth)) { return showActionButtons; } @@ -141,9 +217,26 @@ namespace ElementUI return base.GetDesignerPropertyVisible(propertyName); } + public override bool GetRunTimeMethodVisible(string name) + { + if (name == nameof(SetCurrentRow)) + { + return highlightCurrentRow; + } + if (name == nameof(ClearSelection) || name == nameof(GetSelectedRow)) + { + return showSelectColumn; + } + if (name == nameof(SetJsonDataSource)) + { + return bindingOptions == null; + } + return base.GetRunTimeMethodVisible(name); + } + public override string ToString() { - return "表格"; + return Resources.TableCellType_DisplayName; } public void PostGenerate(IBuilderContextBase builderContext) @@ -153,7 +246,7 @@ namespace ElementUI return; } - var columns = new List(); + var columnSettings = new List(); if (this.bindingOptions?.TableName != null) { var tables = new Dictionary(); @@ -164,57 +257,137 @@ namespace ElementUI } foreach (var item in this.bindingOptions.Columns) { - var columnSetting = new columnSetting(); + var columnSetting = new ColumnSetting(); columnSetting.label = item.ColumnName; columnSetting.dataColumnName = item.ColumnName; - if (item.BindingInfo != null) + if (item.BindingInfo != null && tables.TryGetValue(item.BindingInfo.GetLastTableName(), out var tableInfo)) { - if (tables.TryGetValue(item.BindingInfo.GetLastTableName(), out var tableInfo)) + var column = tableInfo.Columns.FirstOrDefault(i => i.ColumnName == item.BindingInfo.GetLastColumnName()); + if (column != null) { - var column = tableInfo.Columns.FirstOrDefault(i => i.ColumnName == item.BindingInfo.GetLastColumnName()); - if (column != null) - { - columnSetting.formatStr = GetDefaultFormat(column.ColumnType); - } + columnSetting.formatStr = GetDefaultFormat(column.ColumnType); } } - columns.Add(columnSetting); + columnSettings.Add(columnSetting); + } + } + this.bindingColumns = columnSettings; + } + + [RunTimeMethod] + [SRDisplayName(nameof(Resources.TableCellType_SetJsonDataSource))] + [SRDescription(nameof(Resources.TableCellType_SetJsonDataSource_Description))] + public void SetJsonDataSource([SRItemDisplayName(nameof(Resources.TableCellType_JsonData))] string dataSource) + { + // + } + + [RunTimeMethod] + [SRDisplayName(nameof(Resources.TableCellType_ClearSelection))] + public void ClearSelection() + { + // + } + + [RunTimeMethod] + [SRDisplayName(nameof(Resources.TableCellType_SetCurrentRow))] + public void SetCurrentRow([SRItemDisplayName(nameof(Resources.TableCellType_RowIndex))] int rowIndex) + { + // + } + + [RunTimeMethod] + [SRDisplayName(nameof(Resources.TableCellType_GetSelectedRow))] + public GetSelectedRowResult GetSelectedRow() + { + return null; + } + [RunTimeMethod] + [SRDisplayName(nameof(Resources.TableCellType_ResetTable))] + public void ResetTable( + [BoolProperty][SRItemDisplayName(nameof(Resources.TableCellType_ClearSort))] bool clearSort = true, + [BoolProperty][SRItemDisplayName(nameof(Resources.TableCellType_ClearFilter))] bool clearFilter = true + ) + { + // + } + } + + public class GetSelectedRowResult + { + [SRDisplayName(nameof(Resources.TableCellType_SelectedRow))] + public string SelectedRow { get; set; } + } + + public class ColumnSettingDesigner : ObjectDesigner + { + public override EditorSetting GetEditorSetting(PropertyDescriptor property, IBuilderContextBase contextBase) + { + if (property.Name == nameof(ColumnSetting.dataColumnName)) + { + var columnSetting = Obj as ColumnSetting; + List source = new List(); + if (columnSetting.Owner != null) + { + source.AddRange(columnSetting.Owner.Select(x => x.ColumnName)); } + return new ComboEditorSetting(source) { IsReadOnly = false }; } - this.bindingColumns = columns; + return base.GetEditorSetting(property, contextBase); } } - sealed public class columnSetting : INamedObject + [Designer("ElementUI.ColumnSettingDesigner, ElementUI")] + sealed public class ColumnSetting : INamedObject, ICloneable { - public columnSetting() + public ColumnSetting() { key = Guid.NewGuid().ToString(); } - [DisplayName("列名")] + + [Browsable(false)] + [SaveJsonIgnore] + public IEnumerable Owner { get; set; } + + [SRDisplayName(nameof(Resources.TableCellType_ColumnName))] public string label { get; set; } - [DisplayName("绑定数据源的列名")] + + [SRDisplayName(nameof(Resources.TableCellType_ColumnNameFromDataSource))] public string dataColumnName { get; set; } - [DisplayName("列的宽度")] - public string width { get; set; } - [DisplayName("列的最小宽度")] - public string minWidth { get; set; } - [Description("需要在表格上设置‘带有纵向边框’属性为真时起作用")] - [DisplayName("格式字符串")] - [ComboProperty(ValueList = "yyyy\"年\"m\"月\"d\"日\"|yyyy/m/d|HH:mm", IsSelectOnly = false)] + + [SRDisplayName(nameof(Resources.TableCellType_ColumnFormatString))] + [SRComboProperty(ValueList = nameof(Resources.TableCellType_ColumnFormatStringValueList), IsSelectOnly = false)] public string formatStr { get; set; } - [ComboProperty(ValueList = "left|center|right", DisplayList = "左|中|右")] - [DisplayName("对齐方式")] + + [DefaultValue(null)] + [IntProperty(Min = 0, AllowNull = true)] + [SRDisplayName(nameof(Resources.TableCellType_ColumnWidth))] + public int? width { get; set; } + + [DefaultValue(null)] + [IntProperty(Min = 0, AllowNull = true)] + [SRDisplayName(nameof(Resources.TableCellType_ColumnMinWidth))] + public int? minWidth { get; set; } + + [SRComboProperty(ValueList = "left|center|right", DisplayList = nameof(Resources.TableCellType_ColumnAlignDisplayList))] + [SRDisplayName(nameof(Resources.TableCellType_ColumnAlign))] public string align { get; set; } = "left"; - [DisplayName("表头对齐方式")] - [ComboProperty(ValueList = "left|center|right", DisplayList = "左|中|右")] + + [SRDisplayName(nameof(Resources.TableCellType_ColumnHeaderAlign))] + [SRComboProperty(ValueList = "left|center|right", DisplayList = nameof(Resources.TableCellType_ColumnAlignDisplayList))] public string headerAlign { get; set; } = "center"; - [DisplayName("可以通过拖动改变宽度")] + + [SRDisplayName(nameof(Resources.TableCellType_ColumnResizable))] + [DefaultValue(true)] public bool resizable { get; set; } = true; - [DisplayName("当内容过长被隐藏时显示 tooltip")] + + [SRDisplayName(nameof(Resources.TableCellType_ShowColumnOverflowTooltip))] + [DefaultValue(false)] public bool showOverflowTooltip { get; set; } = false; + [Browsable(false)] public string key { get; set; } + string INamedObject.Name { get @@ -226,48 +399,98 @@ namespace ElementUI label = value; } } + public object Clone() + { + return new ColumnSetting() + { + Owner = Owner, + label = label, + resizable = resizable, + key = key, + align = align, + headerAlign = headerAlign, + minWidth = minWidth, + formatStr = formatStr, + showOverflowTooltip = showOverflowTooltip, + dataColumnName = dataColumnName, + width = width + }; + } } public enum TableMode { - [Description("水平")] + [SRDescription(nameof(Resources.TableCellType_HorizontalMode))] horizontal, - [Description("垂直")] + [SRDescription(nameof(Resources.TableCellType_VerticalMode))] vertical } - public class actionButton : ObjectPropertyBase, INamedObject + public class ActionButton : ObjectPropertyBase, INamedObject { + [SRDisplayName(nameof(Resources.TableCellType_ActionButtonType))] + [SRComboProperty(ValueList = "button|link|icon", DisplayList = nameof(Resources.TableCellType_ActionButtonTypeDisplayList))] + public string type { get; set; } + [Required] - [DisplayName("按钮文字")] + [SRDisplayName(nameof(Resources.TableCellType_ActionButtonText))] public string Name { get; set; } - [DisplayName("图标")] - public string icon { get; set; } + private object _icon; + [IconProperty] + [SRDisplayName(nameof(Resources.TableCellType_ActionButtonIcon))] + public object icon + { + get + { + return _icon; + } + set + { + if (value is ImageValue || value is null) + { + _icon = value; + } + } + } + + [IntProperty(Min = 1)] + [SRDisplayName(nameof(Resources.TableCellType_ActionButtonIconWidth))] + public int iconWidth { get; set; } - [ComboProperty(ValueList = "default|primary|success|warning|danger|info|text", DisplayList = "默认|主要|成功|警告|危险|提示|链接")] - [DisplayName("按钮样式")] + [IntProperty(Min = 1)] + [SRDisplayName(nameof(Resources.TableCellType_ActionButtonIconHeight))] + public int iconHeight { get; set; } + + [SRComboProperty(ValueList = "default|primary|success|warning|danger|info", DisplayList = nameof(Resources.TableCellType_ActionButtonStyleDisplayList))] + [SRDisplayName(nameof(Resources.TableCellType_ActionButtonStyle))] public string styleType { get; set; } - [ComboProperty(ValueList = "default|round|circle", DisplayList = "默认|圆角|圆形")] - [DisplayName("按钮形状")] - public string shape { get; set; } = "default"; + [SRComboProperty(ValueList = "default|round|circle", DisplayList = nameof(Resources.TableCellType_ActionButtonShapeDisplayList))] + [SRDisplayName(nameof(Resources.TableCellType_ActionButtonShape))] + public string shape { get; set; } - [DisplayName("命令...")] - [CustomCommandObject(InitParamProperties = "dataRow", InitParamValues = "行数据")] + [SRDisplayName(nameof(Resources.TableCellType_ActionButtonCommand))] + [SRCustomCommandObject(InitParamProperties = "dataRow", InitParamValues = nameof(Resources.TableCellType_RowData))] public object Commands { get; set; } - [DisplayName("浅色背景")] - public bool plain { get; set; } - - [DisplayName("只显示图标")] - public bool iconOnly { get; set; } = false; - public override bool GetDesignerPropertyVisible(string propertyName) { - if (propertyName == nameof(iconOnly)) + if (propertyName == nameof(icon)) + { + return type != "link"; + } + if (propertyName == nameof(styleType)) + { + return type != "icon"; + } + if (propertyName == nameof(shape)) + { + return type == "button"; + } + if (propertyName == nameof(iconWidth) || propertyName == nameof(iconHeight)) { - return !string.IsNullOrEmpty(this.icon); + return type == "icon"; } return base.GetDesignerPropertyVisible(propertyName); } diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index 0e4457f..ced0b09 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -1203,6 +1203,15 @@ namespace ElementUI.Properties { } } + /// + /// Looks up a localized string similar to None. + /// + public static string ElementCellType_None { + get { + return ResourceManager.GetString("ElementCellType_None", resourceCulture); + } + } + /// /// Looks up a localized string similar to ElementPlus. /// @@ -2131,6 +2140,15 @@ namespace ElementUI.Properties { } } + /// + /// Looks up a localized string similar to Element Table. + /// + public static string PaginationCellType_ElementTable { + get { + return ResourceManager.GetString("PaginationCellType_ElementTable", resourceCulture); + } + } + /// /// Looks up a localized string similar to ExecuteCommand. /// @@ -2284,6 +2302,15 @@ namespace ElementUI.Properties { } } + /// + /// Looks up a localized string similar to Select Element Table. + /// + public static string PaginationCellType_SelectElementTable { + get { + return ResourceManager.GetString("PaginationCellType_SelectElementTable", resourceCulture); + } + } + /// /// Looks up a localized string similar to SetCurrentPageIndex. /// @@ -4142,6 +4169,624 @@ namespace ElementUI.Properties { } } + /// + /// Looks up a localized string similar to Edit Command. + /// + public static string TableCellType_ActionButtonCommand { + get { + return ResourceManager.GetString("TableCellType_ActionButtonCommand", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Icon. + /// + public static string TableCellType_ActionButtonIcon { + get { + return ResourceManager.GetString("TableCellType_ActionButtonIcon", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Icon Height. + /// + public static string TableCellType_ActionButtonIconHeight { + get { + return ResourceManager.GetString("TableCellType_ActionButtonIconHeight", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Icon Width. + /// + public static string TableCellType_ActionButtonIconWidth { + get { + return ResourceManager.GetString("TableCellType_ActionButtonIconWidth", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shape. + /// + public static string TableCellType_ActionButtonShape { + get { + return ResourceManager.GetString("TableCellType_ActionButtonShape", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to default|round|circle. + /// + public static string TableCellType_ActionButtonShapeDisplayList { + get { + return ResourceManager.GetString("TableCellType_ActionButtonShapeDisplayList", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Style. + /// + public static string TableCellType_ActionButtonStyle { + get { + return ResourceManager.GetString("TableCellType_ActionButtonStyle", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to default|primary|success|warning|danger|information. + /// + public static string TableCellType_ActionButtonStyleDisplayList { + get { + return ResourceManager.GetString("TableCellType_ActionButtonStyleDisplayList", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Text. + /// + public static string TableCellType_ActionButtonText { + get { + return ResourceManager.GetString("TableCellType_ActionButtonText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type. + /// + public static string TableCellType_ActionButtonType { + get { + return ResourceManager.GetString("TableCellType_ActionButtonType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Button|Link|Icon. + /// + public static string TableCellType_ActionButtonTypeDisplayList { + get { + return ResourceManager.GetString("TableCellType_ActionButtonTypeDisplayList", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Generate Columns By Data Source Automatically. + /// + public static string TableCellType_AutoGenerateColumnByDataSource { + get { + return ResourceManager.GetString("TableCellType_AutoGenerateColumnByDataSource", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Vertical Border. + /// + public static string TableCellType_Border { + get { + return ResourceManager.GetString("TableCellType_Border", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Button. + /// + public static string TableCellType_Button { + get { + return ResourceManager.GetString("TableCellType_Button", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Clear Filter. + /// + public static string TableCellType_ClearFilter { + get { + return ResourceManager.GetString("TableCellType_ClearFilter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Clear Selection. + /// + public static string TableCellType_ClearSelection { + get { + return ResourceManager.GetString("TableCellType_ClearSelection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Clear Sort. + /// + public static string TableCellType_ClearSort { + get { + return ResourceManager.GetString("TableCellType_ClearSort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Column Align. + /// + public static string TableCellType_ColumnAlign { + get { + return ResourceManager.GetString("TableCellType_ColumnAlign", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to left|center|right. + /// + public static string TableCellType_ColumnAlignDisplayList { + get { + return ResourceManager.GetString("TableCellType_ColumnAlignDisplayList", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Fit Column Width Automatically. + /// + public static string TableCellType_ColumnAutoSize { + get { + return ResourceManager.GetString("TableCellType_ColumnAutoSize", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Format String. + /// + public static string TableCellType_ColumnFormatString { + get { + return ResourceManager.GetString("TableCellType_ColumnFormatString", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to yyyy/mm/dd|HH:mm. + /// + public static string TableCellType_ColumnFormatStringValueList { + get { + return ResourceManager.GetString("TableCellType_ColumnFormatStringValueList", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Column Header Align. + /// + public static string TableCellType_ColumnHeaderAlign { + get { + return ResourceManager.GetString("TableCellType_ColumnHeaderAlign", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Column Min Width. + /// + public static string TableCellType_ColumnMinWidth { + get { + return ResourceManager.GetString("TableCellType_ColumnMinWidth", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Column Name. + /// + public static string TableCellType_ColumnName { + get { + return ResourceManager.GetString("TableCellType_ColumnName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Column Name From Data Source. + /// + public static string TableCellType_ColumnNameFromDataSource { + get { + return ResourceManager.GetString("TableCellType_ColumnNameFromDataSource", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Column Resizable. + /// + public static string TableCellType_ColumnResizable { + get { + return ResourceManager.GetString("TableCellType_ColumnResizable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Column Width. + /// + public static string TableCellType_ColumnWidth { + get { + return ResourceManager.GetString("TableCellType_ColumnWidth", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Config Operation Buttons. + /// + public static string TableCellType_ConfigActionButtons { + get { + return ResourceManager.GetString("TableCellType_ConfigActionButtons", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Current Row Changed Command. + /// + public static string TableCellType_CurrentRowChangedCommand { + get { + return ResourceManager.GetString("TableCellType_CurrentRowChangedCommand", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Data Source. + /// + public static string TableCellType_DataSource { + get { + return ResourceManager.GetString("TableCellType_DataSource", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to yyyy/mm/dd. + /// + public static string TableCellType_DateTimeFormat { + get { + return ResourceManager.GetString("TableCellType_DateTimeFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Delete. + /// + public static string TableCellType_Delete { + get { + return ResourceManager.GetString("TableCellType_Delete", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Table. + /// + public static string TableCellType_DisplayName { + get { + return ResourceManager.GetString("TableCellType_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Edit. + /// + public static string TableCellType_Edit { + get { + return ResourceManager.GetString("TableCellType_Edit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Empty Text. + /// + public static string TableCellType_EmptyText { + get { + return ResourceManager.GetString("TableCellType_EmptyText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Config Columns Manually. + /// + public static string TableCellType_GenerateColumnManually { + get { + return ResourceManager.GetString("TableCellType_GenerateColumnManually", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Get Selected Row. + /// + public static string TableCellType_GetSelectedRow { + get { + return ResourceManager.GetString("TableCellType_GetSelectedRow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Highlight Current Row. + /// + public static string TableCellType_HighlightCurrentRow { + get { + return ResourceManager.GetString("TableCellType_HighlightCurrentRow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Horizontal. + /// + public static string TableCellType_HorizontalMode { + get { + return ResourceManager.GetString("TableCellType_HorizontalMode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to JSON Data. + /// + public static string TableCellType_JsonData { + get { + return ResourceManager.GetString("TableCellType_JsonData", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No Data. + /// + public static string TableCellType_NoData { + get { + return ResourceManager.GetString("TableCellType_NoData", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Operation Column Width. + /// + public static string TableCellType_OperationColumnWidth { + get { + return ResourceManager.GetString("TableCellType_OperationColumnWidth", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Operations. + /// + public static string TableCellType_Operations { + get { + return ResourceManager.GetString("TableCellType_Operations", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reset Table. + /// + public static string TableCellType_ResetTable { + get { + return ResourceManager.GetString("TableCellType_ResetTable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Row Click Command. + /// + public static string TableCellType_RowClickCommand { + get { + return ResourceManager.GetString("TableCellType_RowClickCommand", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Row Data. + /// + public static string TableCellType_RowData { + get { + return ResourceManager.GetString("TableCellType_RowData", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Row Double-click Command. + /// + public static string TableCellType_RowDoubleClickCommand { + get { + return ResourceManager.GetString("TableCellType_RowDoubleClickCommand", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Row Index. + /// + public static string TableCellType_RowIndex { + get { + return ResourceManager.GetString("TableCellType_RowIndex", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Selected Row. + /// + public static string TableCellType_SelectedRow { + get { + return ResourceManager.GetString("TableCellType_SelectedRow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Set Current Row. + /// + public static string TableCellType_SetCurrentRow { + get { + return ResourceManager.GetString("TableCellType_SetCurrentRow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Set JSON Data Source. + /// + public static string TableCellType_SetJsonDataSource { + get { + return ResourceManager.GetString("TableCellType_SetJsonDataSource", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Using a dynamic JSON string array as the data source for cells, json format example is as follows + ///[ + /// { "ID": 1, "Column": "Column content" }, + /// { "ID": 2, "Column": "Column content" }, + /// { "ID": 3, "Column": "Column content" } + ///] + ///Usually, the data source can be obtained from a web service through an HTTP request command, or it can be obtained through a server-side command. + /// + public static string TableCellType_SetJsonDataSource_Description { + get { + return ResourceManager.GetString("TableCellType_SetJsonDataSource_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show Operation Buttons. + /// + public static string TableCellType_ShowActionButtons { + get { + return ResourceManager.GetString("TableCellType_ShowActionButtons", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show Overflow Tooltip. + /// + public static string TableCellType_ShowColumnOverflowTooltip { + get { + return ResourceManager.GetString("TableCellType_ShowColumnOverflowTooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show Table Header. + /// + public static string TableCellType_ShowHeader { + get { + return ResourceManager.GetString("TableCellType_ShowHeader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show Index Column. + /// + public static string TableCellType_ShowIndexColumn { + get { + return ResourceManager.GetString("TableCellType_ShowIndexColumn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show Select Column. + /// + public static string TableCellType_ShowSelectColumn { + get { + return ResourceManager.GetString("TableCellType_ShowSelectColumn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show Summary At Footer. + /// + public static string TableCellType_ShowSummary { + get { + return ResourceManager.GetString("TableCellType_ShowSummary", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stripe. + /// + public static string TableCellType_Stripe { + get { + return ResourceManager.GetString("TableCellType_Stripe", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Summary. + /// + public static string TableCellType_Summary { + get { + return ResourceManager.GetString("TableCellType_Summary", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Summary Text. + /// + public static string TableCellType_SummaryText { + get { + return ResourceManager.GetString("TableCellType_SummaryText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Table Column. + /// + public static string TableCellType_TableColumn { + get { + return ResourceManager.GetString("TableCellType_TableColumn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Element Table Name. + /// + public static string TableCellType_TableName { + get { + return ResourceManager.GetString("TableCellType_TableName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Element table name '{0}' is repeated. + /// + public static string TableCellType_TableNameDuplicateError { + get { + return ResourceManager.GetString("TableCellType_TableNameDuplicateError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Table Size. + /// + public static string TableCellType_tableSize { + get { + return ResourceManager.GetString("TableCellType_tableSize", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to large|medium|small. + /// + public static string TableCellType_tableSizeDisplayList { + get { + return ResourceManager.GetString("TableCellType_tableSizeDisplayList", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Vertical. + /// + public static string TableCellType_VerticalMode { + get { + return ResourceManager.GetString("TableCellType_VerticalMode", resourceCulture); + } + } + /// /// Looks up a localized string similar to Tag. /// diff --git a/Properties/Resources.resx b/Properties/Resources.resx index 953de92..ec80a32 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -491,6 +491,12 @@ Value + + + Select Element Table + + + Element Table Type @@ -2081,5 +2087,218 @@ Typically, a JSON data source can be obtained from a web service via an HTTP req At least select on item + + + Edit + + + Delete + + + Row Click Command + + + Row Double-click Command + + + Current Row Changed Command + + + Data Source + + + Generate Columns By Data Source Automatically + + + Config Columns Manually + + + Table Column + + + yyyy/mm/dd + + + Row Data + + + Table Size + + + large|medium|small + + + Empty Text + + + No Data + + + Fit Column Width Automatically + + + Show Table Header + + + Highlight Current Row + + + Stripe + + + Vertical Border + + + Show Index Column + + + Show Select Column + + + Show Operation Buttons + + + Button + + + Config Operation Buttons + + + Show Summary At Footer + + + Summary Text + + + Summary + + + Table + + + Column Name + + + Column Name From Data Source + + + Column Width + + + Column Min Width + + + Format String + + + yyyy/mm/dd|HH:mm + + + left|center|right + + + Column Align + + + Column Header Align + + + Column Resizable + + + Show Overflow Tooltip + + + Horizontal + + + Vertical + + + Type + + + Button|Link|Icon + + + Text + + + Icon + + + Icon Width + + + Icon Height + + + Style + + + default|primary|success|warning|danger|information + + + Shape + + + default|round|circle + + + Edit Command + + + Operations + + + Element Table Name + + + Element table name '{0}' is repeated + + + Operation Column Width + + + None + + + Clear Selection + + + Set Current Row + + + Get Selected Row + + + Reset Table + + + Clear Sort + + + Clear Filter + + + Selected Row + + + Row Index + + + Set JSON Data Source + + + Using a dynamic JSON string array as the data source for cells, json format example is as follows +[ + { "ID": 1, "Column": "Column content" }, + { "ID": 2, "Column": "Column content" }, + { "ID": 3, "Column": "Column content" } +] +Usually, the data source can be obtained from a web service through an HTTP request command, or it can be obtained through a server-side command + + + JSON Data \ No newline at end of file diff --git a/Properties/Resources.zh-CN.resx b/Properties/Resources.zh-CN.resx index 18a4a2a..459cb3c 100644 --- a/Properties/Resources.zh-CN.resx +++ b/Properties/Resources.zh-CN.resx @@ -491,6 +491,12 @@ 每页显示行数 + + + 选择Element表格 + + + Element表格 显示类型 @@ -2160,5 +2166,218 @@ rgb或rgba格式,如 rgb(0,10,100) 或 rgba(0,10,100,0.5) 至少选择一项 + + + 编辑 + + + 删除 + + + 行点击命令 + + + 行双击命令 + + + 编辑当前行变更命令 + + + 数据源 + + + 自动根据数据源生成列 + + + 手动配置表格列 + + + 表格列 + + + yyyy"年"m"月"d"日" + + + 行数据 + + + 表格的尺寸 + + + 大|中|小 + + + 空数据时显示的文本内容 + + + 暂无数据 + + + 列的宽度是否自撑开 + + + 显示表头 + + + 高亮当前行 + + + 斑马纹 + + + 带有纵向边框 + + + 显示行号 + + + 显示选择列 + + + 显示操作按钮 + + + 按钮 + + + 配置操作按钮 + + + 在表尾显示合计行 + + + 合计行第一列的文本 + + + 合计 + + + EL-表格 + + + 列名 + + + 绑定字段 + + + 列的宽度 + + + 列的最小宽度 + + + 格式字符串 + + + yyyy年m月d日|yyyy/mm/dd|HH:mm + + + 左|中|右 + + + 对齐方式 + + + 表头对齐方式 + + + 可以通过拖动改变宽度 + + + 当内容过长被隐藏时显示 tooltip + + + 水平 + + + 垂直 + + + 类型 + + + 按钮|链接|图片 + + + 文本 + + + 图标 + + + 图标宽度 + + + 图标高度 + + + 样式 + + + 默认|主要|成功|警告|危险|提示 + + + 形状 + + + 默认|圆角|圆形 + + + 编辑命令 + + + 操作 + + + 表格名 + + + Element表格名“{0}”重复 + + + 操作列宽度 + + + + + + 清空用户选择 + + + 设置当前行 + + + 获取选择行 + + + 重载表格 + + + 清空排序 + + + 清空过滤 + + + 选择行 + + + 行号 + + + 设置JSON数据源 + + + 使用动态JSON字符串数组作为单元格的数据源,JSON格式示例如下 +[ + { "ID": 1, "Column": "Column content" }, + { "ID": 2, "Column": "Column content" }, + { "ID": 3, "Column": "Column content" } +] +通常情况下,数据源可以通过HTTP请求命令从Web服务获取,也可以通过服务端命令获取 + + + JSON数据 \ No newline at end of file diff --git a/Resources/CellTypes/Pagination.ts b/Resources/CellTypes/Pagination.ts index 509b33d..e39bfee 100644 --- a/Resources/CellTypes/Pagination.ts +++ b/Resources/CellTypes/Pagination.ts @@ -12,6 +12,8 @@ namespace ElementCellTypes { small: boolean; background: boolean; hideOnSinglePage: boolean; + ElementTableName?: string; + AttachElementTable: boolean; } interface PageLayout { @@ -24,8 +26,10 @@ namespace ElementCellTypes { CommandList: object[]; valueParamName: string; } + export class PaginationCellType extends ElementCellTypeBase { _listview: Forguncy.ListView; + _elementTable: TableCellType; _pagingChangedCallBack: Function; public createContent() { const cellType = this.cellType; @@ -40,13 +44,17 @@ namespace ElementCellTypes { const self = this; this.addCustomClass("el-pagination-custom"); const cellType = this.cellType; - if (cellType.ListviewName) { + if (cellType.AttachElementTable) { + this._elementTable = PaginationCellType.getElementTableCellTypeByName(cellType.ElementTableName, this.runTimePageName); + } else if (cellType.ListviewName) { this._listview = Forguncy.Page.getListViews(true) - .filter(i => i.getName() === cellType.ListviewName && i.getRunTimePageName() === this.runTimePageName)[0]; + .filter(i => i.getName() === cellType.ListviewName && i.getRunTimePageName() === this.runTimePageName)[0]; } const listview = this._listview; + const elementTable = this._elementTable; const option = { - template: `
+ template: ` +
cell.cellType instanceof TableCellType); + return allElTableCells.find(({ cellType }) => cellType.cellType.ElTableName === elTableName)?.cellType; + } + + public queryElTable() { + this.queryElTableTotalRecords().then(total => { + this.vue.total = total; + this.queryElTableByPager(); + }); + } + + public queryElTableByPager() { + const tableCellType = this._elementTable.CellElement.CellType as any; + const option = { + top: this.vue.pageSize, + offset: this.vue.pageSize * (this.vue.currentPage - 1), + pagerMode: true + }; + SupportDataSourceCellType.refreshDataWithOption(this._elementTable, tableCellType.bindingOptions, dataSource => this._elementTable.setDataSource(dataSource), option); + } + + public queryElTableTotalRecords(): Promise { + const tableCellType = this._elementTable.CellElement.CellType as any; + return new Promise(resolve => { + const option = { queryValueType: Forguncy.Plugin.TableValueType.Count }; + SupportDataSourceCellType.refreshDataWithOption(this._elementTable, tableCellType.bindingOptions, total => { + resolve(total); + }, option); + }); + } + // RunTimeMethods SetPageSize(pageSize) { pageSize = Number(pageSize); diff --git a/Resources/CellTypes/Table.ts b/Resources/CellTypes/Table.ts index 703ec5b..ebfff45 100644 --- a/Resources/CellTypes/Table.ts +++ b/Resources/CellTypes/Table.ts @@ -1,170 +1,290 @@ -/// -namespace ElementCellTypes { - interface ITableCellTypeParam { - RowClickCommand: Forguncy.Plugin.ICustomCommandObject; - RowDoubleClickCommand: Forguncy.Plugin.ICustomCommandObject; - bindingOptions: any; - bindingColumns: IColumn[]; - autoGenerateColumnsByDataSource: boolean; - columns: IColumn[]; - stripe: boolean; - border: boolean; - size: string; - fit: boolean; - showHeader: boolean; - highlightCurrentRow: boolean; - emptyText: string; - showSummary: boolean; - sumText: string; - showIndexColumn: boolean; - showSelectColumn: boolean; - showActionButtons: boolean; - actionButtons: IActionButton[]; - - } - interface IActionButton { +/// +namespace ElementCellTypes { + interface ITableCellTypeParam { + ElTableName: string; + RowClickCommand: Forguncy.Plugin.ICustomCommandObject; + RowDoubleClickCommand: Forguncy.Plugin.ICustomCommandObject; + CurrentRowChangedCommand: Forguncy.Plugin.ICustomCommandObject; + bindingOptions: any; + bindingColumns: IColumn[]; + autoGenerateColumnsByDataSource: boolean; + columns: IColumn[]; + stripe: boolean; + border: boolean; + size: string; + fit: boolean; + showHeader: boolean; + highlightCurrentRow: boolean; + emptyText: string; + showSummary: boolean; + sumText: string; + showIndexColumn: boolean; + showSelectColumn: boolean; + showActionButtons: boolean; + actionButtons: IActionButton[]; + operationColumnName: string; + operationColumnWidth: number; + } + interface IActionButton { + type: string; Name: string; - icon: string; + icon: Icon; + isIconSvg: boolean; styleType: string; shape: string; Commands: Forguncy.Plugin.ICustomCommandObject; - plain: boolean; - iconOnly: boolean; - } - interface IColumn { - key: string; - dataColumnName: string; - label: string; - width: string; - minWidth: string; - freezeColumn: string; - resizable: boolean; - formatStr: string; - showOverflowTooltip: boolean; - align: string; - headerAlign: string; - } - - export class TableCellType extends ElementCellTypeBase { - public setDataSource(dataSource) { - return this.vue.setOptions(dataSource); - } - - public onPageLoaded(info: Forguncy.Plugin.CellTypeInfo) { - const self = this; - const cellType = this.CellElement.CellType; - const columnCache = {}; - if (cellType.autoGenerateColumnsByDataSource) { - cellType.columns = cellType.bindingColumns; - } - cellType.columns.forEach(c => columnCache[c.key] = c); - const option = { - el: "#" + this.uId, - template: ` - - - - - -`, - data() { - return { - tableData: undefined, - columns: cellType.columns, - border: cellType.border, - emptyText: cellType.emptyText, - fit: cellType.fit, - highlightCurrentRow: cellType.highlightCurrentRow, - showHeader: cellType.showHeader, - showIndexColumn: cellType.showIndexColumn, - showSelectColumn: cellType.showSelectColumn, - showActionButtons: cellType.showActionButtons, - actionButtons: cellType.actionButtons, - showSummary: cellType.showSummary, - size: cellType.size, - stripe: cellType.stripe, - sumText: cellType.sumText, - }; - }, - methods: { - setOptions(options) { - this.tableData = options; - }, - handleFormatter(row, column, cellValue, index) { - if (column.columnKey && columnCache[column.columnKey] && columnCache[column.columnKey]?.formatStr) { - const result = Forguncy.FormatHelper.format(columnCache[column.columnKey]?.formatStr, cellValue); - if (result) { - return result.text; - } - } - return cellValue; - }, - handleRowClick(row) { + iconWidth: number; + iconHeight: number; + } + interface IColumn { + key: string; + dataColumnName: string; + label: string; + width: string; + minWidth: string; + freezeColumn: string; + resizable: boolean; + formatStr: string; + showOverflowTooltip: boolean; + align: string; + headerAlign: string; + } + + export class TableCellType extends ElementCellTypeBase { + public setDataSource(dataSource) { + return this.vue.setOptions(dataSource); + } + + public onPageLoaded(info: Forguncy.Plugin.CellTypeInfo) { + const self = this; + const cellType = this.CellElement.CellType; + const columnCache = {}; + if (cellType.autoGenerateColumnsByDataSource) { + cellType.columns = cellType.bindingColumns; + } + cellType.columns.forEach(c => columnCache[c.key] = c); + const option = { + el: "#" + this.uId, + template: ` + + + + + +`, + data() { + return { + tableData: undefined, + columns: cellType.columns, + border: !!cellType.border, + emptyText: cellType.emptyText, + fit: !!cellType.fit, + highlightCurrentRow: !!cellType.highlightCurrentRow, + showHeader: !!cellType.showHeader, + showIndexColumn: !!cellType.showIndexColumn, + showSelectColumn: !!cellType.showSelectColumn, + showActionButtons: !!cellType.showActionButtons, + actionButtons: cellType.actionButtons, + showSummary: !!cellType.showSummary, + size: cellType.size, + stripe: !!cellType.stripe, + sumText: cellType.sumText, + operationColumnName: cellType.operationColumnName, + operationColumnWidth: cellType.operationColumnWidth ?? 200 + }; + }, + methods: { + setOptions(options) { + this.tableData = options; + }, + handleFormatter(row, column, cellValue, index) { + if (column.columnKey && columnCache[column.columnKey] && columnCache[column.columnKey]?.formatStr) { + const result = Forguncy.FormatHelper.format(columnCache[column.columnKey]?.formatStr, cellValue); + if (result) { + return result.text; + } + } + return cellValue; + }, + handleRowClick(row) { this.handleClick(row, cellType.RowClickCommand); - }, - handleActionClick(row, actionButton: IActionButton) { + }, + handleActionClick(row, actionButton: IActionButton) { const commands = actionButton.Commands; - const initParam = {}; - initParam[commands.ParamProperties["dataRow"]] = row; - self.executeCustomCommandObject(commands, initParam); - }, - handleDoubleRowClick(row) { + if (commands) { + const initParam = {}; + initParam[commands.ParamProperties["dataRow"]] = row; + self.executeCustomCommandObject(commands, initParam); + } + }, + handleDoubleRowClick(row) { this.handleClick(row, cellType.RowDoubleClickCommand, "doubleClick"); - }, + }, handleClick(row, commands: Forguncy.Plugin.ICustomCommandObject, eventType: string) { if (commands) { const initParam = {}; initParam[commands.ParamProperties["dataRow"]] = row; self.executeCustomCommandObject(commands, initParam, eventType); } - } - } - }; - this.createVueApp(option); - - SupportDataSourceCellType.refreshData(this, cellType.bindingOptions, dataSource => this.setDataSource(dataSource)); - super.onPageLoaded(info); - } - } -} - + }, + handleCurrentRowChange(currentRow) { + if (cellType.CurrentRowChangedCommand) { + const commands = cellType.CurrentRowChangedCommand; + const initParam = {}; + initParam[commands.ParamProperties["dataRow"]] = currentRow; + self.executeCustomCommandObject(commands, initParam); + } + }, + getOperateIconStyle(button: IActionButton) { + return { + cursor: "pointer", + margin: "0 10px", + verticalAlign: "middle", + width: button.iconWidth + 'px', + height: button.iconHeight + 'px' + }; + } + }, + created() { + this.actionButtons.forEach((button: IActionButton) => { + self.getIconComponent(button.icon, (icon, result: IconResult) => { + button.icon = icon; + button.isIconSvg = result.isSvg; + }); + }); + } + }; + this.createVueApp(option); + if (!this.IsElTablePaging()) { + SupportDataSourceCellType.refreshData(this, cellType.bindingOptions, dataSource => this.setDataSource(dataSource)); + } + + super.onPageLoaded(info); + } + + public IsElTablePaging(): boolean { + const tableCellType = this.CellElement.CellType; + if (this.isEmpty(tableCellType.ElTableName)) { + return false; + } + const allCells = Forguncy.ForguncyData.pageInfo.pageElementManager.cells.getAllCells([this.runTimePageName]); + const allElPagerCells = allCells?.filter(cell => cell.cellType instanceof PaginationCellType); + return allElPagerCells.some(({ cellType }) => cellType.cellType.ElementTableName === tableCellType.ElTableName); + } + + // RunTimeMethods + SetJsonDataSource(json: string) { + const cellType = this.CellElement.CellType; + const data = JSON.parse(this.evaluateFormula(json)); + if (Array.isArray(data) && data.length > 0 && cellType.autoGenerateColumnsByDataSource) { + const sample = data[0]; + if (this.isPlainObject(sample)) { + this.vue.columns = Object.keys(sample).map((columnName, index) => { + return { + key: columnName + index, + label: columnName, + dataColumnName: columnName, + headerAlign: "center", + resizable: true + }; + }); + } + } + this.setDataSource(data); + } + + ClearSelection() { + this.vue.$refs["elTable"].clearSelection(); + } + SetCurrentRow(rowIndex: string) { + if (this.isEmpty(rowIndex)) { + this.vue.$refs["elTable"].setCurrentRow(); + return; + } + const index = Number(this.evaluateFormula(rowIndex)); + if (!isNaN(index) && index > 0 && this.vue.tableData.length >= index) { + this.vue.$refs["elTable"].setCurrentRow(this.vue.tableData[index - 1]); + } + } + GetSelectedRow() { + return { + SelectedRow: this.vue.$refs["elTable"].getSelectionRows() + }; + } + ResetTable(clearSort: boolean, clearFilter: boolean) { + if (clearSort) { + this.vue.$refs["elTable"].clearSort(); + } + if (clearFilter) { + this.vue.$refs["elTable"].clearFilter(); + } + } + } +} + Forguncy.Plugin.CellTypeHelper.registerCellType("ElementUI.TableCellType, ElementUI", ElementCellTypes.TableCellType); \ No newline at end of file diff --git a/Resources/Declaration/forguncy.Internal.d.ts b/Resources/Declaration/forguncy.Internal.d.ts index e9612da..5020796 100644 --- a/Resources/Declaration/forguncy.Internal.d.ts +++ b/Resources/Declaration/forguncy.Internal.d.ts @@ -23,9 +23,22 @@ } class ForguncyData { + static pageInfo: PageInfo; static initListviewPaginationInfo(runTimePageName: string, listviewName: string, pageSize: number); } + class PageInfo { + pageElementManager: PageElementManager; + } + + class PageElementManager { + public cells: NormalCellCollection; + } + + class NormalCellCollection { + public getAllCells(runTimePageNames?: string[]): any[] + } + class ColorHelper { public static UpdateTint(baseColor: string, tint: number, alpha: number): string } diff --git a/Resources/Declaration/forguncy.Plugin.d.ts b/Resources/Declaration/forguncy.Plugin.d.ts index c48bd88..3e5dd34 100644 --- a/Resources/Declaration/forguncy.Plugin.d.ts +++ b/Resources/Declaration/forguncy.Plugin.d.ts @@ -466,6 +466,10 @@ declare namespace Forguncy.Plugin { * 最大查询结果行数。 */ top: number, + /** + * 跳过的记录数。 + * */ + offset?: number, /** * 查询条件。 */ @@ -477,7 +481,24 @@ declare namespace Forguncy.Plugin { /** * 是否去掉重复项。 */ - distinct?: boolean + distinct?: boolean, + /** + * 分页模式 + */ + pagerMode?: boolean, + /** + * 查询类型 + */ + queryValueType?: TableValueType + } + /** + * 查询类型 + */ + const enum TableValueType { + SingleValue = 0, + SingleRecord = 1, + Table = 2, + Count = 3 } /** * 条件关系。 diff --git a/WpfControls/DrawingObject/TableDrawingObject.xaml b/WpfControls/DrawingObject/TableDrawingObject.xaml new file mode 100644 index 0000000..d0cb2ac --- /dev/null +++ b/WpfControls/DrawingObject/TableDrawingObject.xaml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WpfControls/DrawingObject/TableDrawingObject.xaml.cs b/WpfControls/DrawingObject/TableDrawingObject.xaml.cs new file mode 100644 index 0000000..7134c81 --- /dev/null +++ b/WpfControls/DrawingObject/TableDrawingObject.xaml.cs @@ -0,0 +1,354 @@ +using GrapeCity.Forguncy.CellTypes; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using GrapeCity.Forguncy.Plugin; + +namespace ElementUI.WpfControls +{ + /// + /// Interaction logic for TableDrawingObject.xaml + /// + public partial class TableDrawingControl : UserControl + { + private TableDrawingControlViewModel _viewModel; + + public TableDrawingControl(CellTypeViewModelStyle cellStyle, TableCellType cellType, IDrawingHelper drawingHelper) + { + var viewModel = new TableDrawingControlViewModel(cellType); + if (cellStyle.Foreground == null) + { + cellStyle.Foreground = ColorHelper.Text; + } + this.DataContext = viewModel; + this._viewModel = viewModel; + InitializeComponent(); + if (viewModel.ShowIndexColumn) + { + this.InitIndexColumnView(); + } + if (viewModel.ShowSelectColumn) + { + this.InitSelectColumnView(); + } + this.InitTableView(); + //if (viewModel.ShowOperationColumn) + //{ + // this.InitOperationColumnView(); + //} + } + + private List> CreateTableData() + { + var result = new List>(); + + for (int row = 1; row < _viewModel.RowCount; row++) + { + var rowData = new List(); + _viewModel.ColumnSettings.ForEach(x => + { + rowData.Add("data"); + }); + result.Add(rowData); + } + + return result; + } + + private void InitTableView() + { + var grid = this.TableView; + InitTableRowAndColumn(grid); + var tableData = CreateTableData(); + + if (_viewModel.ShowHeader) + { + int gridColumn = 0; + _viewModel.ColumnSettings.ForEach(x => + { + var tableCell = CreateCellView(x, true); + grid.Children.Add(tableCell); + Grid.SetRow(tableCell, 0); + Grid.SetColumn(tableCell, gridColumn); + gridColumn++; + }); + } + + for (int row = 1; row < _viewModel.RowCount; row++) + { + var rowData = tableData[row - 1]; + int columnNum = 0; + _viewModel.ColumnSettings.ForEach(x => + { + var column = x.Clone() as ColumnSetting; + column.label = rowData[columnNum]; + column.headerAlign = column.align; + var tableCell = CreateCellView(column, false); + grid.Children.Add(tableCell); + Grid.SetRow(tableCell, _viewModel.ShowHeader ? row : row - 1); + Grid.SetColumn(tableCell, columnNum); + columnNum++; + + if (_viewModel.Stripe && row != 0 && row % 2 == 0) + { + tableCell.Background = new BrushConverter().ConvertFromString(_viewModel.StripeColor) as Brush; + } + }); + } + } + + private void InitTableRowAndColumn(Grid grid) + { + for (int row = 0; row < _viewModel.RowCount; row++) + { + var rowDefination = new RowDefinition(); + rowDefination.Height = new GridLength( + (_viewModel.ShowHeader && row == 0) ? _viewModel.CellSize - 10 : _viewModel.CellSize, + GridUnitType.Pixel + ); + grid.RowDefinitions.Add(rowDefination); + } + + _viewModel.ColumnSettings.ForEach(columnSetting => + { + var columnDefination = new ColumnDefinition(); + if (columnSetting.width != null) + { + columnDefination.Width = new GridLength((int)columnSetting.width, GridUnitType.Pixel); + } + else if (_viewModel.FitColumnWidth) + { + columnDefination.Width = new GridLength(1, GridUnitType.Star); + } + else + { + columnDefination.Width = new GridLength(1, GridUnitType.Auto); + } + grid.ColumnDefinitions.Add(columnDefination); + }); + } + + private Border CreateCellView(ColumnSetting column, bool isHeader) + { + + var border = new Border() + { + BorderBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString(_viewModel.VerticalBorderColor)), + BorderThickness = new Thickness(0, 0, _viewModel.ShowVerticalBorder ? 1 : 0, 1) + }; + var headerAlign = TextAlignment.Center; + if (column.headerAlign == "left") + { + headerAlign = TextAlignment.Left; + } + else if (column.headerAlign == "right") + { + headerAlign = TextAlignment.Right; + } + var textBlock = new TextBlock() + { + Text = column.label, + TextAlignment = headerAlign, + Margin = new Thickness(5, 0, 5, 0), + VerticalAlignment = VerticalAlignment.Center, + }; + if (isHeader) + { + textBlock.FontWeight = FontWeights.Bold; + textBlock.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString(_viewModel.HeaderColor)); + } + border.Child = textBlock; + + return border; + } + + private void InitIndexColumnView() + { + var grid = this.IndexColumnView; + grid.Width = _viewModel.CellSize; + + for (int row = _viewModel.ShowHeader ? 0 : 1; row < _viewModel.RowCount; row++) + { + var rowDefination = new RowDefinition(); + rowDefination.Height = new GridLength(row == 0 ? _viewModel.CellSize - 10 : _viewModel.CellSize, GridUnitType.Pixel); + grid.RowDefinitions.Add(rowDefination); + var cell = CreateCellView(new ColumnSetting { label = row == 0 ? string.Empty : row.ToString() }, false); + + if (_viewModel.Stripe && row != 0 && row % 2 == 0) + { + cell.Background = new BrushConverter().ConvertFromString(_viewModel.StripeColor) as Brush; + } + + grid.Children.Add(cell); + Grid.SetRow(cell, _viewModel.ShowHeader ? row : row - 1); + } + } + + private void InitSelectColumnView() + { + var grid = this.SelectColumnView; + grid.Width = _viewModel.CellSize; + for (int row = _viewModel.ShowHeader ? 0 : 1; row < _viewModel.RowCount; row++) + { + var rowDefination = new RowDefinition(); + rowDefination.Height = new GridLength(row == 0 ? _viewModel.CellSize - 10 : _viewModel.CellSize, GridUnitType.Pixel); + grid.RowDefinitions.Add(rowDefination); + + var cell = new Border() + { + BorderBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString(_viewModel.VerticalBorderColor)), + BorderThickness = new Thickness(0, 0, _viewModel.ShowVerticalBorder ? 1 : 0, 1) + }; + + cell.Child = new CheckBox() + { + Width = 14, + Height = 14, + VerticalAlignment = VerticalAlignment.Center, + BorderBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#dcdfe6")), + BorderThickness = new Thickness(1) + }; + + if (_viewModel.Stripe && row != 0 && row % 2 == 0) + { + cell.Background = new BrushConverter().ConvertFromString(_viewModel.StripeColor) as Brush; + } + + grid.Children.Add(cell); + Grid.SetRow(cell, _viewModel.ShowHeader ? row : row - 1); + } + } + + //private void InitOperationColumnView() + //{ + // var grid = this.OperationColumnView; + // for (int row = _viewModel.ShowHeader ? 0 : 1; row < _viewModel.RowCount; row++) + // { + // var rowDefination = new RowDefinition(); + // rowDefination.Height = new GridLength(row == 0 ? _viewModel.CellSize - 10 : _viewModel.CellSize, GridUnitType.Pixel); + // grid.RowDefinitions.Add(rowDefination); + + // Border cell; + // if (row == 0) + // { + // cell = CreateCellView(new ColumnSetting() { label = "操作" }, true); + // } + // else + // { + // cell = new Border() + // { + // BorderBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString(_viewModel.VerticalBorderColor)), + // BorderThickness = new Thickness(0, 0, _viewModel.ShowVerticalBorder ? 1 : 0, 1) + // }; + + // var stackPanel = new StackPanel() { Orientation = Orientation.Horizontal }; + // _viewModel.ActionButtons.ForEach(button => + // { + // var btn = new Button() { Content = button.Name, Padding = new Thickness(10, 15, 10, 15) }; + // stackPanel.Children.Add(btn); + // }); + // cell.Child = stackPanel; + // } + + // grid.Children.Add(cell); + // Grid.SetRow(cell, _viewModel.ShowHeader ? row : row - 1); + // } + //} + } + + public class TableDrawingControlViewModel { + + public TableDrawingControlViewModel(TableCellType cellType) { + ElementTableName = cellType.ElTableName; + AutoGenerateColumnsByDataSource = cellType.autoGenerateColumnsByDataSource; + if (AutoGenerateColumnsByDataSource) + { + ColumnSettings = cellType.bindingOptions.Columns.Select(x => new ColumnSetting() { label = x.ColumnName }).ToList(); + } + else + { + ColumnSettings = cellType.columns.Select(x => x as ColumnSetting).ToList(); + } + TableSize = cellType.size; + ShowHeader = cellType.showHeader; + FitColumnWidth = cellType.fit; + ShowVerticalBorder = cellType.border; + ShowIndexColumn = cellType.showIndexColumn; + ShowSelectColumn = cellType.showSelectColumn; + Stripe = cellType.stripe; + ActionButtons = cellType.actionButtons.Select(x => x as ActionButton).ToList(); + OperationColumnWidth = cellType.operationColumnWidth; + ShowOperationColumn = cellType.showActionButtons; + } + + public bool AutoGenerateColumnsByDataSource { get; set; } + + public string ElementTableName { get; set; } + + public List ColumnSettings { get; set; } + + public string TableSize { get; set; } + + public bool ShowHeader { get; set; } + + public bool FitColumnWidth { get; set; } + + public bool ShowVerticalBorder { get; set; } + + public int CellSize + { + get + { + int cellSize = 60; + if (TableSize == "default") + { + cellSize = 50; + } + else if (TableSize == "small") + { + cellSize = 40; + } + return cellSize; + } + } + + public int RowCount { get; set; } = 10; + + public bool ShowIndexColumn { get; set; } + + public bool ShowSelectColumn { get; set; } + + public bool Stripe { get; set; } + + public string StripeColor { get; set; } = "#fafafa"; + + public string VerticalBorderColor { get; set; } = "#ebeef5"; + + public string HeaderColor { get; set; } = "#909399"; + + public List ActionButtons { get; set; } + + public bool ShowOperationColumn { get; set; } + + public int? OperationColumnWidth { get; set; } + + public GridLength OprColumnWidth + { + get + { + return new GridLength(OperationColumnWidth ?? 200, GridUnitType.Pixel); + } + } + } +} -- Gitee From b4eed9b0f2d603d3d584ac7f562d1221462c307d Mon Sep 17 00:00:00 2001 From: RexLi Date: Fri, 5 Aug 2022 13:57:05 +0800 Subject: [PATCH 058/350] pass build --- CellTypes/Common.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CellTypes/Common.cs b/CellTypes/Common.cs index 7faf007..c719426 100644 --- a/CellTypes/Common.cs +++ b/CellTypes/Common.cs @@ -58,7 +58,8 @@ namespace ElementUI if (_uIPermissions == null) { List permissions = new List() { UIPermissionScope.Enable, UIPermissionScope.Visible }; - if(this is ISupportReadOnly) + var inputCellTypeBase = this; + if (inputCellTypeBase is ISupportReadOnly) { permissions.Add(UIPermissionScope.Editable); } @@ -74,7 +75,8 @@ namespace ElementUI { if (i.Scope == UIPermissionScope.Editable) { - return this is ISupportReadOnly; + var inputCellTypeBase = this; + return inputCellTypeBase is ISupportReadOnly; } return true; }).ToList(); -- Gitee From 01fa84cae186f6b8ee0111b1f4ef3e078b8cac9f Mon Sep 17 00:00:00 2001 From: RexLi Date: Fri, 5 Aug 2022 14:00:58 +0800 Subject: [PATCH 059/350] pass build --- Resources/CellTypes/Base.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Resources/CellTypes/Base.ts b/Resources/CellTypes/Base.ts index e34a7b0..5eadc3f 100644 --- a/Resources/CellTypes/Base.ts +++ b/Resources/CellTypes/Base.ts @@ -395,6 +395,10 @@ } return result; } + + public isPlainObject(obj: any): boolean { + return Object.prototype.toString.call(obj) === "[object Object]"; + } } export enum SlotPath { -- Gitee From efa01bc5c004fcb308e85ef5a93dd84457951f6b Mon Sep 17 00:00:00 2001 From: RexLi Date: Fri, 5 Aug 2022 14:28:11 +0800 Subject: [PATCH 060/350] pass build --- ElementUI.csproj | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ElementUI.csproj b/ElementUI.csproj index 153eedb..13c1896 100644 --- a/ElementUI.csproj +++ b/ElementUI.csproj @@ -142,6 +142,9 @@ TabHeaderDrawingObject.xaml + + TableDrawingObject.xaml + TagDrawingObject.xaml @@ -334,6 +337,10 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + Designer MSBuild:Compile -- Gitee From 66479a9f3672dd76648f9c3f2b1e758e0da68093 Mon Sep 17 00:00:00 2001 From: "Edric.Li" Date: Fri, 5 Aug 2022 06:38:16 +0000 Subject: [PATCH 061/350] update README.md. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d587958..6dafa91 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ### 快速开始 #### 编译 -- 依赖 typescript 4.4.4, 请确保电脑安装有 4x版本以上的SDK。 +- 依赖 typescript 4.4.4, 请确保电脑安装有 4x版本以上的SDK。 - 插件会在 设计器的默认安装路径下 获取引用,如果你的设计器是自定义的安装路径,需要更新引用的路径,具体可阅读 [活字格-插件开发-插件开发流程](https://help.grapecity.com.cn/pages/viewpage.action?pageId=56534757)。 #### 分支管理 -- Gitee From e96773234cdf6388b83e917a44c57c27329495b3 Mon Sep 17 00:00:00 2001 From: RexLi Date: Fri, 5 Aug 2022 14:56:35 +0800 Subject: [PATCH 062/350] =?UTF-8?q?fix=20element=20table=20bug:=20?= =?UTF-8?q?=E4=B8=8D=E8=AE=BE=E5=9B=BE=E6=A0=87=EF=BC=8C=E6=B5=8F=E8=A7=88?= =?UTF-8?q?=E5=99=A8=E5=B4=A9=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Resources/CellTypes/Table.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/CellTypes/Table.ts b/Resources/CellTypes/Table.ts index ebfff45..d05601c 100644 --- a/Resources/CellTypes/Table.ts +++ b/Resources/CellTypes/Table.ts @@ -107,7 +107,7 @@ height="100%"