diff --git a/.gitignore b/.gitignore index fcae7c3..cec4222 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ packages TestConsoleApp .vs **/obj/Debug/** -**/obj/Release/** \ No newline at end of file +**/obj/Release/** +**/obj/Test/** \ No newline at end of file diff --git a/.vs/AIProofread/v17/.suo b/.vs/AIProofread/v17/.suo index 8cf87bb..1ae1031 100644 Binary files a/.vs/AIProofread/v17/.suo and b/.vs/AIProofread/v17/.suo differ diff --git a/AIProofread/AIProofread.csproj b/AIProofread/AIProofread.csproj index 73b0baf..5a3ba3b 100644 --- a/AIProofread/AIProofread.csproj +++ b/AIProofread/AIProofread.csproj @@ -366,6 +366,7 @@ + @@ -425,6 +426,7 @@ Ribbon1.cs + SettingsSingleFileGenerator diff --git a/AIProofread/Bridge.cs b/AIProofread/Bridge.cs index 46a1d88..ee32cfb 100644 --- a/AIProofread/Bridge.cs +++ b/AIProofread/Bridge.cs @@ -591,10 +591,10 @@ namespace AIProofread return InitContent(content, documentId, false); } - public void ShowMessage(string message,int closeDelay=1000) + public void ShowMessage(string message,int closeDelay=1000, bool showCloseBtn = true) { //FormMessage.ShowMessage(message, closeDelay); - Globals.ThisAddIn.ActiveDocument?.ShowMessage(message, closeDelay); + Globals.ThisAddIn.ActiveDocument?.ShowMessage(message, closeDelay, showCloseBtn); } public string ShowDialogMessage(string message) { diff --git a/AIProofread/Config.cs b/AIProofread/Config.cs index 3af519d..b22b1de 100644 --- a/AIProofread/Config.cs +++ b/AIProofread/Config.cs @@ -25,7 +25,7 @@ namespace AIProofread /// /// 网页访问地址 /// - public static string WEB_PATH = "https://pre-gm-plugin.gachafun.com/"; //pre-gm-plugin.gachafun.com 192.168.0.231:5137 192.168.10.100:5173 gm2-plugin.zverse.group + public static string WEB_PATH = "http://localhost:5173/"; //pre-gm-plugin.gachafun.com 192.168.0.231:5137 192.168.10.100:5173 gm2-plugin.zverse.group public static bool RUN_IN_DEBUG = true; public static AppEnvironment APP_ENV = AppEnvironment.Dev; #else diff --git a/AIProofread/Controls/FormContact.Designer.cs b/AIProofread/Controls/FormContact.Designer.cs index dce3fc0..f3690df 100644 --- a/AIProofread/Controls/FormContact.Designer.cs +++ b/AIProofread/Controls/FormContact.Designer.cs @@ -40,7 +40,7 @@ this.WebViewContact.Dock = System.Windows.Forms.DockStyle.Fill; this.WebViewContact.Location = new System.Drawing.Point(0, 0); this.WebViewContact.Name = "WebViewContact"; - this.WebViewContact.Size = new System.Drawing.Size(400, 310); + this.WebViewContact.Size = new System.Drawing.Size(380, 216); this.WebViewContact.TabIndex = 0; this.WebViewContact.ZoomFactor = 1D; // @@ -48,11 +48,11 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(400, 310); + this.ClientSize = new System.Drawing.Size(380, 216); this.Controls.Add(this.WebViewContact); this.Name = "FormContact"; this.ShowIcon = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "联系客服"; this.Load += new System.EventHandler(this.FormContact_Load); ((System.ComponentModel.ISupportInitialize)(this.WebViewContact)).EndInit(); diff --git a/AIProofread/Controls/FormMessage.cs b/AIProofread/Controls/FormMessage.cs index 998e424..b675710 100644 --- a/AIProofread/Controls/FormMessage.cs +++ b/AIProofread/Controls/FormMessage.cs @@ -68,6 +68,12 @@ namespace AIProofread.Controls BtnConfirm.Visible = true; BtnConfirm.Enabled = true; } + + public void HideCloseBtn() + { + BtnClose.Visible = false; + } + public static FormMessage ShowMessage(string message, int closeDelay = 3000) { FormMessage formMessage = new FormMessage(); diff --git a/AIProofread/Model/DocumentInfo.cs b/AIProofread/Model/DocumentInfo.cs index e5024eb..597f637 100644 --- a/AIProofread/Model/DocumentInfo.cs +++ b/AIProofread/Model/DocumentInfo.cs @@ -115,9 +115,13 @@ namespace AIProofread.Model FormMessage.ShowMessage(message, confirmText, confirmAction); })); } - public void ShowMessage(string message, int closeDelay) + public void ShowMessage(string message, int closeDelay,bool showCloseBtn = true) { var msgForm = FormMessage.ShowMessage(message, closeDelay); + if (!showCloseBtn) + { + msgForm.HideCloseBtn(); + } // n毫秒后自动关闭 System.Threading.Tasks.Task.Delay(closeDelay).ContinueWith(t => { diff --git a/AIProofread/Model/ExportDataItem.cs b/AIProofread/Model/ExportDataItem.cs index c30cfaf..4492509 100644 --- a/AIProofread/Model/ExportDataItem.cs +++ b/AIProofread/Model/ExportDataItem.cs @@ -43,7 +43,7 @@ namespace AIProofread.Model if(x.LineNumber == y.LineNumber) { // 如果行数相同,则根据起始位置排序 - return x.Item.Start.CompareTo(y.Item.Start); + return x.Item.Id.CompareTo(y.Item.Id); } // 如果页码相同,则根据行数排序 return x.LineNumber.CompareTo(y.LineNumber); diff --git a/AIProofread/app.config b/AIProofread/app.config new file mode 100644 index 0000000..08b3fbf --- /dev/null +++ b/AIProofread/app.config @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AIProofread/core/DocumentUtil.cs b/AIProofread/core/DocumentUtil.cs index 8afb9a1..7a44f62 100644 --- a/AIProofread/core/DocumentUtil.cs +++ b/AIProofread/core/DocumentUtil.cs @@ -669,30 +669,13 @@ namespace AIProofread { //row.CreateCell(5).SetCellValue(suggest); } - else if (it.Type == "first_choice") + else if ( !string.IsNullOrEmpty(it.Type) && ExportConfig.ErrorTypeMap.ContainsKey(it.Type.ToLower())) { - tag = "【提示】首选"; - //row.CreateCell(5).SetCellValue(suggest + " 【提示】首选"); - } - else if (it.Type == "now_called") - { - tag = "【提示】现称"; - //row.CreateCell(5).SetCellValue(suggest + " 【提示】现称"); - } - else if (it.Type == "quoting_legal") - { - tag = "【提示】法规"; - //row.CreateCell(5).SetCellValue(suggest + " 【提示】法规"); - } - else if (it.Type == "incorrect_expression") - { - tag = "【提示】表述有误"; - //row.CreateCell(5).SetCellValue(suggest + " 【提示】表述有误"); + tag = $"【提示】{ExportConfig.ErrorTypeMap[it.Type.ToLower()]}"; } else if (!string.IsNullOrEmpty(it.Addition) && it.Addition.Trim().Length > 0 && it.Addition != "提示") { - //row.CreateCell(5).SetCellValue(suggest + (string.IsNullOrEmpty(it.Addition) ? "" : $" 【提示】{it.Addition}")); tag = $"【提示】{it.Addition}"; } } @@ -722,7 +705,7 @@ namespace AIProofread { tag = "敏感词"; } - else if (it.Type == "blacklist") + else if (it.Type == "blacklist" || it.Type == "blacklist_mask") { tag = "黑名单"; } diff --git a/AIProofread/core/ExportConfig.cs b/AIProofread/core/ExportConfig.cs new file mode 100644 index 0000000..afc7d0b --- /dev/null +++ b/AIProofread/core/ExportConfig.cs @@ -0,0 +1,23 @@ +using NPOI.XSSF.Model; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AIProofread +{ + public class ExportConfig + { + public static readonly Dictionary ErrorTypeMap = new Dictionary() + { + {"first_choice","首选"}, + {"now_called","现称"}, + {"quoting_legal","引用法律条文时"}, + {"incorrect_expression","表述有误"}, + {"coinage","造字"}, + {"serial_number","作为标题序号时"}, + {"alien","异形词"}, + }; + } +} diff --git a/AIProofread/obj/Debug/AIProofread.Properties.Resources.resources b/AIProofread/obj/Debug/AIProofread.Properties.Resources.resources index 70ba9fd..52b6ecc 100644 Binary files a/AIProofread/obj/Debug/AIProofread.Properties.Resources.resources and b/AIProofread/obj/Debug/AIProofread.Properties.Resources.resources differ diff --git a/AIProofread/obj/Debug/AIProofread.csproj.AssemblyReference.cache b/AIProofread/obj/Debug/AIProofread.csproj.AssemblyReference.cache index 00cb02d..1ec8d6d 100644 Binary files a/AIProofread/obj/Debug/AIProofread.csproj.AssemblyReference.cache and b/AIProofread/obj/Debug/AIProofread.csproj.AssemblyReference.cache differ diff --git a/AIProofread/obj/Debug/AIProofread.csproj.CoreCompileInputs.cache b/AIProofread/obj/Debug/AIProofread.csproj.CoreCompileInputs.cache index 2b744e1..b089b12 100644 --- a/AIProofread/obj/Debug/AIProofread.csproj.CoreCompileInputs.cache +++ b/AIProofread/obj/Debug/AIProofread.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -54a319e61bbb40f00beb0f42abcb8716c81b74e48883b7a20bcbaff71f4ef2ff +0ffc09f3eb798c1989429f7c2b6c0220e93f9976a035c03b8478b5bf94f1b55c diff --git a/AIProofread/obj/Debug/AIProofread.csproj.FileListAbsolute.txt b/AIProofread/obj/Debug/AIProofread.csproj.FileListAbsolute.txt index 9bccb84..fe5e564 100644 --- a/AIProofread/obj/Debug/AIProofread.csproj.FileListAbsolute.txt +++ b/AIProofread/obj/Debug/AIProofread.csproj.FileListAbsolute.txt @@ -212,3 +212,6 @@ C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofr.881 C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.dll C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.pdb C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\obj\Debug\AIProofread.Controls.MessageTips.resources +C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Debug\AIProofread.dll.config +C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Debug\AntdUI.dll +C:\Users\yaclt\source\repos\repos\AIProofread\AIProofread\bin\Debug\AntdUI.xml diff --git a/AIProofread/obj/Debug/AIProofread.csproj.GenerateResource.cache b/AIProofread/obj/Debug/AIProofread.csproj.GenerateResource.cache index fea8749..d542ba8 100644 Binary files a/AIProofread/obj/Debug/AIProofread.csproj.GenerateResource.cache and b/AIProofread/obj/Debug/AIProofread.csproj.GenerateResource.cache differ diff --git a/AIProofread/obj/Debug/AIProofread.dll b/AIProofread/obj/Debug/AIProofread.dll index 939aef2..1e2d138 100644 Binary files a/AIProofread/obj/Debug/AIProofread.dll and b/AIProofread/obj/Debug/AIProofread.dll differ diff --git a/AIProofread/obj/Debug/AIProofread.pdb b/AIProofread/obj/Debug/AIProofread.pdb index d80becd..7ec706b 100644 Binary files a/AIProofread/obj/Debug/AIProofread.pdb and b/AIProofread/obj/Debug/AIProofread.pdb differ diff --git a/AIProofread/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/AIProofread/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache index 8a1d0a1..bd5d4b5 100644 Binary files a/AIProofread/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/AIProofread/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/updater/Form1.Designer.cs b/updater/Form1.Designer.cs index 336d77a..c684e03 100644 --- a/updater/Form1.Designer.cs +++ b/updater/Form1.Designer.cs @@ -31,66 +31,69 @@ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); this.LabelLog = new System.Windows.Forms.Label(); this.progressBar1 = new System.Windows.Forms.ProgressBar(); - this.ButtonProcess = new System.Windows.Forms.Button(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.ButtonProcess = new AntdUI.Button(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); // // LabelLog // this.LabelLog.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.LabelLog.Location = new System.Drawing.Point(90, 10); + this.LabelLog.Location = new System.Drawing.Point(75, 24); this.LabelLog.Name = "LabelLog"; - this.LabelLog.Size = new System.Drawing.Size(300, 93); + this.LabelLog.Size = new System.Drawing.Size(254, 71); this.LabelLog.TabIndex = 0; - this.LabelLog.Text = "正在检测"; - this.LabelLog.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.LabelLog.Text = "正在检测。。。"; + this.LabelLog.TextAlign = System.Drawing.ContentAlignment.TopCenter; this.LabelLog.Click += new System.EventHandler(this.LabelLog_Click); // // progressBar1 // - this.progressBar1.Location = new System.Drawing.Point(90, 118); + this.progressBar1.Location = new System.Drawing.Point(29, 103); this.progressBar1.Name = "progressBar1"; this.progressBar1.Size = new System.Drawing.Size(300, 14); this.progressBar1.TabIndex = 3; this.progressBar1.Visible = false; // - // ButtonProcess - // - this.ButtonProcess.Location = new System.Drawing.Point(141, 153); - this.ButtonProcess.Name = "ButtonProcess"; - this.ButtonProcess.Size = new System.Drawing.Size(136, 40); - this.ButtonProcess.TabIndex = 4; - this.ButtonProcess.Text = "继续"; - this.ButtonProcess.UseVisualStyleBackColor = false; - this.ButtonProcess.Visible = false; - this.ButtonProcess.Click += new System.EventHandler(this.ButtonProcess_Click); - // // pictureBox1 // this.pictureBox1.Image = global::updater.Properties.Resources.upgrade; - this.pictureBox1.Location = new System.Drawing.Point(29, 38); + this.pictureBox1.Location = new System.Drawing.Point(29, 24); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(40, 40); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBox1.TabIndex = 5; this.pictureBox1.TabStop = false; // + // ButtonProcess + // + this.ButtonProcess.BackHover = System.Drawing.Color.FromArgb(((int)(((byte)(214)))), ((int)(((byte)(170)))), ((int)(((byte)(105))))); + this.ButtonProcess.DefaultBack = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(160)))), ((int)(((byte)(99))))); + this.ButtonProcess.Font = new System.Drawing.Font("微软雅黑", 10F); + this.ButtonProcess.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.ButtonProcess.Location = new System.Drawing.Point(122, 125); + this.ButtonProcess.Name = "ButtonProcess"; + this.ButtonProcess.Radius = 4; + this.ButtonProcess.Size = new System.Drawing.Size(136, 44); + this.ButtonProcess.TabIndex = 6; + this.ButtonProcess.Text = "继续"; + this.ButtonProcess.Click += new System.EventHandler(this.ButtonProcess_Click); + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.White; - this.ClientSize = new System.Drawing.Size(409, 205); - this.Controls.Add(this.pictureBox1); + this.ClientSize = new System.Drawing.Size(364, 177); this.Controls.Add(this.ButtonProcess); + this.Controls.Add(this.pictureBox1); this.Controls.Add(this.progressBar1); this.Controls.Add(this.LabelLog); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; - this.MaximumSize = new System.Drawing.Size(425, 244); + this.MaximumSize = new System.Drawing.Size(380, 216); this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(425, 244); + this.MinimumSize = new System.Drawing.Size(380, 216); this.Name = "Form1"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "AI校对王更新"; @@ -104,8 +107,8 @@ private System.Windows.Forms.Label LabelLog; private System.Windows.Forms.ProgressBar progressBar1; - private System.Windows.Forms.Button ButtonProcess; private System.Windows.Forms.PictureBox pictureBox1; + private AntdUI.Button ButtonProcess; } } diff --git a/updater/Form1.cs b/updater/Form1.cs index 8cf2491..0330d28 100644 --- a/updater/Form1.cs +++ b/updater/Form1.cs @@ -112,7 +112,6 @@ namespace updater { Directory.CreateDirectory(UpgradeDir); } - upgradeInfo.DownloadUrl = "https://file.wx.wm-app.xyz/os/tmp/update_test.exe"; string updateFileName = UpgradeDir + Path.GetFileName(upgradeInfo.DownloadUrl); // 判断是否已经存在升级包 if (File.Exists(updateFileName)) diff --git a/updater/packages.config b/updater/packages.config index ea29129..376e4c9 100644 --- a/updater/packages.config +++ b/updater/packages.config @@ -1,4 +1,5 @@  + \ No newline at end of file diff --git a/updater/updater.csproj b/updater/updater.csproj index 75eba9d..75f3d43 100644 --- a/updater/updater.csproj +++ b/updater/updater.csproj @@ -65,6 +65,9 @@ Properties\app.manifest + + ..\packages\AntdUI.1.7.12\lib\net46\AntdUI.dll + ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll