| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #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 "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 |
| | | 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() |
| | | { |
| | | xstring xfNodeAgentArea = L"agentarea"; |
| | | xnode anode = GetAgentNode(xfNodeAgentArea); |
| | | if(m_agentNode) |
| | | { |
| | | SetAgentNode (anode,m_agentNode); |
| | | } |
| | | else |
| | | { |
| | | KXMLDOMElement xframeElement = GetElement(); |
| | | KXMLDOMElement agent = xframeElement.selectSingleNode(L"agent/"+xfNodeAgentArea+L"[1]/*"); |
| | | if(agent) |
| | | { |
| | | xstring s = agent.xml(); |
| | | m_agentNode = SetAgentNode (anode,s); |
| | | } |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | //ç¦ç¹æ¿æ´»å¤ç彿° |
| | | int OnSetFocus(TEvent* evt, LPARAM param) |
| | | { |
| | | //é置工å
·æ¡ |
| | | SetAgent(); |
| | | return 1; |
| | | } |
| | | |
| | | //å½ä»¤åå¸å½æ° |
| | | int OnCmdDispatch(xstring comdid) |
| | | { |
| | | HCURSOR hCursor = 0; |
| | | if(comdid==L"xmQuery") |
| | | { |
| | | 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(L"/sale/data/Total3/total/GDNTotal/Item/LogList",argStr); |
| | | |
| | | xutil::RestoreCursor(hCursor); |
| | | } |
| | | |
| | | else |
| | | { |
| | | argStr=L""; |
| | | OnRetrieve(L"/sale/data/Total3/total/GDNTotal/Item/LogList",argStr); |
| | | } |
| | | |
| | | return 1; |
| | | } |
| | | if(comdid==L"xmAnalysis") |
| | | { |
| | | hCursor = xutil::SetCursorWait(); |
| | | 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==L"xmSearch") return OnSearch(); |
| | | return 0; |
| | | } |
| | | |
| | | int OnSearch() |
| | | { |
| | | 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(L"*",searchStr); |
| | | return 1; |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | |
| | | int OnCombboChanged(TEvent* evt, LPARAM lParam) |
| | | { |
| | | int h = xcombobox::GetCurSel(evt->command.hCtrl); |
| | | if(h > -1) |
| | | { |
| | | HCURSOR hCursor = xutil::SetCursorWait(); |
| | | KXMLDOMElement e = xcombobox::GetItemData(evt->command.hCtrl, h); |
| | | |
| | | PostMessage(GetHWND(),0x401,(LPARAM)L"xmQuery",0); |
| | | //OnCmdDispatch(L"xmQuery"); |
| | | xutil::RestoreCursor(hCursor); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | |
| | | //å½ä»¤å¤çäºä»¶ |
| | | int OnXCommand(TEvent* evt, LPARAM param) |
| | | { |
| | | return OnCmdDispatch(evt->xcommand.pStrID); |
| | | } |
| | | |
| | | int OnDWClick(TEvent* evt, int p) |
| | | { |
| | | DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh; |
| | | xstring value = hdr.data; |
| | | xstring colname = hdr.colname; |
| | | int row = hdr.row; |
| | | |
| | | if(row < 1) return 1; |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | int OnAttachEvent() |
| | | { |
| | | //ç»å®å·¥å
·æ¡ç¹å»äºä»¶ |
| | | AttachEvent(L"WM_XCOMMAND", (FEvent)&ViewLogList::OnXCommand); |
| | | //è·åç¦ç¹äºä»¶ï¼ç¨äºé置工å
·æ¡ |
| | | 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(xstring dataurl, xstring argstr) |
| | | { |
| | | dw_list.Reset(); |
| | | |
| | | xml x ; |
| | | |
| | | xaserverarg arg ; |
| | | ; |
| | | arg.AddArg(L"arg",argstr); |
| | | //alert(argstr); |
| | | |
| | | if (xurl::get(dataurl,arg.GetString(),x)!=1) |
| | | { |
| | | //alert(x.xml()); |
| | | trace(x.text()); |
| | | dw_list.Redraw(); |
| | | return -1; |
| | | } |
| | | //alert(x.xml()); |
| | | dw_list.Retrieve(x); |
| | | dw_list.Redraw(); |
| | | dw_list.SetReadOnly(true); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | int onload() |
| | | { |
| | | 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 =L""; |
| | | xcombobox xc = GetControl(L"cb_report"); |
| | | |
| | | |
| | | OnAttachEvent(); |
| | | return 1; |
| | | } |
| | | |
| | | int onloaded() |
| | | { |
| | | SetAgent(); |
| | | OnCmdDispatch(L"xmQuery"); |
| | | return 1; |
| | | } |
| | | }; |