| | |
| | | use "xcontrol.vframe.vbusiness.vd" |
| | | use "xbase.vframe.vbusiness.vd" |
| | | #include <wobject/xstring.hpp> |
| | | #include <xcontrol/xtreeview.hpp> |
| | | #include <xcontrol/xdwgrid.hpp> |
| | | #include <wobject/xdouble.hpp> |
| | | #include <xcontrol/xlayersheet.hpp> |
| | | #include <xcontrol/xdatetimepick.hpp> |
| | | #include <xcontrol/xoffice.hpp> |
| | | #include <xcontrol/xcell.hpp> |
| | | |
| | | unit trade |
| | | [ |
| | | class ViewLogList : public xwin |
| | | |
| | | #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp" |
| | | #include "viewobject/view.base.hpp" |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | class __declspec(dllexport) ViewLogList : public xwin |
| | | { |
| | | public: |
| | | xdwgrid dw_list; |
| | | xoffice dw_office; |
| | | xcell dw_cell; |
| | | xnode m_agentNode; //Agent Condition |
| | | string m_category; |
| | | string argStr; |
| | | string searchStr; |
| | | |
| | | xstring m_category; |
| | | xstring argStr; |
| | | xstring searchStr; |
| | | public: |
| | | ViewLogList(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {} |
| | | public: |
| | | static ViewLogList* CreateInstance(void* implPtr, void* hWnd) |
| | | { |
| | | ViewLogList* pWin = new ViewLogList(implPtr, (HWND)hWnd); |
| | | return pWin; |
| | | } |
| | | int SetAgent() |
| | | { |
| | | string xfNodeAgentArea = "agentarea"; |
| | | xstring xfNodeAgentArea = L"agentarea"; |
| | | xnode anode = GetAgentNode(xfNodeAgentArea); |
| | | if(m_agentNode) |
| | | { |
| | | SetAgentNodeContent (anode,m_agentNode); |
| | | SetAgentNode (anode,m_agentNode); |
| | | } |
| | | else |
| | | { |
| | | msxml::IXMLDOMElement xframeElement = GetElement(); |
| | | msxml::IXMLDOMElement agent = xframeElement.selectSingleNode("agent/"+xfNodeAgentArea+"[1]/*"); |
| | | KXMLDOMElement xframeElement = GetElement(); |
| | | KXMLDOMElement agent = xframeElement.selectSingleNode(L"agent/"+xfNodeAgentArea+L"[1]/*"); |
| | | if(agent) |
| | | { |
| | | string s = agent.xml; |
| | | m_agentNode = SetAgentNodeContent (anode,s); |
| | | xstring s = agent.xml(); |
| | | m_agentNode = SetAgentNode (anode,s); |
| | | } |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | //焦点激活处理函数 |
| | | int OnSetFocus(ref TEvent evt,int param) |
| | | int OnSetFocus(TEvent* evt, LPARAM param) |
| | | { |
| | | //重置工具条 |
| | | SetAgent(); |
| | |
| | | } |
| | | |
| | | //命令发布函数 |
| | | int OnCmdDispatch(string comdid) |
| | | int OnCmdDispatch(xstring comdid) |
| | | { |
| | | int hCursor = 0; |
| | | if(comdid=="xmQuery") |
| | | HCURSOR hCursor = 0; |
| | | if(comdid==L"xmQuery") |
| | | { |
| | | xaserverarg ar = new xaserverarg; |
| | | ar.setNativePointer(ar.CreateInstance()); |
| | | ar.AddArg("argurl","/sale/view/Total3/arg/LogListItem"); |
| | | if(argStr !="") |
| | | ar.AddArg("arg",argStr); |
| | | OpenWindow("dev:xpage[view.total.arg.vx]",cast(ar as int)); |
| | | string arstr = ar.GetArgString("arg"); |
| | | if(arstr != "" && ar.GetArgString("action")=="ok") |
| | | xaserverarg ar ; |
| | | |
| | | ar.AddArg(L"argurl",L"/sale/view/Total3/arg/LogListItem"); |
| | | if(argStr !=L"") |
| | | ar.AddArg(L"arg",argStr); |
| | | OpenWindow(L"dev:xpage[view.total.arg.vx]",ar); |
| | | xstring arstr = ar.GetArgString(L"arg"); |
| | | if(arstr != L"" && ar.GetArgString(L"action")==L"ok") |
| | | { |
| | | argStr = arstr; |
| | | hCursor = xutil::SetCursorWait(); |
| | | OnRetrieve("/sale/data/Total3/total/GDNTotal/Item/LogList",argStr); |
| | | OnRetrieve(L"/sale/data/Total3/total/GDNTotal/Item/LogList",argStr); |
| | | |
| | | xutil::RestoreCursor(hCursor); |
| | | } |
| | | |
| | | else |
| | | { |
| | | argStr=""; |
| | | OnRetrieve("/sale/data/Total3/total/GDNTotal/Item/LogList",argStr); |
| | | argStr=L""; |
| | | OnRetrieve(L"/sale/data/Total3/total/GDNTotal/Item/LogList",argStr); |
| | | } |
| | | |
| | | return 1; |
| | | } |
| | | if(comdid=="xmAnalysis") |
| | | if(comdid==L"xmAnalysis") |
| | | { |
| | | hCursor = xutil::SetCursorWait(); |
| | | string str = dw_list.DataAnalysis(""); |
| | | xaserverarg arg=new xaserverarg; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("html", str); |
| | | int obj = cast(dw_list as int); |
| | | arg.AddArg("obj",obj.toString()); |
| | | OpenWindow("dev:xpage[data.vanalysis.vx]", cast(arg as int)); |
| | | xstring str = dw_list.DataAnalysis(L""); |
| | | xaserverarg arg; |
| | | ; |
| | | arg.AddArg(L"html", str); |
| | | |
| | | OpenWindow(L"dev:xpage[data.vanalysis.vx]", arg); |
| | | xutil::RestoreCursor(hCursor); |
| | | return 1; |
| | | } |
| | | if(comdid=="xmSearch") return OnSearch(); |
| | | if(comdid==L"xmSearch") return OnSearch(); |
| | | return 0; |
| | | } |
| | | |
| | | int OnSearch() |
| | | { |
| | | xaserverarg arg=new xaserverarg; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("text", searchStr); |
| | | OpenWindow("dev:xpage[search.dialog.vx]", cast(arg as int)); |
| | | string str = arg.GetArgString("text"); |
| | | xaserverarg arg; |
| | | ; |
| | | arg.AddArg(L"text", searchStr); |
| | | OpenWindow(L"dev:xpage[search.dialog.vx]", arg); |
| | | xstring str = arg.GetArgString(L"text"); |
| | | if(str != searchStr) |
| | | { |
| | | searchStr = str; |
| | | dw_list.Filter("*",searchStr); |
| | | dw_list.Filter(L"*",searchStr); |
| | | return 1; |
| | | } |
| | | return 1; |
| | |
| | | |
| | | |
| | | |
| | | int OnCombboChanged(ref TCommandEvent evt,int lParam) |
| | | int OnCombboChanged(TEvent* evt, LPARAM lParam) |
| | | { |
| | | int h = xcombobox::GetCurSel(evt.hCtrl); |
| | | int h = xcombobox::GetCurSel(evt->command.hCtrl); |
| | | if(h > -1) |
| | | { |
| | | int hCursor = xutil::SetCursorWait(); |
| | | msxml::IXMLDOMElement e = xcombobox::GetItemData(evt.hCtrl, h); |
| | | HCURSOR hCursor = xutil::SetCursorWait(); |
| | | KXMLDOMElement e = xcombobox::GetItemData(evt->command.hCtrl, h); |
| | | |
| | | win32::PostMessage(GetHWND(),0x401,"xmQuery",0); |
| | | //OnCmdDispatch("xmQuery"); |
| | | PostMessage(GetHWND(),0x401,(LPARAM)L"xmQuery",0); |
| | | //OnCmdDispatch(L"xmQuery"); |
| | | xutil::RestoreCursor(hCursor); |
| | | } |
| | | return 1; |
| | |
| | | |
| | | |
| | | //命令处理事件 |
| | | int OnXCommand(ref TXCommandEvent evt,int param) |
| | | int OnXCommand(TEvent* evt, LPARAM param) |
| | | { |
| | | return OnCmdDispatch(evt.pStrID); |
| | | return OnCmdDispatch(evt->xcommand.pStrID); |
| | | } |
| | | |
| | | int OnDWClick(ref TNotifyEvent evt,int p) |
| | | int OnDWClick(TEvent* evt, int p) |
| | | { |
| | | ref DWNMHDR hdr = trust(evt.pnmh as ref DWNMHDR); |
| | | string value = hdr.data; |
| | | string colname = hdr.colname; |
| | | DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh; |
| | | xstring value = hdr.data; |
| | | xstring colname = hdr.colname; |
| | | int row = hdr.row; |
| | | |
| | | if(row < 1) return 1; |
| | |
| | | int OnAttachEvent() |
| | | { |
| | | //绑定工具条点击事件 |
| | | AttachEvent("WM_XCOMMAND",OnXCommand); |
| | | AttachEvent(L"WM_XCOMMAND", (FEvent)&ViewLogList::OnXCommand); |
| | | //获取焦点事件,用于重置工具条 |
| | | AttachEvent("WM_SETFOCUS",OnSetFocus); |
| | | AttachEvent("cb_report","CBN_SELCHANGE",OnCombboChanged); |
| | | AttachEvent("dw_report","DWV_CLICKED",OnDWClick); |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&ViewLogList::OnSetFocus); |
| | | AttachEvent(L"cb_report",L"CBN_SELCHANGE", (FEvent)&ViewLogList::OnCombboChanged); |
| | | AttachEvent(L"dw_report",L"DWV_CLICKED", (FEvent)&ViewLogList::OnDWClick); |
| | | return 1; |
| | | } |
| | | |
| | | int OnRetrieve(string dataurl, string argstr) |
| | | int OnRetrieve(xstring dataurl, xstring argstr) |
| | | { |
| | | dw_list.Reset(); |
| | | |
| | | xml x = new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | xaserverarg arg = new xaserverarg; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("arg",argstr); |
| | | xml x ; |
| | | |
| | | xaserverarg arg ; |
| | | ; |
| | | arg.AddArg(L"arg",argstr); |
| | | //alert(argstr); |
| | | |
| | | if (url::get(dataurl,arg.GetString(),x)!=1) |
| | | if (xurl::get(dataurl,arg.GetString(),x)!=1) |
| | | { |
| | | //alert(x.GetXml()); |
| | | trace(x.GetXmlDoc().text); |
| | | //alert(x.xml()); |
| | | trace(x.text()); |
| | | dw_list.Redraw(); |
| | | return -1; |
| | | } |
| | | //alert(x.GetXml()); |
| | | //alert(x.xml()); |
| | | dw_list.Retrieve(x); |
| | | dw_list.Redraw(); |
| | | dw_list.SetReadOnly(true); |
| | |
| | | |
| | | int onload() |
| | | { |
| | | dw_list = GetControl("dw_report"); |
| | | dw_office = GetControl("dw_office"); |
| | | dw_cell = GetControl("dw_cell"); |
| | | dw_list.openUrl("/sale/view/Total3/template/business/gdn/LogList/ship/full"); |
| | | dw_list = GetControl(L"dw_report"); |
| | | dw_office = GetControl(L"dw_office"); |
| | | dw_cell = GetControl(L"dw_cell"); |
| | | dw_list.openUrl(L"/sale/view/Total3/template/business/gdn/LogList/ship/full"); |
| | | |
| | | argStr =""; |
| | | xcombobox xc = GetControl("cb_report"); |
| | | argStr =L""; |
| | | xcombobox xc = GetControl(L"cb_report"); |
| | | |
| | | |
| | | OnAttachEvent(); |
| | |
| | | int onloaded() |
| | | { |
| | | SetAgent(); |
| | | OnCmdDispatch("xmQuery"); |
| | | OnCmdDispatch(L"xmQuery"); |
| | | return 1; |
| | | } |
| | | }; |
| | | ] |
| | | }; |