xj qian
2024-06-28 50a37dbe8b73033a6295c9794c0f2f1b8db2b469
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include <wobject/xwin.hpp>
#include <xcontrol/xdwgrid.hpp>
#include <xcontrol/xflowchart.hpp>
#include <xcontrol/ximageview.hpp>
 
using xml = KXMLDOMDocument;
class __declspec(dllexport) workflow_actionlog : public xwin
{
public:
    workflow_actionlog(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {}
    static workflow_actionlog* CreateInstance(void* implPtr, void* hWnd)
    {
        workflow_actionlog* pWin = new workflow_actionlog(implPtr, (HWND)hWnd);
        return pWin;
    }
 
public:
    //ÃüÁî·¢²¼º¯Êý
    int OnCmdDispatch(xstring comdid)
    {
        CloseWindow();
        return 0;
    }
 
    //ÃüÁî´¦Àíʼþ
    int OnXCommand(TEvent* evt, int param)
    {
        return OnCmdDispatch(evt->xcommand.pStrID);
    }
 
    int OnAttachEvent()
    {
        //°ó¶¨¹¤¾ßÌõµã»÷ʼþ
        AttachEvent(L"WM_XCOMMAND", (FEvent)& workflow_actionlog::OnXCommand);
        return 1;
    }
 
 
    int onload()
    {
        SetArg();
        OnAttachEvent();
 
        xdwgrid dw_loglist = GetControl(L"dw_loglist");
        dw_loglist.openUrl(L"/sale/view/workflow.view/template/chkdlg/loglist");
 
        if (GetWinParam())
        {
            xaserverarg argx;
            xaserverarg arg = GetArg();
            argx.AddArg(L"EntityID", arg.GetArgString(L"EntityID"));
            xml x;
            xurl::get(L"/sale/data/workflow.core/workflow/chk/loglist", argx.GetString(), x);
            dw_loglist.Retrieve(x);
            dw_loglist.SetReadOnly(true);
 
            xflowchart dw_chart = GetControl(L"dw_logchart");
            xml xc;
            xurl::get(L"/sale/data/workflow.core/workflow/chk/logchart", argx.GetString(), xc);
            KXMLDOMElement e = xc.documentElement();
            dw_chart.Load(e);
 
            ximageview im = GetControl(L"image");
            im.AddImages((xstring)L"/business/flow/" + arg.GetArgString(L"EntityName") + L".jpg");
        }
        return 1;
    }
 
};