feat: 校对和常识性检测合并

This commit is contained in:
LittleBoy 2025-07-16 21:45:02 +08:00
parent a49e185569
commit 5d9d3e6b4f
6 changed files with 87 additions and 80 deletions

Binary file not shown.

View File

@ -52,11 +52,11 @@ namespace AIProofread
/// <summary>
/// 网页访问地址
/// </summary>
public static string WEB_PATH = AppServer.TEST; //pre-gm-plugin.gachafun.com localhost:5173 gm2-plugin.zverse.group
public static string WEB_PATH = AppServer.DEV; //pre-gm-plugin.gachafun.com localhost:5173 gm2-plugin.zverse.group
public static bool RUN_IN_DEBUG = true;
public static AppEnvironment APP_ENV = AppEnvironment.Prod;
#else
public static string WEB_PATH = AppServer.TEST; // gm-plugin.gachafun.com pre-gm-plugin.gachafun.com
public static string WEB_PATH = AppServer.PROD; // gm-plugin.gachafun.com pre-gm-plugin.gachafun.com
public static bool RUN_IN_DEBUG = false;
public static AppEnvironment APP_ENV = AppEnvironment.Prod;
#endif

View File

@ -41,6 +41,12 @@ namespace AIProofread
Microsoft.Office.Tools.Ribbon.RibbonDropDownItem ribbonDropDownItemImpl3 = this.Factory.CreateRibbonDropDownItem();
this.tabAIProofreadAnno = this.Factory.CreateRibbonTab();
this.group1 = this.Factory.CreateRibbonGroup();
this.grpOther = this.Factory.CreateRibbonGroup();
this.LblDate = this.Factory.CreateRibbonLabel();
this.LblNickname = this.Factory.CreateRibbonLabel();
this.group2 = this.Factory.CreateRibbonGroup();
this.grpDebug = this.Factory.CreateRibbonGroup();
this.dropDown1 = this.Factory.CreateRibbonDropDown();
this.BtnProofreadAll = this.Factory.CreateRibbonButton();
this.menuProofreadList = this.Factory.CreateRibbonMenu();
this.BtnProofreadExact = this.Factory.CreateRibbonButton();
@ -55,18 +61,12 @@ namespace AIProofread
this.btnLogin = this.Factory.CreateRibbonButton();
this.BtnShowManual = this.Factory.CreateRibbonButton();
this.BtnShowPanel = this.Factory.CreateRibbonButton();
this.btnDetectionOneClick = this.Factory.CreateRibbonButton();
this.MenuMore = this.Factory.CreateRibbonMenu();
this.btnOpenLexicon = this.Factory.CreateRibbonButton();
this.ButtonSaveCache = this.Factory.CreateRibbonButton();
this.ButtonLoadCache = this.Factory.CreateRibbonButton();
this.btnDetectionHistory = this.Factory.CreateRibbonButton();
this.btnSetting = this.Factory.CreateRibbonButton();
this.grpOther = this.Factory.CreateRibbonGroup();
this.LblDate = this.Factory.CreateRibbonLabel();
this.LblNickname = this.Factory.CreateRibbonLabel();
this.group2 = this.Factory.CreateRibbonGroup();
this.grpDebug = this.Factory.CreateRibbonGroup();
this.btnShowPane = this.Factory.CreateRibbonButton();
this.btnHidePane = this.Factory.CreateRibbonButton();
this.BtnOpenLog = this.Factory.CreateRibbonButton();
@ -75,7 +75,6 @@ namespace AIProofread
this.BtnTest = this.Factory.CreateRibbonButton();
this.BtnOpenAppDir = this.Factory.CreateRibbonButton();
this.BtnShowVersion = this.Factory.CreateRibbonButton();
this.dropDown1 = this.Factory.CreateRibbonDropDown();
this.tabAIProofreadAnno.SuspendLayout();
this.group1.SuspendLayout();
this.grpOther.SuspendLayout();
@ -106,18 +105,64 @@ namespace AIProofread
this.group1.Items.Add(this.btnLogin);
this.group1.Items.Add(this.BtnShowManual);
this.group1.Items.Add(this.BtnShowPanel);
this.group1.Items.Add(this.btnDetectionOneClick);
this.group1.Items.Add(this.MenuMore);
this.group1.Name = "group1";
//
// grpOther
//
this.grpOther.Items.Add(this.LblDate);
this.grpOther.Items.Add(this.LblNickname);
this.grpOther.Name = "grpOther";
//
// LblDate
//
this.LblDate.Label = "过期时间:";
this.LblDate.Name = "LblDate";
this.LblDate.Visible = false;
//
// LblNickname
//
this.LblNickname.Label = "xxx 已登录";
this.LblNickname.Name = "LblNickname";
this.LblNickname.Visible = false;
//
// group2
//
this.group2.Name = "group2";
//
// grpDebug
//
this.grpDebug.Items.Add(this.btnShowPane);
this.grpDebug.Items.Add(this.btnHidePane);
this.grpDebug.Items.Add(this.BtnOpenLog);
this.grpDebug.Items.Add(this.button1);
this.grpDebug.Items.Add(this.BtnOpenLogger);
this.grpDebug.Items.Add(this.BtnTest);
this.grpDebug.Items.Add(this.BtnOpenAppDir);
this.grpDebug.Items.Add(this.BtnShowVersion);
this.grpDebug.Items.Add(this.dropDown1);
this.grpDebug.Label = "开发调试";
this.grpDebug.Name = "grpDebug";
this.grpDebug.Visible = false;
//
// dropDown1
//
ribbonDropDownItemImpl1.Label = "开发";
ribbonDropDownItemImpl2.Label = "测试";
ribbonDropDownItemImpl3.Label = "生产";
this.dropDown1.Items.Add(ribbonDropDownItemImpl1);
this.dropDown1.Items.Add(ribbonDropDownItemImpl2);
this.dropDown1.Items.Add(ribbonDropDownItemImpl3);
this.dropDown1.Label = "环境";
this.dropDown1.Name = "dropDown1";
//
// BtnProofreadAll
//
this.BtnProofreadAll.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
this.BtnProofreadAll.Image = global::AIProofread.Properties.Resources.icon_proofread;
this.BtnProofreadAll.Label = "全文校对\r\n";
this.BtnProofreadAll.Label = "一键校对\r\n";
this.BtnProofreadAll.Name = "BtnProofreadAll";
this.BtnProofreadAll.ShowImage = true;
this.BtnProofreadAll.Visible = false;
this.BtnProofreadAll.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.BtnProofreadAll_Click);
//
// menuProofreadList
@ -129,6 +174,7 @@ namespace AIProofread
this.menuProofreadList.Label = "全文校对\r\n";
this.menuProofreadList.Name = "menuProofreadList";
this.menuProofreadList.ShowImage = true;
this.menuProofreadList.Visible = false;
//
// BtnProofreadExact
//
@ -238,15 +284,6 @@ namespace AIProofread
this.BtnShowPanel.Visible = false;
this.BtnShowPanel.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.BtnShowPanel_Click);
//
// btnDetectionOneClick
//
this.btnDetectionOneClick.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
this.btnDetectionOneClick.Image = global::AIProofread.Properties.Resources.icon_ai_robot;
this.btnDetectionOneClick.Label = "一键校对\r\n";
this.btnDetectionOneClick.Name = "btnDetectionOneClick";
this.btnDetectionOneClick.ShowImage = true;
this.btnDetectionOneClick.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnDetectionOneClick_Click);
//
// MenuMore
//
this.MenuMore.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
@ -295,43 +332,6 @@ namespace AIProofread
this.btnSetting.ShowImage = true;
this.btnSetting.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnSetting_Click);
//
// grpOther
//
this.grpOther.Items.Add(this.LblDate);
this.grpOther.Items.Add(this.LblNickname);
this.grpOther.Name = "grpOther";
//
// LblDate
//
this.LblDate.Label = "过期时间:";
this.LblDate.Name = "LblDate";
this.LblDate.Visible = false;
//
// LblNickname
//
this.LblNickname.Label = "xxx 已登录";
this.LblNickname.Name = "LblNickname";
this.LblNickname.Visible = false;
//
// group2
//
this.group2.Name = "group2";
//
// grpDebug
//
this.grpDebug.Items.Add(this.btnShowPane);
this.grpDebug.Items.Add(this.btnHidePane);
this.grpDebug.Items.Add(this.BtnOpenLog);
this.grpDebug.Items.Add(this.button1);
this.grpDebug.Items.Add(this.BtnOpenLogger);
this.grpDebug.Items.Add(this.BtnTest);
this.grpDebug.Items.Add(this.BtnOpenAppDir);
this.grpDebug.Items.Add(this.BtnShowVersion);
this.grpDebug.Items.Add(this.dropDown1);
this.grpDebug.Label = "开发调试";
this.grpDebug.Name = "grpDebug";
this.grpDebug.Visible = false;
//
// btnShowPane
//
this.btnShowPane.Label = "显示面板";
@ -380,17 +380,6 @@ namespace AIProofread
this.BtnShowVersion.Name = "BtnShowVersion";
this.BtnShowVersion.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.BtnShowVersion_Click);
//
// dropDown1
//
ribbonDropDownItemImpl1.Label = "开发";
ribbonDropDownItemImpl2.Label = "测试";
ribbonDropDownItemImpl3.Label = "生产";
this.dropDown1.Items.Add(ribbonDropDownItemImpl1);
this.dropDown1.Items.Add(ribbonDropDownItemImpl2);
this.dropDown1.Items.Add(ribbonDropDownItemImpl3);
this.dropDown1.Label = "环境";
this.dropDown1.Name = "dropDown1";
//
// Ribbon1
//
this.Name = "Ribbon1";
@ -439,7 +428,6 @@ namespace AIProofread
internal Microsoft.Office.Tools.Ribbon.RibbonButton BtnShowVersion;
internal Microsoft.Office.Tools.Ribbon.RibbonDropDown dropDown1;
internal Microsoft.Office.Tools.Ribbon.RibbonGroup grpOther;
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnDetectionOneClick;
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnDetectionHistory;
internal Microsoft.Office.Tools.Ribbon.RibbonButton BtnShowManual;
internal Microsoft.Office.Tools.Ribbon.RibbonMenu menuProofreadList;

View File

@ -42,7 +42,7 @@ namespace AIProofread
public void SetCommonBtnStatus(bool status)
{
// BtnProofreadAll.Enabled = status;
BtnProofreadAll.Enabled = status;
menuProofreadList.Enabled = status;
btnClear.Enabled = status;
@ -53,7 +53,7 @@ namespace AIProofread
btnLogout.Enabled = status;
ButtonLoadCache.Enabled = status;
ButtonSaveCache.Enabled = status;
btnDetectionOneClick.Enabled = status;
//btnDetectionOneClick.Enabled = status;
//BtnShowPanel.Enabled = status;
BtnExportProofreadResult.Enabled = status;
}
@ -209,8 +209,8 @@ namespace AIProofread
private void BtnProofreadAll_Click(object sender, RibbonControlEventArgs e)
{
string time = DateTime.Now.ToString("yyyy - MM - dd HH: mm:ss: fff:ffffff");
Globals.ThisAddIn.SendMessageToWeb("start", time);
Globals.ThisAddIn.SendMessageToWeb("start","all");
//Globals.ThisAddIn.SendMessageToWeb("show-check-all", "");
}
private void btnClear_Click(object sender, RibbonControlEventArgs e)
@ -619,9 +619,31 @@ namespace AIProofread
//btnDetectionAll.Enabled = r.Start == r.End;
}
public void SetDetectionBtnStatus(bool isChecking)
/// <summary>
/// 检测状态
/// </summary>
private bool isChecking = false;
/// <summary>
/// 校对状态
/// </summary>
private bool isProofreading = false;
/// <summary>
/// 设置校对状态
/// </summary>
/// <param name="isProofreading"></param>
public void SetProofreadStatus(bool isProofreading)
{
btnDetectionOneClick.Enabled = !isChecking;
this.isProofreading = isProofreading;
BtnProofreadAll.Enabled = !isChecking && !isProofreading;
}
/// <summary>
/// 设置常识性检测状态
/// </summary>
/// <param name="isChecking"></param>
public void SetDetectionStatus(bool isChecking)
{
this.isChecking = isChecking;
//BtnProofreadAll.Enabled = !isChecking && !isProofreading;
}
private void BtnShowManual_Click(object sender, RibbonControlEventArgs e)

View File

@ -159,9 +159,6 @@
<metadata name="BtnShowPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnDetectionOneClick.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnOpenLexicon.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>

View File

@ -75,7 +75,7 @@ namespace AIProofread.core
var enableAll = string.IsNullOrEmpty(checkingSummary);
//Globals.ThisAddIn.ribbon.SetDetectionBtnStatus(enableAll,!enableAll);
}
Globals.Ribbons.Ribbon1.SetDetectionBtnStatus(isChecking);
Globals.Ribbons.Ribbon1.SetDetectionStatus(isChecking);
}
public string GetHistory()