LiFan
2025-04-24 9b3b2eb20b09e13da837a28f16e552ba70a090c4
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
70
71
72
73
74
75
76
77
78
79
#include <wobject/xwin.hpp>
#include <xcontrol/xdwgrid.hpp>
#include <xcontrol/xflowchart.hpp>
#include <xcontrol/ximageview.hpp>
 
using xml = KXMLDOMDocument;
class __declspec(dllexport) workflow_chkdlg_vd : public xwin
{
public:
    workflow_chkdlg_vd(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {}
    static workflow_chkdlg_vd* CreateInstance(void* implPtr, void* hWnd)
    {
        workflow_chkdlg_vd* pWin = new workflow_chkdlg_vd(implPtr, (HWND)hWnd);
        return pWin;
    }
public:
 
    //ÃüÁî·¢²¼º¯Êý
    int OnCmdDispatch(xstring comdid)
    {
        if (GetWinParam())
        {
            xaserverarg arg = GetArg();
            if (comdid == L"xmOK")
            {
                xcontrol xc = GetControl(L"content");
                xstring str = xc.GetText();
                if (str == L"")str = L".";
                arg.AddArg(L"content", str);
            }
            arg.AddArg(L"comdid", comdid);
        }
        CloseWindow();
        return 0;
    }
 
    //ÃüÁî´¦Àíʼþ
    int OnXCommand(TEvent* evt, int param)
    {
        return OnCmdDispatch(evt->xcommand.pStrID);
    }
 
    int OnAttachEvent()
    {
        //°ó¶¨¹¤¾ßÌõµã»÷ʼþ
        AttachEvent(L"WM_XCOMMAND", (FEvent)&workflow_chkdlg_vd::OnXCommand);
        return 1;
    }
 
 
    int onload()
    {
        SetArg();
        OnAttachEvent();
        xaserverarg arg;
        if (GetWinParam())
        {
            arg = GetArg();
            xcontrol xc = GetControl(L"content");
            xc.SetText(arg.GetArgString(L"content"));
        }
 
        xdwgrid dw_loglist = GetControl(L"dw_loglist");
        dw_loglist.openUrl(L"/sale/view/workflow.view/template/chkdlg/loglist");
 
        if (GetWinParam())
        {
            xaserverarg argx;
            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);
        }
 
        return 1;
    }
};