Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GeliBusinessPlatform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ljy
GeliBusinessPlatform
Commits
45213823
Commit
45213823
authored
Jun 03, 2020
by
ljh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更换工作中心的存储方式
parent
5d2fd070
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
29 deletions
+36
-29
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
...ata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/Define/NetworkRequest.swift
GeliBusinessPlatform/Define/NetworkRequest.swift
+3
-5
GeliBusinessPlatform/ViewController/工作中心/WorkCViewController.swift
...essPlatform/ViewController/工作中心/WorkCViewController.swift
+0
-0
GeliBusinessPlatform/ViewController/工作中心/WorkTestModel.swift
GeliBusinessPlatform/ViewController/工作中心/WorkTestModel.swift
+23
-10
GeliBusinessPlatform/ViewController/工作中心/编辑工作中心/EditWorkCViewController.swift
.../ViewController/工作中心/编辑工作中心/EditWorkCViewController.swift
+8
-9
GeliBusinessPlatform/ViewController/账号信息/AccountViewController.swift
...sPlatform/ViewController/账号信息/AccountViewController.swift
+2
-5
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
View file @
45213823
No preview for this file type
GeliBusinessPlatform/Define/NetworkRequest.swift
View file @
45213823
...
...
@@ -10,7 +10,7 @@ import Foundation
import
Alamofire
import
SwiftyJSON
import
ObjectMapper
import
RealmSwift
import
UIKit
private
let
NetworkRequestShareInstance
=
NetworkRequest
()
...
...
@@ -126,10 +126,8 @@ extension NetworkRequest {
HUD
.
flash
(
.
label
(
json
[
"message"
]
.
stringValue
),
delay
:
1.5
)
failture
(
DogError
.
DataInvalidError
)
delay
(
1.5
)
{
let
realm
=
try!
Realm
()
try!
realm
.
write
{
realm
.
deleteAll
()
}
UserDefaults
.
standard
.
removeObject
(
forKey
:
"WorkDataModel"
)
UserDefaults
.
standard
.
removeObject
(
forKey
:
"user_token"
)
NotificationCenter
.
default
.
post
(
name
:
Notification
.
Name
(
rawValue
:
"logout"
),
object
:
nil
)
JPUSHService
.
deleteAlias
({
(
resCode
,
alias
,
num
)
in
...
...
GeliBusinessPlatform/ViewController/工作中心/WorkCViewController.swift
View file @
45213823
This diff is collapsed.
Click to expand it.
GeliBusinessPlatform/ViewController/工作中心/WorkTestModel.swift
View file @
45213823
...
...
@@ -7,16 +7,29 @@
//
import
Foundation
import
RealmSwift
import
ObjectMapper
//工作中心
class
WorkDataModel
:
Object
{
class
WorkDataModel
:
Mappable
{
//类型名
@objc
dynamic
var
dataModelStr
=
""
@objc
dynamic
var
star_time
=
0
@objc
dynamic
var
end_time
=
0
@objc
dynamic
var
oftenArrStr
=
""
}
var
dataModelStr
:
String
=
""
var
star_time
=
0
var
end_time
=
0
var
oftenArrStr
=
""
init
(){
}
required
init
?(
map
:
Map
)
{
}
// Mappable
func
mapping
(
map
:
Map
)
{
dataModelStr
<-
map
[
"dataModelStr"
]
star_time
<-
map
[
"star_time"
]
end_time
<-
map
[
"end_time"
]
oftenArrStr
<-
map
[
"oftenArrStr"
]
}
}
GeliBusinessPlatform/ViewController/工作中心/编辑工作中心/EditWorkCViewController.swift
View file @
45213823
...
...
@@ -7,7 +7,6 @@
//
import
UIKit
import
RealmSwift
protocol
EditWorkCViewControllerDelegate
{
func
updataUIbyEditWorkSave
()
...
...
@@ -21,8 +20,7 @@ class EditWorkCViewController: BaseViewController, UICollectionViewDelegate, UIC
//MARK:--一级分类
var
titleStrArr
:[
String
]
=
[]
var
pAuthResModelArr
:[
WorkcenterIndexAuthResModel
]
=
[]
let
realm
=
try!
Realm
()
//数据库
@IBOutlet
weak
var
topLayou
:
NSLayoutConstraint
!
@IBOutlet
weak
var
itemListCollectionView
:
UICollectionView
!
@IBOutlet
weak
var
titleView
:
UIView
!
...
...
@@ -90,14 +88,15 @@ class EditWorkCViewController: BaseViewController, UICollectionViewDelegate, UIC
}
func
sureGeliAlertViewAction
(
sender
:
UIButton
)
{
if
sender
.
tag
==
1001
{
let
items
=
self
.
realm
.
objects
(
WorkDataModel
.
self
)
if
items
.
count
>
0
{
let
workTestMd
:
WorkDataModel
=
items
[
0
];
let
userdataStr
=
UserDefaults
.
standard
.
value
(
forKey
:
"WorkDataModel"
)
if
userdataStr
!=
nil
{
let
workTestMd
=
WorkDataModel
(
JSONString
:
userdataStr
as!
String
)
// 在一个事务中更新对象
let
oftenStr
=
self
.
oftenArr
?
.
toJSONString
()
try!
realm
.
write
{
workTestMd
.
oftenArrStr
=
oftenStr
!
}
workTestMd
!.
oftenArrStr
=
oftenStr
!
let
userDataStr
=
workTestMd
!.
toJSONString
()
UserDefaults
.
standard
.
set
(
userDataStr
,
forKey
:
"WorkDataModel"
)
UserDefaults
.
standard
.
synchronize
()
HUD
.
flash
(
.
label
(
"保存成功"
),
onView
:
nil
,
delay
:
1.2
)
{
(
istrue
)
in
self
.
delegate
?
.
updataUIbyEditWorkSave
()
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
...
...
GeliBusinessPlatform/ViewController/账号信息/AccountViewController.swift
View file @
45213823
...
...
@@ -7,7 +7,7 @@
//
import
UIKit
import
RealmSwift
class
AccountViewController
:
BaseViewController
{
@IBOutlet
weak
var
phoneLbl
:
UILabel
!
...
...
@@ -52,10 +52,7 @@ class AccountViewController: BaseViewController{
@IBAction
func
logOutAction
(
_
sender
:
Any
)
{
print
(
"退出登录"
)
//模拟退出登录
let
realm
=
try!
Realm
()
try!
realm
.
write
{
realm
.
deleteAll
()
}
UserDefaults
.
standard
.
removeObject
(
forKey
:
"WorkDataModel"
)
UserDefaults
.
standard
.
removeObject
(
forKey
:
"user_token"
)
NotificationCenter
.
default
.
post
(
name
:
Notification
.
Name
(
rawValue
:
"logout"
),
object
:
nil
)
JPUSHService
.
deleteAlias
({
(
resCode
,
alias
,
num
)
in
...
...
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