Compare commits

...

3 Commits

Author SHA1 Message Date
5d9d3e6b4f feat: 校对和常识性检测合并 2025-07-16 21:45:02 +08:00
a49e185569 常识性检测改为一键校对 2025-07-16 17:26:32 +08:00
bdd88c4cb1 更新名称 2025-07-16 13:03:47 +08:00
6 changed files with 113 additions and 124 deletions

Binary file not shown.

View File

@ -36,7 +36,7 @@ namespace AIProofread
public class Config
{
public static readonly string APP_NAME = "AI校对王(公告版)";
public static readonly string APP_VERSION = "3.1.0";
public static readonly string APP_VERSION = "1.1.1";
public static bool IS_WPS = false;
public static bool UpgradeForcedNotice = false;
public static readonly string APP_BASE_DIR = AppDomain.CurrentDomain.BaseDirectory;
@ -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,20 +61,12 @@ namespace AIProofread
this.btnLogin = this.Factory.CreateRibbonButton();
this.BtnShowManual = this.Factory.CreateRibbonButton();
this.BtnShowPanel = this.Factory.CreateRibbonButton();
this.menuSencenDect = this.Factory.CreateRibbonMenu();
this.btnDetectionAll = this.Factory.CreateRibbonButton();
this.btnDetectionParagraph = this.Factory.CreateRibbonButton();
this.btnDetectionHistory = 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();
@ -77,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();
@ -108,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.menuSencenDect);
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
@ -131,6 +174,7 @@ namespace AIProofread
this.menuProofreadList.Label = "全文校对\r\n";
this.menuProofreadList.Name = "menuProofreadList";
this.menuProofreadList.ShowImage = true;
this.menuProofreadList.Visible = false;
//
// BtnProofreadExact
//
@ -240,40 +284,6 @@ namespace AIProofread
this.BtnShowPanel.Visible = false;
this.BtnShowPanel.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.BtnShowPanel_Click);
//
// menuSencenDect
//
this.menuSencenDect.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
this.menuSencenDect.Image = global::AIProofread.Properties.Resources.icon_ai_robot;
this.menuSencenDect.Items.Add(this.btnDetectionAll);
this.menuSencenDect.Items.Add(this.btnDetectionParagraph);
this.menuSencenDect.Items.Add(this.btnDetectionHistory);
this.menuSencenDect.Label = "常识性检测\r\n";
this.menuSencenDect.Name = "menuSencenDect";
this.menuSencenDect.ShowImage = true;
this.menuSencenDect.Visible = false;
//
// btnDetectionAll
//
this.btnDetectionAll.Label = "全文常识检测\r\n";
this.btnDetectionAll.Name = "btnDetectionAll";
this.btnDetectionAll.ShowImage = true;
this.btnDetectionAll.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnDetectionAll_Click);
//
// btnDetectionParagraph
//
this.btnDetectionParagraph.Enabled = false;
this.btnDetectionParagraph.Label = "段落常识检测\r\n";
this.btnDetectionParagraph.Name = "btnDetectionParagraph";
this.btnDetectionParagraph.ShowImage = true;
this.btnDetectionParagraph.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnDetectionParagraph_Click);
//
// btnDetectionHistory
//
this.btnDetectionHistory.Label = "历史检测记录\r\n";
this.btnDetectionHistory.Name = "btnDetectionHistory";
this.btnDetectionHistory.ShowImage = true;
this.btnDetectionHistory.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnDetectionHistory_Click);
//
// MenuMore
//
this.MenuMore.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
@ -281,6 +291,7 @@ namespace AIProofread
this.MenuMore.Items.Add(this.btnOpenLexicon);
this.MenuMore.Items.Add(this.ButtonSaveCache);
this.MenuMore.Items.Add(this.ButtonLoadCache);
this.MenuMore.Items.Add(this.btnDetectionHistory);
this.MenuMore.Items.Add(this.btnSetting);
this.MenuMore.Label = "更多";
this.MenuMore.Name = "MenuMore";
@ -307,6 +318,13 @@ namespace AIProofread
this.ButtonLoadCache.ShowImage = true;
this.ButtonLoadCache.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.ButtonLoadCache_Click);
//
// btnDetectionHistory
//
this.btnDetectionHistory.Label = "校对历史\r\n";
this.btnDetectionHistory.Name = "btnDetectionHistory";
this.btnDetectionHistory.ShowImage = true;
this.btnDetectionHistory.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnDetectionHistory_Click);
//
// btnSetting
//
this.btnSetting.Label = "设置\r\n";
@ -314,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 = "显示面板";
@ -399,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";
@ -458,9 +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.RibbonMenu menuSencenDect;
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnDetectionAll;
internal Microsoft.Office.Tools.Ribbon.RibbonButton btnDetectionParagraph;
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;
menuSencenDect.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)
@ -615,14 +615,35 @@ namespace AIProofread
{
return;
}
btnDetectionParagraph.Enabled = r.Start != r.End;
btnDetectionAll.Enabled = r.Start == r.End;
//btnDetectionParagraph.Enabled = r.Start != r.End;
//btnDetectionAll.Enabled = r.Start == r.End;
}
public void SetDetectionBtnStatus(bool allStatus,bool rangeStatus)
/// <summary>
/// 检测状态
/// </summary>
private bool isChecking = false;
/// <summary>
/// 校对状态
/// </summary>
private bool isProofreading = false;
/// <summary>
/// 设置校对状态
/// </summary>
/// <param name="isProofreading"></param>
public void SetProofreadStatus(bool isProofreading)
{
btnDetectionAll.Enabled = allStatus;
btnDetectionParagraph.Enabled = rangeStatus;
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)
@ -657,5 +678,14 @@ namespace AIProofread
{
Globals.ThisAddIn.ShowLawQuery();
}
private void btnDetectionOneClick_Click(object sender, RibbonControlEventArgs e)
{
if (CommonSenseDetection.instance.isChecking)
{
return;
}
Globals.ThisAddIn.SendMessageToWeb("show-check-all", "");
}
}
}

View File

@ -159,18 +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="menuSencenDect.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnDetectionAll.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnDetectionParagraph.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnDetectionHistory.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>
@ -180,6 +168,9 @@
<metadata name="ButtonLoadCache.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnDetectionHistory.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnSetting.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>

View File

@ -64,7 +64,7 @@ namespace AIProofread.core
this.checkingKey = checkingKey;
this.checkingSummary = checkingSummary;
this.checkingLocation = checkingLocation;
Globals.ThisAddIn.ribbon.SetDetectionBtnStatus(false,false);
// Globals.ThisAddIn.ribbon.SetDetectionBtnStatus(false,false);
}
else
{
@ -73,8 +73,9 @@ namespace AIProofread.core
this.checkingSummary = null;
this.checkingLocation = null;
var enableAll = string.IsNullOrEmpty(checkingSummary);
Globals.ThisAddIn.ribbon.SetDetectionBtnStatus(enableAll,!enableAll);
//Globals.ThisAddIn.ribbon.SetDetectionBtnStatus(enableAll,!enableAll);
}
Globals.Ribbons.Ribbon1.SetDetectionStatus(isChecking);
}
public string GetHistory()