当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript data-form.service.DataFormService类代码示例

本文整理汇总了TypeScript中@geonature_common/form/data-form.service.DataFormService的典型用法代码示例。如果您正苦于以下问题:TypeScript service.DataFormService类的具体用法?TypeScript service.DataFormService怎么用?TypeScript service.DataFormService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了service.DataFormService类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: constructor

  constructor(
    private _dataService: DataFormService,
    private _syntheseDateService: DataService,
    private _formService: SyntheseFormService,
    private _formGen: DynamicFormService
  ) {
    if (AppConfig.SYNTHESE.DISPLAY_TAXON_TREE) {
      this._syntheseDateService.getTaxonTree().subscribe(data => {
        this.taxonTree = this.formatTaxonTree(data);
      });
    }

    // get taxhub attributes
    this._dataService.getTaxhubBibAttributes().subscribe(attrs => {
      // display only the taxhub attributes set in the config
      this.taxhubAttributes = attrs
        .filter(attr => {
          return AppConfig.SYNTHESE.ID_ATTRIBUT_TAXHUB.indexOf(attr.id_attribut) !== -1;
        })
        .map(attr => {
          // format attributes to fit with the GeoNature dynamicFormComponent
          attr['values'] = JSON.parse(attr['liste_valeur_attribut']).values;
          attr['attribut_name'] = 'taxhub_attribut_' + attr['id_attribut'];
          attr['required'] = attr['obligatoire'];
          attr['attribut_label'] = attr['label_attribut'];
          if (attr['type_widget'] == 'multiselect') {
            attr['values'] = attr['values'].map(val => {
              return { value: val };
            });
          }
          this._formGen.addNewControl(attr, this._formService.searchForm);

          return attr;
        });
      this.formBuilded = true;
    });
    // load LR,  habitat and group2inpn
    this._dataService.getTaxonomyLR().subscribe(data => {
      this.taxonomyLR = data;
    });

    this._dataService.getTaxonomyHabitat().subscribe(data => {
      this.taxonomyHab = data;
    });

    const all_groups = [];
    this._dataService.getRegneAndGroup2Inpn().subscribe(data => {
      this.taxonomyGroup2Inpn = data;
      // tslint:disable-next-line:forin
      for (let regne in data) {
        data[regne].forEach(group => {
          if (group.length > 0) {
            all_groups.push({ value: group });
          }
        });
      }
      this.taxonomyGroup2Inpn = all_groups;
    });
  }
开发者ID:PnEcrins,项目名称:GeoNature,代码行数:59,代码来源:taxon-advanced-store.service.ts

示例2: constructor

 constructor(private _api: DataFormService) {
   this._api.getModulesList([]).subscribe(data => {
     this.modules = data;
     this.displayedModules = data.filter(mod => {
       return mod.module_code.toLowerCase() !== 'geonature';
     });
     this.setModulesLocalStorage(data);
   });
 }
开发者ID:PnEcrins,项目名称:GeoNature,代码行数:9,代码来源:module.service.ts

示例3: constructor

 constructor(private _api: DataFormService) {
   this._api.getCruved().subscribe(data => {
     this.cruved = data;
   });
 }
开发者ID:PnEcrins,项目名称:GeoNature,代码行数:5,代码来源:cruved-store.service.ts

示例4: ngOnInit

 ngOnInit() {
   this._dfs.getOrganisms().subscribe(data => {
     this.organisms = data;
   });
   this._dfs.getRoles({'group': false}).subscribe(data => {
     this.roles = data;
   });
 }
开发者ID:PnEcrins,项目名称:GeoNature,代码行数:8,代码来源:actors.component.ts

示例5: getDataset

  getDataset(id) {
    // on edition mode
    this._dfs.getDataset(id).subscribe(data => {
      this.dataset = data;
      this.datasetForm.patchValue(data);

      data.cor_dataset_actor.forEach((cor, index) => {
        if (index === 0) {
          this.cor_dataset_actor_array.controls[index].patchValue(cor);
        } else {
          const formCor = this._formService.generateCorDatasetActorForm();
          this.cor_dataset_actor_array.push(formCor);
          //hack pour attendre que le template soit rendu avant de mettre les valeurs au formulaire
          setTimeout(() => {
            this.cor_dataset_actor_array.controls[index].patchValue(cor);
          }, 2000);
        }
      });
    });
  }
开发者ID:PnEcrins,项目名称:GeoNature,代码行数:20,代码来源:dataset-form.component.ts

示例6: ngOnInit

  ngOnInit() {
    // get the id from the route
    this._route.params.subscribe(params => {
      this.id_dataset = params['id'];
      if (this.id_dataset) {
        this.getDataset(this.id_dataset);
      }
    });
    this.datasetForm = this._fb.group({
      id_acquisition_framework: [null, Validators.required],
      id_dataset: null,
      dataset_name: [null, Validators.compose([Validators.required, Validators.maxLength(150)])],
      dataset_shortname: [
        null,
        Validators.compose([Validators.required, Validators.maxLength(30)])
      ],
      dataset_desc: [null, Validators.required],
      id_nomenclature_data_type: [null, Validators.required],
      keywords: null,
      marine_domain: true,
      terrestrial_domain: false,
      id_nomenclature_dataset_objectif: [null, Validators.required],
      //TODO bouding-box
      id_nomenclature_collecting_method: [null, Validators.required],
      id_nomenclature_data_origin: [null, Validators.required],
      id_nomenclature_source_status: [null, Validators.required],
      id_nomenclature_resource_type: [null, Validators.required],
      default_validity: true,
      active: [true, Validators.required]
    });

    this.cor_dataset_actor_array = this._fb.array([]);

    this._dfs.getAcquisitionFrameworks().subscribe(data => {
      this.acquisitionFrameworks = data;
    });

    this.cor_dataset_actor_array.push(this._formService.generateCorDatasetActorForm());
  }
开发者ID:PnEcrins,项目名称:GeoNature,代码行数:39,代码来源:dataset-form.component.ts

示例7: ngOnInit

  ngOnInit() {
    this._SideNavService.sidenav.open();
    this.appConfig = AppConfig;

    this._syntheseApi.getSyntheseData({ limit: 100 }).subscribe(result => {
      this.lastObs = result.data;
    });
    // get general stats
    this._syntheseApi.getSyntheseGeneralStat().subscribe(result => {
      this.generalStat = result;
    });

    // get module home if not already in localstorage
    if (!localStorage.getItem('modules')) {
      this._api.getModuleByCodeName('GEONATURE').subscribe(module => {
        module['module_label'] = 'Accueil';
        // emit the currentModule event
        this._globalSub.currentModuleSubject.next(module);
      });
    } else {
      // emit the currentModule event
      this._globalSub.currentModuleSubject.next(this._moduleService.getModule('GEONATURE'));
    }
  }
开发者ID:PnEcrins,项目名称:GeoNature,代码行数:24,代码来源:home-content.component.ts

示例8: ngOnInit

 ngOnInit() {
   this._dfs.getAcquisitionFrameworks().subscribe(data => {
     this.values = data;
     this.savedValues = data;
   });
 }
开发者ID:PnEcrins,项目名称:GeoNature,代码行数:6,代码来源:acquisition-frameworks.component.ts


注:本文中的@geonature_common/form/data-form.service.DataFormService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。