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

// lint

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