/* * @Author: tengmingxue 1473375109@qq.com * @Date: 2023-09-11 19:36:34 * @LastEditors: tengmingxue 1473375109@qq.com * @LastEditTime: 2023-09-20 15:34:53 * @FilePath: \xld-gis-admin\src\api\resource\examine.ts * @Description: 流程配置信息api */ import { defHttp } from '/@/utils/http/axios'; enum Api { SelectFlowInfo = '/base-center/flow/selectFlowInfo', //查询流程信息 SaveFlowInfo = '/base-center/flow/saveFlowInfo', //新增、更新流程信息 SaveFlowInfoAll = '/base-center/flow/insertFlowInfoAll', //新增流程、节点、节点人员信息 DelFLowInfo = '/base-center/flow/deleteFlowInfo', //删除流程 SelectLowConfig = '/base-center/flow/selectFlowInfoAll', //查询流程、节点、节点人员信息 } /** * @description: 查询流程信息 * @param: page:页数 must * @param: rows:每页数据条数 must * @param: keyStr:模糊查询关键字 * @param: id:流程id */ export const queryFlowInfo = (params) => { params['row'] = params?.pageSize ? params?.pageSize : 10 return new Promise((resolve) => { defHttp.post({ url: Api.SelectFlowInfo, params: params }).then((res) => { const result = res.resp_code === 0 ? res.datas : [] result.forEach(item => { item['status'] = true }); resolve(result) }) }) }; /** * @description:根据流程业务id查询流程配置所有信息 * @param: ids:字符串数组 */ export const queryFlowInfoById = (param) => { const data = param.toString() // const dataFrom = new FormData() // dataFrom.append('',data) return new Promise((resolve) => { defHttp.post({ url: Api.SelectLowConfig, data, headers: { 'Content-Type': 'application/json;charset=UTF-8' }, }).then((res) => { const result = (res.resp_code === 0 && res.datas.length > 0) ? res.datas[0] : null resolve(result) }) }) } /** * @description: 一次提交流程配置信息 * @param: flowInfo:流程信息 must * @param: flowNode:流程步骤结点信息 must * @param: flowNodePerson:流程审核人信息 must * */ export const addFlowInfoAll = (params) => { return new Promise((resolve) => { defHttp.post({ url: Api.SaveFlowInfoAll, params }).then((res) => { resolve(res) }) }) }; /** * @description: 批量删除流程信息 * @param: ids:流程信息id must * */ export const delFlowInfo = (params) => { const data = params.toString() return new Promise((resolve) => { defHttp.post({ url: Api.DelFLowInfo, data, headers: { 'Content-Type': 'application/json;charset=UTF-8' }, }).then((res) => { resolve(res) }) }) };