Commit c91d3e5d authored by Steven杜宇's avatar Steven杜宇

// lint

parent 9f015eff
...@@ -452,7 +452,9 @@ extension YHCertificateAppointViewController: UITableViewDelegate, UITableViewDa ...@@ -452,7 +452,9 @@ extension YHCertificateAppointViewController: UITableViewDelegate, UITableViewDa
if item.type == .grabingNumberBatch { if item.type == .grabingNumberBatch {
// 赴港办理抢号中批次 // 赴港办理抢号中批次
let cell = tableView.dequeueReusableCell(withIdentifier: YHGrabingNumberListCell.cellReuseIdentifier, for: indexPath) as! YHGrabingNumberListCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHGrabingNumberListCell.cellReuseIdentifier, for: indexPath) as? YHGrabingNumberListCell else {
return UITableViewCell()
}
cell.listArr = self.waitList cell.listArr = self.waitList
cell.cancelAppointBlock = { cell.cancelAppointBlock = {
[weak self] groupModel in [weak self] groupModel in
...@@ -486,7 +488,9 @@ extension YHCertificateAppointViewController: UITableViewDelegate, UITableViewDa ...@@ -486,7 +488,9 @@ extension YHCertificateAppointViewController: UITableViewDelegate, UITableViewDa
if item.type == .haveGrabedNumberBatch { if item.type == .haveGrabedNumberBatch {
// 赴港办理已抢号批次 // 赴港办理已抢号批次
let cell = tableView.dequeueReusableCell(withIdentifier: YHHaveGrabbedNumberListCell.cellReuseIdentifier, for: indexPath) as! YHHaveGrabbedNumberListCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHHaveGrabbedNumberListCell.cellReuseIdentifier, for: indexPath) as? YHHaveGrabbedNumberListCell else {
return UITableViewCell()
}
cell.listArr = self.successList cell.listArr = self.successList
return cell return cell
} }
......
...@@ -301,7 +301,7 @@ extension YHResignAppointTimeModifyViewController { ...@@ -301,7 +301,7 @@ extension YHResignAppointTimeModifyViewController {
} else { // 如果操作的当前批次不是最后一批 需要更新当前批次的下一批该用户的选中状态 } else { // 如果操作的当前批次不是最后一批 需要更新当前批次的下一批该用户的选中状态
var nextGroupIndex = groupLevel+1 var nextGroupIndex = groupLevel+1
let newMember = currentMember.copy() as! YHResignAppointMember if let newMember = currentMember.copy() as? YHResignAppointMember {
newMember.isSelected = true newMember.isSelected = true
while 0 <= nextGroupIndex, nextGroupIndex < selectGroupArr.count { while 0 <= nextGroupIndex, nextGroupIndex < selectGroupArr.count {
let item = selectGroupArr[nextGroupIndex] let item = selectGroupArr[nextGroupIndex]
...@@ -333,7 +333,7 @@ extension YHResignAppointTimeModifyViewController { ...@@ -333,7 +333,7 @@ extension YHResignAppointTimeModifyViewController {
newItem.users = nextMembers newItem.users = nextMembers
selectGroupArr.append(newItem) selectGroupArr.append(newItem)
} }
}
} }
} else { // 如果操作是选中 } else { // 如果操作是选中
...@@ -436,9 +436,9 @@ extension YHResignAppointTimeModifyViewController { ...@@ -436,9 +436,9 @@ extension YHResignAppointTimeModifyViewController {
let dict = ["member_id": "\($0.id)"] let dict = ["member_id": "\($0.id)"]
return dict return dict
} }
let dict = ["ready_to_submit_at": self.oneGroupTimeSetting.getSubmitHKTime(), let dict:[String: Any] = ["ready_to_submit_at": self.oneGroupTimeSetting.getSubmitHKTime(),
"leave_hk_at": self.oneGroupTimeSetting.notleaveHK ? "" : self.oneGroupTimeSetting.getLeaveHKTime(), "leave_hk_at": self.oneGroupTimeSetting.notleaveHK ? "" : self.oneGroupTimeSetting.getLeaveHKTime(),
"users": allUserInfoArr] as! [String: Any] "users": allUserInfoArr]
batchs.append(dict) batchs.append(dict)
} else { } else {
...@@ -453,9 +453,9 @@ extension YHResignAppointTimeModifyViewController { ...@@ -453,9 +453,9 @@ extension YHResignAppointTimeModifyViewController {
let dict = ["member_id": "\($0.id)"] let dict = ["member_id": "\($0.id)"]
return dict return dict
} }
let dict = ["ready_to_submit_at": group.getSubmitHKTime(), let dict:[String: Any] = ["ready_to_submit_at": group.getSubmitHKTime(),
"leave_hk_at": group.notleaveHK ? "" : group.getLeaveHKTime(), "leave_hk_at": group.notleaveHK ? "" : group.getLeaveHKTime(),
"users": allUserInfoArr] as! [String: Any] "users": allUserInfoArr]
batchs.append(dict) batchs.append(dict)
} }
} }
......
...@@ -318,7 +318,7 @@ class YHResignAppointTimeViewController: YHBaseViewController { ...@@ -318,7 +318,7 @@ class YHResignAppointTimeViewController: YHBaseViewController {
let dict = ["member_id": "\($0.id)"] let dict = ["member_id": "\($0.id)"]
return dict return dict
} }
let dict:[String: Any] = ["ready_to_submit_at": group.getSubmitHKTime(), let dict: [String: Any] = ["ready_to_submit_at": group.getSubmitHKTime(),
"leave_hk_at": group.notleaveHK ? "" : group.getLeaveHKTime(), "leave_hk_at": group.notleaveHK ? "" : group.getLeaveHKTime(),
"users": allUserInfoArr] "users": allUserInfoArr]
batchs.append(dict) batchs.append(dict)
...@@ -338,9 +338,9 @@ class YHResignAppointTimeViewController: YHBaseViewController { ...@@ -338,9 +338,9 @@ class YHResignAppointTimeViewController: YHBaseViewController {
let dict = ["member_id": "\($0.id)"] let dict = ["member_id": "\($0.id)"]
return dict return dict
} }
let dict = ["ready_to_submit_at": group.getSubmitHKTime(), let dict: [String: Any] = ["ready_to_submit_at": group.getSubmitHKTime(),
"leave_hk_at": group.notleaveHK ? "" : group.getLeaveHKTime(), "leave_hk_at": group.notleaveHK ? "" : group.getLeaveHKTime(),
"users": allUserInfoArr] as! [String: Any] "users": allUserInfoArr]
batchs.append(dict) batchs.append(dict)
if allUserInfoArr.count <= 0 { if allUserInfoArr.count <= 0 {
// 人员列表不可为空 // 人员列表不可为空
...@@ -392,7 +392,9 @@ extension YHResignAppointTimeViewController: UITableViewDelegate, UITableViewDat ...@@ -392,7 +392,9 @@ extension YHResignAppointTimeViewController: UITableViewDelegate, UITableViewDat
if indexPath.section == 0 { // 是否一起在港递交的cell if indexPath.section == 0 { // 是否一起在港递交的cell
if self.togetherSetting.isCanEdit { if self.togetherSetting.isCanEdit {
let cell = tableView.dequeueReusableCell(withIdentifier: YHResignAppointOptionCell.cellReuseIdentifier, for: indexPath) as! YHResignAppointOptionCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHResignAppointOptionCell.cellReuseIdentifier, for: indexPath) as? YHResignAppointOptionCell else {
return UITableViewCell()
}
if self.togetherSetting.is_together == 1 { if self.togetherSetting.is_together == 1 {
cell.isSelectTogether = true cell.isSelectTogether = true
...@@ -412,7 +414,9 @@ extension YHResignAppointTimeViewController: UITableViewDelegate, UITableViewDat ...@@ -412,7 +414,9 @@ extension YHResignAppointTimeViewController: UITableViewDelegate, UITableViewDat
return cell return cell
} }
// 不能编辑是否一起递交 只展示 // 不能编辑是否一起递交 只展示
let cell1 = tableView.dequeueReusableCell(withIdentifier: YHResignAppointOptionResultCell.cellReuseIdentifier, for: indexPath) as! YHResignAppointOptionResultCell guard let cell1 = tableView.dequeueReusableCell(withIdentifier: YHResignAppointOptionResultCell.cellReuseIdentifier, for: indexPath) as? YHResignAppointOptionResultCell else {
return UITableViewCell()
}
cell1.isTogether = (self.togetherSetting.is_together == 1) cell1.isTogether = (self.togetherSetting.is_together == 1)
return cell1 return cell1
} }
......
...@@ -47,7 +47,7 @@ class YHChoiceButtonHoldView: UIView { ...@@ -47,7 +47,7 @@ class YHChoiceButtonHoldView: UIView {
if CGFloat(x) + width + 18.0 + butGap > maxWidth { if CGFloat(x) + width + 18.0 + butGap > maxWidth {
x = 0 x = 0
y = y + 1 y += 1
} }
let btn = UIButton(type: .custom) let btn = UIButton(type: .custom)
......
...@@ -128,7 +128,9 @@ extension YHCollegeSearchViewController: UITableViewDelegate, UITableViewDataSou ...@@ -128,7 +128,9 @@ extension YHCollegeSearchViewController: UITableViewDelegate, UITableViewDataSou
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCollegeNameCell.cellReuseIdentifier, for: indexPath) as! YHCollegeNameCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHCollegeNameCell.cellReuseIdentifier, for: indexPath) as? YHCollegeNameCell else {
return UITableViewCell()
}
if indexPath.row < colleges.count { if indexPath.row < colleges.count {
let college: YHCollegeInfo = colleges[indexPath.row] let college: YHCollegeInfo = colleges[indexPath.row]
......
...@@ -353,7 +353,7 @@ extension YHEducationDetailVC: UITableViewDelegate, UITableViewDataSource { ...@@ -353,7 +353,7 @@ extension YHEducationDetailVC: UITableViewDelegate, UITableViewDataSource {
return return
} }
if item is YHFormDetailItem { if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem if let detailItem = item as? YHFormDetailItem {
if detailItem.type == .universityFullName { // 选择大学名称 if detailItem.type == .universityFullName { // 选择大学名称
if detailInfo.degree.contains("学士学位") { if detailInfo.degree.contains("学士学位") {
...@@ -526,6 +526,7 @@ extension YHEducationDetailVC: UITableViewDelegate, UITableViewDataSource { ...@@ -526,6 +526,7 @@ extension YHEducationDetailVC: UITableViewDelegate, UITableViewDataSource {
} }
} }
} }
}
func createDefaultCell(_ indexPath: IndexPath) -> UITableViewCell { func createDefaultCell(_ indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath) let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath)
......
...@@ -244,8 +244,10 @@ extension YHEducationInfoListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -244,8 +244,10 @@ extension YHEducationInfoListVC: UITableViewDelegate, UITableViewDataSource {
} }
if item is YHFormAddItem { if item is YHFormAddItem {
let detailItem = item as! YHFormAddItem guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemAddCell.cellReuseIdentifier, for: indexPath) as? YHFormItemAddCell else {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemAddCell.cellReuseIdentifier, for: indexPath) as! YHFormItemAddCell return UITableViewCell()
}
if let detailItem = item as? YHFormAddItem {
if detailItem.type == .addEducation { if detailItem.type == .addEducation {
cell.title = "新增学历信息" cell.title = "新增学历信息"
...@@ -273,13 +275,16 @@ extension YHEducationInfoListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -273,13 +275,16 @@ extension YHEducationInfoListVC: UITableViewDelegate, UITableViewDataSource {
} }
return return
} }
}
return cell return cell
} }
if item is YHQuestionInfo { if item is YHQuestionInfo {
let detailItem = item as! YHQuestionInfo guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemQuestionsCell.cellReuseIdentifier, for: indexPath) as? YHFormItemQuestionsCell else {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemQuestionsCell.cellReuseIdentifier, for: indexPath) as! YHFormItemQuestionsCell return UITableViewCell()
}
if let detailItem = item as? YHQuestionInfo {
cell.isMust = true cell.isMust = true
cell.title = String(format: "%d、\(detailItem.question)", indexPath.row) cell.title = String(format: "%d、\(detailItem.question)", indexPath.row)
...@@ -307,18 +312,21 @@ extension YHEducationInfoListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -307,18 +312,21 @@ extension YHEducationInfoListVC: UITableViewDelegate, UITableViewDataSource {
} }
loadInfo() loadInfo()
} }
}
return cell return cell
} }
if item is YHFormDetailItem { if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem guard let detailItem = item as? YHFormDetailItem else { return UITableViewCell() }
if detailItem.type == .educationInfo { if detailItem.type == .educationInfo {
if let eduList = educationInfo?.eduList, eduList.count > 0 { if let eduList = educationInfo?.eduList, eduList.count > 0 {
// 第一行是标题 // 第一行是标题
let eduInfo: YHEducationInfo = eduList[indexPath.row-1] let eduInfo: YHEducationInfo = eduList[indexPath.row-1]
if eduInfo.vacantNum > 0 { // 有未填项 if eduInfo.vacantNum > 0 { // 有未填项
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier, for: indexPath) as! YHFormItemEnterDetailCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier, for: indexPath) as? YHFormItemEnterDetailCell else {
return UITableViewCell()
}
if let college = eduInfo.college, !college.isEmpty { if let college = eduInfo.college, !college.isEmpty {
cell.title = eduInfo.college cell.title = eduInfo.college
} else { } else {
...@@ -345,7 +353,9 @@ extension YHEducationInfoListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -345,7 +353,9 @@ extension YHEducationInfoListVC: UITableViewDelegate, UITableViewDataSource {
} else { // 数据已填满 } else { // 数据已填满
let cell = tableView.dequeueReusableCell(withIdentifier: YHEducationInfoCell.cellReuseIdentifier, for: indexPath) as! YHEducationInfoCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHEducationInfoCell.cellReuseIdentifier, for: indexPath) as? YHEducationInfoCell else {
return UITableViewCell()
}
cell.titleLabel.text = eduInfo.college cell.titleLabel.text = eduInfo.college
cell.subTitleLabel.text = "" cell.subTitleLabel.text = ""
if let major = eduInfo.major, let degree = eduInfo.degree { if let major = eduInfo.major, let degree = eduInfo.degree {
...@@ -377,7 +387,10 @@ extension YHEducationInfoListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -377,7 +387,10 @@ extension YHEducationInfoListVC: UITableViewDelegate, UITableViewDataSource {
if let quaList = educationInfo?.quaList, quaList.count > 0 { if let quaList = educationInfo?.quaList, quaList.count > 0 {
// 第一行是标题 // 第一行是标题
let quaInfo: YHQualificationInfo = quaList[indexPath.row-1] let quaInfo: YHQualificationInfo = quaList[indexPath.row-1]
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier, for: indexPath) as! YHFormItemEnterDetailCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier, for: indexPath) as? YHFormItemEnterDetailCell else {
return UITableViewCell()
}
cell.title = "证书标题" cell.title = "证书标题"
if let qualification = quaInfo.qualification, !qualification.isEmpty { if let qualification = quaInfo.qualification, !qualification.isEmpty {
cell.title = qualification cell.title = qualification
......
...@@ -155,9 +155,12 @@ extension YHQualificationDetailVC: UITableViewDelegate, UITableViewDataSource { ...@@ -155,9 +155,12 @@ extension YHQualificationDetailVC: UITableViewDelegate, UITableViewDataSource {
let item: YHFormItemProtocol = arr[indexPath.row] let item: YHFormItemProtocol = arr[indexPath.row]
if item is YHFormTitleItem { // 是标题 if item is YHFormTitleItem { // 是标题
let formItem = item as! YHFormTitleItem guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as? YHFormItemTitleCell else {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormItemTitleCell return UITableViewCell()
}
if let formItem = item as? YHFormTitleItem {
cell.setTitleAndSubTitle(title: formItem.getTitle()) cell.setTitleAndSubTitle(title: formItem.getTitle())
}
return cell return cell
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment