From 97bd58312eaf462c81a0fcdaa1dabef07dc5344a Mon Sep 17 00:00:00 2001 From: kuaifan Date: Tue, 16 Jun 2026 11:35:49 +0000 Subject: [PATCH] =?UTF-8?q?refactor(approve):=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E4=B8=BB=E4=BB=93=E5=BA=93=E5=86=85=E7=BD=AE=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E5=8A=9F=E8=83=BD,=E6=94=B6=E6=95=9B=E5=88=B0=E6=8F=92?= =?UTF-8?q?=E4=BB=B6/=E5=BE=AE=E5=BA=94=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 删除 ApproveController、ApproveProcInstHistory/ApproveProcMsg 模型、approve 前端页面与导出组件,移除 approve 路由与 flow_url 配置;审批消息模板改为对接 插件侧能力。版本号 1.7.90 → 1.7.91。 Co-Authored-By: Claude Opus 4.8 (1M context) --- .prefetch | 5 - .../Controllers/Api/ApproveController.php | 1267 ----------------- app/Http/Controllers/Api/DialogController.php | 45 + app/Models/ApproveProcInstHistory.php | 99 -- app/Models/ApproveProcMsg.php | 34 - app/Tasks/CheckinRemindTask.php | 4 - config/dootask.php | 3 - package.json | 2 +- resources/assets/js/App.vue | 1 - .../assets/js/components/Mobile/Tabbar.vue | 6 +- resources/assets/js/pages/manage.vue | 61 +- .../assets/js/pages/manage/application.vue | 7 - .../js/pages/manage/approve/details.vue | 550 ------- .../assets/js/pages/manage/approve/index.vue | 739 ---------- .../assets/js/pages/manage/approve/list.vue | 46 - .../js/pages/manage/approve/setting.vue | 176 --- .../pages/manage/components/ApproveExport.vue | 124 -- .../template/approve-comment-notifier.vue | 3 - .../DialogView/template/approve-notifier.vue | 13 +- .../DialogView/template/approve-reviewer.vue | 28 +- .../DialogView/template/approve-submitter.vue | 24 +- .../pages/manage/components/DialogWrapper.vue | 30 - resources/assets/js/store/actions.js | 40 - resources/assets/js/store/state.js | 3 - .../sass/pages/components/dialog-wrapper.scss | 1 - routes/web.php | 4 - 26 files changed, 85 insertions(+), 3230 deletions(-) delete mode 100755 app/Http/Controllers/Api/ApproveController.php delete mode 100644 app/Models/ApproveProcInstHistory.php delete mode 100644 app/Models/ApproveProcMsg.php delete mode 100644 resources/assets/js/pages/manage/approve/details.vue delete mode 100644 resources/assets/js/pages/manage/approve/index.vue delete mode 100644 resources/assets/js/pages/manage/approve/list.vue delete mode 100644 resources/assets/js/pages/manage/approve/setting.vue delete mode 100644 resources/assets/js/pages/manage/components/ApproveExport.vue diff --git a/.prefetch b/.prefetch index abb24d7b6..a2f74609a 100644 --- a/.prefetch +++ b/.prefetch @@ -158,11 +158,6 @@ drawio/webapp/js/app.min.js drawio/webapp/js/extensions.min.js drawio/webapp/js/shapes-14-6-5.min.js drawio/webapp/js/stencils.min.js -drawio/webapp/math/es5/core.js -drawio/webapp/math/es5/input/asciimath.js -drawio/webapp/math/es5/input/tex.js -drawio/webapp/math/es5/output/svg.js -drawio/webapp/math/es5/output/svg/fonts/tex.js drawio/webapp/styles/grapheditor.css minder/css/chunk-vendors.fe9c56c6.css diff --git a/app/Http/Controllers/Api/ApproveController.php b/app/Http/Controllers/Api/ApproveController.php deleted file mode 100755 index d5929bced..000000000 --- a/app/Http/Controllers/Api/ApproveController.php +++ /dev/null @@ -1,1267 +0,0 @@ -flow_url = config('dootask.flow_url') ?: 'http://approve'; - } - - /** - * @api {get} api/approve/verifyToken 验证APi登录 - * - * @apiDescription 需要token身份 - * @apiVersion 1.0.0 - * @apiGroup approve - * @apiName verifyToken - * - * @apiSuccess {String} version - * @apiSuccess {String} publish - */ - public function verifyToken() - { - try { - $user = User::auth(); - $user->checkAdmin(); - return Base::retSuccess('成功'); - } catch (\Throwable $th) { - return response('身份无效', 400)->header('Content-Type', 'text/plain'); - } - } - - /** - * @api {post} api/approve/procdef/all 查询流程定义 - * - * @apiDescription 需要token身份 - * @apiVersion 1.0.0 - * @apiGroup approve - * @apiName procdef__all - * - * @apiQuery {String} name 流程名称 - * - * @apiSuccess {Number} ret 返回状态码(1正确、0错误) - * @apiSuccess {String} msg 返回信息(错误描述) - * @apiSuccess {Object} data 返回数据 - */ - public function procdef__all() - { - User::auth(); - $data['name'] = Request::input('name'); - $ret = Ihttp::ihttp_post($this->flow_url . '/api/v1/workflow/procdef/findAll', json_encode($data)); - $procdef = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); - if (!$procdef || $procdef['status'] != 200 || $ret['ret'] == 0) { - // info($ret); - return Base::retError($procdef['message'] ?? '查询失败'); - } - return Base::retSuccess('success', Base::arrayKeyToUnderline($procdef['data'])); - } - - /** - * @api {get} api/approve/procdef/del 删除流程定义 - * - * @apiDescription 需要token身份 - * @apiVersion 1.0.0 - * @apiGroup approve - * @apiName procdef__del - * - * @apiQuery {String} id 流程ID - * - * @apiSuccess {Number} ret 返回状态码(1正确、0错误) - * @apiSuccess {String} msg 返回信息(错误描述) - * @apiSuccess {Object} data 返回数据 - */ - public function procdef__del() - { - User::auth('admin'); - $data['id'] = Request::input('id'); - $ret = Ihttp::ihttp_get($this->flow_url . '/api/v1/workflow/procdef/delById?' . http_build_query($data)); - $procdef = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); - if (!$procdef || $procdef['status'] != 200) { - return Base::retError($procdef['message'] ?? '删除失败'); - } - return Base::retSuccess('success', Base::arrayKeyToUnderline($procdef['data'])); - } - - /** - * @api {post} api/approve/process/start 启动流程(审批中) - * - * @apiDescription 需要token身份 - * @apiVersion 1.0.0 - * @apiGroup approve - * @apiName process__start - * - * @apiQuery {String} proc_name 流程名称 - * @apiQuery {Number} department_id 部门ID - * @apiQuery {Array} [var] 启动流程类型信息(格式:[{type,startTime,endTime,description}]) - * - * @apiSuccess {Number} ret 返回状态码(1正确、0错误) - * @apiSuccess {String} msg 返回信息(错误描述) - * @apiSuccess {Object} data 返回数据 - */ - public function process__start() - { - $user = User::auth(); - $data['userid'] = (string)$user->userid; - $data['department_id'] = intval(Request::input('department_id')); - $data['proc_name'] = Request::input('proc_name'); - // - $var = json_decode(Request::input('var'), true); - $data['var'] = $var; - $ret = Ihttp::ihttp_post($this->flow_url . '/api/v1/workflow/process/start', json_encode(Base::arrayKeyToCamel($data))); - $process = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); - if (!$process || $process['status'] != 200) { - return Base::retError($process['message'] ?? '启动失败'); - } - // - $process = Base::arrayKeyToUnderline($process['data']); - $process = $this->getProcessById($process['id']); //获取最新的流程信息 - if ($process['candidate']) { - $userid = explode(',', $process['candidate']); - $toUser = User::whereIn('userid', $userid)->get()->toArray(); - $botUser = User::botGetOrCreate('approval-alert'); - if (empty($botUser)) { - return Base::retError('审批机器人不存在'); - } - foreach ($toUser as $val) { - if ($val['bot']) { - continue; - } - $dialog = WebSocketDialog::checkUserDialog($botUser, $val['userid']); - if (empty($dialog)) { - continue; - } - $this->approveMsg('approve_reviewer', $dialog, $botUser, $val, $process, 'start'); - } - // 抄送人 - $notifier = $this->handleProcessNode($process); - if ($notifier) { - foreach ($notifier as $val) { - $dialog = WebSocketDialog::checkUserDialog($botUser, $val['target_id']); - $this->approveMsg('approve_notifier', $dialog, $botUser, $process, $process); - } - } - } - - return Base::retSuccess('创建成功', $process); - } - - /** - * @api {post} api/approve/process/addGlobalComment 添加全局评论 - * - * @apiDescription 需要token身份 - * @apiVersion 1.0.0 - * @apiGroup approve - * @apiName process__addGlobalComment - * - * @apiQuery {Number} proc_inst_id 流程实例ID - * @apiQuery {String} content 评论内容 - * - * @apiSuccess {Number} ret 返回状态码(1正确、0错误) - * @apiSuccess {String} msg 返回信息(错误描述) - * @apiSuccess {Object} data 返回数据 - */ - public function process__addGlobalComment() - { - $user = User::auth(); - $data['proc_inst_id'] = intval(Request::input('proc_inst_id')); - $data['userid'] = (string)$user->userid; - $data['content'] = Request::input('content'); //内容+图片 - - $processInst = $this->getProcessById($data['proc_inst_id']); - - $ret = Ihttp::ihttp_post($this->flow_url . '/api/v1/workflow/process/addGlobalComment', json_encode(Base::arrayKeyToCamel($data))); - $process = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); - if (!$process || $process['status'] != 200) { - return Base::retError($process['message'] ?? '添加失败'); - } - - // 推送通知 - $botUser = User::botGetOrCreate('approval-alert'); - foreach ($processInst['userids'] as $id) { - if ($id != $user->userid) { - $dialog = WebSocketDialog::checkUserDialog($botUser, $id); - $processInst['comment_user_id'] = $user->userid; - $processInst['comment_contents'] = json_decode($data['content'], true) ?? []; - $this->approveMsg('approve_comment_notifier', $dialog, $botUser, $processInst, $processInst); - } - } - - $res = Base::arrayKeyToUnderline($process['data']); - return Base::retSuccess('success', $res); - } - - /** - * @api {post} api/approve/task/complete 审批 - * - * @apiDescription 需要token身份 - * @apiVersion 1.0.0 - * @apiGroup approve - * @apiName task__complete - * - * @apiQuery {Number} task_id 流程ID - * @apiQuery {String} pass 标题 [true-通过,false-拒绝] - * @apiQuery {String} comment 评论 - * - * @apiSuccess {Number} ret 返回状态码(1正确、0错误) - * @apiSuccess {String} msg 返回信息(错误描述) - * @apiSuccess {Object} data 返回数据 - */ - public function task__complete() - { - $user = User::auth(); - $data['userid'] = (string)$user->userid; - $data['task_id'] = intval(Request::input('task_id')); - $data['pass'] = Request::input('pass'); - $data['comment'] = Request::input('comment'); - $ret = Ihttp::ihttp_post($this->flow_url . '/api/v1/workflow/task/complete', json_encode(Base::arrayKeyToCamel($data))); - $task = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); - if (!$task || $task['status'] != 200) { - return Base::retError($task['message'] ?? '审批失败'); - } - // - $task = Base::arrayKeyToUnderline($task['data']); - $pass = $data['pass'] == 'true' ? 'pass' : 'refuse'; - $process = $this->getProcessById($task['proc_inst_id']); - $botUser = User::botGetOrCreate('approval-alert'); - if (empty($botUser)) { - return Base::retError('审批机器人不存在'); - } - // 在流程信息关联的用户中查找 - $toUser = ApproveProcMsg::where('proc_inst_id', $process['id'])->get()->toArray(); - foreach ($toUser as $val) { - $dialog = WebSocketDialog::checkUserDialog($botUser, $val['userid']); - if (empty($dialog)) { - continue; - } - $this->approveMsg('approve_reviewer', $dialog, $botUser, $val, $process, $pass); - } - // 发起人 - if ($process['is_finished']) { - $dialog = WebSocketDialog::checkUserDialog($botUser, $process['start_user_id']); - if (!empty($dialog)) { - $this->approveMsg('approve_submitter', $dialog, $botUser, ['userid' => $data['userid']], $process, $pass); - } - } else if ($process['candidate']) { - // 下个审批人 - $userid = explode(',', $process['candidate']); - $toUser = User::whereIn('userid', $userid)->get()->toArray(); - foreach ($toUser as $val) { - if ($val['bot']) { - continue; - } - $dialog = WebSocketDialog::checkUserDialog($botUser, $val['userid']); - if (empty($dialog)) { - continue; - } - $this->approveMsg('approve_reviewer', $dialog, $botUser, $val, $process, 'start'); - } - } - - // 抄送人 - $notifier = $this->handleProcessNode($process); - if ($notifier && $pass == 'pass') { - foreach ($notifier as $val) { - $dialog = WebSocketDialog::checkUserDialog($botUser, $val['target_id']); - if (!empty($dialog)) { - $this->approveMsg('approve_notifier', $dialog, $botUser, $process, $process); - } - } - } - return Base::retSuccess($pass == 'pass' ? '已通过' : '已拒绝', $task); - } - - /** - * @api {post} api/approve/task/withdraw 撤回 - * - * @apiDescription 需要token身份 - * @apiVersion 1.0.0 - * @apiGroup approve - * @apiName task__withdraw - * - * @apiQuery {Number} task_id 流程ID - * @apiQuery {Number} proc_inst_id 流程实例ID - * - * @apiSuccess {Number} ret 返回状态码(1正确、0错误) - * @apiSuccess {String} msg 返回信息(错误描述) - * @apiSuccess {Object} data 返回数据 - */ - public function task__withdraw() - { - $user = User::auth(); - $data['userid'] = (string)$user->userid; - $data['task_id'] = intval(Request::input('task_id')); - $data['proc_inst_id'] = intval(Request::input('proc_inst_id')); - $ret = Ihttp::ihttp_post($this->flow_url . '/api/v1/workflow/task/withdraw', json_encode(Base::arrayKeyToCamel($data))); - $task = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); - if (!$task || $task['status'] != 200) { - return Base::retError($task['message'] ?? '撤回失败'); - } - // - $process = $this->getProcessById($data['proc_inst_id']); - $botUser = User::botGetOrCreate('approval-alert'); - if (empty($botUser)) { - return Base::retError('审批机器人不存在'); - } - // 在流程信息关联的用户中查找 - $toUser = ApproveProcMsg::where('proc_inst_id', $process['id'])->get()->toArray(); - foreach ($toUser as $val) { - $dialog = WebSocketDialog::checkUserDialog($botUser, $val['userid']); - if (empty($dialog)) { - continue; - } - //发送撤回提醒 - $this->approveMsg('approve_reviewer', $dialog, $botUser, $val, $process, 'withdraw'); - } - return Base::retSuccess('已撤回', Base::arrayKeyToUnderline($task['data'])); - } - - /** - * @api {post} api/approve/process/delById 删除审批(流程实例) - * - * @apiDescription 需要token身份;仅可删除已结束的审批,且仅发起人或管理员可删 - * @apiVersion 1.0.0 - * @apiGroup approve - * @apiName process__delById - * - * @apiQuery {Number} proc_inst_id 流程实例ID - * - * @apiSuccess {Number} ret 返回状态码(1正确、0错误) - * @apiSuccess {String} msg 返回信息(错误描述) - * @apiSuccess {Object} data 返回数据 - */ - public function process__delById() - { - $user = User::auth(); - $data['userid'] = (string)$user->userid; - $data['proc_inst_id'] = intval(Request::input('proc_inst_id')); - $data['is_admin'] = $user->isAdmin(); - if ($data['proc_inst_id'] <= 0) { - return Base::retError('参数错误'); - } - $ret = Ihttp::ihttp_post($this->flow_url . '/api/v1/workflow/process/delById', json_encode(Base::arrayKeyToCamel($data))); - $task = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); - if (!$task || $task['status'] != 200) { - return Base::retError($task['message'] ?? '删除失败'); - } - return Base::retSuccess('已删除'); - } - - /** - * @api {post} api/approve/process/findTask 查询需要我审批的流程(审批中) - * - * @apiDescription 需要token身份 - * @apiVersion 1.0.0 - * @apiGroup approve - * @apiName process__findTask - * - * @apiQuery {String} proc_def_name 流程名称 - * @apiQuery {String} sort 排序[asc升序,desc降序] - * @apiQuery {Number} page 页码 - * @apiQuery {Number} page_size 每页条数 - * - * @apiSuccess {Number} ret 返回状态码(1正确、0错误) - * @apiSuccess {String} msg 返回信息(错误描述) - * @apiSuccess {Object} data 返回数据 - */ - public function process__findTask() - { - $user = User::auth(); - $data['userid'] = (string)$user->userid; - $data['username'] = Request::input('username'); - $data['procName'] = Request::input('proc_def_name'); - $data['sort'] = Request::input('sort'); - $data['pageIndex'] = intval(Request::input('page')); - $data['pageSize'] = intval(Request::input('page_size')); - $ret = Ihttp::ihttp_post($this->flow_url . '/api/v1/workflow/process/findTask', json_encode(Base::arrayKeyToCamel($data))); - $process = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); - if (!$process || $process['status'] != 200) { - return Base::retError($process['message'] ?? '查询失败'); - } - // - $res = Base::arrayKeyToUnderline($process['data']); - foreach ($res['rows'] as &$val) { - $info = User::whereUserid($val['start_user_id'])->first(); - if (!$info) { - continue; - } - $val['userimg'] = User::getAvatar($info->userid, $info->userimg, $info->email, $info->nickname); - } - return Base::retSuccess('success', $res); - } - - /** - * @api {post} api/approve/process/startByMyselfAll 查询我启动的流程(全部) - * - * @apiDescription 需要token身份 - * @apiVersion 1.0.0 - * @apiGroup approve - * @apiName process__startByMyselfAll - * - * @apiQuery {String} proc_def_name 流程分类 - * @apiQuery {String} state 流程状态[0全部,1审批中,2通过,3拒绝,4撤回] - * @apiQuery {Number} page 页码 - * @apiQuery {Number} page_size 每页条数 - * - * @apiSuccess {Number} ret 返回状态码(1正确、0错误) - * @apiSuccess {String} msg 返回信息(错误描述) - * @apiSuccess {Object} data 返回数据 - */ - public function process__startByMyselfAll() - { - $user = User::auth(); - $data['userid'] = (string)$user->userid; - $data['username'] = Request::input('username'); - $data['procName'] = Request::input('proc_def_name'); //分类 - $data['state'] = intval(Request::input('state')); //状态 - $data['pageIndex'] = intval(Request::input('page')); - $data['pageSize'] = intval(Request::input('page_size')); - $ret = Ihttp::ihttp_post($this->flow_url . '/api/v1/workflow/process/startByMyselfAll', json_encode($data)); - $process = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); - if (!$process || $process['status'] != 200) { - return Base::retError($process['message'] ?? '查询失败'); - } - // - $res = Base::arrayKeyToUnderline($process['data']); - foreach ($res['rows'] as &$val) { - $info = User::whereUserid($val['start_user_id'])->first(); - if (!$info) { - continue; - } - $val['userimg'] = User::getAvatar($info->userid, $info->userimg, $info->email, $info->nickname); - } - return Base::retSuccess('success', $res); - } - - /** - * @api {post} api/approve/process/startByMyself 查询我启动的流程(审批中) - * - * @apiDescription 需要token身份 - * @apiVersion 1.0.0 - * @apiGroup approve - * @apiName process__startByMyself - * - * @apiQuery {Number} page 页码 - * @apiQuery {Number} page_size 每页条数 - * - * @apiSuccess {Number} ret 返回状态码(1正确、0错误) - * @apiSuccess {String} msg 返回信息(错误描述) - * @apiSuccess {Object} data 返回数据 - */ - public function process__startByMyself() - { - $user = User::auth(); - $data['userid'] = (string)$user->userid; - $data['pageIndex'] = intval(Request::input('page')); - $data['pageSize'] = intval(Request::input('page_size')); - $ret = Ihttp::ihttp_post($this->flow_url . '/api/v1/workflow/process/startByMyself', json_encode($data)); - $process = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); - if (!$process || $process['status'] != 200) { - return Base::retError($process['message'] ?? '查询失败'); - } - // - $res = Base::arrayKeyToUnderline($process['data']); - foreach ($res['rows'] as &$val) { - $info = User::whereUserid($val['start_user_id'])->first(); - if (!$info) { - continue; - } - $val['userimg'] = User::getAvatar($info->userid, $info->userimg, $info->email, $info->nickname); - } - return Base::retSuccess('success', $res); - } - - /** - * @api {post} api/approve/process/findProcNotify 查询抄送我的流程(审批中) - * - * @apiDescription 需要token身份 - * @apiVersion 1.0.0 - * @apiGroup approve - * @apiName process__findProcNotify - * - * @apiQuery {Number} userid 用户ID - * @apiQuery {String} proc_def_name 流程分类 - * @apiQuery {String} sort 排序[asc升序,desc降序] - * @apiQuery {Number} page 页码 - * @apiQuery {Number} page_size 每页条数 - * - * @apiSuccess {Number} ret 返回状态码(1正确、0错误) - * @apiSuccess {String} msg 返回信息(错误描述) - * @apiSuccess {Object} data 返回数据 - */ - public function process__findProcNotify() - { - $user = User::auth(); - $data['userid'] = (string)$user->userid; - $data['procName'] = Request::input('proc_def_name'); - $data['sort'] = Request::input('sort'); - $data['pageIndex'] = intval(Request::input('page')); - $data['pageSize'] = intval(Request::input('page_size')); - - $ret = Ihttp::ihttp_post($this->flow_url . '/api/v1/workflow/process/findProcNotify', json_encode($data)); - $process = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); - if (!$process || $process['status'] != 200) { - return Base::retError($process['message'] ?? '查询失败'); - } - // - $res = Base::arrayKeyToUnderline($process['data']); - foreach ($res['rows'] as &$val) { - $info = User::whereUserid($val['start_user_id'])->first(); - if (!$info) { - continue; - } - $val['userimg'] = User::getAvatar($info->userid, $info->userimg, $info->email, $info->nickname); - } - return Base::retSuccess('success', $res); - } - - /** - * @api {get} api/approve/identitylink/findParticipant 查询流程实例的参与者(审批中) - * - * @apiDescription 需要token身份 - * @apiVersion 1.0.0 - * @apiGroup approve - * @apiName identitylink__findParticipant - * - * @apiQuery {Number} proc_inst_id 流程实例ID - * - * @apiSuccess {Number} ret 返回状态码(1正确、0错误) - * @apiSuccess {String} msg 返回信息(错误描述) - * @apiSuccess {Object} data 返回数据 - */ - public function identitylink__findParticipant() - { - User::auth(); - $proc_inst_id = Request::input('proc_inst_id'); - $ret = Ihttp::ihttp_get($this->flow_url . '/api/v1/workflow/identitylink/findParticipant?procInstId=' . $proc_inst_id); - $identitylink = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); - if (!$identitylink || $identitylink['status'] != 200) { - return Base::retError($identitylink['message'] ?? '查询失败'); - } - // - $res = Base::arrayKeyToUnderline($identitylink['data']); - foreach ($res as &$val) { - $info = User::whereUserid($val['userid'])->first(); - if (!$info) { - continue; - } - $val['userimg'] = User::getAvatar($info->userid, $info->userimg, $info->email, $info->nickname); - } - return Base::retSuccess('success', $res); - } - - /** - * @api {post} api/approve/procHistory/findTask 查询需要我审批的流程(已结束) - * - * @apiDescription 需要token身份 - * @apiVersion 1.0.0 - * @apiGroup approve - * @apiName procHistory__findTask - * - * @apiQuery {String} proc_def_name 流程分类 - * @apiQuery {String} sort 排序[asc升序,desc降序] - * @apiQuery {Number} page 页码 - * @apiQuery {Number} page_size 每页条数 - * - * @apiSuccess {Number} ret 返回状态码(1正确、0错误) - * @apiSuccess {String} msg 返回信息(错误描述) - * @apiSuccess {Object} data 返回数据 - */ - public function procHistory__findTask() - { - $user = User::auth(); - $data['userid'] = (string)$user->userid; - $data['username'] = Request::input('username'); - $data['procName'] = Request::input('proc_def_name'); - $data['sort'] = Request::input('sort'); - $data['pageIndex'] = intval(Request::input('page')); - $data['pageSize'] = intval(Request::input('page_size')); - $ret = Ihttp::ihttp_post($this->flow_url . '/api/v1/workflow/procHistory/findTask', json_encode(Base::arrayKeyToCamel($data))); - $process = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); - if (!$process || $process['status'] != 200) { - return Base::retError($process['message'] ?? '查询失败'); - } - // - $res = Base::arrayKeyToUnderline($process['data']); - foreach ($res['rows'] as &$val) { - $info = User::whereUserid($val['start_user_id'])->first(); - if (!$info) { - continue; - } - $val['userimg'] = User::getAvatar($info->userid, $info->userimg, $info->email, $info->nickname); - } - return Base::retSuccess('success', $res); - } - - /** - * @api {post} api/approve/procHistory/startByMyself 查询我启动的流程(已结束) - * - * @apiDescription 需要token身份 - * @apiVersion 1.0.0 - * @apiGroup approve - * @apiName procHistory__startByMyself - * - * @apiQuery {Number} page 页码 - * @apiQuery {Number} page_size 每页条数 - * - * @apiSuccess {Number} ret 返回状态码(1正确、0错误) - * @apiSuccess {String} msg 返回信息(错误描述) - * @apiSuccess {Object} data 返回数据 - */ - public function procHistory__startByMyself() - { - $user = User::auth(); - $data['userid'] = (string)$user->userid; - $data['pageIndex'] = intval(Request::input('page')); - $data['pageSize'] = intval(Request::input('page_size')); - $ret = Ihttp::ihttp_post($this->flow_url . '/api/v1/workflow/procHistory/startByMyself', json_encode($data)); - $process = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); - if (!$process || $process['status'] != 200) { - return Base::retError($process['message'] ?? '查询失败'); - } - // - $res = Base::arrayKeyToUnderline($process['data']); - foreach ($res['rows'] as &$val) { - $info = User::whereUserid($val['start_user_id'])->first(); - if (!$info) { - continue; - } - $val['userimg'] = User::getAvatar($info->userid, $info->userimg, $info->email, $info->nickname); - } - return Base::retSuccess('success', $res); - } - - /** - * @api {post} api/approve/procHistory/findProcNotify 查询抄送我的流程(已结束) - * - * @apiDescription 需要token身份 - * @apiVersion 1.0.0 - * @apiGroup approve - * @apiName procHistory__findProcNotify - * - * @apiQuery {String} proc_def_name 流程分类 - * @apiQuery {String} sort 排序[asc升序,desc降序] - * @apiQuery {Number} page 页码 - * @apiQuery {Number} page_size 每页条数 - * - * @apiSuccess {Number} ret 返回状态码(1正确、0错误) - * @apiSuccess {String} msg 返回信息(错误描述) - * @apiSuccess {Object} data 返回数据 - */ - public function procHistory__findProcNotify() - { - $user = User::auth(); - $data['userid'] = (string)$user->userid; - $data['username'] = Request::input('username'); - $data['procName'] = Request::input('proc_def_name'); - $data['sort'] = Request::input('sort'); - $data['pageIndex'] = intval(Request::input('page')); - $data['pageSize'] = intval(Request::input('page_size')); - - $ret = Ihttp::ihttp_post($this->flow_url . '/api/v1/workflow/procHistory/findProcNotify', json_encode($data)); - $process = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); - if (!$process || $process['status'] != 200) { - return Base::retError($process['message'] ?? '查询失败'); - } - // - $res = Base::arrayKeyToUnderline($process['data']); - foreach ($res['rows'] as &$val) { - $info = User::whereUserid($val['start_user_id'])->first(); - if (!$info) { - continue; - } - $val['userimg'] = User::getAvatar($info->userid, $info->userimg, $info->email, $info->nickname); - } - return Base::retSuccess('success', $res); - } - - /** - * @api {get} api/approve/identitylinkHistory/findParticipant 查询流程实例的参与者(已结束) - * - * @apiDescription 需要token身份 - * @apiVersion 1.0.0 - * @apiGroup approve - * @apiName identitylinkHistory__findParticipant - * - * @apiQuery {Number} proc_inst_id 流程实例ID - * - * @apiSuccess {Number} ret 返回状态码(1正确、0错误) - * @apiSuccess {String} msg 返回信息(错误描述) - * @apiSuccess {Object} data 返回数据 - */ - public function identitylinkHistory__findParticipant() - { - User::auth(); - $proc_inst_id = Request::input('proc_inst_id'); - $ret = Ihttp::ihttp_get($this->flow_url . '/api/v1/workflow/identitylinkHistory/findParticipant?procInstId=' . $proc_inst_id); - $identitylink = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); - if (!$identitylink || $identitylink['status'] != 200) { - return Base::retError($identitylink['message'] ?? '查询失败'); - } - // - $res = Base::arrayKeyToUnderline($identitylink['data']); - foreach ($res as &$val) { - $info = User::whereUserid($val['userid'])->first(); - if (!$info) { - continue; - } - $val['userimg'] = User::getAvatar($info->userid, $info->userimg, $info->email, $info->nickname); - } - return Base::retSuccess('success', $res); - } - - /** - * @api {get} api/approve/process/detail 根据流程ID查询流程详情 - * - * @apiDescription 需要token身份 - * @apiVersion 1.0.0 - * @apiGroup approve - * @apiName process__detail - * - * @apiQuery {Number} id 流程ID - * - * @apiSuccess {Number} ret 返回状态码(1正确、0错误) - * @apiSuccess {String} msg 返回信息(错误描述) - * @apiSuccess {Object} data 返回数据 - */ - public function process__detail() - { - User::auth(); - $data['id'] = intval(Request::input('id')); - $approve = $this->getProcessById($data['id']); - return Base::retSuccess('success', $approve); - } - - /** - * @api {post} api/approve/export 导出数据 - * - * @apiDescription 需要token身份 - * @apiVersion 1.0.0 - * @apiGroup approve - * @apiName export - * - * @apiQuery {String} proc_def_name 流程分类 - * @apiQuery {String} state 流程状态[0全部,1审批中,2通过,3拒绝,4撤回] - * @apiQuery {String} is_finished 是否完成 - * @apiQuery {Array} [date] 指定日期范围,如:['2020-12-12', '2020-12-30'] - * - * @apiSuccess {Number} ret 返回状态码(1正确、0错误) - * @apiSuccess {String} msg 返回信息(错误描述) - * @apiSuccess {Object} data 返回数据 - */ - public function export() - { - $user = User::auth('admin'); - $name = $data['procName'] = Request::input('proc_def_name'); //分类 - $data['state'] = intval(Request::input('state')); //状态 - $data['isFinished'] = intval(Request::input('is_finished')); //是否完成 - $date = Request::input('date'); - $data['startTime'] = $date[0]; //开始时间 - $data['endTime'] = Carbon::parse($date[1])->addDay()->toDateString(); //结束时间 + 1天 - // - if (empty($name) || empty($date)) { - return Base::retError('参数错误'); - } - if (!(is_array($date) && Timer::isDate($date[0]) && Timer::isDate($date[1]))) { - return Base::retError('日期选择错误'); - } - if (Carbon::parse($date[1])->timestamp - Carbon::parse($date[0])->timestamp > 35 * 86400) { - return Base::retError('日期范围限制最大35天'); - } - $botUser = User::botGetOrCreate('system-msg'); - if (empty($botUser)) { - return Base::retError('系统机器人不存在'); - } - $dialog = WebSocketDialog::checkUserDialog($botUser, $user->userid); - // - $doo = Doo::load(); - go(function () use ($doo, $data, $user, $botUser, $dialog) { - Coroutine::sleep(1); - // - $content = []; - $content[] = [ - 'content' => '导出审批数据已完成', - 'style' => 'font-weight: bold;padding-bottom: 4px;', - ]; - // - $ret = Ihttp::ihttp_post($this->flow_url . '/api/v1/workflow/process/findAllProcIns', json_encode($data)); - $process = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); - if (!$process || $process['status'] != 200) { - $content[] = [ - 'content' => $process['message'] ?? '查询失败', - 'style' => 'color: #ff0000;', - ]; - WebSocketDialogMsg::sendMsg(null, $dialog->id, 'template', [ - 'type' => 'content', - 'title' => $content[0]['content'], - 'content' => $content, - ], $botUser->userid, true, false, true); - return; - } - // - $res = Base::arrayKeyToUnderline($process['data']); - // - $headings = []; - $headings[] = $doo->translate('申请编号'); - $headings[] = $doo->translate('标题'); - $headings[] = $doo->translate('申请状态'); - $headings[] = $doo->translate('发起时间'); - $headings[] = $doo->translate('完成时间'); - $headings[] = $doo->translate('发起人工号'); - $headings[] = $doo->translate('发起人User ID'); - $headings[] = $doo->translate('发起人姓名'); - $headings[] = $doo->translate('发起人部门'); - $headings[] = $doo->translate('发起人部门ID'); - $headings[] = $doo->translate('部门负责人'); - $headings[] = $doo->translate('历史审批人'); - $headings[] = $doo->translate('历史办理人'); - $headings[] = $doo->translate('审批记录'); - $headings[] = $doo->translate('当前处理人'); - $headings[] = $doo->translate('审批节点'); - $headings[] = $doo->translate('审批人数'); - $headings[] = $doo->translate('审批耗时'); - $headings[] = $doo->translate('假期类型'); - $headings[] = $doo->translate('开始时间'); - $headings[] = $doo->translate('结束时间'); - $headings[] = $doo->translate('时长'); - $headings[] = $doo->translate('请假事由'); - $headings[] = $doo->translate('请假单位'); - // - $datas = []; - foreach ($res as $val) { - // - $nickname = Base::filterEmoji($val['start_user_name']); - $participant = $this->getUserProcessParticipantById($val['id']); // 获取参与人 - $participant = $this->handleParticipant($val, $participant['data']); // 处理参与人返回数据 - // - $job_number = ''; // 发起人工号 - $department_leader = User::userid2nickname(UserDepartment::find(1, ['owner_userid'])['owner_userid']); // 部门负责人 - $historical_approver = $participant['historical_approver'] ?? ''; // 历史审批人 - $historical_agent = ''; // 历史办理人 - $approval_record = $participant['approval_record'] ?? ''; // 审批记录 - $current_handler = !$val['is_finished'] ? implode(',', User::whereIn('userid', explode(';', $val['candidate']))->pluck('nickname')->toArray()) : ''; // 当前处理人 - $approved_node = $participant['approved_node'] ?? 0; // 审批节点 - $approved_num = $participant['approved_num'] ?? 0; // 审批人数 - // 计算审批耗时 - $startTime = Carbon::parse($val['start_time'])->timestamp; - $endTime = $val['end_time'] ? Carbon::parse($val['end_time'])->timestamp : time(); - $approval_time = $doo->translate(Timer::timeDiff($startTime, $endTime)); // 审批耗时 - // 计算时长 - $varStartTime = Carbon::parse($val['var']['start_time']); - $varEndTime = Carbon::parse($val['var']['end_time']); - $duration = $varEndTime->floatDiffInHours($varStartTime); - $duration_unit = $doo->translate('小时'); // 时长单位 - $datas[] = [ - $val['id'], // 申请编号 - $val['proc_def_name'], // 标题 - $this->getStateDescription($val['state']), // 申请状态 - $val['start_time'], // 发起时间 - $val['end_time'], // 完成时间 - $job_number, // 发起人工号 - $val['start_user_id'], // 发起人User ID - $nickname, // 发起人姓名 - $val['department'], // 发起人部门 - $val['department_id'], // 发起人部门ID - $department_leader, // 部门负责人 - $historical_approver, // 历史审批人 - $historical_agent, // 历史办理人 - $approval_record, // 审批记录 - $current_handler, // 当前处理人 - $approved_node, // 审批节点 - $approved_num, // 审批人数 - $approval_time, // 审批耗时 - $val['var']['type'], // 假期类型 - $val['var']['start_time'], // 开始时间 - $val['var']['end_time'], // 结束时间 - $duration, // 时长 - $val['var']['description'], // 请假事由 - $duration_unit, // 请假单位 - ]; - } - if (empty($datas)) { - $content[] = [ - 'content' => '没有任何数据', - 'style' => 'color: #ff0000;', - ]; - WebSocketDialogMsg::sendMsg(null, $dialog->id, 'template', [ - 'type' => 'content', - 'title' => $content[0]['content'], - 'content' => $content, - ], $botUser->userid, true, false, true); - return; - } - // - $title = $doo->translate("审批记录"); - $sheets = [ - BillExport::create()->setTitle($title)->setHeadings($headings)->setData($datas)->setStyles(["A1:Y1" => ["font" => ["bold" => true]]]) - ]; - // - $fileName = $title . '_' . Timer::time() . '.xlsx'; - $filePath = "temp/approve/export/" . date("Ym", Timer::time()); - $export = new BillMultipleExport($sheets); - $res = $export->store($filePath . "/" . $fileName); - if ($res != 1) { - $content[] = [ - 'content' => "导出失败,{$fileName}!", - 'style' => 'color: #ff0000;', - ]; - WebSocketDialogMsg::sendMsg(null, $dialog->id, 'template', [ - 'type' => 'content', - 'title' => $content[0]['content'], - 'content' => $content, - ], $botUser->userid, true, false, true); - return; - } - $xlsPath = storage_path("app/" . $filePath . "/" . $fileName); - $zipFile = "app/" . $filePath . "/" . Base::rightDelete($fileName, '.xlsx') . ".zip"; - $zipPath = storage_path($zipFile); - if (file_exists($zipPath)) { - Base::deleteDirAndFile($zipPath, true); - } - try { - Base::zipAddFiles($zipPath, $xlsPath); - } catch (\Throwable) { - } - // - if (file_exists($zipPath)) { - $key = Down::cache_encode([ - 'file' => $zipFile, - ]); - $fileUrl = Base::fillUrl('api/approve/down?key=' . $key); - WebSocketDialogMsg::sendMsg(null, $dialog->id, 'template', [ - 'type' => 'file_download', - 'title' => '导出审批数据已完成', - 'name' => $fileName, - 'size' => filesize($zipPath), - 'url' => $fileUrl, - ], $botUser->userid, true, false, true); - } else { - $content[] = [ - 'content' => "打包失败,请稍后再试...", - 'style' => 'color: #ff0000;', - ]; - WebSocketDialogMsg::sendMsg(null, $dialog->id, 'template', [ - 'type' => 'content', - 'title' => $content[0]['content'], - 'content' => $content, - ], $botUser->userid, true, false, true); - } - }); - // - WebSocketDialogMsg::sendMsg(null, $dialog->id, 'template', [ - 'type' => 'content', - 'content' => '正在导出审批数据,请稍等...', - ], $botUser->userid, true, false, true); - // - return Base::retSuccess('success'); - } - - protected function getStateDescription($state) - { - $state_map = array( - 0 => '全部', - 1 => '审批中', - 2 => '通过', - 3 => '拒绝', - 4 => '撤回' - ); - return $state_map[$state] ?? ''; - } - - /** - * @api {get} api/approve/down 下载导出的审批数据 - * - * @apiVersion 1.0.0 - * @apiGroup approve - * @apiName down - * - * @apiParam {String} key 通过export接口得到的下载钥匙 - * - * @apiSuccess {File} data 返回数据(直接下载文件) - */ - public function down() - { - $array = Down::cache_decode(); - $file = $array['file']; - if (empty($file) || !file_exists(storage_path($file))) { - return Base::ajaxError("文件不存在!", [], 0, 403); - } - return Response::download(storage_path($file)); - } - - // 处理参与人返回数据 - protected function handleParticipant($process, $participant) - { - // 如果空 - if (empty($participant)) { - return []; - } - $res = []; - $historical_approver = []; - $approved_node = 0; // 审批节点 - $approved_num = 0; // 审批人数 - foreach ($participant as $val) { - // 如果是审批人 - if ($val['type'] == 'participant') { - if ($val['step'] != 0) { - // 过滤掉空的审批意见 - if ($val['comment'] == '' || in_array($val['username'], $historical_approver)) { - continue; - } - $historical_approver = array_unique(array_merge($historical_approver, explode(',', $val['username']))); - $approved_node++; - $approved_num++; - } - // 审批记录 - $name = $val['username'] . '|'; - $call = $val['step'] == 0 ? '发起审批' . '|' : '同意' . '|'; - $time = $val['step'] == 0 ? $process['start_time'] . '|' : ''; - $comment = $val['step'] == 0 ? '' : ($val['comment'] ?? '') . '|'; - $res['approval_record'] .= $name . $call . $time . $comment; - } - } - $res['historical_approver'] = trim(implode(';', $historical_approver), ';'); - $res['approved_node'] = $approved_node; - $res['approved_num'] = $approved_num; - $res['historical_agent'] = $res['historical_approver']; - return $res; - } - - // 审批机器人消息 - protected function approveMsg($type, $dialog, $botUser, $toUser, $process, $action = null) - { - $data = [ - 'id' => $process['id'], - 'nickname' => User::userid2nickname($type == 'approve_submitter' ? $toUser['userid'] : $process['start_user_id']), - 'start_nickname' => User::userid2nickname($process['start_user_id']), - 'proc_def_name' => $process['proc_def_name'], - 'department' => $process['department'], - 'type' => $process['var']['type'], - 'start_time' => $process['var']['start_time'], - 'start_day_of_week' => '周' . Timer::getWeek(Carbon::parse($process['var']['start_time'])->timestamp), - 'end_time' => $process['var']['end_time'], - 'end_day_of_week' => '周' . Timer::getWeek(Carbon::parse($process['var']['end_time'])->timestamp), - 'description' => $process['var']['description'], - 'comment_nickname' => $process['comment_user_id'] ? User::userid2nickname($process['comment_user_id']) : '', - 'comment_content' => $process['comment_contents']['content'] ?? '', - 'comment_pictures' => $process['comment_contents']['pictures'] ?? [] - ]; - $thumb = null; - if ($type === 'approve_reviewer') { - $thumb = $process['var']['other']; - } elseif ($type === 'approve_comment_notifier') { - $thumb = $data['comment_pictures'] ? $data['comment_pictures'][0] : null; - } - if ($thumb && file_exists(public_path($thumb))) { - $imageSize = getimagesize(public_path($thumb)); - $data['thumb'] = [ - 'url' => Base::fillUrl($thumb), - 'width' => $imageSize[0], - 'height' => $imageSize[1] - ]; - } - $msgAction = null; - $msgData = [ - 'type' => $type, - 'action' => $action, - 'is_finished' => $process['is_finished'], - 'data' => $data - ]; - $msgData['title'] = match ($type) { - 'approve_reviewer' => $data['nickname'] . " 提交的「{$data['proc_def_name']}」待你审批", - 'approve_notifier' => "抄送 {$data['nickname']} 提交的「{$data['proc_def_name']}」记录", - 'approve_comment_notifier' => $data['comment_nickname'] . " 评论了 {$data['nickname']} 的「{$data['proc_def_name']}」审批", - 'approve_submitter' => $action == 'pass' ? "您发起的「{$data['proc_def_name']}」已通过" : "您发起的「{$data['proc_def_name']}」被 {$data['nickname']} 拒绝", - default => '不支持的指令', - }; - if ($action == 'withdraw' || $action == 'pass' || $action == 'refuse') { - // 任务完成,给发起人发送消息 - if ($type == 'approve_submitter' && $action != 'withdraw') { - return WebSocketDialogMsg::sendMsg($msgAction, $dialog->id, 'template', $msgData, $botUser->userid, false, false, true); - } - // 查找最后一条消息msg_id - $msgAction = 'change-' . $toUser['msg_id']; - } - // - $msg = WebSocketDialogMsg::sendMsg($msgAction, $dialog->id, 'template', $msgData, $process['start_user_id'], false, false, true); - // 关联信息 - if ($action == 'start') { - $proc_msg = new ApproveProcMsg(); - $proc_msg->proc_inst_id = $process['id']; - $proc_msg->msg_id = $msg['data']->id; - $proc_msg->userid = $toUser['userid']; - $proc_msg->save(); - } - // 更新审批 未读数量 - if ($type == 'approve_reviewer' && $toUser['userid']) { - $params = [ - 'userid' => [$toUser['userid'], User::userid()], - 'msg' => [ - 'type' => 'approve', - 'action' => 'unread', - 'userid' => $toUser['userid'], - ] - ]; - Task::deliver(new PushTask($params, false)); - } - return true; - } - - // 根据ID获取流程 - protected function getProcessById($id) - { - $data['id'] = intval($id); - $ret = Ihttp::ihttp_get($this->flow_url . "/api/v1/workflow/process/findById?" . http_build_query($data)); - $process = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); - if (!$process || $process['status'] != 200) { - throw new ApiException($process['message'] ?? '查询失败'); - } - // - $res = Base::arrayKeyToUnderline($process['data']); - $res['userids'] = []; - foreach ($res['node_infos'] as &$val) { - if (isset($val['node_user_list'])) { - $node = $val['node_user_list']; - foreach ($node as $k => &$item) { - $info = User::whereUserid($item['target_id'])->first(); - if (!$info) { - continue; - } - $val['node_user_list'][$k]['userimg'] = User::getAvatar($info->userid, $info->userimg, $info->email, $info->nickname); - $res['userids'][] = $item['target_id']; - } - } else if ($val['aprover_id']) { - $info = User::whereUserid($val['aprover_id'])->first(); - $val['userimg'] = $info ? User::getAvatar($info->userid, $info->userimg, $info->email, $info->nickname) : ''; - $res['userids'][] = $val['aprover_id']; - } - } - // 全局评论 - unset($res['global_comment']); - if (isset($res['global_comments'])) { - foreach ($res['global_comments'] as $k => $globalComment) { - $info = User::whereUserid($globalComment['user_id'])->first(); - if (!$info) { - continue; - } - $res['global_comments'][$k]['userimg'] = User::getAvatar($info->userid, $info->userimg, $info->email, $info->nickname); - $res['global_comments'][$k]['nickname'] = $info->nickname; - } - } else { - $res['global_comments'] = []; - } - $info = User::whereUserid($res['start_user_id'])->first(); - $res['userimg'] = $info ? User::getAvatar($info->userid, $info->userimg, $info->email, $info->nickname) : ''; - // - $res['userids'][] = $info->userid; - $res['userids'] = array_unique($res['userids']); - // - return $res; - } - - // 处理流程节点返回是否有抄送人 - protected function handleProcessNode($process) - { - // 获取流程节点 - $process_node = $process['node_infos']; - $notifier = []; - foreach ($process_node as $key => $val) { - if ($val['type'] == 'notifier') { - $notifier = array_merge($notifier, $val['node_user_list']); - } - // 判断到达的节点 - if ($process['node_id'] == $val['node_id']) { - break; - } - } - return array_unique($notifier, SORT_REGULAR) ?? []; - } - - // 根据ID查询流程实例的参与者(所有) - protected function getUserProcessParticipantById($id) - { - $data['procInstId'] = intval($id); - $ret = Ihttp::ihttp_get($this->flow_url . "/api/v1/workflow/identitylink/findParticipantAll?" . http_build_query($data)); - $process = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); - if (!$process || $process['status'] != 200) { - throw new ApiException($process['message'] ?? '查询失败'); - } - return $process; - } - - - /** - * @api {get} api/approve/user/status 获取用户审批状态 - * - * @apiVersion 1.0.0 - * @apiGroup approve - * @apiName user__status - * - * @apiParam {String} userid - * - * @apiSuccess {Number} ret 返回状态码(1正确、0错误) - * @apiSuccess {String} msg 返回信息(错误描述) - * @apiSuccess {Object} data 返回数据 - */ - public function user__status() - { - $userid = intval(Request::input('userid')); - $status = ApproveProcInstHistory::getUserApprovalStatus($userid); - return Base::retSuccess('success', $status); - } - - /** - * @api {get} api/approve/process/doto 查询需要我审批的流程数量 - * - * @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']); - } - -} diff --git a/app/Http/Controllers/Api/DialogController.php b/app/Http/Controllers/Api/DialogController.php index 96e0fd00a..e06ad0b49 100755 --- a/app/Http/Controllers/Api/DialogController.php +++ b/app/Http/Controllers/Api/DialogController.php @@ -1257,6 +1257,51 @@ class DialogController extends AbstractController return $result; } + /** + * @api {post} api/dialog/msg/sendapprove 发送审批通知卡片 + * + * @apiDescription 需要token身份。以「审批助手」机器人身份向指定用户发送审批模板卡片 + * (由 approve 插件调用,卡片仅展示、不与旧审批系统有数据关联)。 + * @apiVersion 1.0.0 + * @apiGroup dialog + * @apiName msg__sendapprove + * + * @apiParam {Number} to_userid 接收用户ID + * @apiParam {String} type 卡片类型:approve_reviewer / approve_notifier / approve_submitter / approve_comment_notifier + * @apiParam {String} [action] 动作:start / pass / refuse / withdraw(按类型取用) + * @apiParam {Number} [is_finished] 是否已结束(0/1) + * @apiParam {Object} data 卡片数据 + * @apiParam {String} [title] 消息标题(会话列表预览用) + */ + public function msg__sendapprove() + { + $user = User::auth(); + $toUserid = intval(Request::input('to_userid')); + $type = trim(Request::input('type')); + $action = trim(Request::input('action')); + $isFinished = intval(Request::input('is_finished')); + $data = Base::json2array(Request::input('data')); + $title = trim(Request::input('title')); + // + $allow = ['approve_reviewer', 'approve_notifier', 'approve_submitter', 'approve_comment_notifier']; + if ($toUserid <= 0 || !in_array($type, $allow)) { + return Base::retError('参数错误'); + } + $botUser = User::botGetOrCreate('approval-alert'); + $dialog = WebSocketDialog::checkUserDialog($botUser, $toUserid); + if (empty($dialog)) { + return Base::retError('无法创建对话'); + } + $msgData = [ + 'type' => $type, + 'action' => $action ?: null, + 'is_finished' => $isFinished, + 'data' => $data, + 'title' => $title, + ]; + return WebSocketDialogMsg::sendMsg(null, $dialog->id, 'template', $msgData, $botUser->userid, false, false, true); + } + /** * @api {post} api/dialog/msg/sendrecord 发送语音 * diff --git a/app/Models/ApproveProcInstHistory.php b/app/Models/ApproveProcInstHistory.php deleted file mode 100644 index 7ce6ba26b..000000000 --- a/app/Models/ApproveProcInstHistory.php +++ /dev/null @@ -1,99 +0,0 @@ -addMinute(), function () use ($userid) { - return self::where([ - ['start_user_id', '=', $userid], - [DB::raw("JSON_UNQUOTE(JSON_EXTRACT(var, '$.startTime'))"), '<=', Carbon::now()->toDateTimeString()], - [DB::raw("JSON_UNQUOTE(JSON_EXTRACT(var, '$.endTime'))"), '>=', Carbon::now()->toDateTimeString()], - ['state', '=', 2] - ])->where(function ($query) { - $query->where('proc_def_name', 'like', '%请假%') - ->orWhere('proc_def_name', 'like', '%外出%'); - })->orderByDesc('id')->value('proc_def_name'); - }); - } - - /** - * 判断用户是否请假(包含:请假、外出) - * @param $userid - * @return bool - */ - public static function userIsLeave($userid) - { - return (bool)self::getUserApprovalStatus($userid); - } -} diff --git a/app/Models/ApproveProcMsg.php b/app/Models/ApproveProcMsg.php deleted file mode 100644 index 7ac5105cd..000000000 --- a/app/Models/ApproveProcMsg.php +++ /dev/null @@ -1,34 +0,0 @@ -userid)->where('created_at', '>', Carbon::now()->subDays(3))->exists()) { continue; // 3天内没有打卡 } - if (ApproveProcInstHistory::userIsLeave($user->userid)) { - continue; // 请假、外出 - } $dialog = WebSocketDialog::checkUserDialog($botUser, $user->userid); if ($dialog) { if ($type === 'exceed') { diff --git a/config/dootask.php b/config/dootask.php index dfcecdca3..f5ff4f0f9 100644 --- a/config/dootask.php +++ b/config/dootask.php @@ -20,9 +20,6 @@ return [ // 创始人密码修改开关:设为 'disabled' 时禁止修改创始人密码(User 模型) 'password_owner' => env('PASSWORD_OWNER'), - // 审批流服务地址:审批微服务的内部访问 URL(ApproveController) - 'flow_url' => env('FLOW_URL'), - // Manticore 全文搜索服务主机(ManticoreBase) 'search_host' => env('SEARCH_HOST', 'search'), diff --git a/package.json b/package.json index eff33ac89..6e7d7bb32 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "DooTask", - "version": "1.7.90", + "version": "1.7.91", "codeVerson": 237, "description": "DooTask is task management system.", "scripts": { diff --git a/resources/assets/js/App.vue b/resources/assets/js/App.vue index e8b24bd4f..0a1331047 100755 --- a/resources/assets/js/App.vue +++ b/resources/assets/js/App.vue @@ -447,7 +447,6 @@ export default { '/api/dialog/msg/download', // 会话文件 '/api/project/task/filedown', // 任务文件 '/api/file/download/pack', // 文件打包下载 - '/api/approve/down', // 审批导出下载 '/api/project/task/down', // 任务导出下载 '/api/system/checkin/down' // 签到导出下载 ]; diff --git a/resources/assets/js/components/Mobile/Tabbar.vue b/resources/assets/js/components/Mobile/Tabbar.vue index 2cb2c8b99..873392a7f 100644 --- a/resources/assets/js/components/Mobile/Tabbar.vue +++ b/resources/assets/js/components/Mobile/Tabbar.vue @@ -18,7 +18,7 @@ @@ -54,7 +54,7 @@ export default { }, computed: { - ...mapState(['cacheDialogs', 'reportUnreadNumber', 'approveUnreadNumber']), + ...mapState(['cacheDialogs', 'reportUnreadNumber']), ...mapGetters(['dashboardTask']), /** @@ -138,7 +138,7 @@ export default { }, activeName() { - if (['manage-calendar', 'manage-file', 'manage-setting', 'manage-application', 'manage-approve'].includes(this.routeName)) { + if (['manage-calendar', 'manage-file', 'manage-setting', 'manage-application'].includes(this.routeName)) { return 'application'; } diff --git a/resources/assets/js/pages/manage.vue b/resources/assets/js/pages/manage.vue index 2b91265b7..68d7111d2 100644 --- a/resources/assets/js/pages/manage.vue +++ b/resources/assets/js/pages/manage.vue @@ -82,7 +82,6 @@ {{$L('团队管理')}} {{$L('导出任务统计')}} {{$L('导出超期任务')}} - {{$L('导出审批数据')}} {{$L('导出签到数据')}} @@ -126,10 +125,6 @@ v-else-if="item.path === 'workReport' && reportUnreadNumber > 0" class="manage-menu-report-badge" :count="reportUnreadNumber"/> - @@ -162,7 +157,7 @@
  • - +
  • @@ -389,9 +384,6 @@ - - - @@ -457,16 +449,6 @@ - - - - - - - - - - @@ -495,14 +477,11 @@ import DialogModal from "./manage/components/DialogModal"; import TaskModal from "./manage/components/TaskModal"; import CheckinExport from "./manage/components/CheckinExport"; import TaskExport from "./manage/components/TaskExport"; -import ApproveExport from "./manage/components/ApproveExport"; import ComplaintManagement from "./manage/components/ComplaintManagement"; import MicroApps from "../components/MicroApps"; import ResizeLine from "../components/ResizeLine.vue"; import UserSelect from "../components/UserSelect.vue"; import ImgUpload from "../components/ImgUpload.vue"; -import Approve from "./manage/approve/index.vue"; -import ApproveDetails from "./manage/approve/details.vue"; import notificationKoro from "notification-koro1"; import emitter from "../store/events"; import SearchBox from "../components/SearchBox.vue"; @@ -514,14 +493,11 @@ import DepartmentOwnerView from "./manage/components/DepartmentOwnerView.vue"; export default { components: { - Approve, SearchBox, - ApproveDetails, ImgUpload, UserSelect, TaskExport, CheckinExport, - ApproveExport, TaskModal, DialogModal, MobileTabbar, @@ -568,7 +544,6 @@ export default { exportTaskShow: false, exportCheckinShow: false, - exportApproveShow: false, projectKeyValue: '', projectKeyLoading: 0, @@ -600,10 +575,6 @@ export default { complaintShow: false, - approveShow: false, - approveDetails: {id: 0}, - approveDetailsShow: false, - taskBrowseLoading: false, taskBrowseHistory: [], @@ -621,7 +592,6 @@ export default { emitter.on('addTask', this.onAddTask); emitter.on('createGroup', this.onCreateGroup); emitter.on('dialogMsgPush', this.addDialogMsg); - emitter.on('approveDetails', this.openApproveDetails); emitter.on('openReport', this.openReport); emitter.on('openFavorite', this.openFavorite); emitter.on('openRecent', this.openRecent); @@ -634,14 +604,12 @@ export default { this.$store.dispatch("getUserInfo").catch(_ => {}) this.$store.dispatch("getTaskPriority", 1000) this.$store.dispatch("getReportUnread", 1000) - this.$store.dispatch("getApproveUnread", 1000) }, beforeDestroy() { emitter.off('addTask', this.onAddTask); emitter.off('createGroup', this.onCreateGroup); emitter.off('dialogMsgPush', this.addDialogMsg); - emitter.off('approveDetails', this.openApproveDetails); emitter.off('openReport', this.openReport); emitter.off('openFavorite', this.openFavorite); emitter.off('openRecent', this.openRecent); @@ -671,7 +639,6 @@ export default { 'clientDownloadUrl', 'reportUnreadNumber', - 'approveUnreadNumber', 'dialogIns', 'formOptions', @@ -1112,9 +1079,6 @@ export default { case 'exportCheckin': this.exportCheckinShow = true; return; - case 'exportApprove': - this.exportApproveShow = true; - return; case 'workReport': this.openReport(this.reportUnreadNumber > 0 ? 'receive' : 'my'); return; @@ -1132,11 +1096,6 @@ export default { $A.reloadUrl() }); return; - case 'approve': - if (this.menu.findIndex((m) => m.path == path) > -1) { - this.goForward({name: 'manage-approve'}); - } - return; case 'complaint': this.complaintShow = true; return; @@ -1201,10 +1160,7 @@ export default { }, classNameRoute(path) { - let name = this.routeName - if (name == 'manage-approve') { - name = `manage-application` - } + const name = this.routeName return { "active": name === `manage-${path}`, }; @@ -1678,13 +1634,6 @@ export default { } }, - openApproveDetails(id) { - this.approveDetailsShow = true; - this.$nextTick(() => { - this.approveDetails = {id}; - }) - }, - openReport(tab) { this.workReportTab = tab; this.workReportShow = true; @@ -1706,9 +1655,6 @@ export default { case 'overdue': this.exportOverdueTask(); break; - case 'approve': - this.exportApproveShow = true; - break; case 'checkin': this.exportCheckinShow = true; break; @@ -1776,9 +1722,6 @@ export default { onTabbarClick(act, params = '') { switch (act) { - case 'approve': - this.approveShow = true - break; case 'createGroup': this.onAddMenu('group') break; diff --git a/resources/assets/js/pages/manage/application.vue b/resources/assets/js/pages/manage/application.vue index cb0418dd0..afb90fa0b 100644 --- a/resources/assets/js/pages/manage/application.vue +++ b/resources/assets/js/pages/manage/application.vue @@ -97,7 +97,6 @@ v-if="!sortingMode" @click.stop="handleCardClick(card, 'badge')" class="apply-box-top-report"> - @@ -528,7 +527,6 @@ export default { 'userInfo', 'userIsAdmin', 'reportUnreadNumber', - 'approveUnreadNumber', 'cacheDialogs', 'windowOrientation', 'windowPortrait', @@ -543,7 +541,6 @@ export default { applyList() { const list = [ // 常用应用 - {value: "approve", label: "审批中心", sort: 30, show: this.microAppsIds.includes('approve')}, {value: "favorite", label: "我的收藏", sort: 45}, {value: "recent", label: "最近打开", sort: 47}, {value: "report", label: "工作报告", sort: 50}, @@ -985,7 +982,6 @@ export default { const list = [ {label: this.$L('导出任务统计'), value: 'task'}, {label: this.$L('导出超期任务'), value: 'overdue'}, - {label: this.$L('导出审批数据'), value: 'approve'}, {label: this.$L('导出签到数据'), value: 'checkin'}, ]; this.$store.commit('menu/operation', { @@ -1037,9 +1033,6 @@ export default { showBadge(item, type) { let num = 0; switch (type) { - case 'approve': - num = this.approveUnreadNumber; - break; case 'report': num = this.reportUnreadNumber; break; diff --git a/resources/assets/js/pages/manage/approve/details.vue b/resources/assets/js/pages/manage/approve/details.vue deleted file mode 100644 index 03d1b3005..000000000 --- a/resources/assets/js/pages/manage/approve/details.vue +++ /dev/null @@ -1,550 +0,0 @@ - - - diff --git a/resources/assets/js/pages/manage/approve/index.vue b/resources/assets/js/pages/manage/approve/index.vue deleted file mode 100644 index 0403033aa..000000000 --- a/resources/assets/js/pages/manage/approve/index.vue +++ /dev/null @@ -1,739 +0,0 @@ - - - - - diff --git a/resources/assets/js/pages/manage/approve/list.vue b/resources/assets/js/pages/manage/approve/list.vue deleted file mode 100644 index 1cc73f687..000000000 --- a/resources/assets/js/pages/manage/approve/list.vue +++ /dev/null @@ -1,46 +0,0 @@ - - - - diff --git a/resources/assets/js/pages/manage/approve/setting.vue b/resources/assets/js/pages/manage/approve/setting.vue deleted file mode 100644 index 2106d0f30..000000000 --- a/resources/assets/js/pages/manage/approve/setting.vue +++ /dev/null @@ -1,176 +0,0 @@ - - - - - diff --git a/resources/assets/js/pages/manage/components/ApproveExport.vue b/resources/assets/js/pages/manage/components/ApproveExport.vue deleted file mode 100644 index 163e33097..000000000 --- a/resources/assets/js/pages/manage/components/ApproveExport.vue +++ /dev/null @@ -1,124 +0,0 @@ - - - diff --git a/resources/assets/js/pages/manage/components/DialogView/template/approve-comment-notifier.vue b/resources/assets/js/pages/manage/components/DialogView/template/approve-comment-notifier.vue index c3812efbd..3a2caa014 100644 --- a/resources/assets/js/pages/manage/components/DialogView/template/approve-comment-notifier.vue +++ b/resources/assets/js/pages/manage/components/DialogView/template/approve-comment-notifier.vue @@ -7,9 +7,6 @@

    {{ msg.data.comment_content }}

    -
    - -
    diff --git a/resources/assets/js/pages/manage/components/DialogView/template/approve-notifier.vue b/resources/assets/js/pages/manage/components/DialogView/template/approve-notifier.vue index cd7e30fb6..2f181e84c 100644 --- a/resources/assets/js/pages/manage/components/DialogView/template/approve-notifier.vue +++ b/resources/assets/js/pages/manage/components/DialogView/template/approve-notifier.vue @@ -2,16 +2,13 @@
    {{ $L(`抄送 ${msg.data.nickname} 提交的「${msg.data.proc_def_name}」记录`) }}
    +

    {{$L("状态")}}:{{ msg.is_finished ? $L("已完成") : $L("审批中") }}

    {{$L("申请人")}}:@{{ msg.data.nickname }} {{ msg.data.department }}

    {{$L("详情")}} -

    {{$L("假期类型")}}:{{ $L(msg.data.type) }}

    -

    {{$L("开始时间")}}:{{ msg.data.start_time }} ({{ $L(msg.data.start_day_of_week) }})

    -

    {{$L("结束时间")}}:{{ msg.data.end_time }} ({{ $L(msg.data.end_day_of_week) }})

    -

    {{$L("事由")}}:{{ msg.data.description }}

    -
    -
    - - +

    {{$L("类型")}}:{{ $L(msg.data.type) }}

    +

    {{$L("开始时间")}}:{{ msg.data.start_time }}

    +

    {{$L("结束时间")}}:{{ msg.data.end_time }}

    +

    {{$L("事由")}}:{{ msg.data.description }}

    diff --git a/resources/assets/js/pages/manage/components/DialogView/template/approve-reviewer.vue b/resources/assets/js/pages/manage/components/DialogView/template/approve-reviewer.vue index f0583d978..c798ebf7a 100644 --- a/resources/assets/js/pages/manage/components/DialogView/template/approve-reviewer.vue +++ b/resources/assets/js/pages/manage/components/DialogView/template/approve-reviewer.vue @@ -2,23 +2,15 @@
    {{ $L(`${msg.data.nickname} 提交的「${msg.data.proc_def_name}」待你审批`) }}
    +

    {{$L("状态")}}:{{ $L(statusText) }}

    {{$L("申请人")}}:@{{ msg.data.nickname }} {{ msg.data.department }}

    {{$L("详情")}} -

    {{$L("假期类型")}}:{{ $L(msg.data.type) }}

    -

    {{$L("开始时间")}}:{{ msg.data.start_time }} ({{ $L(msg.data.start_day_of_week) }})

    -

    {{$L("结束时间")}}:{{ msg.data.end_time }} ({{ $L(msg.data.end_day_of_week) }})

    -

    {{$L("事由")}}:{{ msg.data.description }}

    +

    {{$L("类型")}}:{{ $L(msg.data.type) }}

    +

    {{$L("开始时间")}}:{{ msg.data.start_time }}

    +

    {{$L("结束时间")}}:{{ msg.data.end_time }}

    +

    {{$L("事由")}}:{{ msg.data.description }}

    -
    - - - - -
    @@ -30,6 +22,16 @@ export default { data() { return {}; }, + computed: { + statusText({msg}) { + switch (msg.action) { + case 'pass': return '已同意'; + case 'refuse': return '已拒绝'; + case 'withdraw': return '已撤销'; + default: return '待审批'; + } + }, + }, methods: { imageHtml(info) { const data = $A.imageRatioHandle({ diff --git a/resources/assets/js/pages/manage/components/DialogView/template/approve-submitter.vue b/resources/assets/js/pages/manage/components/DialogView/template/approve-submitter.vue index 3f71f1413..56ea0b9f3 100644 --- a/resources/assets/js/pages/manage/components/DialogView/template/approve-submitter.vue +++ b/resources/assets/js/pages/manage/components/DialogView/template/approve-submitter.vue @@ -2,17 +2,13 @@
    {{ $L(title) }}
    +

    {{$L("状态")}}:{{ $L(statusText) }}

    {{$L("申请人")}}:@{{ msg.data.start_nickname }} {{ msg.data.department }}

    {{$L("详情")}} -

    {{$L("假期类型")}}:{{ $L(msg.data.type) }}

    -

    {{$L("开始时间")}}:{{ msg.data.start_time }} ({{ $L(msg.data.start_day_of_week) }})

    -

    {{$L("结束时间")}}:{{ msg.data.end_time }} ({{ $L(msg.data.end_day_of_week) }})

    -

    {{$L("事由")}}:{{ msg.data.description }}

    -
    -
    - - - +

    {{$L("类型")}}:{{ $L(msg.data.type) }}

    +

    {{$L("开始时间")}}:{{ msg.data.start_time }}

    +

    {{$L("结束时间")}}:{{ msg.data.end_time }}

    +

    {{$L("事由")}}:{{ msg.data.description }}

    @@ -28,7 +24,15 @@ export default { computed: { title({msg}) { return msg.action === 'pass' ? `您发起的「${msg.data.proc_def_name}」已通过` : `您发起的「${msg.data.proc_def_name}」被 ${msg.data.nickname} 拒绝` - } + }, + statusText({msg}) { + switch (msg.action) { + case 'pass': return '已通过'; + case 'refuse': return '已拒绝'; + case 'withdraw': return '已撤销'; + default: return '处理中'; + } + }, }, methods: {}, } diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index 85c9b89ab..1f6963dcc 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -44,7 +44,6 @@

    ({{peopleNum}}) {{$L('机器人')}} - {{$L(approvaUserStatus)}} {{$L('全员')}} {{$L('部门')}}
    @@ -915,8 +914,6 @@ export default { scrollIng: 0, scrollGroup: null, - approvaUserStatus: '', - observers: [], msgChangeCache: {}, @@ -1664,8 +1661,6 @@ export default { if (this.autoFocus) { this.inputFocus() } - // - this.getUserApproveStatus() }, /** @@ -3822,10 +3817,6 @@ export default { this.handleOpenMicroApp(clickElement); return; } - if (clickElement.classList.contains('open-approve-details')) { - emitter.emit('approveDetails', clickElement.getAttribute("data-id")); - return; - } clickElement = clickElement.parentElement; } @@ -4565,27 +4556,6 @@ export default { }); }, - async getUserApproveStatus() { - this.approvaUserStatus = '' - if (this.dialogData.type !== 'user' || this.dialogData.bot) { - return - } - const isInstalled = await this.$store.dispatch("isMicroAppInstalled", 'approve'); - if (!isInstalled) { - return - } - this.$store.dispatch("call", { - url: 'approve/user/status', - data: { - userid: this.dialogData.dialog_user.userid, - } - }).then(({data}) => { - this.approvaUserStatus = data; - }).catch(({msg}) => { - $A.messageError(msg); - }); - }, - async shakeToMsgId(id) { try { const element = await $A.findElementWithRetry(() => this.$refs.scroller.$el.querySelector(`[data-id="${id}"]`)?.querySelector(".dialog-head")); diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js index ce3375b3a..c1515f446 100644 --- a/resources/assets/js/store/actions.js +++ b/resources/assets/js/store/actions.js @@ -648,7 +648,6 @@ export default { dispatch("getDialogTodo", 0).catch(() => {}); dispatch("getTaskPriority", 1000); dispatch("getReportUnread", 1000); - dispatch("getApproveUnread", 1000); dispatch("getProjectsForDepartmentOwnerView").catch(() => {}); dispatch("getTaskForDashboard"); dispatch("dialogMsgRead"); @@ -679,34 +678,6 @@ export default { }, typeof timeout === "number" ? timeout : 1000) }, - /** - * 获取审批待办未读数量 - * @param state - * @param dispatch - * @param timeout - */ - getApproveUnread({state, dispatch}, timeout) { - window.__getApproveUnread && clearTimeout(window.__getApproveUnread) - window.__getApproveUnread = setTimeout(() => { - if (state.userId === 0) { - state.approveUnreadNumber = 0; - } else { - dispatch("call", { - url: 'approve/process/doto' - }).then(({data}) => { - state.approveUnreadNumber = data.total || 0; - }).catch(({msg}) => { - if( msg.indexOf("404 not found") !== -1){ - $A.modalInfo({ - title: '版本过低', - content: '服务器版本过低,请升级服务器。', - }) - } - }); - } - }, typeof timeout === "number" ? timeout : 1000) - }, - /** * 获取/更新会员信息 * @param dispatch @@ -5026,17 +4997,6 @@ export default { } })(msgDetail); break; - - /** - * 流程审批 - */ - case "approve": - (function ({action}) { - if (action == 'unread') { - dispatch("getApproveUnread", 1000) - } - })(msgDetail); - break; } break } diff --git a/resources/assets/js/store/state.js b/resources/assets/js/store/state.js index a52d600c3..8501dac63 100644 --- a/resources/assets/js/store/state.js +++ b/resources/assets/js/store/state.js @@ -272,9 +272,6 @@ export default { // 系统设置 systemConfig: {}, - // 审批待办未读数量 - approveUnreadNumber: 0, - // 会议 meetingWindow: { show: false, diff --git a/resources/assets/sass/pages/components/dialog-wrapper.scss b/resources/assets/sass/pages/components/dialog-wrapper.scss index ddc4d1878..62f6fb828 100644 --- a/resources/assets/sass/pages/components/dialog-wrapper.scss +++ b/resources/assets/sass/pages/components/dialog-wrapper.scss @@ -1523,7 +1523,6 @@ } .cause { - border-bottom: 1px solid #e3e3e3; border-top: 1px solid #e3e3e3; padding-bottom: 10px; margin-top: 10px; diff --git a/routes/web.php b/routes/web.php index 9ebb48aca..012c65197 100644 --- a/routes/web.php +++ b/routes/web.php @@ -9,7 +9,6 @@ use App\Http\Controllers\Api\DialogController; use App\Http\Controllers\Api\PublicController; use App\Http\Controllers\Api\ReportController; use App\Http\Controllers\Api\SystemController; -use App\Http\Controllers\Api\ApproveController; use App\Http\Controllers\Api\AssistantController; use App\Http\Controllers\Api\ProjectController; use App\Http\Controllers\Api\ComplaintController; @@ -52,9 +51,6 @@ Route::prefix('api')->middleware(['webapi'])->group(function () { // 公开接口 Route::any('public/{method}', PublicController::class); Route::any('public/{method}/{action}', PublicController::class); - // 审批 - Route::any('approve/{method}', ApproveController::class); - Route::any('approve/{method}/{action}', ApproveController::class); // 助手 Route::any('assistant/{method}', AssistantController::class); Route::any('assistant/{method}/{action}', AssistantController::class);