project-list.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <div class="project-list-container">
  2. <!-- 右侧主要内容 -->
  3. <div class="project-content">
  4. <!-- 页面标题和操作 -->
  5. <div class="page-header">
  6. <h2>项目列表</h2>
  7. <div class="header-actions">
  8. <div class="search-container">
  9. <div class="search-box">
  10. <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  11. <circle cx="11" cy="11" r="8"></circle>
  12. <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
  13. </svg>
  14. <input
  15. type="text"
  16. placeholder="搜索项目名称或客户..."
  17. [value]="searchTerm()"
  18. (input)="searchTerm.set($any($event.target).value)"
  19. (keyup.enter)="onSearch()"
  20. >
  21. <button class="search-btn" (click)="onSearch()">
  22. <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  23. <line x1="5" y1="12" x2="19" y2="12"></line>
  24. <polyline points="12 5 19 12 12 19"></polyline>
  25. </svg>
  26. </button>
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. <!-- 筛选和排序工具栏 -->
  32. <div class="filter-toolbar">
  33. <div class="filter-group">
  34. <label>状态筛选</label>
  35. <select (change)="onStatusChange($event)" [value]="statusFilter()">
  36. <option *ngFor="let option of statusOptions" [value]="option.value">
  37. {{ option.label }}
  38. </option>
  39. </select>
  40. </div>
  41. <div class="filter-group">
  42. <label>阶段筛选</label>
  43. <select (change)="onStageChange($event)" [value]="stageFilter()">
  44. <option *ngFor="let option of stageOptions" [value]="option.value">
  45. {{ option.label }}
  46. </option>
  47. </select>
  48. </div>
  49. <div class="filter-group">
  50. <label>排序方式</label>
  51. <select (change)="onSortChange($event)" [value]="sortBy()">
  52. <option *ngFor="let option of sortOptions" [value]="option.value">
  53. {{ option.label }}
  54. </option>
  55. </select>
  56. </div>
  57. <div class="filter-results">
  58. <span>共 {{ projects().length }} 个项目</span>
  59. </div>
  60. </div>
  61. <!-- 项目列表 -->
  62. <div class="project-grid">
  63. <div *ngFor="let project of paginatedProjects()" class="project-card">
  64. <div class="card-header">
  65. <div class="card-title-section">
  66. <h3 class="project-name">{{ project.name }}</h3>
  67. <span class="project-id">#{{ project.id }}</span>
  68. </div>
  69. <div class="card-tags">
  70. <span class="project-tag">{{ project.tagDisplayText }}</span>
  71. <span *ngIf="project.isUrgent" class="urgent-tag">紧急</span>
  72. </div>
  73. </div>
  74. <div class="card-content">
  75. <!-- 客户信息 -->
  76. <div class="info-item">
  77. <span class="info-label">客户</span>
  78. <span class="info-value">{{ project.customerName }}</span>
  79. </div>
  80. <!-- 设计师信息 -->
  81. <div class="info-item">
  82. <span class="info-label">设计师</span>
  83. <span class="info-value">{{ project.assigneeName }}</span>
  84. </div>
  85. <!-- 项目状态 -->
  86. <div class="info-item">
  87. <span class="info-label">状态</span>
  88. <span class="info-value status-badge" [class]="getStatusClass(project.status)">
  89. {{ project.status }}
  90. </span>
  91. </div>
  92. <!-- 当前阶段 -->
  93. <div class="info-item">
  94. <span class="info-label">阶段</span>
  95. <span class="info-value stage-badge" [class]="getStageClass(project.currentStage)">
  96. {{ project.currentStage }}
  97. </span>
  98. </div>
  99. <!-- 项目进度 -->
  100. <div class="progress-section">
  101. <div class="progress-header">
  102. <span class="progress-label">进度</span>
  103. <span class="progress-percentage">{{ project.progress }}%</span>
  104. </div>
  105. <div class="progress-bar">
  106. <div
  107. class="progress-fill"
  108. [style.width.percent]="project.progress"
  109. [style.backgroundColor]="project.status === '进行中' ? '#1976d2' : '#757575'"
  110. ></div>
  111. </div>
  112. </div>
  113. <!-- 时间信息 -->
  114. <div class="timeline-info">
  115. <div class="time-item">
  116. <span class="time-label">创建时间</span>
  117. <span class="time-value">{{ formatDate(project.createdAt) }}</span>
  118. </div>
  119. <div class="time-item">
  120. <span class="time-label">截止日期</span>
  121. <span
  122. class="time-value deadline"
  123. [class.overdue]="project.daysUntilDeadline < 0"
  124. [class.urgent]="project.isUrgent"
  125. >
  126. {{ formatDate(project.deadline) }} ({{ project.daysUntilDeadline >= 0 ? '还有' + project.daysUntilDeadline + '天' : '已逾期' + getAbsValue(project.daysUntilDeadline) + '天' }})
  127. </span>
  128. </div>
  129. </div>
  130. <!-- 高优先级需求 -->
  131. <div *ngIf="project.highPriorityNeeds && project.highPriorityNeeds.length > 0" class="needs-section">
  132. <span class="needs-label">高优先级需求:</span>
  133. <ul class="needs-list">
  134. <li *ngFor="let need of project.highPriorityNeeds">
  135. <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  136. <circle cx="12" cy="12" r="10"></circle>
  137. <line x1="12" y1="8" x2="12" y2="12"></line>
  138. <line x1="12" y1="16" x2="12.01" y2="16"></line>
  139. </svg>
  140. {{ need }}
  141. </li>
  142. </ul>
  143. </div>
  144. </div>
  145. <div class="card-footer">
  146. <button class="secondary-btn card-action">
  147. <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  148. <path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"></path>
  149. </svg>
  150. <span>联系</span>
  151. </button>
  152. <a [routerLink]="['/designer/project-detail', project.id]" class="primary-btn card-action">
  153. <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  154. <path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"></path>
  155. </svg>
  156. <span>查看详情</span>
  157. </a>
  158. </div>
  159. </div>
  160. </div>
  161. <!-- 分页控件 -->
  162. <div class="pagination" *ngIf="totalPages() > 1">
  163. <button
  164. class="pagination-btn"
  165. (click)="prevPage()"
  166. [disabled]="currentPage() === 1"
  167. >
  168. <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  169. <line x1="15" y1="18" x2="9" y2="12"></line>
  170. <line x1="9" y1="18" x2="15" y2="12"></line>
  171. </svg>
  172. </button>
  173. <button
  174. *ngFor="let page of pageNumbers()"
  175. class="pagination-btn"
  176. [class.active]="page === currentPage()"
  177. (click)="goToPage(page)"
  178. >
  179. {{ page }}
  180. </button>
  181. <!-- 省略号 -->
  182. <span *ngIf="totalPages() > 5" class="pagination-ellipsis">...</span>
  183. <button
  184. *ngIf="totalPages() > 5"
  185. class="pagination-btn"
  186. (click)="goToPage(totalPages())"
  187. >
  188. {{ totalPages() }}
  189. </button>
  190. <button
  191. class="pagination-btn"
  192. (click)="nextPage()"
  193. [disabled]="currentPage() === totalPages()"
  194. >
  195. <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor">
  196. <line x1="9" y1="18" x2="15" y2="12"></line>
  197. <line x1="15" y1="6" x2="9" y2="12"></line>
  198. </svg>
  199. </button>
  200. </div>
  201. </div>
  202. </div>