resources.component.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <page-header> </page-header>
  2. <nz-card [nzBordered]="false">
  3. <form nz-form [nzLayout]="'inline'" (ngSubmit)="onSearch()" class="search__form">
  4. <div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 24, lg: 24, xl: 48, xxl: 48 }">
  5. <div nz-col nzMd="10" nzSm="24">
  6. <nz-form-item>
  7. <nz-form-label nzFor="name">{{ 'mxk.resources.appName' | i18n }}</nz-form-label>
  8. <input nz-input [(ngModel)]="query.params.appName" [ngModelOptions]="{ standalone: true }" disabled placeholder="" />
  9. </nz-form-item>
  10. </div>
  11. <div nz-col nzMd="10" nzSm="24">
  12. <nz-form-item>
  13. <nz-form-label nzFor="resourceName">{{ 'mxk.resources.name' | i18n }}</nz-form-label>
  14. <nz-form-control>
  15. <input
  16. nz-input
  17. [(ngModel)]="query.params.resourceName"
  18. [ngModelOptions]="{ standalone: true }"
  19. name="resourceName"
  20. placeholder=""
  21. id="resourceName"
  22. />
  23. </nz-form-control>
  24. </nz-form-item>
  25. </div>
  26. <div nz-col [nzSpan]="query.expandForm ? 24 : 4" [class.text-right]="query.expandForm">
  27. <button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' | i18n }}</button>
  28. <button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' | i18n }}</button>
  29. <button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm" style="display: none">
  30. {{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button
  31. >
  32. </div>
  33. </div>
  34. </form>
  35. </nz-card>
  36. <nz-card [nzBordered]="false">
  37. <div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
  38. <div nz-col [nzSpan]="24" class="table-list-toolbar">
  39. <button nz-button type="button" [nzType]="'primary'" (click)="onAdd($event)">{{ 'mxk.text.add' | i18n }}</button>
  40. <button
  41. nz-button
  42. type="button"
  43. nz-popconfirm
  44. nzPopconfirmTitle="{{ 'mxk.text.delete.popconfirm.title' | i18n }}"
  45. nzPopconfirmPlacement="left"
  46. [nzCancelText]="'mxk.text.delete.popconfirm.cancelText' | i18n"
  47. [nzOkText]="'mxk.text.delete.popconfirm.okText' | i18n"
  48. (nzOnConfirm)="onBatchDelete()"
  49. [nzType]="'primary'"
  50. nzDanger
  51. class="mx-sm"
  52. >{{ 'mxk.text.delete' | i18n }}</button
  53. >
  54. </div>
  55. <div nz-col nzMd="6" nzSm="24" class="grid-border">
  56. <nz-tree
  57. nzShowLine="false"
  58. [nzCheckable]="treeNodes.checkable"
  59. nzBlockNode
  60. [nzData]="treeNodes.nodes"
  61. (nzClick)="activeNode($event)"
  62. (nzDblClick)="openFolder($event)"
  63. [nzTreeTemplate]="nzTreeTemplate"
  64. ></nz-tree>
  65. <ng-template #nzTreeTemplate let-node let-origin="origin">
  66. <span class="custom-node">
  67. <span *ngIf="!node.isLeaf" (contextmenu)="contextMenu($event, menu)">
  68. <i nz-icon [nzType]="node.isExpanded ? 'folder-open' : 'folder'" (click)="openFolder(node)"></i>
  69. <span class="folder-name">{{ node.title }}</span>
  70. </span>
  71. <span *ngIf="node.isLeaf" (contextmenu)="contextMenu($event, menu)">
  72. <i nz-icon nzType="file"></i>
  73. <span class="file-name">{{ node.title }}</span>
  74. </span>
  75. </span>
  76. </ng-template>
  77. <nz-dropdown-menu #menu="nzDropdownMenu">
  78. <ul nz-menu>
  79. <li nz-menu-item (click)="selectDropdown()">Action 1</li>
  80. <li nz-menu-item (click)="selectDropdown()">Action 2</li>
  81. </ul>
  82. </nz-dropdown-menu>
  83. </div>
  84. <div nz-col nzMd="18" nzSm="24" class="grid-border">
  85. <nz-table
  86. #dynamicTable
  87. nzTableLayout="auto"
  88. nzSize="small"
  89. nzBordered
  90. nzShowSizeChanger
  91. [nzData]="query.results.rows"
  92. [nzFrontPagination]="false"
  93. [nzTotal]="query.results.records"
  94. [nzPageSizeOptions]="query.params.pageSizeOptions"
  95. [nzPageSize]="query.params.pageSize"
  96. [nzPageIndex]="query.params.pageNumber"
  97. [nzLoading]="this.query.tableLoading"
  98. (nzQueryParams)="onQueryParamsChange($event)"
  99. nzWidth="100%"
  100. >
  101. <thead>
  102. <tr>
  103. <th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate" (nzCheckedChange)="onTableAllChecked($event)"></th>
  104. <th nzAlign="center">{{ 'mxk.resources.appName' | i18n }}</th>
  105. <th nzAlign="center">{{ 'mxk.resources.name' | i18n }}</th>
  106. <th nzAlign="center">{{ 'mxk.resources.resourceType' | i18n }}</th>
  107. <th nzAlign="center">{{ 'mxk.text.sortIndex' | i18n }}</th>
  108. <th nzAlign="center">{{ 'mxk.text.status' | i18n }}</th>
  109. <th nzAlign="center" class="table_cell_action_2">{{ 'mxk.text.action' | i18n }}</th>
  110. </tr>
  111. </thead>
  112. <tbody>
  113. <tr *ngFor="let data of query.results.rows">
  114. <td
  115. [nzChecked]="query.tableCheckedId.has(data.id)"
  116. [nzDisabled]="data.disabled"
  117. (nzCheckedChange)="onTableItemChecked(data.id, $event)"
  118. ></td>
  119. <td nzAlign="center">
  120. {{ data.appName }}
  121. </td>
  122. <td nzAlign="left"> {{ data.resourceName }}</td>
  123. <td nzAlign="left"> {{ data.resourceType }}</td>
  124. <td nzAlign="center"> {{ data.sortIndex }}</td>
  125. <td nzAlign="center"> <i *ngIf="data.status == 1" nz-icon nzType="check-circle" nzTheme="fill" style="color: green"></i></td>
  126. <td nzAlign="center" nzBreakWord="false">
  127. <div nz-col>
  128. <button nz-button type="button" (click)="onEdit($event, data.id)">{{ 'mxk.text.edit' | i18n }}</button>
  129. <button
  130. nz-button
  131. type="button"
  132. nz-popconfirm
  133. nzPopconfirmTitle="{{ 'mxk.text.delete.popconfirm.title' | i18n }}"
  134. nzPopconfirmPlacement="left"
  135. [nzCancelText]="'mxk.text.delete.popconfirm.cancelText' | i18n"
  136. [nzOkText]="'mxk.text.delete.popconfirm.okText' | i18n"
  137. (nzOnConfirm)="onDelete(data.id)"
  138. nzDanger
  139. >{{ 'mxk.text.delete' | i18n }}</button
  140. >
  141. </div>
  142. </td>
  143. </tr>
  144. </tbody>
  145. </nz-table>
  146. </div>
  147. </div>
  148. </nz-card>