📄
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form Gy_DeptAllot
BorderStyle = 1 'Fixed Single
Caption = "部门分配"
ClientHeight = 6720
ClientLeft = 45
ClientTop = 330
ClientWidth = 8955
Icon = "公用_部门分配.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6720
ScaleWidth = 8955
StartUpPosition = 2 '屏幕中心
Begin VB.ComboBox Combo1
Height = 300
ItemData = "公用_部门分配.frx":08CA
Left = 1200
List = "公用_部门分配.frx":08CC
Style = 2 'Dropdown List
TabIndex = 1
Top = 600
Width = 2415
End
Begin MSComctlLib.TreeView TreeView
Height = 5745
Left = 0
TabIndex = 0
Top = 960
Width = 8925
_ExtentX = 15743
_ExtentY = 10134
_Version = 393217
Style = 7
Checkboxes = -1 'True
ImageList = "ImageList2"
Appearance = 1
End
Begin MSComctlLib.Toolbar SzToolbar
Align = 1 'Align Top
Height = 555
Left = 0
TabIndex = 2
Top = 0
Width = 8955
_ExtentX = 15796
_ExtentY = 979
ButtonWidth = 820
ButtonHeight = 926
AllowCustomize = 0 'False
Appearance = 1
Style = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 6
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "保存"
Key = "bc"
ImageKey = "bc"
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "刷新"
Key = "sx"
ImageKey = "sx"
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "帮助"
Key = "bz"
ImageKey = "bz"
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "退出"
Key = "tc"
ImageKey = "tc"
EndProperty
EndProperty
BorderStyle = 1
End
Begin MSComctlLib.ImageList ImageList1
Left = 4425
Top = 435
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 29
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":08CE
Key = "sz"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":0C68
Key = "dy"
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":1002
Key = "yl"
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":139C
Key = "xg"
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":1736
Key = "zh"
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":1AD0
Key = "sh"
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":1E6A
Key = "bc"
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":2204
Key = "fq"
EndProperty
BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":259E
Key = "bz"
EndProperty
BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":2938
Key = "tc"
EndProperty
BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":2CD2
Key = "bcgs"
EndProperty
BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":306C
Key = "mrlk"
EndProperty
BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":3406
Key = "xsxm"
EndProperty
BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":37A0
Key = "first"
EndProperty
BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":3B3A
Key = "prev"
EndProperty
BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":3ED4
Key = "next"
EndProperty
BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":426E
Key = "last"
EndProperty
BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":4608
Key = "xx"
EndProperty
BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":49A2
Key = "define"
EndProperty
BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":4D3C
Key = "exec"
EndProperty
BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":50D6
Key = "xz"
EndProperty
BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":5470
Key = "sc"
EndProperty
BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":580A
Key = "sx"
EndProperty
BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":5BA4
Key = "cx"
EndProperty
BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":5F3E
Key = "zd"
EndProperty
BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":62D8
Key = "dz"
EndProperty
BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":6672
Key = "ph"
EndProperty
BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":6A0C
Key = "fz"
EndProperty
BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":6DA6
Key = "dw"
EndProperty
EndProperty
End
Begin MSComctlLib.ImageList ImageList2
Left = 3915
Top = 540
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 4
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":7140
Key = "T"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":7A1A
Key = "C"
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":82F4
Key = "Cl"
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "公用_部门分配.frx":9346
Key = "O"
EndProperty
EndProperty
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "系统名称:"
Height = 180
Left = 60
TabIndex = 3
Top = 660
Width = 810
End
End
Attribute VB_Name = "Gy_DeptAllot"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'*******************************************************
'* 模 块 名 称 :部门分配设置
'* 功 能 描 述 :分级设置
'* 程序员姓名 :徐强
'* 最后修改人 :徐强
'* 最后修改时间:2001/10/15
'* 备 注:
'*******************************************************
Dim nodX As Node
Dim SystemCode(4) As String
Private Sub Combo1_Click()
If Combo1.ListIndex = -1 Then Exit Sub
Add_Tree
End Sub
Private Sub Form_Activate()
Combo1.ListIndex = 0
End Sub
Private Sub Form_Load()
Dim rs As New ADODB.Recordset
Set rs = Cw_DataEnvi.DataConnect.Execute("select * from Xt_ComboList where combo_code='Gy_DeptAllot' order by item_index")
Do While Not rs.EOF
Combo1.AddItem Trim(rs("item_content"))
rs.MoveNext
Loop
SystemCode(0) = "CwzzFlag": SystemCode(1) = "RsPmFlag": SystemCode(2) = "CgFlag"
SystemCode(3) = "XsFlag": SystemCode(4) = "KfFlag"
End Sub
Sub Add_Tree() '添加树项
Dim aDo_Sort As New Recordset
TreeView.Nodes.Clear
TreeView.Nodes.Add , 4, "T", "部门", "T"
TreeView.Nodes("T").Checked = True
Set aDo_Sort = Cw_DataEnvi.DataConnect.Execute("select * from Gy_Department order by DeptCode")
With aDo_Sort
'-----------
Do While Not .EOF
If Trim("" & aDo_Sort!ParentCode) = "" Then
Set nodX = TreeView.Nodes.Add("T", 4, "T" & Trim(.Fields("DeptCode")), "(" & Trim(.Fields("DeptCode")) & ")" & Trim(.Fields("DeptName")), "C")
nodX.Tag = "T"
nodX.Checked = .Fields(SystemCode(Combo1.ListIndex))
Else
Set nodX = TreeView.Nodes.Add("T" & Trim(!ParentCode), 4, "T" & Trim(.Fields("DeptCode")), "(" & Trim(.Fields("DeptCode")) & ")" & Trim(.Fields("DeptName")), "C")
nodX.Tag = "T" & Trim(!ParentCode)
nodX.Checked = .Fields(SystemCode(Combo1.ListIndex))
End If
nodX.EnsureVisible
.MoveNext
Loop
'---------
End With
End Sub
Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
Dim Tsxx As String
Select Case Button.Key
Case "bc"
Dim SSql As String
For i = 2 To TreeView.Nodes.count
SSql = "update Gy_Department set " & SystemCode(Combo1.ListIndex) & "=" _
& IIf(TreeView.Nodes.Item(i).Checked, 1, 0) & " where DeptCode='" & Mid(TreeView.Nodes.Item(i).Key, 2, Len(TreeView.Nodes.Item(i).Key)) & "'"
Cw_DataEnvi.DataConnect.Execute SSql
Next
Tsxx = "保存完毕!"
Call Xtxxts(Tsxx, 0, 4)
Case "sx"
Add_Tree
Case "bz"
Call F1bz
Case "tc"
Unload Me
End Select
End Sub
Private Sub TreeView_Collapse(ByVal Node As MSComctlLib.Node)
If Node.Index <> 1 And Node.Key <> "T" Then
Node.Image = "Cl"
End If
End Sub
Private Sub TreeView_Expand(ByVal Node As MSComctlLib.Node)
If Node.Index <> 1 And Node.Key <> "T" Then
Node.Image = "O"
End If
End Sub
Private Sub TreeView_NodeCheck(ByVal Node As MSComctlLib.Node)
Dim i As Integer
Dim ParentCode As String
If Node.Checked = True Then
ParentCode = Node.Tag
Do While True
If ParentCode = "" Then Exit Do
If TreeView.Nodes(ParentCode).Checked = True Then Exit Do
TreeView.Nodes(ParentCode).Checked = True
ParentCode = TreeView.Nodes(ParentCode).Tag
Loop
'----------------
Else
'----------------
For i = 2 To TreeView.Nodes.count
If Mid(TreeView.Nodes.Item(i).Key, 1, Len(Node.Key)) = Node.Key Then
TreeView.Nodes.Item(i).Checked = False
End If
Next
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -