domestic-action-workbench.component.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <section class="framework-page action-workbench">
  2. <app-page-header
  3. title="行动中心"
  4. eyebrow="Action Center"
  5. description="统一管理 VOC 洞察、反馈原声和经营规则形成的行动项。"
  6. icon="✓"
  7. density="compact"
  8. [crumbs]="[
  9. { label: '行动中心', link: '/action-suggestion' },
  10. { label: '行动工作台', link: '/action-suggestion/kanban' },
  11. { label: section === 'experience' ? '体验优化' : section === 'iteration' ? '产品迭代' : section === 'strategy' ? '长期策略' : '全部行动' }
  12. ]"
  13. [badges]="[{ label: 'ActionItem API', tone: 'green' }, { label: currentTypeLabel, tone: 'blue' }]"
  14. [meta]="[
  15. { label: '行动项', value: actions.length },
  16. { label: '待推进', value: activeCount },
  17. { label: '进行中', value: inProgressCount },
  18. { label: '逾期', value: overdueCount }
  19. ]">
  20. <div pageHeaderActions class="action-header-actions">
  21. <button
  22. type="button"
  23. class="action-icon-button"
  24. aria-label="刷新行动项"
  25. title="刷新"
  26. [disabled]="refreshing"
  27. (click)="loadActions(true)">
  28. <lucide-icon [class.spinning]="refreshing" [img]="icons.refresh" [size]="17" [strokeWidth]="1.9"></lucide-icon>
  29. </button>
  30. </div>
  31. </app-page-header>
  32. <app-page-toolbar [fields]="toolbarFields">
  33. <div pageToolbarActions class="action-header-actions">
  34. <button type="button" class="action-primary-button" (click)="openCreatePanel()">
  35. <lucide-icon [img]="icons.plus" [size]="17" [strokeWidth]="2"></lucide-icon>
  36. <span>新建行动</span>
  37. </button>
  38. </div>
  39. </app-page-toolbar>
  40. <app-board-tabs
  41. class="framework-tabs action-scope-tabs"
  42. [tabs]="tabs"
  43. [activeKey]="section"
  44. density="compact">
  45. </app-board-tabs>
  46. <div class="action-health-band" aria-label="行动推进概况">
  47. <div class="health-band-item">
  48. <span>当前视图</span>
  49. <strong>{{ filteredActions.length }}</strong>
  50. <small>共 {{ actions.length }} 项</small>
  51. </div>
  52. <div class="health-band-item">
  53. <span>进行中</span>
  54. <strong>{{ inProgressCount }}</strong>
  55. <small>正在推进</small>
  56. </div>
  57. <div class="health-band-item" [class.health-risk]="blockedCount > 0">
  58. <span>阻塞</span>
  59. <strong>{{ blockedCount }}</strong>
  60. <small>等待处理</small>
  61. </div>
  62. <div class="health-band-item" [class.health-risk]="overdueCount > 0">
  63. <span>已逾期</span>
  64. <strong>{{ overdueCount }}</strong>
  65. <small>未完成且超期</small>
  66. </div>
  67. </div>
  68. @if (loadWarning) {
  69. <div class="action-load-warning" role="status">
  70. <lucide-icon [img]="icons.alert" [size]="16" [strokeWidth]="1.8"></lucide-icon>
  71. <span>{{ loadWarning }};行动项仍可继续查看和更新。</span>
  72. </div>
  73. }
  74. <section class="action-surface" aria-label="行动项工作台">
  75. <div class="action-toolbar">
  76. <label class="action-search">
  77. <lucide-icon [img]="icons.search" [size]="16" [strokeWidth]="1.8"></lucide-icon>
  78. <input
  79. type="search"
  80. aria-label="搜索行动项"
  81. placeholder="搜索标题、商品、负责人或验证指标"
  82. [(ngModel)]="searchTerm" />
  83. </label>
  84. <div class="action-filter-group" aria-label="行动项筛选">
  85. <label class="action-select">
  86. <span class="sr-only">状态</span>
  87. <select [(ngModel)]="statusFilter" aria-label="按状态筛选">
  88. @for (option of statusOptions; track option.value) {
  89. <option [ngValue]="option.value">{{ option.label }}</option>
  90. }
  91. </select>
  92. </label>
  93. <label class="action-select">
  94. <span class="sr-only">负责人</span>
  95. <select [(ngModel)]="assigneeFilter" aria-label="按负责人筛选">
  96. <option value="all">全部负责人</option>
  97. <option value="unassigned">待分配</option>
  98. @for (owner of ownerOptions; track owner.value) {
  99. <option [value]="owner.value">{{ owner.label }}</option>
  100. }
  101. </select>
  102. </label>
  103. <label class="action-select">
  104. <span class="sr-only">来源</span>
  105. <select [(ngModel)]="sourceFilter" aria-label="按来源筛选">
  106. @for (option of sourceOptions; track option.value) {
  107. <option [ngValue]="option.value">{{ option.label }}</option>
  108. }
  109. </select>
  110. </label>
  111. @if (hasActiveFilters) {
  112. <button type="button" class="action-text-button" (click)="resetFilters()">
  113. <lucide-icon [img]="icons.clear" [size]="15" [strokeWidth]="1.8"></lucide-icon>
  114. <span>清除</span>
  115. </button>
  116. }
  117. </div>
  118. <div class="action-view-switch" role="group" aria-label="视图模式">
  119. <button
  120. type="button"
  121. aria-label="表格视图"
  122. title="表格视图"
  123. [class.active]="viewMode === 'table'"
  124. [attr.aria-pressed]="viewMode === 'table'"
  125. (click)="setViewMode('table')">
  126. <lucide-icon [img]="icons.list" [size]="16" [strokeWidth]="1.8"></lucide-icon>
  127. </button>
  128. <button
  129. type="button"
  130. aria-label="看板视图"
  131. title="看板视图"
  132. [class.active]="viewMode === 'board'"
  133. [attr.aria-pressed]="viewMode === 'board'"
  134. (click)="setViewMode('board')">
  135. <lucide-icon [img]="icons.board" [size]="16" [strokeWidth]="1.8"></lucide-icon>
  136. </button>
  137. </div>
  138. </div>
  139. @if (loading) {
  140. <div class="action-state">
  141. <app-loading-spinner size="lg" text="正在加载行动项..."></app-loading-spinner>
  142. </div>
  143. } @else if (error) {
  144. <app-error-state
  145. title="行动中心暂未加载"
  146. [description]="error"
  147. (retry)="loadActions()">
  148. </app-error-state>
  149. } @else if (!filteredActions.length) {
  150. <app-empty-state
  151. [title]="hasActiveFilters ? '当前筛选没有行动项' : '当前视图暂无行动项'"
  152. [description]="hasActiveFilters ? '清除筛选条件后查看其他行动。' : '从已确认洞察创建行动,或直接建立执行任务。'"
  153. [actionText]="hasActiveFilters ? '清除筛选' : '新建行动'"
  154. (action)="onEmptyAction()">
  155. </app-empty-state>
  156. } @else if (viewMode === 'table') {
  157. <div class="action-table-wrap">
  158. <table class="action-table">
  159. <thead>
  160. <tr>
  161. <th scope="col">行动项</th>
  162. <th scope="col">类型 / 来源</th>
  163. <th scope="col">优先级</th>
  164. <th scope="col">状态</th>
  165. <th scope="col">负责人</th>
  166. <th scope="col">期限</th>
  167. <th scope="col">验证指标</th>
  168. <th scope="col"><span class="sr-only">查看</span></th>
  169. </tr>
  170. </thead>
  171. <tbody>
  172. @for (action of filteredActions; track action.id) {
  173. <tr class="is-clickable" [class.is-overdue]="isOverdue(action)" (click)="openDetail(action)">
  174. <td class="action-main-cell">
  175. <div class="action-title-button">
  176. <strong>{{ action.title }}</strong>
  177. <span>{{ action.description || '暂无补充说明' }}</span>
  178. </div>
  179. </td>
  180. <td>
  181. <span class="action-type-label">{{ actionTypeLabel(action.actionType) }}</span>
  182. <span class="action-source-label">{{ sourceLabel(action) }}</span>
  183. </td>
  184. <td><span class="priority-badge" [class]="'priority-badge priority-' + action.priority">{{ priorityLabel(action.priority) }}</span></td>
  185. <td><span class="status-badge" [class]="'status-badge ' + statusClass(action.status)"><i></i>{{ statusLabel(action.status) }}</span></td>
  186. <td><span class="owner-cell"><lucide-icon [img]="icons.user" [size]="14" [strokeWidth]="1.8"></lucide-icon>{{ ownerLabel(action.assigneeUserId) }}</span></td>
  187. <td>
  188. <span class="due-cell" [class.due-overdue]="isOverdue(action)">{{ date(action.dueAt) }}</span>
  189. </td>
  190. <td><span class="validation-cell">{{ action.validationMetric || '待定义' }}</span></td>
  191. <td>
  192. <span class="row-open-button" aria-hidden="true">
  193. <lucide-icon [img]="icons.chevron" [size]="17" [strokeWidth]="1.8"></lucide-icon>
  194. </span>
  195. </td>
  196. </tr>
  197. }
  198. </tbody>
  199. </table>
  200. </div>
  201. } @else {
  202. <div class="action-board">
  203. @for (lane of lanes; track lane.id) {
  204. <section class="action-lane" [attr.aria-label]="lane.label">
  205. <header class="lane-header">
  206. <div>
  207. <strong>{{ lane.label }}</strong>
  208. <span>{{ lane.description }}</span>
  209. </div>
  210. <b>{{ actionsForLane(lane).length }}</b>
  211. </header>
  212. <div class="lane-list">
  213. @for (action of actionsForLane(lane); track action.id) {
  214. <button type="button" class="action-board-card" [class.is-overdue]="isOverdue(action)" (click)="openDetail(action)">
  215. <span class="board-card-topline">
  216. <span class="priority-badge" [class]="'priority-badge priority-' + action.priority">{{ priorityLabel(action.priority) }}</span>
  217. <span>{{ sourceLabel(action) }}</span>
  218. </span>
  219. <strong>{{ action.title }}</strong>
  220. <span class="board-card-description">{{ action.description || '暂无补充说明' }}</span>
  221. <span class="board-card-meta">
  222. <span><lucide-icon [img]="icons.user" [size]="13" [strokeWidth]="1.8"></lucide-icon>{{ ownerLabel(action.assigneeUserId) }}</span>
  223. <span [class.due-overdue]="isOverdue(action)"><lucide-icon [img]="icons.calendar" [size]="13" [strokeWidth]="1.8"></lucide-icon>{{ date(action.dueAt) }}</span>
  224. </span>
  225. </button>
  226. } @empty {
  227. <div class="lane-empty">暂无行动项</div>
  228. }
  229. </div>
  230. </section>
  231. }
  232. </div>
  233. }
  234. </section>
  235. @if (createPanelOpen) {
  236. <app-action-create-panel
  237. [workspaceId]="workspaceId"
  238. [actionType]="createActionType"
  239. [sourceKind]="'raw_feedback'"
  240. sourceLabel="行动中心手动创建"
  241. (created)="onActionCreated($event)"
  242. (cancelled)="closeCreatePanel()">
  243. </app-action-create-panel>
  244. }
  245. </section>