Commit dc43c91c authored by wangqinghua's avatar wangqinghua

update

parent 6ce4b934
import { Component } from '@angular/core';
import { Router } from "@angular/router";
import {OverAllService} from './overAll/overAll.service';
import {Title} from '@angular/platform-browser';
@Component({
selector: 'app-root',
......@@ -7,12 +9,18 @@ import { Router } from "@angular/router";
})
export class AppComponent {
constructor(private router: Router){
constructor(private router: Router,private overAll:OverAllService,
private titleSer:Title){
//火狐拖动图片会打开新tab
document.body.ondrop = (event)=> {
event.preventDefault();
event.stopPropagation();
};
console.log("智能运行监管平台:v2.0.7 update By 2019-06-10")
this.overAll.getSystem().subscribe(
(res)=>{
this.titleSer.setTitle(res.main.name);
}
)
}
}
......@@ -25,7 +25,7 @@
<div nz-col nzSpan="8" class="text-right">
</div>
</div>
<nz-table #basicTable [nzData]="dataSet" [nzLoading]="loading" [nzShowPagination]="true"
<nz-table #basicTable [nzData]="dataSet" [nzLoading]="loading" [nzShowPagination]="false"
[nzTotal]="totalNum" [nzPageIndex]="pageNum" [nzPageSize]="pageCount"
(nzPageIndexChange)="change($event)">
<thead>
......@@ -38,7 +38,9 @@
<tr *ngFor="let data of basicTable.data">
<td>{{data.name}}</td>
<td class="handle main-color">
<span (click)="preview(data)">预览</span>
<span (click)="download(data)">下载</span>
<span (click)="deleteFile(data)">删除</span>
</td>
</tr>
</tbody>
......
......@@ -10,6 +10,8 @@ import {CommonService} from '../../shared/common/common.service';
templateUrl: './common-problem.component.html',
styles: []
})
//空数据会导致无限请求数据
export class CommonProblemComponent implements OnInit {
@ViewChild('smartUpload') smartUpload: UploadComponent;
......@@ -28,8 +30,10 @@ export class CommonProblemComponent implements OnInit {
}
change($event) {
this.pageNum = $event;
this.getList();
if($event > 0){
this.pageNum = $event;
this.getList();
}
}
getList() {
......@@ -70,4 +74,24 @@ export class CommonProblemComponent implements OnInit {
);
}
//删除
deleteFile(item) {
this.commonSer.confirmThing('删除', '确认删除?', () => {
const data = {
ids: [item.id],
};
this.workSer.knowledgedDelete(data).subscribe(
(res) => {
this.message.success('删除成功!');
this.getList();
}
);
});
}
//预览
preview(item){
this.commonSer.previewFile(item.view);
}
}
......@@ -38,7 +38,9 @@
<tr *ngFor="let data of basicTable.data">
<td>{{data.name}}</td>
<td class="handle main-color">
<span (click)="preview(data)">预览</span>
<span (click)="download(data)">下载</span>
<span (click)="deleteFile(data)">删除</span>
</td>
</tr>
</tbody>
......
......@@ -24,18 +24,17 @@ export class InformationTechComponent implements OnInit {
}
ngOnInit() {
console.log('init');
this.getList();
}
change($event) {
console.log('change');
this.pageNum = $event;
this.getList();
if($event > 0){
this.pageNum = $event;
this.getList();
}
}
getDone() {
console.log('done');
this.pageNum = 1;
this.getList();
}
......@@ -78,4 +77,24 @@ export class InformationTechComponent implements OnInit {
);
}
//删除
deleteFile(item) {
this.commonSer.confirmThing('删除', '确认删除?', () => {
const data = {
ids: [item.id],
};
this.workSer.knowledgedDelete(data).subscribe(
(res) => {
this.message.success('删除成功!');
this.getList();
}
);
});
}
//预览
preview(item){
this.commonSer.previewFile(item.view);
}
}
......@@ -38,7 +38,9 @@
<tr *ngFor="let data of basicTable.data">
<td>{{data.name}}</td>
<td class="handle main-color">
<span (click)="preview(data)">预览</span>
<span (click)="download(data)">下载</span>
<span (click)="deleteFile(data)">删除</span>
</td>
</tr>
</tbody>
......
......@@ -6,68 +6,90 @@ import {NzMessageService} from 'ng-zorro-antd';
import {CommonService} from '../../shared/common/common.service';
@Component({
selector: 'smart-management-system',
templateUrl: './management-system.component.html',
styles: []
selector: 'smart-management-system',
templateUrl: './management-system.component.html',
styles: []
})
export class ManagementSystemComponent implements OnInit {
@ViewChild('smartUpload') smartUpload: UploadComponent;
@ViewChild('smartUpload') smartUpload: UploadComponent;
dataSet = [];
pageNum = 1;
pageCount = pageSize;
totalNum;
loading = false;
dataSet = [];
pageNum = 1;
pageCount = pageSize;
totalNum;
loading = false;
constructor(private workSer: WorkService, private message: NzMessageService,
private commonSer: CommonService) {
}
constructor(private workSer: WorkService, private message: NzMessageService,
private commonSer: CommonService) {
}
ngOnInit() {
this.getList();
}
ngOnInit() {
this.getList();
}
change($event) {
this.pageNum = $event;
this.getList();
}
change($event) {
if ($event > 0) {
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;
getList() {
this.loading = true;
const data = {
pageNum: this.pageNum,
pageCount: this.pageCount,
obj: {
flag: 2
}
} else {
this.message.info(res.errMsg);
}
this.loading = false;
}
);
}
};
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('上传管理制度文件');
}
//导入
importFile() {
this.smartUpload.showModal('上传管理制度文件');
}
//下载
download(item) {
this.workSer.knowledgedDownload(item.id).subscribe(
(data) => {
this.commonSer.downloadFile(item.name, data);
}
);
}
//下载
download(item) {
this.workSer.knowledgedDownload(item.id).subscribe(
(data) => {
this.commonSer.downloadFile(item.name, data);
}
);
}
//删除
deleteFile(item) {
this.commonSer.confirmThing('删除', '确认删除?', () => {
const data = {
ids: [item.id],
};
this.workSer.knowledgedDelete(data).subscribe(
(res) => {
this.message.success('删除成功!');
this.getList();
}
);
});
}
//预览
preview(item) {
this.commonSer.previewFile(item.view);
}
}
......@@ -72,6 +72,7 @@ export class JhiMainComponent implements OnInit {
const sub = this.appSer.theme.subscribe(value=>{
this.theme = value;
console.log(this.theme);
})
}
......
......@@ -2,7 +2,6 @@
<div nz-row>
<div nz-col class="handle" [nzSpan]="12">
<a class="main-color margin-right-10" routerLink="../main/home">首页</a>
<a class="main-color margin-left-10" (click)="goOut()">机房监控系统</a>
</div>
<div nz-col [nzSpan]="12" class="text-right">
<nz-select style="width: 150px;margin-right: 20px" [(ngModel)]="theme" (ngModelChange)="changeTheme()">
......
<div class="logo">
<div class="text-center">
<img class="margin-bottom-10" style="height: 35px;" src="../../../content/images/logo_gaocun.png" alt="高淳监狱智能运维管理系统">
</div>
{{systemName}}
</div>
......
......@@ -253,16 +253,12 @@ export class CommonService implements OnInit {
* 文件预览
*/
previewFile(fileUrl) {
// this.workSer.getPreview().subscribe(
// (res)=>{
//
// }
// )
console.log(window.location.host + '/zabbixBox');
const previeUrl1 = "http://10.10.38.99:8282"+fileUrl;
// const previeUrl = "http://10.10.38.99:8282/file/knowledge/zyh.jpg";
window.open('http://10.10.38.99:8012/onlinePreview?url=' + encodeURIComponent(previeUrl1) );
// window.open('http://10.10.38.99:8012/onlinePreview?url=' + encodeURIComponent(previeUrl) );
// window.open(window.location.host + '/zabbixBox' + fileUrl);
this.workSer.getPreview().subscribe(
(res)=>{
console.log(res.fileUrl + "?url=" + res.url + fileUrl );
const previewUrl = res.fileUrl + "?url=" + encodeURIComponent(res.url + fileUrl);
window.open(previewUrl);
}
);
}
}
......@@ -164,6 +164,11 @@ export class WorkService {
return this.http.get(SERVER_API_URL + '/knowledge/download/' + params,{responseType: 'blob'});
}
//删除文件
knowledgedDelete(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/knowledge/deleteKnowledge', data);
}
//根据资产类型id查询资产
selectByPrimaryKey(params): Observable<any> {
return this.http.get(SERVER_API_URL + '/inventory/selectByPrimaryKey/' + params);
......
{
"url": "http://10.10.38.99:8012/onlinePreview"
"url": "http://10.10.38.99:8282",
"fileUrl": "http://10.10.38.99:8012/onlinePreview"
}
{
"main": {
"name": "高淳监狱智能运维管理系统"
"name": "View 智能眼 2.0"
},
"gaochun": {
"name": "高淳监狱智能运维管理系统"
......
......@@ -4,7 +4,7 @@
<base href="./"/>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>高淳监狱智能运维管理系统</title>
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#000000">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment