Commit 3878f029 authored by Steven杜宇's avatar Steven杜宇

// lint

parent c91d3e5d
...@@ -689,7 +689,7 @@ extension YHCertificateAppointViewController { ...@@ -689,7 +689,7 @@ extension YHCertificateAppointViewController {
} else { // 如果操作的当前批次不是最后一批 需要更新后面几批的选中状态 } else { // 如果操作的当前批次不是最后一批 需要更新后面几批的选中状态
let nextGroupIndex = groupLevel+1 let nextGroupIndex = groupLevel+1
let newMember = currentMember.copy() as! YHHKMemberModel if let newMember = currentMember.copy() as? YHHKMemberModel {
newMember.isSelected = true newMember.isSelected = true
if 0 <= groupLevel, groupLevel < selectMemberGroupArr.count { if 0 <= groupLevel, groupLevel < selectMemberGroupArr.count {
let item = selectMemberGroupArr[nextGroupIndex] let item = selectMemberGroupArr[nextGroupIndex]
...@@ -699,6 +699,8 @@ extension YHCertificateAppointViewController { ...@@ -699,6 +699,8 @@ extension YHCertificateAppointViewController {
} }
} }
} }
}
} else { // 如果操作是选中 } else { // 如果操作是选中
// 肯定会有下一层因为之前取消过 // 肯定会有下一层因为之前取消过
...@@ -814,9 +816,9 @@ extension YHCertificateAppointViewController { ...@@ -814,9 +816,9 @@ extension YHCertificateAppointViewController {
return $0.isSelected == true return $0.isSelected == true
} }
let users = selectUsers.map { let users = selectUsers.map {
let dict = ["id": $0.id, let dict:[String: Any] = ["id": $0.id,
"type": $0.type, "type": $0.type,
"name": $0.name] as! [String: Any] "name": $0.name]
return dict return dict
} }
......
...@@ -436,7 +436,7 @@ extension YHResignAppointTimeModifyViewController { ...@@ -436,7 +436,7 @@ extension YHResignAppointTimeModifyViewController {
let dict = ["member_id": "\($0.id)"] let dict = ["member_id": "\($0.id)"]
return dict return dict
} }
let dict:[String: Any] = ["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] "users": allUserInfoArr]
batchs.append(dict) batchs.append(dict)
...@@ -453,7 +453,7 @@ extension YHResignAppointTimeModifyViewController { ...@@ -453,7 +453,7 @@ extension YHResignAppointTimeModifyViewController {
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)
......
...@@ -425,7 +425,9 @@ extension YHResignAppointTimeViewController: UITableViewDelegate, UITableViewDat ...@@ -425,7 +425,9 @@ extension YHResignAppointTimeViewController: UITableViewDelegate, UITableViewDat
if 0 <= indexPath.row && indexPath.row < selectGroupArr.count { if 0 <= indexPath.row && indexPath.row < selectGroupArr.count {
let model = selectGroupArr[indexPath.row] let model = selectGroupArr[indexPath.row]
if !model.isShowUsers || self.togetherSetting.is_together == 1 { // 不分组选择cell if !model.isShowUsers || self.togetherSetting.is_together == 1 { // 不分组选择cell
let cell2 = tableView.dequeueReusableCell(withIdentifier: YHResignAppointTimeSingleCell.cellReuseIdentifier, for: indexPath) as! YHResignAppointTimeSingleCell guard let cell2 = tableView.dequeueReusableCell(withIdentifier: YHResignAppointTimeSingleCell.cellReuseIdentifier, for: indexPath) as? YHResignAppointTimeSingleCell else {
return UITableViewCell()
}
cell2.updateModel(model) cell2.updateModel(model)
cell2.switchBlock = { cell2.switchBlock = {
[weak self] isOn in [weak self] isOn in
...@@ -441,7 +443,9 @@ extension YHResignAppointTimeViewController: UITableViewDelegate, UITableViewDat ...@@ -441,7 +443,9 @@ extension YHResignAppointTimeViewController: UITableViewDelegate, UITableViewDat
return cell2 return cell2
} }
// 分组选择cell // 分组选择cell
let cell3 = tableView.dequeueReusableCell(withIdentifier: YHResignAppointTimeMultipleCell.cellReuseIdentifier, for: indexPath) as! YHResignAppointTimeMultipleCell guard let cell3 = tableView.dequeueReusableCell(withIdentifier: YHResignAppointTimeMultipleCell.cellReuseIdentifier, for: indexPath) as? YHResignAppointTimeMultipleCell else {
return UITableViewCell()
}
cell3.updateModel(model) cell3.updateModel(model)
cell3.selectUserBlock = { cell3.selectUserBlock = {
[weak self] member, isSelect, groupIndex in [weak self] member, isSelect, groupIndex in
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
import UIKit import UIKit
class YHChoiceButtonHoldView: UIView { class YHChoiceButtonHoldView: UIView {
typealias block = (_ index: String) -> Void typealias Block = (_ index: String) -> Void
var callBackBlock: block? var callBackBlock: Block?
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
......
...@@ -565,7 +565,9 @@ extension YHEducationDetailVC: UITableViewDelegate, UITableViewDataSource { ...@@ -565,7 +565,9 @@ extension YHEducationDetailVC: UITableViewDelegate, UITableViewDataSource {
} }
if item is YHFormDetailItem { if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem guard let detailItem = item as? YHFormDetailItem else {
return .defaultType
}
if detailItem.type == .cerConfirm { if detailItem.type == .cerConfirm {
return .cerConfirm return .cerConfirm
......
...@@ -477,7 +477,9 @@ extension YHEducationInfoListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -477,7 +477,9 @@ extension YHEducationInfoListVC: UITableViewDelegate, UITableViewDataSource {
} }
if item is YHFormDetailItem { if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem guard let detailItem = item as? YHFormDetailItem else {
return
}
if detailItem.type == .educationInfo { // 学历 if detailItem.type == .educationInfo { // 学历
let vc = YHEducationDetailVC() let vc = YHEducationDetailVC()
if let eduList = educationInfo?.eduList, indexPath.row-1 < eduList.count { if let eduList = educationInfo?.eduList, indexPath.row-1 < eduList.count {
......
...@@ -166,10 +166,12 @@ extension YHQualificationDetailVC: UITableViewDelegate, UITableViewDataSource { ...@@ -166,10 +166,12 @@ extension YHQualificationDetailVC: UITableViewDelegate, UITableViewDataSource {
if item is YHFormDetailItem { if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem guard let detailItem = item as? YHFormDetailItem else { return UITableViewCell()}
let cellType = getCellType(detailItem) let cellType = getCellType(detailItem)
if cellType == .inputText { if cellType == .inputText {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as? YHFormItemInputTextCell else {
return UITableViewCell()
}
var isValueValid = false var isValueValid = false
if let value = detailItem.value, !value.isEmpty { if let value = detailItem.value, !value.isEmpty {
isValueValid = true isValueValid = true
...@@ -224,7 +226,9 @@ extension YHQualificationDetailVC: UITableViewDelegate, UITableViewDataSource { ...@@ -224,7 +226,9 @@ extension YHQualificationDetailVC: UITableViewDelegate, UITableViewDataSource {
} else if cellType == .selectSheet { } else if cellType == .selectSheet {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as? YHFormItemSelectSheetCell else {
return UITableViewCell()
}
cell.placeHolder = detailItem.placeHolder cell.placeHolder = detailItem.placeHolder
var isValueValid = false var isValueValid = false
if let value = detailItem.value, !value.isEmpty { if let value = detailItem.value, !value.isEmpty {
...@@ -274,7 +278,7 @@ extension YHQualificationDetailVC: UITableViewDelegate, UITableViewDataSource { ...@@ -274,7 +278,7 @@ extension YHQualificationDetailVC: UITableViewDelegate, UITableViewDataSource {
return return
} }
if item is YHFormDetailItem { if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem guard let detailItem = item as? YHFormDetailItem else { return }
if detailItem.type == .qualificationCertificateName { // 资格证书名称 if detailItem.type == .qualificationCertificateName { // 资格证书名称
......
...@@ -39,7 +39,9 @@ extension YHQuestionInfo { ...@@ -39,7 +39,9 @@ extension YHQuestionInfo {
// 【问题】学历证书姓名及出生日期正确性 // 【问题】学历证书姓名及出生日期正确性
static func getEducationQuestion(eduList: YHEducationListInfo) -> [YHQuestionInfo] { static func getEducationQuestion(eduList: YHEducationListInfo) -> [YHQuestionInfo] {
let path = Bundle.main.path(forResource: "YHQuestionList", ofType: "plist") let path = Bundle.main.path(forResource: "YHQuestionList", ofType: "plist")
let questions: [Dictionary] = NSArray(contentsOfFile: path!) as! [Dictionary<String, Any>] guard let questions: [Dictionary] = NSArray(contentsOfFile: path!) as? [Dictionary<String, Any>] else {
return []
}
var res: [YHQuestionInfo] = [] var res: [YHQuestionInfo] = []
for dict in questions { for dict in questions {
guard let questionInfo = YHQuestionInfo.deserialize(from: dict) else { guard let questionInfo = YHQuestionInfo.deserialize(from: dict) else {
......
...@@ -302,7 +302,9 @@ class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -302,7 +302,9 @@ class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
return .addItem return .addItem
} }
if item is YHFormDetailItem { if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem guard let detailItem = item as? YHFormDetailItem else {
return .defaultType
}
if detailItem.type == .birthCity { if detailItem.type == .birthCity {
return .inputText return .inputText
......
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