From 839b987a96dc5ee967448591ab782f19286a729f Mon Sep 17 00:00:00 2001 From: Cao yang Date: Thu, 12 Apr 2018 17:32:26 +0800 Subject: [PATCH] 添加请假页面 --- ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj | 28 ++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++++ ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate | Bin 167930 -> 0 bytes ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramCardViewController.swift | 35 +++++++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramCheckViewController.swift | 35 +++++++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramVacateViewController.swift | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramViewController.swift | 17 ++++++++++++++++- ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramVacateBodyTableViewCell.swift | 31 +++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramVacateBodyTableViewCell.xib | 184 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramVacateTableViewCell.swift | 26 ++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramVacateTableViewCell.xib | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/grow_calendar.imageset/Contents.json | 21 +++++++++++++++++++++ ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/grow_calendar.imageset/grow_calendar@2x.png | Bin 0 -> 751 bytes ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/grow_ellipse.imageset/Contents.json | 21 +++++++++++++++++++++ ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/grow_ellipse.imageset/grow_ellipse@2x.png | Bin 0 -> 322 bytes 15 files changed, 667 insertions(+), 1 deletion(-) create mode 100644 ParentAssistant/ParentAssistant.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramCardViewController.swift create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramCheckViewController.swift create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramVacateViewController.swift create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramVacateBodyTableViewCell.swift create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramVacateBodyTableViewCell.xib create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramVacateTableViewCell.swift create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramVacateTableViewCell.xib create mode 100644 ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/grow_calendar.imageset/Contents.json create mode 100644 ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/grow_calendar.imageset/grow_calendar@2x.png create mode 100644 ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/grow_ellipse.imageset/Contents.json create mode 100644 ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/grow_ellipse.imageset/grow_ellipse@2x.png diff --git a/ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj b/ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj index c2b5168..f4d227d 100644 --- a/ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj +++ b/ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj @@ -32,12 +32,19 @@ 5993652C20528D5700C8B371 /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5993652B20528D5700C8B371 /* MainViewController.swift */; }; 59C0A9B8205375F800A8BB5A /* SelectCityViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59C0A9B7205375F800A8BB5A /* SelectCityViewController.swift */; }; 9FB4F6F97960021FB4F02BBE /* Pods_ParentAssistant.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A6EEE742C2FA920AEDF24728 /* Pods_ParentAssistant.framework */; }; + AD198173207D9FB4009AB8B5 /* ProgramCheckViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD198172207D9FB4009AB8B5 /* ProgramCheckViewController.swift */; }; + AD198175207D9FC1009AB8B5 /* ProgramCardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD198174207D9FC1009AB8B5 /* ProgramCardViewController.swift */; }; + AD198177207D9FF5009AB8B5 /* ProgramVacateViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD198176207D9FF5009AB8B5 /* ProgramVacateViewController.swift */; }; AD24AA202065FBAF00ECA428 /* SceneTopCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD24AA1F2065FBAF00ECA428 /* SceneTopCell.swift */; }; AD24AA222065FBC000ECA428 /* SceneMiddleCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD24AA212065FBC000ECA428 /* SceneMiddleCell.swift */; }; AD24AA242065FBD100ECA428 /* SceneDownCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD24AA232065FBD100ECA428 /* SceneDownCell.swift */; }; AD34D11A2064C79D00989F8D /* MoralDetailCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD34D1192064C79D00989F8D /* MoralDetailCell.swift */; }; AD34D11C2064C7AE00989F8D /* EducationDetailCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD34D11B2064C7AE00989F8D /* EducationDetailCell.swift */; }; AD34D11E2064C7C300989F8D /* BehaviorDetailCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD34D11D2064C7C300989F8D /* BehaviorDetailCell.swift */; }; + AD64A2C0207F289400B25E80 /* ProgramVacateTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD64A2BE207F289400B25E80 /* ProgramVacateTableViewCell.swift */; }; + AD64A2C1207F289400B25E80 /* ProgramVacateTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = AD64A2BF207F289400B25E80 /* ProgramVacateTableViewCell.xib */; }; + AD64A2C3207F28CF00B25E80 /* ProgramVacateBodyTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD64A2C2207F28CF00B25E80 /* ProgramVacateBodyTableViewCell.swift */; }; + AD64A2C5207F28EB00B25E80 /* ProgramVacateBodyTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = AD64A2C4207F28EB00B25E80 /* ProgramVacateBodyTableViewCell.xib */; }; AD65FB78206354220052415B /* MoralTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD65FB77206354220052415B /* MoralTableViewCell.swift */; }; AD65FB7A20637F110052415B /* MoralViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD65FB7920637F110052415B /* MoralViewController.swift */; }; ADAEA3982064960300A47D2C /* SceneDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAEA3972064960300A47D2C /* SceneDetailViewController.swift */; }; @@ -187,12 +194,19 @@ 5993652B20528D5700C8B371 /* MainViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = ""; }; 59C0A9B7205375F800A8BB5A /* SelectCityViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectCityViewController.swift; sourceTree = ""; }; A6EEE742C2FA920AEDF24728 /* Pods_ParentAssistant.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ParentAssistant.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + AD198172207D9FB4009AB8B5 /* ProgramCheckViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgramCheckViewController.swift; sourceTree = ""; }; + AD198174207D9FC1009AB8B5 /* ProgramCardViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgramCardViewController.swift; sourceTree = ""; }; + AD198176207D9FF5009AB8B5 /* ProgramVacateViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgramVacateViewController.swift; sourceTree = ""; }; AD24AA1F2065FBAF00ECA428 /* SceneTopCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneTopCell.swift; sourceTree = ""; }; AD24AA212065FBC000ECA428 /* SceneMiddleCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneMiddleCell.swift; sourceTree = ""; }; AD24AA232065FBD100ECA428 /* SceneDownCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDownCell.swift; sourceTree = ""; }; AD34D1192064C79D00989F8D /* MoralDetailCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoralDetailCell.swift; sourceTree = ""; }; AD34D11B2064C7AE00989F8D /* EducationDetailCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EducationDetailCell.swift; sourceTree = ""; }; AD34D11D2064C7C300989F8D /* BehaviorDetailCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BehaviorDetailCell.swift; sourceTree = ""; }; + AD64A2BE207F289400B25E80 /* ProgramVacateTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgramVacateTableViewCell.swift; sourceTree = ""; }; + AD64A2BF207F289400B25E80 /* ProgramVacateTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ProgramVacateTableViewCell.xib; sourceTree = ""; }; + AD64A2C2207F28CF00B25E80 /* ProgramVacateBodyTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgramVacateBodyTableViewCell.swift; sourceTree = ""; }; + AD64A2C4207F28EB00B25E80 /* ProgramVacateBodyTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ProgramVacateBodyTableViewCell.xib; sourceTree = ""; }; AD65FB77206354220052415B /* MoralTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoralTableViewCell.swift; sourceTree = ""; }; AD65FB7920637F110052415B /* MoralViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoralViewController.swift; sourceTree = ""; }; ADAEA3972064960300A47D2C /* SceneDetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SceneDetailViewController.swift; sourceTree = ""; }; @@ -513,6 +527,9 @@ isa = PBXGroup; children = ( ADC9AB87207C940700348EF1 /* ProgramViewController.swift */, + AD198172207D9FB4009AB8B5 /* ProgramCheckViewController.swift */, + AD198174207D9FC1009AB8B5 /* ProgramCardViewController.swift */, + AD198176207D9FF5009AB8B5 /* ProgramVacateViewController.swift */, ); path = Program; sourceTree = ""; @@ -579,6 +596,10 @@ AD24AA232065FBD100ECA428 /* SceneDownCell.swift */, ADC9AB83207C673C00348EF1 /* SceneDownCell.xib */, ADAEA3992064C44900A47D2C /* LineChartView.swift */, + AD64A2BE207F289400B25E80 /* ProgramVacateTableViewCell.swift */, + AD64A2BF207F289400B25E80 /* ProgramVacateTableViewCell.xib */, + AD64A2C2207F28CF00B25E80 /* ProgramVacateBodyTableViewCell.swift */, + AD64A2C4207F28EB00B25E80 /* ProgramVacateBodyTableViewCell.xib */, ); path = View; sourceTree = ""; @@ -888,6 +909,7 @@ 5980BF672061048A00F4A35E /* Address.plist in Resources */, BF38847C205CDE1B00A240EF /* JS.storyboard in Resources */, ADC9AB7C207C66C300348EF1 /* EducationDetailCell.xib in Resources */, + AD64A2C1207F289400B25E80 /* ProgramVacateTableViewCell.xib in Resources */, BFF9B7F42057A29D00F39B3E /* TableEmptyView.xib in Resources */, ADC9AB7E207C66DA00348EF1 /* BehaviorDetailCell.xib in Resources */, ADC9AB84207C673C00348EF1 /* SceneDownCell.xib in Resources */, @@ -902,6 +924,7 @@ BF67F3BD20590A2F002FDC61 /* Info-OSX.plist in Resources */, BF621CAC205660E90040D2C1 /* My.storyboard in Resources */, BF67F3BC20590A2F002FDC61 /* Info-iOS.plist in Resources */, + AD64A2C5207F28EB00B25E80 /* ProgramVacateBodyTableViewCell.xib in Resources */, BF7A4C84204E338500460463 /* Assets.xcassets in Resources */, BF7A4C85204E338500460463 /* LaunchScreen.storyboard in Resources */, ADC9AB82207C673300348EF1 /* SceneMiddleCell.xib in Resources */, @@ -993,6 +1016,7 @@ BF621CB02056664C0040D2C1 /* CurrentInfoViewController.swift in Sources */, ADC9AB88207C940700348EF1 /* ProgramViewController.swift in Sources */, BF7A4C3C204CD55300460463 /* ParentAssistant.xcdatamodeld in Sources */, + AD198177207D9FF5009AB8B5 /* ProgramVacateViewController.swift in Sources */, BFEAAAD620525D620072FAAF /* LxButton.m in Sources */, 5993652C20528D5700C8B371 /* MainViewController.swift in Sources */, 5993652A2052553900C8B371 /* pinyin.c in Sources */, @@ -1014,6 +1038,7 @@ 5980BF692061048A00F4A35E /* LZCityPickerView.m in Sources */, BF388482205F5BC800A240EF /* MessageManager.swift in Sources */, 5980BF682061048A00F4A35E /* LZCityPickerController.m in Sources */, + AD198173207D9FB4009AB8B5 /* ProgramCheckViewController.swift in Sources */, BFCED88B20528DE700055373 /* MyViewControllerModel.swift in Sources */, BFF9B7E92056852A00F39B3E /* RegisterViewController.swift in Sources */, BFBC06C72063AE8900CCFAFF /* ZLaunchAdButton.swift in Sources */, @@ -1046,6 +1071,8 @@ 599364EC204E62E700C8B371 /* EvaluationViewController.swift in Sources */, 599364F0204E62E700C8B371 /* ReportViewController.swift in Sources */, BF621CAE2056663C0040D2C1 /* LoginViewController.swift in Sources */, + AD64A2C0207F289400B25E80 /* ProgramVacateTableViewCell.swift in Sources */, + AD64A2C3207F28CF00B25E80 /* ProgramVacateBodyTableViewCell.swift in Sources */, 599364EA204E62E700C8B371 /* ChannelViewController.swift in Sources */, BF406CDE2057C537000A6681 /* OrderDetailTableViewCell.swift in Sources */, BFEAAAC7205257460072FAAF /* LXCalenderCell.m in Sources */, @@ -1056,6 +1083,7 @@ BFBC06C62063AE8900CCFAFF /* ZLaunchAdAnimation.swift in Sources */, AD34D11E2064C7C300989F8D /* BehaviorDetailCell.swift in Sources */, BFCED888205280B700055373 /* MyViewController.swift in Sources */, + AD198175207D9FC1009AB8B5 /* ProgramCardViewController.swift in Sources */, AD65FB78206354220052415B /* MoralTableViewCell.swift in Sources */, BF38846C205A58F800A240EF /* YXMessageManager.swift in Sources */, BFBC06C92063AE8900CCFAFF /* ZLaunchAdConfig.swift in Sources */, diff --git a/ParentAssistant/ParentAssistant.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ParentAssistant/ParentAssistant.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ParentAssistant/ParentAssistant.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate b/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate index f16de1b..38c768c 100644 Binary files a/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate and b/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramCardViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramCardViewController.swift new file mode 100644 index 0000000..cf4bdce --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramCardViewController.swift @@ -0,0 +1,35 @@ +// +// ProgramCardViewController.swift +// ParentAssistant +// +// Created by Cao yang on 2018/4/11. +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. +// + +import UIKit + +class ProgramCardViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destinationViewController. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramCheckViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramCheckViewController.swift new file mode 100644 index 0000000..d63d91f --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramCheckViewController.swift @@ -0,0 +1,35 @@ +// +// ProgramCheckViewController.swift +// ParentAssistant +// +// Created by Cao yang on 2018/4/11. +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. +// + +import UIKit + +class ProgramCheckViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destinationViewController. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramVacateViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramVacateViewController.swift new file mode 100644 index 0000000..4cfa83a --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramVacateViewController.swift @@ -0,0 +1,153 @@ +// +// ProgramVacateViewController.swift +// ParentAssistant +// +// Created by Cao yang on 2018/4/11. +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. +// + +import UIKit + +class ProgramVacateViewController: UIViewController,UITableViewDelegate,UITableViewDataSource { + + lazy var tableView = {()-> UITableView in + let table = UITableView.init(frame: CGRect.init(x: 0, y: 0, width: screenWidth, height: screenHeight-44-22-60)) + table.backgroundColor = backGroundColor + table.delegate = self + table.dataSource = self + table.tableFooterView = UIView.init() + table.separatorStyle = .none + table.register(UINib.init(nibName: "ProgramVacateTableViewCell", bundle: nil), forCellReuseIdentifier: "ProgramVacateTableViewCell") + table.register(UINib.init(nibName: "ProgramVacateBodyTableViewCell", bundle: nil), forCellReuseIdentifier: "ProgramVacateBodyTableViewCell") + return table + }() + + lazy var bottomBtn = {()-> UIButton in + let btn = UIButton.init(frame: CGRect.init(x: screenWidth/2-60, y: screenHeight-66-50, width: 120, height: 40)) + btn.setTitle("请假", for: UIControlState.normal) + btn.setTitleColor(UIColor.black, for: UIControlState.normal) + btn.backgroundColor = Theme.topBarColor() + return btn + }() + + //data + + /// 请假记录 + var vacateRecodeArray = Array() + + + override func viewDidLoad() { + super.viewDidLoad() + self.view.backgroundColor = backGroundColor + + self.view.addSubview(self.tableView) + self.view.addSubview(self.bottomBtn) + self.vacateRecodeArray = ["1","2"] + + // Do any additional setup after loading the view. + } + + //MARK: - TableView delegate & dataSourse + func numberOfSections(in tableView: UITableView) -> Int { + return 2 + } + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + switch section { + case 0: + return 1 + case 1: + if vacateRecodeArray.count > 0 { + return vacateRecodeArray.count+1 + }else{ + return 2 + } + default: + return 0 + } + } + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + + switch indexPath.section { + case 0: + return 90 + case 1: + if indexPath.row == 0{ + return 40 + }else{ + if vacateRecodeArray.count > 0 { + return 230 + }else{ + return 50 + } + } + default: + return 0 + } + } + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + + switch indexPath.section { + case 0: + let cell = tableView.dequeueReusableCell(withIdentifier: "ProgramVacateTableViewCell", for: indexPath) as! ProgramVacateTableViewCell + return cell + case 1: + if indexPath.row == 0 { + let cell = UITableViewCell.init() + cell.backgroundColor = backGroundColor + let cellView = UIView.init(frame: CGRect.init(x: 10, y: 0, width: screenWidth-20, height: 40)) + cellView.backgroundColor = UIColor.white + let label = UILabel.init(frame: CGRect.init(x: 10, y: 0, width: 200, height: 40)) + label.text = "请假记录:" + label.textAlignment = .left + cellView.addSubview(label) + cell.addSubview(cellView) + return cell + }else{ + if vacateRecodeArray.count > 0 { + let cell = tableView.dequeueReusableCell(withIdentifier: "ProgramVacateBodyTableViewCell", for: indexPath) as! ProgramVacateBodyTableViewCell + return cell + }else{ + let cell = UITableViewCell.init() + cell.backgroundColor = backGroundColor + let cellView = UIView.init(frame: CGRect.init(x: 10, y: 0, width: screenWidth-20, height: 50)) + cellView.backgroundColor = UIColor.white + let label = UILabel.init(frame: CGRect.init(x: 10, y: 0, width: screenWidth-20-20, height: 50)) + label.text = "张三今日无请假记录!" + label.font = UIFont.systemFont(ofSize: 20) + label.textAlignment = .center + label.textColor = UIColor.red + cellView.addSubview(label) + cell.addSubview(cellView) + return cell + } + } + default: + return UITableViewCell.init() + } + } + + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + if indexPath.section == 1 && indexPath.row != 0 && vacateRecodeArray.count>0 { + + + + } + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destinationViewController. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramViewController.swift index 18d4ba1..70a33a6 100644 --- a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramViewController.swift +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramViewController.swift @@ -102,7 +102,22 @@ class ProgramViewController: UIViewController,UITableViewDelegate,UITableViewDat func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - + switch indexPath.row { + case 0: + let vc = ProgramCheckViewController() + vc.title = "考勤" + self.navigationController?.pushViewController(vc, animated: true) + case 1: + let vc = ProgramCardViewController() + vc.title = "补卡" + self.navigationController?.pushViewController(vc, animated: true) + case 2: + let vc = ProgramVacateViewController() + vc.title = "请假" + self.navigationController?.pushViewController(vc, animated: true) + default: + break + } } override func didReceiveMemoryWarning() { diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramVacateBodyTableViewCell.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramVacateBodyTableViewCell.swift new file mode 100644 index 0000000..5a6ff78 --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramVacateBodyTableViewCell.swift @@ -0,0 +1,31 @@ +// +// ProgramVacateBodyTableViewCell.swift +// ParentAssistant +// +// Created by Cao yang on 2018/4/12. +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. +// + +import UIKit + +class ProgramVacateBodyTableViewCell: UITableViewCell { + + @IBOutlet weak var upLine: UILabel! + @IBOutlet weak var vacateName: UILabel! + @IBOutlet weak var vacateType: UILabel! + @IBOutlet weak var startTime: UILabel! + @IBOutlet weak var endTime: UILabel! + @IBOutlet weak var examinePerson: UILabel! + @IBOutlet weak var vacateResult: UILabel! + override func awakeFromNib() { + super.awakeFromNib() + // Initialization code + } + + override func setSelected(_ selected: Bool, animated: Bool) { + super.setSelected(selected, animated: animated) + + // Configure the view for the selected state + } + +} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramVacateBodyTableViewCell.xib b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramVacateBodyTableViewCell.xib new file mode 100644 index 0000000..8a3e22e --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramVacateBodyTableViewCell.xib @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramVacateTableViewCell.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramVacateTableViewCell.swift new file mode 100644 index 0000000..4596aa3 --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramVacateTableViewCell.swift @@ -0,0 +1,26 @@ +// +// ProgramVacateTableViewCell.swift +// ParentAssistant +// +// Created by Cao yang on 2018/4/12. +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. +// + +import UIKit + +class ProgramVacateTableViewCell: UITableViewCell { + + @IBOutlet weak var vacateName: UILabel! + @IBOutlet weak var startTime: UILabel! + @IBOutlet weak var endTime: UILabel! + override func awakeFromNib() { + super.awakeFromNib() + // Initialization code + } + + override func setSelected(_ selected: Bool, animated: Bool) { + super.setSelected(selected, animated: animated) + + // Configure the view for the selected state + } +} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramVacateTableViewCell.xib b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramVacateTableViewCell.xib new file mode 100644 index 0000000..50968f3 --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramVacateTableViewCell.xib @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/grow_calendar.imageset/Contents.json b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/grow_calendar.imageset/Contents.json new file mode 100644 index 0000000..02395d4 --- /dev/null +++ b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/grow_calendar.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "grow_calendar@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/grow_calendar.imageset/grow_calendar@2x.png b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/grow_calendar.imageset/grow_calendar@2x.png new file mode 100644 index 0000000..6abf175 Binary files /dev/null and b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/grow_calendar.imageset/grow_calendar@2x.png differ diff --git a/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/grow_ellipse.imageset/Contents.json b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/grow_ellipse.imageset/Contents.json new file mode 100644 index 0000000..c850860 --- /dev/null +++ b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/grow_ellipse.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "grow_ellipse@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/grow_ellipse.imageset/grow_ellipse@2x.png b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/grow_ellipse.imageset/grow_ellipse@2x.png new file mode 100644 index 0000000..d2f632f Binary files /dev/null and b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/grow_ellipse.imageset/grow_ellipse@2x.png differ -- libgit2 0.21.0