/// <summary> /// 初始化工具栏 /// </summary> private void InitToolsBar() { string toolsDefault = ""; //保存 toolsDefault += "<a id=\"save\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-save'\" onclick=\"EventFactory('save')\">保存</a>"; //轨迹 toolsDefault += "<a id=\"Track\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-flowmap'\" onclick=\"EventFactory('showchart')\">轨迹</a>"; ////查询 //toolsDefault += "<a id=\"Search\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-search'\" onclick=\"EventFactory('search')\">查询</a>"; //扩展工具,显示位置为工具栏类型 NodeToolbars extToolBars = new NodeToolbars(); QueryObject info = new QueryObject(extToolBars); info.AddWhere(NodeToolbarAttr.FK_Node, this.FK_Node); info.addAnd(); info.AddWhere(NodeToolbarAttr.ShowWhere, (int)ShowWhere.Toolbar); info.DoQuery(); foreach (NodeToolbar item in extToolBars) { string url = ""; if (string.IsNullOrEmpty(item.Url)) { continue; } string urlExt = this.RequestParas; url = item.Url; if (url.Contains("?")) { url += urlExt; } else { url += "?" + urlExt; } toolsDefault += "<a target=\"" + item.Target + "\" href=\"" + url + "\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-new'\">" + item.Title + "</a>"; } //关闭 toolsDefault += "<a id=\"closeWin\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-no'\" onclick=\"EventFactory('closeWin')\">关闭</a>"; //添加内容 this.toolBars.InnerHtml = toolsDefault; }
private string GetFlowFormTree() { string flowId = getUTF8ToString("flowId"); string nodeId = getUTF8ToString("nodeId"); //add root BP.WF.Template.FlowFormTree root = new BP.WF.Template.FlowFormTree(); root.No = "01"; root.ParentNo = "0"; root.Name = "目录"; root.NodeType = "root"; appFlowFormTree.Clear(); appFlowFormTree.AddEntity(root); #region 添加表单及文件夹 //节点表单 FrmNodes frmNodes = new FrmNodes(); QueryObject qo = new QueryObject(frmNodes); qo.AddWhere(FrmNodeAttr.FK_Node, nodeId); qo.addAnd(); qo.AddWhere(FrmNodeAttr.FK_Flow, flowId); qo.addOrderBy(FrmNodeAttr.Idx); qo.DoQuery(); //文件夹 SysFormTrees formTrees = new SysFormTrees(); formTrees.RetrieveAll(SysFormTreeAttr.Name); //所有表单集合 MapDatas mds = new MapDatas(); mds.Retrieve(MapDataAttr.AppType, (int)AppType.Application); foreach (FrmNode frmNode in frmNodes) { foreach (MapData md in mds) { if (frmNode.FK_Frm != md.No) { continue; } foreach (SysFormTree formTree in formTrees) { if (md.FK_FormTree != formTree.No) { continue; } if (!appFlowFormTree.Contains("No", formTree.No)) { BP.WF.Template.FlowFormTree nodeFolder = new BP.WF.Template.FlowFormTree(); nodeFolder.No = formTree.No; nodeFolder.ParentNo = root.No; nodeFolder.Name = formTree.Name; nodeFolder.NodeType = "folder"; appFlowFormTree.AddEntity(nodeFolder); } } //检查必填项 bool IsNotNull = false; FrmFields formFields = new FrmFields(); QueryObject obj = new QueryObject(formFields); obj.AddWhere(FrmFieldAttr.FK_Node, nodeId); obj.addAnd(); obj.AddWhere(FrmFieldAttr.FK_MapData, md.No); obj.addAnd(); obj.AddWhere(FrmFieldAttr.IsNotNull, "1"); obj.DoQuery(); if (formFields != null && formFields.Count > 0) { IsNotNull = true; } BP.WF.Template.FlowFormTree nodeForm = new BP.WF.Template.FlowFormTree(); nodeForm.No = md.No; nodeForm.ParentNo = md.FK_FormTree; nodeForm.Name = md.Name; nodeForm.NodeType = IsNotNull ? "form|1" : "form|0"; appFlowFormTree.AddEntity(nodeForm); } } #endregion //扩展工具,显示位置为表单树类型 NodeToolbars extToolBars = new NodeToolbars(); QueryObject info = new QueryObject(extToolBars); info.AddWhere(NodeToolbarAttr.FK_Node, nodeId); info.addAnd(); info.AddWhere(NodeToolbarAttr.ShowWhere, (int)ShowWhere.Tree); info.DoQuery(); foreach (NodeToolbar item in extToolBars) { string url = ""; if (string.IsNullOrEmpty(item.Url)) { continue; } url = item.Url; BP.WF.Template.FlowFormTree formTree = new BP.WF.Template.FlowFormTree(); formTree.No = item.OID.ToString(); formTree.ParentNo = "01"; formTree.Name = item.Title; formTree.NodeType = "tools|0"; if (!string.IsNullOrEmpty(item.Target) && item.Target.ToUpper() == "_BLANK") { formTree.NodeType = "tools|1"; } formTree.Url = url; appFlowFormTree.AddEntity(formTree); } TansEntitiesToGenerTree(appFlowFormTree, root.No, ""); return(appendMenus.ToString()); }
/// <summary> /// 获取工具栏 /// </summary> /// <returns></returns> private string GetAppToolBar() { int fk_Node = Int32.Parse(getUTF8ToString("nodeId")); BtnLab btnLab = new BtnLab(fk_Node); StringBuilder toolsBar = new StringBuilder(); toolsBar.Append("{"); //系统工具 toolsBar.Append("tools:["); //Send,Save,Thread,Return,CC,Shift,Del,EndFLow,RptTrack,HungUp" //发送 if (btnLab.SendEnable) { toolsBar.Append("{"); toolsBar.Append("no:'Send',btnlabel:'" + btnLab.SendLab + "'"); toolsBar.Append("},"); } //保存 if (btnLab.SaveEnable) { toolsBar.Append("{"); toolsBar.Append("no:'Save',btnlabel:'" + btnLab.SaveLab + "'"); toolsBar.Append("},"); } //子线程 if (btnLab.ThreadEnable) { toolsBar.Append("{"); toolsBar.Append("no:'Thread',btnlabel:'" + btnLab.ThreadLab + "'"); toolsBar.Append("},"); } //退回 if (btnLab.ReturnEnable) { toolsBar.Append("{"); toolsBar.Append("no:'Return',btnlabel:'" + btnLab.ReturnLab + "'"); toolsBar.Append("},"); } //抄送 if (btnLab.CCRole != 0) { toolsBar.Append("{"); toolsBar.Append("no:'CC',btnlabel:'" + btnLab.CCLab + "'"); toolsBar.Append("},"); } //移交 if (btnLab.ShiftEnable) { toolsBar.Append("{"); toolsBar.Append("no:'Shift',btnlabel:'" + btnLab.ShiftLab + "'"); toolsBar.Append("},"); } //删除 if (btnLab.DeleteEnable != 0) { toolsBar.Append("{"); toolsBar.Append("no:'Del',btnlabel:'" + btnLab.DeleteLab + "'"); toolsBar.Append("},"); } //结束 if (btnLab.EndFlowEnable) { toolsBar.Append("{"); toolsBar.Append("no:'EndFLow',btnlabel:'" + btnLab.EndFlowLab + "'"); toolsBar.Append("},"); } //打印 if (btnLab.PrintDocEnable) { toolsBar.Append("{"); toolsBar.Append("no:'Rpt',btnlabel:'" + btnLab.PrintDocLab + "'"); toolsBar.Append("},"); } //轨迹 if (btnLab.TrackEnable) { toolsBar.Append("{"); toolsBar.Append("no:'Track',btnlabel:'" + btnLab.TrackLab + "'"); toolsBar.Append("},"); } //挂起 if (btnLab.HungEnable) { toolsBar.Append("{"); toolsBar.Append("no:'HungUp',btnlabel:'" + btnLab.HungLab + "'"); toolsBar.Append("},"); } if (toolsBar.Length > 8) { toolsBar.Remove(toolsBar.Length - 1, 1); } toolsBar.Append("]"); //扩展工具 NodeToolbars extToolBars = new NodeToolbars(); extToolBars.RetrieveByAttr(NodeToolbarAttr.FK_Node, fk_Node); toolsBar.Append(",extTools:["); if (extToolBars.Count > 0) { foreach (NodeToolbar item in extToolBars) { toolsBar.Append("{OID:'" + item.OID + "',Title:'" + item.Title + "',Target:'" + item.Target + "',Url:'" + item.Url + "'},"); } toolsBar.Remove(toolsBar.Length - 1, 1); } toolsBar.Append("]"); toolsBar.Append("}"); return(toolsBar.ToString()); }
/// <summary> /// 初始化工具栏 /// </summary> private void InitToolsBar() { string toolsDefault = ""; string extMenuHTML = ""; int toolCount = 0; int alowToolCount = 8; BtnLab btnLab = new BtnLab(this.FK_Node); this.mm3.Visible = false; //发送 if (btnLab.SendEnable && currND.HisBatchRole != BatchRole.Group) { toolsDefault += "<a id=\"send\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-send'\" onclick=\"EventFactory('send')\">" + btnLab.SendLab + "</a>"; toolCount++; } //保存 if (btnLab.SaveEnable) { toolsDefault += "<a id=\"save\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-save'\" onclick=\"EventFactory('save')\">" + btnLab.SaveLab + "</a>"; toolCount++; } //子线程 if (btnLab.ThreadEnable) { toolsDefault += "<a id=\"childline\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-childline'\" onclick=\"EventFactory('childline')\">" + btnLab.ThreadLab + "</a>"; toolCount++; } //跳转 if (btnLab.JumpWayEnable) { toolsDefault += "<a id=\"jumpNode\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-redo'\" onclick=\"EventFactory('jumpway')\">" + btnLab.JumpWayLab + "</a>"; toolCount++; } //退回 if (btnLab.ReturnEnable) { toolsDefault += "<a id=\"turnBack\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-back'\" onclick=\"EventFactory('backcase')\">" + btnLab.ReturnLab + "</a>"; toolCount++; } //抄送 if (btnLab.CCRole != 0) { toolsDefault += "<a id=\"A1\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-ccsmall'\" onclick=\"EventFactory('CC')\">" + btnLab.CCLab + "</a>"; toolCount++; } //移交 if (btnLab.ShiftEnable) { toolsDefault += "<a id=\"ShiftLab\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-transfer'\" onclick=\"EventFactory('Shift')\">" + btnLab.ShiftLab + "</a>"; toolCount++; } //删除 if (btnLab.DeleteEnable != 0) { toolsDefault += "<a id=\"DeleteLab\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-delete'\" onclick=\"EventFactory('Del')\">" + "删除" + "</a>"; toolCount++; } //结束 if (btnLab.EndFlowEnable) { //超出范围增加到菜单里面 if (toolCount > alowToolCount) { extMenuHTML += "<div data-options=\"plain:true,iconCls:'icon-no'\" onclick=\"EventFactory('endflow')\">" + btnLab.EndFlowLab + "</div>"; } else { toolsDefault += "<a id=\"EndFlow\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-no'\" onclick=\"EventFactory('endflow')\">" + btnLab.EndFlowLab + "</a>"; } toolCount++; } //打印 if (btnLab.PrintDocEnable) { //超出范围增加到菜单里面 if (toolCount > alowToolCount) { extMenuHTML += "<div data-options=\"plain:true,iconCls:'icon-print'\" onclick=\"EventFactory('printdoc')\">" + btnLab.PrintDocLab + "</div>"; } else { toolsDefault += "<a id=\"PrintDoc\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-print'\" onclick=\"EventFactory('printdoc')\">" + btnLab.PrintDocLab + "</a>"; } toolCount++; } //轨迹 if (btnLab.TrackEnable) { //超出范围增加到菜单里面 if (toolCount > alowToolCount) { extMenuHTML += "<div data-options=\"plain:true,iconCls:'icon-flowmap'\" onclick=\"EventFactory('showchart')\">" + btnLab.TrackLab + "</div>"; } else { toolsDefault += "<a id=\"Track\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-flowmap'\" onclick=\"EventFactory('showchart')\">" + btnLab.TrackLab + "</a>"; } toolCount++; } //挂起 if (btnLab.HungEnable) { //超出范围增加到菜单里面 if (toolCount > alowToolCount) { extMenuHTML += "<div data-options=\"plain:true,iconCls:'icon-hungup'\" onclick=\"EventFactory('hungup')\">" + btnLab.HungLab + "</div>"; } else { toolsDefault += "<a id=\"Hung\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-hungup'\" onclick=\"EventFactory('hungup')\">" + btnLab.HungLab + "</a>"; } toolCount++; } //接收人 if (btnLab.SelectAccepterEnable == 1) { //超出范围增加到菜单里面 if (toolCount > alowToolCount) { extMenuHTML += "<div data-options=\"plain:true,iconCls:'icon-person'\" onclick=\"EventFactory('selectaccepter')\">" + btnLab.SelectAccepterLab + "</div>"; } else { toolsDefault += "<a id=\"SelectAccepter\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-person'\" onclick=\"EventFactory('selectaccepter')\">" + btnLab.SelectAccepterLab + "</a>"; } toolCount++; } //查询 if (btnLab.SearchEnable) { //超出范围增加到菜单里面 if (toolCount > alowToolCount) { extMenuHTML += "<div data-options=\"plain:true,iconCls:'icon-search'\" onclick=\"EventFactory('search')\">" + btnLab.SearchLab + "</div>"; } else { toolsDefault += "<a id=\"Search\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-search'\" onclick=\"EventFactory('search')\">" + btnLab.SearchLab + "</a>"; } toolCount++; } //审核 if (btnLab.WorkCheckEnable) { //超出范围增加到菜单里面 if (toolCount > alowToolCount) { extMenuHTML += "<div data-options=\"plain:true,iconCls:'icon-note'\" onclick=\"EventFactory('workcheck')\">" + btnLab.WorkCheckLab + "</div>"; } else { toolsDefault += "<a id=\"WorkCheck\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-note'\" onclick=\"EventFactory('workcheck')\">" + btnLab.WorkCheckLab + "</a>"; } toolCount++; } //批量审核 if (btnLab.BatchEnable) { //超出范围增加到菜单里面 if (toolCount > alowToolCount) { extMenuHTML += "<div data-options=\"plain:true,iconCls:'icon-note'\" onclick=\"EventFactory('batchworkcheck')\">" + btnLab.BatchLab + "</div>"; } else { toolsDefault += "<a id=\"BatchWorkCheck\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-note'\" onclick=\"EventFactory('batchworkcheck')\">" + btnLab.BatchLab + "</a>"; } toolCount++; } //加签 if (btnLab.AskforEnable) { //超出范围增加到菜单里面 if (toolCount > alowToolCount) { extMenuHTML += "<div data-options=\"plain:true,iconCls:'icon-tag'\" onclick=\"EventFactory('askfor')\">" + btnLab.AskforLab + "</div>"; } else { toolsDefault += "<a id=\"Askfor\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-tag'\" onclick=\"EventFactory('askfor')\">" + btnLab.AskforLab + "</a>"; } toolCount++; } //超出范围增加到菜单里面 if (toolCount > alowToolCount) { //extMenuHTML += "<div data-options=\"plain:true,iconCls:'icon-tag'\" onclick=\"addTab('ycfj','已传附件','/app/function/office/iofficefj.aspx?WorkID=" + this.WorkID + "&UserNo=" + WebUser.No + "&FID=" + this.FID + "');\">已传附件</div>"; //项目备案数据 //extMenuHTML += "<div data-options=\"plain:true,iconCls:'icon-tag'\" onclick=\"addTab('basj','备案数据','/DataBak.aspx?WorkID=" + this.WorkID + "&UserNo=" + WebUser.No + "&FID=" + this.FID + "');\">备案数据</div>"; } else { //toolsDefault += "<a id=\"ycfj\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-tag'\" onclick=\"addTab('ycfj','已传附件','/app/function/office/iofficefj.aspx?WorkID=" + this.WorkID + "&UserNo=" + WebUser.No + "&FID=" + this.FID + "');\">已传附件</a>"; //一键签名 //toolsDefault += "<a id=\"ycfj\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-note'\" onclick=\"EventFactory('Sign')\">一键签名</a>"; //备案数据 //toolsDefault += "<a id=\"DataBak\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-tag'\" onclick=\"addTab('basj','备案数据','/DataBak.aspx?WorkID=" + this.WorkID + "&UserNo=" + WebUser.No + "&FID=" + this.FID + "');\">备案数据</a>"; } //扩展工具,显示位置为工具栏类型 NodeToolbars extToolBars = new NodeToolbars(); QueryObject info = new QueryObject(extToolBars); info.AddWhere(NodeToolbarAttr.FK_Node, this.FK_Node); info.addAnd(); info.AddWhere(NodeToolbarAttr.ShowWhere, (int)ShowWhere.Toolbar); info.DoQuery(); foreach (NodeToolbar item in extToolBars) { string url = ""; if (string.IsNullOrEmpty(item.Url)) { continue; } string urlExt = this.RequestParas; //urlExt = "WorkID=" + this.WorkID + "&FK_Flow=" + this.FK_Flow + "&FK_Node=" + this.FK_Node + "&UserNo=" + WebUser.No + "&FID=" + this.FID + "&SID=" + WebUser.SID + "&CWorkID=" + this.CWorkID; url = item.Url; if (url.Contains("?")) { url += urlExt; } else { url += "?" + urlExt; } //超出范围增加到菜单里面 if (toolCount > alowToolCount) { if (!string.IsNullOrEmpty(item.Target) && item.Target.ToLower() == "javascript") { extMenuHTML += "<div data-options=\"plain:true,iconCls:'icon-new'\" onclick=\"" + item.Url + "\">" + item.Title + "</div>"; } else { extMenuHTML += "<div data-options=\"plain:true,iconCls:'icon-new'\" onclick=\"WinOpenPage('" + item.Target + "','" + url + "','" + item.Title + "')\">" + item.Title + "</div>"; } } else { if (!string.IsNullOrEmpty(item.Target) && item.Target.ToLower() == "javascript") { toolsDefault += "<a href=\"#\" onclick=\"" + item.Url + "\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-new'\">" + item.Title + "</a>"; } else { toolsDefault += "<a target=\"" + item.Target + "\" href=\"" + url + "\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-new'\">" + item.Title + "</a>"; } toolCount++; } } //判断是否出现添加菜单 if (toolCount > alowToolCount) { this.mm3.Visible = true; toolsDefault += "<a href=\"javascript:void(0)\" id=\"mb3\" class=\"easyui-menubutton\" data-options=\"menu:'#mm3',plain:true,iconCls:'icon-add'\"></a>"; } toolsDefault += "<a id=\"closeWin\" href=\"#\" class=\"easyui-linkbutton\" data-options=\"plain:true,iconCls:'icon-no'\" onclick=\"EventFactory('closeWin')\">关闭</a>"; //添加内容 this.toolBars.InnerHtml = toolsDefault; this.mm3.InnerHtml = extMenuHTML; }
private string GetFlowFormTree() { //add root BP.WF.Template.FlowFormTree root = new BP.WF.Template.FlowFormTree(); root.No = "00"; root.ParentNo = "0"; root.Name = "目录"; root.NodeType = "root"; appFlowFormTree.Clear(); appFlowFormTree.AddEntity(root); #region 添加表单及文件夹 //节点表单 string tfModel = SystemConfig.AppSettings["TreeFrmModel"]; BP.WF.Node nd = new BP.WF.Node(this.FK_Node); FrmNodes frmNodes = new FrmNodes(); QueryObject qo = new QueryObject(frmNodes); qo.AddWhere(FrmNodeAttr.FK_Node, this.FK_Node); qo.addAnd(); qo.AddWhere(FrmNodeAttr.FK_Flow, this.FK_Flow); //如果配置了启用关键字段,一下会判断绑定的独立表单中的关键字段是否有数据,没有就不会被显示 // add by 海南 zqp if (tfModel == "1") { //针对合流点与分合流节点有效 //获取独立表单的字段 MapDatas mdes = new MapDatas(); string mypks = ""; if (nd.IsStartNode == false) { qo.addOrderBy(FrmNodeAttr.Idx); qo.DoQuery(); foreach (FrmNode fn in frmNodes) { if (fn.HisFrmType == FrmType.Column4Frm || fn.HisFrmType == FrmType.FreeFrm) { mdes.Retrieve(MapDataAttr.No, fn.FK_Frm); //根据设置的关键字段是否有值,进行判断 foreach (MapData md in mdes) { Paras ps = new Paras(); ps.SQL = "SELECT " + fn.GuanJianZiDuan + " FROM " + md.PTable + " WHERE " + " OID=" + SystemConfig.AppCenterDBVarStr + "OID"; if (this.FID == 0) { ps.Add("OID", this.WorkID); } else { ps.Add("OID", this.FID); } try { DataTable dtmd = BP.DA.DBAccess.RunSQLReturnTable(ps); string dtVal = dtmd.Rows[0]["" + fn.GuanJianZiDuan + ""].ToString(); if (string.IsNullOrWhiteSpace(dtVal)) { mypks = mypks + "'" + md.No + "',"; } } catch (Exception ex) { mypks = mypks + "'" + md.No + "',"; } } } } mypks = mypks.TrimEnd(','); if (!string.IsNullOrWhiteSpace(mypks)) { //添加查询条件 qo = new QueryObject(frmNodes); qo.AddWhere(FrmNodeAttr.FK_Node, this.FK_Node); qo.addAnd(); qo.AddWhere(FrmNodeAttr.FK_Flow, this.FK_Flow); qo.addAnd(); qo.AddWhere(FrmNodeAttr.FK_Frm + " not in(" + mypks + ")"); qo.addOrderBy(FrmNodeAttr.Idx); qo.DoQuery(); } } else { qo.addOrderBy(FrmNodeAttr.Idx); qo.DoQuery(); } } else { qo.addOrderBy(FrmNodeAttr.Idx); qo.DoQuery(); } //文件夹 SysFormTrees formTrees = new SysFormTrees(); formTrees.RetrieveAll(SysFormTreeAttr.Name); //所有表单集合 MapDatas mds = new MapDatas(); mds.RetrieveInSQL("SELECT FK_Frm FROM WF_FrmNode WHERE FK_Node=" + this.FK_Node); foreach (FrmNode frmNode in frmNodes) { #region 增加判断是否启用规则. switch (frmNode.FrmEnableRole) { case FrmEnableRole.Allways: break; case FrmEnableRole.WhenHaveData: //判断是否有数据. MapData md = new MapData(frmNode.FK_Frm); if (DBAccess.RunSQLReturnValInt("SELECT COUNT(*) as Num FROM " + md.PTable + " WHERE OID=" + this.WorkID) == 0) { continue; } break; case FrmEnableRole.WhenHaveFrmPara: //判断是否有参数. string frms = this.Request.QueryString["Frms"]; if (frms != null && frms.Contains(frmNode.FK_Frm) == true) { /*包含这个表单.*/ } else { continue; } break; case FrmEnableRole.ByFrmFields: throw new Exception("@这种类型的判断,ByFrmFields 还没有完成。"); case FrmEnableRole.BySQL: // 按照SQL的方式. string mysql = frmNode.FrmEnableExp.Clone() as string; mysql = mysql.Replace("@OID", this.WorkID.ToString()); mysql = mysql.Replace("@WorkID", this.WorkID.ToString()); mysql = mysql.Replace("@NodeID", this.FK_Node.ToString()); mysql = mysql.Replace("@FK_Node", this.FK_Node.ToString()); mysql = mysql.Replace("@FK_Flow", this.FK_Flow); if (DBAccess.RunSQLReturnValFloat(mysql) <= 0) { continue; } break; case FrmEnableRole.Disable: // 如果禁用了,就continue出去.. continue; default: throw new Exception("@没有判断的规则." + frmNode.FrmEnableRole); } #endregion #region 检查是否有没有目录的表单? bool isHave = false; foreach (MapData md in mds) { if (md.FK_FormTree == "") { isHave = true; break; } } string treeNo = "0"; if (isHave && mds.Count == 1) { treeNo = "0"; } else if (isHave == true) { foreach (MapData md in mds) { if (md.FK_FormTree != "") { treeNo = md.FK_FormTree; break; } } } #endregion 检查是否有没有目录的表单? foreach (MapData md in mds) { if (frmNode.FK_Frm != md.No) { continue; } #warning 这里有错误, 如果是节点表单的话,就没有这个值,没有这个值就绑定不到表单树,代国强解决. if (md.FK_FormTree == "") { md.FK_FormTree = treeNo; } foreach (SysFormTree formTree in formTrees) { if (md.FK_FormTree != formTree.No) { continue; } if (appFlowFormTree.Contains("No", formTree.No) == false) { BP.WF.Template.FlowFormTree nodeFolder = new BP.WF.Template.FlowFormTree(); nodeFolder.No = formTree.No; nodeFolder.ParentNo = root.No; nodeFolder.Name = formTree.Name; nodeFolder.NodeType = "folder"; appFlowFormTree.AddEntity(nodeFolder); } } //检查必填项 bool IsNotNull = false; FrmFields formFields = new FrmFields(); QueryObject obj = new QueryObject(formFields); obj.AddWhere(FrmFieldAttr.FK_Node, this.FK_Node); obj.addAnd(); obj.AddWhere(FrmFieldAttr.FK_MapData, md.No); obj.addAnd(); obj.AddWhere(FrmFieldAttr.IsNotNull, "1"); obj.DoQuery(); if (formFields != null && formFields.Count > 0) { IsNotNull = true; } BP.WF.Template.FlowFormTree nodeForm = new BP.WF.Template.FlowFormTree(); nodeForm.No = md.No; nodeForm.ParentNo = md.FK_FormTree; nodeForm.Name = md.Name; nodeForm.NodeType = IsNotNull ? "form|1" : "form|0"; nodeForm.IsEdit = Convert.ToString(Convert.ToInt32(frmNode.IsEdit)); appFlowFormTree.AddEntity(nodeForm); } } #endregion //扩展工具,显示位置为表单树类型 NodeToolbars extToolBars = new NodeToolbars(); QueryObject info = new QueryObject(extToolBars); info.AddWhere(NodeToolbarAttr.FK_Node, this.FK_Node); info.addAnd(); info.AddWhere(NodeToolbarAttr.ShowWhere, (int)ShowWhere.Tree); info.DoQuery(); foreach (NodeToolbar item in extToolBars) { string url = ""; if (string.IsNullOrEmpty(item.Url)) { continue; } url = item.Url; BP.WF.Template.FlowFormTree formTree = new BP.WF.Template.FlowFormTree(); formTree.No = item.OID.ToString(); formTree.ParentNo = "01"; formTree.Name = item.Title; formTree.NodeType = "tools|0"; if (!string.IsNullOrEmpty(item.Target) && item.Target.ToUpper() == "_BLANK") { formTree.NodeType = "tools|1"; } formTree.Url = url; appFlowFormTree.AddEntity(formTree); } TansEntitiesToGenerTree(appFlowFormTree, root.No, ""); return(appendMenus.ToString()); }