|
@@ -55,6 +55,7 @@ export class SysConfigComponent implements OnInit {
|
55
|
55
|
systemName: [""],
|
56
|
56
|
largeScreenName: [""],
|
57
|
57
|
logo: [""],
|
|
58
|
+ favicon: [""],
|
58
|
59
|
defaultRoleOfNurse: [null, [Validators.required]],
|
59
|
60
|
formUrl: [{ value: null, disabled: true }, [Validators.required]],
|
60
|
61
|
serviceUrl: [{ value: null, disabled: true }, [Validators.required]],
|
|
@@ -65,8 +66,16 @@ export class SysConfigComponent implements OnInit {
|
65
|
66
|
this.getDeptType();
|
66
|
67
|
this.coopBtns = this.tool.initCoopBtns(this.route);
|
67
|
68
|
this.getRoleList();
|
|
69
|
+ this.getLogoOrFavicon();
|
68
|
70
|
this.avatarUrl = this.tool.logoUrl;
|
69
|
|
- this.validateForm.controls.logo.setValue(this.tool.logoUrl);
|
|
71
|
+ this.avatarUrl1 = this.tool.logoUrl;
|
|
72
|
+ }
|
|
73
|
+
|
|
74
|
+ getLogoOrFavicon(){
|
|
75
|
+ this.tool.getSysNameAndLogoAsync().subscribe(result => {
|
|
76
|
+ this.avatarUrl = result.logo || '';
|
|
77
|
+ this.avatarUrl1 = result.favicon || '';
|
|
78
|
+ })
|
70
|
79
|
}
|
71
|
80
|
|
72
|
81
|
// 角色列表
|
|
@@ -289,6 +298,7 @@ export class SysConfigComponent implements OnInit {
|
289
|
298
|
|
290
|
299
|
avatarLoading = false;
|
291
|
300
|
avatarUrl: string;
|
|
301
|
+ avatarUrl1: string;
|
292
|
302
|
beforeUpload = (file: File) => {
|
293
|
303
|
return new Observable((observer: Observer<boolean>) => {
|
294
|
304
|
const isPic = (file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/jpg');
|
|
@@ -314,20 +324,7 @@ export class SysConfigComponent implements OnInit {
|
314
|
324
|
reader.readAsDataURL(img);
|
315
|
325
|
}
|
316
|
326
|
|
317
|
|
- private checkImageDimension(file: File): Promise<boolean> {
|
318
|
|
- return new Promise(resolve => {
|
319
|
|
- const img = new Image(); // create image
|
320
|
|
- img.src = window.URL.createObjectURL(file);
|
321
|
|
- img.onload = () => {
|
322
|
|
- const width = img.naturalWidth;
|
323
|
|
- const height = img.naturalHeight;
|
324
|
|
- window.URL.revokeObjectURL(img.src!);
|
325
|
|
- resolve(width === height && width >= 300);
|
326
|
|
- };
|
327
|
|
- });
|
328
|
|
- }
|
329
|
|
-
|
330
|
|
- handleChange(info: { file: UploadFile }): void {
|
|
327
|
+ handleChange(info: { file: UploadFile }, avatarUrl): void {
|
331
|
328
|
switch (info.file.status) {
|
332
|
329
|
case 'uploading':
|
333
|
330
|
this.avatarLoading = true;
|
|
@@ -336,7 +333,7 @@ export class SysConfigComponent implements OnInit {
|
336
|
333
|
// Get this url from response in real world.
|
337
|
334
|
this.getBase64(info.file!.originFileObj!, (img: string) => {
|
338
|
335
|
this.avatarLoading = false;
|
339
|
|
- this.avatarUrl = img;
|
|
336
|
+ this[avatarUrl] = img;
|
340
|
337
|
});
|
341
|
338
|
break;
|
342
|
339
|
case 'error':
|