mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-15 21:32:49 +00:00
perf: 优化待审批流程数量接口
This commit is contained in:
parent
4104dea68e
commit
ab0539a263
@ -1128,5 +1128,27 @@ class ApproveController extends AbstractController
|
||||
return Base::retSuccess('success', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/approve/process/doto 20. 查询需要我审批的流程数量
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
* @apiGroup approve
|
||||
* @apiName process__doto
|
||||
*
|
||||
* @apiSuccess {Number} ret 返回状态码(1正确、0错误)
|
||||
* @apiSuccess {String} msg 返回信息(错误描述)
|
||||
* @apiSuccess {Object} data 返回数据
|
||||
*/
|
||||
public function process__doto()
|
||||
{
|
||||
$user = User::auth();
|
||||
$ret = Ihttp::ihttp_get($this->flow_url.'/api/v1/workflow/process/findTaskTotal?userid='.$user->userid);
|
||||
$process = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true);
|
||||
if (!$process || $process['status'] != 200) {
|
||||
return Base::retError($process['message'] ?? '查询失败');
|
||||
}
|
||||
return Base::retSuccess('success', $process['data']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -150,7 +150,7 @@ services:
|
||||
|
||||
approve:
|
||||
container_name: "dootask-approve-${APP_ID}"
|
||||
image: "kuaifan/dooapprove:0.0.9"
|
||||
image: "kuaifan/dooapprove:0.0.10"
|
||||
environment:
|
||||
TZ: "${TIMEZONE:-PRC}"
|
||||
MYSQL_HOST: "${DB_HOST}"
|
||||
|
||||
17
resources/assets/js/store/actions.js
vendored
17
resources/assets/js/store/actions.js
vendored
@ -588,14 +588,19 @@ export default {
|
||||
state.approveUnreadNumber = 0;
|
||||
} else {
|
||||
dispatch("call", {
|
||||
url: 'approve/process/findTask',
|
||||
data: {
|
||||
page:1,
|
||||
page_size: 500,
|
||||
}
|
||||
url: 'approve/process/doto'
|
||||
}).then(({data}) => {
|
||||
state.approveUnreadNumber = data.total || 0;
|
||||
}).catch(_ => {});
|
||||
}).catch(({msg}) => {
|
||||
if( msg.indexOf("404 not found") !== -1){
|
||||
$A.modalInfo({
|
||||
language: false,
|
||||
title: '版本过低',
|
||||
content: '服务器版本过低,请升级服务器。',
|
||||
})
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}, typeof timeout === "number" ? timeout : 1000)
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user