Przeglądaj źródła

拆分配置中心组件

seimin 8 miesięcy temu
rodzic
commit
3aab36305f
21 zmienionych plików z 2683 dodań i 3483 usunięć
  1. 1 1
      proxy.conf.json
  2. 212 0
      src/app/components/configurationCenter/configuration-category/configuration-category.component.html
  3. 297 0
      src/app/components/configurationCenter/configuration-category/configuration-category.component.less
  4. 721 0
      src/app/components/configurationCenter/configuration-category/configuration-category.component.ts
  5. 66 0
      src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component.html
  6. 172 0
      src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component.less
  7. 249 0
      src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component.ts
  8. 97 0
      src/app/components/configurationCenter/configuration-priority/configuration-priority.component.html
  9. 289 0
      src/app/components/configurationCenter/configuration-priority/configuration-priority.component.less
  10. 212 0
      src/app/components/configurationCenter/configuration-priority/configuration-priority.component.ts
  11. 63 0
      src/app/share/allocation-worker copy/allocation-worker.component.html
  12. 110 0
      src/app/share/allocation-worker copy/allocation-worker.component.less
  13. 168 0
      src/app/share/allocation-worker copy/allocation-worker.component.ts
  14. 3 359
      src/app/views/incident-config/incident-config.component.html
  15. 0 342
      src/app/views/incident-config/incident-config.component.less
  16. 2 1038
      src/app/views/incident-config/incident-config.component.ts
  17. 7 1
      src/app/views/incident-config/incident-config.module.ts
  18. 4 360
      src/app/views/other-config/other-config.component.html
  19. 1 343
      src/app/views/other-config/other-config.component.less
  20. 2 1038
      src/app/views/other-config/other-config.component.ts
  21. 7 1
      src/app/views/other-config/other-config.module.ts

+ 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": {

+ 212 - 0
src/app/components/configurationCenter/configuration-category/configuration-category.component.html

@@ -0,0 +1,212 @@
1
+<div class="hospitalConfig">
2
+  <nz-radio-group [(ngModel)]="hospitalConfig" (ngModelChange)="changeHospitalConfig($event)">
3
+    <label nz-radio [nzValue]="item.id" *ngFor="let item of hospitalConfigList">{{ item.name }}</label>
4
+  </nz-radio-group>
5
+</div>
6
+
7
+<div class="content">
8
+  <div class="contentInner">
9
+    <div class="address">
10
+      <div class="contentHead">一级故障现象<button nz-button nzType="primary" nzSize="small" (click)="addCategoryModal(1)">新增</button></div>
11
+      <overlay-scrollbars #osComponentRef1 class="contentBody">
12
+        <nz-spin nzSimple [nzSpinning]="categoryLoading1" class="mt8 text_align_center"></nz-spin>
13
+        <div [hidden]="categoryLoading1" class="contentItem" [title]="item.category" [ngClass]="{ active: item.id === activeCategory1.id }" (click)="clickCategory(item, 1)" *ngFor="let item of categoryList1">{{ item.category }}</div>
14
+      </overlay-scrollbars>
15
+    </div>
16
+    <div class="address">
17
+      <div class="contentHead">二级故障现象<button nz-button nzType="primary" nzSize="small" *ngIf="activeCategory1.id" (click)="addCategoryModal(2)">新增</button></div>
18
+      <overlay-scrollbars #osComponentRef2 class="contentBody">
19
+        <nz-spin nzSimple [nzSpinning]="categoryLoading2" class="mt8 text_align_center"></nz-spin>
20
+        <div [hidden]="categoryLoading2" class="contentItem" [title]="item.category" [ngClass]="{ active: item.id === activeCategory2.id }" (click)="clickCategory(item, 2)" *ngFor="let item of categoryList2">{{ item.category }}</div>
21
+      </overlay-scrollbars>
22
+    </div>
23
+    <div class="address">
24
+      <div class="contentHead">三级故障现象<button nz-button nzType="primary" nzSize="small" *ngIf="activeCategory2.id" (click)="addCategoryModal(3)">新增</button></div>
25
+      <overlay-scrollbars #osComponentRef3 class="contentBody">
26
+        <nz-spin nzSimple [nzSpinning]="categoryLoading3" class="mt8 text_align_center"></nz-spin>
27
+        <div [hidden]="categoryLoading3" class="contentItem" [title]="item.category" [ngClass]="{ active: item.id === activeCategory3.id }" (click)="clickCategory(item, 3)" *ngFor="let item of categoryList3">{{ item.category }}</div>
28
+      </overlay-scrollbars>
29
+    </div>
30
+    <div class="addressAssign">
31
+      <div class="contentHead">
32
+        <div class="title" title="{{activeCategory1.category}}{{activeCategory2.category ? ' - ' + activeCategory2.category : ''}}{{activeCategory3.category ? ' - ' + activeCategory3.category : ''}}">{{activeCategory1.category}}{{activeCategory2.category ? ' - ' + activeCategory2.category : ''}}{{activeCategory3.category ? ' - ' + activeCategory3.category : ''}}</div>
33
+        <div class="btns" *ngIf="activeCategory1.id || activeCategory2.id || activeCategory3.id">
34
+          <button nz-button nzType="primary" nzSize="small" (click)="showDelModal(data, hospitalConfig === 1 ? '您确认向下复制您的配置信息吗?' : '您确认向下复制您的配置吗?将会移除各科室的配置,使用当前配置进行覆盖。','向下复制','copy')" *ngIf="currentChildrenCategoryList">向下复制</button>
35
+          <button nz-button nzType="primary" nzSize="small" class="ml8" *ngIf="hospitalConfig === 2" (click)="addConfigModal()">新增</button>
36
+        </div>
37
+      </div>
38
+      <div class="contentBody" id="categoryTable">
39
+        <div class="list-template">
40
+          <div class="list-template__content">
41
+            <div class="list-template__bottom">
42
+              <nz-table class="list-template__nzTable" [nzData]="categoryConfigList" nzSize="middle" [nzShowPagination]="false"
43
+                [nzLoading]="loading1" [nzScroll]="{ y: tableCategoryHeight + 'px' }">
44
+                <thead>
45
+                  <tr class="thead">
46
+                    <th nzWidth="16%">院区</th>
47
+                    <th nzWidth="16%">责任部门</th>
48
+                    <th nzWidth="16%">优先级</th>
49
+                    <th nzWidth="16%">积分</th>
50
+                    <th nzWidth="16%">维修人|组</th>
51
+                    <th nzWidth="20%">操作</th>
52
+                  </tr>
53
+                </thead>
54
+                <tbody>
55
+                  <tr *ngFor="let data of categoryConfigList;let i = index">
56
+                    <td>{{data.hospitalDTO?.hosName}}</td>
57
+                    <td>{{data.dutyDTO?.hosName}}</td>
58
+                    <td>{{data.priorityDTO?.name}}</td>
59
+                    <td>{{data.score?.value}}</td>
60
+                    <td>{{data.userGroup === 1 ? data.userDTO?.name : (data.userGroup === 2 ? data.groupDTO?.groupName : '')}}</td>
61
+                    <td>
62
+                      <div class="coop">
63
+                        <span (click)="showDelModal(data,'您确认要删除吗?','删除','delConfig')">删除</span>
64
+                        <span (click)="editConfig(data)">编辑</span>
65
+                      </div>
66
+                    </td>
67
+                  </tr>
68
+                </tbody>
69
+              </nz-table>
70
+            </div>
71
+          </div>
72
+        </div>
73
+      </div>
74
+    </div>
75
+  </div>
76
+</div>
77
+
78
+<!-- 新增/编辑关联模态框 -->
79
+<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modalConfig">
80
+  <div class="modalBody">
81
+    <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hideConfigModal()"></i></div>
82
+    <div class="content">
83
+      <form nz-form [formGroup]="validateConfigForm" class="addForm">
84
+        <nz-form-item>
85
+          <nz-form-label [nzSpan]="5" nzRequired nzFor="hosId">院区</nz-form-label>
86
+          <nz-form-control [nzSpan]="19" nzErrorTip="请选择院区!">
87
+            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="hosId" nzShowSearch
88
+              nzPlaceHolder="请选择院区" nzServerSearch (ngModelChange)="changeHospital($event)" [nzDisabled]="!add">
89
+              <ng-container *ngFor="let data of hospitalList">
90
+                <nz-option *ngIf="!isLoading" [nzLabel]="data.hosName" [nzValue]="data.id"></nz-option>
91
+              </ng-container>
92
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
93
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
94
+              </nz-option>
95
+            </nz-select>
96
+          </nz-form-control>
97
+        </nz-form-item>
98
+        <nz-form-item>
99
+          <nz-form-label [nzSpan]="5" nzRequired nzFor="dutyId">责任部门</nz-form-label>
100
+          <nz-form-control [nzSpan]="19" nzErrorTip="请选择责任部门!">
101
+            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="dutyId" nzShowSearch
102
+              nzPlaceHolder="请选择责任部门" nzServerSearch (ngModelChange)="changeDuty($event)" [nzDisabled]="!add">
103
+              <ng-container *ngFor="let data of dutyList">
104
+                <nz-option *ngIf="!isLoading" [nzLabel]="data.hosName" [nzValue]="data.id"></nz-option>
105
+              </ng-container>
106
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
107
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
108
+              </nz-option>
109
+            </nz-select>
110
+          </nz-form-control>
111
+        </nz-form-item>
112
+        <nz-form-item>
113
+          <nz-form-label [nzSpan]="5" nzRequired nzFor="priority">优先级</nz-form-label>
114
+          <nz-form-control [nzSpan]="19" nzErrorTip="请选择优先级!">
115
+            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="priority" nzShowSearch
116
+            nzPlaceHolder="请选择优先级" nzServerSearch>
117
+              <ng-container *ngFor="let option of priority_c_List">
118
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
119
+              </ng-container>
120
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
121
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
122
+              </nz-option>
123
+            </nz-select>
124
+          </nz-form-control>
125
+        </nz-form-item>
126
+        <nz-form-item>
127
+          <nz-form-label [nzSpan]="5" nzRequired nzFor="score">积分</nz-form-label>
128
+          <nz-form-control [nzSpan]="19" nzErrorTip="请选择积分!">
129
+            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="score" nzShowSearch
130
+              nzPlaceHolder="请选择积分" nzServerSearch>
131
+              <ng-container *ngFor="let data of scoreList">
132
+                <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.id"></nz-option>
133
+              </ng-container>
134
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
135
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
136
+              </nz-option>
137
+            </nz-select>
138
+          </nz-form-control>
139
+        </nz-form-item>
140
+        <nz-form-item>
141
+          <nz-form-label [nzSpan]="5" nzRequired nzFor="userGroup">分配方式</nz-form-label>
142
+          <nz-form-control [nzSpan]="19" nzErrorTip="请选择积分!">
143
+            <nz-radio-group formControlName="userGroup" (ngModelChange)="changeUserGroup($event)">
144
+              <label nz-radio [nzValue]="1">人</label>
145
+              <label nz-radio [nzValue]="2">组</label>
146
+            </nz-radio-group>
147
+          </nz-form-control>
148
+        </nz-form-item>
149
+        <nz-form-item>
150
+          <nz-form-label [nzSpan]="5" nzRequired nzFor="groupId">维修组</nz-form-label>
151
+          <nz-form-control [nzSpan]="19" nzErrorTip="请选择维修组!">
152
+            <nz-select (nzOnSearch)="changeInp('group', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="groupId" nzPlaceHolder="请选择维修组" (ngModelChange)="changeGroup($event)">
153
+              <ng-container *ngFor="let option of groupList">
154
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.groupName" [nzValue]="option.id"></nz-option>
155
+              </ng-container>
156
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
157
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
158
+              </nz-option>
159
+            </nz-select>
160
+          </nz-form-control>
161
+        </nz-form-item>
162
+        <nz-form-item *ngIf="validateConfigForm.value.userGroup === 1">
163
+          <nz-form-label [nzSpan]="5" nzRequired nzFor="userId">维修人</nz-form-label>
164
+          <nz-form-control [nzSpan]="19" nzErrorTip="请选择维修人!">
165
+            <nz-select (nzOnSearch)="changeInp('user', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="userId" nzPlaceHolder="请选择维修人">
166
+              <ng-container *ngFor="let option of userList">
167
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
168
+              </ng-container>
169
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
170
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
171
+              </nz-option>
172
+            </nz-select>
173
+          </nz-form-control>
174
+        </nz-form-item>
175
+      </form>
176
+    </div>
177
+    <div class=" display_flex justify-content_flex-center">
178
+      <button nzType="primary" nz-button (click)="submitConfigForm()" [nzLoading]="btnLoading">确认</button>
179
+      <button class="btn cancel" nz-button nzType="default" (click)="hideConfigModal()">取消</button>
180
+    </div>
181
+  </div>
182
+</div>
183
+
184
+<!-- 新增/编辑故障现象模态框 -->
185
+<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modalCategory">
186
+  <div class="modalBody">
187
+    <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hideCategoryModal()"></i></div>
188
+    <div class="content">
189
+      <div class="tips" *ngIf="coopType === 1">您将添加一级故障现象,请输入故障现象</div>
190
+      <div class="tips" *ngIf="coopType === 2">您将在“<span class="red">{{activeCategory1.category}}</span>”下新增故障现象,请输入故障现象</div>
191
+      <div class="tips" *ngIf="coopType === 3">您将在“<span class="red">{{activeCategory1.category}}{{activeCategory2.category ? ' - ' + activeCategory2.category : ''}}</span>”下新增故障现象,请输入故障现象</div>
192
+      <form nz-form [formGroup]="validateCategoryForm" class="addForm">
193
+        <nz-form-item>
194
+          <nz-form-control [nzSpan]="24" nzErrorTip="请输入故障现象名称!">
195
+            <nz-input-group>
196
+              <textarea formControlName="name" nz-input placeholder="请输入故障现象名称" [nzAutosize]="{minRows: 3}"></textarea>
197
+            </nz-input-group>
198
+          </nz-form-control>
199
+        </nz-form-item>
200
+      </form>
201
+    </div>
202
+    <div class=" display_flex justify-content_flex-center">
203
+      <button nzType="primary" nz-button (click)="submitCategoryForm()" [nzLoading]="btnLoading">确认</button>
204
+      <button class="btn cancel" nz-button nzType="default" (click)="hideCategoryModal()">取消</button>
205
+    </div>
206
+  </div>
207
+</div>
208
+
209
+<!-- 操作成功/失败提示框 -->
210
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
211
+  [info]="promptInfo">
212
+</app-prompt-modal>

+ 297 - 0
src/app/components/configurationCenter/configuration-category/configuration-category.component.less

@@ -0,0 +1,297 @@
1
+@import "../../../../../src/theme.less";
2
+:host {
3
+  height: 100%;
4
+  display: flex;
5
+  flex-direction: column;
6
+  justify-content: space-between;
7
+  background-color: #F0F2F5;
8
+  .list-template__nzTable,
9
+  .list-template__bottom{
10
+    padding: 0!important;
11
+    border: none!important;
12
+    background: #fff!important;
13
+  }
14
+  .list-template{
15
+    width: 100%!important;
16
+    height: 100%!important;
17
+  }
18
+
19
+  .hospitalConfig{
20
+    height: 60px;
21
+    display: flex;
22
+    justify-content: center;
23
+    align-items: center;
24
+    gap: 72px;
25
+  }
26
+  .content{
27
+    flex: 1;
28
+    min-height: 0;
29
+    display: flex;
30
+    flex-direction: column;
31
+    justify-content: space-between;
32
+    border: 1px solid #EEF3F9;
33
+    &.priority{
34
+      margin: 24px 118px 0;
35
+      background-color: #fff;
36
+      .contentInner{
37
+        padding: 48px 206px;
38
+        border: 1px solid #E8EBEF;
39
+      }
40
+    }
41
+    .contentItem{
42
+      padding: 4px 16px;
43
+      cursor: pointer;
44
+      overflow: hidden;
45
+      text-overflow: ellipsis;
46
+      white-space: nowrap;
47
+      &.active{
48
+        color: @primary-color;
49
+        background-color: #F0F6ED;
50
+        border-radius: 4px;
51
+      }
52
+    }
53
+    .contentInner{
54
+      flex: 1;
55
+      display: flex;
56
+      justify-content: space-between;
57
+      align-items: center;
58
+      padding: 0 16px;
59
+      gap: 16px;
60
+      .contentHead{
61
+        height: 45px;
62
+        display: flex;
63
+        justify-content: space-between;
64
+        align-items: center;
65
+        gap: 16px;
66
+        padding: 0 16px;
67
+        font-size: 16px;
68
+        font-weight: bold;
69
+        border-bottom: 1px solid #D9D9D9;
70
+        .title{
71
+          overflow: hidden;
72
+          text-overflow: ellipsis;
73
+          white-space: nowrap;
74
+        }
75
+        .btns{
76
+          flex-shrink: 0;
77
+        }
78
+      }
79
+      .contentBody{
80
+        padding: 0 8px;
81
+        margin: 4px 0;
82
+        flex: 1;
83
+      }
84
+      .address{
85
+        flex: 1;
86
+        height: 100%;
87
+        background: #FFFFFF;
88
+        border: 1px solid #E8EBEF;
89
+        display: flex;
90
+        flex-direction: column;
91
+        width: 0;
92
+      }
93
+      .addressAssign{
94
+        flex: 3;
95
+        height: 100%;
96
+        background: #FFFFFF;
97
+        border: 1px solid #E8EBEF;
98
+        display: flex;
99
+        flex-direction: column;
100
+        width: 0;
101
+      }
102
+      .list-template__searchItem {
103
+        margin-bottom: 16px;
104
+        .label {
105
+          color: #333;
106
+          display: inline-block;
107
+          width: 70px;
108
+          text-align-last: justify;
109
+          text-align: justify;
110
+          &.label--big {
111
+            width: 100px;
112
+          }
113
+        }
114
+        .formItem {
115
+          width: 135px;
116
+        }
117
+      }
118
+    }
119
+    .contentBtns{
120
+      margin-bottom: 16px;
121
+      display: flex;
122
+      justify-content: center;
123
+      align-items: center;
124
+    }
125
+  }
126
+
127
+  .save {
128
+    position: fixed;
129
+    left: 0;
130
+    top: 0;
131
+    width: 100%;
132
+    height: 100%;
133
+    background: rgba(0, 0, 0, 0.4);
134
+    z-index: 99;
135
+
136
+    .tips{
137
+      margin-bottom: 16px!important;
138
+    }
139
+
140
+    .modalBody {
141
+      width: 350px;
142
+      background: #fff;
143
+      border-radius: 5px;
144
+      padding: 10px 20px;
145
+      color: #333;
146
+
147
+      .title {
148
+        width: 100%;
149
+        text-align: center;
150
+        font-size: 18px;
151
+        position: relative;
152
+
153
+        i {
154
+          position: absolute;
155
+          right: 0;
156
+          top: 0;
157
+          font-size: 20px;
158
+          color: #666;
159
+          cursor: pointer;
160
+          padding: 0 5px;
161
+        }
162
+      }
163
+
164
+      .content {
165
+        width: 310px;
166
+        background: #f9fafb;
167
+        border: 1px solid #e5e9ed;
168
+        border-radius: 5px;
169
+        overflow: hidden;
170
+        margin-top: 12px;
171
+        padding: 16px 0;
172
+
173
+        .busyList{
174
+          display: flex;
175
+          margin-bottom: 8px;
176
+          .busyContent{
177
+            margin-right: 8px;
178
+            flex: 1;
179
+          }
180
+        }
181
+
182
+        & > div {
183
+          text-align: center;
184
+          margin: 0;
185
+
186
+          &.icon {
187
+            // margin-top: 17px;
188
+
189
+            i {
190
+              color: #34b349;
191
+              font-size: 30px !important;
192
+
193
+              &.transport-wenhao {
194
+                color: #f5a523;
195
+              }
196
+
197
+              &.transport-shibai {
198
+                color: #ff3a52;
199
+              }
200
+            }
201
+          }
202
+
203
+          &.defeat {
204
+            color: #333;
205
+            font-size: 14px;
206
+          }
207
+
208
+          &:nth-child(3) {
209
+            font-size: 14px;
210
+            color: #666;
211
+          }
212
+        }
213
+        .workAssignmentTips {
214
+          font-size: 12px;
215
+        }
216
+      }
217
+
218
+      button {
219
+        margin-top: 10px;
220
+
221
+        &.btn {
222
+          margin-left: 8px;
223
+        }
224
+      }
225
+    }
226
+
227
+    // 新增
228
+    &.add {
229
+      .modalBody {
230
+        width: 480px;
231
+        height: auto;
232
+
233
+        .content {
234
+          width: 100%;
235
+          height: auto;
236
+          padding: 16px;
237
+          max-height: 497px;
238
+          overflow-y: auto;
239
+
240
+          .addForm {
241
+            .ant-form-item {
242
+              margin-bottom: 0;
243
+
244
+              .ant-form-item-label {
245
+                text-align: left;
246
+              }
247
+
248
+              .desc {
249
+                margin-top: 5px;
250
+              }
251
+            }
252
+
253
+            .datesControl {
254
+              margin-top: -16px;
255
+
256
+              .ant-form-item-label {
257
+                line-height: 40px;
258
+              }
259
+            }
260
+
261
+            .timer {
262
+              .ant-form-item-label {
263
+                width: 100%;
264
+                text-align: left;
265
+              }
266
+
267
+              .numInp {
268
+                margin-right: 5px;
269
+              }
270
+
271
+              .line {
272
+                margin-right: 5px;
273
+              }
274
+            }
275
+
276
+            .timer2 {
277
+              .ant-form-item-label {
278
+                line-height: 20px;
279
+              }
280
+            }
281
+          }
282
+
283
+          .editForm {
284
+            .ant-form-item {
285
+              margin-bottom: 15px;
286
+
287
+              .ant-form-item-label {
288
+                line-height: 14px;
289
+                text-align: left;
290
+              }
291
+            }
292
+          }
293
+        }
294
+      }
295
+    }
296
+  }
297
+}

+ 721 - 0
src/app/components/configurationCenter/configuration-category/configuration-category.component.ts

@@ -0,0 +1,721 @@
1
+import { Component, OnInit, ViewChild } from "@angular/core";
2
+import { ActivatedRoute } from "@angular/router";
3
+import { Subject } from 'rxjs';
4
+import { debounceTime } from 'rxjs/operators';
5
+import { MainService } from "../../../services/main.service";
6
+import { Validators, FormGroup, FormBuilder } from '@angular/forms';
7
+import { ToolService } from 'src/app/services/tool.service';
8
+import { OverlayScrollbarsComponent } from 'overlayscrollbars-ngx';
9
+
10
+@Component({
11
+  selector: "app-configuration-category",
12
+  templateUrl: "./configuration-category.component.html",
13
+  styleUrls: ["./configuration-category.component.less"],
14
+})
15
+export class ConfigurationCategoryComponent implements OnInit {
16
+  constructor(
17
+    private route: ActivatedRoute,
18
+    private mainService: MainService,
19
+    private fb: FormBuilder,
20
+    private tool: ToolService,
21
+  ) {}
22
+
23
+  @ViewChild("osComponentRef1", {
24
+    read: OverlayScrollbarsComponent,
25
+    static: false,
26
+  })
27
+  osComponentRef1: OverlayScrollbarsComponent;
28
+  @ViewChild("osComponentRef2", {
29
+    read: OverlayScrollbarsComponent,
30
+    static: false,
31
+  })
32
+  osComponentRef2: OverlayScrollbarsComponent;
33
+  @ViewChild("osComponentRef3", {
34
+    read: OverlayScrollbarsComponent,
35
+    static: false,
36
+  })
37
+  osComponentRef3: OverlayScrollbarsComponent;
38
+
39
+  coopData: any = {}; //当前操作列
40
+  currentHospital; //当前院区
41
+  // 部门设置、全院设置
42
+  hospitalConfig:any = 2;
43
+  hospitalConfigList:any = [
44
+    // { id: 1, name: '部门设置',},
45
+    { id: 2, name: '全院设置',},
46
+  ];
47
+
48
+  changeInpSubject = new Subject(); //防抖
49
+  debounceSubject = new Subject(); //防抖
50
+
51
+  ngOnInit() {
52
+    //防抖
53
+    this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
54
+      if(v[0] === 'user'){
55
+        this.getUsers(v[1]);
56
+      } else if(v[0] === 'group'){
57
+        this.getGroups(v[1]);
58
+      }
59
+    });
60
+
61
+    this.debounceSubject.pipe(debounceTime(500)).subscribe((v) => {
62
+      if(v[0]){
63
+        this.getCategoryList(v[0], v[1].id);
64
+      }
65
+      this.getCategoryConfigList(v[1].id);
66
+    });
67
+
68
+    this.currentHospital = this.tool.getCurrentHospital();
69
+    // 故障现象
70
+    setTimeout(() => {
71
+      this.tableCategoryHeight = document.querySelector('#categoryTable').clientHeight - 8 - document.querySelector('#categoryTable .thead').clientHeight;
72
+    }, 0)
73
+    if(this.currentHospital.type && this.currentHospital.type.value === '6'){
74
+      // 是责任部门
75
+      let flag = this.hospitalConfigList.some(v => v.id === 1);
76
+      !flag && this.hospitalConfigList.unshift({ id: 1, name: '部门设置',});
77
+    }
78
+    this.getCategoryList(1);
79
+    this.getHospitals(1);
80
+    this.getPrioritys();
81
+    this.getScores();
82
+  }
83
+
84
+  // 获取优先级
85
+  priority_c_List: any = [];
86
+  getPrioritys() {
87
+    let postData = {
88
+      priority: {},
89
+      idx: 0,
90
+      sum: 9999,
91
+    };
92
+    this.mainService
93
+      .getFetchDataList("simple/data", "priority", postData)
94
+      .subscribe((data) => {
95
+        this.isLoading = false;
96
+        this.priority_c_List = data.list || [];
97
+      });
98
+  }
99
+
100
+  // 获取积分
101
+  scoreList: any = [];
102
+  getScores() {
103
+    let postData = {
104
+      dictionary: {
105
+        key: "incident_category_score"
106
+      },
107
+      idx: 0,
108
+      sum: 10,
109
+    };
110
+    this.mainService
111
+      .getFetchDataList("simple/data", "dictionary", postData)
112
+      .subscribe((data) => {
113
+        this.isLoading = false;
114
+        this.scoreList = data.list || [];
115
+      });
116
+  }
117
+
118
+  // 边输边搜节流阀
119
+  isLoading = false;
120
+  changeInp(model, e) {
121
+    this.isLoading = true;
122
+    this.changeInpSubject.next([model, e]);
123
+  }
124
+
125
+  // 搜索
126
+  // 获取用户
127
+  userList: any = [];
128
+  getUsers(keyword = '', isShowValue = false) {
129
+    if((!this.validateConfigForm.value.groupId && this.validateConfigForm.value.userGroup === 1) || this.validateConfigForm.value.userGroup === 2){
130
+      this.userList = [];
131
+      return;
132
+    }
133
+    let postData = {
134
+      user: {
135
+        hospital: { id: this.validateConfigForm.value.dutyId },
136
+        name: keyword,
137
+        simpleQuery: true,
138
+        groupdata: { id: this.validateConfigForm.value.groupId },
139
+      },
140
+      idx: 0,
141
+      sum: 10,
142
+    };
143
+    this.mainService
144
+      .getFetchDataList("data", "user", postData)
145
+      .subscribe((data) => {
146
+        this.isLoading = false;
147
+        let userList = data.list || [];
148
+        if(isShowValue && this.coopData && this.coopData.userId){
149
+          userList = userList.filter(v => v.id !== this.coopData.userId)
150
+          userList.unshift(this.coopData.userDTO);
151
+        }
152
+        this.userList = userList;
153
+      });
154
+  }
155
+
156
+  // 获取组
157
+  groupList: any = []; //所有所属科室(搜索)
158
+  getGroups(keyword = '', isShowValue = false) {
159
+    if(!this.validateConfigForm.value.dutyId){
160
+      this.groupList = [];
161
+      return;
162
+    }
163
+    let postData = {
164
+      group2: {
165
+        groupName: keyword,
166
+        hospitals: this.validateConfigForm.value.dutyId,
167
+        type: 1,
168
+      },
169
+      idx: 0,
170
+      sum: 10,
171
+    };
172
+    this.mainService
173
+      .getFetchDataList("data", "group2", postData)
174
+      .subscribe((data) => {
175
+        this.isLoading = false;
176
+        let groupList = data.list || [];
177
+        if(isShowValue && this.coopData && this.coopData.groupId){
178
+          groupList = groupList.filter(v => v.id !== this.coopData.groupId)
179
+          groupList.unshift(this.coopData.groupDTO);
180
+        }
181
+        this.groupList = groupList;
182
+      });
183
+  }
184
+
185
+  // 点击故障现象
186
+  activeCategory1:any = {};
187
+  activeCategory2:any = {};
188
+  activeCategory3:any = {};
189
+  clickCategory(item, type:number){
190
+    this.categoryConfigList = [];
191
+    switch(type){
192
+      case 1:
193
+        this.categoryList2 = [];
194
+        this.categoryList3 = [];
195
+        this.activeCategory2 = {};
196
+        this.activeCategory3 = {};
197
+        break;
198
+      case 2:
199
+        this.categoryList3 = [];
200
+        this.activeCategory3 = {};
201
+        break;
202
+    }
203
+    this['activeCategory' + type] = item;
204
+    console.log(this['activeCategory' + type])
205
+    switch(type){
206
+      case 1:
207
+        this.categoryLoading2 = true;
208
+        this.loading1 = true;
209
+        this.debounceSubject.next([2, item]);
210
+        break;
211
+      case 2:
212
+        this.categoryLoading3 = true;
213
+        this.loading1 = true;
214
+        this.debounceSubject.next([3, item]);
215
+        break;
216
+      case 3:
217
+        this.loading1 = true;
218
+        this.debounceSubject.next([0, item]);
219
+        break;
220
+    }
221
+  }
222
+
223
+  // 选择部门设置或全院设置
224
+  changeHospitalConfig(e){
225
+    console.log(e);
226
+    this.getCategoryList(1);
227
+
228
+    this.categoryList2 = [];
229
+    this.categoryList3 = [];
230
+
231
+    this.activeCategory1 = {};
232
+    this.activeCategory2 = {};
233
+    this.activeCategory3 = {};
234
+
235
+    this.categoryConfigList = [];
236
+  }
237
+
238
+  // 获取当前选中的故障现象索引
239
+  get currentCategoryIndex(){
240
+    if(this.activeCategory3.id){
241
+      return 3;
242
+    }
243
+    if(this.activeCategory2.id){
244
+      return 2;
245
+    }
246
+    if(this.activeCategory1.id){
247
+      return 1;
248
+    }
249
+  }
250
+
251
+  // 获取当前选中的故障现象索引
252
+  get currentCategory(){
253
+    if(this.activeCategory3.id){
254
+      return this.activeCategory3;
255
+    }
256
+    if(this.activeCategory2.id){
257
+      return this.activeCategory2;
258
+    }
259
+    if(this.activeCategory1.id){
260
+      return this.activeCategory1;
261
+    }
262
+  }
263
+
264
+  // 获取当前选中的故障现象有没有子故障现象
265
+  get currentChildrenCategoryList(){
266
+    return this.currentCategoryIndex && this.currentCategoryIndex < 3 && this['categoryList' + (this.currentCategoryIndex + 1)].length;
267
+  }
268
+  categoryConfigList:any[] = [];
269
+  getCategoryConfigList(parentId = 0) {
270
+    this.loading1 = true;
271
+    let postData = {
272
+      idx: 0,
273
+      sum: 9999,
274
+      incidentCategoryConfig: {
275
+        categoryId: parentId,
276
+        dutyId: this.hospitalConfig === 1 ? this.currentHospital.id  : undefined,
277
+      },
278
+    };
279
+    this.mainService.getFetchDataList("simple/data", "incidentCategoryConfig", postData).subscribe(res => {
280
+      this.loading1 = false;
281
+      this.categoryConfigList = res.list || [];
282
+    })
283
+  }
284
+
285
+  // 修改院区
286
+  changeHospital(id){
287
+    this.validateConfigForm.controls.dutyId.setValue(null);
288
+    this.validateConfigForm.controls.userId.setValue(null);
289
+    this.validateConfigForm.controls.groupId.setValue(null);
290
+
291
+    this.dutyList = [];
292
+    this.userList = [];
293
+    this.groupList = [];
294
+    this.getHospitals(2, id);
295
+  }
296
+
297
+  // 获取院区
298
+  hospitalList: any = [];
299
+  dutyList: any = [];
300
+  getHospitals(type:number, parentId?) {
301
+    if(type === 1){
302
+      this.hospitalList = this.tool.getHospitalList().filter(v => !v.parent);
303
+      return;
304
+    }
305
+    if(type === 2 && !parentId){
306
+      this.dutyList = [];
307
+      return;
308
+    }
309
+    let postData = {
310
+      hospital: {
311
+        parent: { id: parentId },
312
+        type: { key: 'hospital_type', value: '6' },
313
+      },
314
+      idx: 0,
315
+      sum: 9999,
316
+    };
317
+    this.mainService
318
+      .getFetchDataList("data", "hospital", postData)
319
+      .subscribe((data) => {
320
+        this.isLoading = false;
321
+        this.dutyList = data.list || [];
322
+      });
323
+  }
324
+
325
+  // 修改责任部门
326
+  changeDuty(id){
327
+    this.validateConfigForm.controls.userId.setValue(null);
328
+    this.validateConfigForm.controls.groupId.setValue(null);
329
+
330
+    this.userList = [];
331
+    this.groupList = [];
332
+    this.getGroups();
333
+  }
334
+
335
+  // 一级故障现象
336
+  loading1:boolean = false;
337
+  tableCategoryHeight:number = 0;
338
+  categoryList1: any[] = [];
339
+  categoryList2: any[] = [];
340
+  categoryList3: any[] = [];
341
+  categoryLoading1:boolean = false;
342
+  categoryLoading2:boolean = false;
343
+  categoryLoading3:boolean = false;
344
+  getCategoryList(type:number, parentId = 0) {
345
+    setTimeout(() => {
346
+      this['categoryLoading' + type] = true;
347
+    }, 0)
348
+    let postData = {
349
+      category: {
350
+        hierarchy: type === 1 ? 1 : undefined,
351
+        dutyIds: this.hospitalConfig === 1 ? this.currentHospital.id.toString()  : undefined,
352
+        parent: type === 1 ? undefined : { id: parentId },
353
+      },
354
+    };
355
+    this.mainService.incidentPost("listIncidentCategory", postData).subscribe(res => {
356
+      this['categoryLoading' + type] = false;
357
+      this['categoryList' + type] = res.data || [];
358
+    })
359
+  }
360
+
361
+  // 新增故障现象弹框
362
+  modelName = ""; //模态框名称
363
+  add: boolean; //true:新增;false:编辑
364
+  modalCategory: boolean = false; //新增/编辑模态框
365
+  coopType: number = 0;
366
+  addCategoryModal(type:number) {
367
+    this.coopType = type;
368
+    this.modelName = "新增";
369
+    this.add = true; //新增
370
+    this.modalCategory = true;
371
+    this.initCategoryForm();
372
+  }
373
+  //关闭新增/编辑弹框
374
+  hideCategoryModal() {
375
+    this.modalCategory = false;
376
+  }
377
+
378
+  // 初始化新增form表单
379
+  validateCategoryForm: FormGroup; //新增/编辑表单
380
+  initCategoryForm() {
381
+    this.validateCategoryForm = this.fb.group({
382
+      name: [null, [Validators.required]],//名称
383
+    });
384
+    console.log(this.validateCategoryForm.controls)
385
+  }
386
+
387
+  // 编辑
388
+  // editCategory(data) {
389
+  //   console.log(data);
390
+  //   this.modelName = "编辑";
391
+  //   this.add = false;
392
+  //   this.modalCategory = true;
393
+  //   this.initCategoryForm();
394
+  //   this.coopData = data;
395
+  //   this.validateCategoryForm.controls.name.setValue(data.name);
396
+  // }
397
+
398
+  // 新增/编辑表单提交
399
+  btnLoading: boolean = false; //提交按钮loading状态
400
+  submitCategoryForm(): void {
401
+    for (const i in this.validateCategoryForm.controls) {
402
+      this.validateCategoryForm.controls[i].markAsDirty();
403
+      this.validateCategoryForm.controls[i].updateValueAndValidity();
404
+    }
405
+    if (this.validateCategoryForm.invalid) {
406
+      return;
407
+    }
408
+    console.log(this.validateCategoryForm.value);
409
+    this.btnLoading = true;
410
+    // -----------------------------------
411
+    let postData:any = {
412
+      category: {
413
+        hosId: this.currentHospital.id,
414
+        parent: this.coopType === 1 ? undefined : this['activeCategory' + (this.coopType - 1)],
415
+        category: this.validateCategoryForm.value.name,
416
+        hierarchy: this.coopType,
417
+        dutyIds: this.hospitalConfig === 1 ? this.currentHospital.id.toString() : undefined,
418
+      },
419
+    };
420
+    this.mainService
421
+      .incidentPost("checkIncidentCategory", postData)
422
+      .subscribe((result) => {
423
+        let msg = "";
424
+        if (this.add) {
425
+          msg = "新增";
426
+        } else {
427
+          msg = "修改";
428
+        }
429
+        if (result.status == 200) {
430
+          this.submitCategoryAddForm();
431
+        } else if(result.status == 502) {
432
+          this.btnLoading = false;
433
+          this.showDelModal(null, result.msg, '', 'relevance');
434
+        } else {
435
+          this.btnLoading = false;
436
+          this.showPromptModal(msg, false, result.msg);
437
+        }
438
+      });
439
+    // -----------------------------------
440
+  }
441
+
442
+  delModal: boolean = false; //删除模态框
443
+  tipsMsg1: string; //提示框信息
444
+  tipsMsg2: string; //操作后信息
445
+  confirmDelType: string; //确认的类型(启用/停用,删除)
446
+  showDelModal(
447
+    data,
448
+    tipsMsg1: string,
449
+    tipsMsg2: string,
450
+    type: string,
451
+  ) {
452
+    this.confirmDelType = type;
453
+    this.delModal = true;
454
+    this.coopData = data;
455
+    this.tipsMsg1 = tipsMsg1;
456
+    this.tipsMsg2 = tipsMsg2;
457
+  }
458
+  // 隐藏删除框
459
+  hideDelModal() {
460
+    this.delModal = false;
461
+  }
462
+  // 确认删除
463
+  confirmDel() {
464
+    this.btnLoading = true;
465
+    if (this.confirmDelType === "relevance") {
466
+      //新增故障现象-关联
467
+      this.btnLoading = false;
468
+      this.delModal = false;
469
+      this.submitCategoryAddForm();
470
+    } else if (this.confirmDelType === "delConfig") {
471
+      //删除-关联
472
+      this.mainService
473
+        .simplePost("rmvData", "incidentCategoryConfig", [this.coopData.id])
474
+        .subscribe((data) => {
475
+          this.btnLoading = false;
476
+          this.delModal = false;
477
+          if (data.status == 200) {
478
+            this.showPromptModal(this.tipsMsg2, true, "");
479
+          } else {
480
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
481
+          }
482
+        });
483
+    } else if (this.confirmDelType === "copy") {
484
+      //向下复制-关联
485
+      let postData:any = {
486
+        type: this.hospitalConfig === 1 ? 'duty': 'hospital',
487
+        category: this.currentCategory,
488
+      };
489
+      postData.category.dutyIds = this.hospitalConfig === 1 ? this.currentHospital.id.toString() : undefined;
490
+      this.mainService
491
+        .incidentPost("copyIncidentCategoryConfig", postData)
492
+        .subscribe((data) => {
493
+          this.btnLoading = false;
494
+          this.delModal = false;
495
+          if (data.status == 200) {
496
+            this.showPromptModal(this.tipsMsg2, true, "");
497
+          } else {
498
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
499
+          }
500
+        });
501
+    }
502
+  }
503
+
504
+  submitCategoryAddForm(): void {
505
+    let postData:any = {};
506
+    if (this.add) {
507
+      //增加
508
+      console.log(this['activeCategory' + this.coopType])
509
+      postData = {
510
+        category: {
511
+          hosId: this.currentHospital.id,
512
+          parent: this.coopType === 1 ? undefined : this['activeCategory' + (this.coopType - 1)],
513
+          category: this.validateCategoryForm.value.name,
514
+          hierarchy: this.coopType,
515
+          dutyIds: this.hospitalConfig === 1 ? this.currentHospital.id.toString() : undefined,
516
+        },
517
+      };
518
+    } else {
519
+      //编辑
520
+      // postData = {
521
+      //   category: {
522
+      //     hosId: this.currentHospital.id,
523
+      //     parent: this.coopType === 1 ? undefined : { id: this.coopData.id },
524
+      //     category: this.validateCategoryForm.value.name,
525
+      //     hierarchy: this.coopType,
526
+      //   },
527
+      // };
528
+    }
529
+    this.mainService
530
+      .incidentPost("addIncidentCategory", postData)
531
+      .subscribe((result) => {
532
+        this.btnLoading = false;
533
+        this.hideCategoryModal();
534
+        let msg = "";
535
+        if (this.add) {
536
+          msg = "新增";
537
+        } else {
538
+          msg = "修改";
539
+        }
540
+        if (result.status == 200) {
541
+          this.showPromptModal(msg, true, '');
542
+        } else {
543
+          this.showPromptModal(msg, false, result.msg);
544
+        }
545
+      });
546
+  }
547
+
548
+  // ------------------------------
549
+  // 新增故障现象-关联弹框
550
+  modalConfig: boolean = false; //新增/编辑模态框
551
+  addConfigModal() {
552
+    this.modelName = "新增";
553
+    this.add = true; //新增
554
+    this.modalConfig = true;
555
+    this.initConfigForm();
556
+    this.requiredConfigChange('userId', true);
557
+  }
558
+  //关闭新增/编辑弹框
559
+  hideConfigModal() {
560
+    this.modalConfig = false;
561
+  }
562
+
563
+  // 初始化新增form表单
564
+  validateConfigForm: FormGroup; //新增/编辑表单
565
+  initConfigForm() {
566
+    this.validateConfigForm = this.fb.group({
567
+      hosId: [null, [Validators.required]],//院区
568
+      dutyId: [null, [Validators.required]],//责任部门
569
+      priority: [null, [Validators.required]],//优先级
570
+      score: [null, [Validators.required]],//积分
571
+      userGroup: [1, [Validators.required]],//分配方式
572
+      userId: [null],//维修人
573
+      groupId: [null, [Validators.required]],//维修组
574
+    });
575
+    console.log(this.validateConfigForm.controls)
576
+  }
577
+
578
+  // 选择人|组
579
+  changeUserGroup(id){
580
+    this.validateConfigForm.controls.userId.setValue(null);
581
+    this.validateConfigForm.controls.groupId.setValue(null);
582
+    this.userList = [];
583
+    if(id === 1){
584
+      // 人
585
+      this.requiredConfigChange('userId', true);
586
+    }else if(id === 2){
587
+      // 组
588
+      this.requiredConfigChange('userId', false);
589
+    }
590
+  }
591
+
592
+  // 编辑
593
+  editConfig(data) {
594
+    console.log(data);
595
+    this.modelName = "编辑";
596
+    this.add = false;
597
+    this.modalConfig = true;
598
+    this.initConfigForm();
599
+    this.coopData = data;
600
+    this.validateConfigForm.controls.hosId.setValue(data.hosId);
601
+    this.validateConfigForm.controls.dutyId.setValue(data.dutyId);
602
+    this.validateConfigForm.controls.priority.setValue(data.priority);
603
+    this.validateConfigForm.controls.score.setValue(data.score ? data.score.id : null);
604
+    this.validateConfigForm.controls.userGroup.setValue(data.userGroup);
605
+    this.validateConfigForm.controls.userId.setValue(data.userId);
606
+    this.validateConfigForm.controls.groupId.setValue(data.groupId);
607
+    if(data.userGroup === 1){
608
+      this.requiredConfigChange('userId', true);
609
+    }else if(data.userGroup === 2){
610
+      this.requiredConfigChange('userId', false);
611
+    }
612
+    data.hosId && this.getHospitals(2, data.hosId);
613
+    data.dutyId && this.getUsers('', true);
614
+    data.dutyId && this.getGroups('', true);
615
+  }
616
+
617
+  // 修改组
618
+  changeGroup(id){
619
+    this.validateConfigForm.controls.userId.setValue(null);
620
+    this.getUsers();
621
+  }
622
+
623
+  // 新增/编辑表单提交
624
+  submitConfigForm(): void {
625
+    for (const i in this.validateConfigForm.controls) {
626
+      this.validateConfigForm.controls[i].markAsDirty();
627
+      this.validateConfigForm.controls[i].updateValueAndValidity();
628
+    }
629
+    if (this.validateConfigForm.invalid) {
630
+      return;
631
+    }
632
+    console.log(this.validateConfigForm.value);
633
+    this.btnLoading = true;
634
+    let postData:any = {};
635
+
636
+    let categoryId = this.activeCategory3.id || this.activeCategory2.id || this.activeCategory1.id;
637
+
638
+    if (this.add) {
639
+      //增加
640
+      postData = {
641
+        incidentCategoryConfig: {
642
+          categoryId,
643
+          priority: this.validateConfigForm.value.priority,
644
+          score: { id: this.validateConfigForm.value.score },
645
+          dutyId: this.validateConfigForm.value.dutyId,
646
+          userGroup: this.validateConfigForm.value.userGroup,
647
+          groupId: this.validateConfigForm.value.groupId || undefined,
648
+          userId: this.validateConfigForm.value.userGroup === 1 ? this.validateConfigForm.value.userId : undefined,
649
+          hosId: this.currentHospital.id,
650
+        }
651
+      };
652
+    } else {
653
+      //编辑
654
+      postData = {
655
+        incidentCategoryConfig: {
656
+          ...this.coopData,
657
+          ...{
658
+            categoryId,
659
+            priority: this.validateConfigForm.value.priority,
660
+            score: { id: this.validateConfigForm.value.score },
661
+            userGroup: this.validateConfigForm.value.userGroup,
662
+            groupId: this.validateConfigForm.value.groupId || undefined,
663
+            userId: this.validateConfigForm.value.userGroup === 1 ? this.validateConfigForm.value.userId : undefined,
664
+          }
665
+        }
666
+      };
667
+    }
668
+    console.log(postData);
669
+    this.mainService
670
+      .coopData("addData", "incidentCategoryConfig", postData)
671
+      .subscribe((result) => {
672
+        this.btnLoading = false;
673
+        this.hideConfigModal();
674
+        let msg = "";
675
+        if (this.add) {
676
+          msg = "新增";
677
+        } else {
678
+          msg = "修改";
679
+        }
680
+        if (result.status == 200) {
681
+          this.showPromptModal(msg, true, '');
682
+        } else {
683
+          this.showPromptModal(msg, false, result.msg);
684
+        }
685
+      });
686
+  }
687
+
688
+  requiredConfigChange(name: string, required: boolean): void {
689
+    if (!required) {
690
+      this.validateConfigForm.get(name)!.clearValidators();
691
+      this.validateConfigForm.get(name)!.markAsPristine();
692
+    } else {
693
+      this.validateConfigForm.get(name)!.setValidators(Validators.required);
694
+      this.validateConfigForm.get(name)!.markAsDirty();
695
+    }
696
+    this.validateConfigForm.get(name)!.updateValueAndValidity();
697
+  }
698
+
699
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
700
+  promptContent: string; //操作提示框提示信息
701
+  ifSuccess: boolean; //操作成功/失败
702
+  promptInfo: string; //操作结果提示信息
703
+  promptModalShow: boolean; //操作提示框是否展示
704
+  showPromptModal(con, success, promptInfo?) {
705
+    this.promptModalShow = false;
706
+    this.promptContent = con;
707
+    this.ifSuccess = success;
708
+    this.promptInfo = promptInfo;
709
+    setTimeout(() => {
710
+      this.promptModalShow = true;
711
+    }, 100);
712
+    if(this.coopType !== 0){
713
+      this.getCategoryList(this.coopType, this.coopType === 1 ? undefined : this['activeCategory' + (this.coopType - 1)].id);
714
+    }else{
715
+      this.getCategoryList(this.currentCategoryIndex, this.currentCategoryIndex === 1 ? undefined : this['activeCategory' + (this.currentCategoryIndex - 1)].id);
716
+    }
717
+    if(this.activeCategory3.id || this.activeCategory2.id || this.activeCategory1.id){
718
+      this.getCategoryConfigList(this.activeCategory3.id || this.activeCategory2.id || this.activeCategory1.id);
719
+    }
720
+  }
721
+}

+ 66 - 0
src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component.html

@@ -0,0 +1,66 @@
1
+<div class="content" id="dictionary">
2
+  <div class="contentInner">
3
+    <div class="address">
4
+      <overlay-scrollbars #osComponentRef1 class="contentBody">
5
+        <div class="contentItem" [title]="item.name" [ngClass]="{ active: item.id === activeDictionaryKey.id }" (click)="clickDictionaryKey(item)" *ngFor="let item of dictionaryKeyList">{{ item.name }}</div>
6
+      </overlay-scrollbars>
7
+    </div>
8
+    <div class="addressAssign">
9
+      <div class="contentBody">
10
+        <div class="dictionaryRow">
11
+          <div class="orders">排序号</div>
12
+          <div class="name">键</div>
13
+          <div class="value">值</div>
14
+        </div>
15
+        <form nz-form [formGroup]="validateDictionaryForm" class="w100">
16
+          <div class="dictionaryRow" *ngFor="let data of dictionaryList;let i = index;">
17
+            <div class="orders">
18
+              <nz-form-item>
19
+                <nz-form-control [nzSpan]="24" nzErrorTip="请输入排序号!">
20
+                  <nz-input-group>
21
+                    <nz-input-number [formControlName]="'orders_' + data.id" class="ordersInput"></nz-input-number>
22
+                  </nz-input-group>
23
+                </nz-form-control>
24
+              </nz-form-item>
25
+            </div>
26
+            <div class="name">
27
+              <nz-form-item>
28
+                <nz-form-control [nzSpan]="24" nzErrorTip="请输入键!">
29
+                  <nz-input-group>
30
+                    <input [formControlName]="'name_' + data.id" nz-input class="nameInput">
31
+                  </nz-input-group>
32
+                </nz-form-control>
33
+              </nz-form-item>
34
+            </div>
35
+            <div class="value">
36
+              <nz-form-item>
37
+                <nz-form-control [nzSpan]="24" nzErrorTip="请输入值!">
38
+                  <nz-input-group>
39
+                    <input [formControlName]="'value_' + data.id" nz-input class="valueInput">
40
+                  </nz-input-group>
41
+                </nz-form-control>
42
+              </nz-form-item>
43
+              <i class="icon_transport transport-tag27fuben ml8" (click)="addField(i)"></i>
44
+              <i class="icon_transport transport-shanchu1 ml8" *ngIf="dictionaryList.length > 1 && !data.system" (click)="removeField(data, i)"></i>
45
+            </div>
46
+          </div>
47
+        </form>
48
+      </div>
49
+      <div class="contentBtns">
50
+        <button nz-button nzType="primary" class="ml8" (click)="saveDictionary()">保存</button>
51
+      </div>
52
+    </div>
53
+  </div>
54
+</div>
55
+
56
+<!-- 操作成功/失败提示框 -->
57
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
58
+  [info]="promptInfo">
59
+</app-prompt-modal>
60
+
61
+<!-- 删除模态框 -->
62
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
63
+(confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
64
+
65
+<!-- 遮罩 -->
66
+<app-mask *ngIf="maskFlag"></app-mask>

+ 172 - 0
src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component.less

@@ -0,0 +1,172 @@
1
+@import "../../../../../src/theme.less";
2
+:host {
3
+  height: 100%;
4
+  display: flex;
5
+  flex-direction: column;
6
+  justify-content: space-between;
7
+  background-color: #F0F2F5;
8
+  .list-template__nzTable,
9
+  .list-template__bottom{
10
+    padding: 0!important;
11
+    border: none!important;
12
+    background: #fff!important;
13
+  }
14
+  .list-template{
15
+    width: 100%!important;
16
+    height: 100%!important;
17
+  }
18
+  #dictionary{
19
+    margin: 24px 16px;
20
+    .addressAssign{
21
+      flex: 7;
22
+    }
23
+    .contentItem{
24
+      margin: 0 16px;
25
+      padding: 8px;
26
+      text-align: center;
27
+      &.active{
28
+        background-color: @primary-color;
29
+        color: #fff;
30
+        border-radius: 4px;
31
+      }
32
+    }
33
+    .contentBody{
34
+      padding: 16px;
35
+    }
36
+    ::ng-deep .ant-form-item{
37
+      margin-bottom: 0;
38
+    }
39
+    .dictionaryRow{
40
+      display: flex;
41
+      align-items: center;
42
+      justify-content: center;
43
+      gap: 16px;
44
+      .orders{
45
+        flex: 1;
46
+        display: flex;
47
+        justify-content: flex-end;
48
+        align-items: center;
49
+      }
50
+      .name{
51
+        width: 100px;
52
+        display: flex;
53
+        justify-content: flex-end;
54
+        align-items: center;
55
+      }
56
+      .value{
57
+        flex: 3;
58
+        display: flex;
59
+        align-items: center;
60
+        .valueInput{
61
+          width: 600px;
62
+        }
63
+        .icon_transport{
64
+          font-size: 20px;
65
+          color: #8a8a8a;
66
+          cursor: pointer;
67
+        }
68
+      }
69
+
70
+    }
71
+  }
72
+  .content{
73
+    flex: 1;
74
+    min-height: 0;
75
+    display: flex;
76
+    flex-direction: column;
77
+    justify-content: space-between;
78
+    border: 1px solid #EEF3F9;
79
+    &.priority{
80
+      margin: 24px 118px 0;
81
+      background-color: #fff;
82
+      .contentInner{
83
+        padding: 48px 206px;
84
+        border: 1px solid #E8EBEF;
85
+      }
86
+    }
87
+    .contentItem{
88
+      padding: 4px 16px;
89
+      cursor: pointer;
90
+      overflow: hidden;
91
+      text-overflow: ellipsis;
92
+      white-space: nowrap;
93
+      &.active{
94
+        color: @primary-color;
95
+        background-color: #F0F6ED;
96
+        border-radius: 4px;
97
+      }
98
+    }
99
+    .contentInner{
100
+      flex: 1;
101
+      display: flex;
102
+      justify-content: space-between;
103
+      align-items: center;
104
+      padding: 0 16px;
105
+      gap: 16px;
106
+      .contentHead{
107
+        height: 45px;
108
+        display: flex;
109
+        justify-content: space-between;
110
+        align-items: center;
111
+        gap: 16px;
112
+        padding: 0 16px;
113
+        font-size: 16px;
114
+        font-weight: bold;
115
+        border-bottom: 1px solid #D9D9D9;
116
+        .title{
117
+          overflow: hidden;
118
+          text-overflow: ellipsis;
119
+          white-space: nowrap;
120
+        }
121
+        .btns{
122
+          flex-shrink: 0;
123
+        }
124
+      }
125
+      .contentBody{
126
+        padding: 0 8px;
127
+        margin: 4px 0;
128
+        flex: 1;
129
+      }
130
+      .address{
131
+        flex: 1;
132
+        height: 100%;
133
+        background: #FFFFFF;
134
+        border: 1px solid #E8EBEF;
135
+        display: flex;
136
+        flex-direction: column;
137
+        width: 0;
138
+      }
139
+      .addressAssign{
140
+        flex: 3;
141
+        height: 100%;
142
+        background: #FFFFFF;
143
+        border: 1px solid #E8EBEF;
144
+        display: flex;
145
+        flex-direction: column;
146
+        width: 0;
147
+      }
148
+      .list-template__searchItem {
149
+        margin-bottom: 16px;
150
+        .label {
151
+          color: #333;
152
+          display: inline-block;
153
+          width: 70px;
154
+          text-align-last: justify;
155
+          text-align: justify;
156
+          &.label--big {
157
+            width: 100px;
158
+          }
159
+        }
160
+        .formItem {
161
+          width: 135px;
162
+        }
163
+      }
164
+    }
165
+    .contentBtns{
166
+      margin-bottom: 16px;
167
+      display: flex;
168
+      justify-content: center;
169
+      align-items: center;
170
+    }
171
+  }
172
+}

+ 249 - 0
src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component.ts

@@ -0,0 +1,249 @@
1
+import { Component, OnInit, ViewChild } from "@angular/core";
2
+import { ActivatedRoute } from "@angular/router";
3
+import { MainService } from "../../../services/main.service";
4
+import { Validators, FormGroup, FormBuilder, FormControl } from '@angular/forms';
5
+import { ToolService } from 'src/app/services/tool.service';
6
+import { OverlayScrollbarsComponent } from 'overlayscrollbars-ngx';
7
+import { NzMessageService } from 'ng-zorro-antd';
8
+import { v4 as uuidv4, validate as uuidValidate } from 'uuid';
9
+
10
+@Component({
11
+  selector: "app-configuration-dictionary",
12
+  templateUrl: "./configuration-dictionary.component.html",
13
+  styleUrls: ["./configuration-dictionary.component.less"],
14
+})
15
+export class ConfigurationDictionaryComponent implements OnInit {
16
+  constructor(
17
+    private route: ActivatedRoute,
18
+    private mainService: MainService,
19
+    private fb: FormBuilder,
20
+    private tool: ToolService,
21
+    private message: NzMessageService,
22
+  ) {}
23
+
24
+  @ViewChild("osComponentRef1", {
25
+    read: OverlayScrollbarsComponent,
26
+    static: false,
27
+  })
28
+  osComponentRef1: OverlayScrollbarsComponent;
29
+
30
+  ngOnInit() {
31
+    this.initDictionaryForm();
32
+    this.getDictionaryList();
33
+  }
34
+
35
+  // 数据字典key列表
36
+  dictionaryKeyList: any[] = [
37
+    { id: 1, name: '积分配置', key: "incident_category_score"},
38
+    { id: 2, name: '事件来源', key: "incident_source"},
39
+    { id: 3, name: '处理结果', key: "incident_closecode"},
40
+    { id: 4, name: '处理方式', key: "incident_handle_type"},
41
+    { id: 5, name: '状态', key: "incident_status"},
42
+    { id: 6, name: '维修记录', key: "repair_type"},
43
+    { id: 7, name: '满意度评价', key: "incident_degree"},
44
+  ];
45
+
46
+  // 点击数据字典key
47
+  activeDictionaryKey:any = this.dictionaryKeyList[0];
48
+  clickDictionaryKey(item){
49
+    this.activeDictionaryKey = item;
50
+    this.getDictionaryList();
51
+  }
52
+
53
+  btnLoading: boolean = false; //提交按钮loading状态
54
+  // ------------------------------
55
+
56
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
57
+  promptContent: string; //操作提示框提示信息
58
+  ifSuccess: boolean; //操作成功/失败
59
+  promptInfo: string; //操作结果提示信息
60
+  promptModalShow: boolean; //操作提示框是否展示
61
+  showPromptModal(con, success, promptInfo?) {
62
+    this.promptModalShow = false;
63
+    this.promptContent = con;
64
+    this.ifSuccess = success;
65
+    this.promptInfo = promptInfo;
66
+    setTimeout(() => {
67
+      this.promptModalShow = true;
68
+    }, 100);
69
+    this.getDictionaryList();
70
+  }
71
+
72
+  coopData: any = {}; //当前操作列
73
+
74
+  delModal: boolean = false; //删除模态框
75
+  tipsMsg1: string; //提示框信息
76
+  tipsMsg2: string; //操作后信息
77
+  confirmDelType: string; //确认的类型(启用/停用,删除)
78
+  showDelModal(
79
+    data,
80
+    tipsMsg1: string,
81
+    tipsMsg2: string,
82
+    type: string,
83
+  ) {
84
+    this.confirmDelType = type;
85
+    this.delModal = true;
86
+    this.coopData = data;
87
+    this.tipsMsg1 = tipsMsg1;
88
+    this.tipsMsg2 = tipsMsg2;
89
+  }
90
+  // 隐藏删除框
91
+  hideDelModal() {
92
+    this.delModal = false;
93
+  }
94
+  // 确认删除
95
+  confirmDel() {
96
+    this.btnLoading = true;
97
+    if (this.confirmDelType === "delDictionary") {
98
+      //删除-数据字典
99
+      this.mainService
100
+        .simplePost("rmvData", "dictionary", [this.coopData.id])
101
+        .subscribe((data) => {
102
+          this.btnLoading = false;
103
+          this.delModal = false;
104
+          if (data.status == 200) {
105
+            this.showPromptModal(this.tipsMsg2, true, "");
106
+          } else {
107
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
108
+          }
109
+        });
110
+    }
111
+  }
112
+
113
+  // 初始化数据字典新增form表单
114
+  validateDictionaryForm: FormGroup; //新增/编辑表单
115
+  dictionaryList: any = [];
116
+  initDictionaryForm() {
117
+    this.validateDictionaryForm = this.fb.group({
118
+      // name: [null, [Validators.required]],//键
119
+      // value: [null, [Validators.required]],//值
120
+      // orders: [null, [Validators.required]],//排序号
121
+    });
122
+    console.log(this.validateDictionaryForm.controls)
123
+  }
124
+
125
+  // 获取数据字典数据
126
+  maskFlag: any = false;
127
+  getDictionaryList() {
128
+    let postData = {
129
+      idx: 0,
130
+      sum: 9999,
131
+      dictionary: {
132
+        key: this.activeDictionaryKey.key,
133
+      }
134
+    }
135
+    this.maskFlag = this.message.loading("正在加载中..", {
136
+      nzDuration: 0,
137
+    }).messageId;
138
+    this.mainService.getFetchDataList('simple/data','dictionary',postData).subscribe(data => {
139
+      this.message.remove(this.maskFlag);
140
+      this.maskFlag = false;
141
+      let list = data.list || [];
142
+      if(list.length){
143
+        this.dictionaryList = list.map(v => {
144
+          return {
145
+            id: v.id,
146
+            name: v.name || null,
147
+            value: v.value || null,
148
+            orders: v.orders || null,
149
+            system: v.system || false,
150
+          }
151
+        });
152
+      }else{
153
+        this.dictionaryList = [
154
+          {
155
+            id: uuidv4(),
156
+            name: null,
157
+            value: null,
158
+            orders: null,
159
+            system: false,
160
+          }
161
+        ];
162
+      }
163
+
164
+      console.log(this.dictionaryList);
165
+      // 动态添加表单
166
+      this.dictionaryList.forEach((obj, i) => {
167
+        for (const key in obj) {
168
+          if(key !== 'id' && key !== 'system'){
169
+            this.validateDictionaryForm.addControl(key + '_' + obj.id, new FormControl({value: obj[key], disabled: key === 'value' ? obj.system : false}, [Validators.required]))
170
+          }
171
+        }
172
+      })
173
+    })
174
+  }
175
+
176
+  // 添加数据字典
177
+  addField(i:number): void{
178
+    let obj = {
179
+      id: uuidv4(),
180
+      name: null,
181
+      value: null,
182
+      orders: null,
183
+      system: false,
184
+    };
185
+
186
+    // 动态添加表单
187
+    for (const key in obj) {
188
+      console.log(key + '_' + obj.id)
189
+      if(key !== 'id' && key !== 'system'){
190
+        this.validateDictionaryForm.addControl(key + '_' + obj.id, new FormControl(null, [Validators.required]))
191
+      }
192
+    }
193
+
194
+    this.dictionaryList.splice(i + 1, 0, obj);
195
+  }
196
+
197
+  // 删除
198
+  removeField(obj, i:number): void {
199
+    if(uuidValidate(obj.id)){
200
+      this.dictionaryList.splice(i, 1);
201
+      this.dictionaryList = [...this.dictionaryList];
202
+      // 动态删除表单
203
+      for (const key in obj) {
204
+        this.validateDictionaryForm.removeControl(key + '_' + obj.id);
205
+      }
206
+    }else{
207
+      this.showDelModal(obj,'您确认要删除吗?','删除','delDictionary')
208
+    }
209
+  }
210
+
211
+  // 保存数据字典
212
+  saveDictionary(): void {
213
+    console.log(this.coopData)
214
+    for (const i in this.validateDictionaryForm.controls) {
215
+      this.validateDictionaryForm.controls[i].markAsDirty();
216
+      this.validateDictionaryForm.controls[i].updateValueAndValidity();
217
+    }
218
+    if (this.validateDictionaryForm.invalid) {
219
+      return;
220
+    }
221
+    console.log(this.validateDictionaryForm.value);
222
+    let postData:any = {};
223
+
224
+    //增加
225
+    postData = [];
226
+    for (let i = 0; i < this.dictionaryList.length; i++) {
227
+      postData.push({
228
+        id: uuidValidate(this.dictionaryList[i].id) ? undefined : this.dictionaryList[i].id,
229
+        name: this.validateDictionaryForm.value['name_' + this.dictionaryList[i].id],
230
+        value: this.validateDictionaryForm.value['value_' + this.dictionaryList[i].id],
231
+        orders: this.validateDictionaryForm.value['orders_' + this.dictionaryList[i].id],
232
+        system: uuidValidate(this.dictionaryList[i].id) ? false : this.dictionaryList[i].system,
233
+        key: this.activeDictionaryKey.key,
234
+      })
235
+    }
236
+    console.log(postData);
237
+    this.btnLoading = true;
238
+    this.mainService
239
+      .simplePost("addListData", "dictionary", postData)
240
+      .subscribe((result) => {
241
+        this.btnLoading = false;
242
+        if (result.status == 200) {
243
+          this.showPromptModal('保存', true, '');
244
+        } else {
245
+          this.showPromptModal('保存', false, result.msg || '');
246
+        }
247
+      });
248
+  }
249
+}

+ 97 - 0
src/app/components/configurationCenter/configuration-priority/configuration-priority.component.html

@@ -0,0 +1,97 @@
1
+<div class="content priority">
2
+  <div class="contentInner">
3
+    <div class="list-template" id="priorityTable">
4
+      <div class="list-template__content">
5
+        <div class="list-template__bottom">
6
+          <div class="list-template__top" nz-row>
7
+            <div nz-col nzLg="24" class="list-template__btns">
8
+              <button nz-button class="btn default" (click)="addPriorityModal()">新增</button>
9
+            </div>
10
+          </div>
11
+          <nz-table class="list-template__nzTable" [nzData]="priorityList" nzSize="middle" [nzShowPagination]="false"
12
+            [nzLoading]="loading1" [nzScroll]="{ y: tablePriorityHeight + 'px' }">
13
+            <thead>
14
+              <tr class="thead">
15
+                <th nzWidth="20%">优先级名称</th>
16
+                <th nzWidth="20%">排序</th>
17
+                <th nzWidth="20%">响应时间(分钟)</th>
18
+                <th nzWidth="20%">解决时间(分钟)</th>
19
+                <th nzWidth="20%">操作</th>
20
+              </tr>
21
+            </thead>
22
+            <tbody>
23
+              <tr *ngFor="let data of priorityList;let i = index">
24
+                <td>{{data.name}}</td>
25
+                <td>{{data.orders}}</td>
26
+                <td>{{data.responseTime}}</td>
27
+                <td>{{data.handleTime}}</td>
28
+                <td>
29
+                  <div class="coop">
30
+                    <span (click)="showDelModal(data,'您确认要删除吗?','删除','delPriority')">删除</span>
31
+                    <span (click)="editPriority(data)">编辑</span>
32
+                  </div>
33
+                </td>
34
+              </tr>
35
+            </tbody>
36
+          </nz-table>
37
+        </div>
38
+      </div>
39
+    </div>
40
+  </div>
41
+</div>
42
+
43
+<!-- 操作成功/失败提示框 -->
44
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
45
+  [info]="promptInfo">
46
+</app-prompt-modal>
47
+
48
+<!-- 删除模态框 -->
49
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
50
+(confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
51
+
52
+<!-- 新增/编辑优先级模态框 -->
53
+<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modalPriority">
54
+  <div class="modalBody">
55
+    <div class="title">{{modelName}}优先级<i class="icon_transport transport-guanbi" (click)="hidePriorityModal()"></i></div>
56
+    <div class="content">
57
+      <form nz-form [formGroup]="validatePriorityForm" class="addForm">
58
+        <nz-form-item>
59
+          <nz-form-label [nzSpan]="6" nzRequired nzFor="name">优先级名称</nz-form-label>
60
+          <nz-form-control [nzSpan]="18" nzErrorTip="请输入优先级名称!">
61
+            <nz-input-group>
62
+              <input formControlName="name" nz-input placeholder="请输入优先级名称">
63
+            </nz-input-group>
64
+          </nz-form-control>
65
+        </nz-form-item>
66
+        <nz-form-item>
67
+          <nz-form-label [nzSpan]="6" nzRequired nzFor="orders">排&nbsp;&nbsp;&nbsp;序&nbsp;&nbsp;&nbsp;号</nz-form-label>
68
+          <nz-form-control [nzSpan]="18" nzErrorTip="请输入排序号!">
69
+            <nz-input-group>
70
+              <nz-input-number class="w100" formControlName="orders" nzPlaceHolder="请输入排序号" [nzMin]="0" [nzStep]="1" [nzPrecision]="0"></nz-input-number>
71
+            </nz-input-group>
72
+          </nz-form-control>
73
+        </nz-form-item>
74
+        <nz-form-item>
75
+          <nz-form-label [nzSpan]="6" nzRequired nzFor="responseTime">响&nbsp;应&nbsp;时&nbsp;间</nz-form-label>
76
+          <nz-form-control [nzSpan]="18" nzErrorTip="请输入响应时间(分钟)!">
77
+            <nz-input-group>
78
+              <nz-input-number class="w100" formControlName="responseTime" nzPlaceHolder="请输入响应时间(分钟)" [nzMin]="0" [nzStep]="1" [nzPrecision]="0" [nzFormatter]="formatterMinute" [nzParser]="parserMinute"></nz-input-number>
79
+            </nz-input-group>
80
+          </nz-form-control>
81
+        </nz-form-item>
82
+        <nz-form-item>
83
+          <nz-form-label [nzSpan]="6" nzRequired nzFor="handleTime">解&nbsp;决&nbsp;时&nbsp;间</nz-form-label>
84
+          <nz-form-control [nzSpan]="18" nzErrorTip="请输入解决时间(分钟)!">
85
+            <nz-input-group>
86
+              <nz-input-number class="w100" formControlName="handleTime" nzPlaceHolder="请输入解决时间(分钟)" [nzMin]="0" [nzStep]="1" [nzPrecision]="0" [nzFormatter]="formatterMinute" [nzParser]="parserMinute"></nz-input-number>
87
+            </nz-input-group>
88
+          </nz-form-control>
89
+        </nz-form-item>
90
+      </form>
91
+    </div>
92
+    <div class=" display_flex justify-content_flex-center">
93
+      <button nzType="primary" nz-button (click)="submitPriorityForm()" [nzLoading]="btnLoading">确认</button>
94
+      <button class="btn cancel" nz-button nzType="default" (click)="hidePriorityModal()">取消</button>
95
+    </div>
96
+  </div>
97
+</div>

+ 289 - 0
src/app/components/configurationCenter/configuration-priority/configuration-priority.component.less

@@ -0,0 +1,289 @@
1
+@import "../../../../../src/theme.less";
2
+:host {
3
+  height: 100%;
4
+  display: flex;
5
+  flex-direction: column;
6
+  justify-content: space-between;
7
+  background-color: #F0F2F5;
8
+  .list-template__nzTable,
9
+  .list-template__bottom{
10
+    padding: 0!important;
11
+    border: none!important;
12
+    background: #fff!important;
13
+  }
14
+  .list-template{
15
+    width: 100%!important;
16
+    height: 100%!important;
17
+  }
18
+  .content{
19
+    flex: 1;
20
+    min-height: 0;
21
+    display: flex;
22
+    flex-direction: column;
23
+    justify-content: space-between;
24
+    border: 1px solid #EEF3F9;
25
+    &.priority{
26
+      margin: 24px 118px 0;
27
+      background-color: #fff;
28
+      .contentInner{
29
+        padding: 48px 206px;
30
+        border: 1px solid #E8EBEF;
31
+      }
32
+    }
33
+    .contentItem{
34
+      padding: 4px 16px;
35
+      cursor: pointer;
36
+      overflow: hidden;
37
+      text-overflow: ellipsis;
38
+      white-space: nowrap;
39
+      &.active{
40
+        color: @primary-color;
41
+        background-color: #F0F6ED;
42
+        border-radius: 4px;
43
+      }
44
+    }
45
+    .contentInner{
46
+      flex: 1;
47
+      display: flex;
48
+      justify-content: space-between;
49
+      align-items: center;
50
+      padding: 0 16px;
51
+      gap: 16px;
52
+      .contentHead{
53
+        height: 45px;
54
+        display: flex;
55
+        justify-content: space-between;
56
+        align-items: center;
57
+        gap: 16px;
58
+        padding: 0 16px;
59
+        font-size: 16px;
60
+        font-weight: bold;
61
+        border-bottom: 1px solid #D9D9D9;
62
+        .title{
63
+          overflow: hidden;
64
+          text-overflow: ellipsis;
65
+          white-space: nowrap;
66
+        }
67
+        .btns{
68
+          flex-shrink: 0;
69
+        }
70
+      }
71
+      .contentBody{
72
+        padding: 0 8px;
73
+        margin: 4px 0;
74
+        flex: 1;
75
+      }
76
+      .address{
77
+        flex: 1;
78
+        height: 100%;
79
+        background: #FFFFFF;
80
+        border: 1px solid #E8EBEF;
81
+        display: flex;
82
+        flex-direction: column;
83
+        width: 0;
84
+      }
85
+      .addressAssign{
86
+        flex: 3;
87
+        height: 100%;
88
+        background: #FFFFFF;
89
+        border: 1px solid #E8EBEF;
90
+        display: flex;
91
+        flex-direction: column;
92
+        width: 0;
93
+      }
94
+      .list-template__searchItem {
95
+        margin-bottom: 16px;
96
+        .label {
97
+          color: #333;
98
+          display: inline-block;
99
+          width: 70px;
100
+          text-align-last: justify;
101
+          text-align: justify;
102
+          &.label--big {
103
+            width: 100px;
104
+          }
105
+        }
106
+        .formItem {
107
+          width: 135px;
108
+        }
109
+      }
110
+    }
111
+    .contentBtns{
112
+      margin-bottom: 16px;
113
+      display: flex;
114
+      justify-content: center;
115
+      align-items: center;
116
+    }
117
+  }
118
+
119
+  .save {
120
+    position: fixed;
121
+    left: 0;
122
+    top: 0;
123
+    width: 100%;
124
+    height: 100%;
125
+    background: rgba(0, 0, 0, 0.4);
126
+    z-index: 99;
127
+
128
+    .tips{
129
+      margin-bottom: 16px!important;
130
+    }
131
+
132
+    .modalBody {
133
+      width: 350px;
134
+      background: #fff;
135
+      border-radius: 5px;
136
+      padding: 10px 20px;
137
+      color: #333;
138
+
139
+      .title {
140
+        width: 100%;
141
+        text-align: center;
142
+        font-size: 18px;
143
+        position: relative;
144
+
145
+        i {
146
+          position: absolute;
147
+          right: 0;
148
+          top: 0;
149
+          font-size: 20px;
150
+          color: #666;
151
+          cursor: pointer;
152
+          padding: 0 5px;
153
+        }
154
+      }
155
+
156
+      .content {
157
+        width: 310px;
158
+        background: #f9fafb;
159
+        border: 1px solid #e5e9ed;
160
+        border-radius: 5px;
161
+        overflow: hidden;
162
+        margin-top: 12px;
163
+        padding: 16px 0;
164
+
165
+        .busyList{
166
+          display: flex;
167
+          margin-bottom: 8px;
168
+          .busyContent{
169
+            margin-right: 8px;
170
+            flex: 1;
171
+          }
172
+        }
173
+
174
+        & > div {
175
+          text-align: center;
176
+          margin: 0;
177
+
178
+          &.icon {
179
+            // margin-top: 17px;
180
+
181
+            i {
182
+              color: #34b349;
183
+              font-size: 30px !important;
184
+
185
+              &.transport-wenhao {
186
+                color: #f5a523;
187
+              }
188
+
189
+              &.transport-shibai {
190
+                color: #ff3a52;
191
+              }
192
+            }
193
+          }
194
+
195
+          &.defeat {
196
+            color: #333;
197
+            font-size: 14px;
198
+          }
199
+
200
+          &:nth-child(3) {
201
+            font-size: 14px;
202
+            color: #666;
203
+          }
204
+        }
205
+        .workAssignmentTips {
206
+          font-size: 12px;
207
+        }
208
+      }
209
+
210
+      button {
211
+        margin-top: 10px;
212
+
213
+        &.btn {
214
+          margin-left: 8px;
215
+        }
216
+      }
217
+    }
218
+
219
+    // 新增
220
+    &.add {
221
+      .modalBody {
222
+        width: 480px;
223
+        height: auto;
224
+
225
+        .content {
226
+          width: 100%;
227
+          height: auto;
228
+          padding: 16px;
229
+          max-height: 497px;
230
+          overflow-y: auto;
231
+
232
+          .addForm {
233
+            .ant-form-item {
234
+              margin-bottom: 0;
235
+
236
+              .ant-form-item-label {
237
+                text-align: left;
238
+              }
239
+
240
+              .desc {
241
+                margin-top: 5px;
242
+              }
243
+            }
244
+
245
+            .datesControl {
246
+              margin-top: -16px;
247
+
248
+              .ant-form-item-label {
249
+                line-height: 40px;
250
+              }
251
+            }
252
+
253
+            .timer {
254
+              .ant-form-item-label {
255
+                width: 100%;
256
+                text-align: left;
257
+              }
258
+
259
+              .numInp {
260
+                margin-right: 5px;
261
+              }
262
+
263
+              .line {
264
+                margin-right: 5px;
265
+              }
266
+            }
267
+
268
+            .timer2 {
269
+              .ant-form-item-label {
270
+                line-height: 20px;
271
+              }
272
+            }
273
+          }
274
+
275
+          .editForm {
276
+            .ant-form-item {
277
+              margin-bottom: 15px;
278
+
279
+              .ant-form-item-label {
280
+                line-height: 14px;
281
+                text-align: left;
282
+              }
283
+            }
284
+          }
285
+        }
286
+      }
287
+    }
288
+  }
289
+}

+ 212 - 0
src/app/components/configurationCenter/configuration-priority/configuration-priority.component.ts

@@ -0,0 +1,212 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { ActivatedRoute } from "@angular/router";
3
+import { Subject } from 'rxjs';
4
+import { debounceTime } from 'rxjs/operators';
5
+import { MainService } from "../../../services/main.service";
6
+import { Validators, FormGroup, FormBuilder } from '@angular/forms';
7
+import { ToolService } from 'src/app/services/tool.service';
8
+import { NzMessageService } from 'ng-zorro-antd';
9
+
10
+@Component({
11
+  selector: "app-configuration-priority",
12
+  templateUrl: "./configuration-priority.component.html",
13
+  styleUrls: ["./configuration-priority.component.less"],
14
+})
15
+export class ConfigurationPriorityComponent implements OnInit {
16
+  constructor(
17
+    private route: ActivatedRoute,
18
+    private mainService: MainService,
19
+    private fb: FormBuilder,
20
+    private tool: ToolService,
21
+    private message: NzMessageService,
22
+  ) {}
23
+
24
+  coopData: any = {}; //当前操作列
25
+
26
+  formatterMinute = (value: number) => `${value} 分钟`;
27
+  parserMinute = (value: string) => value.replace(' 分钟', '');
28
+
29
+  ngOnInit() {
30
+    // 优先级
31
+    setTimeout(() => {
32
+      this.tablePriorityHeight = document.querySelector('#priorityTable').clientHeight - document.querySelector('#priorityTable .list-template__top').clientHeight - 8 - document.querySelector('#priorityTable .thead').clientHeight;
33
+    }, 0)
34
+    this.getPriorityList();
35
+  }
36
+
37
+  // 新增优先级弹框
38
+  modelName = ""; //模态框名称
39
+  modalPriority: boolean = false; //新增/编辑模态框
40
+  add: boolean; //true:新增;false:编辑
41
+  addPriorityModal() {
42
+    this.modelName = "新增";
43
+    this.add = true; //新增
44
+    this.modalPriority = true;
45
+    this.initPriorityForm();
46
+  }
47
+  //关闭新增/编辑弹框
48
+  hidePriorityModal() {
49
+    this.modalPriority = false;
50
+  }
51
+
52
+  // 编辑
53
+  editPriority(data) {
54
+    console.log(data);
55
+    this.modelName = "编辑";
56
+    this.add = false;
57
+    this.modalPriority = true;
58
+    this.initPriorityForm();
59
+    this.coopData = data;
60
+    this.validatePriorityForm.controls.name.setValue(data.name);
61
+    this.validatePriorityForm.controls.orders.setValue(data.orders);
62
+    this.validatePriorityForm.controls.responseTime.setValue(data.responseTime);
63
+    this.validatePriorityForm.controls.handleTime.setValue(data.handleTime);
64
+  }
65
+
66
+  // 新增/编辑表单提交
67
+  btnLoading: boolean = false; //提交按钮loading状态
68
+  submitPriorityForm(): void {
69
+    for (const i in this.validatePriorityForm.controls) {
70
+      this.validatePriorityForm.controls[i].markAsDirty();
71
+      this.validatePriorityForm.controls[i].updateValueAndValidity();
72
+    }
73
+    if (this.validatePriorityForm.invalid) {
74
+      return;
75
+    }
76
+    console.log(this.validatePriorityForm.value);
77
+    this.btnLoading = true;
78
+    let postData:any = {};
79
+
80
+    if (this.add) {
81
+      //增加
82
+      postData = {
83
+        // priority: {
84
+          name: this.validatePriorityForm.value.name,
85
+          orders: this.validatePriorityForm.value.orders,
86
+          responseTime: this.validatePriorityForm.value.responseTime,
87
+          handleTime: this.validatePriorityForm.value.handleTime,
88
+        // }
89
+      };
90
+    } else {
91
+      //编辑
92
+      postData = {
93
+        // priority: {
94
+          ...this.coopData,
95
+          ...{
96
+            name: this.validatePriorityForm.value.name,
97
+            orders: this.validatePriorityForm.value.orders,
98
+            responseTime: this.validatePriorityForm.value.responseTime,
99
+            handleTime: this.validatePriorityForm.value.handleTime,
100
+          }
101
+        // }
102
+      };
103
+    }
104
+    this.mainService
105
+      .simplePost("addData", "priority", postData)
106
+      .subscribe((result) => {
107
+        this.btnLoading = false;
108
+        this.hidePriorityModal();
109
+        let msg = "";
110
+        if (this.add) {
111
+          msg = "新增";
112
+        } else {
113
+          msg = "修改";
114
+        }
115
+        if (result.status == 200) {
116
+          this.showPromptModal(msg, true, '');
117
+        } else {
118
+          this.showPromptModal(msg, false, result.msg);
119
+        }
120
+      });
121
+  }
122
+
123
+  // 初始化新增form表单
124
+  validatePriorityForm: FormGroup; //新增/编辑表单
125
+  initPriorityForm() {
126
+    this.validatePriorityForm = this.fb.group({
127
+      name: [null, [Validators.required]],//优先级名称
128
+      orders: [null, [Validators.required]],//排序号
129
+      responseTime: [0, [Validators.required]],//响应时间
130
+      handleTime: [0, [Validators.required]],//解决时间
131
+    });
132
+    console.log(this.validatePriorityForm.controls)
133
+  }
134
+
135
+  // 获取优先级列表
136
+  loading1:boolean = false;
137
+  priorityList: any[] = []; //表格数据
138
+  tablePriorityHeight:number = 0;
139
+  getPriorityList() {
140
+    let data = {
141
+      idx: 0,
142
+      sum: 9999,
143
+      priority: {},
144
+    };
145
+    this.loading1 = true;
146
+    this.mainService
147
+      .getFetchDataList("simple/data", "priority", data)
148
+      .subscribe((data) => {
149
+        this.loading1 = false;
150
+        if (data.status == 200) {
151
+          this.priorityList = data.list || [];
152
+        }else{
153
+          this.message.error(data.msg || "请求数据失败");
154
+        }
155
+      });
156
+  }
157
+
158
+  delModal: boolean = false; //删除模态框
159
+  tipsMsg1: string; //提示框信息
160
+  tipsMsg2: string; //操作后信息
161
+  confirmDelType: string; //确认的类型(启用/停用,删除)
162
+  showDelModal(
163
+    data,
164
+    tipsMsg1: string,
165
+    tipsMsg2: string,
166
+    type: string,
167
+  ) {
168
+    this.confirmDelType = type;
169
+    this.delModal = true;
170
+    this.coopData = data;
171
+    this.tipsMsg1 = tipsMsg1;
172
+    this.tipsMsg2 = tipsMsg2;
173
+  }
174
+  // 隐藏删除框
175
+  hideDelModal() {
176
+    this.delModal = false;
177
+  }
178
+  // 确认删除
179
+  confirmDel() {
180
+    this.btnLoading = true;
181
+    if (this.confirmDelType === "delPriority") {
182
+      //删除-优先级
183
+      this.mainService
184
+        .simplePost("rmvData", "priority", [this.coopData.id])
185
+        .subscribe((data) => {
186
+          this.btnLoading = false;
187
+          this.delModal = false;
188
+          if (data.status == 200) {
189
+            this.showPromptModal(this.tipsMsg2, true, "");
190
+          } else {
191
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
192
+          }
193
+        });
194
+    }
195
+  }
196
+
197
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
198
+  promptContent: string; //操作提示框提示信息
199
+  ifSuccess: boolean; //操作成功/失败
200
+  promptInfo: string; //操作结果提示信息
201
+  promptModalShow: boolean; //操作提示框是否展示
202
+  showPromptModal(con, success, promptInfo?) {
203
+    this.promptModalShow = false;
204
+    this.promptContent = con;
205
+    this.ifSuccess = success;
206
+    this.promptInfo = promptInfo;
207
+    setTimeout(() => {
208
+      this.promptModalShow = true;
209
+    }, 100);
210
+    this.getPriorityList();
211
+  }
212
+}

+ 63 - 0
src/app/share/allocation-worker copy/allocation-worker.component.html

@@ -0,0 +1,63 @@
1
+<div class="detail">
2
+  <div class="title">分配配送人员<i class="icon_transport transport-guanbi" (click)="close()"></i></div>
3
+  <div class="content">
4
+    <div nz-row class="select">
5
+      <div nz-col nzSpan="6">
6
+        <div class="label">人员姓名:</div>
7
+        <input [disabled]="nameMask" nz-input placeholder="请输入人员姓名" [(ngModel)]="searchName" nzSize="default"
8
+          (ngModelChange)="searchInp('worker')" />
9
+      </div>
10
+      <div nz-col nzSpan="6" class="ml8">
11
+        <div class="label">人员分组:</div>
12
+        <nz-select nzAllowClear [nzDisabled]="groupMask" style="width: 220px;" [nzDropdownMatchSelectWidth]="false"
13
+          [(ngModel)]="checkedGroup" (ngModelChange)="searchInp('group')" nzPlaceHolder="请选择人员分组">
14
+          <nz-option *ngFor="let optionData of groupList" [nzLabel]="optionData.groupName" [nzValue]="optionData.id">
15
+          </nz-option>
16
+        </nz-select>
17
+      </div>
18
+    </div>
19
+    <div class="table">
20
+      <div class="box">
21
+        <nz-table class="allotWorkerTable" [nzShowPagination]="false" #rowSelectionTable [nzData]="workerList"
22
+          nzSize="small" [nzScroll]="{ y: '270px' }" [nzLoading]="loading1">
23
+          <thead>
24
+            <tr class="thead">
25
+              <th nzWidth="30px" style="text-align: center"></th>
26
+              <th style="text-align: center">姓名</th>
27
+              <th nzWidth="202px" style="text-align: center" *ngIf="workerDispatchUserList === 'dynamic'">分组名称</th>
28
+              <th nzWidth="202px" style="text-align: center" *ngIf="workerDispatchUserList === 'dynamic'">工单数</th>
29
+              <th nzWidth="202px" style="text-align: center" *ngIf="workerDispatchUserList === 'dynamic'">空闲时间</th>
30
+            </tr>
31
+          </thead>
32
+          <tbody>
33
+            <tr *ngFor="let data of rowSelectionTable.data" (click)="checkAllotWorker(data.id,true)">
34
+              <td nzShowCheckbox [(nzChecked)]="mapOfCheckedId[data.id]" (nzCheckedChange)="checkAllotWorker(data.id)">
35
+              </td>
36
+              <td nzAlign="center">{{ data.name }}</td>
37
+              <td nzAlign="center" *ngIf="workerDispatchUserList === 'dynamic'">{{ data.groupDTO?.groupName }}</td>
38
+              <td nzAlign="center" *ngIf="workerDispatchUserList === 'dynamic'">{{ data.totalCount }}</td>
39
+              <td nzAlign="center" *ngIf="workerDispatchUserList === 'dynamic'" [ngClass]="{red: data.workStateRemark ? true : !data.freetime, green: !data.workStateRemark && data.freetime}">{{ data.workStateRemark ? '示忙-' + data.workStateRemark : (data.freetime || '忙碌中') }}</td>
40
+            </tr>
41
+          </tbody>
42
+        </nz-table>
43
+        <div class="pagination">
44
+          <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger
45
+            [(nzPageSize)]="pageSize" (nzPageIndexChange)="getWorkerList()" (nzPageSizeChange)="getWorkerList()">
46
+          </nz-pagination>
47
+        </div>
48
+      </div>
49
+    </div>
50
+  </div>
51
+  <div class="btns display_flex justify-content_flex-center">
52
+    <button nz-button nzType="primary" [nzLoading]="btnLoading" (click)="submit()"
53
+      *ngIf="mapOfCheckedId[worderId]">确认</button>
54
+    <button class=" btn cancel" nz-button nzType="default" (click)="close()">取消</button>
55
+  </div>
56
+</div>
57
+
58
+
59
+<!-- 操作成功/失败提示框 -->
60
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
61
+  [info]="promptInfo" (closeModel)="close()">
62
+  <!-- 2.父组件调用子组件时绑定到这个事件属性,并在事件发生时作出回应。(closeModel)="close()" -->
63
+</app-prompt-modal>

+ 110 - 0
src/app/share/allocation-worker copy/allocation-worker.component.less

@@ -0,0 +1,110 @@
1
+@import "../../../../src/theme.less";
2
+:host {
3
+  width: 100%;
4
+  height: 100%;
5
+  position: fixed;
6
+  left: 0;
7
+  top: 0;
8
+  background: rgba(0, 0, 0, 0.4);
9
+  z-index: 999;
10
+
11
+  display: flex;
12
+  justify-content: center;
13
+  align-items: center;
14
+}
15
+
16
+.detail {
17
+  width: 1000px;
18
+  min-height: 580px;
19
+  border-radius: 5px;
20
+  background: #fff;
21
+  color: #333;
22
+  font-size: 14px;
23
+  padding: 12px 20px;
24
+  padding-bottom: 70px;
25
+  position: relative;
26
+
27
+  .title {
28
+    font-size: 18px;
29
+    text-align: center;
30
+    line-height: 24px;
31
+    margin: 0;
32
+    margin-bottom: 12px;
33
+    position: relative;
34
+
35
+    i {
36
+      position: absolute;
37
+      right: 0;
38
+      top: 0;
39
+      font-size: 20px;
40
+      color: #666;
41
+      cursor: pointer;
42
+      padding: 0 5px;
43
+    }
44
+  }
45
+
46
+  .content {
47
+    width: 960px;
48
+    overflow: hidden;
49
+
50
+    .select {
51
+      width: 100%;
52
+      background: #f9fafb;
53
+      border: 1px solid #e5e9ed;
54
+      border-radius: 5px;
55
+      padding: 13px 20px;
56
+
57
+      .label {
58
+        margin-bottom: 8px;
59
+      }
60
+    }
61
+
62
+    .table {
63
+      width: 100%;
64
+      margin-top: 15px;
65
+
66
+      .thead {
67
+        background-image: repeating-linear-gradient(
68
+          to right,
69
+          @bg-start,
70
+          @bg-end 100%
71
+        ) !important;
72
+
73
+        th {
74
+          color: #fff !important;
75
+          text-align: center;
76
+          font-size: 12px;
77
+          border: none;
78
+        }
79
+      }
80
+
81
+      .box {
82
+        min-height: 380px;
83
+        border-radius: 5px;
84
+        background: #f9fafb;
85
+        border: 1px solid #e5e9ed;
86
+        padding-bottom: 60px;
87
+        position: relative;
88
+
89
+        .pagination {
90
+          margin-top: 14px;
91
+          position: absolute;
92
+          bottom: 12px;
93
+          right: 5px;
94
+        }
95
+      }
96
+    }
97
+  }
98
+
99
+  .btns {
100
+    width: 100%;
101
+    position: absolute;
102
+    left: 0;
103
+    bottom: 20px;
104
+
105
+    button {
106
+      margin: 9px;
107
+      margin-bottom: 0;
108
+    }
109
+  }
110
+}

+ 168 - 0
src/app/share/allocation-worker copy/allocation-worker.component.ts

@@ -0,0 +1,168 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { ActivatedRoute } from "@angular/router";
3
+import { MainService } from "../../services/main.service";
4
+
5
+@Component({
6
+  selector: "app-allocation-worker",
7
+  templateUrl: "./allocation-worker.component.html",
8
+  styleUrls: ["./allocation-worker.component.less"],
9
+})
10
+export class AllocationWorkerComponent implements OnInit {
11
+  constructor(
12
+    private route: ActivatedRoute,
13
+    private mainService: MainService
14
+  ) {}
15
+
16
+  ngOnInit() {
17
+    this.groupList = JSON.parse(localStorage.getItem("user")).user.scope ? JSON.parse(localStorage.getItem("user")).user.scope.groupIds : [];
18
+    this.getWorkerList();
19
+  }
20
+  // 配送人员数据
21
+  workerList = [];
22
+
23
+  id; //工单id
24
+  stateId; //工单状态id
25
+  listOfDisplayData: any[] = [];
26
+  mapOfCheckedId: { [key: string]: boolean } = {};
27
+  searchName: string = ""; //搜索框内容
28
+  checkedGroup; //选中人员分组
29
+  pageIndex: number = 1; //表格当前页码
30
+  pageSize: number = 10; //表格每页展示条数
31
+  listLength: number = 10; //表格总数据量
32
+
33
+  promptContent: string; //操作提示框提示信息
34
+  ifSuccess: boolean; //操作成功/失败
35
+  promptInfo: string; //操作结果提示信息
36
+  promptModalShow: boolean; //是否展示提示框
37
+
38
+  btnLoading: boolean = false; //提交按钮loading状态
39
+
40
+  // 配送人员数据
41
+  groupList: Array<{ groupName: string; id: string }> = []; //分组下拉框
42
+  snum = 0;
43
+  loading1 = false;
44
+  nameMask = false; //是否禁用
45
+  groupMask = false; //是否禁用
46
+  workerDispatchUserList = '';
47
+  getWorkerList(pageIndex?) {
48
+    this.id = this.route.snapshot.paramMap.get("id");
49
+    this.stateId = this.route.snapshot.paramMap.get("stateId");
50
+    this.pageIndex = pageIndex ? pageIndex : this.pageIndex;
51
+
52
+    let groupsId = [];
53
+    JSON.parse(localStorage.getItem("user")).infoPermission.groups.forEach(
54
+      (e) => {
55
+        groupsId.push(e.id);
56
+      }
57
+    );
58
+
59
+    let postData: any = {
60
+      idx: this.pageIndex - 1,
61
+      sum: this.pageSize,
62
+      groupIds: "",
63
+      hosId: this.route.snapshot.paramMap.get("hosId"),
64
+    };
65
+    if (this.searchName) {
66
+      postData.name = this.searchName;
67
+    } else {
68
+      delete postData.name;
69
+    }
70
+    if (this.checkedGroup) {
71
+      postData.groupId = this.checkedGroup;
72
+    } else {
73
+      delete postData.groupId;
74
+    }
75
+    this.snum++;
76
+    this.loading1 = true;
77
+    this.mainService
78
+      .getSerInfo("getOnlineWorker", postData)
79
+      .subscribe((data) => {
80
+        this.snum--;
81
+        if (this.snum == 0) {
82
+          this.loading1 = false;
83
+        }
84
+        console.log(data);
85
+        this.workerDispatchUserList = data.type;
86
+        this.workerList = data.data;
87
+        this.listLength = data.totalNum;
88
+      });
89
+  }
90
+
91
+  // 输入用户信息搜索节流阀
92
+  time: any;
93
+  searchInp(type) {
94
+    this.getWorkerList(1);
95
+    console.log(type);
96
+    if (type == "worker") {
97
+      this.groupMask = Boolean(this.searchName);
98
+    } else if (type == "group") {
99
+      this.nameMask = Boolean(this.checkedGroup);
100
+    }
101
+  }
102
+
103
+  // 选择分配配送人员
104
+  worderId = 0; //配送人员id
105
+  checkAllotWorker(id, flag?): void {
106
+    this.mapOfCheckedId = {
107
+      [id]: flag ? !this.mapOfCheckedId[id] : this.mapOfCheckedId[id],
108
+    };
109
+    this.worderId = id;
110
+  }
111
+
112
+  // 分配
113
+  submit() {
114
+    let that = this;
115
+    that.btnLoading = true;
116
+    let flag: any = that.route.snapshot.paramMap.get("flag");
117
+
118
+    let postData: any = {};
119
+    let flags = "";
120
+    if (that.id.includes("_")) {
121
+      flags = "batchExcuteWorkOrder";
122
+      let ids_types = that.id.split("-");
123
+      let stateIds = that.stateId.split("-");
124
+      postData.workOrders = [];
125
+      stateIds.forEach((item, i) => {
126
+        postData.workOrders.push({
127
+          id: ids_types[i].split("_")[0],
128
+          type: ids_types[i].split("_")[1],
129
+          worker: { id: that.worderId },
130
+          gdState: { id: item },
131
+        });
132
+      });
133
+    } else {
134
+      flags = flag == 1 ? "excuteWorkOrder/reassign" : "excuteWorkOrder/assign";
135
+      postData = {
136
+        workOrder: {
137
+          id: that.id,
138
+          worker: { id: that.worderId },
139
+          gdState: { id: that.stateId },
140
+        },
141
+      };
142
+    }
143
+    that.mainService.assignWorker(postData, flags).subscribe((data) => {
144
+      that.btnLoading = false;
145
+      if (data.status == 200) {
146
+        that.showPromptModal("分配", true, "");
147
+      } else {
148
+        that.showPromptModal("分配", false, data.msg);
149
+      }
150
+    });
151
+  }
152
+
153
+  // 关闭弹框
154
+  close() {
155
+    history.go(-1);
156
+  }
157
+
158
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
159
+  showPromptModal(con, success, promptInfo?) {
160
+    this.promptModalShow = false;
161
+    this.promptContent = con;
162
+    this.ifSuccess = success;
163
+    this.promptInfo = promptInfo;
164
+    setTimeout(() => {
165
+      this.promptModalShow = true;
166
+    }, 100);
167
+  }
168
+}

+ 3 - 359
src/app/views/incident-config/incident-config.component.html

@@ -10,372 +10,16 @@
10 10
   </div>
11 11
   <!-- 故障现象 -->
12 12
   <ng-container *ngIf="activeTagId === 1">
13
-    <div class="hospitalConfig">
14
-      <nz-radio-group [(ngModel)]="hospitalConfig" (ngModelChange)="changeHospitalConfig($event)">
15
-        <label nz-radio [nzValue]="item.id" *ngFor="let item of hospitalConfigList">{{ item.name }}</label>
16
-      </nz-radio-group>
17
-    </div>
18
-
19
-    <div class="content">
20
-      <div class="contentInner">
21
-        <div class="address">
22
-          <div class="contentHead">一级故障现象<button nz-button nzType="primary" nzSize="small" (click)="addCategoryModal(1)">新增</button></div>
23
-          <overlay-scrollbars #osComponentRef1 class="contentBody">
24
-            <nz-spin nzSimple [nzSpinning]="categoryLoading1" class="mt8 text_align_center"></nz-spin>
25
-            <div [hidden]="categoryLoading1" class="contentItem" [title]="item.category" [ngClass]="{ active: item.id === activeCategory1.id }" (click)="clickCategory(item, 1)" *ngFor="let item of categoryList1">{{ item.category }}</div>
26
-          </overlay-scrollbars>
27
-        </div>
28
-        <div class="address">
29
-          <div class="contentHead">二级故障现象<button nz-button nzType="primary" nzSize="small" *ngIf="activeCategory1.id" (click)="addCategoryModal(2)">新增</button></div>
30
-          <overlay-scrollbars #osComponentRef2 class="contentBody">
31
-            <nz-spin nzSimple [nzSpinning]="categoryLoading2" class="mt8 text_align_center"></nz-spin>
32
-            <div [hidden]="categoryLoading2" class="contentItem" [title]="item.category" [ngClass]="{ active: item.id === activeCategory2.id }" (click)="clickCategory(item, 2)" *ngFor="let item of categoryList2">{{ item.category }}</div>
33
-          </overlay-scrollbars>
34
-        </div>
35
-        <div class="address">
36
-          <div class="contentHead">三级故障现象<button nz-button nzType="primary" nzSize="small" *ngIf="activeCategory2.id" (click)="addCategoryModal(3)">新增</button></div>
37
-          <overlay-scrollbars #osComponentRef3 class="contentBody">
38
-            <nz-spin nzSimple [nzSpinning]="categoryLoading3" class="mt8 text_align_center"></nz-spin>
39
-            <div [hidden]="categoryLoading3" class="contentItem" [title]="item.category" [ngClass]="{ active: item.id === activeCategory3.id }" (click)="clickCategory(item, 3)" *ngFor="let item of categoryList3">{{ item.category }}</div>
40
-          </overlay-scrollbars>
41
-        </div>
42
-        <div class="addressAssign">
43
-          <div class="contentHead">
44
-            <div class="title" title="{{activeCategory1.category}}{{activeCategory2.category ? ' - ' + activeCategory2.category : ''}}{{activeCategory3.category ? ' - ' + activeCategory3.category : ''}}">{{activeCategory1.category}}{{activeCategory2.category ? ' - ' + activeCategory2.category : ''}}{{activeCategory3.category ? ' - ' + activeCategory3.category : ''}}</div>
45
-            <div class="btns" *ngIf="activeCategory1.id || activeCategory2.id || activeCategory3.id">
46
-              <button nz-button nzType="primary" nzSize="small" (click)="showDelModal(data, hospitalConfig === 1 ? '您确认向下复制您的配置信息吗?' : '您确认向下复制您的配置吗?将会移除各科室的配置,使用当前配置进行覆盖。','向下复制','copy')" *ngIf="currentChildrenCategoryList">向下复制</button>
47
-              <button nz-button nzType="primary" nzSize="small" class="ml8" *ngIf="hospitalConfig === 2" (click)="addConfigModal()">新增</button>
48
-            </div>
49
-          </div>
50
-          <div class="contentBody" id="categoryTable">
51
-            <div class="list-template">
52
-              <div class="list-template__content">
53
-                <div class="list-template__bottom">
54
-                  <nz-table class="list-template__nzTable" [nzData]="categoryConfigList" nzSize="middle" [nzShowPagination]="false"
55
-                    [nzLoading]="loading1" [nzScroll]="{ y: tableCategoryHeight + 'px' }">
56
-                    <thead>
57
-                      <tr class="thead">
58
-                        <th nzWidth="16%">院区</th>
59
-                        <th nzWidth="16%">责任部门</th>
60
-                        <th nzWidth="16%">优先级</th>
61
-                        <th nzWidth="16%">积分</th>
62
-                        <th nzWidth="16%">维修人|组</th>
63
-                        <th nzWidth="20%">操作</th>
64
-                      </tr>
65
-                    </thead>
66
-                    <tbody>
67
-                      <tr *ngFor="let data of categoryConfigList;let i = index">
68
-                        <td>{{data.hospitalDTO?.hosName}}</td>
69
-                        <td>{{data.dutyDTO?.hosName}}</td>
70
-                        <td>{{data.priorityDTO?.name}}</td>
71
-                        <td>{{data.score?.value}}</td>
72
-                        <td>{{data.userGroup === 1 ? data.userDTO?.name : (data.userGroup === 2 ? data.groupDTO?.groupName : '')}}</td>
73
-                        <td>
74
-                          <div class="coop">
75
-                            <span (click)="showDelModal(data,'您确认要删除吗?','删除','delConfig')">删除</span>
76
-                            <span (click)="editConfig(data)">编辑</span>
77
-                          </div>
78
-                        </td>
79
-                      </tr>
80
-                    </tbody>
81
-                  </nz-table>
82
-                </div>
83
-              </div>
84
-            </div>
85
-          </div>
86
-        </div>
87
-      </div>
88
-    </div>
13
+    <app-configuration-category></app-configuration-category>
89 14
   </ng-container>
90 15
   <!-- 优先级 -->
91 16
   <ng-container *ngIf="activeTagId === 2">
92
-    <div class="content priority">
93
-      <div class="contentInner">
94
-        <div class="list-template" id="priorityTable">
95
-          <div class="list-template__content">
96
-            <div class="list-template__bottom">
97
-              <div class="list-template__top" nz-row>
98
-                <div nz-col nzLg="24" class="list-template__btns">
99
-                  <button nz-button class="btn default" (click)="addPriorityModal()">新增</button>
100
-                </div>
101
-              </div>
102
-              <nz-table class="list-template__nzTable" [nzData]="priorityList" nzSize="middle" [nzShowPagination]="false"
103
-                [nzLoading]="loading1" [nzScroll]="{ y: tablePriorityHeight + 'px' }">
104
-                <thead>
105
-                  <tr class="thead">
106
-                    <th nzWidth="20%">优先级名称</th>
107
-                    <th nzWidth="20%">排序</th>
108
-                    <th nzWidth="20%">响应时间(分钟)</th>
109
-                    <th nzWidth="20%">解决时间(分钟)</th>
110
-                    <th nzWidth="20%">操作</th>
111
-                  </tr>
112
-                </thead>
113
-                <tbody>
114
-                  <tr *ngFor="let data of priorityList;let i = index">
115
-                    <td>{{data.name}}</td>
116
-                    <td>{{data.orders}}</td>
117
-                    <td>{{data.responseTime}}</td>
118
-                    <td>{{data.handleTime}}</td>
119
-                    <td>
120
-                      <div class="coop">
121
-                        <span (click)="showDelModal(data,'您确认要删除吗?','删除','delPriority')">删除</span>
122
-                        <span (click)="editPriority(data)">编辑</span>
123
-                      </div>
124
-                    </td>
125
-                  </tr>
126
-                </tbody>
127
-              </nz-table>
128
-            </div>
129
-          </div>
130
-        </div>
131
-      </div>
132
-    </div>
17
+    <app-configuration-priority></app-configuration-priority>
133 18
   </ng-container>
134 19
   <!-- 数据字典 -->
135 20
   <ng-container *ngIf="activeTagId === 3">
136
-    <div class="content" id="dictionary">
137
-      <div class="contentInner">
138
-        <div class="address">
139
-          <overlay-scrollbars #osComponentRef5 class="contentBody">
140
-            <div class="contentItem" [title]="item.name" [ngClass]="{ active: item.id === activeDictionaryKey.id }" (click)="clickDictionaryKey(item)" *ngFor="let item of dictionaryKeyList">{{ item.name }}</div>
141
-          </overlay-scrollbars>
142
-        </div>
143
-        <div class="addressAssign">
144
-          <div class="contentBody">
145
-            <div class="dictionaryRow">
146
-              <div class="orders">排序号</div>
147
-              <div class="name">键</div>
148
-              <div class="value">值</div>
149
-            </div>
150
-            <form nz-form [formGroup]="validateDictionaryForm" class="w100">
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>
161
-                <div class="name">
162
-                  <nz-form-item>
163
-                    <nz-form-control [nzSpan]="24" nzErrorTip="请输入键!">
164
-                      <nz-input-group>
165
-                        <input [formControlName]="'name_' + data.id" nz-input class="nameInput">
166
-                      </nz-input-group>
167
-                    </nz-form-control>
168
-                  </nz-form-item>
169
-                </div>
170
-                <div class="value">
171
-                  <nz-form-item>
172
-                    <nz-form-control [nzSpan]="24" nzErrorTip="请输入值!">
173
-                      <nz-input-group>
174
-                        <input [formControlName]="'value_' + data.id" nz-input class="valueInput">
175
-                      </nz-input-group>
176
-                    </nz-form-control>
177
-                  </nz-form-item>
178
-                  <i class="icon_transport transport-tag27fuben ml8" (click)="addField(i)"></i>
179
-                  <i class="icon_transport transport-shanchu1 ml8" *ngIf="dictionaryList.length > 1 && !data.system" (click)="removeField(data, i)"></i>
180
-                </div>
181
-              </div>
182
-            </form>
183
-          </div>
184
-          <div class="contentBtns">
185
-            <button nz-button nzType="primary" class="ml8" (click)="saveDictionary()">保存</button>
186
-          </div>
187
-        </div>
188
-      </div>
189
-    </div>
21
+    <app-configuration-dictionary></app-configuration-dictionary>
190 22
   </ng-container>
191 23
 </div>
192 24
 
193
-<!-- 操作成功/失败提示框 -->
194
-<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
195
-  [info]="promptInfo">
196
-</app-prompt-modal>
197
-
198
-<!-- 删除模态框 -->
199
-<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
200
-(confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
201
-
202
-<!-- 新增/编辑优先级模态框 -->
203
-<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modalPriority">
204
-  <div class="modalBody">
205
-    <div class="title">{{modelName}}优先级<i class="icon_transport transport-guanbi" (click)="hidePriorityModal()"></i></div>
206
-    <div class="content">
207
-      <form nz-form [formGroup]="validatePriorityForm" class="addForm">
208
-        <nz-form-item>
209
-          <nz-form-label [nzSpan]="6" nzRequired nzFor="name">优先级名称</nz-form-label>
210
-          <nz-form-control [nzSpan]="18" nzErrorTip="请输入优先级名称!">
211
-            <nz-input-group>
212
-              <input formControlName="name" nz-input placeholder="请输入优先级名称">
213
-            </nz-input-group>
214
-          </nz-form-control>
215
-        </nz-form-item>
216
-        <nz-form-item>
217
-          <nz-form-label [nzSpan]="6" nzRequired nzFor="orders">排&nbsp;&nbsp;&nbsp;序&nbsp;&nbsp;&nbsp;号</nz-form-label>
218
-          <nz-form-control [nzSpan]="18" nzErrorTip="请输入排序号!">
219
-            <nz-input-group>
220
-              <nz-input-number class="w100" formControlName="orders" nzPlaceHolder="请输入排序号" [nzMin]="0" [nzStep]="1" [nzPrecision]="0"></nz-input-number>
221
-            </nz-input-group>
222
-          </nz-form-control>
223
-        </nz-form-item>
224
-        <nz-form-item>
225
-          <nz-form-label [nzSpan]="6" nzRequired nzFor="responseTime">响&nbsp;应&nbsp;时&nbsp;间</nz-form-label>
226
-          <nz-form-control [nzSpan]="18" nzErrorTip="请输入响应时间(分钟)!">
227
-            <nz-input-group>
228
-              <nz-input-number class="w100" formControlName="responseTime" nzPlaceHolder="请输入响应时间(分钟)" [nzMin]="0" [nzStep]="1" [nzPrecision]="0" [nzFormatter]="formatterMinute" [nzParser]="parserMinute"></nz-input-number>
229
-            </nz-input-group>
230
-          </nz-form-control>
231
-        </nz-form-item>
232
-        <nz-form-item>
233
-          <nz-form-label [nzSpan]="6" nzRequired nzFor="handleTime">解&nbsp;决&nbsp;时&nbsp;间</nz-form-label>
234
-          <nz-form-control [nzSpan]="18" nzErrorTip="请输入解决时间(分钟)!">
235
-            <nz-input-group>
236
-              <nz-input-number class="w100" formControlName="handleTime" nzPlaceHolder="请输入解决时间(分钟)" [nzMin]="0" [nzStep]="1" [nzPrecision]="0" [nzFormatter]="formatterMinute" [nzParser]="parserMinute"></nz-input-number>
237
-            </nz-input-group>
238
-          </nz-form-control>
239
-        </nz-form-item>
240
-      </form>
241
-    </div>
242
-    <div class=" display_flex justify-content_flex-center">
243
-      <button nzType="primary" nz-button (click)="submitPriorityForm()" [nzLoading]="btnLoading">确认</button>
244
-      <button class="btn cancel" nz-button nzType="default" (click)="hidePriorityModal()">取消</button>
245
-    </div>
246
-  </div>
247
-</div>
248
-
249
-<!-- 新增/编辑故障现象模态框 -->
250
-<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modalCategory">
251
-  <div class="modalBody">
252
-    <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hideCategoryModal()"></i></div>
253
-    <div class="content">
254
-      <div class="tips" *ngIf="coopType === 1">您将添加一级故障现象,请输入故障现象</div>
255
-      <div class="tips" *ngIf="coopType === 2">您将在“<span class="red">{{activeCategory1.category}}</span>”下新增故障现象,请输入故障现象</div>
256
-      <div class="tips" *ngIf="coopType === 3">您将在“<span class="red">{{activeCategory1.category}}{{activeCategory2.category ? ' - ' + activeCategory2.category : ''}}</span>”下新增故障现象,请输入故障现象</div>
257
-      <form nz-form [formGroup]="validateCategoryForm" class="addForm">
258
-        <nz-form-item>
259
-          <nz-form-control [nzSpan]="24" nzErrorTip="请输入故障现象名称!">
260
-            <nz-input-group>
261
-              <textarea formControlName="name" nz-input placeholder="请输入故障现象名称" [nzAutosize]="{minRows: 3}"></textarea>
262
-            </nz-input-group>
263
-          </nz-form-control>
264
-        </nz-form-item>
265
-      </form>
266
-    </div>
267
-    <div class=" display_flex justify-content_flex-center">
268
-      <button nzType="primary" nz-button (click)="submitCategoryForm()" [nzLoading]="btnLoading">确认</button>
269
-      <button class="btn cancel" nz-button nzType="default" (click)="hideCategoryModal()">取消</button>
270
-    </div>
271
-  </div>
272
-</div>
273
-
274
-<!-- 新增/编辑关联模态框 -->
275
-<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modalConfig">
276
-  <div class="modalBody">
277
-    <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hideConfigModal()"></i></div>
278
-    <div class="content">
279
-      <form nz-form [formGroup]="validateConfigForm" class="addForm">
280
-        <nz-form-item>
281
-          <nz-form-label [nzSpan]="5" nzRequired nzFor="hosId">院区</nz-form-label>
282
-          <nz-form-control [nzSpan]="19" nzErrorTip="请选择院区!">
283
-            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="hosId" nzShowSearch
284
-              nzPlaceHolder="请选择院区" nzServerSearch (ngModelChange)="changeHospital($event)" [nzDisabled]="!add">
285
-              <ng-container *ngFor="let data of hospitalList">
286
-                <nz-option *ngIf="!isLoading" [nzLabel]="data.hosName" [nzValue]="data.id"></nz-option>
287
-              </ng-container>
288
-              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
289
-                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
290
-              </nz-option>
291
-            </nz-select>
292
-          </nz-form-control>
293
-        </nz-form-item>
294
-        <nz-form-item>
295
-          <nz-form-label [nzSpan]="5" nzRequired nzFor="dutyId">责任部门</nz-form-label>
296
-          <nz-form-control [nzSpan]="19" nzErrorTip="请选择责任部门!">
297
-            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="dutyId" nzShowSearch
298
-              nzPlaceHolder="请选择责任部门" nzServerSearch (ngModelChange)="changeDuty($event)" [nzDisabled]="!add">
299
-              <ng-container *ngFor="let data of dutyList">
300
-                <nz-option *ngIf="!isLoading" [nzLabel]="data.hosName" [nzValue]="data.id"></nz-option>
301
-              </ng-container>
302
-              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
303
-                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
304
-              </nz-option>
305
-            </nz-select>
306
-          </nz-form-control>
307
-        </nz-form-item>
308
-        <nz-form-item>
309
-          <nz-form-label [nzSpan]="5" nzRequired nzFor="priority">优先级</nz-form-label>
310
-          <nz-form-control [nzSpan]="19" nzErrorTip="请选择优先级!">
311
-            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="priority" nzShowSearch
312
-            nzPlaceHolder="请选择优先级" nzServerSearch>
313
-              <ng-container *ngFor="let option of priority_c_List">
314
-                <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
315
-              </ng-container>
316
-              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
317
-                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
318
-              </nz-option>
319
-            </nz-select>
320
-          </nz-form-control>
321
-        </nz-form-item>
322
-        <nz-form-item>
323
-          <nz-form-label [nzSpan]="5" nzRequired nzFor="score">积分</nz-form-label>
324
-          <nz-form-control [nzSpan]="19" nzErrorTip="请选择积分!">
325
-            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="score" nzShowSearch
326
-              nzPlaceHolder="请选择积分" nzServerSearch>
327
-              <ng-container *ngFor="let data of scoreList">
328
-                <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.id"></nz-option>
329
-              </ng-container>
330
-              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
331
-                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
332
-              </nz-option>
333
-            </nz-select>
334
-          </nz-form-control>
335
-        </nz-form-item>
336
-        <nz-form-item>
337
-          <nz-form-label [nzSpan]="5" nzRequired nzFor="userGroup">分配方式</nz-form-label>
338
-          <nz-form-control [nzSpan]="19" nzErrorTip="请选择积分!">
339
-            <nz-radio-group formControlName="userGroup" (ngModelChange)="changeUserGroup($event)">
340
-              <label nz-radio [nzValue]="1">人</label>
341
-              <label nz-radio [nzValue]="2">组</label>
342
-            </nz-radio-group>
343
-          </nz-form-control>
344
-        </nz-form-item>
345
-        <nz-form-item>
346
-          <nz-form-label [nzSpan]="5" nzRequired nzFor="groupId">维修组</nz-form-label>
347
-          <nz-form-control [nzSpan]="19" nzErrorTip="请选择维修组!">
348
-            <nz-select (nzOnSearch)="changeInp('group', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="groupId" nzPlaceHolder="请选择维修组" (ngModelChange)="changeGroup($event)">
349
-              <ng-container *ngFor="let option of groupList">
350
-                <nz-option *ngIf="!isLoading" [nzLabel]="option.groupName" [nzValue]="option.id"></nz-option>
351
-              </ng-container>
352
-              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
353
-                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
354
-              </nz-option>
355
-            </nz-select>
356
-          </nz-form-control>
357
-        </nz-form-item>
358
-        <nz-form-item *ngIf="validateConfigForm.value.userGroup === 1">
359
-          <nz-form-label [nzSpan]="5" nzRequired nzFor="userId">维修人</nz-form-label>
360
-          <nz-form-control [nzSpan]="19" nzErrorTip="请选择维修人!">
361
-            <nz-select (nzOnSearch)="changeInp('user', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="userId" nzPlaceHolder="请选择维修人">
362
-              <ng-container *ngFor="let option of userList">
363
-                <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
364
-              </ng-container>
365
-              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
366
-                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
367
-              </nz-option>
368
-            </nz-select>
369
-          </nz-form-control>
370
-        </nz-form-item>
371
-      </form>
372
-    </div>
373
-    <div class=" display_flex justify-content_flex-center">
374
-      <button nzType="primary" nz-button (click)="submitConfigForm()" [nzLoading]="btnLoading">确认</button>
375
-      <button class="btn cancel" nz-button nzType="default" (click)="hideConfigModal()">取消</button>
376
-    </div>
377
-  </div>
378
-</div>
379 25
 
380
-<!-- 遮罩 -->
381
-<app-mask *ngIf="maskFlag"></app-mask>

+ 0 - 342
src/app/views/incident-config/incident-config.component.less

@@ -1,70 +1,6 @@
1 1
 @import "../../../../src/theme.less";
2 2
 :host {
3 3
   width: 100%;
4
-  .list-template__nzTable,
5
-  .list-template__bottom{
6
-    padding: 0!important;
7
-    border: none!important;
8
-    background: #fff!important;
9
-  }
10
-  .list-template{
11
-    width: 100%!important;
12
-    height: 100%!important;
13
-  }
14
-  #dictionary{
15
-    margin: 24px 16px;
16
-    .addressAssign{
17
-      flex: 7;
18
-    }
19
-    .contentItem{
20
-      margin: 0 16px;
21
-      padding: 8px;
22
-      text-align: center;
23
-      &.active{
24
-        background-color: @primary-color;
25
-        color: #fff;
26
-        border-radius: 4px;
27
-      }
28
-    }
29
-    .contentBody{
30
-      padding: 16px;
31
-    }
32
-    ::ng-deep .ant-form-item{
33
-      margin-bottom: 0;
34
-    }
35
-    .dictionaryRow{
36
-      display: flex;
37
-      align-items: center;
38
-      justify-content: center;
39
-      gap: 16px;
40
-      .orders{
41
-        flex: 1;
42
-        display: flex;
43
-        justify-content: flex-end;
44
-        align-items: center;
45
-      }
46
-      .name{
47
-        width: 100px;
48
-        display: flex;
49
-        justify-content: flex-end;
50
-        align-items: center;
51
-      }
52
-      .value{
53
-        flex: 3;
54
-        display: flex;
55
-        align-items: center;
56
-        .valueInput{
57
-          width: 600px;
58
-        }
59
-        .icon_transport{
60
-          font-size: 20px;
61
-          color: #8a8a8a;
62
-          cursor: pointer;
63
-        }
64
-      }
65
-
66
-    }
67
-  }
68 4
   .incidentConfig{
69 5
     padding-bottom: 24px;
70 6
     height: 100%;
@@ -110,283 +46,5 @@
110 46
         }
111 47
       }
112 48
     }
113
-    .hospitalConfig{
114
-      height: 60px;
115
-      display: flex;
116
-      justify-content: center;
117
-      align-items: center;
118
-      gap: 72px;
119
-    }
120
-    .content{
121
-      flex: 1;
122
-      min-height: 0;
123
-      display: flex;
124
-      flex-direction: column;
125
-      justify-content: space-between;
126
-      border: 1px solid #EEF3F9;
127
-      &.priority{
128
-        margin: 24px 118px 0;
129
-        background-color: #fff;
130
-        .contentInner{
131
-          padding: 48px 206px;
132
-          border: 1px solid #E8EBEF;
133
-        }
134
-      }
135
-      .contentItem{
136
-        padding: 4px 16px;
137
-        cursor: pointer;
138
-        overflow: hidden;
139
-        text-overflow: ellipsis;
140
-        white-space: nowrap;
141
-        &.active{
142
-          color: @primary-color;
143
-          background-color: #F0F6ED;
144
-          border-radius: 4px;
145
-        }
146
-      }
147
-      .contentInner{
148
-        flex: 1;
149
-        display: flex;
150
-        justify-content: space-between;
151
-        align-items: center;
152
-        padding: 0 16px;
153
-        gap: 16px;
154
-        .contentHead{
155
-          height: 45px;
156
-          display: flex;
157
-          justify-content: space-between;
158
-          align-items: center;
159
-          gap: 16px;
160
-          padding: 0 16px;
161
-          font-size: 16px;
162
-          font-weight: bold;
163
-          border-bottom: 1px solid #D9D9D9;
164
-          .title{
165
-            overflow: hidden;
166
-            text-overflow: ellipsis;
167
-            white-space: nowrap;
168
-          }
169
-          .btns{
170
-            flex-shrink: 0;
171
-          }
172
-        }
173
-        .contentBody{
174
-          padding: 0 8px;
175
-          margin: 4px 0;
176
-          flex: 1;
177
-        }
178
-        .address{
179
-          flex: 1;
180
-          height: 100%;
181
-          background: #FFFFFF;
182
-          border: 1px solid #E8EBEF;
183
-          display: flex;
184
-          flex-direction: column;
185
-          width: 0;
186
-        }
187
-        .addressAssign{
188
-          flex: 3;
189
-          height: 100%;
190
-          background: #FFFFFF;
191
-          border: 1px solid #E8EBEF;
192
-          display: flex;
193
-          flex-direction: column;
194
-          width: 0;
195
-        }
196
-        .list-template__searchItem {
197
-          margin-bottom: 16px;
198
-          .label {
199
-            color: #333;
200
-            display: inline-block;
201
-            width: 70px;
202
-            text-align-last: justify;
203
-            text-align: justify;
204
-            &.label--big {
205
-              width: 100px;
206
-            }
207
-          }
208
-          .formItem {
209
-            width: 135px;
210
-          }
211
-        }
212
-      }
213
-      .contentBtns{
214
-        margin-bottom: 16px;
215
-        display: flex;
216
-        justify-content: center;
217
-        align-items: center;
218
-      }
219
-    }
220
-  }
221
-
222
-  .save {
223
-    position: fixed;
224
-    left: 0;
225
-    top: 0;
226
-    width: 100%;
227
-    height: 100%;
228
-    background: rgba(0, 0, 0, 0.4);
229
-    z-index: 99;
230
-
231
-    .tips{
232
-      margin-bottom: 16px!important;
233
-    }
234
-
235
-    .modalBody {
236
-      width: 350px;
237
-      background: #fff;
238
-      border-radius: 5px;
239
-      padding: 10px 20px;
240
-      color: #333;
241
-
242
-      .title {
243
-        width: 100%;
244
-        text-align: center;
245
-        font-size: 18px;
246
-        position: relative;
247
-
248
-        i {
249
-          position: absolute;
250
-          right: 0;
251
-          top: 0;
252
-          font-size: 20px;
253
-          color: #666;
254
-          cursor: pointer;
255
-          padding: 0 5px;
256
-        }
257
-      }
258
-
259
-      .content {
260
-        width: 310px;
261
-        background: #f9fafb;
262
-        border: 1px solid #e5e9ed;
263
-        border-radius: 5px;
264
-        overflow: hidden;
265
-        margin-top: 12px;
266
-        padding: 16px 0;
267
-
268
-        .busyList{
269
-          display: flex;
270
-          margin-bottom: 8px;
271
-          .busyContent{
272
-            margin-right: 8px;
273
-            flex: 1;
274
-          }
275
-        }
276
-
277
-        & > div {
278
-          text-align: center;
279
-          margin: 0;
280
-
281
-          &.icon {
282
-            // margin-top: 17px;
283
-
284
-            i {
285
-              color: #34b349;
286
-              font-size: 30px !important;
287
-
288
-              &.transport-wenhao {
289
-                color: #f5a523;
290
-              }
291
-
292
-              &.transport-shibai {
293
-                color: #ff3a52;
294
-              }
295
-            }
296
-          }
297
-
298
-          &.defeat {
299
-            color: #333;
300
-            font-size: 14px;
301
-          }
302
-
303
-          &:nth-child(3) {
304
-            font-size: 14px;
305
-            color: #666;
306
-          }
307
-        }
308
-        .workAssignmentTips {
309
-          font-size: 12px;
310
-        }
311
-      }
312
-
313
-      button {
314
-        margin-top: 10px;
315
-
316
-        &.btn {
317
-          margin-left: 8px;
318
-        }
319
-      }
320
-    }
321
-
322
-    // 新增
323
-    &.add {
324
-      .modalBody {
325
-        width: 480px;
326
-        height: auto;
327
-
328
-        .content {
329
-          width: 100%;
330
-          height: auto;
331
-          padding: 16px;
332
-          max-height: 497px;
333
-          overflow-y: auto;
334
-
335
-          .addForm {
336
-            .ant-form-item {
337
-              margin-bottom: 0;
338
-
339
-              .ant-form-item-label {
340
-                text-align: left;
341
-              }
342
-
343
-              .desc {
344
-                margin-top: 5px;
345
-              }
346
-            }
347
-
348
-            .datesControl {
349
-              margin-top: -16px;
350
-
351
-              .ant-form-item-label {
352
-                line-height: 40px;
353
-              }
354
-            }
355
-
356
-            .timer {
357
-              .ant-form-item-label {
358
-                width: 100%;
359
-                text-align: left;
360
-              }
361
-
362
-              .numInp {
363
-                margin-right: 5px;
364
-              }
365
-
366
-              .line {
367
-                margin-right: 5px;
368
-              }
369
-            }
370
-
371
-            .timer2 {
372
-              .ant-form-item-label {
373
-                line-height: 20px;
374
-              }
375
-            }
376
-          }
377
-
378
-          .editForm {
379
-            .ant-form-item {
380
-              margin-bottom: 15px;
381
-
382
-              .ant-form-item-label {
383
-                line-height: 14px;
384
-                text-align: left;
385
-              }
386
-            }
387
-          }
388
-        }
389
-      }
390
-    }
391 49
   }
392 50
 }

Plik diff jest za duży
+ 2 - 1038
src/app/views/incident-config/incident-config.component.ts


+ 7 - 1
src/app/views/incident-config/incident-config.module.ts

@@ -4,11 +4,17 @@ import { CommonModule } from '@angular/common';
4 4
 import { IncidentConfigRoutingModule } from './incident-config-routing.module';
5 5
 import { IncidentConfigComponent } from './incident-config.component';
6 6
 import { ShareModule } from 'src/app/share/share.module';
7
+import { ConfigurationCategoryComponent } from 'src/app/components/configurationCenter/configuration-category/configuration-category.component';
8
+import { ConfigurationPriorityComponent } from 'src/app/components/configurationCenter/configuration-priority/configuration-priority.component';
9
+import { ConfigurationDictionaryComponent } from 'src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component';
7 10
 
8 11
 
9 12
 @NgModule({
10 13
   declarations: [
11
-    IncidentConfigComponent
14
+    IncidentConfigComponent,
15
+    ConfigurationCategoryComponent,
16
+    ConfigurationPriorityComponent,
17
+    ConfigurationDictionaryComponent,
12 18
   ],
13 19
   imports: [
14 20
     CommonModule,

+ 4 - 360
src/app/views/other-config/other-config.component.html

@@ -1,4 +1,4 @@
1
-<div class="otherConfig">
1
+<div class="incidentConfig">
2 2
   <div class="tagsAndTemplete">
3 3
     <div class="tags">
4 4
       <div><i class="icon_transport transport-peizhizhongxin"></i>配置中心&emsp;&gt;&emsp;事件配置</div>
@@ -10,372 +10,16 @@
10 10
   </div>
11 11
   <!-- 故障现象 -->
12 12
   <ng-container *ngIf="activeTagId === 1">
13
-    <div class="hospitalConfig">
14
-      <nz-radio-group [(ngModel)]="hospitalConfig" (ngModelChange)="changeHospitalConfig($event)">
15
-        <label nz-radio [nzValue]="item.id" *ngFor="let item of hospitalConfigList">{{ item.name }}</label>
16
-      </nz-radio-group>
17
-    </div>
18
-
19
-    <div class="content">
20
-      <div class="contentInner">
21
-        <div class="address">
22
-          <div class="contentHead">一级故障现象<button nz-button nzType="primary" nzSize="small" (click)="addCategoryModal(1)">新增</button></div>
23
-          <overlay-scrollbars #osComponentRef1 class="contentBody">
24
-            <nz-spin nzSimple [nzSpinning]="categoryLoading1" class="mt8 text_align_center"></nz-spin>
25
-            <div [hidden]="categoryLoading1" class="contentItem" [title]="item.category" [ngClass]="{ active: item.id === activeCategory1.id }" (click)="clickCategory(item, 1)" *ngFor="let item of categoryList1">{{ item.category }}</div>
26
-          </overlay-scrollbars>
27
-        </div>
28
-        <div class="address">
29
-          <div class="contentHead">二级故障现象<button nz-button nzType="primary" nzSize="small" *ngIf="activeCategory1.id" (click)="addCategoryModal(2)">新增</button></div>
30
-          <overlay-scrollbars #osComponentRef2 class="contentBody">
31
-            <nz-spin nzSimple [nzSpinning]="categoryLoading2" class="mt8 text_align_center"></nz-spin>
32
-            <div [hidden]="categoryLoading2" class="contentItem" [title]="item.category" [ngClass]="{ active: item.id === activeCategory2.id }" (click)="clickCategory(item, 2)" *ngFor="let item of categoryList2">{{ item.category }}</div>
33
-          </overlay-scrollbars>
34
-        </div>
35
-        <div class="address">
36
-          <div class="contentHead">三级故障现象<button nz-button nzType="primary" nzSize="small" *ngIf="activeCategory2.id" (click)="addCategoryModal(3)">新增</button></div>
37
-          <overlay-scrollbars #osComponentRef3 class="contentBody">
38
-            <nz-spin nzSimple [nzSpinning]="categoryLoading3" class="mt8 text_align_center"></nz-spin>
39
-            <div [hidden]="categoryLoading3" class="contentItem" [title]="item.category" [ngClass]="{ active: item.id === activeCategory3.id }" (click)="clickCategory(item, 3)" *ngFor="let item of categoryList3">{{ item.category }}</div>
40
-          </overlay-scrollbars>
41
-        </div>
42
-        <div class="addressAssign">
43
-          <div class="contentHead">
44
-            <div class="title" title="{{activeCategory1.category}}{{activeCategory2.category ? ' - ' + activeCategory2.category : ''}}{{activeCategory3.category ? ' - ' + activeCategory3.category : ''}}">{{activeCategory1.category}}{{activeCategory2.category ? ' - ' + activeCategory2.category : ''}}{{activeCategory3.category ? ' - ' + activeCategory3.category : ''}}</div>
45
-            <div class="btns" *ngIf="activeCategory1.id || activeCategory2.id || activeCategory3.id">
46
-              <button nz-button nzType="primary" nzSize="small" (click)="showDelModal(data, hospitalConfig === 1 ? '您确认向下复制您的配置信息吗?' : '您确认向下复制您的配置吗?将会移除各科室的配置,使用当前配置进行覆盖。','向下复制','copy')" *ngIf="currentChildrenCategoryList">向下复制</button>
47
-              <button nz-button nzType="primary" nzSize="small" class="ml8" *ngIf="hospitalConfig === 2" (click)="addConfigModal()">新增</button>
48
-            </div>
49
-          </div>
50
-          <div class="contentBody" id="categoryTable">
51
-            <div class="list-template">
52
-              <div class="list-template__content">
53
-                <div class="list-template__bottom">
54
-                  <nz-table class="list-template__nzTable" [nzData]="categoryConfigList" nzSize="middle" [nzShowPagination]="false"
55
-                    [nzLoading]="loading1" [nzScroll]="{ y: tableCategoryHeight + 'px' }">
56
-                    <thead>
57
-                      <tr class="thead">
58
-                        <th nzWidth="16%">院区</th>
59
-                        <th nzWidth="16%">责任部门</th>
60
-                        <th nzWidth="16%">优先级</th>
61
-                        <th nzWidth="16%">积分</th>
62
-                        <th nzWidth="16%">维修人|组</th>
63
-                        <th nzWidth="20%">操作</th>
64
-                      </tr>
65
-                    </thead>
66
-                    <tbody>
67
-                      <tr *ngFor="let data of categoryConfigList;let i = index">
68
-                        <td>{{data.hospitalDTO?.hosName}}</td>
69
-                        <td>{{data.dutyDTO?.hosName}}</td>
70
-                        <td>{{data.priorityDTO?.name}}</td>
71
-                        <td>{{data.score?.value}}</td>
72
-                        <td>{{data.userGroup === 1 ? data.userDTO?.name : (data.userGroup === 2 ? data.groupDTO?.groupName : '')}}</td>
73
-                        <td>
74
-                          <div class="coop">
75
-                            <span (click)="showDelModal(data,'您确认要删除吗?','删除','delConfig')">删除</span>
76
-                            <span (click)="editConfig(data)">编辑</span>
77
-                          </div>
78
-                        </td>
79
-                      </tr>
80
-                    </tbody>
81
-                  </nz-table>
82
-                </div>
83
-              </div>
84
-            </div>
85
-          </div>
86
-        </div>
87
-      </div>
88
-    </div>
13
+    <app-configuration-category></app-configuration-category>
89 14
   </ng-container>
90 15
   <!-- 优先级 -->
91 16
   <ng-container *ngIf="activeTagId === 2">
92
-    <div class="content priority">
93
-      <div class="contentInner">
94
-        <div class="list-template" id="priorityTable">
95
-          <div class="list-template__content">
96
-            <div class="list-template__bottom">
97
-              <div class="list-template__top" nz-row>
98
-                <div nz-col nzLg="24" class="list-template__btns">
99
-                  <button nz-button class="btn default" (click)="addPriorityModal()">新增</button>
100
-                </div>
101
-              </div>
102
-              <nz-table class="list-template__nzTable" [nzData]="priorityList" nzSize="middle" [nzShowPagination]="false"
103
-                [nzLoading]="loading1" [nzScroll]="{ y: tablePriorityHeight + 'px' }">
104
-                <thead>
105
-                  <tr class="thead">
106
-                    <th nzWidth="20%">优先级名称</th>
107
-                    <th nzWidth="20%">排序</th>
108
-                    <th nzWidth="20%">响应时间(分钟)</th>
109
-                    <th nzWidth="20%">解决时间(分钟)</th>
110
-                    <th nzWidth="20%">操作</th>
111
-                  </tr>
112
-                </thead>
113
-                <tbody>
114
-                  <tr *ngFor="let data of priorityList;let i = index">
115
-                    <td>{{data.name}}</td>
116
-                    <td>{{data.orders}}</td>
117
-                    <td>{{data.responseTime}}</td>
118
-                    <td>{{data.handleTime}}</td>
119
-                    <td>
120
-                      <div class="coop">
121
-                        <span (click)="showDelModal(data,'您确认要删除吗?','删除','delPriority')">删除</span>
122
-                        <span (click)="editPriority(data)">编辑</span>
123
-                      </div>
124
-                    </td>
125
-                  </tr>
126
-                </tbody>
127
-              </nz-table>
128
-            </div>
129
-          </div>
130
-        </div>
131
-      </div>
132
-    </div>
17
+    <app-configuration-priority></app-configuration-priority>
133 18
   </ng-container>
134 19
   <!-- 数据字典 -->
135 20
   <ng-container *ngIf="activeTagId === 3">
136
-    <div class="content" id="dictionary">
137
-      <div class="contentInner">
138
-        <div class="address">
139
-          <overlay-scrollbars #osComponentRef5 class="contentBody">
140
-            <div class="contentItem" [title]="item.name" [ngClass]="{ active: item.id === activeDictionaryKey.id }" (click)="clickDictionaryKey(item)" *ngFor="let item of dictionaryKeyList">{{ item.name }}</div>
141
-          </overlay-scrollbars>
142
-        </div>
143
-        <div class="addressAssign">
144
-          <div class="contentBody">
145
-            <div class="dictionaryRow">
146
-              <div class="orders">排序号</div>
147
-              <div class="name">键</div>
148
-              <div class="value">值</div>
149
-            </div>
150
-            <form nz-form [formGroup]="validateDictionaryForm" class="w100">
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>
161
-                <div class="name">
162
-                  <nz-form-item>
163
-                    <nz-form-control [nzSpan]="24" nzErrorTip="请输入键!">
164
-                      <nz-input-group>
165
-                        <input [formControlName]="'name_' + data.id" nz-input class="nameInput">
166
-                      </nz-input-group>
167
-                    </nz-form-control>
168
-                  </nz-form-item>
169
-                </div>
170
-                <div class="value">
171
-                  <nz-form-item>
172
-                    <nz-form-control [nzSpan]="24" nzErrorTip="请输入值!">
173
-                      <nz-input-group>
174
-                        <input [formControlName]="'value_' + data.id" nz-input class="valueInput">
175
-                      </nz-input-group>
176
-                    </nz-form-control>
177
-                  </nz-form-item>
178
-                  <i class="icon_transport transport-tag27fuben ml8" (click)="addField(i)"></i>
179
-                  <i class="icon_transport transport-shanchu1 ml8" *ngIf="dictionaryList.length > 1 && !data.system" (click)="removeField(data, i)"></i>
180
-                </div>
181
-              </div>
182
-            </form>
183
-          </div>
184
-          <div class="contentBtns">
185
-            <button nz-button nzType="primary" class="ml8" (click)="saveDictionary()">保存</button>
186
-          </div>
187
-        </div>
188
-      </div>
189
-    </div>
21
+    <app-configuration-dictionary></app-configuration-dictionary>
190 22
   </ng-container>
191 23
 </div>
192 24
 
193
-<!-- 操作成功/失败提示框 -->
194
-<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
195
-  [info]="promptInfo">
196
-</app-prompt-modal>
197
-
198
-<!-- 删除模态框 -->
199
-<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
200
-(confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
201
-
202
-<!-- 新增/编辑优先级模态框 -->
203
-<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modalPriority">
204
-  <div class="modalBody">
205
-    <div class="title">{{modelName}}优先级<i class="icon_transport transport-guanbi" (click)="hidePriorityModal()"></i></div>
206
-    <div class="content">
207
-      <form nz-form [formGroup]="validatePriorityForm" class="addForm">
208
-        <nz-form-item>
209
-          <nz-form-label [nzSpan]="6" nzRequired nzFor="name">优先级名称</nz-form-label>
210
-          <nz-form-control [nzSpan]="18" nzErrorTip="请输入优先级名称!">
211
-            <nz-input-group>
212
-              <input formControlName="name" nz-input placeholder="请输入优先级名称">
213
-            </nz-input-group>
214
-          </nz-form-control>
215
-        </nz-form-item>
216
-        <nz-form-item>
217
-          <nz-form-label [nzSpan]="6" nzRequired nzFor="orders">排&nbsp;&nbsp;&nbsp;序&nbsp;&nbsp;&nbsp;号</nz-form-label>
218
-          <nz-form-control [nzSpan]="18" nzErrorTip="请输入排序号!">
219
-            <nz-input-group>
220
-              <nz-input-number class="w100" formControlName="orders" nzPlaceHolder="请输入排序号" [nzMin]="0" [nzStep]="1" [nzPrecision]="0"></nz-input-number>
221
-            </nz-input-group>
222
-          </nz-form-control>
223
-        </nz-form-item>
224
-        <nz-form-item>
225
-          <nz-form-label [nzSpan]="6" nzRequired nzFor="responseTime">响&nbsp;应&nbsp;时&nbsp;间</nz-form-label>
226
-          <nz-form-control [nzSpan]="18" nzErrorTip="请输入响应时间(分钟)!">
227
-            <nz-input-group>
228
-              <nz-input-number class="w100" formControlName="responseTime" nzPlaceHolder="请输入响应时间(分钟)" [nzMin]="0" [nzStep]="1" [nzPrecision]="0" [nzFormatter]="formatterMinute" [nzParser]="parserMinute"></nz-input-number>
229
-            </nz-input-group>
230
-          </nz-form-control>
231
-        </nz-form-item>
232
-        <nz-form-item>
233
-          <nz-form-label [nzSpan]="6" nzRequired nzFor="handleTime">解&nbsp;决&nbsp;时&nbsp;间</nz-form-label>
234
-          <nz-form-control [nzSpan]="18" nzErrorTip="请输入解决时间(分钟)!">
235
-            <nz-input-group>
236
-              <nz-input-number class="w100" formControlName="handleTime" nzPlaceHolder="请输入解决时间(分钟)" [nzMin]="0" [nzStep]="1" [nzPrecision]="0" [nzFormatter]="formatterMinute" [nzParser]="parserMinute"></nz-input-number>
237
-            </nz-input-group>
238
-          </nz-form-control>
239
-        </nz-form-item>
240
-      </form>
241
-    </div>
242
-    <div class=" display_flex justify-content_flex-center">
243
-      <button nzType="primary" nz-button (click)="submitPriorityForm()" [nzLoading]="btnLoading">确认</button>
244
-      <button class="btn cancel" nz-button nzType="default" (click)="hidePriorityModal()">取消</button>
245
-    </div>
246
-  </div>
247
-</div>
248
-
249
-<!-- 新增/编辑故障现象模态框 -->
250
-<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modalCategory">
251
-  <div class="modalBody">
252
-    <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hideCategoryModal()"></i></div>
253
-    <div class="content">
254
-      <div class="tips" *ngIf="coopType === 1">您将添加一级故障现象,请输入故障现象</div>
255
-      <div class="tips" *ngIf="coopType === 2">您将在“<span class="red">{{activeCategory1.category}}</span>”下新增故障现象,请输入故障现象</div>
256
-      <div class="tips" *ngIf="coopType === 3">您将在“<span class="red">{{activeCategory1.category}}{{activeCategory2.category ? ' - ' + activeCategory2.category : ''}}</span>”下新增故障现象,请输入故障现象</div>
257
-      <form nz-form [formGroup]="validateCategoryForm" class="addForm">
258
-        <nz-form-item>
259
-          <nz-form-control [nzSpan]="24" nzErrorTip="请输入故障现象名称!">
260
-            <nz-input-group>
261
-              <textarea formControlName="name" nz-input placeholder="请输入故障现象名称" [nzAutosize]="{minRows: 3}"></textarea>
262
-            </nz-input-group>
263
-          </nz-form-control>
264
-        </nz-form-item>
265
-      </form>
266
-    </div>
267
-    <div class=" display_flex justify-content_flex-center">
268
-      <button nzType="primary" nz-button (click)="submitCategoryForm()" [nzLoading]="btnLoading">确认</button>
269
-      <button class="btn cancel" nz-button nzType="default" (click)="hideCategoryModal()">取消</button>
270
-    </div>
271
-  </div>
272
-</div>
273
-
274
-<!-- 新增/编辑关联模态框 -->
275
-<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modalConfig">
276
-  <div class="modalBody">
277
-    <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hideConfigModal()"></i></div>
278
-    <div class="content">
279
-      <form nz-form [formGroup]="validateConfigForm" class="addForm">
280
-        <nz-form-item>
281
-          <nz-form-label [nzSpan]="5" nzRequired nzFor="hosId">院区</nz-form-label>
282
-          <nz-form-control [nzSpan]="19" nzErrorTip="请选择院区!">
283
-            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="hosId" nzShowSearch
284
-              nzPlaceHolder="请选择院区" nzServerSearch (ngModelChange)="changeHospital($event)" [nzDisabled]="!add">
285
-              <ng-container *ngFor="let data of hospitalList">
286
-                <nz-option *ngIf="!isLoading" [nzLabel]="data.hosName" [nzValue]="data.id"></nz-option>
287
-              </ng-container>
288
-              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
289
-                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
290
-              </nz-option>
291
-            </nz-select>
292
-          </nz-form-control>
293
-        </nz-form-item>
294
-        <nz-form-item>
295
-          <nz-form-label [nzSpan]="5" nzRequired nzFor="dutyId">责任部门</nz-form-label>
296
-          <nz-form-control [nzSpan]="19" nzErrorTip="请选择责任部门!">
297
-            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="dutyId" nzShowSearch
298
-              nzPlaceHolder="请选择责任部门" nzServerSearch (ngModelChange)="changeDuty($event)" [nzDisabled]="!add">
299
-              <ng-container *ngFor="let data of dutyList">
300
-                <nz-option *ngIf="!isLoading" [nzLabel]="data.hosName" [nzValue]="data.id"></nz-option>
301
-              </ng-container>
302
-              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
303
-                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
304
-              </nz-option>
305
-            </nz-select>
306
-          </nz-form-control>
307
-        </nz-form-item>
308
-        <nz-form-item>
309
-          <nz-form-label [nzSpan]="5" nzRequired nzFor="priority">优先级</nz-form-label>
310
-          <nz-form-control [nzSpan]="19" nzErrorTip="请选择优先级!">
311
-            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="priority" nzShowSearch
312
-            nzPlaceHolder="请选择优先级" nzServerSearch>
313
-              <ng-container *ngFor="let option of priority_c_List">
314
-                <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
315
-              </ng-container>
316
-              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
317
-                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
318
-              </nz-option>
319
-            </nz-select>
320
-          </nz-form-control>
321
-        </nz-form-item>
322
-        <nz-form-item>
323
-          <nz-form-label [nzSpan]="5" nzRequired nzFor="score">积分</nz-form-label>
324
-          <nz-form-control [nzSpan]="19" nzErrorTip="请选择积分!">
325
-            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="score" nzShowSearch
326
-              nzPlaceHolder="请选择积分" nzServerSearch>
327
-              <ng-container *ngFor="let data of scoreList">
328
-                <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.id"></nz-option>
329
-              </ng-container>
330
-              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
331
-                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
332
-              </nz-option>
333
-            </nz-select>
334
-          </nz-form-control>
335
-        </nz-form-item>
336
-        <nz-form-item>
337
-          <nz-form-label [nzSpan]="5" nzRequired nzFor="userGroup">分配方式</nz-form-label>
338
-          <nz-form-control [nzSpan]="19" nzErrorTip="请选择积分!">
339
-            <nz-radio-group formControlName="userGroup" (ngModelChange)="changeUserGroup($event)">
340
-              <label nz-radio [nzValue]="1">人</label>
341
-              <label nz-radio [nzValue]="2">组</label>
342
-            </nz-radio-group>
343
-          </nz-form-control>
344
-        </nz-form-item>
345
-        <nz-form-item>
346
-          <nz-form-label [nzSpan]="5" nzRequired nzFor="groupId">维修组</nz-form-label>
347
-          <nz-form-control [nzSpan]="19" nzErrorTip="请选择维修组!">
348
-            <nz-select (nzOnSearch)="changeInp('group', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="groupId" nzPlaceHolder="请选择维修组" (ngModelChange)="changeGroup($event)">
349
-              <ng-container *ngFor="let option of groupList">
350
-                <nz-option *ngIf="!isLoading" [nzLabel]="option.groupName" [nzValue]="option.id"></nz-option>
351
-              </ng-container>
352
-              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
353
-                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
354
-              </nz-option>
355
-            </nz-select>
356
-          </nz-form-control>
357
-        </nz-form-item>
358
-        <nz-form-item *ngIf="validateConfigForm.value.userGroup === 1">
359
-          <nz-form-label [nzSpan]="5" nzRequired nzFor="userId">维修人</nz-form-label>
360
-          <nz-form-control [nzSpan]="19" nzErrorTip="请选择维修人!">
361
-            <nz-select (nzOnSearch)="changeInp('user', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="userId" nzPlaceHolder="请选择维修人">
362
-              <ng-container *ngFor="let option of userList">
363
-                <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
364
-              </ng-container>
365
-              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
366
-                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
367
-              </nz-option>
368
-            </nz-select>
369
-          </nz-form-control>
370
-        </nz-form-item>
371
-      </form>
372
-    </div>
373
-    <div class=" display_flex justify-content_flex-center">
374
-      <button nzType="primary" nz-button (click)="submitConfigForm()" [nzLoading]="btnLoading">确认</button>
375
-      <button class="btn cancel" nz-button nzType="default" (click)="hideConfigModal()">取消</button>
376
-    </div>
377
-  </div>
378
-</div>
379 25
 
380
-<!-- 遮罩 -->
381
-<app-mask *ngIf="maskFlag"></app-mask>

+ 1 - 343
src/app/views/other-config/other-config.component.less

@@ -1,71 +1,7 @@
1 1
 @import "../../../../src/theme.less";
2 2
 :host {
3 3
   width: 100%;
4
-  .list-template__nzTable,
5
-  .list-template__bottom{
6
-    padding: 0!important;
7
-    border: none!important;
8
-    background: #fff!important;
9
-  }
10
-  .list-template{
11
-    width: 100%!important;
12
-    height: 100%!important;
13
-  }
14
-  #dictionary{
15
-    margin: 24px 16px;
16
-    .addressAssign{
17
-      flex: 7;
18
-    }
19
-    .contentItem{
20
-      margin: 0 16px;
21
-      padding: 8px;
22
-      text-align: center;
23
-      &.active{
24
-        background-color: @primary-color;
25
-        color: #fff;
26
-        border-radius: 4px;
27
-      }
28
-    }
29
-    .contentBody{
30
-      padding: 16px;
31
-    }
32
-    ::ng-deep .ant-form-item{
33
-      margin-bottom: 0;
34
-    }
35
-    .dictionaryRow{
36
-      display: flex;
37
-      align-items: center;
38
-      justify-content: center;
39
-      gap: 16px;
40
-      .orders{
41
-        flex: 1;
42
-        display: flex;
43
-        justify-content: flex-end;
44
-        align-items: center;
45
-      }
46
-      .name{
47
-        width: 100px;
48
-        display: flex;
49
-        justify-content: flex-end;
50
-        align-items: center;
51
-      }
52
-      .value{
53
-        flex: 3;
54
-        display: flex;
55
-        align-items: center;
56
-        .valueInput{
57
-          width: 600px;
58
-        }
59
-        .icon_transport{
60
-          font-size: 20px;
61
-          color: #8a8a8a;
62
-          cursor: pointer;
63
-        }
64
-      }
65
-
66
-    }
67
-  }
68
-  .otherConfig{
4
+  .incidentConfig{
69 5
     padding-bottom: 24px;
70 6
     height: 100%;
71 7
     display: flex;
@@ -110,283 +46,5 @@
110 46
         }
111 47
       }
112 48
     }
113
-    .hospitalConfig{
114
-      height: 60px;
115
-      display: flex;
116
-      justify-content: center;
117
-      align-items: center;
118
-      gap: 72px;
119
-    }
120
-    .content{
121
-      flex: 1;
122
-      min-height: 0;
123
-      display: flex;
124
-      flex-direction: column;
125
-      justify-content: space-between;
126
-      border: 1px solid #EEF3F9;
127
-      &.priority{
128
-        margin: 24px 118px 0;
129
-        background-color: #fff;
130
-        .contentInner{
131
-          padding: 48px 206px;
132
-          border: 1px solid #E8EBEF;
133
-        }
134
-      }
135
-      .contentItem{
136
-        padding: 4px 16px;
137
-        cursor: pointer;
138
-        overflow: hidden;
139
-        text-overflow: ellipsis;
140
-        white-space: nowrap;
141
-        &.active{
142
-          color: @primary-color;
143
-          background-color: #F0F6ED;
144
-          border-radius: 4px;
145
-        }
146
-      }
147
-      .contentInner{
148
-        flex: 1;
149
-        display: flex;
150
-        justify-content: space-between;
151
-        align-items: center;
152
-        padding: 0 16px;
153
-        gap: 16px;
154
-        .contentHead{
155
-          height: 45px;
156
-          display: flex;
157
-          justify-content: space-between;
158
-          align-items: center;
159
-          gap: 16px;
160
-          padding: 0 16px;
161
-          font-size: 16px;
162
-          font-weight: bold;
163
-          border-bottom: 1px solid #D9D9D9;
164
-          .title{
165
-            overflow: hidden;
166
-            text-overflow: ellipsis;
167
-            white-space: nowrap;
168
-          }
169
-          .btns{
170
-            flex-shrink: 0;
171
-          }
172
-        }
173
-        .contentBody{
174
-          padding: 0 8px;
175
-          margin: 4px 0;
176
-          flex: 1;
177
-        }
178
-        .address{
179
-          flex: 1;
180
-          height: 100%;
181
-          background: #FFFFFF;
182
-          border: 1px solid #E8EBEF;
183
-          display: flex;
184
-          flex-direction: column;
185
-          width: 0;
186
-        }
187
-        .addressAssign{
188
-          flex: 3;
189
-          height: 100%;
190
-          background: #FFFFFF;
191
-          border: 1px solid #E8EBEF;
192
-          display: flex;
193
-          flex-direction: column;
194
-          width: 0;
195
-        }
196
-        .list-template__searchItem {
197
-          margin-bottom: 16px;
198
-          .label {
199
-            color: #333;
200
-            display: inline-block;
201
-            width: 70px;
202
-            text-align-last: justify;
203
-            text-align: justify;
204
-            &.label--big {
205
-              width: 100px;
206
-            }
207
-          }
208
-          .formItem {
209
-            width: 135px;
210
-          }
211
-        }
212
-      }
213
-      .contentBtns{
214
-        margin-bottom: 16px;
215
-        display: flex;
216
-        justify-content: center;
217
-        align-items: center;
218
-      }
219
-    }
220
-  }
221
-
222
-  .save {
223
-    position: fixed;
224
-    left: 0;
225
-    top: 0;
226
-    width: 100%;
227
-    height: 100%;
228
-    background: rgba(0, 0, 0, 0.4);
229
-    z-index: 99;
230
-
231
-    .tips{
232
-      margin-bottom: 16px!important;
233
-    }
234
-
235
-    .modalBody {
236
-      width: 350px;
237
-      background: #fff;
238
-      border-radius: 5px;
239
-      padding: 10px 20px;
240
-      color: #333;
241
-
242
-      .title {
243
-        width: 100%;
244
-        text-align: center;
245
-        font-size: 18px;
246
-        position: relative;
247
-
248
-        i {
249
-          position: absolute;
250
-          right: 0;
251
-          top: 0;
252
-          font-size: 20px;
253
-          color: #666;
254
-          cursor: pointer;
255
-          padding: 0 5px;
256
-        }
257
-      }
258
-
259
-      .content {
260
-        width: 310px;
261
-        background: #f9fafb;
262
-        border: 1px solid #e5e9ed;
263
-        border-radius: 5px;
264
-        overflow: hidden;
265
-        margin-top: 12px;
266
-        padding: 16px 0;
267
-
268
-        .busyList{
269
-          display: flex;
270
-          margin-bottom: 8px;
271
-          .busyContent{
272
-            margin-right: 8px;
273
-            flex: 1;
274
-          }
275
-        }
276
-
277
-        & > div {
278
-          text-align: center;
279
-          margin: 0;
280
-
281
-          &.icon {
282
-            // margin-top: 17px;
283
-
284
-            i {
285
-              color: #34b349;
286
-              font-size: 30px !important;
287
-
288
-              &.transport-wenhao {
289
-                color: #f5a523;
290
-              }
291
-
292
-              &.transport-shibai {
293
-                color: #ff3a52;
294
-              }
295
-            }
296
-          }
297
-
298
-          &.defeat {
299
-            color: #333;
300
-            font-size: 14px;
301
-          }
302
-
303
-          &:nth-child(3) {
304
-            font-size: 14px;
305
-            color: #666;
306
-          }
307
-        }
308
-        .workAssignmentTips {
309
-          font-size: 12px;
310
-        }
311
-      }
312
-
313
-      button {
314
-        margin-top: 10px;
315
-
316
-        &.btn {
317
-          margin-left: 8px;
318
-        }
319
-      }
320
-    }
321
-
322
-    // 新增
323
-    &.add {
324
-      .modalBody {
325
-        width: 480px;
326
-        height: auto;
327
-
328
-        .content {
329
-          width: 100%;
330
-          height: auto;
331
-          padding: 16px;
332
-          max-height: 497px;
333
-          overflow-y: auto;
334
-
335
-          .addForm {
336
-            .ant-form-item {
337
-              margin-bottom: 0;
338
-
339
-              .ant-form-item-label {
340
-                text-align: left;
341
-              }
342
-
343
-              .desc {
344
-                margin-top: 5px;
345
-              }
346
-            }
347
-
348
-            .datesControl {
349
-              margin-top: -16px;
350
-
351
-              .ant-form-item-label {
352
-                line-height: 40px;
353
-              }
354
-            }
355
-
356
-            .timer {
357
-              .ant-form-item-label {
358
-                width: 100%;
359
-                text-align: left;
360
-              }
361
-
362
-              .numInp {
363
-                margin-right: 5px;
364
-              }
365
-
366
-              .line {
367
-                margin-right: 5px;
368
-              }
369
-            }
370
-
371
-            .timer2 {
372
-              .ant-form-item-label {
373
-                line-height: 20px;
374
-              }
375
-            }
376
-          }
377
-
378
-          .editForm {
379
-            .ant-form-item {
380
-              margin-bottom: 15px;
381
-
382
-              .ant-form-item-label {
383
-                line-height: 14px;
384
-                text-align: left;
385
-              }
386
-            }
387
-          }
388
-        }
389
-      }
390
-    }
391 49
   }
392 50
 }

Plik diff jest za duży
+ 2 - 1038
src/app/views/other-config/other-config.component.ts


+ 7 - 1
src/app/views/other-config/other-config.module.ts

@@ -4,11 +4,17 @@ import { CommonModule } from '@angular/common';
4 4
 import { OtherConfigRoutingModule } from './other-config-routing.module';
5 5
 import { OtherConfigComponent } from './other-config.component';
6 6
 import { ShareModule } from 'src/app/share/share.module';
7
+import { ConfigurationCategoryComponent } from 'src/app/components/configurationCenter/configuration-category/configuration-category.component';
8
+import { ConfigurationPriorityComponent } from 'src/app/components/configurationCenter/configuration-priority/configuration-priority.component';
9
+import { ConfigurationDictionaryComponent } from 'src/app/components/configurationCenter/configuration-dictionary/configuration-dictionary.component';
7 10
 
8 11
 
9 12
 @NgModule({
10 13
   declarations: [
11
-    OtherConfigComponent
14
+    OtherConfigComponent,
15
+    ConfigurationCategoryComponent,
16
+    ConfigurationPriorityComponent,
17
+    ConfigurationDictionaryComponent,
12 18
   ],
13 19
   imports: [
14 20
     CommonModule,