|
@@ -1,7 +1,7 @@
|
|
import { CommonModule } from '@angular/common';
|
|
import { CommonModule } from '@angular/common';
|
|
import { Component, OnInit } from '@angular/core';
|
|
import { Component, OnInit } from '@angular/core';
|
|
import { Router } from '@angular/router';
|
|
import { Router } from '@angular/router';
|
|
-import { IonicModule, NavController, ModalController } from '@ionic/angular';
|
|
|
|
|
|
+import { NavController, ModalController, IonicModule } from '@ionic/angular';
|
|
import { addIcons } from 'ionicons';
|
|
import { addIcons } from 'ionicons';
|
|
import { arrowBackOutline, checkmarkCircleOutline, closeCircleOutline, radioButtonOffOutline, reload, reloadOutline } from 'ionicons/icons';
|
|
import { arrowBackOutline, checkmarkCircleOutline, closeCircleOutline, radioButtonOffOutline, reload, reloadOutline } from 'ionicons/icons';
|
|
import { FormsModule } from '@angular/forms';
|
|
import { FormsModule } from '@angular/forms';
|
|
@@ -12,13 +12,17 @@ import { TaskGeneratePrompt } from 'src/agent/tasks/generate/generate-prompt';
|
|
import { TaskGeneratePicture } from 'src/agent/tasks/generate/generate-picture';
|
|
import { TaskGeneratePicture } from 'src/agent/tasks/generate/generate-picture';
|
|
import { CloudQuery, CloudUser } from 'src/lib/ncloud';
|
|
import { CloudQuery, CloudUser } from 'src/lib/ncloud';
|
|
import { CustomHeaderComponent } from 'src/lib/component/custom-header/custom-header.component';
|
|
import { CustomHeaderComponent } from 'src/lib/component/custom-header/custom-header.component';
|
|
|
|
+import { IonButton, IonCard, IonContent, IonIcon, IonImg, IonText, IonTextarea } from '@ionic/angular/standalone';
|
|
addIcons({ 'arrow-back-outline': arrowBackOutline, radioButtonOffOutline, closeCircleOutline, checkmarkCircleOutline, reloadOutline });
|
|
addIcons({ 'arrow-back-outline': arrowBackOutline, radioButtonOffOutline, closeCircleOutline, checkmarkCircleOutline, reloadOutline });
|
|
@Component({
|
|
@Component({
|
|
selector: 'app-generate-option',
|
|
selector: 'app-generate-option',
|
|
templateUrl: './generate-option.component.html',
|
|
templateUrl: './generate-option.component.html',
|
|
styleUrls: ['./generate-option.component.scss'],
|
|
styleUrls: ['./generate-option.component.scss'],
|
|
standalone: true,
|
|
standalone: true,
|
|
- imports: [CustomHeaderComponent, IonicModule, CommonModule, FormsModule],
|
|
|
|
|
|
+ imports: [CustomHeaderComponent, CommonModule, FormsModule, IonButton, IonCard, IonIcon,
|
|
|
|
+ IonImg, IonText, IonTextarea, IonContent
|
|
|
|
+ ],
|
|
|
|
+ providers: [ModalController],
|
|
})
|
|
})
|
|
export class GenerateOptionComponent implements OnInit {
|
|
export class GenerateOptionComponent implements OnInit {
|
|
/**
|
|
/**
|
|
@@ -197,8 +201,8 @@ export class GenerateOptionComponent implements OnInit {
|
|
// 将选中的键对应的值设置为 true
|
|
// 将选中的键对应的值设置为 true
|
|
option[selectedKey] = true;
|
|
option[selectedKey] = true;
|
|
// 更新 userProfile 中的对应字段
|
|
// 更新 userProfile 中的对应字段
|
|
- this.userProfile[name as keyof UserProfile] = selectedKey;
|
|
|
|
- }else{
|
|
|
|
|
|
+ this.userProfile[name as keyof UserProfile] = selectedKey + ":" + this.description[selectedKey];
|
|
|
|
+ } else {
|
|
option[selectedKey] = false;
|
|
option[selectedKey] = false;
|
|
this.userProfile[name as keyof UserProfile] = '不限制';
|
|
this.userProfile[name as keyof UserProfile] = '不限制';
|
|
}
|
|
}
|
|
@@ -265,14 +269,14 @@ export class GenerateOptionComponent implements OnInit {
|
|
let query = new CloudQuery("GenerateResult");
|
|
let query = new CloudQuery("GenerateResult");
|
|
let user = new CloudUser();
|
|
let user = new CloudUser();
|
|
query.equalTo("UserID", user.id);
|
|
query.equalTo("UserID", user.id);
|
|
- let result:any = await query.find();
|
|
|
|
|
|
+ let result: any = await query.find();
|
|
//按照ruslt中的careatedAt字段(string)进行排序
|
|
//按照ruslt中的careatedAt字段(string)进行排序
|
|
result.sort((a: { createdAt: string | number | Date; }, b: { createdAt: string | number | Date; }) => {
|
|
result.sort((a: { createdAt: string | number | Date; }, b: { createdAt: string | number | Date; }) => {
|
|
return new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime();
|
|
return new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime();
|
|
});
|
|
});
|
|
result = result[0];
|
|
result = result[0];
|
|
console.log(result);
|
|
console.log(result);
|
|
- this.router.navigate(['generateResult',result?.id]);
|
|
|
|
|
|
+ this.router.navigate(['generateResult', result?.id]);
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
* @风格描述下的帮助文本点击事件
|
|
* @风格描述下的帮助文本点击事件
|