2
0

resources.component.html 5.9 KB

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