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,39 +301,39 @@ extension YHResignAppointTimeModifyViewController { ...@@ -301,39 +301,39 @@ 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]
if !item.isHaveAppointed { // 不是已确认在港 if !item.isHaveAppointed { // 不是已确认在港
var members = item.users var members = item.users
members.append(newMember) members.append(newMember)
item.users = members item.users = members
break break
} }
nextGroupIndex += 1 nextGroupIndex += 1
}
if nextGroupIndex == selectGroupArr.count { // 在现有列表没有找到下一批可以操作的批次 则需要分一个新批次
// 进行分批
let newItem = YHResignAppointTimeSettingModel()
newItem.isShowUsers = true
// 批次+1
newItem.itemIndex = groupLevel+1
// 找出上一批未选中的人
let needMembers = currentMembers.filter {
return $0.isSelected == false
} }
// 在下一批中默认全选中
let nextMembers = needMembers.deepCopy().map { if nextGroupIndex == selectGroupArr.count { // 在现有列表没有找到下一批可以操作的批次 则需要分一个新批次
let item = $0 // 进行分批
item.isSelected = true let newItem = YHResignAppointTimeSettingModel()
return item newItem.isShowUsers = true
// 批次+1
newItem.itemIndex = groupLevel+1
// 找出上一批未选中的人
let needMembers = currentMembers.filter {
return $0.isSelected == false
}
// 在下一批中默认全选中
let nextMembers = needMembers.deepCopy().map {
let item = $0
item.isSelected = true
return item
}
newItem.users = nextMembers
selectGroupArr.append(newItem)
} }
newItem.users = nextMembers
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]
......
...@@ -244,81 +244,89 @@ extension YHEducationInfoListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -244,81 +244,89 @@ 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 detailItem.type == .addEducation {
cell.title = "新增学历信息"
} else if detailItem.type == .addCertificateInfo {
cell.title = "新增证书信息"
} else {
cell.title = ""
} }
if let detailItem = item as? YHFormAddItem {
cell.clickBlock = { if detailItem.type == .addEducation {
cell.title = "新增学历信息"
[weak self] in
guard let self = self else { return } } else if detailItem.type == .addCertificateInfo {
cell.title = "新增证书信息"
} else {
cell.title = ""
}
if detailItem.type == .addEducation { // 学历 cell.clickBlock = {
let vc = YHEducationDetailVC()
vc.orderId = self.orderId
self.navigationController?.pushViewController(vc)
} else if detailItem.type == .addCertificateInfo { // 证书 [weak self] in
let vc = YHQualificationDetailVC() guard let self = self else { return }
vc.orderId = self.orderId
self.navigationController?.pushViewController(vc) if detailItem.type == .addEducation { // 学历
let vc = YHEducationDetailVC()
vc.orderId = self.orderId
self.navigationController?.pushViewController(vc)
} else if detailItem.type == .addCertificateInfo { // 证书
let vc = YHQualificationDetailVC()
vc.orderId = self.orderId
self.navigationController?.pushViewController(vc)
}
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()
cell.isMust = true
cell.title = String(format: "%d、\(detailItem.question)", indexPath.row)
var select0 = false
var select1 = false
if let answer = detailItem.answer {
select0 = answer
select1 = !answer
} }
if let detailItem = item as? YHQuestionInfo {
let answers = [YHFormChoiceItem(title: "是".local, isSelect: select0), YHFormChoiceItem(title: "否".local, isSelect: select1)] cell.isMust = true
cell.answerArr = answers cell.title = String(format: "%d、\(detailItem.question)", indexPath.row)
cell.answerBlock = {
[weak self] (arr, selectIndex) in var select0 = false
guard let self = self else { return } var select1 = false
if let answer = detailItem.answer {
select0 = answer
select1 = !answer
}
let selectItem: YHFormChoiceItem = arr[selectIndex] let answers = [YHFormChoiceItem(title: "是".local, isSelect: select0), YHFormChoiceItem(title: "否".local, isSelect: select1)]
let option = (selectItem.title == "是".local ? true : false) cell.answerArr = answers
if detailItem.key == "qualification" { cell.answerBlock = {
self.educationInfo?.isNameSameNew = option ? 1 : 2
[weak self] (arr, selectIndex) in
guard let self = self else { return }
} else if detailItem.key == "graduate" { let selectItem: YHFormChoiceItem = arr[selectIndex]
self.educationInfo?.isSpouseNameSame = option let option = (selectItem.title == "是".local ? true : false)
if detailItem.key == "qualification" {
self.educationInfo?.isNameSameNew = option ? 1 : 2
} else if detailItem.key == "graduate" {
self.educationInfo?.isSpouseNameSame = option
}
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()
cell.setTitleAndSubTitle(title: formItem.getTitle()) }
if let formItem = item as? YHFormTitleItem {
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