1. table 谷歌内核48版本

问题:1. 无粘性定位,无法固定收尾两列

  1. <nz-table
  2. #groupingTable
  3. [nzData]="listOfData"
  4. nzBordered
  5. nzSize="small"
  6. nzTableLayout="fixed"
  7. nzAlign="center"
  8. [nzShowPagination]="false"
  9. [nzScroll]="scroll"
  10. [nzWidthConfig]="['130px']"
  11. >
  12. <thead>
  13. <tr>
  14. <th
  15. rowSpan="2"
  16. nzLeft
  17. [ngClass]="{ 'date-th': this.colName.length > 3 }"
  18. >
  19. 时间
  20. </th>
  21. <ng-container *ngFor="let item of colName">
  22. <th colspan="5">{{ item.name }}</th>
  23. </ng-container>
  24. <th
  25. rowspan="2"
  26. nzRight
  27. [ngClass]="{ 'num-th': this.colName.length > 3 }"
  28. >
  29. 总数
  30. </th>
  31. </tr>
  32. <tr>
  33. <th
  34. *ngIf="this.colName.length > 3"
  35. nzLeft
  36. [ngClass]="{ erj: this.colName.length > 3 }"
  37. >
  38. <div style="visibility: hidden">{{ "1 " }}</div>
  39. </th>
  40. <ng-container
  41. style="position: absolute; left: 130px"
  42. *ngFor="let item of colName"
  43. >
  44. <th [nzEllipsis]="this.colName.length < 3 ? 'false' : 'true'">
  45. 未结工单总数
  46. </th>
  47. <th [nzEllipsis]="this.colName.length < 3 ? 'false' : 'true'">
  48. 待生产数
  49. </th>
  50. <th [nzEllipsis]="this.colName.length < 3 ? 'false' : 'true'">
  51. SMT未结数
  52. </th>
  53. <th [nzEllipsis]="this.colName.length < 3 ? 'false' : 'true'">
  54. DIP未结数
  55. </th>
  56. <th [nzEllipsis]="this.colName.length < 3 ? 'false' : 'true'">
  57. 维修未结数
  58. </th>
  59. </ng-container>
  60. <!-- <th
  61. *ngIf="this.colName.length > 3"
  62. nzRight
  63. [ngClass]="{ two: this.colName.length > 3 }"
  64. >
  65. <div style="visibility: hidden">{{ "1 " }}</div>
  66. </th> -->
  67. </tr>
  68. </thead>
  69. <tbody>
  70. <tr *ngFor="let data of groupingTable.data">
  71. <td nzLeft [ngClass]="{ one: this.colName.length > 3 }">
  72. {{ data.date }}
  73. </td>
  74. <ng-container *ngFor="let item of data.children">
  75. <td>
  76. <a (click)="JumpToView(item, data.date, '')">{{
  77. item.workOrderOpen
  78. }}</a>
  79. </td>
  80. <td>
  81. <a (click)="JumpToView(item, data.date, 'WAIT')">{{
  82. item.productionOpen
  83. }}</a>
  84. </td>
  85. <td>
  86. <a (click)="JumpToView(item, data.date, 'SMT')">{{
  87. item.smtOpen
  88. }}</a>
  89. </td>
  90. <td>
  91. <a (click)="JumpToView(item, data.date, 'DIP')">{{
  92. item.dipOpen
  93. }}</a>
  94. </td>
  95. <td>
  96. <a (click)="JumpToView(item, data.date, 'REPAIR')">{{
  97. item.repairOpen
  98. }}</a>
  99. </td>
  100. </ng-container>
  101. <td nzRight [ngClass]="{ two: this.colName.length > 3 }">
  102. {{ data.tergetNum }}
  103. </td>
  104. </tr>
  105. </tbody>
  106. </nz-table>
  107. .date-th {
  108. position: absolute;
  109. text-align: center;
  110. width: 130px;
  111. left: 0px;
  112. border-bottom: 1px solid #fafafa;
  113. z-index: 3;
  114. line-height: 4.3;
  115. }
  116. .num-th {
  117. position: absolute;
  118. text-align: center;
  119. width: 130px;
  120. right: 0px;
  121. border-bottom: 1px solid #fafafa;
  122. z-index: 3;
  123. line-height: 4.3;
  124. }
  125. .erj {
  126. position: absolute !important;
  127. text-align: center;
  128. width: 130px;
  129. left: 0px;
  130. }
  131. .one {
  132. position: absolute;
  133. text-align: center;
  134. width: 130px;
  135. left: 0px;
  136. }
  137. .two {
  138. position: absolute;
  139. text-align: center;
  140. width: 130px;
  141. right: 0px;
  142. }

2. 树下拉框 (nz-tree-select)

  1. <nz-tree-select
  2. #treeSelect
  3. [nzDisabled]="
  4. validateFormTypeChild.value.BadReasonsCode !==
  5. 'BadSelfControl'
  6. "
  7. nzPlaceHolder="请选择"
  8. nzShowSearch
  9. [nzDropdownClassName]="'nzDropdownClassName'"
  10. [nzNodes]="deptArr"
  11. (ngModelChange)="onChange($event)"
  12. formControlName="DeptNo"
  13. ></nz-tree-select>
  14. @ViewChild('treeSelect') treeSelect;
  15. onChange(e) {
  16. const arr: NzTreeNode = this.treeSelect.getSelectedNodeList() as NzTreeNode;
  17. if (arr) {
  18. this.validateFormTypeChild.patchValue({
  19. DeptName: arr[0]?.origin?.deptName ?? '',
  20. });
  21. }
  22. this.cdr.markForCheck();
  23. this.cdr.detectChanges();
  24. }
  25. // 部门
  26. setTreeData(data) {
  27. let result;
  28. const map = {};
  29. data.forEach(item => {
  30. item.title = item.deptName;
  31. item.key = item.deptId;
  32. if (!item.hasChild) {
  33. item.isLeaf = true;
  34. }
  35. map[item.deptId] = item;
  36. });
  37. // console.log(map);
  38. data.forEach(item => {
  39. const parent = map[item.pDeptId];
  40. if (parent) {
  41. (parent.children || (parent.children = [])).push(item);
  42. } else {
  43. // 这里push的item是pDeptId为null的数据
  44. result = item;
  45. }
  46. });
  47. return result;
  48. }