Browse Source

feet:customer3

徐福静0235668 19 hours ago
parent
commit
bbd156e623

+ 1 - 104
src/app/app.html

@@ -1,112 +1,9 @@
 <div class="app-container">
-  <!-- 根据当前路由显示不同的导航 -->
-@if (isDesignerRoute) {
-  <!-- 设计师导航 -->
-  <app-designer-nav userName="设计师用户" [onlineHours]="4.8">
-    <router-outlet></router-outlet>
-  </app-designer-nav>
-} @else {
-  <!-- 客服导航 -->
-  <!-- 顶部导航栏 -->
-  <header class="top-navbar">
-    <div class="navbar-left">
-      <button class="menu-toggle" (click)="toggleSidebar()">
-        <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor">
-          <line x1="3" y1="12" x2="21" y2="12"></line>
-          <line x1="3" y1="6" x2="21" y2="6"></line>
-          <line x1="3" y1="18" x2="21" y2="18"></line>
-        </svg>
-      </button>
-      <h1 class="app-title">客服工作台</h1>
-    </div>
-    
-    <div class="navbar-center">
-      <div class="search-container">
-        <input 
-          type="text" 
-          [(ngModel)]="searchTerm"
-          placeholder="搜索客户、订单或项目..." 
-          class="search-input"
-        />
-        <button class="search-button">
-          <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor">
-            <circle cx="11" cy="11" r="8"></circle>
-            <path d="m21 21-4.35-4.35"></path>
-          </svg>
-        </button>
-      </div>
-    </div>
-    
-    <div class="navbar-right">
-      <button class="notification-btn">
-        <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor">
-          <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path>
-        </svg>
-        <span class="notification-badge">3</span>
-      </button>
-      <div class="user-profile">
-        <img src="https://picsum.photos/id/823/40/40" alt="用户头像" class="user-avatar">
-        <span class="user-name">客服小张</span>
-      </div>
-    </div>
-  </header>
-
   <!-- 主要内容区 -->
   <main class="main-content">
-    <!-- 左侧侧边栏 -->
-    <aside class="sidebar" [class.collapsed]="!sidebarOpen">
-      <nav class="sidebar-nav">
-        <a href="/customer-service/dashboard" class="nav-item" routerLinkActive="active">
-          <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor">
-            <path d="M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z"></path>
-          </svg>
-          <span>工作台</span>
-        </a>
-        <a href="/customer-service/consultation-order" class="nav-item" routerLinkActive="active">
-          <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor">
-            <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path>
-          </svg>
-          <span>客户咨询</span>
-        </a>
-        <a href="/customer-service/project-list" class="nav-item" routerLinkActive="active">
-          <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor">
-            <line x1="8" y1="6" x2="21" y2="6"></line>
-            <line x1="8" y1="12" x2="21" y2="12"></line>
-            <line x1="8" y1="18" x2="21" y2="18"></line>
-            <line x1="3" y1="6" x2="3.01" y2="6"></line>
-            <line x1="3" y1="12" x2="3.01" y2="12"></line>
-            <line x1="3" y1="18" x2="3.01" y2="18"></line>
-          </svg>
-          <span>项目列表</span>
-        </a>
-        <a href="/customer-service/case-library" class="nav-item" routerLinkActive="active">
-          <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor">
-            <path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path>
-            <path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path>
-          </svg>
-          <span>案例库</span>
-        </a>
-      </nav>
-      
-      <div class="sidebar-footer">
-        <div class="storage-info">
-          <span>在线时长: 4.5h</span>
-        </div>
-        <button class="logout-btn">
-          <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor">
-            <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
-            <polyline points="16 17 21 12 16 7"></polyline>
-            <line x1="21" y1="12" x2="9" y2="12"></line>
-          </svg>
-          <span>退出登录</span>
-        </button>
-      </div>
-    </aside>
-
     <!-- 中间内容区 -->
-    <div class="content-wrapper" [class.expanded]="!sidebarOpen">
+    <div class="content-wrapper">
       <router-outlet />
     </div>
   </main>
-}
 </div>

+ 1 - 1
src/app/app.routes.ts

@@ -106,4 +106,4 @@ export const routes: Routes = [
   // 默认路由重定向到客服工作台
   { path: '', redirectTo: '/customer-service/dashboard', pathMatch: 'full' },
   { path: '**', redirectTo: '/customer-service/dashboard' }
-];
+];

+ 4 - 32
src/app/app.ts

@@ -1,41 +1,13 @@
 import { Component, signal } from '@angular/core';
-import { OnInit } from '@angular/core';
-import { Router, RouterOutlet, RouterLinkActive } from '@angular/router';
-import { FormsModule } from '@angular/forms';
-import { DesignerNavComponent } from './shared/components/designer-nav/designer-nav';
+import { RouterOutlet } from '@angular/router';
 
 @Component({
   selector: 'app-root',
   standalone: true,
-  imports: [RouterOutlet, RouterLinkActive, FormsModule, DesignerNavComponent],
+  imports: [RouterOutlet],
   templateUrl: './app.html',
   styleUrl: './app.scss'
 })
-export class App implements OnInit {
+export class App {
   protected readonly title = signal('yss-project');
-  sidebarOpen = true;
-  searchTerm = '';
-  currentDate = new Date();
-  isDesignerRoute = false;
-
-  constructor(private router: Router) {}
-
-  ngOnInit() {
-    // 初始化时检查当前路由
-    this.checkIfDesignerRoute();
-    
-    // 监听路由变化
-    this.router.events.subscribe(() => {
-      this.checkIfDesignerRoute();
-    });
-  }
-
-  checkIfDesignerRoute() {
-    // 检查当前路径是否包含'designer'
-    this.isDesignerRoute = this.router.url.includes('designer');
-  }
-
-  toggleSidebar() {
-    this.sidebarOpen = !this.sidebarOpen;
-  }
-}
+}

+ 1 - 1
src/app/pages/customer-service/case-library/case-library.html

@@ -305,4 +305,4 @@
       </div>
     </div>
   </div>
-</div>
+</div>

+ 40 - 28
src/app/pages/customer-service/case-library/case-library.ts

@@ -237,35 +237,35 @@ export class CaseLibrary implements OnInit {
     });
   }
   // 智能页码生成
-  pageNumbers = computed(() => {
-    const pages = [];
-    const total = this.totalPages();
-    const current = this.currentPage();
-    
-    // 显示当前页及前后2页,加上第一页和最后一页
-    const start = Math.max(1, current - 2);
-    const end = Math.min(total, current + 2);
-    
-    if (start > 1) {
-      pages.push(1);
-      if (start > 2) {
-        pages.push(-1); // 用-1表示省略号
-      }
-    }
-    
-    for (let i = start; i <= end; i++) {
-      pages.push(i);
+pageNumbers = computed(() => {
+  const pages = [];
+  const total = this.totalPages();
+  const current = this.currentPage();
+  
+  // 显示当前页及前后2页,加上第一页和最后一页
+  const start = Math.max(1, current - 2);
+  const end = Math.min(total, current + 2);
+  
+  if (start > 1) {
+    pages.push(1);
+    if (start > 2) {
+      pages.push(-1); // 用-1表示省略号
     }
-    
-    if (end < total) {
-      if (end < total - 1) {
-        pages.push(-1); // 用-1表示省略号
-      }
-      pages.push(total);
+  }
+  
+  for (let i = start; i <= end; i++) {
+    pages.push(i);
+  }
+  
+  if (end < total) {
+    if (end < total - 1) {
+      pages.push(-1); // 用-1表示省略号
     }
-    
-    return pages;
-  });
+    pages.push(total);
+  }
+  
+  return pages;
+});
   // 格式化样式显示的辅助方法
   getStyleDisplay(caseItem: CaseItem | null | undefined): string {
     if (!caseItem || !caseItem.style) {
@@ -279,6 +279,18 @@ export class CaseLibrary implements OnInit {
     return this.getStyleDisplay(this.selectedCase());
   }
 
+  // 删除重复的简单分页逻辑
+  // 保留智能分页逻辑(第251-270行)
+  // 移除下面这段代码:
+  //  // 在组件类中添加这个计算属性
+  //  pageNumbers = computed(() => {
+  //    const pages = [];
+  //    for (let i = 1; i <= this.totalPages(); i++) {
+  //      pages.push(i);
+  //    }
+  //    return pages;
+  //  });
+  
   // 修复 onStyleChange 方法中的类型安全问题
   onStyleChange(style: string, isChecked: boolean): void {
     const currentStyles = (this.filterForm.get('style')?.value || []) as string[];
@@ -294,4 +306,4 @@ export class CaseLibrary implements OnInit {
     
     this.filterForm.patchValue({ style: updatedStyles });
   }
-}
+}

+ 1 - 1
src/app/pages/customer-service/consultation-order/consultation-order.ts

@@ -271,4 +271,4 @@ export class ConsultationOrder {
     console.log('创建项目群');
     alert('项目群已创建,并邀请了相应技术组长!');
   }
-}
+}

+ 1 - 1
src/app/pages/customer-service/dashboard/dashboard.ts

@@ -215,4 +215,4 @@ getUpdateStatus(update: Project | CustomerFeedback): string {
         return '';
     }
   }
-}
+}

+ 1 - 1
src/app/pages/customer-service/project-detail/project-detail.ts

@@ -452,4 +452,4 @@ export class ProjectDetail implements OnInit {
   progressFillWidth = computed(() => {
     return `${this.completionProgress()}%`;
   });
-}
+}

+ 1 - 1
src/app/pages/customer-service/project-list/project-list.ts

@@ -375,4 +375,4 @@ export class ProjectList implements OnInit {
     
     return stageClasses[stage] || '';
   }
-}
+}