| 
					
				 | 
			
			
				@@ -0,0 +1,119 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { Component, OnInit } from '@angular/core'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { Router } from '@angular/router'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { CloudObject, CloudQuery, CloudUser } from '../lib/ncloud'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { IonHeader, IonToolbar, IonTitle, IonContent, IonButton,IonIcon, ModalController, IonTextarea, IonInput, IonCard, IonCardHeader, IonCardTitle, IonThumbnail, IonCardContent, IonCardSubtitle, IonItem, IonList, IonLabel, IonAvatar, IonSelect, IonSelectOption, AlertController, IonButtons, IonProgressBar, IonText } from '@ionic/angular/standalone'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { CommonModule } from '@angular/common'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { AvatarModule, ChatPanelOptions, DalleOptions, FmodeChat, FmodeChatCompletion, FmodeChatMessage, ImagineWork, openChatPanelModal } from 'fmode-ng'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+@Component({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  selector: 'app-atest', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  templateUrl: './atest.page.html', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  styleUrls: ['./atest.page.scss'], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  standalone: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  imports: [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    IonHeader, IonToolbar, IonTitle, IonContent, IonButton,IonTextarea,IonInput, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    IonIcon,IonCard,IonCardHeader,IonCardTitle, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    IonCardSubtitle,IonCardContent, IonThumbnail, IonItem,IonList,CommonModule,IonLabel, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    IonAvatar, IonSelect, IonSelectOption,IonButtons,IonProgressBar, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    IonText, IonCardHeader, IonCardSubtitle,] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+export class AtestPage implements OnInit { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  currentUser: CloudUser; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  constructor( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private modalCtrl:ModalController, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private router:Router, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private alertController: AlertController 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  ) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+   this.currentUser = new CloudUser(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  // 示例任务,自己生成图片后请存储新的ID  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  this.imagineWork = new ImagineWork(""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  this.imagineWork.fetchTask().then(work=>{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if(work){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.imagineWork.id = work.id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    this.images = this.imagineWork?.images || '../../assets/image/头像示例.png'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  this.loadAgentData() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ images:Array<string> = [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  back:string = "<"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  backhome() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    this.router.navigate(['/tab1']); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  ngOnInit() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  name: string = '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  nameInput(e:any) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    this.name = e.detail.value; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    console.log(this.name); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  age: number = 25 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  ageInput(e:any) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    this.age = e.detail.value; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    console.log(this.age); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  gender: string = 'male' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  genderChange(e:any) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    console.log('ionChange fired with value: ' + e.detail.value); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    this.gender = e.detail.value; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  genderCancel(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  genderDismiss(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  // 描述 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  desc: string = '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  descInput(e:any) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    this.desc = e.detail.value; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    console.log(this.desc); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  imagineWork:ImagineWork 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  PictureDescResult:string = `` // 画面描述结果 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  // 创建医生 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  async createAgent() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    const alert = await this.alertController.create({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      header: '温馨提示', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      subHeader: 'Tips', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      message: '把信息填写完整哦~', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      buttons: ['好的'], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if (this.name == '' || this.age == 0 || this.gender == '' || this.desc == '') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      //await alert.present(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    localStorage.setItem("company","E4KpGvTEto") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    let consult = new CloudObject("NovelCharacter") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    let now = new Date(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    let dateStr = `${now.getFullYear()}-${now.getMonth()+1}-${now.getDate()}` 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // 对象权限的精确指定 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    let ACL:any = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      "*":{read:true,write:true} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if(this.currentUser?.id){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      ACL[this.currentUser?.id] = {read:true,write:true} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+       
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+   
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+   
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  agentList: Array<CloudObject> = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  async loadAgentData() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    let query = new CloudQuery("test") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    this.agentList = await query.find() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    console.log(this.agentList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 |