Commit dc43c91c authored by wangqinghua's avatar wangqinghua

update

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