| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- import { dictFilterArr } from '@/pages/Isystem/I2dict/data'
- import store, { AppDispatch } from '@/store'
- import http from '@/utils/http'
- /**
- * 流程设置 - 获取分页列表
- */
- export const I4_APIgetList = (data: any): any => {
- return async (dispatch: AppDispatch) => {
- const res = await http.post('cms/flow/pageList', { ...data, pageSize: 99999, pageNum: 1 })
- if (res.code === 0) {
- const treeData = store.getState().I2dict.dictAll.filter(v => dictFilterArr.includes(v.id))
- let list: any[] = res.data.records || []
- list.forEach(v => {
- const ids: string = v.dictIds || ''
- if (ids) {
- const arr = ids.split(',')
- const ids1: string[] = []
- const ids2: string[] = []
- arr.forEach(v2 => {
- if (dictFilterArr.includes(v2)) ids1.push(v2)
- else ids2.push(v2)
- })
- let txtTemp: any = []
- treeData.forEach(v1 => {
- if (ids1.includes(v1.id)) {
- if (txtTemp[v1.name]) txtTemp[v1.name].push('默认')
- else txtTemp[v1.name] = ['默认']
- }
- if (v1.children) {
- v1.children.forEach(v2 => {
- if (ids2.includes(v2.id)) {
- if (txtTemp[v1.name]) txtTemp[v1.name].push(v2.name)
- else txtTemp[v1.name] = [v2.name]
- }
- })
- }
- })
- let txt = ''
- for (const k in txtTemp) {
- txt += k + ':'
- if (txtTemp[k] && txtTemp[k].length) {
- txt += txtTemp[k].join(',') + '<br/>'
- }
- }
- txt = txt.substring(0, txt.length - 5)
- v.guanLian = txt
- }
- })
- dispatch({ type: 'I4/getList', payload: list })
- }
- }
- }
- /**
- * 流程设置 - 删除
- */
- export const I4_APIdel = (ids: number[]) => {
- return http.post('cms/flow/removes', ids)
- }
- /**
- * 流程设置-新增/编辑
- */
- export const I4_APIsave = (data: any) => {
- return http.post('cms/flow/saveEntity', data)
- }
- /**
- * 流程设置-获取详情
- */
- export const I4_APIgetInfo = (id: number) => {
- return http.get(`cms/flow/detail/${id}`)
- }
- /**
- * 流程设置- 环节 - 列表
- */
- export const I4_APIgetProList = (id: number) => {
- return http.get(`cms/flow/process/getList/${id}`)
- }
- /**
- * 流程设置- 环节-获取详情
- */
- export const I4_APIgetProInfo = (id: number) => {
- return http.get(`cms/flow/process/${id}`)
- }
- /**
- * 流程设置- 环节-删除
- */
- export const I4_APIgetProDel = (id: number) => {
- return http.get(`cms/flow/process/remove/${id}`)
- }
- /**
- * 流程设置- 环节-新增/编辑
- */
- export const I4_APIgetProSave = (data: any) => {
- return http.post('cms/flow/process/save', data)
- }
- /**
- * 流程设置- 环节 - 列表
- */
- export const I4_APIgetProGetUser = (id: number) => {
- return http.get(`cms/flow/process/getUser/${id}`)
- }
|