Browse Source

fix: namedchunk & contact page

ryanemax 1 day ago
parent
commit
97a5a93e21

+ 1 - 0
angular.json

@@ -77,6 +77,7 @@
                 }
               ],
               "outputHashing": "all",
+              "namedChunks": true,
               "optimization": {
                 "fonts": {
                   "inline": false

+ 7 - 7
docs/implementation-summary-wxwork-project.md

@@ -44,7 +44,7 @@
 - ✅ Skeleton加载动画
 
 ### 4. ✅ 实现客户画像组件
-**文件位置**: `/home/ryan/workspace/nova/yss-project/src/modules/project/pages/customer-profile/`
+**文件位置**: `/home/ryan/workspace/nova/yss-project/src/modules/project/pages/contact/`
 
 **核心功能**:
 - ✅ 客户基础信息展示 (头像/姓名/来源/标签)
@@ -200,10 +200,10 @@ yss-project/
 │               │   ├── project-loader.component.html
 │               │   └── project-loader.component.scss
 │               │
-│               ├── customer-profile/            # 客户画像页
-│               │   ├── customer-profile.component.ts
-│               │   ├── customer-profile.component.html
-│               │   └── customer-profile.component.scss
+│               ├── contact/            # 客户画像页
+│               │   ├── contact.component.ts
+│               │   ├── contact.component.html
+│               │   └── contact.component.scss
 │               │
 │               └── project-detail/              # 项目详情页
 │                   ├── project-detail.component.ts
@@ -344,7 +344,7 @@ this.isTeamLeader = role === '组长';
 
     // 客户画像页
     {
-      path: 'customer-profile/:contactId',
+      path: 'contact/:contactId',
       component: CustomerProfileComponent,
       title: '客户画像'
     },
@@ -367,7 +367,7 @@ this.isTeamLeader = role === '组长';
 
 **访问示例**:
 - 项目加载: `/wxwork/cDL6R1hgSi/project-loader`
-- 客户画像: `/wxwork/cDL6R1hgSi/customer-profile/abc123`
+- 客户画像: `/wxwork/cDL6R1hgSi/contact/abc123`
 - 订单分配: `/wxwork/cDL6R1hgSi/project/xyz789/order`
 - 确认需求: `/wxwork/cDL6R1hgSi/project/xyz789/requirements`
 - 交付执行: `/wxwork/cDL6R1hgSi/project/xyz789/delivery`

+ 3 - 3
docs/prd/wxwork-project-management.md

@@ -82,9 +82,9 @@ src/modules/project/
 │   ├── project-loader/              # 项目预加载页面
 │   │   ├── project-loader.component.ts
 │   │   └── project-loader.component.html
-│   ├── customer-profile/            # 客户画像页面
-│   │   ├── customer-profile.component.ts
-│   │   └── customer-profile.component.html
+│   ├── contact/            # 客户画像页面
+│   │   ├── contact.component.ts
+│   │   └── contact.component.html
 │   └── project-detail/              # 项目详情页面
 │       ├── project-detail.component.ts
 │       ├── project-detail.component.html

+ 6 - 6
docs/project-loader-fix-summary.md

@@ -68,7 +68,7 @@ if (this.currentChat?.type === "chatId" && this.currentChat?.group) {
 await this.router.navigate(['/wxwork', this.cid, 'customer', this.contact!.id]);
 
 // 正确
-await this.router.navigate(['/wxwork', this.cid, 'customer-profile', this.contact!.id]);
+await this.router.navigate(['/wxwork', this.cid, 'contact', this.contact!.id]);
 ```
 
 ❌ **错误处理不够详细**
@@ -228,7 +228,7 @@ async handleContactScene() {
   });
 
   // 跳转客户画像页面
-  await this.router.navigate(['/wxwork', this.cid, 'customer-profile', this.contact!.id], {
+  await this.router.navigate(['/wxwork', this.cid, 'contact', this.contact!.id], {
     queryParams: {
       profileId: this.currentUser!.id
     }
@@ -238,14 +238,14 @@ async handleContactScene() {
 
 **变化:**
 - ❌ `/wxwork/:cid/customer/:contactId`
-- ✅ `/wxwork/:cid/customer-profile/:contactId`
+- ✅ `/wxwork/:cid/contact/:contactId`
 
 **匹配路由配置:**
 ```typescript
 // app.routes.ts
 {
-  path: 'customer-profile/:contactId',
-  loadComponent: () => import('../modules/project/pages/customer-profile/customer-profile.component')
+  path: 'contact/:contactId',
+  loadComponent: () => import('../modules/project/pages/contact/contact.component')
     .then(m => m.CustomerProfileComponent),
   title: '客户画像'
 }
@@ -394,7 +394,7 @@ chunk-NWSP7TJL.js | project-loader-component | 9.16 MB   | 1.86 MB
 
 **联系人 → 客户画像:**
 ```
-/wxwork/cDL6R1hgSi/customer-profile/CONTACT_ID?profileId=USER_ID
+/wxwork/cDL6R1hgSi/contact/CONTACT_ID?profileId=USER_ID
 ```
 
 ---

+ 1 - 1
docs/route-lazy-loading-summary.md

@@ -110,7 +110,7 @@ dist/yss-project/browser/
 
 **受保护的路由:**
 - `/wxwork/:cid/project-loader` - 项目加载页
-- `/wxwork/:cid/customer-profile/:contactId` - 客户画像
+- `/wxwork/:cid/contact/:contactId` - 客户画像
 - `/wxwork/:cid/project/:projectId/*` - 项目详情及4个阶段子页面
   - `order` - 订单分配
   - `requirements` - 确认需求

+ 214 - 0
npminstall-debug.log

@@ -0,0 +1,214 @@
+{
+  root: '/home/ryan/workspace/nova/yss-project',
+  registry: 'https://registry.npmmirror.com',
+  pkgs: [
+    {
+      name: 'fmode-ng',
+      version: '0.0.216',
+      type: 'version',
+      alias: undefined,
+      arg: [Result]
+    }
+  ],
+  production: false,
+  cacheStrict: false,
+  cacheDir: '/home/ryan/.npminstall_tarball',
+  env: {
+    npm_config_registry: 'https://registry.npmmirror.com',
+    npm_config_argv: '{"remain":[],"cooked":["--fix-bug-versions","--china","--userconfig=/home/ryan/.cnpmrc","--disturl=https://cdn.npmmirror.com/binaries/node","--registry=https://registry.npmmirror.com","fmode-ng@0.0.216"],"original":["--fix-bug-versions","--china","--userconfig=/home/ryan/.cnpmrc","--disturl=https://cdn.npmmirror.com/binaries/node","--registry=https://registry.npmmirror.com","fmode-ng@0.0.216"]}',
+    npm_config_user_agent: 'npminstall/7.12.0 npm/? node/v20.19.4 linux x64',
+    npm_config_cache: '/home/ryan/.npminstall_tarball',
+    NODE: '/usr/local/bin/node',
+    npm_node_execpath: '/usr/local/bin/node',
+    npm_execpath: '/usr/local/lib/node_modules/cnpm/node_modules/npminstall/bin/install.js',
+    npm_config_userconfig: '/home/ryan/.cnpmrc',
+    npm_config_disturl: 'https://cdn.npmmirror.com/binaries/node',
+    npm_config_r: 'https://registry.npmmirror.com',
+    COREPACK_NPM_REGISTRY: 'https://registry.npmmirror.com',
+    EDGEDRIVER_CDNURL: 'https://npmmirror.com/mirrors/edgedriver',
+    NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
+    NVM_NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
+    PHANTOMJS_CDNURL: 'https://cdn.npmmirror.com/binaries/phantomjs',
+    CHROMEDRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/chromedriver',
+    OPERADRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/operadriver',
+    CYPRESS_DOWNLOAD_PATH_TEMPLATE: 'https://cdn.npmmirror.com/binaries/cypress/${version}/${platform}-${arch}/cypress.zip',
+    ELECTRON_MIRROR: 'https://cdn.npmmirror.com/binaries/electron/',
+    ELECTRON_BUILDER_BINARIES_MIRROR: 'https://cdn.npmmirror.com/binaries/electron-builder-binaries/',
+    SASS_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-sass',
+    SWC_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-swc',
+    NWJS_URLBASE: 'https://cdn.npmmirror.com/binaries/nwjs/v',
+    PUPPETEER_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
+    PUPPETEER_DOWNLOAD_BASE_URL: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
+    PUPPETEER_CHROME_DOWNLOAD_BASE_URL: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
+    PUPPETEER_CHROME_HEADLESS_SHELL_DOWNLOAD_BASE_URL: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
+    PLAYWRIGHT_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/playwright',
+    SENTRYCLI_CDNURL: 'https://cdn.npmmirror.com/binaries/sentry-cli',
+    SAUCECTL_INSTALL_BINARY_MIRROR: 'https://cdn.npmmirror.com/binaries/saucectl',
+    RE2_DOWNLOAD_MIRROR: 'https://cdn.npmmirror.com/binaries/node-re2',
+    RE2_DOWNLOAD_SKIP_PATH: 'true',
+    PRISMA_ENGINES_MIRROR: 'https://cdn.npmmirror.com/binaries/prisma',
+    npm_config_better_sqlite3_binary_host: 'https://cdn.npmmirror.com/binaries/better-sqlite3',
+    npm_config_keytar_binary_host: 'https://cdn.npmmirror.com/binaries/keytar',
+    npm_config_sharp_binary_host: 'https://cdn.npmmirror.com/binaries/sharp',
+    npm_config_sharp_libvips_binary_host: 'https://cdn.npmmirror.com/binaries/sharp-libvips',
+    npm_config_robotjs_binary_host: 'https://cdn.npmmirror.com/binaries/robotjs',
+    npm_config_gl_binary_host: 'https://cdn.npmmirror.com/binaries/gl',
+    npm_rootpath: '/home/ryan/workspace/nova/yss-project',
+    INIT_CWD: '/home/ryan/workspace/nova/yss-project'
+  },
+  binaryMirrors: {
+    ENVS: {
+      COREPACK_NPM_REGISTRY: 'https://registry.npmmirror.com',
+      EDGEDRIVER_CDNURL: 'https://npmmirror.com/mirrors/edgedriver',
+      NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
+      NVM_NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
+      PHANTOMJS_CDNURL: 'https://cdn.npmmirror.com/binaries/phantomjs',
+      CHROMEDRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/chromedriver',
+      OPERADRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/operadriver',
+      CYPRESS_DOWNLOAD_PATH_TEMPLATE: 'https://cdn.npmmirror.com/binaries/cypress/${version}/${platform}-${arch}/cypress.zip',
+      ELECTRON_MIRROR: 'https://cdn.npmmirror.com/binaries/electron/',
+      ELECTRON_BUILDER_BINARIES_MIRROR: 'https://cdn.npmmirror.com/binaries/electron-builder-binaries/',
+      SASS_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-sass',
+      SWC_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-swc',
+      NWJS_URLBASE: 'https://cdn.npmmirror.com/binaries/nwjs/v',
+      PUPPETEER_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
+      PUPPETEER_DOWNLOAD_BASE_URL: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
+      PUPPETEER_CHROME_DOWNLOAD_BASE_URL: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
+      PUPPETEER_CHROME_HEADLESS_SHELL_DOWNLOAD_BASE_URL: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
+      PLAYWRIGHT_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/playwright',
+      SENTRYCLI_CDNURL: 'https://cdn.npmmirror.com/binaries/sentry-cli',
+      SAUCECTL_INSTALL_BINARY_MIRROR: 'https://cdn.npmmirror.com/binaries/saucectl',
+      RE2_DOWNLOAD_MIRROR: 'https://cdn.npmmirror.com/binaries/node-re2',
+      RE2_DOWNLOAD_SKIP_PATH: 'true',
+      PRISMA_ENGINES_MIRROR: 'https://cdn.npmmirror.com/binaries/prisma',
+      npm_config_better_sqlite3_binary_host: 'https://cdn.npmmirror.com/binaries/better-sqlite3',
+      npm_config_keytar_binary_host: 'https://cdn.npmmirror.com/binaries/keytar',
+      npm_config_sharp_binary_host: 'https://cdn.npmmirror.com/binaries/sharp',
+      npm_config_sharp_libvips_binary_host: 'https://cdn.npmmirror.com/binaries/sharp-libvips',
+      npm_config_robotjs_binary_host: 'https://cdn.npmmirror.com/binaries/robotjs',
+      npm_config_gl_binary_host: 'https://cdn.npmmirror.com/binaries/gl'
+    },
+    '@ali/s2': { host: 'https://cdn.npmmirror.com/binaries/looksgood-s2' },
+    sharp: { replaceHostFiles: [Array], replaceHostMap: [Object] },
+    '@tensorflow/tfjs-node': {
+      replaceHostFiles: [Array],
+      replaceHostRegExpMap: [Object],
+      replaceHostMap: [Object]
+    },
+    cypress: {
+      host: 'https://cdn.npmmirror.com/binaries/cypress',
+      newPlatforms: [Object]
+    },
+    'utf-8-validate': {
+      host: 'https://cdn.npmmirror.com/binaries/utf-8-validate/v{version}'
+    },
+    xprofiler: {
+      remote_path: './xprofiler/v{version}/',
+      host: 'https://cdn.npmmirror.com/binaries'
+    },
+    leveldown: { host: 'https://cdn.npmmirror.com/binaries/leveldown/v{version}' },
+    couchbase: { host: 'https://cdn.npmmirror.com/binaries/couchbase/v{version}' },
+    gl: { host: 'https://cdn.npmmirror.com/binaries/gl/v{version}' },
+    sqlite3: {
+      host: 'https://cdn.npmmirror.com/binaries/sqlite3',
+      remote_path: 'v{version}'
+    },
+    '@journeyapps/sqlcipher': { host: 'https://cdn.npmmirror.com/binaries' },
+    grpc: {
+      host: 'https://cdn.npmmirror.com/binaries',
+      remote_path: '{name}/v{version}'
+    },
+    'grpc-tools': { host: 'https://cdn.npmmirror.com/binaries' },
+    wrtc: {
+      host: 'https://cdn.npmmirror.com/binaries',
+      remote_path: '{name}/v{version}'
+    },
+    fsevents: { host: 'https://cdn.npmmirror.com/binaries/fsevents' },
+    nodejieba: { host: 'https://cdn.npmmirror.com/binaries/nodejieba' },
+    canvas: {
+      host: 'https://cdn.npmmirror.com/binaries/canvas',
+      remote_path: 'v{version}'
+    },
+    'skia-canvas': { host: 'https://cdn.npmmirror.com/binaries/skia-canvas' },
+    'flow-bin': {
+      replaceHost: 'https://github.com/facebook/flow/releases/download/v',
+      host: 'https://cdn.npmmirror.com/binaries/flow/v'
+    },
+    'jpegtran-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/jpegtran-bin'
+    },
+    'cwebp-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/cwebp-bin'
+    },
+    'zopflipng-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/zopflipng-bin'
+    },
+    'optipng-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/optipng-bin'
+    },
+    mozjpeg: {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/mozjpeg-bin'
+    },
+    gifsicle: {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/gifsicle-bin'
+    },
+    'pngquant-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/pngquant-bin',
+      replaceHostMap: [Object]
+    },
+    'pngcrush-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/pngcrush-bin'
+    },
+    'jpeg-recompress-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/jpeg-recompress-bin'
+    },
+    'advpng-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/advpng-bin'
+    },
+    'pngout-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/pngout-bin'
+    },
+    'jpegoptim-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/jpegoptim-bin'
+    },
+    argon2: { host: 'https://cdn.npmmirror.com/binaries/argon2' },
+    'ali-zeromq': { host: 'https://cdn.npmmirror.com/binaries/ali-zeromq' },
+    'ali-usb_ctl': { host: 'https://cdn.npmmirror.com/binaries/ali-usb_ctl' },
+    'gdal-async': { host: 'https://cdn.npmmirror.com/binaries/node-gdal-async' },
+    'libpg-query': { host: 'https://cdn.npmmirror.com/binaries' }
+  },
+  forbiddenLicenses: null,
+  flatten: false,
+  proxy: undefined,
+  prune: false,
+  disableFallbackStore: false,
+  workspacesMap: Map(0) {},
+  enableWorkspace: false,
+  workspaceRoot: '/home/ryan/workspace/nova/yss-project',
+  isWorkspaceRoot: true,
+  isWorkspacePackage: false,
+  offline: false,
+  strictSSL: true,
+  ignoreScripts: false,
+  foregroundScripts: false,
+  ignoreOptionalDependencies: false,
+  detail: false,
+  forceLinkLatest: false,
+  trace: false,
+  engineStrict: false,
+  registryOnly: false,
+  client: false,
+  autoFixVersion: [Function: autoFixVersion]
+}

+ 1 - 1
package.json

@@ -67,7 +67,7 @@
     "echarts": "^6.0.0",
     "esdk-obs-browserjs": "^3.25.6",
     "eventemitter3": "^5.0.1",
-    "fmode-ng": "^0.0.215",
+    "fmode-ng": "^0.0.216",
     "highlight.js": "^11.11.1",
     "jquery": "^3.7.1",
     "markdown-it": "^14.1.0",

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

@@ -264,8 +264,8 @@ export const routes: Routes = [
 
       // 客户画像页
       {
-        path: 'customer-profile/:contactId',
-        loadComponent: () => import('../modules/project/pages/customer-profile/customer-profile.component').then(m => m.CustomerProfileComponent),
+        path: 'contact/:contactId',
+        loadComponent: () => import('../modules/project/pages/contact/contact.component').then(m => m.CustomerProfileComponent),
         title: '客户画像'
       },
 

+ 4 - 1
src/app/app.ts

@@ -16,7 +16,10 @@ export class App {
     private router:Router
     // private authServ:AuthService
   ){
-    console.log("router",this.router)
+    setInterval(() => {
+      console.log("router",this.router)
+      console.log(this.router)
+    }, 3000);
     this.initAuthServ();
   }
   initAuthServ(){

+ 0 - 7
src/index.html

@@ -11,13 +11,6 @@
     <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
     <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" />
     <!-- Local import map to resolve bare specifier 'echarts' to local ESM file -->
-    <script type="importmap">
-      {
-        "imports": {
-          "echarts": document.baseURI+"/assets/echarts/echarts.esm.js"
-        }
-      }
-    </script>
     <!-- Use local UMD build to provide window.echarts globally (avoid external CDN errors) -->
     <script defer src="assets/echarts/echarts.min.js"></script>
   </head>

+ 1 - 1
src/modules/project/pages/customer-profile/customer-profile.component.html → src/modules/project/pages/contact/contact.component.html

@@ -27,7 +27,7 @@
 
   <!-- 客户画像内容 -->
   @if (!loading && !error && contactInfo) {
-    <div class="customer-profile-container">
+    <div class="contact-container">
       <!-- 头部:头像 + 基础信息 -->
       <ion-card class="header-card">
         <ion-card-content>

+ 2 - 2
src/modules/project/pages/customer-profile/customer-profile.component.scss → src/modules/project/pages/contact/contact.component.scss

@@ -30,7 +30,7 @@
 }
 
 // 客户画像容器
-.customer-profile-container {
+.contact-container {
   max-width: 800px;
   margin: 0 auto;
   padding-bottom: 20px;
@@ -425,7 +425,7 @@ ion-badge {
 
 // 响应式适配
 @media (min-width: 768px) {
-  .customer-profile-container {
+  .contact-container {
     .preference-grid {
       grid-template-columns: repeat(2, 1fr);
     }

+ 3 - 3
src/modules/project/pages/customer-profile/customer-profile.component.ts → src/modules/project/pages/contact/contact.component.ts

@@ -21,11 +21,11 @@ const Parse = FmodeParse.with('nova');
  * 路由:/wxwork/:cid/customer/:contactId
  */
 @Component({
-  selector: 'app-customer-profile',
+  selector: 'app-contact',
   standalone: true,
   imports: [CommonModule, IonicModule],
-  templateUrl: './customer-profile.component.html',
-  styleUrls: ['./customer-profile.component.scss']
+  templateUrl: './contact.component.html',
+  styleUrls: ['./contact.component.scss']
 })
 export class CustomerProfileComponent implements OnInit {
   // 输入参数(支持组件复用)

+ 1 - 1
src/modules/project/pages/project-loader/project-loader.component.ts

@@ -244,7 +244,7 @@ export class ProjectLoaderComponent implements OnInit {
     });
 
     // 跳转客户画像页面
-    await this.router.navigate(['/wxwork', this.cid, 'customer-profile', this.contact!.id], {
+    await this.router.navigate(['/wxwork', this.cid, 'contact', this.contact!.id], {
       queryParams: {
         profileId: this.currentUser!.id
       }