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

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

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