上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:31k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
  3. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
  4. Begin VB.Form Xt_Control 
  5.    Caption         =   "桌面"
  6.    ClientHeight    =   5850
  7.    ClientLeft      =   675
  8.    ClientTop       =   1665
  9.    ClientWidth     =   9240
  10.    Icon            =   "系统_主操作桌面.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   5850
  14.    ScaleWidth      =   9240
  15.    WindowState     =   2  'Maximized
  16.    Begin VB.PictureBox picSplitter 
  17.       BackColor       =   &H00808080&
  18.       BorderStyle     =   0  'None
  19.       FillColor       =   &H00808080&
  20.       BeginProperty Font 
  21.          Name            =   "MS Sans Serif"
  22.          Size            =   8.25
  23.          Charset         =   0
  24.          Weight          =   400
  25.          Underline       =   0   'False
  26.          Italic          =   0   'False
  27.          Strikethrough   =   0   'False
  28.       EndProperty
  29.       Height          =   4800
  30.       Left            =   4740
  31.       ScaleHeight     =   2090.126
  32.       ScaleMode       =   0  'User
  33.       ScaleWidth      =   780
  34.       TabIndex        =   0
  35.       Top             =   780
  36.       Visible         =   0   'False
  37.       Width           =   72
  38.    End
  39.    Begin MSComctlLib.ImageList ImageList1 
  40.       Left            =   5220
  41.       Top             =   2340
  42.       _ExtentX        =   1005
  43.       _ExtentY        =   1005
  44.       BackColor       =   -2147483643
  45.       ImageWidth      =   16
  46.       ImageHeight     =   16
  47.       MaskColor       =   12632256
  48.       _Version        =   393216
  49.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  50.          NumListImages   =   5
  51.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  52.             Picture         =   "系统_主操作桌面.frx":1042
  53.             Key             =   "stb"
  54.          EndProperty
  55.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  56.             Picture         =   "系统_主操作桌面.frx":2094
  57.             Key             =   "xttb"
  58.          EndProperty
  59.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  60.             Picture         =   "系统_主操作桌面.frx":30E6
  61.             Key             =   "szk"
  62.          EndProperty
  63.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  64.             Picture         =   "系统_主操作桌面.frx":3480
  65.             Key             =   "gnqx"
  66.          EndProperty
  67.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  68.             Picture         =   "系统_主操作桌面.frx":381A
  69.             Key             =   "kpgl"
  70.          EndProperty
  71.       EndProperty
  72.    End
  73.    Begin MSComctlLib.ListView lvListView 
  74.       Height          =   3375
  75.       Left            =   2160
  76.       TabIndex        =   5
  77.       Top             =   705
  78.       Width           =   2295
  79.       _ExtentX        =   4048
  80.       _ExtentY        =   5953
  81.       Arrange         =   2
  82.       LabelEdit       =   1
  83.       LabelWrap       =   -1  'True
  84.       HideSelection   =   -1  'True
  85.       OLEDragMode     =   1
  86.       OLEDropMode     =   1
  87.       PictureAlignment=   1
  88.       _Version        =   393217
  89.       Icons           =   "ImageList2"
  90.       SmallIcons      =   "ImageList1"
  91.       ColHdrIcons     =   "ImageList1"
  92.       ForeColor       =   -2147483640
  93.       BackColor       =   -2147483643
  94.       BorderStyle     =   1
  95.       Appearance      =   1
  96.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  97.          Name            =   "宋体"
  98.          Size            =   9
  99.          Charset         =   134
  100.          Weight          =   400
  101.          Underline       =   0   'False
  102.          Italic          =   0   'False
  103.          Strikethrough   =   0   'False
  104.       EndProperty
  105.       OLEDragMode     =   1
  106.       OLEDropMode     =   1
  107.       NumItems        =   0
  108.    End
  109.    Begin VB.PictureBox picTitles 
  110.       Align           =   1  'Align Top
  111.       Appearance      =   0  'Flat
  112.       BorderStyle     =   0  'None
  113.       BeginProperty Font 
  114.          Name            =   "MS Sans Serif"
  115.          Size            =   8.25
  116.          Charset         =   0
  117.          Weight          =   400
  118.          Underline       =   0   'False
  119.          Italic          =   0   'False
  120.          Strikethrough   =   0   'False
  121.       EndProperty
  122.       ForeColor       =   &H80000008&
  123.       Height          =   300
  124.       Left            =   0
  125.       ScaleHeight     =   300
  126.       ScaleWidth      =   9240
  127.       TabIndex        =   1
  128.       TabStop         =   0   'False
  129.       Top             =   420
  130.       Width           =   9240
  131.       Begin VB.Label lblTitle 
  132.          BorderStyle     =   1  'Fixed Single
  133.          Caption         =   "百利/ERP5.0"
  134.          Height          =   270
  135.          Index           =   0
  136.          Left            =   0
  137.          TabIndex        =   3
  138.          Tag             =   " 树形视图:"
  139.          Top             =   12
  140.          Width           =   2016
  141.       End
  142.       Begin VB.Label lblTitle 
  143.          BorderStyle     =   1  'Fixed Single
  144.          Caption         =   " 列表视图:"
  145.          Height          =   270
  146.          Index           =   1
  147.          Left            =   2078
  148.          TabIndex        =   2
  149.          Tag             =   " 列表视图:"
  150.          Top             =   12
  151.          Width           =   3216
  152.       End
  153.    End
  154.    Begin MSComDlg.CommonDialog dlgCommonDialog 
  155.       Left            =   3360
  156.       Top             =   2160
  157.       _ExtentX        =   847
  158.       _ExtentY        =   847
  159.       _Version        =   393216
  160.    End
  161.    Begin MSComctlLib.TreeView tvTreeView 
  162.       Height          =   4800
  163.       Left            =   0
  164.       TabIndex        =   4
  165.       Top             =   705
  166.       Width           =   2010
  167.       _ExtentX        =   3545
  168.       _ExtentY        =   8467
  169.       _Version        =   393217
  170.       Indentation     =   564
  171.       Style           =   7
  172.       ImageList       =   "ImageList1"
  173.       Appearance      =   1
  174.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  175.          Name            =   "宋体"
  176.          Size            =   9
  177.          Charset         =   134
  178.          Weight          =   400
  179.          Underline       =   0   'False
  180.          Italic          =   0   'False
  181.          Strikethrough   =   0   'False
  182.       EndProperty
  183.    End
  184.    Begin MSComctlLib.Toolbar tbToolBar 
  185.       Align           =   1  'Align Top
  186.       Height          =   420
  187.       Left            =   0
  188.       TabIndex        =   6
  189.       Top             =   0
  190.       Width           =   9240
  191.       _ExtentX        =   16298
  192.       _ExtentY        =   741
  193.       ButtonWidth     =   609
  194.       ButtonHeight    =   582
  195.       AllowCustomize  =   0   'False
  196.       Appearance      =   1
  197.       ImageList       =   "imlToolbarIcons"
  198.       _Version        =   393216
  199.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  200.          NumButtons      =   10
  201.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  202.             Style           =   3
  203.          EndProperty
  204.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  205.             Key             =   "返回"
  206.             Object.ToolTipText     =   "返回"
  207.             ImageKey        =   "xq"
  208.          EndProperty
  209.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  210.             Key             =   "向前"
  211.             Object.ToolTipText     =   "向前"
  212.             ImageKey        =   "xh"
  213.          EndProperty
  214.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  215.             Style           =   3
  216.          EndProperty
  217.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  218.             Style           =   3
  219.          EndProperty
  220.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  221.             Style           =   3
  222.          EndProperty
  223.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  224.             Key             =   "大图标"
  225.             Object.ToolTipText     =   "大图标"
  226.             ImageKey        =   "dtb"
  227.             Style           =   2
  228.             Value           =   1
  229.          EndProperty
  230.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  231.             Key             =   "小图标"
  232.             Object.ToolTipText     =   "小图标"
  233.             ImageKey        =   "xtb"
  234.             Style           =   2
  235.          EndProperty
  236.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  237.             Key             =   "列表"
  238.             Object.ToolTipText     =   "列表"
  239.             ImageKey        =   "lb"
  240.             Style           =   2
  241.          EndProperty
  242.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  243.             Key             =   "详细资料"
  244.             Object.ToolTipText     =   "详细资料"
  245.             ImageKey        =   "xxzl"
  246.             Style           =   2
  247.          EndProperty
  248.       EndProperty
  249.    End
  250.    Begin MSComctlLib.ImageList imlToolbarIcons 
  251.       Left            =   4710
  252.       Top             =   840
  253.       _ExtentX        =   1005
  254.       _ExtentY        =   1005
  255.       BackColor       =   -2147483643
  256.       ImageWidth      =   16
  257.       ImageHeight     =   16
  258.       MaskColor       =   12632256
  259.       _Version        =   393216
  260.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  261.          NumListImages   =   6
  262.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  263.             Picture         =   "系统_主操作桌面.frx":486C
  264.             Key             =   "xq"
  265.          EndProperty
  266.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  267.             Picture         =   "系统_主操作桌面.frx":4C06
  268.             Key             =   "xh"
  269.          EndProperty
  270.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  271.             Picture         =   "系统_主操作桌面.frx":4FA0
  272.             Key             =   "dtb"
  273.          EndProperty
  274.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  275.             Picture         =   "系统_主操作桌面.frx":533A
  276.             Key             =   "xtb"
  277.          EndProperty
  278.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  279.             Picture         =   "系统_主操作桌面.frx":56D4
  280.             Key             =   "lb"
  281.          EndProperty
  282.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  283.             Picture         =   "系统_主操作桌面.frx":5A6E
  284.             Key             =   "xxzl"
  285.          EndProperty
  286.       EndProperty
  287.    End
  288.    Begin MSComctlLib.ImageList ImageList2 
  289.       Left            =   6210
  290.       Top             =   2370
  291.       _ExtentX        =   1005
  292.       _ExtentY        =   1005
  293.       BackColor       =   -2147483643
  294.       ImageWidth      =   32
  295.       ImageHeight     =   32
  296.       MaskColor       =   12632256
  297.       _Version        =   393216
  298.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  299.          NumListImages   =   3
  300.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  301.             Picture         =   "系统_主操作桌面.frx":5E08
  302.             Key             =   ""
  303.          EndProperty
  304.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  305.             Picture         =   "系统_主操作桌面.frx":6128
  306.             Key             =   "y"
  307.          EndProperty
  308.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  309.             Picture         =   "系统_主操作桌面.frx":6E02
  310.             Key             =   "i"
  311.          EndProperty
  312.       EndProperty
  313.    End
  314.    Begin VB.Image imgSplitter 
  315.       Height          =   4785
  316.       Left            =   4230
  317.       MousePointer    =   9  'Size W E
  318.       Top             =   750
  319.       Width           =   150
  320.    End
  321. End
  322. Attribute VB_Name = "Xt_Control"
  323. Attribute VB_GlobalNameSpace = False
  324. Attribute VB_Creatable = False
  325. Attribute VB_PredeclaredId = True
  326. Attribute VB_Exposed = False
  327. '***********************************************
  328. '*    模 块 名 称 :系统主操作桌面
  329. '*    功 能 描 述 :
  330. '*    程序员姓名  :张建忠
  331. '*    最后修改人  :张建忠
  332. '*    最后修改时间:2001/06/21
  333. '*    备        注:封版
  334. '***********************************************
  335. Const NAME_COLUMN = 0
  336. Const TYPE_COLUMN = 1
  337. Const SIZE_COLUMN = 2
  338. Const DATE_COLUMN = 3
  339. Private Declare Function OSWinHelp% Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any)
  340.   
  341. Dim mbMoving As Boolean
  342. Const sglSplitLimit = 1000
  343. Dim nodX As Node
  344. Dim mitem As ListItem
  345. Dim Ztxxrec As New ADODB.Recordset           '帐套信息动态集
  346. Dim Xtgnbrec As New ADODB.Recordset          '系统功能表
  347. Dim Xtqxxzrec As New ADODB.Recordset         '系统权限限制动态集
  348. Dim Tsxx As String                           '系统提示信息
  349. Dim gnsyte As String                         '系统功能项索引
  350. Dim Xtrlrec As New ADODB.Recordset           '系统日历动态集
  351. Dim Ctsfscdr As Boolean                      '窗体是否首次读入
  352. Dim sjgnbmStr As String                      '上级编码
  353. Private Sub lvListView_DblClick()            '点击ListView执行相应功能
  354.     If lvListView.ListItems.Count > 0 Then
  355.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm='" + Mid(Trim(lvListView.SelectedItem.Key), 2, Len(Trim(lvListView.SelectedItem.Key)) - 1) + "'")
  356.         If Not Xtgnbrec.EOF Then
  357.             If Xtgnbrec.Fields("mjbz") = True Then
  358.                 gnsyte = Trim(Xtgnbrec.Fields("gnsy"))
  359.                 Call Zxxymk(gnsyte)
  360.             Else
  361.                 '---------------
  362.                 Dim Ssql As String
  363.                 sjgnbmStr = ""
  364.                 lvListView.ColumnHeaders.Clear
  365.                 lvListView.ListItems.Clear
  366.                 Ssql = "SELECT * FROM xt_xtgnb where sjgnbm='" + Xtgnbrec.Fields("gnbm") + "' and MenuList=1 order by gnbm"
  367.                 Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute(Ssql)
  368.                 lvListView.ColumnHeaders.Add 1, "rcsw", tvTreeView.SelectedItem.Text, 3000, , "stb"
  369.                 Do While Not Xtgnbrec.EOF
  370.                     Set mitem = lvListView.ListItems.Add()
  371.                     mitem.Text = Trim(Xtgnbrec!gnmc)
  372.                     If Xtgnbrec.Fields("mjbz") Then
  373.                         mitem.SmallIcon = "gnqx"
  374.                         mitem.Icon = "y"
  375.                     Else
  376.                         mitem.Icon = "i"
  377.                         mitem.SmallIcon = "stb"
  378.                     End If
  379.                     mitem.Key = "T" & Trim(Xtgnbrec!gnbm)
  380.                     Xtgnbrec.MoveNext
  381.                 Loop
  382.                 '---------------
  383.             End If
  384.         End If
  385.     End If
  386. End Sub
  387. Private Sub tvTreeView_NodeClick(ByVal Node As MSComctlLib.Node)
  388.     Dim Ssql As String
  389.     If Node.Tag <> "" Then
  390.         If Node.Tag = False Then
  391.             Ssql = "SELECT * FROM xt_xtgnb where sjgnbm='" + Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) + "' and MenuList=1 order by gnbm"
  392.             If sjgnbmStr = Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) Then
  393.                 Exit Sub
  394.             Else
  395.                 sjgnbmStr = Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1)
  396.             End If
  397.         Else
  398.             Ssql = "SELECT * FROM xt_xtgnb a," _
  399.                     & "(SELECT sjgnbm FROM xt_xtgnb where gnbm='" + Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) + "')b" & " where a.sjgnbm=b.sjgnbm and MenuList=1 order by gnbm"
  400.         End If
  401.         
  402.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute(Ssql)
  403.         If Node.Tag = True Then
  404.             If sjgnbmStr = Trim(Xtgnbrec!sjgnbm) Then
  405.                 Exit Sub
  406.             Else
  407.                 sjgnbmStr = Trim(Xtgnbrec!sjgnbm)
  408.             End If
  409.         End If
  410.         lvListView.ColumnHeaders.Clear
  411.         lvListView.ListItems.Clear
  412.         lvListView.ColumnHeaders.Add 1, "rcsw", "明细", 3000, , "stb"
  413.         Do While Not Xtgnbrec.EOF
  414.             Set mitem = lvListView.ListItems.Add()
  415.             mitem.Text = Trim(Xtgnbrec!gnmc)
  416.             If Xtgnbrec.Fields("mjbz") Then
  417.                 mitem.SmallIcon = "gnqx"
  418.                 mitem.Icon = "y"
  419.             Else
  420.                 mitem.Icon = "i"
  421.                 mitem.SmallIcon = "stb"
  422.             End If
  423.             mitem.Key = "T" & Trim(Xtgnbrec!gnbm)
  424.             Xtgnbrec.MoveNext
  425.         Loop
  426.     End If
  427. End Sub
  428. Private Sub lvListView_KeyPress(KeyAscii As Integer)
  429.     If KeyAscii = vbKeyReturn Then
  430.         Call lvListView_DblClick
  431.     End If
  432. End Sub
  433. Public Sub Cshgns()                                                    '初始化系统功能树
  434.   
  435.     Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm like '25%' and MenuList=1 order by gnbm")
  436.     tvTreeView.Nodes.Add , 4, "T", "百利/ERP5.0", "xttb"
  437.     With Xtgnbrec
  438.         Do While Not .EOF
  439.             If .Fields("mjbz") Then
  440.                 Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "gnqx")
  441.             Else
  442.                 If Trim(.Fields("sjgnbm")) = "" Then
  443.                     Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "kpgl")
  444.                 Else
  445.                     Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "stb")
  446.                 End If
  447.             End If
  448.             nodX.Tag = Xtgnbrec!mjbz
  449.             If Len(Trim(.Fields("sjgnbm"))) <= 2 Then
  450.                 nodX.EnsureVisible
  451.             End If
  452.             .MoveNext
  453.         Loop
  454.     End With
  455. End Sub
  456. '系统功能树操作
  457. Private Sub tvTreeView_BeforeLabelEdit(Cancel As Integer)                     '屏蔽编辑
  458.   Cancel = 1
  459. End Sub
  460. Private Sub tvTreeView_Collapse(ByVal Node As MSComctlLib.Node)               '功能树收缩
  461.     
  462.     If Node.Index <> 1 And Node.Key <> "T25" Then
  463.         Node.Image = "stb"
  464.     End If
  465.  
  466. End Sub
  467. Private Sub tvTreeView_Expand(ByVal Node As MSComctlLib.Node)                 '功能树展开
  468.     
  469.     If Node.Index <> 1 And Node.Key <> "T25" Then
  470.         Node.Image = "szk"
  471.     End If
  472. End Sub
  473. Private Sub tvTreeView_KeyPress(KeyAscii As Integer)                          '用户按回车键执行相应功能
  474.     
  475.     If KeyAscii = vbKeyReturn Then
  476.         Call tvTreeView_DblClick
  477.     End If
  478. End Sub
  479. Private Sub tvTreeView_DblClick()                                             '选择功能
  480.     
  481.     If tvTreeView.SelectedItem.Children = 0 Then
  482.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm='" + Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) + "'")
  483.         If Not Xtgnbrec.EOF Then
  484.             gnsyte = Trim(Xtgnbrec.Fields("gnsy"))
  485.             Call Zxxymk(gnsyte)
  486.         End If
  487.     End If
  488. End Sub
  489. Public Sub Zxxymk(gnsy As String)                                            '根据用户选择执行相应程序
  490.   
  491.     Dim RecTemp As New ADODB.Recordset     '临时使用动态集
  492.     Dim Sqlstr As String                   '临时查询字符串
  493.   
  494.     If Len(Trim(gnsy)) = 0 Then
  495.         Exit Sub
  496.     End If
  497.     
  498. '    '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  499.     
  500.     On Error GoTo Cwcl:
  501.     Select Case gnsy
  502.     '文件
  503.         Case "Dev_register"                       '用户重新注册
  504.             XT_login.Show 1
  505.         Case "Dev_End"
  506.             Unload XT_Main
  507.         
  508.    '基础设置
  509.         Case "Dev_SortSet"
  510.             If Not Security_Log("Dev_SortSet", Xtczybm, 1) Then
  511.                 Exit Sub
  512.             End If
  513.             Dev_EquitpmentSortSetForm.Show 1        '设备类别设置
  514.         Case "Dev_RepairSet"
  515.             If Not Security_Log("Dev_RepairSet", Xtczybm, 1) Then
  516.                 Exit Sub
  517.             End If
  518.             Dev_RepairSortSetForm.Show 1            '设备维修类别设置
  519.         Case "Dev_StateSet"
  520.             If Not Security_Log("Dev_StateSet", Xtczybm, 1) Then
  521.                 Exit Sub
  522.             End If
  523.             Dev_EquipmentStateSetForm.Show 1        '设备状态设置
  524.         Case "Dev_LubricateSet"
  525.             If Not Security_Log("Dev_LubricateSet", Xtczybm, 1) Then
  526.                 Exit Sub
  527.             End If
  528.             Dev_LubricateSetForm.Show 1             '润滑油设置
  529.         Case "Dev_ItemSet"
  530.             If Not Security_Log("Dev_ItemSet", Xtczybm, 1) Then
  531.                 Exit Sub
  532.             End If
  533.             Dev_ItemForm.Show 1                     '项目设置
  534.         Case "Dev_ItemSortSet"
  535.             If Not Security_Log("Dev_ItemSortSet", Xtczybm, 1) Then
  536.                 Exit Sub
  537.             End If
  538.             Dev_ItemCorrelationForm.Show 1          '项目相关类别设置
  539.         Case "Dev_ItemList"
  540.             If Not Security_Log("Dev_ItemList", Xtczybm, 1) Then
  541.                 Exit Sub
  542.             End If
  543.             Dev_ItemCorrelationListForm.Show 1      '项目相关明细设置
  544.         Case "Dev_ItemPlaceSet"
  545.             If Not Security_Log("Dev_ItemPlaceSet", Xtczybm, 1) Then
  546.                 Exit Sub
  547.             End If
  548.             Dev_ItemPlaceInfoForm.Show 1            '项目位置设置
  549.     '设备档案
  550.         Case "Dev_DevCard"
  551.             If Not Security_Log("Dev_DevCard", Xtczybm, 1) Then
  552.                 Exit Sub
  553.             End If
  554.             AddExit_TF = True
  555.             Dev_ItemInfoForm.Show 1                 '设备档案录入
  556.             Security_Log "Dev_DevCard", Xtczybm, 2, False  '用户退出时写上机日志
  557.         Case "Dev_DevCardFind"
  558.             If Not Security_Log("Dev_DevCard", Xtczybm, 1) Then
  559.                 Exit Sub
  560.             End If
  561.             Dev_ItemQInfoForm.Show                  '设备主台帐查询
  562.             Dev_ItemQFilt.Show 1
  563.             
  564.     '设备变动
  565.         Case "Dev_Remove"                           '设备调拨
  566.             If Not Security_Log("Dev_Remove", Xtczybm, 1) Then
  567.                 Exit Sub
  568.             End If
  569.             Dev_DevRemoveListForm.Show
  570.             Dev_DevRemoveFindForm.Show 1
  571.         Case "Dev_ChangeAdd"                        '设备革新
  572.             If Not Security_Log("Dev_ChangeAdd", Xtczybm, 1) Then
  573.                 Exit Sub
  574.             End If
  575.             Dev_ChangeAddListForm.Show
  576.             Dev_ChangeAddFindForm.Show 1
  577.         Case "Dev_DevReject"                        '设备报废
  578.             If Not Security_Log("Dev_DevReject", Xtczybm, 1) Then
  579.                 Exit Sub
  580.             End If
  581.             Dev_DevRejectListForm.Show
  582.             Dev_DevRejectFindForm.Show 1
  583.             
  584.     '设备运行
  585.         Case "Dev_CheckFile"                        '设备检查记录
  586.             If Not Security_Log("Dev_CheckFile", Xtczybm, 1) Then
  587.                 Exit Sub
  588.             End If
  589.             Dev_CheckFileListForm.Show
  590.             Dev_CheckFileFindForm.Show 1
  591.         Case "Dev_Accident"                         '设备事故
  592.             If Not Security_Log("Dev_Accident", Xtczybm, 1) Then
  593.                 Exit Sub
  594.             End If
  595.             Dev_AccidentListForm.Show
  596.             Dev_AccidentFindForm.Show 1
  597.         Case "Dev_HiddenTrouble"                    '设备隐患
  598.             If Not Security_Log("Dev_HiddenTrouble", Xtczybm, 1) Then
  599.                 Exit Sub
  600.             End If
  601.             Dev_HiddenTroubleListForm.Show
  602.             Dev_HiddenTroubleFindForm.Show 1
  603.         Case "Dev_Malfunction"                      '设备故障
  604.             If Not Security_Log("Dev_Malfunction", Xtczybm, 1) Then
  605.                 Exit Sub
  606.             End If
  607.             Dev_MalfunctionListForm.Show
  608.             Dev_MalfunctionFindForm.Show 1
  609.         Case "Dev_StateCheck"                       '设备状态维护
  610.             If Not Security_Log("Dev_StateCheck", Xtczybm, 1) Then
  611.                 Exit Sub
  612.             End If
  613.             Dev_StateCheckListForm.Show
  614.             Dev_StateCheckFindForm.Show 1
  615.             
  616.     '设备检修管理
  617.         Case "Dev_DayRepair"                        '设备日常维修
  618.             If Not Security_Log("Dev_DayRepair", Xtczybm, 1) Then
  619.                 Exit Sub
  620.             End If
  621.             Dev_DayRepairListForm.Show
  622.             Dev_DayRepairFindForm.Show 1
  623.         Case "Dev_MonthRepair"                      '设备月度检修计划
  624.             If Not Security_Log("Dev_DayRepair", Xtczybm, 1) Then
  625.                 Exit Sub
  626.             End If
  627.             Dev_MonthRepairPlanListForm.Show
  628.             Dev_MonthRepairPlanFindForm.Show 1
  629.         Case "Dev_CheckScenario"                    '设备检修方案
  630.             If Not Security_Log("Dev_CheckScenario", Xtczybm, 1) Then
  631.                 Exit Sub
  632.             End If
  633.             Dev_CheckScenarioListForm.Show
  634.             Dev_CheckScenarioFindForm.Show 1
  635.         Case "Dev_DevCheckFile"                     '设备检修记录
  636.             If Not Security_Log("Dev_DevCheckFile", Xtczybm, 1) Then
  637.                 Exit Sub
  638.             End If
  639.             Dev_RepairFileListForm.Show
  640.             Dev_RepairFileFindForm.Show 1
  641.         
  642.     '设备润滑管理
  643.         Case "Dev_LubricateCard"                    '设备润滑标准
  644.             If Not Security_Log("Dev_LubricateCard", Xtczybm, 1) Then
  645.                 Exit Sub
  646.             End If
  647.             Dev_LubricateListFrom.Show
  648.             Dev_LubricateFindFrom.Show 1
  649.         Case "Dev_LubricateStat"                    '润滑油统计
  650.             If Not Security_Log("Dev_LubricateStat", Xtczybm, 1) Then
  651.                 Exit Sub
  652.             End If
  653.             Dev_LubrucateStatListForm.Show
  654.             Dev_LubricateStatFindForm.Show 1
  655.         Case "Dev_LubricateAna"                     '设备润滑油分析
  656.             If Not Security_Log("Dev_LubricateAna", Xtczybm, 1) Then
  657.                 Exit Sub
  658.             End If
  659.             Dev_FrmLubricateAnalyzeCxjg.Show
  660.             Dev_FrmLubricateAnalyzeCxtj.Show 1
  661.     '备品备件
  662.         Case "Dev_SparePart"                        '备品备件库存查询
  663.             If Not Security_Log("Dev_SparePart", Xtczybm, 1) Then
  664.                 Exit Sub
  665.             End If
  666.             Dev_SparePartListForm.Show
  667.             Dev_SparePartFindForm.Show 1
  668.     '设备密封管理
  669.         Case "Dev_Airproof"                         '设备密封
  670.             If Not Security_Log("Dev_Airproof", Xtczybm, 1) Then
  671.                 Exit Sub
  672.             End If
  673.             Dev_FrmAirproofCxjg.Show
  674.             Dev_FrmAirproofcxtj.Show 1
  675.         Case "Dev_Leak"                             '设备泄漏
  676.             If Not Security_Log("Dev_Leak", Xtczybm, 1) Then
  677.                 Exit Sub
  678.             End If
  679.             Dev_FrmLeakCxjg.Show
  680.             Dev_FrmLeakCxtj.Show 1
  681.             
  682.           
  683.         '工具
  684.         Case "Dev_IsQ"                        '计算器
  685.             Shell App.Path & "calc.exe", vbNormalFocus
  686.         
  687.         
  688.         '帮助
  689.         Case "Dev_MHelp"                           '系统帮助
  690.             Call F1bz
  691.         Case "Dev_About"                             '关于
  692.             XT_frmAbout.Show
  693.     End Select
  694.     
  695.     '用户退出时写上机日志
  696.    Security_Log gnsy, Xtczybm, 2, False
  697.    
  698.     Exit Sub
  699. Cwcl:
  700.     Tsxx = "此项系统功能有待完善!"
  701.     Call Xtxxts(Tsxx, 0, 4)
  702.     Exit Sub
  703. End Sub
  704. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)        '用户关闭窗体
  705.   
  706.     If Unload_TF = False Then
  707.         Cancel = 1
  708.         Me.WindowState = 1
  709.     End If
  710. End Sub
  711. Private Sub Form_Load()
  712.     
  713.     '设置窗体图标
  714.     Me.Icon = XT_Main.Icon
  715.     
  716.     '设置窗体位置大小,并调入系统功能树
  717.     Me.Left = 0
  718.     Me.Top = 0
  719.     Me.Width = XT_Main.Width - 60
  720.     Me.Height = XT_Main.Height - 760 - 690
  721.     Call Cshgns
  722.     
  723.     '启动调入数据等待提示
  724.     Load Xt_Wait
  725.     
  726. End Sub
  727. Private Sub Form_Unload(Cancel As Integer)
  728.     
  729.     On Error Resume Next
  730.     
  731.     Dim i As Integer
  732.     For i = Forms.Count - 1 To 1 Step -1
  733.         Unload Forms(i)
  734.     Next
  735.     If Me.WindowState <> vbMinimized Then
  736.         SaveSetting App.Title, "Settings", "MainLeft", Me.Left
  737.         SaveSetting App.Title, "Settings", "MainTop", Me.Top
  738.         SaveSetting App.Title, "Settings", "MainWidth", Me.Width
  739.         SaveSetting App.Title, "Settings", "MainHeight", Me.Height
  740.     End If
  741.     SaveSetting App.Title, "Settings", "ViewMode", lvListView.View
  742. End Sub
  743. Private Sub Form_Resize()
  744.     
  745.     On Error Resume Next
  746.     If Me.Width < 3000 Then Me.Width = 3000
  747.     SizeControls imgSplitter.Left
  748. End Sub
  749. Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  750.     
  751.     With imgSplitter
  752.         picSplitter.Move .Left, .Top, .Width  2, .Height - 20
  753.     End With
  754.     picSplitter.Visible = True
  755.     mbMoving = True
  756. End Sub
  757. Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
  758.     
  759.     Dim sglPos As Single
  760.     If mbMoving Then
  761.         sglPos = x + imgSplitter.Left
  762.         If sglPos < sglSplitLimit Then
  763.             picSplitter.Left = sglSplitLimit
  764.         ElseIf sglPos > Me.Width - sglSplitLimit Then
  765.             picSplitter.Left = Me.Width - sglSplitLimit
  766.         Else
  767.             picSplitter.Left = sglPos
  768.         End If
  769.     End If
  770. End Sub
  771. Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
  772.     
  773.     SizeControls picSplitter.Left
  774.     picSplitter.Visible = False
  775.     mbMoving = False
  776.     lvListView.Refresh
  777. End Sub
  778. Private Sub TreeView1_DragDrop(Source As Control, x As Single, y As Single)
  779.     
  780.     If Source = imgSplitter Then
  781.         SizeControls x
  782.     End If
  783. End Sub
  784. Sub SizeControls(x As Single)
  785.     
  786.     On Error Resume Next
  787.     '设置 Width 属性
  788.     If x < 3500 Then x = 3500
  789.     If x > (Me.Width - 1500) Then x = Me.Width - 1500
  790.     tvTreeView.Width = x
  791.     imgSplitter.Left = x
  792.     lvListView.Left = x + 40
  793.     lvListView.Width = Me.Width - (tvTreeView.Width + 140)
  794.     lblTitle(0).Width = tvTreeView.Width
  795.     lblTitle(1).Left = lvListView.Left + 20
  796.     lblTitle(1).Width = lvListView.Width - 40
  797.     '设置 Top 属性
  798.     tvTreeView.Top = tbToolBar.Height + picTitles.Height
  799.     lvListView.Top = tvTreeView.Top
  800.     '设置 height 属性
  801.     tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height)
  802.     
  803.     lvListView.Height = tvTreeView.Height
  804.     imgSplitter.Top = tvTreeView.Top
  805.     imgSplitter.Height = tvTreeView.Height
  806. End Sub
  807. Private Sub tbToolBar_ButtonClick(ByVal Button As MSComctlLib.Button)
  808.     
  809.     On Error Resume Next
  810.     
  811.     Select Case Button.Key
  812.         Case "返回"
  813.             tvTreeView.SetFocus
  814.               SendKeys "{up}", True
  815.         Case "向前"
  816.              tvTreeView.SetFocus
  817.               SendKeys "{DOWN}", True
  818.         Case "大图标"
  819.             lvListView.View = lvwIcon
  820.         Case "小图标"
  821.             lvListView.View = lvwSmallIcon
  822.         Case "列表"
  823.             lvListView.View = lvwList
  824.         Case "详细资料"
  825.             lvListView.View = lvwReport
  826.     End Select
  827. End Sub