xflow.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import { queryOSSData, queryBoomFlowDetail, queryAuditList } from '@/services/boom';
  2. import { message } from 'antd';
  3. export default {
  4. namespace: 'xflow',
  5. state: {
  6. OSSData: {},
  7. flowDetail: { nodes: [], edges: [] },
  8. auditList: [],
  9. },
  10. effects: {
  11. *queryOSSData({}, { call, put }) {
  12. const response = yield call(queryOSSData);
  13. if (response) {
  14. yield put({
  15. type: 'save',
  16. payload: { OSSData: response.data },
  17. });
  18. }
  19. },
  20. *queryBoomFlowDetail({ payload, callback }, { call, put }) {
  21. const data = yield call(queryBoomFlowDetail, payload);
  22. console.log(data);
  23. callback && callback(data);
  24. yield put({
  25. type: 'save',
  26. payload: { flowDetail: data },
  27. });
  28. },
  29. *queryAuditList({ payload }, { call, put }) {
  30. const response = yield call(queryAuditList, payload);
  31. if (response) {
  32. yield put({
  33. type: 'save',
  34. payload: { auditList: response.data },
  35. });
  36. }
  37. },
  38. },
  39. reducers: {
  40. save(state, action) {
  41. return {
  42. ...state,
  43. ...action.payload,
  44. };
  45. },
  46. },
  47. };