Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
smart
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
wangqinghua
smart
Commits
71308a89
Commit
71308a89
authored
Dec 24, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
995c905e
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
30 additions
and
23 deletions
+30
-23
common.service.ts
src/main/webapp/app/shared/common/common.service.ts
+1
-1
examine.component.html
src/main/webapp/app/system/examine/examine.component.html
+1
-1
group.component.html
src/main/webapp/app/system/group/group.component.html
+1
-1
group.component.ts
src/main/webapp/app/system/group/group.component.ts
+1
-1
system.service.ts
src/main/webapp/app/system/system.service.ts
+16
-8
asset-part.component.ts
src/main/webapp/app/work/asset-part/asset-part.component.ts
+5
-4
upload.component.ts
src/main/webapp/app/work/modal/upload/upload.component.ts
+5
-2
work.service.ts
src/main/webapp/app/work/work.service.ts
+0
-5
No files found.
src/main/webapp/app/shared/common/common.service.ts
View file @
71308a89
...
...
@@ -87,7 +87,7 @@ export class CommonService implements OnInit {
* @param url 文件URL
*/
downloadFile
(
title
,
data
:
Response
)
{
const
blob
=
new
Blob
([
data
],
{
type
:
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
});
const
blob
=
new
Blob
([
data
],
{
type
:
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;"
});
const
url
=
window
.
URL
.
createObjectURL
(
blob
);
let
link
=
document
.
createElement
(
"a"
);
link
.
setAttribute
(
"href"
,
url
);
...
...
src/main/webapp/app/system/examine/examine.component.html
View file @
71308a89
...
...
@@ -101,7 +101,7 @@
<span
*
ngIf=
"data.status == 0"
>
未审核
</span>
<span
*
ngIf=
"data.status == 1"
>
撤回
</span>
<span
*
ngIf=
"data.status == 2"
>
通过
</span>
<span
*
ngIf=
"data.status ==
2
"
>
失败
</span>
<span
*
ngIf=
"data.status ==
3
"
>
失败
</span>
</td>
<td>
{{data.checkUserName}}
</td>
<td>
{{data.chechTime | date:'yyyy-MM-dd HH:mm:ss'}}
</td>
...
...
src/main/webapp/app/system/group/group.component.html
View file @
71308a89
...
...
@@ -92,5 +92,5 @@
<!--授予角色-->
<smart-select-role
#
smartSelectRole
(
done
)="
setRole
($
event
)"
></smart-select-role>
<!--导入文件-->
<smart-upload
#
smartUpload
></smart-upload>
<smart-upload
#
smartUpload
(
done
)="
ngOnInit
()"
></smart-upload>
src/main/webapp/app/system/group/group.component.ts
View file @
71308a89
...
...
@@ -281,7 +281,7 @@ export class GroupComponent implements OnInit {
//下载模版
downLoad
(){
this
.
systemSer
.
downloadTemplate
().
subscribe
(
this
.
systemSer
.
downloadTemplate
(
""
,
SERVER_API_URL_COMS
+
"/user/downloadTemplate/"
).
subscribe
(
data
=>
{
this
.
commonSer
.
downloadFile
(
"模版"
,
data
)
}
...
...
src/main/webapp/app/system/system.service.ts
View file @
71308a89
import
{
HttpClient
}
from
"@angular/common/http"
;
import
{
Observable
}
from
"rxjs/Rx"
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
SERVER_API_URL
_COMS
}
from
"../app.constants"
;
import
{
SERVER_API_URL
,
SERVER_API_URL_COMS
}
from
'../app.constants'
;
import
{
CommonService
}
from
'../shared/common/common.service'
;
import
{
LocalStorageService
,
SessionStorageService
}
from
'ngx-webstorage'
;
import
{
Request
Options
}
from
'@angular/http'
;
import
{
Http
,
RequestOptions
,
ResponseContentType
,
Response
Options
}
from
'@angular/http'
;
@
Injectable
()
export
class
SystemService
{
constructor
(
private
http
:
HttpClient
,
private
commonSer
:
CommonService
,
headers
;
options
;
constructor
(
private
http
:
HttpClient
,
private
commonSer
:
CommonService
,
private
http1
:
Http
,
private
localStorage
:
LocalStorageService
,
private
sessionStorage
:
SessionStorageService
)
{
}
...
...
@@ -211,11 +213,6 @@ export class SystemService {
return
this
.
http
.
get
(
SERVER_API_URL_COMS
+
'/resources/getMenuBySeparation'
);
}
//下载文件
downloadTemplate
():
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL_COMS
+
'/user/downloadTemplate'
,{
responseType
:
'text'
}
);
}
//用户导入
importUser
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL_COMS
+
'/user/importUser'
,
data
);
...
...
@@ -225,4 +222,15 @@ export class SystemService {
importOrg
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL_COMS
+
'/organization/importOrg'
,
data
);
}
/**
* 下载文件
* @param pararms 参数
* @param url 地址
* @returns {Observable<any>}
*/
downloadTemplate
(
pararms
,
url
):
Observable
<
any
>
{
return
this
.
http
.
get
(
url
+
pararms
,{
responseType
:
'blob'
});
}
}
src/main/webapp/app/work/asset-part/asset-part.component.ts
View file @
71308a89
import
{
Component
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
WorkService
}
from
'../work.service'
;
import
{
pageSize
}
from
'../../app.constants'
;
import
{
pageSize
,
SERVER_API_URL
}
from
'../../app.constants'
;
import
{
Router
}
from
'@angular/router'
;
import
{
TypeAsetsComponent
}
from
'../modal/type-asets/type-asets.component'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
import
{
UploadComponent
}
from
'../modal/upload/upload.component'
;
import
{
CommonService
}
from
'../../shared/common/common.service'
;
import
{
SystemService
}
from
'../../system/system.service'
;
@
Component
({
selector
:
'smart-asset-part'
,
...
...
@@ -36,7 +37,7 @@ export class AssetPartComponent implements OnInit {
endTime
:
''
,
};
constructor
(
private
workSer
:
WorkService
,
private
router
:
Router
,
private
commonSer
:
CommonService
,
private
messge
:
NzMessageService
)
{
}
private
messge
:
NzMessageService
,
private
systemSer
:
SystemService
)
{
}
ngOnInit
()
{
this
.
getList
();
...
...
@@ -153,9 +154,9 @@ export class AssetPartComponent implements OnInit {
//下载模版
downLoad
(){
this
.
workSer
.
download
(
"inventory
"
).
subscribe
(
this
.
systemSer
.
downloadTemplate
(
"inventory"
,
SERVER_API_URL
+
"/api/template/download/
"
).
subscribe
(
(
data
)
=>
{
this
.
commonSer
.
downloadFile
(
"资产模版"
,
data
);
this
.
commonSer
.
downloadFile
(
"资产模版
1
"
,
data
);
}
)
}
...
...
src/main/webapp/app/work/modal/upload/upload.component.ts
View file @
71308a89
import
{
Component
,
OnIni
t
}
from
'@angular/core'
;
import
{
Component
,
EventEmitter
,
OnInit
,
Outpu
t
}
from
'@angular/core'
;
import
{
NzMessageService
,
UploadFile
}
from
'ng-zorro-antd'
;
import
{
WorkService
}
from
'../../work.service'
;
import
{
SystemService
}
from
'../../../system/system.service'
;
...
...
@@ -9,6 +9,7 @@ import {SystemService} from '../../../system/system.service';
styles
:
[]
})
export
class
UploadComponent
implements
OnInit
{
@
Output
()
done
=
new
EventEmitter
<
any
>
();
title
;
isVisible
=
false
;
...
...
@@ -31,7 +32,7 @@ export class UploadComponent implements OnInit {
if
(
!
isExcel
)
{
this
.
message
.
error
(
'请上传excel文件!'
);
}
else
{
this
.
fileList
.
push
(
file
)
;
this
.
fileList
[
0
]
=
file
;
}
return
false
;
};
...
...
@@ -87,6 +88,7 @@ export class UploadComponent implements OnInit {
if
(
res
.
errCode
==
10000
)
{
this
.
isVisible
=
false
;
this
.
fileList
=
[];
this
.
done
.
emit
();
this
.
message
.
success
(
'上传成功'
);
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
...
...
@@ -106,6 +108,7 @@ export class UploadComponent implements OnInit {
if
(
res
.
errCode
==
10000
)
{
this
.
isVisible
=
false
;
this
.
fileList
=
[];
this
.
done
.
emit
();
this
.
message
.
success
(
'上传成功'
);
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
...
...
src/main/webapp/app/work/work.service.ts
View file @
71308a89
...
...
@@ -168,9 +168,4 @@ export class WorkService {
deleteTypeByparams
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/syseventType/delete'
,
data
);
}
//下载模版
download
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/api/template/download/'
+
params
,{
responseType
:
'text'
});
}
}
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