Browse Source

调整菜单与数据字典

seimin 10 months ago
parent
commit
dad565e7c7

+ 1 - 1
proxy.conf.json

@@ -1,6 +1,6 @@
1
 {
1
 {
2
   "/service": {
2
   "/service": {
3
-		"target": "http://192.168.3.108",
3
+		"target": "http://192.168.4.105",
4
     "logLevel": "debug",
4
     "logLevel": "debug",
5
     "changeOrigin": true,
5
     "changeOrigin": true,
6
     "pathRewrite": {
6
     "pathRewrite": {

+ 18 - 1
src/app/views/configuration-center/configuration-center.component.html

@@ -143,11 +143,21 @@
143
         <div class="addressAssign">
143
         <div class="addressAssign">
144
           <div class="contentBody">
144
           <div class="contentBody">
145
             <div class="dictionaryRow">
145
             <div class="dictionaryRow">
146
+              <div class="orders">排序号</div>
146
               <div class="name">键</div>
147
               <div class="name">键</div>
147
               <div class="value">值</div>
148
               <div class="value">值</div>
148
             </div>
149
             </div>
149
             <form nz-form [formGroup]="validateDictionaryForm" class="w100">
150
             <form nz-form [formGroup]="validateDictionaryForm" class="w100">
150
               <div class="dictionaryRow" *ngFor="let data of dictionaryList;let i = index;">
151
               <div class="dictionaryRow" *ngFor="let data of dictionaryList;let i = index;">
152
+                <div class="orders">
153
+                  <nz-form-item>
154
+                    <nz-form-control [nzSpan]="24" nzErrorTip="请输入排序号!">
155
+                      <nz-input-group>
156
+                        <nz-input-number [formControlName]="'orders_' + data.id" class="ordersInput"></nz-input-number>
157
+                      </nz-input-group>
158
+                    </nz-form-control>
159
+                  </nz-form-item>
160
+                </div>
151
                 <div class="name">
161
                 <div class="name">
152
                   <nz-form-item>
162
                   <nz-form-item>
153
                     <nz-form-control [nzSpan]="24" nzErrorTip="请输入键!">
163
                     <nz-form-control [nzSpan]="24" nzErrorTip="请输入键!">
@@ -165,8 +175,15 @@
165
                       </nz-input-group>
175
                       </nz-input-group>
166
                     </nz-form-control>
176
                     </nz-form-control>
167
                   </nz-form-item>
177
                   </nz-form-item>
178
+                  <!-- <nz-form-item class="ml8">
179
+                    <nz-form-control [nzSpan]="24" nzErrorTip="请输入排序号!">
180
+                      <nz-input-group>
181
+                        <nz-input-number [formControlName]="'orders_' + data.id" class="nameInput"></nz-input-number>
182
+                      </nz-input-group>
183
+                    </nz-form-control>
184
+                  </nz-form-item> -->
168
                   <i class="icon_transport transport-tag27fuben ml8" (click)="addField(i)"></i>
185
                   <i class="icon_transport transport-tag27fuben ml8" (click)="addField(i)"></i>
169
-                  <i class="icon_transport transport-shanchu1 ml8" *ngIf="dictionaryList.length > 1" (click)="removeField(data, i)"></i>
186
+                  <i class="icon_transport transport-shanchu1 ml8" *ngIf="dictionaryList.length > 1 && !data.system" (click)="removeField(data, i)"></i>
170
                 </div>
187
                 </div>
171
               </div>
188
               </div>
172
             </form>
189
             </form>

+ 8 - 4
src/app/views/configuration-center/configuration-center.component.less

@@ -37,14 +37,17 @@
37
       align-items: center;
37
       align-items: center;
38
       justify-content: center;
38
       justify-content: center;
39
       gap: 16px;
39
       gap: 16px;
40
-      .name{
40
+      .orders{
41
         flex: 1;
41
         flex: 1;
42
         display: flex;
42
         display: flex;
43
         justify-content: flex-end;
43
         justify-content: flex-end;
44
         align-items: center;
44
         align-items: center;
45
-        .nameInput{
46
-          width: 100px;
47
-        }
45
+      }
46
+      .name{
47
+        width: 100px;
48
+        display: flex;
49
+        justify-content: flex-end;
50
+        align-items: center;
48
       }
51
       }
49
       .value{
52
       .value{
50
         flex: 3;
53
         flex: 3;
@@ -59,6 +62,7 @@
59
           cursor: pointer;
62
           cursor: pointer;
60
         }
63
         }
61
       }
64
       }
65
+
62
     }
66
     }
63
   }
67
   }
64
   .configurationCenter{
68
   .configurationCenter{

+ 9 - 2
src/app/views/configuration-center/configuration-center.component.ts

@@ -681,6 +681,7 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
681
     this.validateDictionaryForm = this.fb.group({
681
     this.validateDictionaryForm = this.fb.group({
682
       // name: [null, [Validators.required]],//键
682
       // name: [null, [Validators.required]],//键
683
       // value: [null, [Validators.required]],//值
683
       // value: [null, [Validators.required]],//值
684
+      // orders: [null, [Validators.required]],//排序号
684
     });
685
     });
685
     console.log(this.validateDictionaryForm.controls)
686
     console.log(this.validateDictionaryForm.controls)
686
   }
687
   }
@@ -707,6 +708,8 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
707
             id: v.id,
708
             id: v.id,
708
             name: v.name || null,
709
             name: v.name || null,
709
             value: v.value || null,
710
             value: v.value || null,
711
+            orders: v.orders || null,
712
+            system: v.system || false,
710
           }
713
           }
711
         });
714
         });
712
       }else{
715
       }else{
@@ -715,6 +718,8 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
715
             id: uuidv4(),
718
             id: uuidv4(),
716
             name: null,
719
             name: null,
717
             value: null,
720
             value: null,
721
+            orders: null,
722
+            system: false,
718
           }
723
           }
719
         ];
724
         ];
720
       }
725
       }
@@ -723,7 +728,7 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
723
       // 动态添加表单
728
       // 动态添加表单
724
       this.dictionaryList.forEach((obj, i) => {
729
       this.dictionaryList.forEach((obj, i) => {
725
         for (const key in obj) {
730
         for (const key in obj) {
726
-          if(key !== 'id'){
731
+          if(key !== 'id' && key !== 'system'){
727
             this.validateDictionaryForm.addControl(key + '_' + obj.id, new FormControl(obj[key], [Validators.required]))
732
             this.validateDictionaryForm.addControl(key + '_' + obj.id, new FormControl(obj[key], [Validators.required]))
728
           }
733
           }
729
         }
734
         }
@@ -737,6 +742,7 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
737
       id: uuidv4(),
742
       id: uuidv4(),
738
       name: null,
743
       name: null,
739
       value: null,
744
       value: null,
745
+      orders: null,
740
     };
746
     };
741
 
747
 
742
     // 动态添加表单
748
     // 动态添加表单
@@ -784,7 +790,8 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
784
         id: uuidValidate(this.dictionaryList[i].id) ? undefined : this.dictionaryList[i].id,
790
         id: uuidValidate(this.dictionaryList[i].id) ? undefined : this.dictionaryList[i].id,
785
         name: this.validateDictionaryForm.value['name_' + this.dictionaryList[i].id],
791
         name: this.validateDictionaryForm.value['name_' + this.dictionaryList[i].id],
786
         value: this.validateDictionaryForm.value['value_' + this.dictionaryList[i].id],
792
         value: this.validateDictionaryForm.value['value_' + this.dictionaryList[i].id],
787
-        orders: i + 1,
793
+        orders: this.validateDictionaryForm.value['orders_' + this.dictionaryList[i].id],
794
+        system: !uuidValidate(this.dictionaryList[i].id),
788
         key: 'incident_category_score',
795
         key: 'incident_category_score',
789
       })
796
       })
790
     }
797
     }

+ 7 - 3
src/app/views/main/main.component.ts

@@ -67,8 +67,12 @@ export class MainComponent implements OnInit {
67
   }
67
   }
68
 
68
 
69
   // 菜单图标名称是否包含transport-
69
   // 菜单图标名称是否包含transport-
70
-  isTransportIcon(icon:string) {
71
-    return icon.indexOf("transport-") > -1;
70
+  isTransportIcon(icon:any) {
71
+    if(icon){
72
+      return icon.indexOf("transport-") > -1;
73
+    }else{
74
+      return false;
75
+    }
72
   }
76
   }
73
 
77
 
74
   //上下班
78
   //上下班
@@ -301,7 +305,7 @@ export class MainComponent implements OnInit {
301
         arr.push(e);
305
         arr.push(e);
302
       }
306
       }
303
     });
307
     });
304
-    this.menus = arr;
308
+    this.menus = arr.filter(v => v.type === 'default');
305
   }
309
   }
306
 
310
 
307
   // 判断登录是否已失效
311
   // 判断登录是否已失效