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
8ff3197c
Commit
8ff3197c
authored
Jun 28, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
知识库 update
parent
11057c2e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
209 additions
and
37 deletions
+209
-37
common-problem.component.html
...pp/knowladge/common-problem/common-problem.component.html
+5
-4
common-problem.component.ts
.../app/knowladge/common-problem/common-problem.component.ts
+46
-3
information-tech.component.html
...nowladge/information-tech/information-tech.component.html
+5
-4
information-tech.component.ts
.../knowladge/information-tech/information-tech.component.ts
+67
-16
management-system.component.html
...wladge/management-system/management-system.component.html
+5
-4
management-system.component.ts
...nowladge/management-system/management-system.component.ts
+46
-3
navbar.component.ts
src/main/webapp/app/layouts/navbar/navbar.component.ts
+4
-0
common.service.ts
src/main/webapp/app/shared/common/common.service.ts
+0
-1
upload.component.ts
src/main/webapp/app/work/modal/upload/upload.component.ts
+31
-2
work.service.ts
src/main/webapp/app/work/work.service.ts
+0
-0
No files found.
src/main/webapp/app/knowladge/common-problem/common-problem.component.html
View file @
8ff3197c
...
...
@@ -25,17 +25,18 @@
<div
nz-col
nzSpan=
"8"
class=
"text-right"
>
</div>
</div>
<nz-table
#
basicTable
[
nzData
]="
dataSet
"
>
<nz-table
#
basicTable
[
nzData
]="
dataSet
"
[
nzLoading
]="
loading
"
[
nzShowPagination
]="
true
"
[
nzTotal
]="
totalNum
"
[
nzPageIndex
]="
pageNum
"
[
nzPageSize
]="
pageCount
"
(
nzPageIndexChange
)="
change
($
event
)"
>
<thead>
<tr>
<th>
文件名称
</th>
<th
nzWidth=
"80%"
>
文件名称
</th>
<th>
操作
</th>
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let data of basicTable.data"
>
<td>
{{data.name}}
</td>
<td>
{{data.comment}}
</td>
<td
class=
"handle main-color"
>
<span
(
click
)="
download
(
data
)"
>
下载
</span>
</td>
...
...
@@ -43,4 +44,4 @@
</tbody>
</nz-table>
<!--导入文件-->
<smart-upload
#
smartUpload
></smart-upload>
<smart-upload
#
smartUpload
(
done
)="
getList
()"
></smart-upload>
src/main/webapp/app/knowladge/common-problem/common-problem.component.ts
View file @
8ff3197c
import
{
Component
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
UploadComponent
}
from
'../../work/modal/upload/upload.component'
;
import
{
pageSize
}
from
'../../app.constants'
;
import
{
WorkService
}
from
'../../work/work.service'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
import
{
CommonService
}
from
'../../shared/common/common.service'
;
@
Component
({
selector
:
'smart-common-problem'
,
...
...
@@ -10,11 +14,46 @@ export class CommonProblemComponent implements OnInit {
@
ViewChild
(
'smartUpload'
)
smartUpload
:
UploadComponent
;
dataSet
=
[];
pageNum
=
1
;
pageCount
=
pageSize
;
totalNum
;
loading
=
false
;
constructor
()
{
constructor
(
private
workSer
:
WorkService
,
private
message
:
NzMessageService
,
private
commonSer
:
CommonService
)
{
}
ngOnInit
()
{
this
.
getList
();
}
change
(
$event
)
{
this
.
pageNum
=
$event
;
this
.
getList
();
}
getList
()
{
this
.
loading
=
true
;
const
data
=
{
pageNum
:
this
.
pageNum
,
pageCount
:
this
.
pageCount
,
obj
:{
flag
:
0
}
};
this
.
workSer
.
knowledgedFindPage
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
if
(
res
.
data
)
{
this
.
dataSet
=
res
.
data
.
data
;
this
.
totalNum
=
res
.
data
.
totalNum
;
}
}
else
{
this
.
message
.
info
(
res
.
errMsg
);
}
this
.
loading
=
false
;
}
);
}
//导入
...
...
@@ -23,8 +62,12 @@ export class CommonProblemComponent implements OnInit {
}
//下载
download
(
data
)
{
download
(
item
)
{
this
.
workSer
.
knowledgedDownload
(
item
.
id
).
subscribe
(
(
data
)
=>
{
this
.
commonSer
.
downloadFile
(
item
.
name
,
data
);
}
);
}
}
src/main/webapp/app/knowladge/information-tech/information-tech.component.html
View file @
8ff3197c
...
...
@@ -25,17 +25,18 @@
<div
nz-col
nzSpan=
"8"
class=
"text-right"
>
</div>
</div>
<nz-table
#
basicTable
[
nzData
]="
dataSet
"
>
<nz-table
#
basicTable
[
nzData
]="
dataSet
"
[
nzLoading
]="
loading
"
[
nzShowPagination
]="
true
"
[
nzTotal
]="
totalNum
"
[
nzPageIndex
]="
pageNum
"
[
nzPageSize
]="
pageCount
"
(
nzPageIndexChange
)="
change
($
event
)"
>
<thead>
<tr>
<th>
文件名称
</th>
<th
nzWidth=
"80%"
>
文件名称
</th>
<th>
操作
</th>
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let data of basicTable.data"
>
<td>
{{data.name}}
</td>
<td>
{{data.comment}}
</td>
<td
class=
"handle main-color"
>
<span
(
click
)="
download
(
data
)"
>
下载
</span>
</td>
...
...
@@ -43,4 +44,4 @@
</tbody>
</nz-table>
<!--导入文件-->
<smart-upload
#
smartUpload
></smart-upload>
<smart-upload
#
smartUpload
(
done
)="
getDone
()"
></smart-upload>
src/main/webapp/app/knowladge/information-tech/information-tech.component.ts
View file @
8ff3197c
import
{
Component
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
UploadComponent
}
from
'../../work/modal/upload/upload.component'
;
import
{
pageSize
}
from
'../../app.constants'
;
import
{
WorkService
}
from
'../../work/work.service'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
import
{
CommonService
}
from
'../../shared/common/common.service'
;
@
Component
({
selector
:
'smart-information-tech'
,
templateUrl
:
'./information-tech.component.html'
,
styles
:
[]
selector
:
'smart-information-tech'
,
templateUrl
:
'./information-tech.component.html'
,
styles
:
[]
})
export
class
InformationTechComponent
implements
OnInit
{
@
ViewChild
(
'smartUpload'
)
smartUpload
:
UploadComponent
;
@
ViewChild
(
'smartUpload'
)
smartUpload
:
UploadComponent
;
dataSet
=
[];
dataSet
=
[];
pageNum
=
1
;
pageCount
=
pageSize
;
totalNum
;
loading
=
false
;
constructor
()
{
}
constructor
(
private
workSer
:
WorkService
,
private
message
:
NzMessageService
,
private
commonSer
:
CommonService
)
{
}
ngOnInit
()
{
}
ngOnInit
()
{
console
.
log
(
'init'
);
this
.
getList
();
}
//导入
importFile
()
{
this
.
smartUpload
.
showModal
(
'上传信息技术文件'
);
}
change
(
$event
)
{
console
.
log
(
'change'
);
this
.
pageNum
=
$event
;
this
.
getList
();
}
//下载
download
(
data
)
{
getDone
()
{
console
.
log
(
'done'
);
this
.
pageNum
=
1
;
this
.
getList
();
}
}
getList
()
{
this
.
loading
=
true
;
const
data
=
{
pageNum
:
this
.
pageNum
,
pageCount
:
this
.
pageCount
,
obj
:
{
flag
:
1
}
};
this
.
workSer
.
knowledgedFindPage
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
if
(
res
.
data
)
{
this
.
dataSet
=
res
.
data
.
data
;
this
.
totalNum
=
res
.
data
.
totalNum
;
}
}
else
{
this
.
message
.
info
(
res
.
errMsg
);
}
this
.
loading
=
false
;
}
);
}
//导入
importFile
()
{
this
.
smartUpload
.
showModal
(
'上传信息技术文件'
);
}
//下载
download
(
item
)
{
this
.
workSer
.
knowledgedDownload
(
item
.
id
).
subscribe
(
(
data
)
=>
{
this
.
commonSer
.
downloadFile
(
item
.
name
,
data
);
}
);
}
}
src/main/webapp/app/knowladge/management-system/management-system.component.html
View file @
8ff3197c
...
...
@@ -25,17 +25,18 @@
<div
nz-col
nzSpan=
"8"
class=
"text-right"
>
</div>
</div>
<nz-table
#
basicTable
[
nzData
]="
dataSet
"
>
<nz-table
#
basicTable
[
nzData
]="
dataSet
"
[
nzLoading
]="
loading
"
[
nzShowPagination
]="
true
"
[
nzTotal
]="
totalNum
"
[
nzPageIndex
]="
pageNum
"
[
nzPageSize
]="
pageCount
"
(
nzPageIndexChange
)="
change
($
event
)"
>
<thead>
<tr>
<th>
文件名称
</th>
<th
nzWidth=
"80%"
>
文件名称
</th>
<th>
操作
</th>
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let data of basicTable.data"
>
<td>
{{data.name}}
</td>
<td>
{{data.comment}}
</td>
<td
class=
"handle main-color"
>
<span
(
click
)="
download
(
data
)"
>
下载
</span>
</td>
...
...
@@ -43,4 +44,4 @@
</tbody>
</nz-table>
<!--导入文件-->
<smart-upload
#
smartUpload
></smart-upload>
<smart-upload
#
smartUpload
(
done
)="
getList
()"
></smart-upload>
src/main/webapp/app/knowladge/management-system/management-system.component.ts
View file @
8ff3197c
import
{
Component
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
UploadComponent
}
from
'../../work/modal/upload/upload.component'
;
import
{
pageSize
}
from
'../../app.constants'
;
import
{
WorkService
}
from
'../../work/work.service'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
import
{
CommonService
}
from
'../../shared/common/common.service'
;
@
Component
({
selector
:
'smart-management-system'
,
...
...
@@ -10,11 +14,46 @@ export class ManagementSystemComponent implements OnInit {
@
ViewChild
(
'smartUpload'
)
smartUpload
:
UploadComponent
;
dataSet
=
[];
pageNum
=
1
;
pageCount
=
pageSize
;
totalNum
;
loading
=
false
;
constructor
()
{
constructor
(
private
workSer
:
WorkService
,
private
message
:
NzMessageService
,
private
commonSer
:
CommonService
)
{
}
ngOnInit
()
{
this
.
getList
();
}
change
(
$event
)
{
this
.
pageNum
=
$event
;
this
.
getList
();
}
getList
()
{
this
.
loading
=
true
;
const
data
=
{
pageNum
:
this
.
pageNum
,
pageCount
:
this
.
pageCount
,
obj
:{
flag
:
2
}
};
this
.
workSer
.
knowledgedFindPage
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
if
(
res
.
data
)
{
this
.
dataSet
=
res
.
data
.
data
;
this
.
totalNum
=
res
.
data
.
totalNum
;
}
}
else
{
this
.
message
.
info
(
res
.
errMsg
);
}
this
.
loading
=
false
;
}
);
}
//导入
...
...
@@ -23,8 +62,12 @@ export class ManagementSystemComponent implements OnInit {
}
//下载
download
(
data
)
{
download
(
item
)
{
this
.
workSer
.
knowledgedDownload
(
item
.
id
).
subscribe
(
(
data
)
=>
{
this
.
commonSer
.
downloadFile
(
item
.
name
,
data
);
}
);
}
}
src/main/webapp/app/layouts/navbar/navbar.component.ts
View file @
8ff3197c
...
...
@@ -66,6 +66,10 @@ export class NavbarComponent implements OnInit ,AfterViewChecked{
const
sub
=
this
.
appSer
.
theme
.
subscribe
(
value
=>
{
this
.
theme
=
value
;
})
const
data
=
{
token
:
''
}
}
/**
...
...
src/main/webapp/app/shared/common/common.service.ts
View file @
8ff3197c
...
...
@@ -107,7 +107,6 @@ export class CommonService implements OnInit {
*/
downloadFile
(
title
,
data
:
Response
)
{
const
blob
=
new
Blob
([
data
],
{
type
:
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;'
});
const
ie
=
navigator
.
userAgent
.
match
(
/MSIE
\s([\d
.
]
+
)
/
),
ie11
=
navigator
.
userAgent
.
match
(
/Trident
\/
7.0/
)
&&
navigator
.
userAgent
.
match
(
/rv:11/
),
ieEDGE
=
navigator
.
userAgent
.
match
(
/Edge/g
),
...
...
src/main/webapp/app/work/modal/upload/upload.component.ts
View file @
8ff3197c
...
...
@@ -18,7 +18,7 @@ export class UploadComponent implements OnInit {
fileList
:
UploadFile
[]
=
[];
constructor
(
private
message
:
NzMessageService
,
private
workSer
:
WorkService
,
private
systemSer
:
SystemService
,
private
overAllSer
:
OverAllService
)
{
private
systemSer
:
SystemService
,
private
overAllSer
:
OverAllService
)
{
}
ngOnInit
()
{
...
...
@@ -59,9 +59,12 @@ export class UploadComponent implements OnInit {
if
(
this
.
title
==
'上传组织文件'
)
{
this
.
orgUpload
();
}
if
(
this
.
title
==
'上传XML模版'
)
{
if
(
this
.
title
==
'上传XML模版'
)
{
this
.
xmlpload
();
}
if
(
this
.
title
==
'上传常见问题文件'
||
this
.
title
==
'上传信息技术文件'
||
this
.
title
==
'上传管理制度文件'
)
{
this
.
knowladgeUpload
();
}
}
//上传资产文件
...
...
@@ -145,4 +148,30 @@ export class UploadComponent implements OnInit {
}
);
}
//知识库里面的文件
knowladgeUpload
()
{
let
flag
;
if
(
this
.
title
==
'上传常见问题文件'
)
flag
=
0
;
if
(
this
.
title
==
'上传信息技术文件'
)
flag
=
1
;
if
(
this
.
title
==
'上传管理制度文件'
)
flag
=
2
;
const
formData
=
new
FormData
();
this
.
fileList
.
forEach
((
file
:
any
)
=>
{
formData
.
append
(
'file'
,
file
);
});
this
.
workSer
.
importKnowladage
(
formData
,
flag
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
isVisible
=
false
;
this
.
fileList
=
[];
this
.
done
.
emit
();
this
.
message
.
success
(
'上传成功'
);
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
this
.
isOkLoading
=
false
;
}
);
}
}
src/main/webapp/app/work/work.service.ts
View file @
8ff3197c
This diff is collapsed.
Click to expand it.
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