Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
a3ee8c01
Commit
a3ee8c01
authored
Nov 19, 2024
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工作经验细节修改
parent
e6d2080f
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
369 additions
and
293 deletions
+369
-293
YHOtherPickerView.swift
...(我的信息流程)/OtherInformation(其他信息)/V/YHOtherPickerView.swift
+12
-2
YHWorkExperiencePositionViewViewController.swift
...(工作经验)/C/YHWorkExperiencePositionViewViewController.swift
+51
-59
YHWorkExperienceViewController.swift
...rkExperience(工作经验)/C/YHWorkExperienceViewController.swift
+46
-40
YHWorkExperienceDetailModel.swift
...kExperience(工作经验)/Model/YHWorkExperienceDetailModel.swift
+1
-0
YHWorkExperienceModel.swift
...程)/WorkExperience(工作经验)/Model/YHWorkExperienceModel.swift
+2
-1
YHWorkExperiencePositionModel.swift
...xperience(工作经验)/Model/YHWorkExperiencePositionModel.swift
+3
-2
YHWorkExperienceItemView.swift
...流程)/WorkExperience(工作经验)/V/YHWorkExperienceItemView.swift
+15
-0
YHWorkExperiencePositionItemView.swift
...Experience(工作经验)/V/YHWorkExperiencePositionItemView.swift
+27
-11
YHWorkExperiencePositionListTableViewCell.swift
...e(工作经验)/V/YHWorkExperiencePositionListTableViewCell.swift
+1
-7
YHWorkExperiencePositionReasonTableViewCell.swift
...工作经验)/V/YHWorkExperiencePositionReasonTableViewCell.swift
+24
-13
YHWorkExperiencePositionTableViewCell.swift
...ience(工作经验)/V/YHWorkExperiencePositionTableViewCell.swift
+9
-9
YHWorkExperiencePositionViewModel.swift
...e(工作经验)/ViewModel/YHWorkExperiencePositionViewModel.swift
+122
-145
YHWorkExperienceViewModel.swift
...xperience(工作经验)/ViewModel/YHWorkExperienceViewModel.swift
+28
-4
YHConstantArrayData.swift
galaxy/galaxy/Classes/Tools/Helper/YHConstantArrayData.swift
+23
-0
YHAllApiName.swift
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
+5
-0
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/OtherInformation(其他信息)/V/YHOtherPickerView.swift
View file @
a3ee8c01
...
...
@@ -248,6 +248,8 @@ class YHOtherPickerView: UIView {
return
"选择星座"
case
.
selectAddress
:
return
"选择国家地区"
case
.
field
:
return
"选择经验领域"
default
:
return
"请选择"
}
...
...
@@ -275,7 +277,7 @@ extension YHOtherPickerView: UIPickerViewDelegate, UIPickerViewDataSource {
func
pickerView
(
_
pickerView
:
UIPickerView
,
rowHeightForComponent
component
:
Int
)
->
CGFloat
{
switch
type
{
case
.
nature
,
.
certificate
,
.
structure
,
.
level
,
.
prove
,
.
idType
,
.
sex
,
.
marry
,
.
constellation
:
case
.
nature
,
.
certificate
,
.
structure
,
.
level
,
.
prove
,
.
idType
,
.
sex
,
.
marry
,
.
constellation
,
.
field
:
return
50
default
:
return
70
...
...
@@ -285,7 +287,7 @@ extension YHOtherPickerView: UIPickerViewDelegate, UIPickerViewDataSource {
func
pickerView
(
_
pickerView
:
UIPickerView
,
viewForRow
row
:
Int
,
forComponent
component
:
Int
,
reusing
view
:
UIView
?)
->
UIView
{
switch
type
{
case
.
nature
,
.
certificate
,
.
structure
,
.
level
,
.
prove
,
.
idType
,
.
travelIdType
,
.
sex
,
.
marry
,
.
constellation
,
.
selectAddress
:
case
.
nature
,
.
certificate
,
.
structure
,
.
level
,
.
prove
,
.
idType
,
.
travelIdType
,
.
sex
,
.
marry
,
.
constellation
,
.
selectAddress
,
.
field
:
let
label
=
UILabel
()
label
.
textColor
=
UIColor
.
mainTextColor
label
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
14
)
...
...
@@ -450,6 +452,14 @@ extension YHOtherPickerView {
arrData
.
append
(
model
)
}
title
=
getTitle
(
type
:
type
)
case
.
field
:
let
arr
=
YHConstantArrayData
.
arrSelectField
arrData
.
removeAll
()
arr
.
forEach
{
item
in
let
model
=
YHOtherPickerViewItemData
(
title
:
item
[
"title"
]
??
"-"
,
subTitle
:
""
,
index
:
item
[
"id"
]
??
"-"
)
arrData
.
append
(
model
)
}
title
=
getTitle
(
type
:
type
)
default
:
return
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/WorkExperience(工作经验)/C/YHWorkExperiencePositionViewViewController.swift
View file @
a3ee8c01
...
...
@@ -17,11 +17,14 @@ class YHWorkExperiencePositionViewViewController: YHBaseViewController {
var
introductionDataSource
:
[
YHWorkExperienceProjectModel
]?
var
fileDataSource
:
[
YHWorkExperienceFileModel
]?
var
workExperienceID
:
String
?
var
workID
:
Int
=
0
var
orderID
:
Int
=
0
var
positionId
:
Int
=
0
var
isMore
:
Bool
=
false
var
isShowPrompt
:
Bool
=
false
var
isShowMessageSelect
:
Bool
=
true
var
isKeyboardShow
:
Bool
=
false
var
selectReasonIndex
:
Int
=
5
var
selectEditItem
=
YHWorkExperienceFileModel
()
override
func
viewDidLoad
()
{
...
...
@@ -36,8 +39,17 @@ class YHWorkExperiencePositionViewViewController: YHBaseViewController {
}
func
getData
()
{
self
.
baseDataSource
=
self
.
viewModel
.
getBaseDataSource
(
false
)
updateDataSource
()
viewModel
.
requestWorkPositionDetail
(
workID
,
positionId
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
??
false
{
self
.
selectReasonIndex
=
self
.
viewModel
.
position
.
provide_certificate_type
-
1
updateDataSource
()
}
else
{
self
.
viewModel
.
position
.
work_id
=
workID
self
.
viewModel
.
position
.
order_id
=
orderID
updateDataSource
()
}
}
}
func
getTextWithType
(
type
:
Int
)
->
ASAttributedString
{
...
...
@@ -75,7 +87,7 @@ class YHWorkExperiencePositionViewViewController: YHBaseViewController {
func
updateDataSource
()
{
bottomView
.
nextButton
.
setTitle
(
"提交"
,
for
:
.
normal
)
self
.
baseDataSource
=
self
.
viewModel
.
getBaseDataSource
(
false
)
self
.
tableView
.
reloadData
()
}
...
...
@@ -85,6 +97,7 @@ class YHWorkExperiencePositionViewViewController: YHBaseViewController {
if
#available(iOS 11.0, *)
{
tableView
.
contentInsetAdjustmentBehavior
=
.
never
}
tableView
.
sectionHeaderHeight
=
16
tableView
.
backgroundColor
=
.
clear
tableView
.
separatorStyle
=
.
none
tableView
.
delegate
=
self
...
...
@@ -105,41 +118,35 @@ class YHWorkExperiencePositionViewViewController: YHBaseViewController {
bottom
.
nextblock
=
{
[
weak
self
]
in
bottom
.
nextButton
.
isEnabled
=
false
guard
let
self
=
self
else
{
return
}
// if self.viewModel.isCanNext(self.stepView.currentIndex) {
// self.viewModel.mainModel.step = self.stepView.currentIndex
// self.viewModel.saveWorkDetail(1, orderID: self.orderID, callBackBlock: {[weak self] flag, error in
// guard let self = self else { return }
// bottom.nextButton.isEnabled = true
// if let error = error {
// YHHUD.flash(message: error.errorMsg )
// } else {
// YHHUD.hideFlashMessage()
// if self.stepView.currentIndex == 3 {
// YHHUD.flash(message: "提交成功")
// self.navigationController?.popViewController()
// } else {
// self.stepView.currentIndex = self.stepView.currentIndex + 1
// self.updateDataSource()
// }
// }
// })
// } else {
// bottom.nextButton.isEnabled = true
// self.isShowPrompt = true
// self.updateDataSource()
// YHHUD.flash(message: "您还有信息未填写")
// }
if
self
.
viewModel
.
isCanNext
()
{
self
.
viewModel
.
saveWorkPosition
(
callBackBlock
:
{[
weak
self
]
flag
,
error
in
guard
let
self
=
self
else
{
return
}
bottom
.
nextButton
.
isEnabled
=
true
if
let
error
=
error
{
YHHUD
.
flash
(
message
:
error
.
errorMsg
)
}
else
{
YHHUD
.
hideFlashMessage
()
YHHUD
.
flash
(
message
:
"提交成功"
)
self
.
navigationController
?
.
popViewController
()
}
})
}
else
{
bottom
.
nextButton
.
isEnabled
=
true
self
.
isShowPrompt
=
true
self
.
updateDataSource
()
YHHUD
.
flash
(
message
:
"您还有信息未填写"
)
}
}
bottom
.
saveBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
// self.viewModel.saveWorkDetail(0, orderID: self.orderID,
callBackBlock: {[weak self] flag, error in
// guard let self
= self else { return }
//
if let error = error {
//
YHHUD.flash(message: error.errorMsg )
//
} else {
//
YHHUD.flash(message: "保存成功")
//
}
//
})
self
.
viewModel
.
saveWorkPosition
(
callBackBlock
:
{[
weak
self
]
flag
,
error
in
guard
let
_
=
self
else
{
return
}
if
let
error
=
error
{
YHHUD
.
flash
(
message
:
error
.
errorMsg
)
}
else
{
YHHUD
.
flash
(
message
:
"保存成功"
)
}
})
}
return
bottom
}()
...
...
@@ -159,26 +166,6 @@ class YHWorkExperiencePositionViewViewController: YHBaseViewController {
}
}
func
showDeleteAlert
(
_
model
:
YHWorkExperienceFileModel
)
{
YHCommonAlertView
.
show
(
""
,
"确定要删除吗?"
,
"取消"
,
"确认"
)
{[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
for
i
in
0
..<
(
self
.
fileDataSource
?
.
count
??
0
)
{
let
data
=
self
.
fileDataSource
?[
i
]
if
data
?
.
fileName
==
model
.
fileName
{
self
.
fileDataSource
?
.
remove
(
at
:
i
)
self
.
tableView
.
reloadData
()
self
.
viewModel
.
mainModel
.
file
=
self
.
fileDataSource
??
[]
return
}
}
}
}
deinit
{
NotificationCenter
.
default
.
removeObserver
(
self
)
}
}
extension
YHWorkExperiencePositionViewViewController
:
UITableViewDelegate
,
UITableViewDataSource
{
...
...
@@ -190,13 +177,12 @@ extension YHWorkExperiencePositionViewViewController: UITableViewDelegate, UITab
if
indexPath
.
row
==
0
{
let
cell
=
tableView
.
dequeueReusableCell
(
withClass
:
YHWorkExperiencePositionListTableViewCell
.
self
)
cell
.
country
=
self
.
viewModel
.
mainModel
.
location
.
country
cell
.
dataSource
=
baseDataSource
?[
indexPath
.
row
]
cell
.
workExperienceBlock
=
{[
weak
self
]
model
in
guard
let
self
=
self
else
{
return
}
self
.
viewModel
.
updateModel
(
model
)
let
id
=
model
.
id
if
id
!=
.
id1
&&
id
!=
.
id
3
&&
id
!=
.
id4
&&
id
!=
.
id7
&&
id
!=
.
id8
&&
id
!=
.
id12
&&
id
!=
.
id14
&&
id
!=
.
id16
&&
id
!=
.
id17
&&
id
!=
.
id18
{
if
id
!=
.
id1
&&
id
!=
.
id
2
&&
id
!=
.
id6
&&
id
!=
.
id10
{
self
.
updateDataSource
()
}
}
...
...
@@ -208,7 +194,13 @@ extension YHWorkExperiencePositionViewViewController: UITableViewDelegate, UITab
return
cell
}
else
{
let
cell
=
tableView
.
dequeueReusableCell
(
withClass
:
YHWorkExperiencePositionReasonTableViewCell
.
self
)
cell
.
selectItem
=
[
self
.
selectReasonIndex
]
cell
.
dataSource
=
getTipsWithType
()
cell
.
selectBlock
=
{[
weak
self
]
index
in
guard
let
self
=
self
else
{
return
}
self
.
selectReasonIndex
=
index
.
first
??
5
self
.
viewModel
.
position
.
provide_certificate_type
=
self
.
selectReasonIndex
+
1
}
cell
.
backgroundColor
=
.
clear
cell
.
contentView
.
backgroundColor
=
.
clear
return
cell
...
...
@@ -223,7 +215,7 @@ extension YHWorkExperiencePositionViewViewController: UITableViewDelegate, UITab
let
data
=
array
[
i
]
let
message
=
data
.
message
??
""
let
isShow
=
data
.
isShowPrompts
??
false
if
data
.
id
==
.
id
13
{
if
data
.
id
==
.
id
7
{
h
=
h
+
72
}
else
{
h
=
h
+
52
...
...
@@ -244,7 +236,7 @@ extension YHWorkExperiencePositionViewViewController: UITableViewDelegate, UITab
}
func
tableView
(
_
tableView
:
UITableView
,
heightForHeaderInSection
section
:
Int
)
->
CGFloat
{
return
7
return
16
}
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/WorkExperience(工作经验)/C/YHWorkExperienceViewController.swift
View file @
a3ee8c01
...
...
@@ -51,7 +51,6 @@ class YHWorkExperienceViewController: YHBaseViewController {
setView
()
getData
()
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
keyboardWillShow(_:)
)
,
name
:
UIResponder
.
keyboardDidShowNotification
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
keyboardWillHide(_:)
)
,
name
:
UIResponder
.
keyboardDidHideNotification
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
handleKeyboardNotification(_:)
)
,
name
:
UIResponder
.
keyboardWillShowNotification
,
object
:
nil
)
...
...
@@ -77,10 +76,15 @@ class YHWorkExperienceViewController: YHBaseViewController {
}
}
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
getData
()
}
@objc
func
handleKeyboardNotification
(
_
notification
:
Notification
)
{
if
notification
.
userInfo
!=
nil
{
if
stepView
.
currentIndex
==
4
||
stepView
.
currentIndex
==
3
{
if
stepView
.
currentIndex
==
3
{
guard
let
keyboardFrame
=
(
notification
.
userInfo
?[
UIResponder
.
keyboardFrameEndUserInfoKey
]
as
AnyObject
)
.
cgRectValue
else
{
return
}
let
isKeyboardShow
=
notification
.
name
==
UIResponder
.
keyboardWillShowNotification
...
...
@@ -103,6 +107,10 @@ class YHWorkExperienceViewController: YHBaseViewController {
func
getData
()
{
viewModel
.
requestWorkExample
{
success
,
error
in
}
viewModel
.
requestWorkPositionList
(
"
\(
orderID
)
"
,
workExperienceID
??
""
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
self
.
updateDataSource
()
}
viewModel
.
requestWorkDetail
(
"
\(
orderID
)
"
,
workExperienceID
??
""
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
...
...
@@ -117,6 +125,7 @@ class YHWorkExperienceViewController: YHBaseViewController {
self
.
updateDataSource
()
}
}
updateDataSource
()
}
...
...
@@ -339,10 +348,10 @@ class YHWorkExperienceViewController: YHBaseViewController {
}
}
func
showDeleteAlert
(
_
model
:
YHWorkExperienceP
roject
Model
)
{
YHCommonAlertView
.
show
(
""
,
"确定要删除该
项目介绍
吗?"
,
"取消"
,
"确认"
)
{[
weak
self
]
in
func
showDeleteAlert
(
_
model
:
YHWorkExperienceP
osition
Model
)
{
YHCommonAlertView
.
show
(
""
,
"确定要删除该
职位信息
吗?"
,
"取消"
,
"确认"
)
{[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
self
.
viewModel
?
.
requestDeleteWork
ExperienceProject
(
"
\(
model
.
id
??
0
)
"
,
callBackBlock
:
{[
weak
self
]
success
,
error
in
self
.
viewModel
?
.
requestDeleteWork
Position
(
model
,
callBackBlock
:
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
self
.
getData
()
})
...
...
@@ -696,7 +705,7 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
}
else
{
let
cell
=
tableView
.
dequeueReusableCell
(
withClass
:
YHWorkExperiencePositionTableViewCell
.
self
)
cell
.
showPrompt
=
isShowPrompt
// cell.dataSource = dataSource
cell
.
dataSource
=
self
.
viewModel
.
positionList
if
isMore
{
cell
.
more
()
}
else
{
...
...
@@ -704,19 +713,15 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
}
cell
.
clickBlock
=
{[
weak
self
]
model
in
guard
let
self
=
self
else
{
return
}
// let firstModel = self.dataSource?.first
// let vc = YHWorkExperienceViewController()
// vc.workExperienceID = "\(model.id ?? 0)"
// vc.orderID = self.orderId
// vc.isShowMessageSelect = true
// if firstModel?.id == model.id {
// vc.isShowMessageSelect = false
// }
// self.navigationController?.pushViewController(vc, animated: true)
let
vc
=
YHWorkExperiencePositionViewViewController
()
vc
.
workID
=
model
.
work_id
vc
.
orderID
=
model
.
order_id
vc
.
positionId
=
model
.
position_id
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
cell
.
deleteBlock
=
{[
weak
self
]
model
in
guard
let
self
=
self
else
{
return
}
//
self.showDeleteAlert(model)
self
.
showDeleteAlert
(
model
)
}
cell
.
isMoreBlock
=
{[
weak
self
]
isMore
in
guard
let
self
=
self
else
{
return
}
...
...
@@ -733,6 +738,8 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
// self.navigationController?.pushViewController(vc, animated: true)
// }
let
vc
=
YHWorkExperiencePositionViewViewController
()
vc
.
workID
=
workExperienceID
?
.
intValue
()
??
0
vc
.
orderID
=
orderID
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
cell
.
backgroundColor
=
.
clear
...
...
@@ -763,31 +770,30 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
}
return
CGFloat
(
h
+
52
+
14
+
386
)
}
else
{
// let number = dataSource?.count ?? 0
let
number
=
viewModel
.
positionList
.
count
var
height
=
23
+
154
// if let data = dataSource {
// for item in data {
// if item.company_name == "" {
// height = height + 52
// } else {
// let text = item.company_name // 要显示的文本内容
// let font = UIFont.PFSC_B(ofSize: 14) // 字体大小
// let maxWidth = 143.0 // 最大宽度限制
//
// // 创建NSAttributedString对象并设置属性
// let attributes = [NSAttributedString.Key.font : font] as [NSAttributedString.Key : Any]
// _ = NSMutableAttributedString(string: text ?? "", attributes: attributes)
//
// // 根据指定的最大宽度和字体大小计算文本的高度
// let size = (text! as NSString).boundingRect(with: CGSize(width: maxWidth, height: .greatestFiniteMagnitude), options: .usesLineFragmentOrigin, attributes: attributes, context: nil).size
// if size.height > 20 {
// height = height + 96
// } else {
// height = height + 76
// }
// }
// }
// }
for
item
in
viewModel
.
positionList
{
if
item
.
position_name
==
""
{
height
=
height
+
52
}
else
{
let
text
=
item
.
position_name
// 要显示的文本内容
let
font
=
UIFont
.
PFSC_B
(
ofSize
:
14
)
// 字体大小
let
maxWidth
=
143.0
// 最大宽度限制
// 创建NSAttributedString对象并设置属性
let
attributes
=
[
NSAttributedString
.
Key
.
font
:
font
]
as
[
NSAttributedString
.
Key
:
Any
]
_
=
NSMutableAttributedString
(
string
:
text
,
attributes
:
attributes
)
// 根据指定的最大宽度和字体大小计算文本的高度
let
size
=
(
text
as
NSString
)
.
boundingRect
(
with
:
CGSize
(
width
:
maxWidth
,
height
:
.
greatestFiniteMagnitude
),
options
:
.
usesLineFragmentOrigin
,
attributes
:
attributes
,
context
:
nil
)
.
size
if
size
.
height
>
20
{
height
=
height
+
96
}
else
{
height
=
height
+
76
}
}
}
return
CGFloat
(
height
)
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/WorkExperience(工作经验)/Model/YHWorkExperienceDetailModel.swift
View file @
a3ee8c01
...
...
@@ -15,6 +15,7 @@ class YHWorkExperienceDetailModel: SmartCodable {
var
company_name
:
String
=
""
var
professional_level
:
Int
=
0
var
work_certificate
:
String
=
""
var
has_finish_basic_question
:
Int
=
0
var
is_famous_enterprise
:
Int
=
0
var
duty
:
String
=
""
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/WorkExperience(工作经验)/Model/YHWorkExperienceModel.swift
View file @
a3ee8c01
...
...
@@ -19,7 +19,8 @@ enum YHWorkExperienceSelectType: Int {
case
structure
=
7
case
level
=
8
case
prove
=
9
case
company
=
10
case
company
=
10
case
field
=
11
}
enum
YHWorkExperienceID
:
Int
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/WorkExperience(工作经验)/Model/YHWorkExperiencePositionModel.swift
View file @
a3ee8c01
...
...
@@ -21,8 +21,9 @@ class YHWorkExperiencePositionModel: SmartCodable {
var
experience_sub_scope
:
String
=
""
var
is_international_work_experience
:
Int
=
0
var
provide_certificate_type
:
Int
=
0
var
work_country
:
String
?
var
work_city
:
String
?
var
work_country
:
String
=
""
var
work_city
:
String
=
""
var
missing_item_num
:
Int
=
0
required
init
()
{
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/WorkExperience(工作经验)/V/YHWorkExperienceItemView.swift
View file @
a3ee8c01
...
...
@@ -248,6 +248,12 @@ class YHWorkExperienceItemView: UIView {
case
.
prove
:
break
case
.
company
:
if
dataSource
.
message
==
"0"
{
messageTextField
.
text
=
"未选择"
}
else
{
messageTextField
.
text
=
"已选择"
}
case
.
field
:
break
}
}
...
...
@@ -506,6 +512,15 @@ class YHWorkExperienceItemView: UIView {
YHWorkExperienceCompanySelectView
.
show
{
array
in
}
case
.
field
:
YHOtherPickerView
.
show
(
type
:
.
field
,
selectTitle
:
self
.
dataSource
?
.
message
??
""
)
{[
weak
self
]
data
in
guard
let
self
=
self
else
{
return
}
self
.
dataSource
?
.
message
=
data
.
title
self
.
updateAllViews
()
if
let
block
=
self
.
block
{
block
(
self
.
dataSource
??
YHWorkExperienceModel
())
}
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/WorkExperience(工作经验)/V/YHWorkExperiencePositionItemView.swift
View file @
a3ee8c01
...
...
@@ -9,7 +9,7 @@
import
UIKit
class
YHWorkExperiencePositionItemView
:
UIView
{
typealias
ItemBlock
=
(
_
model
:
YHWork
ItemList
Model
)
->
()
typealias
ItemBlock
=
(
_
model
:
YHWork
ExperiencePosition
Model
)
->
()
var
clickBlock
:
ItemBlock
?
var
deleteBlock
:
ItemBlock
?
var
titleLabel
:
UILabel
!
...
...
@@ -21,19 +21,21 @@ class YHWorkExperiencePositionItemView: UIView {
var
showPrompt
:
Bool
=
false
{
didSet
{
if
showPrompt
{
if
dataSource
?
.
vacant_num
!=
0
{
subTitleLabel
.
text
=
"有"
+
"
\(
dataSource
?
.
vacant_num
??
0
)
"
+
"项未填写"
subTitleLabel
.
isHidden
=
false
if
dataSource
?
.
missing_item_num
!=
0
{
subTitleLabel
.
text
=
"有"
+
"
\(
dataSource
?
.
missing_item_num
??
0
)
"
+
"项未填写"
subTitleLabel
.
textColor
=
UIColor
.
failColor
}
else
{
subTitleLabel
.
textColor
=
UIColor
.
labelTextColor2
}
}
else
{
subTitleLabel
.
isHidden
=
true
subTitleLabel
.
textColor
=
UIColor
.
labelTextColor2
}
}
}
var
dataSource
:
YHWork
ItemList
Model
?
{
var
dataSource
:
YHWork
ExperiencePosition
Model
?
{
didSet
{
updateAllViews
()
}
...
...
@@ -64,6 +66,20 @@ class YHWorkExperiencePositionItemView: UIView {
make
.
width
.
equalTo
(
143
)
}
subTitleLabel
=
{
let
label
=
UILabel
()
label
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
14
)
label
.
textAlignment
=
.
left
label
.
textColor
=
UIColor
.
labelTextColor2
return
label
}()
addSubview
(
subTitleLabel
)
subTitleLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
height
.
equalTo
(
20
)
make
.
bottom
.
equalTo
(
-
16
)
}
explainLabel
=
{
let
label
=
UILabel
()
label
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
14
)
...
...
@@ -125,27 +141,27 @@ class YHWorkExperiencePositionItemView: UIView {
func
updateAllViews
()
{
guard
let
dataSource
=
dataSource
else
{
return
}
titleLabel
.
text
=
dataSource
.
company
_name
if
dataSource
.
vacant
_num
!=
0
{
explainLabel
.
text
=
"有"
+
"
\(
dataSource
.
vacant
_num
??
0
)
"
+
"项未填写"
titleLabel
.
text
=
dataSource
.
position
_name
if
dataSource
.
missing_item
_num
!=
0
{
explainLabel
.
text
=
"有"
+
"
\(
dataSource
.
missing_item
_num
??
0
)
"
+
"项未填写"
}
else
{
explainLabel
.
text
=
(
dataSource
.
entry_time
??
""
)
+
" ~ "
+
(
dataSource
.
departure_time
??
""
)
}
if
dataSource
.
company_name
?
.
count
==
0
{
titleLabel
.
text
=
"
工作经验
\(
tag
-
4000
+
1
)
"
if
dataSource
.
position_name
.
count
==
0
{
titleLabel
.
text
=
"
职位
\(
tag
-
4000
+
1
)
"
}
}
@objc
func
centerClick
()
{
if
let
block
=
clickBlock
{
block
(
self
.
dataSource
??
YHWork
ItemList
Model
())
block
(
self
.
dataSource
??
YHWork
ExperiencePosition
Model
())
}
}
@objc
func
deleteClick
()
{
if
let
block
=
deleteBlock
{
block
(
self
.
dataSource
??
YHWork
ItemList
Model
())
block
(
self
.
dataSource
??
YHWork
ExperiencePosition
Model
())
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/WorkExperience(工作经验)/V/YHWorkExperiencePositionListTableViewCell.swift
View file @
a3ee8c01
...
...
@@ -107,7 +107,7 @@ class YHWorkExperiencePositionListTableViewCell: UITableViewCell {
let
message
=
data
?
.
message
??
""
var
h
=
51
if
data
?
.
id
==
.
id
13
{
if
data
?
.
id
==
.
id
7
{
h
=
71
}
if
isShow
&&
message
.
count
==
0
{
...
...
@@ -122,12 +122,6 @@ class YHWorkExperiencePositionListTableViewCell: UITableViewCell {
block
(
model
)
}
}
itemView
.
companyBlock
=
{[
weak
self
]
company
in
guard
let
self
=
self
else
{
return
}
if
let
block
=
self
.
companyBlock
{
block
(
company
)
}
}
mainItemView
.
addSubview
(
itemView
)
itemView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
18
)
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/WorkExperience(工作经验)/V/YHWorkExperiencePositionReasonTableViewCell.swift
View file @
a3ee8c01
...
...
@@ -134,6 +134,13 @@ class YHWorkExperiencePositionReasonTableViewCell: UITableViewCell {
view
.
layer
.
borderColor
=
UIColor
.
brandMainColor
.
cgColor
view
.
addTarget
(
self
,
action
:
#selector(
agreeClick(sender:)
)
,
for
:
.
touchUpInside
)
view
.
tag
=
20000
+
i
if
selectItem
.
contains
(
i
)
{
view
.
layer
.
borderWidth
=
1
view
.
backgroundColor
=
UIColor
(
hex
:
0xebf0f9
)
}
else
{
view
.
layer
.
borderWidth
=
0
view
.
backgroundColor
=
UIColor
.
contentBkgColor
}
return
view
}()
mainItemView
.
addSubview
(
bgviewButton
)
...
...
@@ -192,21 +199,25 @@ class YHWorkExperiencePositionReasonTableViewCell: UITableViewCell {
}
@objc
func
agreeClick
(
sender
:
UIButton
)
{
selectItem
.
removeAll
()
selectItem
.
append
(
sender
.
tag
-
20000
)
sender
.
isSelected
=
!
sender
.
isSelected
if
sender
.
isSelected
{
sender
.
layer
.
borderWidth
=
1
sender
.
backgroundColor
=
UIColor
(
hex
:
0xebf0f9
)
selectItem
.
append
(
sender
.
tag
-
20000
)
let
view
=
mainItemView
.
viewWithTag
(
sender
.
tag
-
20000
+
10000
)
as!
UIImageView
view
.
image
=
UIImage
(
named
:
"login_privacy_agree"
)
}
else
{
sender
.
layer
.
borderWidth
=
0
sender
.
backgroundColor
=
UIColor
.
contentBkgColor
selectItem
.
removeAll
(
where
:
{
$0
==
sender
.
tag
-
20000
})
let
view
=
mainItemView
.
viewWithTag
(
sender
.
tag
-
20000
+
10000
)
as!
UIImageView
view
.
image
=
UIImage
(
named
:
"login_privacy_disagree_glay"
)
for
i
in
0
..<
(
dataSource
?
.
count
??
0
)
{
if
i
==
sender
.
tag
-
20000
{
let
view
=
mainItemView
.
viewWithTag
(
i
+
20000
)
view
?
.
layer
.
borderWidth
=
1
view
?
.
backgroundColor
=
UIColor
(
hex
:
0xebf0f9
)
let
subview
=
mainItemView
.
viewWithTag
(
i
+
10000
)
as!
UIImageView
subview
.
image
=
UIImage
(
named
:
"login_privacy_agree"
)
}
else
{
let
view
=
mainItemView
.
viewWithTag
(
i
+
20000
)
view
?
.
layer
.
borderWidth
=
0
view
?
.
backgroundColor
=
UIColor
.
contentBkgColor
let
subview
=
mainItemView
.
viewWithTag
(
i
+
10000
)
as!
UIImageView
subview
.
image
=
UIImage
(
named
:
"login_privacy_disagree_glay"
)
}
}
if
let
block
=
selectBlock
{
block
(
selectItem
)
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/WorkExperience(工作经验)/V/YHWorkExperiencePositionTableViewCell.swift
View file @
a3ee8c01
...
...
@@ -9,7 +9,7 @@
import
UIKit
class
YHWorkExperiencePositionTableViewCell
:
UITableViewCell
{
typealias
ExperienceListBlock
=
(
_
model
:
YHWork
ItemList
Model
)
->
()
typealias
ExperienceListBlock
=
(
_
model
:
YHWork
ExperiencePosition
Model
)
->
()
typealias
IsMoreBlock
=
(
_
isMore
:
Bool
)
->
()
typealias
NewWorkBlock
=
()
->
()
var
clickBlock
:
ExperienceListBlock
?
...
...
@@ -24,7 +24,7 @@ class YHWorkExperiencePositionTableViewCell: UITableViewCell {
var
mainItemView
:
UIView
!
var
bottomView
:
YHWorkItemAddView
!
var
showPrompt
:
Bool
=
false
var
dataSource
:
[
YHWork
ItemList
Model
]?{
var
dataSource
:
[
YHWork
ExperiencePosition
Model
]?{
didSet
{
updateAllViews
()
}
...
...
@@ -144,7 +144,7 @@ class YHWorkExperiencePositionTableViewCell: UITableViewCell {
bottomView
=
{
let
view
=
YHWorkItemAddView
()
view
.
addBtn
.
setTitle
(
"新增
工作经验
"
.
local
,
for
:
.
normal
)
view
.
addBtn
.
setTitle
(
"新增
职位
"
.
local
,
for
:
.
normal
)
view
.
clickBlock
=
{[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
if
let
block
=
self
.
newWorkBlock
{
...
...
@@ -215,19 +215,19 @@ class YHWorkExperiencePositionTableViewCell: UITableViewCell {
itemView
.
dataSource
=
dataSource
[
i
]
itemView
.
showPrompt
=
showPrompt
var
h
=
0
if
model
.
company
_name
==
""
{
if
model
.
position
_name
==
""
{
h
=
51
}
else
{
let
text
=
model
.
company
_name
// 要显示的文本内容
let
text
=
model
.
position
_name
// 要显示的文本内容
let
font
=
UIFont
.
PFSC_B
(
ofSize
:
14
)
// 字体大小
let
maxWidth
=
143.0
// 最大宽度限制
// 创建NSAttributedString对象并设置属性
let
attributes
=
[
NSAttributedString
.
Key
.
font
:
font
]
as
[
NSAttributedString
.
Key
:
Any
]
_
=
NSMutableAttributedString
(
string
:
text
??
""
,
attributes
:
attributes
)
_
=
NSMutableAttributedString
(
string
:
text
,
attributes
:
attributes
)
// 根据指定的最大宽度和字体大小计算文本的高度
let
size
=
(
text
!
as
NSString
)
.
boundingRect
(
with
:
CGSize
(
width
:
maxWidth
,
height
:
.
greatestFiniteMagnitude
),
options
:
.
usesLineFragmentOrigin
,
attributes
:
attributes
,
context
:
nil
)
.
size
let
size
=
(
text
as
NSString
)
.
boundingRect
(
with
:
CGSize
(
width
:
maxWidth
,
height
:
.
greatestFiniteMagnitude
),
options
:
.
usesLineFragmentOrigin
,
attributes
:
attributes
,
context
:
nil
)
.
size
if
size
.
height
>
20
{
h
=
95
}
else
{
...
...
@@ -249,7 +249,7 @@ class YHWorkExperiencePositionTableViewCell: UITableViewCell {
moreButton
.
isHidden
=
false
cannalButton
.
isHidden
=
true
for
i
in
0
..<
(
dataSource
?
.
count
??
0
)
{
let
view
=
mainItemView
.
viewWithTag
(
4000
+
i
)
as!
YHWorkItemView
let
view
=
mainItemView
.
viewWithTag
(
4000
+
i
)
as!
YHWork
ExperiencePosition
ItemView
view
.
isShowDelete
(
i
,
isShow
:
false
)
}
if
let
block
=
isMoreBlock
{
...
...
@@ -261,7 +261,7 @@ class YHWorkExperiencePositionTableViewCell: UITableViewCell {
moreButton
.
isHidden
=
true
cannalButton
.
isHidden
=
false
for
i
in
0
..<
(
dataSource
?
.
count
??
0
)
{
let
view
=
mainItemView
.
viewWithTag
(
4000
+
i
)
as!
YHWorkItemView
let
view
=
mainItemView
.
viewWithTag
(
4000
+
i
)
as!
YHWork
ExperiencePosition
ItemView
view
.
isShowDelete
(
i
,
isShow
:
true
)
}
if
let
block
=
isMoreBlock
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/WorkExperience(工作经验)/ViewModel/YHWorkExperiencePositionViewModel.swift
View file @
a3ee8c01
...
...
@@ -9,65 +9,54 @@
import
UIKit
class
YHWorkExperiencePositionViewModel
:
YHBaseViewModel
{
var
mainModel
:
YHWorkExperienceDetailModel
=
YHWorkExperienceDetail
Model
()
var
position
:
YHWorkExperiencePositionModel
=
YHWorkExperiencePosition
Model
()
override
init
()
{
super
.
init
()
}
func
getBaseDataSource
(
_
isShowPrompt
:
Bool
)
->
[
YHSectionWorkExperienceModel
]
{
let
item
=
YHWorkExperienceModel
(
id
:
.
id1
,
isNeed
:
true
,
title
:
"职位名称"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
company_name
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请输入"
)
let
item1
=
YHWorkExperienceModel
(
id
:
.
id2
,
isNeed
:
true
,
title
:
"职责性质"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
industry
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请输入"
)
let
item2
=
YHWorkExperienceModel
(
id
:
.
id3
,
isNeed
:
false
,
title
:
"开始就职年月"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
company_introduce
,
type
:
.
time
)
let
item3
=
YHWorkExperienceModel
(
id
:
.
id4
,
isNeed
:
false
,
title
:
"结束就职年月"
,
isUserKeyBoard
:
true
,
prompts
:
"请选择"
,
message
:
mainModel
.
company_website
,
type
:
.
time
)
let
item6
=
YHWorkExperienceModel
(
id
:
.
id5
,
isNeed
:
true
,
title
:
"经验领域"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
location
.
country
,
type
:
.
country
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择"
)
let
item
=
YHWorkExperienceModel
(
id
:
.
id1
,
isNeed
:
true
,
title
:
"职位名称"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
position
.
position_name
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请输入"
)
let
item1
=
YHWorkExperienceModel
(
id
:
.
id2
,
isNeed
:
true
,
title
:
"职责性质"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
position
.
wduty
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请输入"
)
let
item2
=
YHWorkExperienceModel
(
id
:
.
id3
,
isNeed
:
false
,
title
:
"开始就职年月"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
position
.
entry_time
,
type
:
.
time
)
let
item3
=
YHWorkExperienceModel
(
id
:
.
id10
,
isNeed
:
false
,
title
:
"结束就职年月"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
position
.
departure_time
,
type
:
.
time
)
let
item6
=
YHWorkExperienceModel
(
id
:
.
id5
,
isNeed
:
true
,
title
:
"经验领域"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
position
.
experience_scope
,
type
:
.
field
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择"
)
let
item66
=
YHWorkExperienceModel
(
id
:
.
id6
,
isNeed
:
true
,
title
:
"具体经验领域"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
position
.
experience_sub_scope
,
type
:
.
country
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请输入"
)
let
item11
=
YHWorkExperienceModel
(
id
:
.
id7
,
isNeed
:
true
,
title
:
"相关工作经验是否属于国际工作经验"
,
isUserKeyBoard
:
false
,
prompts
:
""
,
message
:
"
\(
position
.
is_international_work_experience
)
"
,
leftButtonString
:
"是"
,
rightButtonString
:
"否"
)
let
item4
=
YHWorkExperienceModel
(
id
:
.
id8
,
isNeed
:
true
,
title
:
"工作国家/地区"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
position
.
work_country
,
type
:
.
country
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择工作国家/地区"
)
let
item5
=
YHWorkExperienceModel
(
id
:
.
id9
,
isNeed
:
true
,
title
:
"工作城市"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
position
.
work_city
,
type
:
.
address
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择工作国家/地区"
)
let
item55
=
YHWorkExperienceModel
(
id
:
.
id11
,
isNeed
:
true
,
title
:
"工作城市"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
position
.
work_city
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请输入工作国家/地区"
)
let
item11
=
YHWorkExperienceModel
(
id
:
.
id13
,
isNeed
:
true
,
title
:
"相关工作经验是否属于国际工作经验"
,
isUserKeyBoard
:
false
,
prompts
:
""
,
message
:
"
\(
mainModel
.
international_work_experience
)
"
,
leftButtonString
:
"是"
,
rightButtonString
:
"否"
)
let
item4
=
YHWorkExperienceModel
(
id
:
.
id5
,
isNeed
:
true
,
title
:
"工作国家/地区"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
location
.
country
,
type
:
.
country
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择工作国家/地区"
)
var
string
=
""
let
array
=
mainModel
.
location
.
area
for
item
in
array
{
if
string
.
count
!=
0
{
string
=
string
+
"/"
+
item
}
else
{
string
=
string
+
item
}
}
let
item5
=
YHWorkExperienceModel
(
id
:
.
id6
,
isNeed
:
true
,
title
:
"工作城市"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
string
,
type
:
.
address
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择工作国家/地区"
)
let
item55
=
YHWorkExperienceModel
(
id
:
.
id7
,
isNeed
:
true
,
title
:
"工作城市"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
location
.
foreign
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请输入工作国家/地区"
)
let
addressCountry
=
position
.
work_country
let
experience_scope
=
position
.
experience_scope
let
addressCountry
=
mainModel
.
location
.
country
var
section
=
YHSectionWorkExperienceModel
()
if
addressCountry
.
contains
(
"中国"
)
{
section
=
YHSectionWorkExperienceModel
(
title
:
"企业信息"
,
models
:
[
item
,
item1
,
item2
,
item3
,
item6
,
item11
,
item4
,
item5
])
if
experience_scope
.
contains
(
"其他"
)
{
if
addressCountry
.
contains
(
"中国"
)
{
section
=
YHSectionWorkExperienceModel
(
title
:
"企业信息"
,
models
:
[
item
,
item1
,
item2
,
item3
,
item6
,
item66
,
item11
,
item4
,
item5
])
}
else
{
section
=
YHSectionWorkExperienceModel
(
title
:
"企业信息"
,
models
:
[
item
,
item1
,
item2
,
item3
,
item6
,
item66
,
item11
,
item4
,
item55
])
}
}
else
{
section
=
YHSectionWorkExperienceModel
(
title
:
"企业信息"
,
models
:
[
item
,
item1
,
item2
,
item3
,
item6
,
item11
,
item4
,
item55
])
if
addressCountry
.
contains
(
"中国"
)
{
section
=
YHSectionWorkExperienceModel
(
title
:
"企业信息"
,
models
:
[
item
,
item1
,
item2
,
item3
,
item6
,
item11
,
item4
,
item5
])
}
else
{
section
=
YHSectionWorkExperienceModel
(
title
:
"企业信息"
,
models
:
[
item
,
item1
,
item2
,
item3
,
item6
,
item11
,
item4
,
item55
])
}
}
return
[
section
]
}
func
updateModel
(
_
item
:
YHWorkExperienceModel
)
{
guard
let
type
=
item
.
id
else
{
return
}
switch
type
{
case
.
id1
:
// 用人单位
mainModel
.
company
_name
=
item
.
message
??
""
position
.
position
_name
=
item
.
message
??
""
case
.
id2
:
// 用人单位性质
mainModel
.
industry
=
item
.
message
??
""
case
.
id3
:
// 用人单位介绍
mainModel
.
company_introduce
=
item
.
message
??
""
case
.
id4
:
// 用人单位官网
mainModel
.
company_website
=
item
.
message
??
""
case
.
id5
:
// 工作地区国家
mainModel
.
location
.
country
=
item
.
message
??
""
case
.
id6
:
// 工作城市 国内
mainModel
.
location
.
area
=
item
.
value
??
[]
case
.
id7
:
// 工作城市国外
mainModel
.
location
.
foreign
=
item
.
message
??
""
case
.
id8
:
// 职位
mainModel
.
position
=
item
.
message
??
""
case
.
id9
:
// 入职年月
position
.
wduty
=
item
.
message
??
""
case
.
id3
:
// 入职年月
let
format
=
DateFormatter
()
format
.
dateFormat
=
"yyyy-MM"
if
let
selectDate
=
format
.
date
(
from
:
item
.
message
??
""
)
{
...
...
@@ -76,139 +65,127 @@ class YHWorkExperiencePositionViewModel: YHBaseViewModel {
if
selectTimeInterval
>
currentTimeInterval
{
YHHUD
.
flash
(
message
:
"入职日期不能晚于当前日期"
)
}
else
{
guard
let
endDate
=
format
.
date
(
from
:
mainModel
.
departure_time
)
else
{
mainModel
.
entry_time
=
item
.
message
??
""
guard
let
endDate
=
format
.
date
(
from
:
position
.
departure_time
)
else
{
position
.
entry_time
=
item
.
message
??
""
return
}
let
endTimeInterval
=
endDate
.
timeIntervalSince1970
if
selectTimeInterval
>
endTimeInterval
{
YHHUD
.
flash
(
message
:
"入职日期不能晚于离职日期"
)
}
else
{
mainModel
.
entry_time
=
item
.
message
??
""
position
.
entry_time
=
item
.
message
??
""
}
}
}
case
.
id10
:
// 离职年月
let
format
=
DateFormatter
()
format
.
dateFormat
=
"yyyy-MM"
if
let
selectDate
=
format
.
date
(
from
:
item
.
message
??
""
),
let
startDate
=
format
.
date
(
from
:
mainModel
.
entry_time
)
{
if
let
selectDate
=
format
.
date
(
from
:
item
.
message
??
""
),
let
startDate
=
format
.
date
(
from
:
position
.
entry_time
)
{
let
selectTimeInterval
=
selectDate
.
timeIntervalSince1970
let
startTimeInterval
=
startDate
.
timeIntervalSince1970
if
selectTimeInterval
<
startTimeInterval
{
YHHUD
.
flash
(
message
:
"离职日期不能早于入职日期"
)
}
else
{
mainModel
.
departure_time
=
item
.
message
??
""
position
.
departure_time
=
item
.
message
??
""
}
}
else
{
mainModel
.
departure_time
=
item
.
message
??
""
}
case
.
id11
:
// 工作证明文件
mainModel
.
work_certificate
=
item
.
message
??
""
case
.
id12
:
// 职责性质
mainModel
.
duty
=
item
.
message
??
""
case
.
id13
:
// 是否国际工作经验
mainModel
.
international_work_experience
=
Int
(
item
.
value
?
.
first
??
"0"
)
??
0
case
.
id14
:
// 企业人数规模
mainModel
.
company_member_total
=
Int
(
item
.
message
??
"0"
)
??
0
case
.
id15
:
// 行政架构层级
mainModel
.
administrative_level
=
Int
(
item
.
value
?
.
first
??
"0"
)
??
0
case
.
id16
:
// 下属管理人数
mainModel
.
company_manage_total
=
Int
(
item
.
message
??
"0"
)
??
0
case
.
id17
:
// 公司营业额/港元
mainModel
.
turnover
=
Int
(
item
.
message
??
"0"
)
??
0
case
.
id18
:
// 公司性质/范畴/所属行业
mainModel
.
business_nature
=
item
.
message
??
""
case
.
id19
:
// 职位水平类型
mainModel
.
professional_level
=
Int
(
item
.
value
?
.
first
??
"0"
)
??
0
case
.
id20
:
// 高管证明文件
mainModel
.
executives_certificate
=
item
.
message
??
""
case
.
id21
:
// 高管在职开始时间
let
format
=
DateFormatter
()
format
.
dateFormat
=
"yyyy-MM"
if
let
selectDate
=
format
.
date
(
from
:
item
.
message
??
""
)
{
let
selectTimeInterval
=
selectDate
.
timeIntervalSince1970
let
currentTimeInterval
=
Date
()
.
timeIntervalSince1970
if
selectTimeInterval
>
currentTimeInterval
{
YHHUD
.
flash
(
message
:
"高管在职开始时间不能晚于当前日期"
)
}
else
{
guard
let
endDate
=
format
.
date
(
from
:
mainModel
.
top_manager_end_at
)
else
{
mainModel
.
top_manager_start_at
=
item
.
message
??
""
return
}
let
endTimeInterval
=
endDate
.
timeIntervalSince1970
if
selectTimeInterval
>
endTimeInterval
{
YHHUD
.
flash
(
message
:
"高管在职开始时间不能晚于离职日期"
)
}
else
{
mainModel
.
top_manager_start_at
=
item
.
message
??
""
}
}
position
.
departure_time
=
item
.
message
??
""
}
case
.
id22
:
// 高管在职结束时间
let
format
=
DateFormatter
()
format
.
dateFormat
=
"yyyy-MM"
if
let
selectDate
=
format
.
date
(
from
:
item
.
message
??
""
),
let
startDate
=
format
.
date
(
from
:
mainModel
.
top_manager_start_at
)
{
let
selectTimeInterval
=
selectDate
.
timeIntervalSince1970
let
startTimeInterval
=
startDate
.
timeIntervalSince1970
if
selectTimeInterval
<
startTimeInterval
{
YHHUD
.
flash
(
message
:
"高管在职结束时间不能早于开始日期"
)
}
else
{
mainModel
.
top_manager_end_at
=
item
.
message
??
""
case
.
id5
:
position
.
experience_scope
=
item
.
message
??
""
case
.
id6
:
position
.
experience_sub_scope
=
item
.
message
??
""
case
.
id7
:
position
.
is_international_work_experience
=
Int
(
item
.
value
?
.
first
??
"0"
)
??
0
case
.
id8
:
position
.
work_country
=
item
.
message
??
""
case
.
id9
:
position
.
work_city
=
item
.
message
??
""
case
.
id11
:
position
.
work_city
=
item
.
message
??
""
default
:
break
}
}
func
isCanNext
()
->
Bool
{
let
position_name
=
position
.
position_name
let
wduty
=
position
.
wduty
let
entry_time
=
position
.
entry_time
let
departure_time
=
position
.
departure_time
let
experience_scope
=
position
.
experience_scope
let
experience_sub_scope
=
position
.
experience_sub_scope
let
is_international_work_experience
=
position
.
is_international_work_experience
let
work_country
=
position
.
work_country
let
work_city
=
position
.
work_city
guard
position_name
.
count
>
0
else
{
return
false
}
guard
wduty
.
count
>
0
else
{
return
false
}
guard
entry_time
.
count
>
0
else
{
return
false
}
guard
departure_time
.
count
>
0
else
{
return
false
}
guard
experience_scope
.
count
>
0
else
{
return
false
}
guard
is_international_work_experience
>
0
else
{
return
false
}
guard
work_country
.
count
>
0
else
{
return
false
}
guard
work_city
.
count
>
0
else
{
return
false
}
if
experience_scope
==
"其他"
{
guard
experience_sub_scope
.
count
>
0
else
{
return
false
}
}
return
true
}
func
requestWorkPositionDetail
(
_
workId
:
Int
,
_
positionId
:
Int
,
callBackBlock
:
@escaping
(
_
success
:
Bool
?,
_
error
:
YHErrorModel
?)
->
())
{
let
param
:
[
String
:
Any
]
=
[
"work_id"
:
workId
,
"position_id"
:
positionId
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
WorkExperience
.
workPositionDetail
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
,
params
:
param
)
{
[
weak
self
]
json
,
code
in
//1. json字符串 转 对象
guard
let
self
=
self
else
{
return
}
if
json
.
code
==
200
{
guard
let
dic
=
json
.
data
?
.
peel
as?
[
String
:
Any
],
let
result
=
YHWorkExperiencePositionModel
.
deserialize
(
from
:
dic
)
else
{
callBackBlock
(
false
,
nil
)
return
}
self
.
position
=
result
callBackBlock
(
true
,
nil
)
}
else
{
mainModel
.
top_manager_end_at
=
item
.
message
??
""
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
)
callBackBlock
(
false
,
error
)
}
}
failBlock
:
{
err
in
callBackBlock
(
false
,
err
)
}
}
func
isCanNext
(
_
step
:
Int
)
->
Bool
{
if
step
==
0
{
let
companyName
=
mainModel
.
company_name
//公司名称
let
industry
=
mainModel
.
industry
//用人单位性质
let
country
=
mainModel
.
location
.
country
//工作国家
let
area
=
mainModel
.
location
.
area
//工作城市
let
foreign
=
mainModel
.
location
.
foreign
//工作城市 国外
let
entryTime
=
mainModel
.
entry_time
//入职年月
let
departureTime
=
mainModel
.
departure_time
//离职年月
let
workCertificate
=
mainModel
.
work_certificate
//工作证明文件
let
duty
=
mainModel
.
duty
//职责性质
let
companyMemberTotal
=
mainModel
.
company_member_total
//企业人数规模
let
companyManageTotal
=
mainModel
.
company_manage_total
//下属管理人数
let
professionalLevel
=
mainModel
.
professional_level
//职位水平类别
let
executivesCertificate
=
mainModel
.
executives_certificate
//高管证明文件
let
topManagerStartAt
=
mainModel
.
top_manager_start_at
//高管在职开始时间
let
topManagerEndAt
=
mainModel
.
top_manager_end_at
//高管在职开始时间
guard
companyName
.
count
>
0
else
{
return
false
}
guard
industry
.
count
>
0
else
{
return
false
}
guard
country
.
count
>
0
else
{
return
false
}
guard
entryTime
.
count
>
0
else
{
return
false
}
guard
workCertificate
.
count
>
0
else
{
return
false
}
guard
duty
.
count
>
0
else
{
return
false
}
guard
companyMemberTotal
>=
0
else
{
return
false
}
guard
companyManageTotal
>=
0
else
{
return
false
}
guard
professionalLevel
>
0
else
{
return
false
}
if
country
.
contains
(
"中国"
)
{
guard
area
.
count
>
0
else
{
return
false
}
func
saveWorkPosition
(
callBackBlock
:
@escaping
(
_
success
:
Bool
?,
_
error
:
YHErrorModel
?)
->
())
{
let
params
:
[
String
:
Any
]
=
[
"position_id"
:
position
.
position_id
,
"order_id"
:
position
.
order_id
,
"work_id"
:
position
.
work_id
,
"position_name"
:
position
.
position_name
,
"wduty"
:
position
.
wduty
,
"entry_time"
:
position
.
entry_time
,
"departure_time"
:
position
.
departure_time
,
"experience_scope"
:
position
.
experience_scope
,
"is_international_work_experience"
:
position
.
is_international_work_experience
,
"work_country"
:
position
.
work_country
,
"work_city"
:
position
.
work_city
,
"provide_certificate_type"
:
position
.
provide_certificate_type
,
"experience_sub_scope"
:
position
.
experience_sub_scope
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
WorkExperience
.
saveWorkPosition
let
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
,
params
:
params
)
{
[
weak
self
]
json
,
code
in
guard
let
self
=
self
else
{
return
}
if
json
.
code
==
200
{
guard
let
dic
=
json
.
data
?
.
peel
as?
[
String
:
Any
],
let
result
=
YHWorkExperiencePositionModel
.
deserialize
(
from
:
dic
)
else
{
callBackBlock
(
false
,
nil
)
return
}
self
.
position
.
position_id
=
result
.
position_id
callBackBlock
(
true
,
nil
)
}
else
{
guard
foreign
.
count
>
0
else
{
return
false
}
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
)
callBackBlock
(
false
,
error
)
}
if
professionalLevel
==
1
{
guard
executivesCertificate
.
count
>
0
else
{
return
false
}
guard
topManagerStartAt
.
count
>
0
else
{
return
false
}
guard
topManagerEndAt
.
count
>
0
else
{
return
false
}
}
return
true
}
else
if
step
==
1
{
let
message
=
mainModel
.
wduty
guard
message
.
count
>
0
else
{
return
false
}
return
true
}
else
if
step
==
2
{
let
message
=
mainModel
.
highlights
guard
message
.
count
>
0
else
{
return
false
}
return
true
}
else
if
step
==
3
{
return
true
}
else
{
return
true
}
failBlock
:
{
err
in
callBackBlock
(
false
,
err
)
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/WorkExperience(工作经验)/ViewModel/YHWorkExperienceViewModel.swift
View file @
a3ee8c01
...
...
@@ -14,13 +14,14 @@ class YHWorkExperienceViewModel: YHBaseViewModel {
var
exampleModels
:
[
YHWorkExampleModel
]?
var
projectModels
:
[
YHWorkExperienceProjectModel
]?
var
fileList
:
[
YHWorkExperienceFileModel
]
=
[]
var
positionList
:
[
YHWorkExperiencePositionModel
]
=
[]
override
init
()
{
super
.
init
()
}
func
getBaseDataSource
(
_
isShowPrompt
:
Bool
)
->
[
YHSectionWorkExperienceModel
]
{
let
item
=
YHWorkExperienceModel
(
id
:
.
id1
,
isNeed
:
true
,
title
:
"用人单位"
,
isUserKeyBoard
:
true
,
prompts
:
"请输入"
,
message
:
mainModel
.
company_name
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请输入"
)
let
item1
=
YHWorkExperienceModel
(
id
:
.
id2
,
isNeed
:
true
,
title
:
"公司基本情况"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
mainModel
.
industry
,
type
:
.
company
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择"
)
let
item1
=
YHWorkExperienceModel
(
id
:
.
id2
,
isNeed
:
true
,
title
:
"公司基本情况"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
"
\(
mainModel
.
has_finish_basic_question
)
"
,
type
:
.
company
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择"
)
let
item2
=
YHWorkExperienceModel
(
id
:
.
id3
,
isNeed
:
true
,
title
:
"职位水平类别"
,
isUserKeyBoard
:
false
,
prompts
:
"请选择"
,
message
:
"
\(
mainModel
.
professional_level
)
"
,
type
:
.
level
,
isShowPrompts
:
isShowPrompt
,
alertMessage
:
"请选择"
)
var
section
=
YHSectionWorkExperienceModel
()
section
=
YHSectionWorkExperienceModel
(
title
:
"企业信息"
,
models
:
[
item
,
item1
,
item2
])
...
...
@@ -212,9 +213,9 @@ class YHWorkExperienceViewModel: YHBaseViewModel {
}
}
func
requestDeleteWork
ExperienceProject
(
_
orderId
:
String
,
callBackBlock
:
@escaping
(
_
success
:
Bool
?,
_
error
:
YHErrorModel
?)
->
())
{
let
params
:
[
String
:
Any
]
=
[
"
id"
:
orderI
d
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
WorkExperience
.
projectDel
func
requestDeleteWork
Position
(
_
model
:
YHWorkExperiencePositionModel
,
callBackBlock
:
@escaping
(
_
success
:
Bool
?,
_
error
:
YHErrorModel
?)
->
())
{
let
params
:
[
String
:
Any
]
=
[
"
position_id"
:
model
.
position_id
,
"work_id"
:
model
.
work_i
d
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
WorkExperience
.
deleteWorkPosition
let
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
,
params
:
params
)
{
[
weak
self
]
json
,
code
in
//1. json字符串 转 对象
guard
let
self
=
self
else
{
return
}
...
...
@@ -326,4 +327,27 @@ class YHWorkExperienceViewModel: YHBaseViewModel {
return
true
}
}
func
requestWorkPositionList
(
_
orderId
:
String
,
_
workId
:
String
,
callBackBlock
:
@escaping
(
_
success
:
Bool
?,
_
error
:
YHErrorModel
?)
->
())
{
let
param
:
[
String
:
Any
]
=
[
"work_id"
:
workId
,
"order_id"
:
orderId
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
WorkExperience
.
workPositionList
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
,
params
:
param
)
{
[
weak
self
]
json
,
code
in
//1. json字符串 转 对象
guard
let
self
=
self
else
{
return
}
if
json
.
code
==
200
{
guard
let
dic
=
json
.
data
?
.
peel
as?
[
Any
],
let
result
=
[
YHWorkExperiencePositionModel
]
.
deserialize
(
from
:
dic
)
else
{
callBackBlock
(
false
,
nil
)
return
}
self
.
positionList
=
result
callBackBlock
(
true
,
nil
)
}
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
)
callBackBlock
(
false
,
error
)
}
}
failBlock
:
{
err
in
callBackBlock
(
false
,
err
)
}
}
}
galaxy/galaxy/Classes/Tools/Helper/YHConstantArrayData.swift
View file @
a3ee8c01
...
...
@@ -41,6 +41,8 @@ enum YHOtherPickerViewType: Int {
case
constellation
//选择国家地区
case
selectAddress
//选择经验领域
case
field
}
...
...
@@ -473,6 +475,25 @@ class YHConstantArrayData {
"title"
:
"海外地区"
,
]
]
static
let
arrSelectField
=
[
[
"id"
:
"0"
,
"title"
:
"创新及科技"
,
],
[
"id"
:
"1"
,
"title"
:
"金融"
,
],
[
"id"
:
"2"
,
"title"
:
"国际贸易(包括跨境海运及空运,以及供应链管理)"
,
],
[
"id"
:
"3"
,
"title"
:
"其他"
,
]
]
//通过 id 获取 title
static
func
getShowNameBy
(
indexStr
:
String
,
type
:
YHOtherPickerViewType
)
->
String
{
if
indexStr
.
isEmpty
{
...
...
@@ -500,6 +521,8 @@ class YHConstantArrayData {
arrData
=
YHConstantArrayData
.
arrDegreeConstellation
case
.
selectAddress
:
arrData
=
YHConstantArrayData
.
arrSelectAddress
case
.
field
:
arrData
=
YHConstantArrayData
.
arrSelectField
default
:
arrData
=
[[:]]
}
...
...
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
View file @
a3ee8c01
...
...
@@ -251,6 +251,11 @@ class YHAllApiName {
static
let
ocrFileContent
=
"infoflow/work/getOcrFileContent"
//已上传文件列表
static
let
fileList
=
"infoflow/work/file-list"
//职位列表
static
let
workPositionList
=
"infoflow/work/v1/workPositionList"
static
let
workPositionDetail
=
"infoflow/work/v1/workPositionDetail"
static
let
saveWorkPosition
=
"infoflow/work/v1/SaveWorkPosition"
static
let
deleteWorkPosition
=
"infoflow/work/v1/deleteWorkPosition"
}
//登录
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment