提交 15f2e239 authored 作者: 钟是志's avatar 钟是志

18036 H5------学生或宿管员有待审消息或新审核进度时,模块上红点提示

后台增加系统配置项 mobile_home_todoList {"pageSize": 30} JSON 字符串
上级 59aeec82
......@@ -3,7 +3,7 @@
* 2019年9月20日
* 事务相关接口
*/
import { uaaRequest } from '../utils/request';
import {uaaRequest} from '../utils/request';
import {Base16Encode} from "../Base16/index"
const api = '/UnifiedAppFormApi';
......@@ -11,6 +11,7 @@ const myCollect = {
namespace: 'affair',
state: {
user: {}, // 用户数据
todoListApps: [],
},
effects: {
/**
......@@ -19,15 +20,25 @@ const myCollect = {
* @param {appId} 应用id
* @param {pageNo} 页码
*/
*getBacklog({ payload, callback }, { call, put }) {
* getBacklog({payload, callback}, {call, put}) {
const response = yield call(uaaRequest, `${api}/getWaitPage`, {
...payload,
});
if (response == null) {
yield put({ type: 'nom' });
yield put({type: 'nom'});
return;
}
if (callback) {
} else {
const appIds = new Set();
response?.rows?.map((x) => {
appIds.add(x.appId);
return null;
});
yield put({type: 'todoList', payload: {
todoListApps: Array.from(appIds),
},
});
}
if (callback && typeof callback === 'function') {
callback(response);
}
},
......@@ -37,12 +48,12 @@ const myCollect = {
* @param {appId} 应用id
* @param {pageNo} 页码
*/
*getHaveDone({ payload, callback }, { call, put }) {
* getHaveDone({payload, callback}, {call, put}) {
const response = yield call(uaaRequest, `${api}/getHandledPage`, {
...payload,
});
if (response == null) {
yield put({ type: 'nom' });
yield put({type: 'nom'});
return;
}
if (callback) {
......@@ -55,12 +66,12 @@ const myCollect = {
* @param {appId} 应用id
* @param {pageNo} 页码
*/
*getDraft({ payload, callback }, { call, put }) {
* getDraft({payload, callback}, {call, put}) {
const response = yield call(uaaRequest, `${api}/getDraftPage`, {
...payload,
});
if (response == null) {
yield put({ type: 'nom' });
yield put({type: 'nom'});
return;
}
if (callback) {
......@@ -73,24 +84,24 @@ const myCollect = {
* @param {appId} 应用id
* @param {pageNo} 页码
*/
*getApply({ payload, callback }, { call, put }) {
* getApply({payload, callback}, {call, put}) {
const response = yield call(uaaRequest, `${api}/getApplyPage`, {
...payload,
});
if (response == null) {
yield put({ type: 'nom' });
yield put({type: 'nom'});
return;
}
if (callback) {
callback(response);
}
},
*getData({ payload, callback }, { call, put }) {
* getData({payload, callback}, {call, put}) {
const response = yield call(uaaRequest, `${api}/getData`, {
...payload,
});
if (response == null) {
yield put({ type: 'nom' });
yield put({type: 'nom'});
return;
}
if (callback) {
......@@ -102,15 +113,15 @@ const myCollect = {
* @param {taskId} 任务id
* @param {examineMap} 审核内容
*/
*getExamineProcess({ payload, callback }, { call, put }) {
if(payload.taskForm){
payload.taskForm = Base16Encode(payload.taskForm);
* getExamineProcess({payload, callback}, {call, put}) {
if (payload.taskForm) {
payload.taskForm = Base16Encode(payload.taskForm);
}
const response = yield call(uaaRequest, `${api}/examineProcess`, {
...payload,
});
if (response == null) {
yield put({ type: 'nom' });
yield put({type: 'nom'});
return;
}
if (callback) {
......@@ -121,12 +132,12 @@ const myCollect = {
* 根据id获得表单详情
* @param {id} 表单id
*/
*getIdFormDetail({ payload, callback }, { call, put }) {
* getIdFormDetail({payload, callback}, {call, put}) {
const response = yield call(uaaRequest, `${api}/getFormDetail`, {
...payload,
});
if (response == null) {
yield put({ type: 'nom' });
yield put({type: 'nom'});
return;
}
if (callback) {
......@@ -137,12 +148,12 @@ const myCollect = {
* 删除草稿
* @param {ids } 表单ids
*/
*removeDraft({ payload, callback }, { call, put }) {
* removeDraft({payload, callback}, {call, put}) {
const response = yield call(uaaRequest, `${api}/removeDraft`, {
...payload,
});
if (response == null) {
yield put({ type: 'nom' });
yield put({type: 'nom'});
return;
}
if (callback) {
......@@ -153,12 +164,12 @@ const myCollect = {
* 撤销流程
* @param {id} 表单id
*/
*revokeProcess({ payload, callback }, { call, put }) {
* revokeProcess({payload, callback}, {call, put}) {
const response = yield call(uaaRequest, `${api}/revokeProcess`, {
...payload,
});
if (response == null) {
yield put({ type: 'nom' });
yield put({type: 'nom'});
return;
}
if (callback) {
......@@ -172,15 +183,15 @@ const myCollect = {
* @param {content} 表单内容
* @param {title} 表单标题
*/
*saveDraft({ payload, callback }, { call, put }) {
if(payload.content){
payload.content = Base16Encode(payload.content);
* saveDraft({payload, callback}, {call, put}) {
if (payload.content) {
payload.content = Base16Encode(payload.content);
}
const response = yield call(uaaRequest, `${api}/saveDraft`, {
...payload,
});
if (response == null) {
yield put({ type: 'nom' });
yield put({type: 'nom'});
return;
}
if (callback) {
......@@ -194,45 +205,45 @@ const myCollect = {
* @param {content} 表单内容
* @param {title} 表单标题
*/
*startProcess({ payload, callback }, { call, put }) {
if(payload.content){
payload.content = Base16Encode(payload.content);
* startProcess({payload, callback}, {call, put}) {
if (payload.content) {
payload.content = Base16Encode(payload.content);
}
const response = yield call(uaaRequest, `${api}/startProcess`, {
...payload,
});
if (response == null) {
yield put({ type: 'nom' });
yield put({type: 'nom'});
return;
}
if (callback) {
callback(response);
}
},
*startProcessByService({ payload, callback }, { call, put }) {
if(payload.content){
payload.content = Base16Encode(payload.content);
* startProcessByService({payload, callback}, {call, put}) {
if (payload.content) {
payload.content = Base16Encode(payload.content);
}
const response = yield call(uaaRequest, `${api}/startProcessByService`, {
...payload,
});
if (response == null) {
yield put({ type: 'nom' });
yield put({type: 'nom'});
return;
}
if (callback) {
callback(response);
}
},
*getHandleUser({ payload, callback }, { call, put }) {
if(payload.content){
payload.content = Base16Encode(payload.content);
* getHandleUser({payload, callback}, {call, put}) {
if (payload.content) {
payload.content = Base16Encode(payload.content);
}
const response = yield call(uaaRequest, `${api}/getHandleUser`, {
...payload,
});
if (response == null) {
yield put({ type: 'nom' });
yield put({type: 'nom'});
return;
}
if (callback) {
......@@ -243,12 +254,12 @@ const myCollect = {
* 获取应用列表字段信息
* @param {id} 表单id
*/
*getFormTitle({ payload, callback }, { call, put }) {
* getFormTitle({payload, callback}, {call, put}) {
const response = yield call(uaaRequest, `${api}/getFormTitle`, {
...payload,
});
if (response == null) {
yield put({ type: 'nom' });
yield put({type: 'nom'});
return;
}
if (callback) {
......@@ -263,12 +274,12 @@ const myCollect = {
* @param put
* @returns {IterableIterator<*>}
*/
*getDataTitle({ payload, callback }, { call, put }) {
* getDataTitle({payload, callback}, {call, put}) {
const response = yield call(uaaRequest, `${api}/getDataTitle`, {
...payload,
});
if (response == null) {
yield put({ type: 'nom' });
yield put({type: 'nom'});
return;
}
if (callback) {
......@@ -279,7 +290,13 @@ const myCollect = {
},
reducers: {
nom(state, action) {
return { ...state };
return {...state};
},
todoList(state, { payload }) {
return {
...state,
todoListApps: payload.todoListApps,
}
},
},
};
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论