Commit 808838e6 authored by wangqinghua's avatar wangqinghua

update

parent 03e756cc
......@@ -15,15 +15,3 @@ export const color = {
gray:'#bfbfbf',
black:'#6064'
};
// //图片地址
// export const serverPath = "http://10.10.38.99:8282";
// export const imgUrl = serverPath + "/file/icon/";
// export const fileUrl = serverPath + "/file/";
//图片地址
const urlPath = window.document.location.href; //浏览器显示地址
const docPath = window.document.location.pathname; //文件在服务器相对地址
const index = urlPath.indexOf(docPath);
const serverPath = urlPath.substring(0, index);//服务器地址
export const imgUrl = serverPath + "/file/icon/";
export const fileUrl = serverPath + "/file/";
......@@ -34,7 +34,7 @@
<tr *ngFor="let data of iconList">
<td>{{data.firstTypeName}}</td>
<td>
<img style="width: 40px;" [src]="imgUrl + data.url">
<img style="width: 40px;" [src]="data.url">
</td>
<td class="handle main-color">
<span (click)="editIcon(data)">更换图标</span>
......
......@@ -2,7 +2,7 @@ import {Component, OnInit, ViewChild} from '@angular/core';
import {TopologyService} from '../topology.service';
import {NzMessageService, NzModalService, NzMode} from 'ng-zorro-antd';
import {IconComponent} from '../model/icon/icon.component';
import {imgUrl, pageSize} from '../../app.constants';
import { pageSize} from '../../app.constants';
@Component({
selector: 'smart-topology-img',
......@@ -12,7 +12,6 @@ import {imgUrl, pageSize} from '../../app.constants';
export class TopologyImgComponent implements OnInit {
@ViewChild('smartIcon') smartIcon:IconComponent;
imgUrl = imgUrl;
iconList;
pageNum = 1;
......
......@@ -43,7 +43,7 @@
</div>
<div nz-col nzSpan="8" class="text-right">
<input style="width: 50%;" [(ngModel)]="obj.content" nz-input placeholder="操作内容">
<button (click)="getList()" nz-button nzType="default"><i class="anticon anticon-search"></i>搜索</button>
<button (click)="searchKey()" nz-button nzType="default"><i class="anticon anticon-search"></i>搜索</button>
</div>
</div>
<nz-table #basicTable [nzData]="dataSet" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageNumber" [nzPageSize]="pageSize" (nzPageIndexChange)="changePage($event)">
......
......@@ -69,6 +69,11 @@ export class AuditComponent implements OnInit {
);
}
searchKey(){
this.pageNumber = 1;
this.getList();
}
changePage(e){
this.pageNumber = e;
this.getList();
......
......@@ -4,8 +4,7 @@
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="roleName">角色名称</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nz-input id="roleName" formControlName="name">
<nz-form-explain *ngIf="validateForm.get('name').dirty && validateForm.get('name').errors">请填写角色名称!
</nz-form-explain>
<nz-form-explain *ngIf="validateForm.get('name').dirty && validateForm.get('name').errors">角色名称最多输入20个字符!</nz-form-explain>
</nz-form-control>
</nz-form-item>
<!--<nz-form-item>-->
......@@ -25,7 +24,7 @@
<nz-form-control [nzSm]="14" [nzXs]="24">
<textarea id="comment " row="4" nz-input formControlName="comment"></textarea>
<nz-form-explain *ngIf="validateForm.get('comment').dirty && validateForm.get('comment').errors">
请输入角色说明!
角色说明最多输入300个字符!
</nz-form-explain>
</nz-form-control>
</nz-form-item>
......@@ -53,5 +52,13 @@
</div>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24">模版权限</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<div class="tree-div" style="padding-left: 10px;">
<p *ngFor="let item of viewTempGroupList"><label nz-checkbox [(ngModel)]="item.checked" [ngModelOptions]="{standalone: true}">{{item.name}}</label></p>
</div>
</nz-form-control>
</nz-form-item>
</form>
</nz-modal>
......@@ -36,6 +36,9 @@ export class RoleComponent implements OnInit {
initGroupList = []; //分组权限
viewGroupList = []; //分组权限
initTempGroupList = []; //模版权限
viewTempGroupList = [];
initModuleList = []; //菜单权限
dataModuleList = []; //菜单数据
......@@ -47,14 +50,15 @@ export class RoleComponent implements OnInit {
this.ininForm();
this.getMenu();
this.getGroup();
this.getTempGroup();
}
ininForm() {
this.viewGroupList = [];
this.viewTempGroupList = [];
this.validateForm = this.fb.group({
name: [null, [Validators.required]],
// status: [null, [Validators.required]],
comment: [null, [Validators.required]],
name: [null, [Validators.required,Validators.maxLength(20)]],
comment: [null, [Validators.required,Validators.maxLength(300)]],
});
}
......@@ -69,9 +73,9 @@ export class RoleComponent implements OnInit {
);
}
//获取分组
//获取资源分组
getGroup() {
this.overAllSer.findGroup().subscribe(
this.overAllSer.getEditGroups(0).subscribe(
(res) => {
this.initGroupList = res.data;
this.viewGroupList = res.data;
......@@ -82,6 +86,19 @@ export class RoleComponent implements OnInit {
);
}
//获取模版分组
getTempGroup() {
this.overAllSer.getEditGroups(1).subscribe(
(res) => {
this.initTempGroupList = res.data;
this.viewTempGroupList = res.data;
this.viewTempGroupList.forEach(e => {
e.checked = false;
});
}
);
}
toNode(data) {
this.nodes = data.map(res => {
return new NzTreeNode(res);
......@@ -146,6 +163,23 @@ export class RoleComponent implements OnInit {
}
return data;
});
//模版分组回显
this.viewTempGroupList = this.initTempGroupList.map(e => {
const data = {
groupid: e.groupid,
name: e.name,
checked: false,
};
if (modulrArr.indexOf(e.groupid) > -1) {
data.checked = true;
}
return data;
});
}else{
this.viewGroupList = this.initGroupList;
this.viewTempGroupList = this.initTempGroupList;
}
this.dataModuleList = data.modules;
......@@ -169,7 +203,6 @@ export class RoleComponent implements OnInit {
this.toNode(list);
}
);
}
}
......@@ -199,6 +232,15 @@ export class RoleComponent implements OnInit {
resourceArr.push(data);
}
});
this.viewTempGroupList.forEach(e => {
if (e.checked) {
const data = {
groupId: e.groupid,
groupName: e.name
};
resourceArr.push(data);
}
});
if (this.title == '新增角色') {
this.create(resourceArr);
......
......@@ -4,10 +4,10 @@
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="12">
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired nzFor="name">资产名称
</nz-form-label>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired nzFor="name">资产名称</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="资产名称" name="name" formControlName="name">
<nz-form-explain *ngIf="validateForm.get('name').dirty && validateForm.get('name').errors">资产名称最多输入20字符</nz-form-explain>
</nz-form-control>
</nz-form-item>
</div>
......@@ -16,8 +16,7 @@
<nz-form-item nzFlex>
<nz-form-label [nzSpan]="6">负责人</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="负责人" name="person"
formControlName="person">
<input nz-input placeholder="负责人" name="person" formControlName="person">
</nz-form-control>
</nz-form-item>
</div>
......@@ -26,8 +25,7 @@
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="12">
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6">父分类
</nz-form-label>
<nz-form-label [nzOffset]="4" [nzSpan]="6">父分类</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select name="secondLevelType" nzPlaceHolder="选择父分类" [ngModelOptions]="{standalone: true}" [(ngModel)]="parentId" (ngModelChange)="getTypeByParent($event)">
<ng-container *ngFor="let item of parentTypeList">
......@@ -39,8 +37,7 @@
</div>
<div nz-col [nzSpan]="12">
<nz-form-item nzFlex>
<nz-form-label [nzSpan]="6" nzRequired>子分类
</nz-form-label>
<nz-form-label [nzSpan]="6" nzRequired>子分类</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select nzAllowClear name="secondLevelType" nzPlaceHolder="选择子分类" formControlName="inventoryTypeid">
<ng-container *ngFor="let item of typeList">
......@@ -55,11 +52,9 @@
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="12">
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzFor="secondLevelType">资产数量
</nz-form-label>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzFor="secondLevelType">资产数量</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="资产数量" name="inventorycount"
formControlName="inventorycount">
<input nz-input placeholder="资产数量" name="inventorycount" formControlName="inventorycount">
</nz-form-control>
</nz-form-item>
</div>
......@@ -68,8 +63,7 @@
<nz-form-item nzFlex>
<nz-form-label [nzSpan]="6" nzFor="invertoryname">品牌</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="品牌" name="invertoryname"
formControlName="invertoryname">
<input nz-input placeholder="品牌" name="invertoryname" formControlName="invertoryname">
</nz-form-control>
</nz-form-item>
</div>
......@@ -89,8 +83,7 @@
<nz-form-item nzFlex>
<nz-form-label [nzSpan]="6">型号</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="型号" name="serialnoA"
formControlName="serialnoA">
<input nz-input placeholder="型号" name="serialnoA" formControlName="serialnoA">
</nz-form-control>
</nz-form-item>
</div>
......@@ -101,8 +94,7 @@
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6">使用</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="使用" name="usedcount"
formControlName="usedcount">
<input nz-input placeholder="使用" name="usedcount" formControlName="usedcount">
</nz-form-control>
</nz-form-item>
</div>
......@@ -121,8 +113,7 @@
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6">借出</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="借出" name="lendcount"
formControlName="lendcount">
<input nz-input placeholder="借出" name="lendcount" formControlName="lendcount">
</nz-form-control>
</nz-form-item>
</div>
......@@ -131,8 +122,7 @@
<nz-form-item nzFlex>
<nz-form-label [nzSpan]="6">维保到期</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="维保到期" name="maintenanceExpiration"
formControlName="maintenanceExpiration">
<input nz-input placeholder="维保到期" name="maintenanceExpiration" formControlName="maintenanceExpiration">
</nz-form-control>
</nz-form-item>
</div>
......@@ -143,8 +133,7 @@
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6">维修</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="维修" name="repaircount"
formControlName="repaircount">
<input nz-input placeholder="维修" name="repaircount" formControlName="repaircount">
</nz-form-control>
</nz-form-item>
</div>
......@@ -153,8 +142,7 @@
<nz-form-item nzFlex>
<nz-form-label [nzSpan]="6">存放地点</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="存放地点" name="storageLocation"
formControlName="storageLocation">
<input nz-input placeholder="存放地点" name="storageLocation" formControlName="storageLocation">
</nz-form-control>
</nz-form-item>
</div>
......@@ -165,8 +153,7 @@
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6">报废</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="报废" name="scrapcount"
formControlName="scrapcount">
<input nz-input placeholder="报废" name="scrapcount" formControlName="scrapcount">
</nz-form-control>
</nz-form-item>
</div>
......
......@@ -34,7 +34,7 @@ export class AssetsComponent implements OnInit {
this.validateForm = this.fb.group({
serialnoA:[null],
invertoryname:[null],
name:[null,[Validators.required]],
name:[null,[Validators.required,Validators.maxLength(20)]],
hostid:[null],
person:[null],
ip:[null],
......
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';
import {WorkService} from '../../work.service';
import {fileUrl} from '../../../app.constants';
import {CommonService} from '../../../shared/common/common.service';
@Component({
selector: 'smart-look-plan',
templateUrl: './look-plan.component.html',
styles: []
selector: 'smart-look-plan',
templateUrl: './look-plan.component.html',
styles: []
})
export class LookPlanComponent implements OnInit {
isVisible = false;
title;
plan;
planId;
url = fileUrl + "/planFile/";
constructor(private workSer:WorkService,private commonSer:CommonService) { }
ngOnInit() {
}
showModal(id,name){
this.planId = id;
this.title = "计划:"+name;
this.isVisible = true;
this.workSer.findPlan(id).subscribe(
(res)=>{
if(res.errCode == 10000){
this.plan = res.data;
}
}
)
}
handleEditCancel(){
this.isVisible = false;
isVisible = false;
title;
plan;
planId;
constructor(private workSer: WorkService, private commonSer: CommonService) {
}
ngOnInit() {
}
showModal(id, name) {
this.planId = id;
this.title = '计划:' + name;
this.isVisible = true;
this.workSer.findPlan(id).subscribe(
(res) => {
if (res.errCode == 10000) {
this.plan = res.data;
}
}
);
}
handleEditCancel() {
this.isVisible = false;
}
downLoad(){
this.workSer.downloadTemplate("plan",this.planId).subscribe(
(data)=>{
this.commonSer.downloadFile(this.plan.fileName,data)
downLoad() {
this.workSer.downloadTemplate('plan', this.planId).subscribe(
(data) => {
this.commonSer.downloadFile(this.plan.fileName, data);
}
)
);
}
}
......@@ -23,21 +23,21 @@
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="status" nzRequired nzFor="typeName">分类名称</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input type="text" nz-input formControlName="name" name="typeName" id="typeName">
<nz-form-explain *ngIf="validateForm.get('name').dirty && validateForm.get('name').errors">请选择分类名称!</nz-form-explain>
<nz-form-explain *ngIf="validateForm.get('name').dirty && validateForm.get('name').errors">分类名称最多输入20字符</nz-form-explain>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="status" nzRequired nzFor="typeno">分类编号</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input type="text" nz-input formControlName="typeno" name="typeno" id="typeno">
<nz-form-explain *ngIf="validateForm.get('typeno').dirty && validateForm.get('typeno').errors">请选择分类编号!</nz-form-explain>
<nz-form-explain *ngIf="validateForm.get('typeno').dirty && validateForm.get('typeno').errors">分类编号最多输入30字符!</nz-form-explain>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="tyoeDescribe">分类描述</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<textarea id="tyoeDescribe" row="4" nz-input formControlName="tyoeDescribe"></textarea>
<nz-form-explain *ngIf="validateForm.get('tyoeDescribe').dirty && validateForm.get('tyoeDescribe').errors">请输入分类描述!</nz-form-explain>
<nz-form-explain *ngIf="validateForm.get('tyoeDescribe').dirty && validateForm.get('tyoeDescribe').errors">分类描述最多300字符!</nz-form-explain>
</nz-form-control>
</nz-form-item>
</form>
......
......@@ -70,9 +70,9 @@ export class TypeAsetsComponent implements OnInit {
this.validateForm = this.fb.group(
{
parentid:[null],
name:[null,[Validators.required]],
typeno:[null,[Validators.required]],
tyoeDescribe:[null],
name:[null,[Validators.required,Validators.maxLength(20)]],
typeno:[null,[Validators.required,Validators.maxLength(30)]],
tyoeDescribe:[null,[Validators.maxLength(300)]],
}
)
}
......
......@@ -1038,7 +1038,7 @@ TopologyEditor.prototype.drag = function (modeDiv, drawArea, text) {
// 节点坐标
node.setBound((event.layerX ? event.layerX : event.offsetX) - self.scene.translateX - self.config.nodeDefaultWidth / 2, (event.layerY ? event.layerY : event.offsetY) - self.scene.translateY - self.config.nodeDefaultHeight / 2, self.config.nodeDefaultWidth, self.config.nodeDefaultHeight)
// 节点图片
node.setImage(topoImgPath + img)
node.setImage(img)
// 节点数据
node.nodeId = generateUUID()
node.nodeType = nodeType
......@@ -1081,7 +1081,7 @@ editor.utils = {
node.setBound(320, -200, 50, 50);
// 默认节点图片
node.setImage(topoImgPath + img);
node.setImage(img);
// 节点数据
node.nodeId = generateUUID()
node.text = text
......@@ -1201,8 +1201,6 @@ editor.utils = {
var node = editor.scene.selectedElements;
node[0].text = "";
node[0].text = item.name;
// node[0].setImage(topoImgPath + item.img);
// node[0].nodeImage = item.img;
editor.stage.paint();
},
// 放大
......
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