From 9b3b2eb20b09e13da837a28f16e552ba70a090c4 Mon Sep 17 00:00:00 2001
From: LiFan <2308045698@qq.com>
Date: 星期四, 24 四月 2025 14:48:21 +0800
Subject: [PATCH] update

---
 jrj/project/business/SystemSettings/CommentaryEx.dialog.cpp |   35 +++++++++++++++++++++--------------
 1 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/jrj/project/business/SystemSettings/CommentaryEx.dialog.cpp b/jrj/project/business/SystemSettings/CommentaryEx.dialog.cpp
index e841c25..82376a5 100644
--- a/jrj/project/business/SystemSettings/CommentaryEx.dialog.cpp
+++ b/jrj/project/business/SystemSettings/CommentaryEx.dialog.cpp
@@ -57,7 +57,7 @@
 		int showAtt()
 		{
 			xnode anode = GetAgentNode(L"att");
-			int s = xcombobox::GetCount(m_cb.GetId());
+			int s = m_cb.GetCount();
 			xml x ;
 			x.loadXML(L"<vbox/>");
 		
@@ -65,7 +65,7 @@
 			int i = 0;
 			for (i = 0; i < s; i++)
 			{
-				xstring tmp = xcombobox::GetLBText(m_cb.GetId(), i);
+				xstring tmp = m_cb.GetLBText(i);
 				KXMLDOMElement e = x.createElement(L"hbox");
 				e.setAttribute(L"height", L"20");
 				KXMLDOMElement l = x.createElement(L"xlabel");
@@ -82,7 +82,7 @@
 				g.setAttribute(L"style", L"background-color:#000000");
 				ele.appendChild(g);
 			}
-			SetAgentNodeContent(anode, ele);
+			SetAgentNode(anode, ele.xml());
 			anode.SetWidthHeight(-1, i * 20 + 1);
 			return 1;
 		}
@@ -92,6 +92,7 @@
 			xstring guid = publiccode::GetGuid();
 			xstring str = guid.left(2);
 			xstring ret = xaserver::UploadFile(L"attachment" + str, guid + L".jpg", GetHWND(), L"", false);
+			int nIndex = m_cb.AddItem(ret.c_str(true), (guid + L".jpg").c_str(true));
 			showAtt();
 			return 1;
 		}
@@ -99,22 +100,22 @@
 		int delAtt(xstring no)
 		{
 			int nIndex = no.toInt();
-			xcombobox::DeleteItem(m_cb.GetId(), nIndex);
+			m_cb.DeleteItem(nIndex);
 			showAtt();
 			return 1;
 		}
 
 		KXMLDOMElement getAtt()
 		{
-			int s = xcombobox::GetCount(m_cb.GetId());
+			int s = m_cb.GetCount();
 			xml x;
 			x.loadXML(L"<Attachment/>");
-			KXMLDOMElement ele = x.documentElement;
+			KXMLDOMElement ele = x.documentElement();
 			int i = 0;
 			for (i = 0; i < s; i++)
 			{
-				xstring tmp = xcombobox::GetLBText(m_cb.GetId(), i);
-				xstring tmp2 = xcombobox::GetItemData(m_cb.GetId(), i);
+				xstring tmp = m_cb.GetLBText(i);
+				xstring tmp2 = m_cb.GetItemData( i);
 				KXMLDOMElement e = x.createElement(L"item");
 				e.setAttribute(L"name", L"" + tmp);
 				e.setAttribute(L"file", L"" + tmp2);
@@ -135,8 +136,12 @@
 				xstring value = m_Edit.GetText();
 				if (value == L"")
 				{
-					alert(L"请填写批注!");
-					return 1;
+					int s = m_cb.GetCount();
+					if (s < 1)
+					{
+						alert(L"请填写批注!");
+						return 1;
+					}
 				}
 
 				x.loadXML(L"<Commentary update.new='1' update.modify='1'/>");
@@ -150,12 +155,12 @@
 				AppendItem(x, ele, L"CreatorID", xaserver::GetUserId());
 				ele.appendChild(getAtt());
 
-				arg.AddArg(L"content", L"<root>" + ele.xml + L"</root>");
+				arg.AddArg(L"content", (xstring)L"<root>" + ele.xml() + L"</root>");
 
 				if (getUrl(L"/workflow/action/Commentary/bill.update", arg.GetString(), x) == 1)
 				{
 					m_Edit.SetText(L"");
-					xcombobox::ResetContent(m_cb.GetId());
+					m_cb.ResetContent();
 					Init();
 					showAtt();
 					return 1;
@@ -189,7 +194,8 @@
 
 		int OnHtmlClick(TEvent* evt, LPARAM pr)
 		{
-			ref  HTMLNMHDR p = evt.pnmh;
+			/*
+			HTMLNMHDR& p = evt->pnmh;
 			const xstring d = m_Html.GetData(p.object);
 			if (d == L"") return -1;
 			xstring file = d.mid(0, d.find(L"|##@@|", 0));
@@ -216,7 +222,7 @@
 				alert(L"文件打开失败2!");
 				return -1;
 			}
-
+			*/
 			return -1;
 		}
 
@@ -225,6 +231,7 @@
 			//绑定工具条点击事件
 			AttachEvent(L"WM_XCOMMAND", (FEvent)&CommentaryEx::OnXCommand);
 			AttachEvent(L"note", L"HTC_OBJECTCLICKED", (FEvent)&CommentaryEx::OnHtmlClick);
+			return 1;
 		}
 
 		int onload()

--
Gitblit v1.9.3