import { Component, OnInit } from '@angular/core';
import { CommonModule } from '@angular/common';
    
import { IonContent,IonButton,IonSegment,IonSegmentButton,IonLabel,IonList,IonItem } from "@ionic/angular/standalone";
import { StoryLoader } from '../story-loader/story.loader';

@Component({
  selector: 'app-page-hangzhou',
  templateUrl: './page-hangzhou.component.html',
  styleUrls: ['./page-hangzhou.component.scss'],
  standalone: true,
    imports:[
      CommonModule,
      IonContent,IonButton,
      IonSegment,IonSegmentButton,IonLabel,
      IonList,IonItem
    ]
})
export class PageHangzhouComponent  implements OnInit {
  tab:string = "vector"
  tabChange(ev:any){
    this.tab = ev.detail.value
  }
  constructor() { }

  ngOnInit() {}

  /**
   * 文档加载、分割、向量存储
   */
  fileList:Array<any> = [
    {
      title:`市委办公厅 市政府办公厅印发《关于服务保障“抓防控促发展”落实“人才生态37条”的补充意见》的通知`,
      url:`https://app.fmode.cn/dev/jxnu/case/2020%E5%B9%B4%E6%9D%AD%E5%B7%9E%E5%B8%82%E4%BA%BA%E6%89%8D37%E6%9D%A1.pdf`
    },
    {
      title:"杭州市余杭区服务保障高层次人才创新创业政策实施细则",
      url:"https://app.fmode.cn/dev/jxnu/case/2022%E5%B9%B4%E6%9D%AD%E5%B7%9E%E4%BD%99%E6%9D%AD%E4%BA%BA%E6%89%8D%E5%8F%8C%E5%88%9B%E4%BF%9D%E9%9A%9C%E7%BB%86%E5%88%99.pdf"
    }
  ]
  preview(file:any){
    window.open(file.url,"_blank")
  }
  loader(file:any){
    let storyLoader = new StoryLoader();
    let pdfData = storyLoader.loader(file.url);
  }

}
