Browse Source

add myplan

19318600686 3 months ago
parent
commit
3dd6411f30
29 changed files with 21 additions and 17 deletions
  1. BIN
      huinongbao-app/.angular/cache/18.2.12/angular-webpack/e611e13a4c62056a819b62c38232a39d4771d3a7/0.pack
  2. BIN
      huinongbao-app/.angular/cache/18.2.12/angular-webpack/e611e13a4c62056a819b62c38232a39d4771d3a7/2.pack
  3. BIN
      huinongbao-app/.angular/cache/18.2.12/angular-webpack/e611e13a4c62056a819b62c38232a39d4771d3a7/4.pack
  4. BIN
      huinongbao-app/.angular/cache/18.2.12/angular-webpack/e611e13a4c62056a819b62c38232a39d4771d3a7/5.pack
  5. BIN
      huinongbao-app/.angular/cache/18.2.12/angular-webpack/e611e13a4c62056a819b62c38232a39d4771d3a7/6.pack
  6. BIN
      huinongbao-app/.angular/cache/18.2.12/angular-webpack/e611e13a4c62056a819b62c38232a39d4771d3a7/7.pack
  7. BIN
      huinongbao-app/.angular/cache/18.2.12/angular-webpack/e611e13a4c62056a819b62c38232a39d4771d3a7/8.pack
  8. BIN
      huinongbao-app/.angular/cache/18.2.12/angular-webpack/e611e13a4c62056a819b62c38232a39d4771d3a7/9.pack
  9. BIN
      huinongbao-app/.angular/cache/18.2.12/angular-webpack/e611e13a4c62056a819b62c38232a39d4771d3a7/index.pack
  10. BIN
      huinongbao-app/.angular/cache/18.2.12/angular-webpack/e611e13a4c62056a819b62c38232a39d4771d3a7/index.pack.old
  11. 0 0
      huinongbao-app/.angular/cache/18.2.12/babel-webpack/119593701da365321794ebba58a81e19a1994c180482c6344eb63267af2b9d87.json
  12. 0 0
      huinongbao-app/.angular/cache/18.2.12/babel-webpack/1a60aeb32a9e924a8425d3196d3eab6cb1db80819ad70d212ed6c9c580b42aa2.json
  13. 0 0
      huinongbao-app/.angular/cache/18.2.12/babel-webpack/2039cab312f387e561698684dd4cf31721019a9d2bd6f5865189142ce761f619.json
  14. 0 0
      huinongbao-app/.angular/cache/18.2.12/babel-webpack/2c0f193c7e1aa5b7007ae17dd1bf5a90386593b5d42e4495301d005c56ee0273.json
  15. 0 0
      huinongbao-app/.angular/cache/18.2.12/babel-webpack/305f37cc6f4495501232795bc5664485637ad540ce1751469d91f9fa4a4e63f2.json
  16. 0 0
      huinongbao-app/.angular/cache/18.2.12/babel-webpack/44776771d813185bc8af4837ec3b73e817c367b30e6f2488672ea377cf9bde8e.json
  17. 0 0
      huinongbao-app/.angular/cache/18.2.12/babel-webpack/5ad25f825b055f1f56cd8825bbadc318e09f527c5886528aff76b2717aad6389.json
  18. 0 0
      huinongbao-app/.angular/cache/18.2.12/babel-webpack/5b03c4b763a8d27a5ab92dcd3dc6d122359fce5c7b374a2314293e4296025f6f.json
  19. 0 0
      huinongbao-app/.angular/cache/18.2.12/babel-webpack/61db8eaf7c49e2667fbf9832468d6015f8d71ad9e54df611f39cc6e8d97caaf8.json
  20. 0 0
      huinongbao-app/.angular/cache/18.2.12/babel-webpack/69e5856331952d07784bb1d059bde2a6b1ae5ca539f3d3288bf1cb58c6b42415.json
  21. 0 0
      huinongbao-app/.angular/cache/18.2.12/babel-webpack/7f7ed8a1acedfc9aac14ab79f3658cc4073f8c6d0f8e5e6468fa482d721fd964.json
  22. 0 0
      huinongbao-app/.angular/cache/18.2.12/babel-webpack/9051e15845fb5807168fa61e679c1188ab04100c0407dca72f2a246330121546.json
  23. 0 0
      huinongbao-app/.angular/cache/18.2.12/babel-webpack/a8b37fa17fae646102c96c09a3490c47f824f21d6aa11485b0923cca875c46d1.json
  24. 0 0
      huinongbao-app/.angular/cache/18.2.12/babel-webpack/b7714ceba65632021bb96441f1189d9ab2787f6466f3c7ff7f3961dddddde770.json
  25. 0 0
      huinongbao-app/.angular/cache/18.2.12/babel-webpack/b7be093ca4ddecede7ec5c1ef8116e95a7dbb2aaabaf8209bc36a2c88eb5521c.json
  26. 0 0
      huinongbao-app/.angular/cache/18.2.12/babel-webpack/c14f0ede85a48cc82e4527a1601e28a58b59e93cb544c97839cc97d6cf1a5e86.json
  27. 9 8
      huinongbao-app/src/app/my-plan/my-plan.component.html
  28. 10 7
      huinongbao-app/src/app/my-plan/my-plan.component.ts
  29. 2 2
      huinongbao-app/src/app/plan-create/plan-create.component.ts

BIN
huinongbao-app/.angular/cache/18.2.12/angular-webpack/e611e13a4c62056a819b62c38232a39d4771d3a7/0.pack


BIN
huinongbao-app/.angular/cache/18.2.12/angular-webpack/e611e13a4c62056a819b62c38232a39d4771d3a7/2.pack


BIN
huinongbao-app/.angular/cache/18.2.12/angular-webpack/e611e13a4c62056a819b62c38232a39d4771d3a7/4.pack


BIN
huinongbao-app/.angular/cache/18.2.12/angular-webpack/e611e13a4c62056a819b62c38232a39d4771d3a7/5.pack


BIN
huinongbao-app/.angular/cache/18.2.12/angular-webpack/e611e13a4c62056a819b62c38232a39d4771d3a7/6.pack


BIN
huinongbao-app/.angular/cache/18.2.12/angular-webpack/e611e13a4c62056a819b62c38232a39d4771d3a7/7.pack


BIN
huinongbao-app/.angular/cache/18.2.12/angular-webpack/e611e13a4c62056a819b62c38232a39d4771d3a7/8.pack


BIN
huinongbao-app/.angular/cache/18.2.12/angular-webpack/e611e13a4c62056a819b62c38232a39d4771d3a7/9.pack


BIN
huinongbao-app/.angular/cache/18.2.12/angular-webpack/e611e13a4c62056a819b62c38232a39d4771d3a7/index.pack


BIN
huinongbao-app/.angular/cache/18.2.12/angular-webpack/e611e13a4c62056a819b62c38232a39d4771d3a7/index.pack.old


File diff suppressed because it is too large
+ 0 - 0
huinongbao-app/.angular/cache/18.2.12/babel-webpack/119593701da365321794ebba58a81e19a1994c180482c6344eb63267af2b9d87.json


File diff suppressed because it is too large
+ 0 - 0
huinongbao-app/.angular/cache/18.2.12/babel-webpack/1a60aeb32a9e924a8425d3196d3eab6cb1db80819ad70d212ed6c9c580b42aa2.json


File diff suppressed because it is too large
+ 0 - 0
huinongbao-app/.angular/cache/18.2.12/babel-webpack/2039cab312f387e561698684dd4cf31721019a9d2bd6f5865189142ce761f619.json


File diff suppressed because it is too large
+ 0 - 0
huinongbao-app/.angular/cache/18.2.12/babel-webpack/2c0f193c7e1aa5b7007ae17dd1bf5a90386593b5d42e4495301d005c56ee0273.json


File diff suppressed because it is too large
+ 0 - 0
huinongbao-app/.angular/cache/18.2.12/babel-webpack/305f37cc6f4495501232795bc5664485637ad540ce1751469d91f9fa4a4e63f2.json


File diff suppressed because it is too large
+ 0 - 0
huinongbao-app/.angular/cache/18.2.12/babel-webpack/44776771d813185bc8af4837ec3b73e817c367b30e6f2488672ea377cf9bde8e.json


File diff suppressed because it is too large
+ 0 - 0
huinongbao-app/.angular/cache/18.2.12/babel-webpack/5ad25f825b055f1f56cd8825bbadc318e09f527c5886528aff76b2717aad6389.json


File diff suppressed because it is too large
+ 0 - 0
huinongbao-app/.angular/cache/18.2.12/babel-webpack/5b03c4b763a8d27a5ab92dcd3dc6d122359fce5c7b374a2314293e4296025f6f.json


File diff suppressed because it is too large
+ 0 - 0
huinongbao-app/.angular/cache/18.2.12/babel-webpack/61db8eaf7c49e2667fbf9832468d6015f8d71ad9e54df611f39cc6e8d97caaf8.json


File diff suppressed because it is too large
+ 0 - 0
huinongbao-app/.angular/cache/18.2.12/babel-webpack/69e5856331952d07784bb1d059bde2a6b1ae5ca539f3d3288bf1cb58c6b42415.json


File diff suppressed because it is too large
+ 0 - 0
huinongbao-app/.angular/cache/18.2.12/babel-webpack/7f7ed8a1acedfc9aac14ab79f3658cc4073f8c6d0f8e5e6468fa482d721fd964.json


File diff suppressed because it is too large
+ 0 - 0
huinongbao-app/.angular/cache/18.2.12/babel-webpack/9051e15845fb5807168fa61e679c1188ab04100c0407dca72f2a246330121546.json


File diff suppressed because it is too large
+ 0 - 0
huinongbao-app/.angular/cache/18.2.12/babel-webpack/a8b37fa17fae646102c96c09a3490c47f824f21d6aa11485b0923cca875c46d1.json


File diff suppressed because it is too large
+ 0 - 0
huinongbao-app/.angular/cache/18.2.12/babel-webpack/b7714ceba65632021bb96441f1189d9ab2787f6466f3c7ff7f3961dddddde770.json


File diff suppressed because it is too large
+ 0 - 0
huinongbao-app/.angular/cache/18.2.12/babel-webpack/b7be093ca4ddecede7ec5c1ef8116e95a7dbb2aaabaf8209bc36a2c88eb5521c.json


File diff suppressed because it is too large
+ 0 - 0
huinongbao-app/.angular/cache/18.2.12/babel-webpack/c14f0ede85a48cc82e4527a1601e28a58b59e93cb544c97839cc97d6cf1a5e86.json


+ 9 - 8
huinongbao-app/src/app/my-plan/my-plan.component.html

@@ -5,21 +5,22 @@
 </ion-header>
 
 <ion-content>
-  <ion-card *ngIf="plan">
+  <ion-card *ngFor="let plan of planList"> <!-- 使用 *ngFor 循环展示所有策划 -->
     <ion-card-header>
-      <ion-card-title>{{ plan.brandName }}</ion-card-title>
-      <ion-card-subtitle>{{ plan.brandType }}</ion-card-subtitle>
+      <ion-card-title>{{ plan.get('brandName') }}</ion-card-title>
+      <ion-card-subtitle>{{ plan.get('brandType') }}</ion-card-subtitle>
     </ion-card-header>
     <ion-card-content>
-      <p><strong>目标市场:</strong> {{ plan.targetMarket }}</p>
-      <p><strong>竞争对手信息:</strong> {{ plan.competitorsInfo }}</p>
-      <p><strong>用户提示:</strong> {{ plan.userPrompt }}</p>
+      <p><strong>目标市场:</strong> {{ plan.get('targetMarket') }}</p>
+      <p><strong>竞争对手信息:</strong> {{ plan.get('competitorsInfo') }}</p>
+      <p><strong>用户提示:</strong> {{ plan.get('userPrompt') }}</p>
       <p><strong>策划内容:</strong></p>
-      <p>{{ plan.reportContent }}</p>
+      <p>{{ plan.get('reportContent') }}</p>
+      <fm-markdown-preview class="content-style" [content]="plan.get('reportContent')"></fm-markdown-preview>
     </ion-card-content>
   </ion-card>
 
-  <ion-button *ngIf="!plan" expand="full" color="medium" (click)="loadPlan()">
+  <ion-button *ngIf="planList.length === 0" expand="full" color="medium" (click)="loadPlan()">
     加载策划内容
   </ion-button>
 </ion-content>

+ 10 - 7
huinongbao-app/src/app/my-plan/my-plan.component.ts

@@ -1,28 +1,31 @@
 import { Component, OnInit } from '@angular/core';
 import { IonButton, IonCard, IonCardContent, IonCardHeader, IonCardSubtitle, IonCardTitle, IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/angular/standalone';
-import { CloudQuery } from 'src/lib/ncloud.';
-
+import { CloudObject, CloudQuery } from 'src/lib/ncloud.';
+import { CommonModule } from '@angular/common'; // 导入 CommonModule
+import { MarkdownPreviewModule } from 'fmode-ng';
 @Component({
   selector: 'my-plan',
   templateUrl: './my-plan.component.html',
   styleUrls: ['./my-plan.component.scss'],
   standalone: true,
-  imports: [IonButton,IonCardContent,IonCardSubtitle,IonCardTitle,IonCardHeader,IonCard,IonContent,IonTitle,IonToolbar,IonHeader],
+  imports: [IonButton,IonCardContent,IonCardSubtitle,IonCardTitle,IonCardHeader,IonCard,IonContent,IonTitle,IonToolbar,IonHeader, CommonModule,MarkdownPreviewModule ],
 })
 export class MyPlanComponent implements OnInit {
   plan: any = null;
-
+  planList:Array<CloudObject> = []
   constructor() {}
 
   ngOnInit() {
     this.loadPlan();
+
   }
 
   async loadPlan() {
-    const query = new CloudQuery('UserResponse');
+    const query = new CloudQuery('Report'); // 假设 Report 表存储策划信息
     try {
-      const result = await query.first();
-      this.plan = result;
+      const results = await query.find(); // 使用 find 方法获取所有记录
+      console.log('加载的策划内容:', results);
+      this.planList = results; // 将结果存储到 planList 数组中
     } catch (error) {
       console.error('加载策划内容失败:', error);
     }

+ 2 - 2
huinongbao-app/src/app/plan-create/plan-create.component.ts

@@ -83,7 +83,7 @@ export class PlanCreateComponent implements OnInit {
         this.isComplete = true;
 
         // 创建 UserResponse 对象并保存策划内容
-        const userResponse = new CloudObject("UserResponse"); // 假设 UserResponse 表的名称为 "UserResponse"
+        const userResponse = new CloudObject("Report"); // 假设 UserResponse 表的名称为 "UserResponse"
         userResponse.set({
           reportContent: this.responseMsg, // 将生成的内容赋值给 reportContent
           userName: this.name, // 可选,存储用户名
@@ -92,7 +92,7 @@ export class PlanCreateComponent implements OnInit {
 
         try {
           await userResponse.save(); // 保存到数据库
-          console.log("策划内容已保存到 UserResponse 表中");
+          console.log("策划内容已保存到 Report 表中");
         } catch (error) {
           console.error("保存失败:", error);
         }

Some files were not shown because too many files changed in this diff