Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
contactless-angular
Project
Project
Details
Activity
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
creditcard
contactless-angular
Commits
bdafc9d4
Commit
bdafc9d4
authored
Jul 30, 2024
by
伊藤雄大
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024/07/30
サービスの戻り値をObservableに変更
parent
56967393
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
71 additions
and
23 deletions
+71
-23
pass-list.component.ts
src/app/menu/pass-list/pass-list.component.ts
+4
-1
staff-list.component.ts
src/app/menu/staff-list/staff-list.component.ts
+17
-4
staff-regist.component.ts
src/app/menu/staff-regist/staff-regist.component.ts
+8
-2
user-list.component.ts
src/app/menu/user-list/user-list.component.ts
+4
-1
login.service.ts
src/app/service/login.service.ts
+10
-5
pass.service.ts
src/app/service/pass.service.ts
+6
-2
staff.service.ts
src/app/service/staff.service.ts
+16
-6
user.service.ts
src/app/service/user.service.ts
+6
-2
No files found.
src/app/menu/pass-list/pass-list.component.ts
View file @
bdafc9d4
...
@@ -64,7 +64,10 @@ export class PassListComponent implements OnInit {
...
@@ -64,7 +64,10 @@ export class PassListComponent implements OnInit {
*/
*/
ngOnInit
():
void
{
ngOnInit
():
void
{
if
(
this
.
model
&&
this
.
model
.
customerId
)
{
if
(
this
.
model
&&
this
.
model
.
customerId
)
{
this
.
passList
=
this
.
passService
.
getList
(
this
.
model
.
customerId
);
//this.passList = this.passService.getList(this.model.customerId);
this
.
passService
.
getList
(
this
.
model
.
customerId
).
subscribe
((
ret
:
PassModel
[])
=>
{
this
.
passList
=
ret
;
});
}
}
}
}
...
...
src/app/menu/staff-list/staff-list.component.ts
View file @
bdafc9d4
...
@@ -71,11 +71,18 @@ export class StaffListComponent implements OnInit {
...
@@ -71,11 +71,18 @@ export class StaffListComponent implements OnInit {
* 初期処理
* 初期処理
*/
*/
ngOnInit
():
void
{
ngOnInit
():
void
{
this
.
agencyList
=
this
.
staffService
.
getAgencyList
();
//this.agencyList = this.staffService.getAgencyList();
this
.
staffService
.
getAgencyList
().
subscribe
((
ret
:
Map
<
string
,
string
>
)
=>
{
this
.
agencyList
=
ret
;
});
if
(
this
.
agencyId
)
{
if
(
this
.
agencyId
)
{
this
.
agencyName
=
this
.
agencyList
.
get
(
this
.
agencyId
);
this
.
agencyName
=
this
.
agencyList
.
get
(
this
.
agencyId
);
//担当者一覧取得
//担当者一覧取得
this
.
staffList
=
this
.
staffService
.
getList
(
this
.
agencyId
);
//this.staffList = this.staffService.getList(this.agencyId);
this
.
staffService
.
getList
(
this
.
agencyId
).
subscribe
((
ret
:
StaffInfoModel
[])
=>
{
this
.
staffList
=
ret
;
});
}
else
{
}
else
{
this
.
agencyId
=
this
.
agencyList
.
keys
().
next
().
value
;
this
.
agencyId
=
this
.
agencyList
.
keys
().
next
().
value
;
}
}
...
@@ -86,7 +93,10 @@ export class StaffListComponent implements OnInit {
...
@@ -86,7 +93,10 @@ export class StaffListComponent implements OnInit {
*/
*/
onClickSearch
():
void
{
onClickSearch
():
void
{
//担当者一覧取得
//担当者一覧取得
this
.
staffList
=
this
.
staffService
.
getList
(
this
.
agencyId
);
//this.staffList = this.staffService.getList(this.agencyId);
this
.
staffService
.
getList
(
this
.
agencyId
).
subscribe
((
ret
:
StaffInfoModel
[])
=>
{
this
.
staffList
=
ret
;
});
}
}
/**
/**
...
@@ -120,7 +130,10 @@ export class StaffListComponent implements OnInit {
...
@@ -120,7 +130,10 @@ export class StaffListComponent implements OnInit {
this
.
staffService
.
delete
(
emailList
);
this
.
staffService
.
delete
(
emailList
);
//一覧再取得
//一覧再取得
this
.
staffList
=
this
.
staffService
.
getList
(
this
.
agencyId
);
//this.staffList = this.staffService.getList(this.agencyId);
this
.
staffService
.
getList
(
this
.
agencyId
).
subscribe
((
ret
:
StaffInfoModel
[])
=>
{
this
.
staffList
=
ret
;
});
//↓プロトタイプで行削除の動きを見せるため
//↓プロトタイプで行削除の動きを見せるため
const
array
=
[];
const
array
=
[];
...
...
src/app/menu/staff-regist/staff-regist.component.ts
View file @
bdafc9d4
...
@@ -45,10 +45,16 @@ export class StaffRegistComponent implements OnInit {
...
@@ -45,10 +45,16 @@ export class StaffRegistComponent implements OnInit {
*/
*/
ngOnInit
():
void
{
ngOnInit
():
void
{
//事業所一覧
//事業所一覧
this
.
agencyList
=
this
.
staffService
.
getAgencyList
();
//this.agencyList = this.staffService.getAgencyList();
this
.
staffService
.
getAgencyList
().
subscribe
((
ret
:
Map
<
string
,
string
>
)
=>
{
this
.
agencyList
=
ret
;
});
//権限一覧
//権限一覧
this
.
roleList
=
this
.
staffService
.
getRoleList
();
//this.roleList = this.staffService.getRoleList();
this
.
staffService
.
getRoleList
().
subscribe
((
ret
:
Map
<
string
,
string
>
)
=>
{
this
.
roleList
=
ret
;
});
if
(
this
.
staffInfoModel
!==
null
)
{
if
(
this
.
staffInfoModel
!==
null
)
{
this
.
agencyId
=
this
.
staffInfoModel
?.
agencyId
;
this
.
agencyId
=
this
.
staffInfoModel
?.
agencyId
;
...
...
src/app/menu/user-list/user-list.component.ts
View file @
bdafc9d4
...
@@ -76,7 +76,10 @@ export class UserListComponent implements OnInit {
...
@@ -76,7 +76,10 @@ export class UserListComponent implements OnInit {
* 検索
* 検索
*/
*/
onClickSearch
():
void
{
onClickSearch
():
void
{
this
.
userList
=
this
.
userService
.
getList
(
this
.
userName
);
//this.userList = this.userService.getList(this.userName);
this
.
userService
.
getList
(
this
.
userName
).
subscribe
((
ret
:
UserInfoModel
[])
=>
{
this
.
userList
=
ret
;
});
}
}
onGridReady
(
params
:
any
):
void
{
onGridReady
(
params
:
any
):
void
{
...
...
src/app/service/login.service.ts
View file @
bdafc9d4
import
{
Injectable
}
from
'@angular/core'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
Observable
}
from
'rxjs'
;
/**
/**
* ログインサービス
* ログインサービス
...
@@ -13,16 +14,20 @@ export class LoginService {
...
@@ -13,16 +14,20 @@ export class LoginService {
* @param password パスワード
* @param password パスワード
* @returns 認証成功(true)/失敗(false)
* @returns 認証成功(true)/失敗(false)
*/
*/
login
(
email
?:
string
,
password
?:
string
):
boolean
{
login
(
email
?:
string
,
password
?:
string
):
Observable
<
boolean
>
{
let
ret
=
true
;
//TODO
//TODO
if
(
!
email
)
{
if
(
!
email
)
{
alert
(
"メールアドレスが入力されていません"
);
alert
(
"メールアドレスが入力されていません"
);
ret
urn
false
;
ret
=
false
;
}
}
if
(
!
password
)
{
if
(
ret
&&
!
password
)
{
alert
(
"パスワードが入力されていません"
);
alert
(
"パスワードが入力されていません"
);
ret
urn
false
;
ret
=
false
;
}
}
return
true
;
//return ret;
return
new
Observable
<
boolean
>
(
o
=>
{
o
.
next
(
ret
);
});
}
}
}
}
src/app/service/pass.service.ts
View file @
bdafc9d4
import
{
Injectable
}
from
'@angular/core'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
PassModel
}
from
'../model/pass.model'
;
import
{
PassModel
}
from
'../model/pass.model'
;
import
{
Observable
}
from
'rxjs'
;
/**
/**
* 定期券サービス
* 定期券サービス
...
@@ -13,7 +14,7 @@ export class PassService {
...
@@ -13,7 +14,7 @@ export class PassService {
* @param customerId 利用者ID
* @param customerId 利用者ID
* @returns 定期券一覧
* @returns 定期券一覧
*/
*/
getList
(
customerId
:
string
):
PassModel
[]
{
getList
(
customerId
:
string
):
Observable
<
PassModel
[]
>
{
//TODO
//TODO
const
passList
:
PassModel
[]
=
[];
const
passList
:
PassModel
[]
=
[];
if
(
customerId
)
{
if
(
customerId
)
{
...
@@ -32,7 +33,10 @@ export class PassService {
...
@@ -32,7 +33,10 @@ export class PassService {
passList
.
push
(
model
);
passList
.
push
(
model
);
}
}
}
}
return
passList
;
//return passList;
return
new
Observable
<
PassModel
[]
>
(
o
=>
{
o
.
next
(
passList
);
});
}
}
/**
/**
...
...
src/app/service/staff.service.ts
View file @
bdafc9d4
import
{
Injectable
}
from
'@angular/core'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
StaffInfoModel
}
from
'../model/staff-info.model'
;
import
{
StaffInfoModel
}
from
'../model/staff-info.model'
;
import
{
Observable
}
from
'rxjs'
;
/**
/**
* 担当者サービス
* 担当者サービス
...
@@ -13,7 +14,7 @@ export class StaffService {
...
@@ -13,7 +14,7 @@ export class StaffService {
* @param agencyId 事業者ID
* @param agencyId 事業者ID
* @returns 担当者情報一覧
* @returns 担当者情報一覧
*/
*/
getList
(
agencyId
?:
string
):
StaffInfoModel
[]
{
getList
(
agencyId
?:
string
):
Observable
<
StaffInfoModel
[]
>
{
//TODO
//TODO
const
staffList
:
StaffInfoModel
[]
=
[];
const
staffList
:
StaffInfoModel
[]
=
[];
if
(
agencyId
)
{
if
(
agencyId
)
{
...
@@ -30,28 +31,34 @@ export class StaffService {
...
@@ -30,28 +31,34 @@ export class StaffService {
staffList
.
push
(
model
);
staffList
.
push
(
model
);
}
}
}
}
return
staffList
;
//return staffList;
return
new
Observable
<
StaffInfoModel
[]
>
(
o
=>
{
o
.
next
(
staffList
);
});
}
}
/**
/**
* 事業者一覧取得
* 事業者一覧取得
* @returns 事業者一覧
* @returns 事業者一覧
*/
*/
getAgencyList
():
Map
<
string
,
string
>
{
getAgencyList
():
Observable
<
Map
<
string
,
string
>
>
{
//TODO
//TODO
const
agencyList
=
new
Map
();
const
agencyList
=
new
Map
();
for
(
let
i
=
0
;
i
<
5
;
i
++
)
{
for
(
let
i
=
0
;
i
<
5
;
i
++
)
{
const
str
=
String
(
i
+
1
);
const
str
=
String
(
i
+
1
);
agencyList
.
set
(
"000"
+
str
,
"事業所"
+
str
);
agencyList
.
set
(
"000"
+
str
,
"事業所"
+
str
);
}
}
return
agencyList
;
//return agencyList;
return
new
Observable
<
Map
<
string
,
string
>>
(
o
=>
{
o
.
next
(
agencyList
);
});
}
}
/**
/**
* 権限一覧取得
* 権限一覧取得
* @returns 権限一覧
* @returns 権限一覧
*/
*/
getRoleList
():
Map
<
string
,
string
>
{
getRoleList
():
Observable
<
Map
<
string
,
string
>
>
{
//TODO
//TODO
const
roleList
=
new
Map
();
const
roleList
=
new
Map
();
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
...
@@ -59,7 +66,10 @@ export class StaffService {
...
@@ -59,7 +66,10 @@ export class StaffService {
roleList
?.
set
(
str
,
"権限"
+
str
)
roleList
?.
set
(
str
,
"権限"
+
str
)
}
}
return
roleList
;
//return roleList;
return
new
Observable
<
Map
<
string
,
string
>>
(
o
=>
{
o
.
next
(
roleList
);
});
}
}
/**
/**
...
...
src/app/service/user.service.ts
View file @
bdafc9d4
import
{
Injectable
}
from
'@angular/core'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
UserInfoModel
}
from
'../model/user-info.model'
;
import
{
UserInfoModel
}
from
'../model/user-info.model'
;
import
{
Observable
}
from
'rxjs'
;
/**
/**
* 利用者サービス
* 利用者サービス
...
@@ -14,7 +15,7 @@ export class UserService {
...
@@ -14,7 +15,7 @@ export class UserService {
* @param name 利用者名
* @param name 利用者名
* @returns 利用者一覧
* @returns 利用者一覧
*/
*/
getList
(
name
?:
string
):
UserInfoModel
[]
{
getList
(
name
?:
string
):
Observable
<
UserInfoModel
[]
>
{
//TODO
//TODO
const
userList
:
UserInfoModel
[]
=
[];
const
userList
:
UserInfoModel
[]
=
[];
if
(
name
)
{
if
(
name
)
{
...
@@ -29,6 +30,9 @@ export class UserService {
...
@@ -29,6 +30,9 @@ export class UserService {
userList
.
push
(
model
);
userList
.
push
(
model
);
}
}
}
}
return
userList
;
//return userList;
return
new
Observable
<
UserInfoModel
[]
>
(
o
=>
{
o
.
next
(
userList
);
});
}
}
}
}
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