Browse Source

主题色

seimin 2 days ago
parent
commit
74d014f871

+ 2 - 0
src/app/app.component.ts

@@ -25,6 +25,8 @@ export class AppComponent {
25 25
     }
26 26
     console.log(hosId);
27 27
     this.tool.getSysNameAndLogoAsync(hosId).subscribe(result => {
28
+      // 系统颜色设置
29
+      this.tool.setUIColor(result.ui_colour);
28 30
       let marking = result.project || '';
29 31
       let logoTitle = result.sysName || '';
30 32
       let logoUrl = location.origin + '/file' + result.logo || '';

+ 45 - 0
src/app/services/tool.service.ts

@@ -60,6 +60,51 @@ export class ToolService {
60 60
     this.faviconUrl = faviconUrl;
61 61
   }
62 62
 
63
+  // 系统颜色设置
64
+  setUIColor(color){
65
+    // 移除样式
66
+    if(document.getElementById('dsThemeId')){
67
+      document.getElementById('dsThemeId').remove();
68
+    }
69
+    // 创建一个新的 <style> 元素
70
+    var style = document.createElement('style');
71
+
72
+    // 设置 style 元素的类型
73
+    style.id = 'dsThemeId';
74
+    style.type = 'text/css';
75
+
76
+    // 添加 CSS 规则
77
+    style.innerHTML = `
78
+      .ant-table-thead tr{
79
+        background-image:none!important;
80
+        background-color:${color}!important;
81
+      }
82
+      #ds-menu .mainMenuOne.mainMenuSelected{
83
+        background-color:${color}!important;
84
+      }
85
+      #ds-menu .mainMenu.menuTwoSelected{
86
+        border-left-color: ${color}!important;
87
+      }
88
+      #sidebar-logo .title{
89
+        color: ${color}!important;
90
+      }
91
+      #app-header .left > .icon_transport,
92
+      #app-header .left .icon_transport.green{
93
+        color: ${color}!important;
94
+      }
95
+      #fuwutai .lists_box .right_bots .top_bot{
96
+        background-color: ${color}!important;
97
+        border-color: ${color}!important;
98
+      }
99
+      #fuwutai .lists_box .no_data{
100
+        color: ${color}!important;
101
+      }
102
+    `;
103
+
104
+    // 将 <style> 元素添加到 <head> 中
105
+    document.head.appendChild(style);
106
+  }
107
+
63 108
   // 获取权限中的院区
64 109
   getHospitalList() {
65 110
     return (

+ 3 - 3
src/app/views/fuwutai/fuwutai.component.html

@@ -1,4 +1,4 @@
1
-<div class="fuwutai">
1
+<div class="fuwutai" id="fuwutai">
2 2
   <div class="top" id="top" *ngIf="hurseInfoHiding != 1 && hsmsData.hsmsSwitch">
3 3
     <!-- 头部Tab -->
4 4
     <div class="tabBox">
@@ -2080,7 +2080,7 @@
2080 2080
 	  cancelTxt="否"
2081 2081
 	  (cancelDelEvent)="hideRepeatModal()"
2082 2082
 	></app-dialog-delete>
2083
-	
2083
+
2084 2084
 	<!-- 一键派单 -->
2085 2085
 	<app-dialog-delete
2086 2086
 	  [delModal]="sendModal"
@@ -2089,7 +2089,7 @@
2089 2089
 	  (confirmDelEvent)="confirmSecd()"
2090 2090
 	  content="您确认一键派单吗?系统会根据工作分配方案自动派单给指定人员"
2091 2091
 	></app-dialog-delete>
2092
-	
2092
+
2093 2093
 	<!-- 是否限制业务发起时间模态框 -->
2094 2094
 	<app-dialog-delete [delModal]="limitTimeModal" (hideDelModalEvent)="hideLimitTimeModal()" [btnLoading]="limitTimeLoading"
2095 2095
 	(confirmDelEvent)="confirmLimitTime()" [content]="limitTimeInfo" confirmTxt="继续建单" [isShowConfirm]="isShowConfirm" [isShowConfirmInfo]="isShowConfirmInfo"></app-dialog-delete>

+ 8 - 4
src/app/views/home/home.component.less

@@ -210,7 +210,7 @@
210 210
                 .thead {
211 211
                   th {
212 212
                     background: transparent;
213
-                    color: #333;
213
+                    color: #fff;
214 214
                     text-align: center;
215 215
                     font-size: 12px;
216 216
                     padding: 8px;
@@ -346,6 +346,10 @@
346 346
                 .box {
347 347
                   height: 100%;
348 348
 
349
+                  th{
350
+                    color: #fff;
351
+                  }
352
+
349 353
                   th,
350 354
                   td {
351 355
                     text-align: center;
@@ -421,12 +425,12 @@
421 425
                   width: 100%;
422 426
                   padding: 16px 16px 8px 16px;
423 427
                   font-size: 12px;
424
-									
428
+
425 429
 									.flex{
426 430
 										display: flex;
427 431
 										justify-content: space-between;
428 432
 									}
429
-									
433
+
430 434
                   .title {
431 435
                     color: #333;
432 436
 
@@ -450,7 +454,7 @@
450 454
                     &.noOver {
451 455
                       -webkit-line-clamp: unset;
452 456
                     }
453
-										
457
+
454 458
                   }
455 459
 
456 460
                   .up {

+ 7 - 4
src/app/views/login/login.component.ts

@@ -152,7 +152,7 @@ export class LoginComponent implements OnInit {
152 152
       remember: [Boolean(localStorage.getItem("remember"))],
153 153
 			code: [null, [Validators.required]]
154 154
     });
155
-		
155
+
156 156
 		if(this.isSingleSignOn){
157 157
 			this.validateForm.removeControl('code');
158 158
 		}else{
@@ -163,7 +163,7 @@ export class LoginComponent implements OnInit {
163 163
 	resetCode(){
164 164
 		this.getCode()
165 165
 	}
166
-	
166
+
167 167
 	// 获取系统安全配置
168 168
 	verificationCode:any;
169 169
 	getSysConfig(){
@@ -174,7 +174,7 @@ export class LoginComponent implements OnInit {
174 174
 			}
175 175
 		})
176 176
 	}
177
-	
177
+
178 178
 	// 获取验证码
179 179
 	loginImg:any;
180 180
 	captchaId:any;
@@ -186,7 +186,7 @@ export class LoginComponent implements OnInit {
186 186
 			}
187 187
 		})
188 188
 	}
189
-	
189
+
190 190
   // enter触发
191 191
   enterUp(e): void {
192 192
     let keyCode = e.which || e.keyCode || 0;
@@ -254,6 +254,9 @@ export class LoginComponent implements OnInit {
254 254
         console.log(data.user);
255 255
         let hosId = data.user.user.currentHospital ? data.user.user.currentHospital.id : ''
256 256
         this.tool.getSysNameAndLogoAsync(hosId).subscribe(result => {
257
+          // 系统颜色设置
258
+          this.tool.setUIColor(result.ui_colour);
259
+
257 260
 					// this.verificationCode = result.verificationCode;
258 261
           let marking = result.project || '';
259 262
           let logoTitle = result.sysName || '';

+ 2 - 2
src/app/views/main/main.component.html

@@ -1,6 +1,6 @@
1 1
 <nz-layout class="app-layout display_flex flex_auto ant-layout-has-sider">
2 2
   <overlay-scrollbars #osComponentRef1 class="menu-sidebar">
3
-    <div class="sidebar-logo display_flex align-items_center justify-content_flex-center">
3
+    <div class="sidebar-logo display_flex align-items_center justify-content_flex-center" id="sidebar-logo">
4 4
       <div class="display_flex align-items_center justify-content_flex-center logoTitle">
5 5
         <div class="title ellipsis-multiline" nz-tooltip nzTooltipTitle="{{tool.logoTitle}}">{{tool.logoTitle}}</div>
6 6
       </div>
@@ -28,7 +28,7 @@
28 28
   </overlay-scrollbars>
29 29
   <nz-layout style="background:#fff;display: flex;flex-direction: column;position: relative;">
30 30
     <nz-header>
31
-      <div class="app-header display_flex justify-content_space-between align-items_center">
31
+      <div class="app-header display_flex justify-content_space-between align-items_center" id="app-header">
32 32
         <div class="left">
33 33
 					<!-- <i class="icon_transport transport-xiaoxi green" (click)="toMessage()" nz-tooltip nzTooltipTitle="个人消息通知"></i> -->
34 34
           <div class="dropdown">

+ 1 - 1
src/app/views/new-statistics/distribution-inspection-statistics/date-business-statistics/date-business-statistics.component.ts

@@ -238,7 +238,7 @@ export class DateBusinessStatisticsComponent implements OnInit, AfterViewInit {
238 238
   loading1 = false;
239 239
   dictionaryList: any[] = [];
240 240
   getList(num?: number, field?: string, sort?: string) {
241
-    this.mainService.getDictionary('list', 'statistics_date_type').subscribe((data) => {
241
+    this.mainService.getDictionary('list', 'statistics_date_type', true).subscribe((data) => {
242 242
       this.dictionaryList = data || [];
243 243
       // this.dictionaryList = cloneDeep(dictionaryList);
244 244
       let flag = this.dictionaryList.some((item) => item.value === 'dateOther');

+ 1 - 1
src/app/views/new-statistics/distribution-inspection-statistics/department-business-statistics/department-business-statistics.component.ts

@@ -290,7 +290,7 @@ export class DepartmentBusinessStatisticsComponent implements OnInit, AfterViewI
290 290
   dictionaryList: any[] = [];
291 291
 	widthValue:any;
292 292
   getList(num?: number, field?: string, sort?: string) {
293
-    this.mainService.getDictionary('list', 'statistics_date_type').subscribe((data) => {
293
+    this.mainService.getDictionary('list', 'statistics_date_type', true).subscribe((data) => {
294 294
      this.dictionaryList = data || [];
295 295
      // this.dictionaryList = cloneDeep(dictionaryList);
296 296
      let flag = this.dictionaryList.some((item) => item.value === 'dateOther');

+ 1 - 1
src/app/views/new-statistics/distribution-inspection-statistics/incident-list/incident-list.component.ts

@@ -385,7 +385,7 @@ export class IncidentListComponent implements OnInit, AfterViewInit, OnDestroy {
385 385
   getStatisticsTypeList() {
386 386
     this.isLoading = true;
387 387
     this.mainService
388
-      .getDictionary("list", "statistics_date_type")
388
+      .getDictionary("list", "statistics_date_type", true)
389 389
       .subscribe((data) => {
390 390
 				this.statisticsTypeList = []
391 391
         this.isLoading = false;

+ 1 - 1
src/app/views/new-statistics/distribution-inspection-statistics/user-business-statistics/user-business-statistics.component.ts

@@ -146,7 +146,7 @@ export class UserBusinessStatisticsComponent implements OnInit, AfterViewInit {
146 146
   loading1 = false;
147 147
   dictionaryList: any[] = [];
148 148
   getList(num?: number, field?: string, sort?: string) {
149
-    this.mainService.getDictionary('list', 'statistics_date_type').subscribe((data) => {
149
+    this.mainService.getDictionary('list', 'statistics_date_type', true).subscribe((data) => {
150 150
       let dictionaryList = data || [];
151 151
       dictionaryList = cloneDeep(dictionaryList);
152 152
       let flag = dictionaryList.some((item) => item.value === 'dateOther');

+ 3 - 0
src/app/views/new-statistics/new-statistics.component.ts

@@ -33,6 +33,7 @@ export class NewStatisticsComponent implements OnInit, OnDestroy {
33 33
 
34 34
   ngOnDestroy(){
35 35
 		sessionStorage.removeItem('maintenanceData')
36
+    sessionStorage.removeItem('distributionData');
36 37
     this.tabService.deleteAllRouteSnapshot();
37 38
   }
38 39
 
@@ -169,6 +170,7 @@ export class NewStatisticsComponent implements OnInit, OnDestroy {
169 170
     if(this.sign === 'nurse'){
170 171
       // 护士端跳转到统计
171 172
       sessionStorage.removeItem('maintenanceData')
173
+      sessionStorage.removeItem('distributionData');
172 174
       this.router.navigate(['/nurse']);
173 175
       return;
174 176
     }
@@ -177,6 +179,7 @@ export class NewStatisticsComponent implements OnInit, OnDestroy {
177 179
 		let gglb = false;
178 180
 		let gzgd = false;
179 181
 		sessionStorage.removeItem('maintenanceData')
182
+    sessionStorage.removeItem('distributionData');
180 183
 		roleMenus.forEach((e) => {
181 184
 			if (e.link == "home") {
182 185
 			  sy = true;

+ 8 - 0
src/app/views/sys-config/sys-config.component.html

@@ -236,6 +236,14 @@
236 236
 				    </nz-select>
237 237
 				  </nz-form-control>
238 238
 				</nz-form-item>
239
+        <nz-form-item class="formItem">
240
+				  <nz-form-label [nzSpan]="24" nzFor="ui_colour" nzRequired class="label">系统颜色设置</nz-form-label>
241
+				  <nz-form-control [nzSpan]="24" nzErrorTip="系统颜色设置是必填项!">
242
+				    <nz-select nzPlaceHolder="请选择系统颜色设置" formControlName="ui_colour">
243
+				      <nz-option nzValue="{{item.id}}" nzLabel="{{item.name}}" *ngFor="let item of ui_colour"></nz-option>
244
+				    </nz-select>
245
+				  </nz-form-control>
246
+				</nz-form-item>
239 247
       </div>
240 248
     </form>
241 249
   </overlay-scrollbars>

+ 19 - 3
src/app/views/sys-config/sys-config.component.ts

@@ -77,7 +77,8 @@ export class SysConfigComponent implements OnInit {
77 77
 			supportAppVersion: [null, [Validators.required]],
78 78
 			autoIncidentDegree: [null, [Validators.required]],
79 79
 			autoWechatDegree: [null, [Validators.required]],
80
-			workorderEvaluation: [null, [Validators.required]]
80
+			workorderEvaluation: [null, [Validators.required]],
81
+			ui_colour: [null, [Validators.required]],
81 82
     });
82 83
     this.getDeptType();
83 84
     this.coopBtns = this.tool.initCoopBtns(this.route);
@@ -160,7 +161,8 @@ export class SysConfigComponent implements OnInit {
160 161
 				item.keyconfig === "supportAppVersion" ||
161 162
 				item.keyconfig === "autoIncidentDegree" ||
162 163
 				item.keyconfig === "autoWechatDegree" ||
163
-				item.keyconfig === "workorderEvaluation"
164
+				item.keyconfig === "workorderEvaluation" ||
165
+				item.keyconfig === "ui_colour"
164 166
     );
165 167
 		console.log(7777,this.validateForm.controls.repairs.value)
166 168
     filterData.forEach((item) => {
@@ -222,6 +224,8 @@ export class SysConfigComponent implements OnInit {
222 224
         item.valueconfig = this.validateForm.controls.autoWechatDegree.value;
223 225
       }else if (item.keyconfig === "workorderEvaluation") {
224 226
         item.valueconfig = this.validateForm.controls.workorderEvaluation.value;
227
+      }else if (item.keyconfig === "ui_colour") {
228
+        item.valueconfig = this.validateForm.controls.ui_colour.value;
225 229
       }
226 230
     });
227 231
     const postData = filterData;
@@ -230,6 +234,11 @@ export class SysConfigComponent implements OnInit {
230 234
       (result) => {
231 235
         this.loading2 = false;
232 236
         if (result["status"] == 200) {
237
+          // 系统颜色设置
238
+          let ui_colour = this.ui_colour.find(v => v.id == this.validateForm.controls.ui_colour.value);
239
+          if(ui_colour){
240
+            this.tool.setUIColor(ui_colour.value);
241
+          }
233 242
           this.showPromptModal("保存", true, "");
234 243
         } else {
235 244
           this.showPromptModal("保存", false, "");
@@ -245,6 +254,7 @@ export class SysConfigComponent implements OnInit {
245 254
   deptTypes: any = [];
246 255
 	evaluateData: any = [];
247 256
 	workorderEvaluation: any = [];
257
+	ui_colour: any = [];
248 258
   getDeptType() {
249 259
     this.loading1 = true;
250 260
     this.mainService.getDictionary("list", "dept_type").subscribe((result) => {
@@ -257,6 +267,9 @@ export class SysConfigComponent implements OnInit {
257 267
 		  this.workorderEvaluation = result;
258 268
 		  this.getSysConfig();
259 269
 		});
270
+		this.mainService.getDictionary("list", "ui_colour").subscribe((result) => {
271
+		  this.ui_colour = result;
272
+		});
260 273
   }
261 274
   // 格式化自动关闭工单设置的数字选择框
262 275
   formatterPercent = (value: number) => `${value}小时`;
@@ -354,7 +367,7 @@ export class SysConfigComponent implements OnInit {
354 367
 										this.checkOptionsOne[1].checked = false
355 368
 									}
356 369
 								  this.validateForm.controls.repairs.setValue(this.checkOptionsOne + "");
357
-								  break;	
370
+								  break;
358 371
 								case "cmdbRepair":
359 372
 								  this.validateForm.controls.cmdbRepair.setValue(c[1] + "");
360 373
 								  break;
@@ -370,6 +383,9 @@ export class SysConfigComponent implements OnInit {
370 383
 								case "workorderEvaluation":
371 384
 								  this.validateForm.controls.workorderEvaluation.setValue(c[1] + "");
372 385
 								  break;
386
+								case "ui_colour":
387
+								  this.validateForm.controls.ui_colour.setValue(c[1] + "");
388
+								  break;
373 389
               }
374 390
             });
375 391
           } else {