Select Case e.node.Name
Case e.node.Name
Dim dr As DataRow
Dim dr1 As DataRow
Dim dr2 As DataRow
Dim dr3 As DataRow
Dim dr4 As DataRow
Dim Filter As String
Dim nms1() As String = _UserRoles.Split(",")
If Forms.Contains(e.Node.Name)= False Then
dr = DataTables("表加载树设置").Find("表名 = '" & e.node.Name & "'")
Dim nms() As String
Dim kd As String
Dim hs As String
If dr IsNot Nothing Then
kd = dr("宽度")
hs = dr("行数")
If dr.Isnull("列名")=False Then
nms = dr("列名").Split(",")
End If
End If
For Each nm As String In nms1
dr1 = DataTables("加载内容权限表").Find("表名 = '" & e.node.Name & "' and 角色 like '%" & nm & "%' and 列名 is not null and 列内容 is not null and 制单人=false")
dr2 = DataTables("加载内容权限表").Find("表名 = '" & e.node.Name & "' and 角色 like '%" & nm & "%' and 制单人 = true")
If dr1 IsNot Nothing Then
Filter = dr1("列名") & " In ( '" & dr1("列内容").replace(",","','") & "')"
ElseIf dr2 IsNot Nothing Then
Filter = dr2("制单人列") & " = '" & _UserName & "'"
Else
Filter = ""
End If
Next
If DataTables.Contains(e.node.Name) = False Then '初始未加载表
DataTables.Load(e.node.Name) '先加载表
DataTables(e.node.Name).LoadFilter = Filter '加载条件
DataTables(e.node.Name).Load() '加载数据
Else '如果已经加载表但未加载数据
DataTables(e.node.Name).LoadFilter = Filter
DataTables(e.node.Name).Load()
End If
If dr IsNot Nothing Then
For i As Integer = 0 To nms.Length - 1
If i=0 Then
Tables(e.node.Name).OpenLoadTree("" & nms(0) & "",kd,hs,True,Filter)
ElseIf i=1 Then
Tables(e.node.Name).OpenLoadTree("" & nms(0) & "|" & nms(1) & "",kd,hs,True,Filter)
Else
Tables(e.node.Name).OpenLoadTree("" & nms(0) & "|" & nms(1) & "|" & nms(2) & "",kd,hs,True,Filter)
End If
Next
End If
For Each nm As String In nms1
dr4 = DataTables("表列操作权限表").Find("表名 = '" & e.node.Name & "' and 角色 like '%" & nm & "%' And 不可见=true And 列名 is not null")
dr3 = DataTables("表列操作权限表").Find("表名 = '" & e.node.Name & "' and 角色 like '%" & nm & "%' And 不可见=true And 列名 is null")
For Each dr5 As DataRow In DataTables("表列操作权限表").Select("角色 like '%" & nm & "%'")
If dr5.IsNull("列名") Then
Tables(dr5("表名")).Visible = Not dr5("不可见")
Tables(dr5("表名")).AllowEdit = Not dr5("不可编辑")
Else
Tables(dr5("表名")).Cols(dr5("列名")).Visible = Not dr5("不可见")
Tables(dr5("表名")).Cols(dr5("列名")).AllowEdit = Not dr5("不可编辑")
End If
Next
If dr4 IsNot Nothing Then
RibbonTabs("hlcz").Groups("lcz").Items("UnHideColumn").Enabled=False
ContextMenus("Column").Items("UnHide").Visible=False
Else
RibbonTabs("hlcz").Groups("lcz").Items("UnHideColumn").Enabled=True
ContextMenus("Column").Items("UnHide").Visible=True
End If
If dr3 IsNot Nothing Then
e.cancel = True
End If
Next
If Tables.Contains(e.Node.Name)= True Then
If dr3 IsNot Nothing Then
e.cancel = True
Else
MainTable = Tables(e.node.Name)
End If
End If
ElseIf Forms.Contains(e.Node.Name)= True Then
For Each nm As String In nms1
dr3 = DataTables("表列操作权限表").Find("表名 = '" & e.node.Name & "' and 角色 like '%" & nm & "%' And 不可见=true And 列名 is null")
If dr3 IsNot Nothing Then
e.cancel = True
Else
MainTable = Tables("查询表")
Forms(e.node.name).open()
End If
Next
End If
End Select
上述代码在客户端运行正常,但开发者在开发项目中点击目录树节点想调取报表出来的时候总提示错误,如何解决,采用自定义用户登录
此主题相关图片如下:qq图片20220116144722.png