Commit 32771dbe authored by wangqinghua's avatar wangqinghua

update

parents 43458f66 dc43c91c
import { Component } from '@angular/core';
import { Router } from "@angular/router";
import {LocalStorageService} from 'ngx-webstorage';
import {OverAllService} from './overAll/overAll.service';
import {Title} from '@angular/platform-browser';
@Component({
selector: 'app-root',
......@@ -8,12 +9,18 @@ import {LocalStorageService} from 'ngx-webstorage';
})
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);
}
)
}
}
<div nz-row class="breadcrumbs">
<div nz-col nzSpan="16">
<nz-breadcrumb class="padding-8-0">
<nz-breadcrumb-item>
首页
</nz-breadcrumb-item>
<nz-breadcrumb-item>
<a>知识库</a>
</nz-breadcrumb-item>
<nz-breadcrumb-item>
常见问题
</nz-breadcrumb-item>
</nz-breadcrumb>
</div>
<div nz-col nzSpan="8" class="text-right">
<button (click)="ngOnInit()" nz-button nzType="primary"><i class="anticon anticon-sync"></i></button>
<smart-full-screen></smart-full-screen>
</div>
</div>
<div nz-row class="search-form">
<div nz-col nzSpan="16">
<button (click)="importFile()" nz-button nzType="default">导入文件</button>
</div>
<div nz-col nzSpan="8" class="text-right">
</div>
</div>
<nz-table #basicTable [nzData]="dataSet" [nzLoading]="loading" [nzShowPagination]="false"
[nzTotal]="totalNum" [nzPageIndex]="pageNum" [nzPageSize]="pageCount"
(nzPageIndexChange)="change($event)">
<thead>
<tr>
<th nzWidth="80%">文件名称</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<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>
</nz-table>
<!--导入文件-->
<smart-upload #smartUpload (done)="getList()"></smart-upload>
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',
templateUrl: './common-problem.component.html',
styles: []
})
//空数据会导致无限请求数据
export class CommonProblemComponent implements OnInit {
@ViewChild('smartUpload') smartUpload: UploadComponent;
dataSet = [];
pageNum = 1;
pageCount = pageSize;
totalNum;
loading = false;
constructor(private workSer: WorkService, private message: NzMessageService,
private commonSer: CommonService) {
}
ngOnInit() {
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: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;
}
);
}
//导入
importFile() {
this.smartUpload.showModal('上传常见问题文件');
}
//下载
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);
}
}
<div nz-row class="breadcrumbs">
<div nz-col nzSpan="16">
<nz-breadcrumb class="padding-8-0">
<nz-breadcrumb-item>
首页
</nz-breadcrumb-item>
<nz-breadcrumb-item>
<a>知识库</a>
</nz-breadcrumb-item>
<nz-breadcrumb-item>
信息技术
</nz-breadcrumb-item>
</nz-breadcrumb>
</div>
<div nz-col nzSpan="8" class="text-right">
<button (click)="ngOnInit()" nz-button nzType="primary"><i class="anticon anticon-sync"></i></button>
<smart-full-screen></smart-full-screen>
</div>
</div>
<div nz-row class="search-form">
<div nz-col nzSpan="16">
<button (click)="importFile()" nz-button nzType="default">导入文件</button>
</div>
<div nz-col nzSpan="8" class="text-right">
</div>
</div>
<nz-table #basicTable [nzData]="dataSet" [nzLoading]="loading" [nzShowPagination]="true"
[nzTotal]="totalNum" [nzPageIndex]="pageNum" [nzPageSize]="pageCount"
(nzPageIndexChange)="change($event)">
<thead>
<tr>
<th nzWidth="80%">文件名称</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<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>
</nz-table>
<!--导入文件-->
<smart-upload #smartUpload (done)="getDone()"></smart-upload>
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: []
})
export class InformationTechComponent implements OnInit {
@ViewChild('smartUpload') smartUpload: UploadComponent;
dataSet = [];
pageNum = 1;
pageCount = pageSize;
totalNum;
loading = false;
constructor(private workSer: WorkService, private message: NzMessageService,
private commonSer: CommonService) {
}
ngOnInit() {
this.getList();
}
change($event) {
if($event > 0){
this.pageNum = $event;
this.getList();
}
}
getDone() {
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);
}
);
}
//删除
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);
}
}
<div nz-row class="breadcrumbs">
<div nz-col nzSpan="16">
<nz-breadcrumb class="padding-8-0">
<nz-breadcrumb-item>
首页
</nz-breadcrumb-item>
<nz-breadcrumb-item>
<a>知识库</a>
</nz-breadcrumb-item>
<nz-breadcrumb-item>
管理制度
</nz-breadcrumb-item>
</nz-breadcrumb>
</div>
<div nz-col nzSpan="8" class="text-right">
<button (click)="ngOnInit()" nz-button nzType="primary"><i class="anticon anticon-sync"></i></button>
<smart-full-screen></smart-full-screen>
</div>
</div>
<div nz-row class="search-form">
<div nz-col nzSpan="16">
<button (click)="importFile()" nz-button nzType="default">导入文件</button>
</div>
<div nz-col nzSpan="8" class="text-right">
</div>
</div>
<nz-table #basicTable [nzData]="dataSet" [nzLoading]="loading" [nzShowPagination]="true"
[nzTotal]="totalNum" [nzPageIndex]="pageNum" [nzPageSize]="pageCount"
(nzPageIndexChange)="change($event)">
<thead>
<tr>
<th nzWidth="80%">文件名称</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<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>
</nz-table>
<!--导入文件-->
<smart-upload #smartUpload (done)="getList()"></smart-upload>
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',
templateUrl: './management-system.component.html',
styles: []
})
export class ManagementSystemComponent implements OnInit {
@ViewChild('smartUpload') smartUpload: UploadComponent;
dataSet = [];
pageNum = 1;
pageCount = pageSize;
totalNum;
loading = false;
constructor(private workSer: WorkService, private message: NzMessageService,
private commonSer: CommonService) {
}
ngOnInit() {
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;
}
} 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);
}
);
}
//删除
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);
})
}
......
<div class="logo">
<!-- <div class="text-center">-->
<!-- <img class="margin-bottom-10" style="height: 35px;" src="../../../content/images/logo_gaocun.png" alt="高淳监狱智能运维管理系统">-->
<!-- </div>-->
<div class="text-center">
</div>
{{systemName}}
</div>
<ul nz-menu [nzMode]="'inline'">
......
......@@ -2,9 +2,13 @@ import {Injectable, OnInit} from '@angular/core';
import {NzMessageService, NzModalService} from 'ng-zorro-antd';
import {SERVER_API_URL, SERVER_API_URL_COMS} from '../../app.constants';
import {DatePipe} from '@angular/common';
import {WorkService} from '../../work/work.service';
declare var ActiveXObject: ActiveXObject;
interface ActiveXObject {
new (type: string): ActiveXObject;
new(type: string): ActiveXObject;
SendKeys(key: string): void;
}
......@@ -12,7 +16,7 @@ interface ActiveXObject {
export class CommonService implements OnInit {
constructor(private modalSer: NzModalService, private datePipe: DatePipe,
private message: NzMessageService) {
private message: NzMessageService,private workSer:WorkService) {
// 定义发射事件
}
......@@ -107,7 +111,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),
......@@ -144,11 +147,11 @@ export class CommonService implements OnInit {
ieEDGE = navigator.userAgent.match(/Edge/g),
ieVer = (ie ? ie[1] : (ie11 ? 11 : (ieEDGE ? 12 : -1)));
if (ieVer > -1) {
if(typeof (<any>window).ActiveXObject !== "undefined") {
if (typeof (<any>window).ActiveXObject !== 'undefined') {
//这的方法 模拟f11键,使浏览器全屏
const wscript = new ActiveXObject("WScript.Shell");
if(wscript != null) {
wscript.SendKeys("{F11}");
const wscript = new ActiveXObject('WScript.Shell');
if (wscript != null) {
wscript.SendKeys('{F11}');
}
}
}
......@@ -226,4 +229,36 @@ export class CommonService implements OnInit {
}
return obj;
}
//内存单位换算
unitConversion(unit) {
let res;
let Gbps = 1000 * 1000 * 1000;
let Mbps = 1000 * 1000;
let kbps = 1000;
let size = Math.abs(unit);
if (size / Gbps > 1) {
res += (size / Gbps).toFixed(2) + 'Gbps';
} else if (size / Mbps > 1) {
res += (size / Mbps).toFixed(2) + 'Mbps';
} else if (size / kbps > 1) {
res += (size / kbps).toFixed(2) + 'kbps';
} else {
res += (size) + 'bps';
}
return res;
}
/**
* 文件预览
*/
previewFile(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);
}
);
}
}
......@@ -149,6 +149,11 @@ export class WorkService {
return this.http.post(SERVER_API_URL + '/inventory/import' ,data);
}
//删除文件
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);
......@@ -230,4 +235,9 @@ export class WorkService {
getExportUrl(data): Observable<any>{
return this.http.post( SERVER_API_URL + "/inventory/getExportUrl" ,data);
}
//查询系统信息
getPreview(): Observable<any> {
return this.http.get('./json/preview.json');
}
}
{
"url": "http://10.10.38.99:8282",
"fileUrl": "http://10.10.38.99:8012/onlinePreview"
}
......@@ -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