123456789101112131415161718192021222324252627282930313233343536373839404142 |
- import { Injectable } from '@angular/core';
- import { MainService } from 'src/app/services/main.service';
- import { map } from 'rxjs/operators';
- @Injectable({
- providedIn: 'root'
- })
- export class WashingBatchService {
- constructor(
- private mainService: MainService,
- ) { }
- // simple增删改
- simplePost(type, model, postData) {
- return this.mainService.simplePost(type, model, postData);
- }
- // 查询
- getFetchDataList(postData) {
- return this.mainService.getFetchDataList("simple/data", "clothesBatch", postData).pipe(map((v:any) => {
- if(Array.isArray(v.list)){
- v.list = v.list.map(vv => ({
- ...vv,
- buildingListNames: vv.buildingList ? vv.buildingList.map(v => v.buildingName).toString() : '',
- deptListNames: vv.deptList ? vv.deptList.map(v => v.dept).toString() : '',
- }));
- }else{
- v.list = [];
- }
- return v;
- }));;
- }
- // 字典
- getDictionary(type) {
- return this.mainService.getDictionary("list", type);
- }
- }
|