LiFan
9 天以前 d4726c427464d5fa50c9fce848831c4cec36d8d1
jrj/xframe/vbusiness/vframe/frame.vframe.vbusiness.hpp
@@ -3,6 +3,9 @@
#include <wobject/xwin.hpp>
#include <wobject/xurl.hpp>
#include <wobject/xapp.hpp>
#include "viewobject/view.base.hpp"
#include "xcontrol/xshtml.hpp"
class xframe : public xwin
{
public:
@@ -167,13 +170,13 @@
         if (MessageBoxW(GetHWND(),L"是否确定删除记录!",L"提示", 1) == 2)
            return 1;
      }
      xaserverarg& arg = *(new xaserverarg);
      arg.AddArg(L"Action", action);
      KXMLDOMDocument x;
      xstring aurl =L"/workflow/query/actioninfo/" + action;
      if (xurl::get(GetServerUrl(),aurl,L"", x) != 1)
         return -1;
@@ -284,8 +287,8 @@
         if (x1.selectSingleNode(L"//process"))
         {
            KXMLDOMElement e1 = x1.selectSingleNode(L"//process");
            string valid = e1.getAttribute(L"valid");
            string finished = e1.getAttribute(L"finished");
            xstring valid = e1.getAttribute(L"valid");
            xstring finished = e1.getAttribute(L"finished");
            xstring errInfo =L"";
            if (valid ==L"0")
            {
@@ -389,6 +392,22 @@
      return L"";
   }
   virtual int ShowAgentInfo(xstring scene, xstring EntityID)
   {
      if (EntityID != L"")
      {
         KXMLDOMDocument x = ViewObject::RetrieveData(L"/sale/data/Agent/entity", L"scene",scene,L"EntityID", EntityID);
         if (x)
         {
            xshtml xs =GetControl(L"frame:agentinfo");
            string content = x.xml();
            xs.SetContent(content);
            xs.Redraw();
         }
      }
      return 1;
   }
   virtual int SetAgent(xstring scene, xstring EntityID)
   {
      xstring xfNodeAgentArea =L"agentarea";
@@ -412,8 +431,12 @@
      int  nlen = nlist.length();
      KXMLDOMElement ele;
      auto elenode = anode.GetElement();
      xstring nodeName = elenode.tagName();
      xstring tools =L"<vbox class=''>";
      if (scene ==L"list") tools +=L"<xspace height='12'/>";
      if (nodeName == L"hbox")tools = L"<hbox class=''>";
      for (index = 0; index < nlen; index++)
      {
@@ -432,10 +455,20 @@
         xstring tool;
         if (src !=L"")
            tool =(xstring)L"<xtoolbutton src='" + src +L"'  caption='" + label +L"' name='action:" + name +L"' height='23' style='background-color:none #ceecce  none #ffffff'/>";
         if (nodeName == L"hbox")
         {
            if (src != L"")
               tool = (xstring)L"<xtoolbutton src='" + src + L"'  caption='" + label + L"' name='action:" + name + L"' width='70'  style='font-family:思源黑体 CN Bold;font-size:8pt'/>";
            else
               tool = (xstring)L"<xtoolbutton image='" + image + L"'  caption='" + label + L"' name='action:" + name + L"' width='70'  style='font-family:思源黑体 CN Bold;font-size:8pt'/>";
         }
         else
            tool =(xstring)L"<xtoolbutton image='" + image +L"'  caption='" + label +L"' name='action:" + name +L"' height='23'  style='background-color:none #ceecce none #ffffff'/>";
         {
            if (src != L"")
               tool = (xstring)L"<xtoolbutton src='" + src + L"'  caption='" + label + L"' name='action:" + name + L"' height='23' style='background-color:none #ceecce  none #ffffff'/>";
            else
               tool = (xstring)L"<xtoolbutton image='" + image + L"'  caption='" + label + L"' name='action:" + name + L"' height='23'  style='background-color:none #ceecce none #ffffff'/>";
         }
         tools += tool;
      }
      if (agent)
@@ -449,7 +482,78 @@
            tools += tmp;
         }
      }
      tools +=L"</vbox>";
      if (nodeName == L"hbox")
         tools += L"</hbox>";
      else
         tools +=L"</vbox>";
      SetAgentNode(anode, tools);
      if (GetControl(L"frame:agentinfo"))ShowAgentInfo(scene,EntityID);
      return 1;
   }
   virtual int SetAgent1(xstring scene, xstring EntityID)
   {
      xstring xfNodeAgentArea = L"agentarea";
      xnode anode = GetAgentNode(xfNodeAgentArea);
      KXMLDOMElement xframeElement = GetElement();
      KXMLDOMNode agent = xframeElement.selectSingleNode(L"agent/" + xfNodeAgentArea + L"[1]/*");
      KXMLDOMDocument x;
      xaserverarg arg;
      arg.AddArg(L"scene", scene, L"xs:string");
      arg.AddArg(L"EntityID", EntityID, L"xs:string");
      arg.AddArg(L"TaskID", GetTaskID(), L"xs:string");
      arg.AddArg(L"EntityName", GetEntityName(1), L"xs:string");
      xurl::get(GetServerUrl(), (xstring)L"/workflow/query/datarole/" + GetEntityName(1), arg.GetString(), x);
      //if(x.GetXmlDoc().selectSingleNode("datarole/rightes/right"))
      SetObjectInfo(x.documentElement());
      xstring sNodes;
      sNodes = (xstring)L"datarole/actions/action[contains(@scene,'" + scene + L"')]";
      KXMLDOMNodeList nlist = x.selectNodes(sNodes);
      int  index;
      int  nlen = nlist.length();
      KXMLDOMElement ele;
      xstring tools = L"<vbox class=''>";
      if (scene == L"list") tools += L"<xspace height='12'/>";
      for (index = 0; index < nlen; index++)
      {
         ele = nlist.item(index);
         xstring name = ele.selectSingleNode(L"@id").text();//.getAttribute("id");
         xstring label = ele.selectSingleNode(L"@caption").text();//ele.getAttribute("caption");
         xstring image;
         xstring src = L"";
         if (ele.selectSingleNode(L"@image"))
            image = ele.selectSingleNode(L"@image").text();
         else
            image = L"0 22";
         if (ele.selectSingleNode(L"@src"))
            src = ele.selectSingleNode(L"@src").text();
         xstring tool;
         if (src != L"")
            tool = (xstring)L"<xtoolbutton src='" + src + L"'  caption='" + label + L"' name='action:" + name + L"' height='23' style='background-color:none #ceecce  none #ffffff'/>";
         else
            tool = (xstring)L"<xtoolbutton image='" + image + L"'  caption='" + label + L"' name='action:" + name + L"' height='23'  style='background-color:none #ceecce none #ffffff'/>";
         tools += tool;
      }
      if (agent)
      {
         nlist = agent.selectNodes(L".//xtoolbutton");
         nlen = nlist.length();
         for (index = 0; index < nlen; index++)
         {
            ele = nlist.item(index);
            xstring tmp = ele.xml();
            tools += tmp;
         }
      }
      tools += L"</vbox>";
      SetAgentNode(anode, tools);
      return 1;