|
@@ -0,0 +1,97 @@
|
|
|
+import { Component, OnInit } from '@angular/core';
|
|
|
+import { Router } from '@angular/router';
|
|
|
+import { CloudObject, CloudQuery, CloudUser } from 'src/lib/ncloud';
|
|
|
+import { IonHeader, IonToolbar, IonTitle, IonContent, IonButton,IonIcon, ModalController, IonTextarea, IonInput, IonCard, IonCardHeader, IonCardTitle, IonThumbnail, IonCardContent, IonCardSubtitle, IonItem, IonList, IonLabel, IonAvatar, IonSelect, IonSelectOption } from '@ionic/angular/standalone';
|
|
|
+import { CommonModule } from '@angular/common';
|
|
|
+import { AvatarModule } from 'fmode-ng';
|
|
|
+
|
|
|
+
|
|
|
+@Component({
|
|
|
+ selector: 'app-page-create-agent',
|
|
|
+ templateUrl: './page-create-agent.component.html',
|
|
|
+ styleUrls: ['./page-create-agent.component.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
|
|
|
+ ],
|
|
|
+})
|
|
|
+export class PageCreateAgentComponent implements OnInit {
|
|
|
+
|
|
|
+ currentUser: CloudUser;
|
|
|
+ constructor(
|
|
|
+ private modalCtrl:ModalController,
|
|
|
+ private router:Router
|
|
|
+ ) {
|
|
|
+ this.currentUser = new CloudUser();
|
|
|
+ }
|
|
|
+
|
|
|
+ back:string = "<";
|
|
|
+
|
|
|
+ backhome() {
|
|
|
+ this.router.navigate(['/tabs/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(){
|
|
|
+
|
|
|
+ }
|
|
|
+ keshi: string = 'male'
|
|
|
+ keshiChange(e:any) {
|
|
|
+ console.log('ionChange fired with value: ' + e.detail.value);
|
|
|
+ this.keshi = e.detail.value;
|
|
|
+ }
|
|
|
+ keshiCancel(){
|
|
|
+
|
|
|
+ }
|
|
|
+ keshiDismiss(){
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ desc: string = ''
|
|
|
+ createAgent() {
|
|
|
+ localStorage.setItem("company","E4KpGvTEto")
|
|
|
+
|
|
|
+ let consult = new CloudObject("DoctorAgent")
|
|
|
+ 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}
|
|
|
+ }
|
|
|
+ consult.set({
|
|
|
+ avatar:``,
|
|
|
+ name:`${this.name}`,
|
|
|
+ age:`${this.age}`,
|
|
|
+ gender:`${this.gender}`,
|
|
|
+ desc:`${this.desc}`,
|
|
|
+ user:this.currentUser.toPointer(),
|
|
|
+ ACL:ACL
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+}
|