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

// lint

parent 9f015eff
......@@ -452,7 +452,9 @@ extension YHCertificateAppointViewController: UITableViewDelegate, UITableViewDa
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.cancelAppointBlock = {
[weak self] groupModel in
......@@ -486,7 +488,9 @@ extension YHCertificateAppointViewController: UITableViewDelegate, UITableViewDa
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
return cell
}
......
......@@ -301,39 +301,39 @@ extension YHResignAppointTimeModifyViewController {
} else { // 如果操作的当前批次不是最后一批 需要更新当前批次的下一批该用户的选中状态
var nextGroupIndex = groupLevel+1
let newMember = currentMember.copy() as! YHResignAppointMember
newMember.isSelected = true
while 0 <= nextGroupIndex, nextGroupIndex < selectGroupArr.count {
let item = selectGroupArr[nextGroupIndex]
if !item.isHaveAppointed { // 不是已确认在港
var members = item.users
members.append(newMember)
item.users = members
break
}
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
if let newMember = currentMember.copy() as? YHResignAppointMember {
newMember.isSelected = true
while 0 <= nextGroupIndex, nextGroupIndex < selectGroupArr.count {
let item = selectGroupArr[nextGroupIndex]
if !item.isHaveAppointed { // 不是已确认在港
var members = item.users
members.append(newMember)
item.users = members
break
}
nextGroupIndex += 1
}
// 在下一批中默认全选中
let nextMembers = needMembers.deepCopy().map {
let item = $0
item.isSelected = true
return item
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 {
let item = $0
item.isSelected = true
return item
}
newItem.users = nextMembers
selectGroupArr.append(newItem)
}
newItem.users = nextMembers
selectGroupArr.append(newItem)
}
}
} else { // 如果操作是选中
......@@ -436,9 +436,9 @@ extension YHResignAppointTimeModifyViewController {
let dict = ["member_id": "\($0.id)"]
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(),
"users": allUserInfoArr] as! [String: Any]
"users": allUserInfoArr]
batchs.append(dict)
} else {
......@@ -453,9 +453,9 @@ extension YHResignAppointTimeModifyViewController {
let dict = ["member_id": "\($0.id)"]
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(),
"users": allUserInfoArr] as! [String: Any]
"users": allUserInfoArr]
batchs.append(dict)
}
}
......
......@@ -318,7 +318,7 @@ class YHResignAppointTimeViewController: YHBaseViewController {
let dict = ["member_id": "\($0.id)"]
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(),
"users": allUserInfoArr]
batchs.append(dict)
......@@ -338,9 +338,9 @@ class YHResignAppointTimeViewController: YHBaseViewController {
let dict = ["member_id": "\($0.id)"]
return dict
}
let dict = ["ready_to_submit_at": group.getSubmitHKTime(),
"leave_hk_at": group.notleaveHK ? "" : group.getLeaveHKTime(),
"users": allUserInfoArr] as! [String: Any]
let dict: [String: Any] = ["ready_to_submit_at": group.getSubmitHKTime(),
"leave_hk_at": group.notleaveHK ? "" : group.getLeaveHKTime(),
"users": allUserInfoArr]
batchs.append(dict)
if allUserInfoArr.count <= 0 {
// 人员列表不可为空
......@@ -392,7 +392,9 @@ extension YHResignAppointTimeViewController: UITableViewDelegate, UITableViewDat
if indexPath.section == 0 { // 是否一起在港递交的cell
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 {
cell.isSelectTogether = true
......@@ -412,7 +414,9 @@ extension YHResignAppointTimeViewController: UITableViewDelegate, UITableViewDat
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)
return cell1
}
......
......@@ -47,7 +47,7 @@ class YHChoiceButtonHoldView: UIView {
if CGFloat(x) + width + 18.0 + butGap > maxWidth {
x = 0
y = y + 1
y += 1
}
let btn = UIButton(type: .custom)
......
......@@ -128,7 +128,9 @@ extension YHCollegeSearchViewController: UITableViewDelegate, UITableViewDataSou
}
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 {
let college: YHCollegeInfo = colleges[indexPath.row]
......
......@@ -244,81 +244,89 @@ extension YHEducationInfoListVC: UITableViewDelegate, UITableViewDataSource {
}
if item is YHFormAddItem {
let detailItem = item as! YHFormAddItem
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemAddCell.cellReuseIdentifier, for: indexPath) as! YHFormItemAddCell
if detailItem.type == .addEducation {
cell.title = "新增学历信息"
} else if detailItem.type == .addCertificateInfo {
cell.title = "新增证书信息"
} else {
cell.title = ""
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemAddCell.cellReuseIdentifier, for: indexPath) as? YHFormItemAddCell else {
return UITableViewCell()
}
cell.clickBlock = {
[weak self] in
guard let self = self else { return }
if let detailItem = item as? YHFormAddItem {
if detailItem.type == .addEducation {
cell.title = "新增学历信息"
} else if detailItem.type == .addCertificateInfo {
cell.title = "新增证书信息"
} else {
cell.title = ""
}
if detailItem.type == .addEducation { // 学历
let vc = YHEducationDetailVC()
vc.orderId = self.orderId
self.navigationController?.pushViewController(vc)
cell.clickBlock = {
} else if detailItem.type == .addCertificateInfo { // 证书
let vc = YHQualificationDetailVC()
vc.orderId = self.orderId
self.navigationController?.pushViewController(vc)
[weak self] in
guard let self = self else { return }
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
}
if item is YHQuestionInfo {
let detailItem = item as! YHQuestionInfo
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemQuestionsCell.cellReuseIdentifier, for: indexPath) as! YHFormItemQuestionsCell
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
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemQuestionsCell.cellReuseIdentifier, for: indexPath) as? YHFormItemQuestionsCell else {
return UITableViewCell()
}
let answers = [YHFormChoiceItem(title: "是".local, isSelect: select0), YHFormChoiceItem(title: "否".local, isSelect: select1)]
cell.answerArr = answers
cell.answerBlock = {
if let detailItem = item as? YHQuestionInfo {
cell.isMust = true
cell.title = String(format: "%d、\(detailItem.question)", indexPath.row)
[weak self] (arr, selectIndex) in
guard let self = self else { return }
var select0 = false
var select1 = false
if let answer = detailItem.answer {
select0 = answer
select1 = !answer
}
let selectItem: YHFormChoiceItem = arr[selectIndex]
let option = (selectItem.title == "是".local ? true : false)
if detailItem.key == "qualification" {
self.educationInfo?.isNameSameNew = option ? 1 : 2
let answers = [YHFormChoiceItem(title: "是".local, isSelect: select0), YHFormChoiceItem(title: "否".local, isSelect: select1)]
cell.answerArr = answers
cell.answerBlock = {
[weak self] (arr, selectIndex) in
guard let self = self else { return }
} else if detailItem.key == "graduate" {
self.educationInfo?.isSpouseNameSame = option
let selectItem: YHFormChoiceItem = arr[selectIndex]
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
}
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
guard let detailItem = item as? YHFormDetailItem else { return UITableViewCell() }
if detailItem.type == .educationInfo {
if let eduList = educationInfo?.eduList, eduList.count > 0 {
// 第一行是标题
let eduInfo: YHEducationInfo = eduList[indexPath.row-1]
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 {
cell.title = eduInfo.college
} else {
......@@ -345,7 +353,9 @@ extension YHEducationInfoListVC: UITableViewDelegate, UITableViewDataSource {
} 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.subTitleLabel.text = ""
if let major = eduInfo.major, let degree = eduInfo.degree {
......@@ -377,7 +387,10 @@ extension YHEducationInfoListVC: UITableViewDelegate, UITableViewDataSource {
if let quaList = educationInfo?.quaList, quaList.count > 0 {
// 第一行是标题
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 = "证书标题"
if let qualification = quaInfo.qualification, !qualification.isEmpty {
cell.title = qualification
......
......@@ -155,9 +155,12 @@ extension YHQualificationDetailVC: UITableViewDelegate, UITableViewDataSource {
let item: YHFormItemProtocol = arr[indexPath.row]
if item is YHFormTitleItem { // 是标题
let formItem = item as! YHFormTitleItem
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormItemTitleCell
cell.setTitleAndSubTitle(title: formItem.getTitle())
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as? YHFormItemTitleCell else {
return UITableViewCell()
}
if let formItem = item as? YHFormTitleItem {
cell.setTitleAndSubTitle(title: formItem.getTitle())
}
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