Commit b4d98539 authored by wangqinghua's avatar wangqinghua

update

parent cde072ae
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'smart-select-person',
templateUrl: './select-person.component.html',
styles: []
})
export class SelectPersonComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
...@@ -2,124 +2,126 @@ import {Component, EventEmitter, OnInit, Output} from '@angular/core'; ...@@ -2,124 +2,126 @@ import {Component, EventEmitter, OnInit, Output} from '@angular/core';
import {NzMessageService, UploadFile} from 'ng-zorro-antd'; import {NzMessageService, UploadFile} from 'ng-zorro-antd';
import {TopologyService} from '../../topology.service'; import {TopologyService} from '../../topology.service';
import {FormBuilder, FormGroup, Validator, Validators} from '@angular/forms'; import {FormBuilder, FormGroup, Validator, Validators} from '@angular/forms';
import { filter } from 'rxjs/operators'; import {filter} from 'rxjs/operators';
@Component({ @Component({
selector: 'smart-icon', selector: 'smart-icon',
templateUrl: './icon.component.html', templateUrl: './icon.component.html',
styles: [] styles: []
}) })
export class IconComponent implements OnInit { export class IconComponent implements OnInit {
@Output() done = new EventEmitter<any>(); @Output() done = new EventEmitter<any>();
isVisible = false; isVisible = false;
fileList: UploadFile[] = []; fileList: UploadFile[] = [];
validateForm:FormGroup; validateForm: FormGroup;
title = "添加图标"; title = '添加图标';
options:any; options: any;
childrenList = []; childrenList = [];
constructor(private topologySer:TopologyService,private message:NzMessageService,
private fb:FormBuilder) { } constructor(private topologySer: TopologyService, private message: NzMessageService,
private fb: FormBuilder) {
}
values; values;
ngOnInit() { ngOnInit() {
this.initForm(); this.initForm();
this.getList(); this.getList();
} }
initForm(){ initForm() {
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
firstTypeId:[null,[Validators.required]] , firstTypeId: [null, [Validators.required]],
secondTypeId:[null], secondTypeId: [null],
iconType:['0'], iconType: ['0'],
defaultIcon:["0"], defaultIcon: ['0'],
name:[""], name: [''],
}); });
this.fileList = []; this.fileList = [];
} }
getList(){ getList() {
this.topologySer.findTreeWithWeb().subscribe( this.topologySer.findTreeWithWeb().subscribe(
(res)=>{ (res) => {
if(res.errCode == 10000){ if (res.errCode == 10000) {
this.options = res.data; this.options = res.data;
}else{ } else {
this.message.error(res.errMSg); this.message.error(res.errMSg);
} }
} }
) );
} }
beforeUpload = (file: UploadFile): boolean => { beforeUpload = (file: UploadFile): boolean => {
const isLt2M = file.size / 1024 < 300; const isLt2M = file.size / 1024 < 300;
if (!isLt2M) { if (!isLt2M) {
this.message.error('图标必须小于300kb!'); this.message.error('图标必须小于300kb!');
}else{ } else {
this.fileList.push(file); this.fileList.push(file);
} }
return false; return false;
}; };
showModal(){ showModal() {
this.isVisible = true; this.isVisible = true;
} }
handleOk(){ handleOk() {
if(this.fileList.length == 0){ if (this.fileList.length == 0) {
this.message.error("请选择图标"); this.message.error('请选择图标');
return false; return false;
} }
for(let i in this.validateForm.controls){ for (let i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty(); this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity(); this.validateForm.controls[i].updateValueAndValidity();
} }
if(this.validateForm.invalid){ if (this.validateForm.invalid) {
return false; return false;
} }
const formData = new FormData(); const formData = new FormData();
this.fileList.forEach((file: any) => { this.fileList.forEach((file: any) => {
formData.append('file', file); formData.append('file', file);
}); });
formData.append('iconType',this.validateForm.value.iconType); formData.append('iconType', this.validateForm.value.iconType);
formData.append('defaultIcon',this.validateForm.value.defaultIcon); formData.append('defaultIcon', this.validateForm.value.defaultIcon);
formData.append('firstTypeId',this.validateForm.value.firstTypeId); formData.append('firstTypeId', this.validateForm.value.firstTypeId);
formData.append('secondTypeId',this.validateForm.value.secondTypeId); formData.append('secondTypeId', this.validateForm.value.secondTypeId);
formData.append('name',this.validateForm.value.name); formData.append('name', this.validateForm.value.name);
console.log(this.validateForm.value) console.log(this.validateForm.value);
this.topologySer.iconUpload(formData).subscribe( this.topologySer.iconUpload(formData).subscribe(
(res)=>{ (res) => {
if(res.errCode == 10000){ if (res.errCode == 10000) {
this.message.success("添加成功"); this.message.success('添加成功');
this.isVisible = false; this.isVisible = false;
this.initForm(); this.initForm();
this.done.emit(); this.done.emit();
}else{ } else {
this.message.error(res.errMsg); this.message.error(res.errMsg);
} }
} }
) );
} }
onChanges(e){ onChanges(e) {
this.childrenList = []; this.childrenList = [];
console.log(e); console.log(e);
if(!isNaN(e)){ if (!isNaN(e)) {
console.log('网站监测'); console.log('网站监测');
this.validateForm.get('secondTypeId').clearValidators(); this.validateForm.get('secondTypeId').clearValidators();
this.validateForm.value.iconType = '1'; this.validateForm.value.iconType = '1';
}else{ } else {
this.validateForm.get('secondTypeId').setValidators(Validators.required); this.validateForm.get('secondTypeId').setValidators(Validators.required);
console.log('主机资源'); console.log('主机资源');
} }
this.options.forEach(res=>{ this.options.forEach(res => {
if(res.id == e){ if (res.id == e) {
this.childrenList = res.childs; this.childrenList = res.childs;
} }
}) });
} }
handleCancel(){ handleCancel() {
this.isVisible = false; this.isVisible = false;
} }
......
...@@ -28,8 +28,9 @@ ...@@ -28,8 +28,9 @@
</div> </div>
<div nz-col nzSpan="3"> <div nz-col nzSpan="3">
<nz-select style="width: 100%;" [(ngModel)]="obj.typeId" nzPlaceHolder="计划类型"> <nz-select style="width: 100%;" [(ngModel)]="obj.typeId" nzPlaceHolder="计划类型">
<nz-option nzLabel="待处理" nzValue="0"></nz-option> <ng-container *ngFor="let item of planTypeList">
<nz-option nzLabel="已结束" nzValue="1"></nz-option> <nz-option [nzValue]="item.id" [nzLabel]="item.name"></nz-option>
</ng-container>
</nz-select> </nz-select>
</div> </div>
<div nz-col nzSpan="8"> <div nz-col nzSpan="8">
...@@ -38,7 +39,7 @@ ...@@ -38,7 +39,7 @@
</nz-input-group> </nz-input-group>
</div> </div>
<div nz-col nzSpan="3"> <div nz-col nzSpan="3">
<button nz-button nzType="default"><i class="anticon anticon-plus"></i>新增计划</button> <button (click)="addPlan()" nz-button nzType="default"><i class="anticon anticon-plus"></i>新增计划</button>
</div> </div>
</div> </div>
...@@ -75,9 +76,13 @@ ...@@ -75,9 +76,13 @@
<span *ngIf="data.status == 2">已结束</span> <span *ngIf="data.status == 2">已结束</span>
</td> </td>
<td class="handle text-center"> <td class="handle text-center">
<span (click)="showEditModal(data)">查看</span> <span (click)="lookPlan(data.id)">查看</span>
<span (click)="deleteSend(data)">删除</span> <span (click)="editPlan(data.id)">编辑</span>
<span (click)="deletePlan(data)">删除</span>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</nz-table> </nz-table>
\ No newline at end of file
<smart-plan-modal #smartPlanMoadl ></smart-plan-modal>
<smart-look-plan #smartLookPlan></smart-look-plan>
\ No newline at end of file
import { Component, OnInit } from '@angular/core'; import {Component, OnInit, ViewChild} from '@angular/core';
import {WorkService} from '../work.service'; import {WorkService} from '../work.service';
import {pageSize} from '../../app.constants'; import {pageSize} from '../../app.constants';
import {NzMessageService} from 'ng-zorro-antd'; import {NzMessageService, NzModalService} from 'ng-zorro-antd';
import {PlanModalComponent} from '../modal/plan-modal/plan-modal.component';
import {LookPlanComponent} from '../modal/look-plan/look-plan.component';
@Component({ @Component({
selector: 'smart-inspect-plan', selector: 'smart-inspect-plan',
templateUrl: './inspect-plan.component.html', templateUrl: './inspect-plan.component.html',
styles: [] styles: []
}) })
export class InspectPlanComponent implements OnInit { export class InspectPlanComponent implements OnInit {
@ViewChild('smartPlanMoadl') smartPlanMoadl: PlanModalComponent;
@ViewChild('smartLookPlan') smartLookPlan: LookPlanComponent;
timeFormat = 'yyyy-MM-dd'; timeFormat = 'yyyy-MM-dd';
planList; planList;
planTypeList;
timeBegin; timeBegin;
timeEnd; timeEnd;
pageCount = pageSize; pageCount = pageSize;
...@@ -19,41 +24,102 @@ export class InspectPlanComponent implements OnInit { ...@@ -19,41 +24,102 @@ export class InspectPlanComponent implements OnInit {
totalNum; totalNum;
obj = { obj = {
pageNum:'', pageNum: '',
pageCount:'', pageCount: '',
searchStr:"", searchStr: '',
typeId:null, typeId: null,
status:null, status: null,
}; };
constructor(private workSer:WorkService,private message:NzMessageService) { }
constructor(private workSer: WorkService, private message: NzMessageService,
private modalSer: NzModalService) {
}
ngOnInit() { ngOnInit() {
this.getList(); this.getList();
this.getPlanType();
}
//获取计划分类
getPlanType() {
const data = {
type: 1
};
this.workSer.findByType(data).subscribe(
(res) => {
if (res.errCode == 10000) {
this.planTypeList = res.data;
}
}
);
} }
getList(){ getList() {
const obj = { const obj = {
pageNum:this.pageNum, pageNum: this.pageNum,
pageCount:this.pageCount, pageCount: this.pageCount,
searchStr:this.obj.searchStr, searchStr: this.obj.searchStr,
typeId:this.obj.typeId, typeId: this.obj.typeId,
status:this.obj.status, status: this.obj.status,
}; };
this.workSer.findPlanList(obj).subscribe( this.workSer.findPlanList(obj).subscribe(
(res)=>{ (res) => {
if(res.errCode == 10000){ if (res.errCode == 10000) {
this.planList = res.data.data; this.planList = res.data.data;
this.totalNum = res.data.totalNum; this.totalNum = res.data.totalNum;
}else{ } else {
this.message.error(res.errMsg); this.message.error(res.errMsg);
} }
} }
) );
} }
change(e){ change(e) {
this.pageNum = e; this.pageNum = e;
this.getList(); this.getList();
} }
//新增计划
addPlan() {
this.smartPlanMoadl.showAddModal();
}
//编辑计划
editPlan(id) {
this.smartPlanMoadl.showEditModal(id);
}
//查看计划
lookPlan(id){
this.smartLookPlan.showModal(id);
}
//删除计划
deletePlan(data) {
this.modalSer.confirm({
nzTitle: '删除',
nzContent: '<b style="color: red;">确认删除该计划吗?</b>',
nzOkText: '确定',
nzOkType: 'danger',
nzOnOk: () => {
const arr = {
ids: []
};
arr.ids.push(data.id);
this.workSer.deletePlan(arr).subscribe(
(res) => {
if (res.errCode == 10000) {
this.message.success('删除成功');
this.getList();
} else {
this.message.error(res.errMsg);
}
}
);
},
nzCancelText: '取消',
nzOnCancel: () => console.log('Cancel')
}
);
}
} }
<!--添加资源-->
<nz-modal [nzWidth]="1080" [(nzVisible)]="isVisiable" [nzTitle]="title" (nzOnCancel)="handleEditCancel()" (nzOnOk)="handEditleOk()">
<form nz-form [formGroup]="validateForm">
<div nz-form class="ant-advanced-search-form form-select">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="12">
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired nzFor="title">计划类型</nz-form-label>
<nz-form-control [nzSpan]="14">
{{plan.title}}
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="12">
<nz-form-item nzFlex>
<nz-form-label [nzSpan]="6" nzFor="typeId">计划工作量</nz-form-label>
<nz-form-control [nzSpan]="14">
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="12">
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired nzFor="secondLevelType">
开始日期
</nz-form-label>
<nz-form-control [nzSpan]="14">
{{plan.startTime}}
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="12">
<nz-form-item nzFlex>
<nz-form-label [nzSpan]="6" nzFor="serialnoA">终止日期</nz-form-label>
<nz-form-control [nzSpan]="14">
{{plan.endTime}}
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="12">
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired nzFor="secondLevelType">
循环周期
</nz-form-label>
<nz-form-control [nzSpan]="7">
{{plan.cycleType}}
</nz-form-control>
<nz-form-control [nzSpan]="6">
{{plan.cycleNum}}
</nz-form-control>
<nz-form-control [nzSpan]="6">
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="12">
<nz-form-item nzFlex>
<nz-form-label [nzSpan]="6" nzFor="serialnoA">巡检人数</nz-form-label>
<nz-form-control [nzSpan]="14">
{{plan.number}}
</nz-form-control>
</nz-form-item>
</div>
</div>
<nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired nzFor="serviceid">参与人</nz-form-label>
<nz-form-control [nzSpan]="14">
<span *ngFor="let item of plan.participants">{{item.username}}</span>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired nzFor="serviceid">负责人</nz-form-label>
<nz-form-control [nzSpan]="14">
<span *ngFor="let item of plan.principals">{{item.username}}</span>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired nzFor="description">计划描述</nz-form-label>
<nz-form-control [nzSpan]="14">
{{plan.description}}
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="7" nzRequired nzFor="group">附件</nz-form-label>
<nz-form-control [nzSpan]="12">
<button nz-button>
<i class="anticon anticon-upload"></i><span>下载</span>
</button>
</nz-form-control>
</nz-form-item>
</div>
</form>
</nz-modal>
import { Component, OnInit } from '@angular/core';
import {WorkService} from '../../work.service';
@Component({
selector: 'smart-look-plan',
templateUrl: './look-plan.component.html',
styles: []
})
export class LookPlanComponent implements OnInit {
isVisible = false;
title;
plan;
constructor(private workSer:WorkService) { }
ngOnInit() {
}
showModal(id){
this.workSer.findPlan(id).subscribe(
(res)=>{
if(res.errCode == 10000){
this.plan = res.data;
}
}
)
}
}
<!--添加资源-->
<nz-modal [nzWidth]="1080" [(nzVisible)]="isVisiable" [nzTitle]="title" (nzOnCancel)="handleEditCancel()" (nzOnOk)="handEditleOk()">
<form nz-form [formGroup]="validateForm">
<div nz-form class="ant-advanced-search-form form-select">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="12">
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired nzFor="title">计划标题</nz-form-label>
<nz-form-control [nzSpan]="14">
<input id="title" name="title" nz-input placeholder="计划标题" formControlName="title">
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="12">
<nz-form-item nzFlex>
<nz-form-label [nzSpan]="6" nzFor="typeId">计划类型</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select id="typeId" name="typeId" nzPlaceHolder="计划类型" formControlName="typeId">
<ng-container *ngFor="let item of planList">
<nz-option [nzValue]="item.id" [nzLabel]="item.name"></nz-option>
</ng-container>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="12">
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired nzFor="secondLevelType">
开始日期
</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-date-picker
nzShowTime
formControlName="startTime"
nzPlaceHolder="开始时间"
></nz-date-picker>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="12">
<nz-form-item nzFlex>
<nz-form-label [nzSpan]="6" nzFor="serialnoA">终止日期</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-date-picker
nzShowTime
nzFormat="yyyy-MM-dd HH:mm:ss"
formControlName="endTime"
nzPlaceHolder="结束时间"
></nz-date-picker>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="12">
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired nzFor="secondLevelType">
循环周期
</nz-form-label>
<nz-form-control [nzSpan]="7">
<nz-select name="cycleType" name="cycleType" nzPlaceHolder="巡检人数" formControlName="cycleType">
<nz-option nzValue="0" nzLabel="每天"></nz-option>
<nz-option nzValue="1" nzLabel="工作日"></nz-option>
<nz-option nzValue="2" nzLabel="每周"></nz-option>
<nz-option nzValue="3" nzLabel="每月"></nz-option>
<nz-option nzValue="4" nzLabel="每季度"></nz-option>
<nz-option nzValue="5" nzLabel="每半年"></nz-option>
<nz-option nzValue="6" nzLabel="无"></nz-option>
</nz-select>
</nz-form-control>
<nz-form-control [nzSpan]="6">
<nz-select name="cycleType" name="cycleType" formControlName="cycleType">
<nz-option nzValue="1" nzLabel="1"></nz-option>
<nz-option nzValue="2" nzLabel="2"></nz-option>
<nz-option nzValue="3" nzLabel="3"></nz-option>
<nz-option nzValue="4" nzLabel="4"></nz-option>
<nz-option nzValue="5" nzLabel="5"></nz-option>
</nz-select>
</nz-form-control>
<nz-form-control [nzSpan]="6">
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="12">
<nz-form-item nzFlex>
<nz-form-label [nzSpan]="6" nzFor="serialnoA">巡检人数</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select name="test3" name="test3" nzPlaceHolder="巡检人数" formControlName="number">
<nz-option nzValue="1" nzLabel="1"></nz-option>
<nz-option nzValue="2" nzLabel="2"></nz-option>
<nz-option nzValue="3" nzLabel="3"></nz-option>
<nz-option nzValue="4" nzLabel="4"></nz-option>
<nz-option nzValue="5" nzLabel="5"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
</div>
<nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired nzFor="serviceid">计划工作量</nz-form-label>
<nz-form-control [nzSpan]="14">
<input id="host4" type="text" nz-input name="host1" [(ngModel)]="validateForm.r_longdata" >
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired nzFor="serviceid">参与人</nz-form-label>
<nz-form-control [nzSpan]="14">
<label nz-checkbox></label>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired nzFor="serviceid">负责人</nz-form-label>
<nz-form-control [nzSpan]="14">
<label nz-checkbox></label>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired nzFor="description">计划描述</nz-form-label>
<nz-form-control [nzSpan]="14">
<textarea nz-input id="description" name="description" formControlName="description" placeholder="发送信息" [nzAutosize]="{ minRows: 2, maxRows: 6 }"></textarea>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="7" nzRequired nzFor="group">附件</nz-form-label>
<nz-form-control [nzSpan]="12">
<nz-upload
[nzBeforeUpload]="beforeUpload"
[(nzFileList)]="fileList">
<button nz-button>
<i class="anticon anticon-upload"></i><span>上传</span>
</button>
</nz-upload>
</nz-form-control>
</nz-form-item>
</div>
</form>
</nz-modal>
import {Component, OnInit} from '@angular/core';
import {FormBuilder, FormGroup} from '@angular/forms';
import {WorkService} from '../../work.service';
import {NzMessageService, UploadFile} from 'ng-zorro-antd';
@Component({
selector: 'smart-plan-modal',
templateUrl: './plan-modal.component.html',
styles: []
})
export class PlanModalComponent implements OnInit {
planList;
planId;
title;
isVisiable = false;
validateForm: FormGroup;
fileList: UploadFile[] = [];
constructor(private workSer: WorkService, private message: NzMessageService,
private fb: FormBuilder) {
}
ngOnInit() {
this.initForm();
this.getPlanType();
}
initForm() {
this.validateForm = this.fb.group({
title: [null],
typeId: [null],
startTime: [null],
endTime: [null],
cycleType: [null],
cycleNum: [null],
number: [null],
workload: [null],
description: [null],
});
}
getPlanType(){
const data = {
type:1
};
this.workSer.findByType(data).subscribe(
(res)=>{
if(res.errCode == 10000){
this.planList = res.data;
}
}
)
}
beforeUpload = (file: UploadFile): boolean => {
const isLt5M = file.size / 1024 < 5000;
if (!isLt5M) {
this.message.error(' 文件必须小于5M!');
} else {
this.fileList.push(file);
}
return false;
};
showAddModal() {
this.title = '添加计划';
}
showEditModal(id) {
this.title = '编辑计划';
this.planId = id;
}
handEditleOk() {
for (let i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
}
if (this.validateForm.invalid) {
return false;
}
if(this.title == '添加计划') {
this.create();
}
if(this.title = '编辑计划') {
this.update();
}
}
create() {
let formData = new FormData();
this.fileList.forEach((file: any) => {
formData.append('file', file);
});
formData.append('json', JSON.stringify(this.validateForm.value));
this.workSer.createPlan(formData).subscribe(
(res)=>{
if(res.errCode == 10000){
this.initForm();
this.isVisiable = false;
this.message.success("新增计划成功");
}else{
this.message.error(res.errMsg);
}
}
)
}
update(){
let formData = new FormData();
this.fileList.forEach((file: any) => {
formData.append('file', file);
});
formData.append('json', JSON.stringify(this.validateForm.value));
formData.append('id', this.planId);
this.workSer.createPlan(formData).subscribe(
(res)=>{
if(res.errCode == 10000){
this.message.success("修改计划成功");
this.initForm();
this.isVisiable = false;
}else{
this.message.error(res.errMsg);
}
}
)
}
handleEditCancel() {
this.isVisiable = false;
}
}
...@@ -88,4 +88,29 @@ export class WorkService { ...@@ -88,4 +88,29 @@ export class WorkService {
findByParentidCount(params): Observable<any>{ findByParentidCount(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/inventory/findByParentidCount/' +params); return this.http.get(SERVER_API_URL + '/inventory/findByParentidCount/' +params);
} }
//创建资产分类
createType(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/inventory/createType' ,data);
}
//根据主键id查询资产类型
findType(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/inventory/findType/' ,params);
}
//根据资产类型id 查询没有配置主机的资产
selectByInventoryTypeidAndHostidNull(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/inventory/selectByInventoryTypeidAndHostidNull/' ,params);
}
//设置资产匹配的主机
updateHostid(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/inventory/updateHostid' ,data);
}
//根据type查找
findByType(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/syseventType/findByType' ,data);
}
} }
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