inspection-configuration-item.component.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <div class="inspectionConfigurationItem">
  2. <div class="list-template inspectionConfigurationItemTable">
  3. <div class="list-template__content">
  4. <div class="list-template__bottom">
  5. <div class="list-template__top" nz-row>
  6. <div nz-col nzXl='18' class="list-template__searchBox">
  7. <button nz-button class="btn default" (click)="goBack()">返回</button>
  8. </div>
  9. <div nz-col nzLg="6" class="list-template__btns">
  10. <button nz-button class="btn default" (click)="addModal()">新增巡检项</button>
  11. </div>
  12. </div>
  13. <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
  14. [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }">
  15. <thead>
  16. <tr class="thead">
  17. <th nzWidth="13%">巡检项</th>
  18. <th nzWidth="13%">是否必填</th>
  19. <th nzWidth="13%">默认值</th>
  20. <th nzWidth="13%">排序号</th>
  21. <th nzWidth="13%">填写方式</th>
  22. <th nzWidth="13%">异常显示</th>
  23. <th nzWidth="22%">操作</th>
  24. </tr>
  25. </thead>
  26. <tbody>
  27. <tr *ngFor="let data of listOfData;let i = index">
  28. <td>{{data.name}}</td>
  29. <td>{{data.required === 1 ? '是' : (data.required === 0 ? '否' : '')}}</td>
  30. <td>{{data.defaultValue}}</td>
  31. <td>{{data.orders}}</td>
  32. <td>{{data.type?.name}}</td>
  33. <td>{{data.showError === 1 ? '是' : (data.showError === 0 ? '否' : '')}}</td>
  34. <td>
  35. <div class="coop">
  36. <span (click)="showDelModal(data,'您确认要删除吗?','删除','del')">删除</span>
  37. <span (click)="edit(data)">编辑</span>
  38. <span (click)="showModelInspectionConfigurationItem(data)" *ngIf="data.type.value === '1' || data.type.value === '2' || data.type.value === '3'">选择项配置</span>
  39. <span (click)="showDelModal(data,'您确认要隐藏吗?','隐藏','hidden')" *ngIf="inspectionConfigurationDetail.status.value === '1' && data.display === 1">隐藏</span>
  40. <span (click)="showDelModal(data,'您确认要显示吗?','显示','show')" *ngIf="inspectionConfigurationDetail.status.value === '1' && data.display === 0">显示</span>
  41. </div>
  42. </td>
  43. </tr>
  44. </tbody>
  45. </nz-table>
  46. </div>
  47. </div>
  48. <!-- 新增/编辑巡检项模态框 -->
  49. <div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modal">
  50. <div class="modalBody">
  51. <div class="title">{{modelName}}巡检项<i class="icon_transport transport-guanbi" (click)="hideAddModal()"></i></div>
  52. <div class="content">
  53. <form nz-form [formGroup]="validateForm" class="addForm">
  54. <nz-form-item>
  55. <nz-form-label [nzSpan]="6" nzRequired nzFor="name">巡检项名称</nz-form-label>
  56. <nz-form-control [nzSpan]="18" nzErrorTip="请输入巡检项名称!">
  57. <nz-input-group>
  58. <input formControlName="name" nz-input placeholder="请输入巡检项名称">
  59. </nz-input-group>
  60. </nz-form-control>
  61. </nz-form-item>
  62. <nz-form-item>
  63. <nz-form-label [nzSpan]="6" nzRequired nzFor="orders">排&nbsp;&nbsp;&nbsp;序&nbsp;&nbsp;&nbsp;号</nz-form-label>
  64. <nz-form-control [nzSpan]="18" nzErrorTip="请输入排序号!">
  65. <nz-input-group>
  66. <nz-input-number class="w100" formControlName="orders" nzPlaceHolder="请输入排序号" [nzMin]="0" [nzStep]="1" [nzPrecision]="0"></nz-input-number>
  67. </nz-input-group>
  68. </nz-form-control>
  69. </nz-form-item>
  70. <nz-form-item>
  71. <nz-form-label [nzSpan]="6" nzRequired nzFor="type">填&nbsp;写&nbsp;方&nbsp;式</nz-form-label>
  72. <nz-form-control [nzSpan]="18" nzErrorTip="请选择填写方式!">
  73. <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="type" nzShowSearch
  74. nzPlaceHolder="请选择填写方式" nzServerSearch (ngModelChange)="changeType($event)">
  75. <ng-container *ngFor="let data of dispatchMethods">
  76. <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.value"></nz-option>
  77. </ng-container>
  78. <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
  79. <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
  80. </nz-option>
  81. </nz-select>
  82. </nz-form-control>
  83. </nz-form-item>
  84. <nz-form-item *ngIf="validateForm.value.type !== null && validateForm.value.type !== '8'">
  85. <nz-form-label [nzSpan]="6" nzRequired nzFor="required">是&nbsp;否&nbsp;必&nbsp;填</nz-form-label>
  86. <nz-form-control [nzSpan]="18" nzErrorTip="请选择是否必填!">
  87. <nz-radio-group formControlName="required">
  88. <label nz-radio [nzValue]="1">是</label>
  89. <label nz-radio [nzValue]="0">否</label>
  90. </nz-radio-group>
  91. </nz-form-control>
  92. </nz-form-item>
  93. <!-- 数值 -->
  94. <ng-container *ngIf="validateForm.value.type === '4'">
  95. <nz-form-item>
  96. <nz-form-label [nzSpan]="6" nzRequired nzFor="checkType">判&nbsp;断&nbsp;形&nbsp;式</nz-form-label>
  97. <nz-form-control [nzSpan]="18" nzErrorTip="请选择判断形式!">
  98. <nz-radio-group formControlName="checkType" (ngModelChange)="changeCheckType($event)">
  99. <label nz-radio [nzValue]="1">标准正负值</label>
  100. <label nz-radio [nzValue]="2">范围值</label>
  101. </nz-radio-group>
  102. </nz-form-control>
  103. </nz-form-item>
  104. <!-- 标准正负值 -->
  105. <ng-container *ngIf="validateForm.value.checkType == 1">
  106. <nz-form-item>
  107. <nz-form-label [nzSpan]="6" nzRequired nzFor="valuex">标&nbsp;&nbsp;&nbsp;准&nbsp;&nbsp;&nbsp;值</nz-form-label>
  108. <nz-form-control [nzSpan]="18" nzErrorTip="请输入标准值!">
  109. <nz-input-group>
  110. <nz-input-number class="w100" formControlName="valuex" nzPlaceHolder="请输入标准值"></nz-input-number>
  111. </nz-input-group>
  112. </nz-form-control>
  113. </nz-form-item>
  114. <nz-form-item>
  115. <nz-form-label [nzSpan]="6" nzRequired nzFor="valueGap">正负范围值</nz-form-label>
  116. <nz-form-control [nzSpan]="18" nzErrorTip="请输入正负范围值!">
  117. <nz-input-group>
  118. <nz-input-number class="w100" formControlName="valueGap" nzPlaceHolder="请输入正负范围值"></nz-input-number>
  119. </nz-input-group>
  120. </nz-form-control>
  121. </nz-form-item>
  122. </ng-container>
  123. <!-- 范围值 -->
  124. <ng-container *ngIf="validateForm.value.checkType == 2">
  125. <div class="form_item_wrap" nz-row>
  126. <nz-form-item nz-col [nzSpan]="12">
  127. <nz-form-label [nzSpan]="12" nzRequired nzFor="valueLow">范&nbsp;&nbsp;&nbsp;围&nbsp;&nbsp;&nbsp;值</nz-form-label>
  128. <nz-form-control [nzSpan]="12" nzErrorTip="请输入最小值!">
  129. <nz-input-group>
  130. <nz-input-number formControlName="valueLow" nzPlaceHolder="最小值"></nz-input-number>
  131. </nz-input-group>
  132. </nz-form-control>
  133. </nz-form-item>
  134. <span nz-col [nzSpan]="2" style="display: flex;padding-top: 10px;justify-content: center;padding-right: 12px;">至</span>
  135. <nz-form-item nz-col [nzSpan]="10">
  136. <nz-form-label [nzSpan]="10" nzRequired nzFor="valueUp" hidden>范&nbsp;&nbsp;&nbsp;围&nbsp;&nbsp;&nbsp;值</nz-form-label>
  137. <nz-form-control [nzSpan]="14" nzErrorTip="请输入最大值!">
  138. <nz-input-group>
  139. <nz-input-number formControlName="valueUp" nzPlaceHolder="最大值"></nz-input-number>
  140. </nz-input-group>
  141. </nz-form-control>
  142. </nz-form-item>
  143. </div>
  144. </ng-container>
  145. <nz-form-item *ngIf="validateForm.value.checkType !== null">
  146. <nz-form-label [nzSpan]="6" nzRequired nzFor="defaultValueNumber">默&nbsp;&nbsp;&nbsp;认&nbsp;&nbsp;&nbsp;值</nz-form-label>
  147. <nz-form-control [nzSpan]="18" nzErrorTip="请输入默认值!">
  148. <nz-input-group>
  149. <nz-input-number class="w100" formControlName="defaultValueNumber" nzPlaceHolder="请输入默认值"></nz-input-number>
  150. </nz-input-group>
  151. </nz-form-control>
  152. </nz-form-item>
  153. </ng-container>
  154. <nz-form-item *ngIf="validateForm.value.type === '5' || validateForm.value.type === '6'">
  155. <nz-form-label [nzSpan]="6" nzRequired nzFor="defaultValueString">默&nbsp;&nbsp;&nbsp;认&nbsp;&nbsp;&nbsp;值</nz-form-label>
  156. <nz-form-control [nzSpan]="18" nzErrorTip="请输入默认值!">
  157. <nz-input-group>
  158. <input formControlName="defaultValueString" nz-input placeholder="请输入默认值">
  159. </nz-input-group>
  160. </nz-form-control>
  161. </nz-form-item>
  162. <nz-form-item *ngIf="validateForm.value.type === '5' || validateForm.value.type === '6' || validateForm.value.type === '7'">
  163. <nz-form-label [nzSpan]="6" nzRequired nzFor="showError">异&nbsp;常&nbsp;显&nbsp;示</nz-form-label>
  164. <nz-form-control [nzSpan]="18" nzErrorTip="请选择异常显示!">
  165. <nz-radio-group formControlName="showError">
  166. <label nz-radio [nzValue]="1">是</label>
  167. <label nz-radio [nzValue]="0">否</label>
  168. </nz-radio-group>
  169. </nz-form-control>
  170. </nz-form-item>
  171. </form>
  172. </div>
  173. <div class=" display_flex justify-content_flex-center">
  174. <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">确认</button>
  175. <button class="btn cancel" nz-button nzType="default" (click)="hideAddModal()">取消</button>
  176. </div>
  177. </div>
  178. </div>
  179. <!-- 新增/编辑巡检项页码模态框 -->
  180. <div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="pageModal">
  181. <div class="modalBody">
  182. <div class="title">{{modelName}}巡检项页码<i class="icon_transport transport-guanbi" (click)="hideAddPageModal()"></i></div>
  183. <div class="content">
  184. <form nz-form [formGroup]="validatePageForm" class="addForm">
  185. <nz-form-item>
  186. <nz-form-label [nzSpan]="4" nzRequired nzFor="name">标题</nz-form-label>
  187. <nz-form-control [nzSpan]="20" nzErrorTip="请输入标题!">
  188. <nz-input-group>
  189. <input formControlName="name" nz-input placeholder="请输入标题">
  190. </nz-input-group>
  191. </nz-form-control>
  192. </nz-form-item>
  193. </form>
  194. </div>
  195. <div class=" display_flex justify-content_flex-center">
  196. <button nzType="primary" nz-button (click)="submitPageForm()" [nzLoading]="btnLoading">确认</button>
  197. <button class="btn cancel" nz-button nzType="default" (click)="hideAddPageModal()">取消</button>
  198. </div>
  199. </div>
  200. </div>
  201. <!-- 模态框 -->
  202. <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
  203. (confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
  204. </div>
  205. <div class="inspectionConfigurationItemPage">
  206. <div class="inspectionConfigurationItemPageBox">
  207. <div class="head">
  208. <button nz-button class="btn default" (click)="addPageModal()">新增</button>
  209. </div>
  210. <overlay-scrollbars #osComponentRef1 class="content" [ngStyle]="{height: tableHeight + 46 + 'px'}">
  211. <div class="contentItem active" [ngClass]="{ active: pageActiveId == data.id }" (click)="clickPage(data)"
  212. *ngFor="let data of pageList">
  213. <div class="title">
  214. <span class="name">标题:</span>
  215. <span class="value">{{ data.name }}</span>
  216. </div>
  217. <div class="contentPage">
  218. <div class="title">
  219. <span class="name">页码:</span>
  220. <span class="value">{{ data.orders }}</span>
  221. </div>
  222. <div class="btns">
  223. <span class="icon_transport transport-weibiaoti2010104" (click)="editPage(data)"></span>
  224. <span class="icon_transport transport-shanchu1" (click)="showDelModal(data,'您确认要删除吗?','删除','delPage')"></span>
  225. </div>
  226. </div>
  227. </div>
  228. </overlay-scrollbars>
  229. </div>
  230. </div>
  231. </div>
  232. <!-- 操作成功/失败提示框 -->
  233. <app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
  234. [info]="promptInfo">
  235. </app-prompt-modal>
  236. <!-- 选择项配置 -->
  237. <app-inspection-configuration-item-prompt-modal
  238. *ngIf="inspectionConfigurationItemPromptModalShow"
  239. [show]="inspectionConfigurationItemPromptModalShow"
  240. [coopData]="coopData"
  241. (closeModelHs)="closeModelInspectionConfigurationItem($event)"
  242. (confirmModelHs)="confirmModelInspectionConfigurationItem($event)"
  243. ></app-inspection-configuration-item-prompt-modal>