Przeglądaj źródła

调整菜单与数据字典

seimin 8 miesięcy temu
rodzic
commit
dad565e7c7

+ 1 - 1
proxy.conf.json

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

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

@@ -143,11 +143,21 @@
143 143
         <div class="addressAssign">
144 144
           <div class="contentBody">
145 145
             <div class="dictionaryRow">
146
+              <div class="orders">排序号</div>
146 147
               <div class="name">键</div>
147 148
               <div class="value">值</div>
148 149
             </div>
149 150
             <form nz-form [formGroup]="validateDictionaryForm" class="w100">
150 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 161
                 <div class="name">
152 162
                   <nz-form-item>
153 163
                     <nz-form-control [nzSpan]="24" nzErrorTip="请输入键!">
@@ -165,8 +175,15 @@
165 175
                       </nz-input-group>
166 176
                     </nz-form-control>
167 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 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 187
                 </div>
171 188
               </div>
172 189
             </form>

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

@@ -37,14 +37,17 @@
37 37
       align-items: center;
38 38
       justify-content: center;
39 39
       gap: 16px;
40
-      .name{
40
+      .orders{
41 41
         flex: 1;
42 42
         display: flex;
43 43
         justify-content: flex-end;
44 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 52
       .value{
50 53
         flex: 3;
@@ -59,6 +62,7 @@
59 62
           cursor: pointer;
60 63
         }
61 64
       }
65
+
62 66
     }
63 67
   }
64 68
   .configurationCenter{

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

@@ -681,6 +681,7 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
681 681
     this.validateDictionaryForm = this.fb.group({
682 682
       // name: [null, [Validators.required]],//键
683 683
       // value: [null, [Validators.required]],//值
684
+      // orders: [null, [Validators.required]],//排序号
684 685
     });
685 686
     console.log(this.validateDictionaryForm.controls)
686 687
   }
@@ -707,6 +708,8 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
707 708
             id: v.id,
708 709
             name: v.name || null,
709 710
             value: v.value || null,
711
+            orders: v.orders || null,
712
+            system: v.system || false,
710 713
           }
711 714
         });
712 715
       }else{
@@ -715,6 +718,8 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
715 718
             id: uuidv4(),
716 719
             name: null,
717 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 729
       this.dictionaryList.forEach((obj, i) => {
725 730
         for (const key in obj) {
726
-          if(key !== 'id'){
731
+          if(key !== 'id' && key !== 'system'){
727 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 742
       id: uuidv4(),
738 743
       name: null,
739 744
       value: null,
745
+      orders: null,
740 746
     };
741 747
 
742 748
     // 动态添加表单
@@ -784,7 +790,8 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
784 790
         id: uuidValidate(this.dictionaryList[i].id) ? undefined : this.dictionaryList[i].id,
785 791
         name: this.validateDictionaryForm.value['name_' + this.dictionaryList[i].id],
786 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 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 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 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
   // 判断登录是否已失效