From 77115b7f45e9fcc40c8831b857a77ee69751fcef Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期四, 11 十二月 2025 08:57:23 +0800
Subject: [PATCH] 1.删除变量权限,记录等;

---
 SourceCode/Bond/Servo/PageRecipe.cpp |   43 ++++++++++++++++++++++++++++++++++++-------
 1 files changed, 36 insertions(+), 7 deletions(-)

diff --git a/SourceCode/Bond/Servo/PageRecipe.cpp b/SourceCode/Bond/Servo/PageRecipe.cpp
index 8984870..3965041 100644
--- a/SourceCode/Bond/Servo/PageRecipe.cpp
+++ b/SourceCode/Bond/Servo/PageRecipe.cpp
@@ -386,13 +386,12 @@
 
 void CPageRecipe::OnBnClickedButtonNew()
 {
-	// TODO: 鍦ㄦ娣诲姞鎺т欢閫氱煡澶勭悊绋嬪簭浠g爜
-	//CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_EQUIPMENT);
-	//int nSel = pComboBox->GetCurSel();
-	//SERVO::CEquipment* pEq = (SERVO::CEquipment*)pComboBox->GetItemDataPtr(nSel);
-	//if (pEq == nullptr) {
-	//	return;
-	//}
+	int rc = UX_CanExecute(L"recipe");
+	if (rc != 1) {
+		AfxMessageBox("鎿嶄綔鏉冮檺涓嶈冻锛岃鑱旂郴绠$悊浜哄憳锛�");
+		return;
+	}
+	UX_RecordAction(L"recipe");
 
 	CRecipeDeviceBindDlg dlg(this);
 	if (dlg.DoModal() == IDOK) {
@@ -452,6 +451,13 @@
 
 void CPageRecipe::OnBnClickedButtonModify()
 {
+	int rc = UX_CanExecute(L"recipe");
+	if (rc != 1) {
+		AfxMessageBox("鎿嶄綔鏉冮檺涓嶈冻锛岃鑱旂郴绠$悊浜哄憳锛�");
+		return;
+	}
+	UX_RecordAction(L"recipe");
+
 	// TODO: 鍦ㄦ娣诲姞鎺т欢閫氱煡澶勭悊绋嬪簭浠g爜
 	CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_EQUIPMENT);
 	if (pComboBox == nullptr || !::IsWindow(pComboBox->m_hWnd)) {
@@ -492,6 +498,13 @@
 
 void CPageRecipe::OnBnClickedButtonDelete()
 {
+	int rc = UX_CanExecute(L"recipe");
+	if (rc != 1) {
+		AfxMessageBox("鎿嶄綔鏉冮檺涓嶈冻锛岃鑱旂郴绠$悊浜哄憳锛�");
+		return;
+	}
+	UX_RecordAction(L"recipe");
+
 	// TODO: 鍦ㄦ娣诲姞鎺т欢閫氱煡澶勭悊绋嬪簭浠g爜
 	POSITION pos = m_listPPID.GetFirstSelectedItemPosition();
 	if (!pos) { 
@@ -518,6 +531,13 @@
 
 void CPageRecipe::OnBnClickedButtonDeleteAll()
 {
+	int rc = UX_CanExecute(L"recipe");
+	if (rc != 1) {
+		AfxMessageBox("鎿嶄綔鏉冮檺涓嶈冻锛岃鑱旂郴绠$悊浜哄憳锛�");
+		return;
+	}
+	UX_RecordAction(L"recipe");
+
 	// TODO: 鍦ㄦ娣诲姞鎺т欢閫氱煡澶勭悊绋嬪簭浠g爜
 	if (IDYES != AfxMessageBox(_T("纭畾瑕佸垹闄ゅ叏閮ㄩ厤鏂硅褰曞悧锛�"), MB_YESNO | MB_ICONWARNING)) {
 		return;
@@ -778,4 +798,13 @@
 		}
 	}
 	return result;
+}
+
+BOOL CPageRecipe::PreTranslateMessage(MSG* pMsg)
+{
+	if (pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE) {
+		return TRUE;
+	}
+
+	return CDialogEx::PreTranslateMessage(pMsg);
 }
\ No newline at end of file

--
Gitblit v1.9.3