系统管理角色,用户,部门内部分字段长度控制
This commit is contained in:
@@ -36,7 +36,6 @@ export class LoginComponent implements OnInit {
|
||||
if (data.is_success) {
|
||||
this.httpClient.get('/sysapi/setting/user/currentUser/detail').subscribe(
|
||||
xhr => {
|
||||
console.log(xhr);
|
||||
if (xhr.is_success) {
|
||||
sessionStorage.setItem('userInfo', JSON.stringify(xhr.body));
|
||||
this.message.success('登录成功!');
|
||||
|
||||
@@ -35,7 +35,6 @@ export class MainComponent implements OnInit {
|
||||
private websocketService: WebsocketService
|
||||
) {
|
||||
this.toastService.getToasts().forEach((config: ToastConfig) => {
|
||||
console.log(config);
|
||||
this.toastConfigs.unshift(config);
|
||||
});
|
||||
this.toastService.removeToastMainSubject.subscribe((config?: ToastConfig) => {
|
||||
@@ -53,6 +52,9 @@ export class MainComponent implements OnInit {
|
||||
if (event.urlAfterRedirects != '/app/main') {
|
||||
if (this.websocketService.websocket.readyState === 1) {
|
||||
this.websocketService.websocket.close();
|
||||
if(this.websocketService.websocketHeartBeat){
|
||||
this.websocketService.clearIntervalHandle();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,14 +131,9 @@ export class MainComponent implements OnInit {
|
||||
// 订阅航班更新
|
||||
this.websocketService.dynamicsMessage().subscribe(
|
||||
event => {
|
||||
setInterval(() => {
|
||||
let msg = { "topic": "heart-beat", "message": "" };
|
||||
this.websocketService.websocket.send(JSON.stringify(msg));
|
||||
}, 30000);
|
||||
let data = JSON.parse(event as string);
|
||||
if (data.topic === 'schd') {
|
||||
let message = JSON.parse(data.message);
|
||||
// console.log(message);
|
||||
//是否可以开始处理动态消息
|
||||
if (this.canHandleDynamicMessage) {
|
||||
this.dynamicMessageHandle(message);
|
||||
@@ -145,7 +142,6 @@ export class MainComponent implements OnInit {
|
||||
}
|
||||
} else if (data.topic === 'msg') {
|
||||
let message = JSON.parse(data.message);
|
||||
// console.log(message);
|
||||
if (this.canHandleDynamicAlert) {
|
||||
this.dynamicAlertHandle(message);
|
||||
} else {
|
||||
|
||||
@@ -54,7 +54,6 @@ export class PagesComponent implements OnInit {
|
||||
menuList.forEach(menu => {
|
||||
this.menuDataHandle(menu);
|
||||
})
|
||||
// console.log(menuList);
|
||||
this.menuData = menuList;
|
||||
}
|
||||
)
|
||||
|
||||
@@ -49,7 +49,6 @@ export class DataSynchronizeComponent implements OnInit {
|
||||
onEndChange(date: Date): void {
|
||||
this.endValue = date;
|
||||
this.search.endDate = this.changeDate(date)
|
||||
console.log(this.search.endDate)
|
||||
}
|
||||
|
||||
handleStartOpenChange(open: boolean): void {
|
||||
|
||||
+8
-7
@@ -97,7 +97,8 @@
|
||||
<nz-form-label nzSpan="7" nzFor="organization" nzRequired>机构名称</nz-form-label>
|
||||
<nz-form-control nzSpan="12">
|
||||
<input nz-input id="organization" formControlName="organization" placeholder="请输入姓名">
|
||||
<nz-form-explain *ngIf="validateForm.get('organization').dirty && validateForm.get('organization').errors">请输入机构名称</nz-form-explain>
|
||||
<nz-form-explain *ngIf="validateForm.get('organization').dirty && validateForm.get('organization').errors?.required">请输入机构名称</nz-form-explain>
|
||||
<nz-form-explain *ngIf="validateForm.get('organization').dirty && validateForm.get('organization').errors?.maxlength">机构名称最长20个字符</nz-form-explain>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
@@ -106,17 +107,17 @@
|
||||
<nz-form-label nzSpan="7" nzFor="shortName">机构简称</nz-form-label>
|
||||
<nz-form-control nzSpan="12">
|
||||
<input nz-input id="shortName" formControlName="shortName" placeholder="请输入姓名">
|
||||
<nz-form-explain *ngIf="validateForm.get('shortName').dirty && validateForm.get('shortName').errors">请输入机构简称</nz-form-explain>
|
||||
<nz-form-explain *ngIf="validateForm.get('shortName').dirty && validateForm.get('shortName').errors">机构简称最长10个字符</nz-form-explain>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
<div nz-col [nzXs]="24" [nzSm]="24" [nzMd]="24" [nzLg]="24" [nzXl]="12" [nzXXl]="12">
|
||||
<nz-form-item>
|
||||
<nz-form-label nzSpan="7" nzFor="code" nzRequired>机构编码</nz-form-label>
|
||||
<nz-form-control nzSpan="12" [nzValidateStatus]="checkNameStatus" nzHasFeedback>
|
||||
<input nz-input id="code" formControlName="code" placeholder="请输入机构编码" (blur)='checkName()'
|
||||
(keydown)="checkNameStatus='';nameOnly=true" name="validating">
|
||||
<nz-form-explain *ngIf="validateForm.get('code').dirty && validateForm.get('code').errors">请输入机构编码</nz-form-explain>
|
||||
<nz-form-control nzSpan="12">
|
||||
<input nz-input id="code" formControlName="code" placeholder="请输入机构编码" (keyup)='checkName()' name="validating">
|
||||
<nz-form-explain *ngIf="validateForm.get('code').dirty && validateForm.get('code').errors?.required">请输入机构编码</nz-form-explain>
|
||||
<nz-form-explain *ngIf="validateForm.get('code').dirty && validateForm.get('code').errors?.maxlength">机构编码最长10个字符</nz-form-explain>
|
||||
<nz-form-explain *ngIf="!nameOnly" class="danger">该编码已存在</nz-form-explain>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
@@ -126,7 +127,7 @@
|
||||
<nz-form-label nzSpan="7" nzFor="contact_person">联系人</nz-form-label>
|
||||
<nz-form-control nzSpan="12">
|
||||
<input nz-input id="contact_person" formControlName="contact_person" placeholder="请输入姓名">
|
||||
<nz-form-explain *ngIf="validateForm.get('contact_person').dirty && validateForm.get('contact_person').errors">请输入联系人</nz-form-explain>
|
||||
<nz-form-explain *ngIf="validateForm.get('contact_person').dirty && validateForm.get('contact_person').errors?.maxlength">联系人名称最长10个字符</nz-form-explain>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
|
||||
+5
-9
@@ -69,10 +69,10 @@ export class DepartmentManagementComponent implements OnInit {
|
||||
})
|
||||
//表单实例化
|
||||
this.validateForm = this.fb.group({
|
||||
organization:[ '', [ Validators.required ] ],
|
||||
shortName:[ '' ],
|
||||
code:[ '', [ Validators.required ] ],
|
||||
contact_person:[ '' ],
|
||||
organization: ['', [Validators.required, Validators.maxLength(20)]],
|
||||
shortName: ['',[Validators.maxLength(10)]],
|
||||
code: ['', [Validators.required,Validators.maxLength(10)]],
|
||||
contact_person: ['',[Validators.maxLength(10)]],
|
||||
contact_method: [''],
|
||||
organization_type: [''],
|
||||
address: [''],
|
||||
@@ -95,7 +95,6 @@ export class DepartmentManagementComponent implements OnInit {
|
||||
|
||||
} else if (type == 2) {
|
||||
let item = this.orgDetail;
|
||||
// console.log(item);
|
||||
this.zNodesChild = this.zNodes.concat();
|
||||
for (let i = 0; i < this.zNodesChild.length; i++) {
|
||||
if (this.zNodesChild[i].id === item.id) {
|
||||
@@ -319,7 +318,7 @@ export class DepartmentManagementComponent implements OnInit {
|
||||
initTree() {
|
||||
//获取目录列表
|
||||
this.statusParamsTree.status = 1;
|
||||
this.http.get("/sysapi/setting/organization/list",).subscribe(json=>{
|
||||
this.http.get("/sysapi/setting/organization/list").subscribe(json => {
|
||||
if (json.is_success) {
|
||||
if (json.body.length > 0) {
|
||||
this.statusParamsTree.status = 3;
|
||||
@@ -348,10 +347,7 @@ export class DepartmentManagementComponent implements OnInit {
|
||||
this.statusParamsTree.status = 0;
|
||||
}
|
||||
this.zNodes = json.body;
|
||||
|
||||
// console.log(this.zNodes);
|
||||
$.fn.zTree.init($("#treeDemo"), this.setting, this.zNodes);
|
||||
|
||||
var zTree = $.fn.zTree.getZTreeObj("treeDemo");
|
||||
let node = zTree.getNodes();
|
||||
if (json.body.length > 0) {
|
||||
|
||||
+2
-1
@@ -7,7 +7,8 @@
|
||||
<nz-form-label class="mr-2" nzFor="role_name" nzRequired style="vertical-align:top">角色名称</nz-form-label>
|
||||
<nz-form-control style="display:inline-block">
|
||||
<input nz-input id="role_name" formControlName="role_name" placeholder="请输入角色名称">
|
||||
<nz-form-explain *ngIf="validateForm.get('role_name').dirty && validateForm.get('role_name').errors">请输入角色名称</nz-form-explain>
|
||||
<nz-form-explain *ngIf="validateForm.get('role_name').dirty && validateForm.get('role_name').errors?.required">请输入角色名称</nz-form-explain>
|
||||
<nz-form-explain *ngIf="validateForm.get('role_name').dirty && validateForm.get('role_name').errors?.maxlength">角色名称最长20个字符</nz-form-explain>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
<nz-form-item>
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ export class RoleManagementModifyComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.validateForm = this.fb.group({
|
||||
role_name: ['', [Validators.required]],
|
||||
role_name: ['', [Validators.required,Validators.maxLength(20)]],
|
||||
role_type: ['1', [Validators.required]], //0=系统内置(不可删除) ,1=用户定义
|
||||
description: [''],
|
||||
role_code: [''],
|
||||
|
||||
+8
-5
@@ -8,7 +8,8 @@
|
||||
<nz-form-label nzSpan="7" nzFor="real_name" nzRequired>姓名</nz-form-label>
|
||||
<nz-form-control nzSpan="12">
|
||||
<input nz-input id="real_name" formControlName="real_name" placeholder="请输入姓名">
|
||||
<nz-form-explain *ngIf="validateForm.get('real_name').dirty && validateForm.get('real_name').errors">请输入姓名</nz-form-explain>
|
||||
<nz-form-explain *ngIf="validateForm.get('real_name').dirty && validateForm.get('real_name').errors?.required">请输入姓名</nz-form-explain>
|
||||
<nz-form-explain *ngIf="validateForm.get('real_name').dirty && validateForm.get('real_name').errors?.maxlength">姓名最长20个字符</nz-form-explain>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
@@ -30,10 +31,11 @@
|
||||
<div nz-col [nzXs]="24" [nzSm]="24" [nzMd]="24" [nzLg]="24" [nzXl]="12" [nzXXl]="12">
|
||||
<nz-form-item>
|
||||
<nz-form-label nzSpan="7" nzFor="login_name" nzRequired>系统账号</nz-form-label>
|
||||
<nz-form-control nzSpan="12" [nzValidateStatus]="checkNameStatus" nzHasFeedback>
|
||||
<input nz-input (blur)='checkName()' (keydown)="checkNameStatus='';nameOnly=true" name="validating"
|
||||
<nz-form-control nzSpan="12">
|
||||
<input nz-input (keyup)="checkName()" name="validating"
|
||||
id="login_name" formControlName="login_name" placeholder="请输入统一身份认证账号">
|
||||
<nz-form-explain *ngIf="validateForm.get('login_name').dirty && validateForm.get('login_name').errors">请输入系统账号</nz-form-explain>
|
||||
<nz-form-explain *ngIf="validateForm.get('login_name').dirty && validateForm.get('login_name').errors?.required">请输入系统账号</nz-form-explain>
|
||||
<nz-form-explain *ngIf="validateForm.get('login_name').dirty && validateForm.get('login_name').errors?.maxlength">系统账号最长20个字符</nz-form-explain>
|
||||
<nz-form-explain *ngIf="!nameOnly" class="red">本账号已存在</nz-form-explain>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
@@ -43,7 +45,8 @@
|
||||
<nz-form-label nzSpan="7" nzFor="password" nzRequired>系统密码</nz-form-label>
|
||||
<nz-form-control nzSpan="12">
|
||||
<input nz-input id="password" formControlName="password" placeholder="请输入密码">
|
||||
<nz-form-explain *ngIf="validateForm.get('password').dirty && validateForm.get('password').errors">请输入密码</nz-form-explain>
|
||||
<nz-form-explain *ngIf="validateForm.get('password').dirty && validateForm.get('password').errors?.required">请输入密码</nz-form-explain>
|
||||
<nz-form-explain *ngIf="validateForm.get('password').dirty && validateForm.get('password').errors?.maxlength">密码最长20个字符</nz-form-explain>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
|
||||
+3
-3
@@ -54,9 +54,9 @@ export class UserManagementModifyComponent implements OnInit {
|
||||
// $('#main-container').height('height',(document.documentElement.clientHeight-106+'px'));
|
||||
this.queryRole();
|
||||
this.validateForm = this.fb.group({
|
||||
real_name: ['', [Validators.required]],
|
||||
login_name: ['', [Validators.required]],
|
||||
password: ['', [Validators.required]],
|
||||
real_name: ['', [Validators.required,Validators.maxLength(20)]],
|
||||
login_name: ['', [Validators.required,Validators.maxLength(20)]],
|
||||
password: ['', [Validators.required,Validators.maxLength(20)]],
|
||||
identify_num: [''],
|
||||
email: [''],
|
||||
mobile: [''],
|
||||
|
||||
@@ -7,6 +7,7 @@ var SECURE = 'wss://';
|
||||
|
||||
export class WebsocketService {
|
||||
public websocket: WebSocket;
|
||||
public websocketHeartBeat;
|
||||
constructor() { }
|
||||
|
||||
dynamicsMessage() {
|
||||
@@ -19,7 +20,11 @@ export class WebsocketService {
|
||||
this.websocket = new WebSocket(url);
|
||||
return new Observable(ob => {
|
||||
this.websocket.onopen = () => {
|
||||
console.log('websocket was connected...')
|
||||
console.log('websocket was connected...');
|
||||
this.websocketHeartBeat = setInterval(() => {
|
||||
let msg = { "topic": "heart-beat", "message": "" };
|
||||
this.websocket.send(JSON.stringify(msg));
|
||||
}, 30000);
|
||||
}
|
||||
this.websocket.onmessage = (event) => {
|
||||
ob.next(event.data)
|
||||
@@ -33,4 +38,8 @@ export class WebsocketService {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
clearIntervalHandle() {
|
||||
clearInterval(this.websocketHeartBeat);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user