From e24078ba1c947e8d1bcdef58a378a3803aa2dec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 9 Jan 2023 14:30:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=96=AA=E8=B5=84=E6=A1=A3=E6=A1=88=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=8F=82=E6=95=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/stores/payrollFiles.js | 30 +++++++++++++++--------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/pc4mobx/hrmSalary/stores/payrollFiles.js b/pc4mobx/hrmSalary/stores/payrollFiles.js index 752b63e6..4fc882cb 100644 --- a/pc4mobx/hrmSalary/stores/payrollFiles.js +++ b/pc4mobx/hrmSalary/stores/payrollFiles.js @@ -1,23 +1,31 @@ -import { observable, action } from "mobx"; +import { action, observable } from "mobx"; import { WeaTableNew } from "comsMobx"; -import * as API from '../apis/payrollFiles'; +import * as API from "../apis/payrollFiles"; const { TableStore } = WeaTableNew; export class PayrollFilesStore { @observable tableStore = new TableStore(); @action("列表查询") - queryList= (payload={}, searchItemsValue={}, url='')=>{ - return new Promise((resolve, reject)=>{ - API.queryList({ ...payload, ...searchItemsValue, url }).then(res=>{ - const {data, status}= res; - if(status){ + queryList = (payload = {}, searchItemsValue = {}, url = "") => { + return new Promise((resolve, reject) => { + const { departmentIds, positionIds, subcompanyIds, ...extra } = searchItemsValue; + API.queryList({ + departmentIds: departmentIds ? departmentIds.split(",") : [], + positionIds: positionIds ? positionIds.split(",") : [], + subcompanyIds: subcompanyIds ? subcompanyIds.split(",") : [], + ...payload, ...extra, url + }).then(res => { + const { data, status } = res; + if (status) { const { dataKey } = data; const { datas } = dataKey; this.tableStore.getDatas(datas); // table 请求数据 } - resolve(res) - }).catch(()=>{reject()}) - }) - } + resolve(res); + }).catch(() => { + reject(); + }); + }); + }; }