diff --git a/app/Http/Controllers/Api/ApproveController.php b/app/Http/Controllers/Api/ApproveController.php index ae80dfd61..828abff95 100755 --- a/app/Http/Controllers/Api/ApproveController.php +++ b/app/Http/Controllers/Api/ApproveController.php @@ -262,7 +262,7 @@ class ApproveController extends AbstractController $this->approveMsg('approve_reviewer', $dialog, $botUser, $val, $process, $pass); } // 发起人 - if ($process['is_finished'] == true) { + 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); @@ -284,7 +284,7 @@ class ApproveController extends AbstractController } // 抄送人 - $notifier = $this->handleProcessNode($process, $task['step']); + $notifier = $this->handleProcessNode($process); if ($notifier && $pass == 'pass') { foreach ($notifier as $val) { $dialog = WebSocketDialog::checkUserDialog($botUser, $val['target_id']); @@ -899,7 +899,7 @@ class ApproveController extends AbstractController 3 => '拒绝', 4 => '撤回' ); - return isset($state_map[$state]) ? $state_map[$state] : ''; + return $state_map[$state] ?? ''; } /** @@ -986,21 +986,24 @@ class ApproveController extends AbstractController 'comment_content' => $process['comment_contents']['content'] ?? '', 'comment_pictures' => $process['comment_contents']['pictures'] ?? [] ]; - $text = view('push.bot', ['type' => $type, 'action' => $action, 'is_finished' => $process['is_finished'], 'data' => (object)$data])->render(); - $text = preg_replace("/^\x20+/", "", $text); - $text = preg_replace("/\n\x20+/", "\n", $text); $msg_action = null; + $msg_data = [ + 'type' => $type, + 'action' => $action, + 'is_finished' => $process['is_finished'], + 'data' => $data + ]; if ($action == 'withdraw' || $action == 'pass' || $action == 'refuse') { // 任务完成,给发起人发送消息 if ($type == 'approve_submitter' && $action != 'withdraw') { - return WebSocketDialogMsg::sendMsg($msg_action, $dialog->id, 'text', ['text' => $text, 'approve_type' => $type], $botUser->userid, false, false, true); + return WebSocketDialogMsg::sendMsg($msg_action, $dialog->id, 'template', $msg_data, $botUser->userid, false, false, true); } // 查找最后一条消息msg_id $msg_action = 'change-' . $toUser['msg_id']; } // try { - $msg = WebSocketDialogMsg::sendMsg($msg_action, $dialog->id, 'text', ['text' => $text, 'approve_type' => $type], $process['start_user_id'], false, false, true); + $msg = WebSocketDialogMsg::sendMsg($msg_action, $dialog->id, 'template', $msg_data, $process['start_user_id'], false, false, true); // 关联信息 if ($action == 'start') { $proc_msg = new ApproveProcMsg(); @@ -1022,7 +1025,7 @@ class ApproveController extends AbstractController Task::deliver(new PushTask($params, false)); } } catch (\Throwable $th) { - //throw $th; + info($th->getMessage()); } return true; } @@ -1126,7 +1129,7 @@ class ApproveController extends AbstractController $ret = Ihttp::ihttp_get($this->flow_url . '/api/v1/workflow/process/getUserApprovalStatus?' . http_build_query($data)); $procdef = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); if (isset($procdef['status']) && $procdef['status'] == 200) { - return Base::retSuccess('success', isset($procdef['data']["proc_def_name"]) ? $procdef['data']["proc_def_name"] : ''); + return Base::retSuccess('success', $procdef['data']["proc_def_name"] ?? ''); } return Base::retSuccess('success', ''); } diff --git a/app/Models/User.php b/app/Models/User.php index d6f49158b..b1722c946 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -578,7 +578,7 @@ class User extends AbstractModel case 'ai-gemini@bot.system': return url("images/avatar/default_gemini.png"); case 'ai-zhipu@bot.system': - return url("images/avatar/default_zhipu.png"); + return url("images/avatar/default_zhipu.png"); case 'bot-manager@bot.system': return url("images/avatar/default_bot.png"); case 'meeting-alert@bot.system': @@ -651,7 +651,9 @@ class User extends AbstractModel ])->save(); } // - $update['nickname'] = UserBot::systemBotName($email); + if (empty($update['nickname'])) { + $update['nickname'] = UserBot::systemBotName($email); + } } if ($update) { $botUser->updateInstance($update); diff --git a/app/Models/WebSocketDialogMsg.php b/app/Models/WebSocketDialogMsg.php index f3ede65fc..7232242ce 100644 --- a/app/Models/WebSocketDialogMsg.php +++ b/app/Models/WebSocketDialogMsg.php @@ -949,7 +949,7 @@ class WebSocketDialogMsg extends AbstractModel ]; } } else { - if ($dialogMsg->type !== 'text') { + if (!in_array($dialogMsg->type, ['text', 'template'])) { throw new ApiException('此消息不支持此操作'); } if ($dialogMsg->userid != $sender) { diff --git a/app/Tasks/BotReceiveMsgTask.php b/app/Tasks/BotReceiveMsgTask.php index 5fb63ba37..156abc394 100644 --- a/app/Tasks/BotReceiveMsgTask.php +++ b/app/Tasks/BotReceiveMsgTask.php @@ -340,19 +340,13 @@ class BotReceiveMsgTask extends AbstractTask break; } // - $text = view('push.bot', [ + WebSocketDialogMsg::sendMsg(null, $msg->dialog_id, 'template', [ 'type' => $type, 'data' => $data, 'notice' => $notice, 'manager' => $isManager, 'version' => Base::getVersion() - ])->render(); - if (!$isManager) { - $text = preg_replace("/\s*\{机器人ID\}/", "", $text); - } - $text = preg_replace("/^\x20+/", "", $text); - $text = preg_replace("/\n\x20+/", "\n", $text); - WebSocketDialogMsg::sendMsg(null, $msg->dialog_id, 'text', ['text' => $text], $botUser->userid, false, false, true); // todo 未能在任务end事件来发送任务 + ], $botUser->userid, false, false, true); // todo 未能在任务end事件来发送任务 } } @@ -471,7 +465,7 @@ class BotReceiveMsgTask extends AbstractTask && !Base::judgeClientVersion("0.29.11", $this->client['version'])) { $error = 'The client version is low (required version ≥ v0.29.12).'; } - break; + break; // 其他机器人 default: $userBot = UserBot::whereBotId($botUser->userid)->first(); diff --git a/language/original-web.txt b/language/original-web.txt index 35671c548..ace45b64b 100644 --- a/language/original-web.txt +++ b/language/original-web.txt @@ -1614,5 +1614,5 @@ License Key 返回参数错误 未知错误 -网络异常 -请求失败 +网络异常,请重试。 +请求失败,请重试。 diff --git a/resources/assets/js/pages/manage.vue b/resources/assets/js/pages/manage.vue index a7a00498c..2562b31c3 100644 --- a/resources/assets/js/pages/manage.vue +++ b/resources/assets/js/pages/manage.vue @@ -333,6 +333,11 @@ + + + + + @@ -361,10 +366,13 @@ import {Store} from "le5le-store"; import {MarkdownPreview} from "../store/markdown"; import UserSelect from "../components/UserSelect.vue"; import ImgUpload from "../components/ImgUpload.vue"; +import ApproveDetails from "./manage/approve/details.vue"; export default { components: { - ImgUpload, UserSelect, + ApproveDetails, + ImgUpload, + UserSelect, TaskExport, CheckinExport, ApproveExport, @@ -443,6 +451,10 @@ export default { needStartHome: false, complaintShow: false, + + approveDetails: {id: 0}, + approveDetailsShow: false, + approveDetailsSubscribe: null, } }, @@ -452,6 +464,7 @@ export default { this.addTaskSubscribe = Store.subscribe('addTask', this.onAddTask); this.createGroupSubscribe = Store.subscribe('createGroup', this.onCreateGroup); this.dialogMsgSubscribe = Store.subscribe('dialogMsgPush', this.addDialogMsg); + this.approveDetailsSubscribe = Store.subscribe('approveDetails', this.openApproveDetails); // document.addEventListener('keydown', this.shortcutEvent); }, @@ -482,6 +495,10 @@ export default { this.dialogMsgSubscribe.unsubscribe(); this.dialogMsgSubscribe = null; } + if (this.approveDetailsSubscribe) { + this.approveDetailsSubscribe.unsubscribe(); + this.approveDetailsSubscribe = null; + } // document.removeEventListener('keydown', this.shortcutEvent); }, @@ -1135,6 +1152,13 @@ export default { } }, + openApproveDetails(id) { + this.approveDetailsShow = true; + this.$nextTick(() => { + this.approveDetails = {id}; + }) + }, + handleLongpress(event, el) { const projectId = $A.getAttr(el, 'data-id') const projectItem = this.projectLists.find(item => item.id == projectId) diff --git a/resources/assets/js/pages/manage/approve/details.vue b/resources/assets/js/pages/manage/approve/details.vue index 01cf561ff..20f33a2d0 100644 --- a/resources/assets/js/pages/manage/approve/details.vue +++ b/resources/assets/js/pages/manage/approve/details.vue @@ -2,7 +2,7 @@
-
+

{{$L('审批详情')}}

@@ -279,6 +279,10 @@ export default { this.getInfo() } }, + // 返回 + onBack() { + this.$emit('onBack') + }, // 把时间转成几小时前 getTimeAgo(time, type) { const timeDiff = $A.dayjs().unix() - $A.dayjs(time).unix(); // convert to seconds diff --git a/resources/assets/js/pages/manage/approve/index.vue b/resources/assets/js/pages/manage/approve/index.vue index 544744996..1d99559fb 100644 --- a/resources/assets/js/pages/manage/approve/index.vue +++ b/resources/assets/js/pages/manage/approve/index.vue @@ -251,6 +251,7 @@ import ImgUpload from "../../../components/ImgUpload"; import ApproveSetting from "./setting"; import ApproveExport from "../components/ApproveExport"; import {mapState} from 'vuex' +import {Store} from "le5le-store"; export default { components: {list, listDetails, DrawerOverlay, ImgUpload, ApproveSetting, ApproveExport}, @@ -491,7 +492,7 @@ export default { }) // if (window.innerWidth < 426) { - this.goForward({name: 'manage-approve-details', query: {id: item.id}}); + Store.set('approveDetails', item.id); return; } if (window.innerWidth < 1010) { diff --git a/resources/assets/js/pages/manage/components/DialogItem.vue b/resources/assets/js/pages/manage/components/DialogItem.vue index 62e153637..fc6c9bc39 100644 --- a/resources/assets/js/pages/manage/components/DialogItem.vue +++ b/resources/assets/js/pages/manage/components/DialogItem.vue @@ -51,6 +51,7 @@ @on-view-text="onViewText" @on-view-file="onViewFile" @on-down-file="onDownFile" + @on-click-template="onClickTemplate" @on-reply-list="onReplyList" @on-error="onError" @on-emoji="onEmoji" @@ -252,6 +253,10 @@ export default { this.dispatch("on-down-file", data) }, + onClickTemplate(e) { + this.dispatch("on-click-template", e) + }, + onReplyList(data) { this.dispatch("on-reply-list", data) }, diff --git a/resources/assets/js/pages/manage/components/DialogView/index.vue b/resources/assets/js/pages/manage/components/DialogView/index.vue index ca4a0d93b..05aa4b8e7 100644 --- a/resources/assets/js/pages/manage/components/DialogView/index.vue +++ b/resources/assets/js/pages/manage/components/DialogView/index.vue @@ -26,7 +26,7 @@
- + @@ -37,6 +37,8 @@ + + @@ -179,6 +181,7 @@ import RecordMsg from "./record.vue"; import MeetingMsg from "./meet.vue"; import WordChainMsg from "./word-chain.vue"; import VoteMsg from "./vote.vue"; +import TemplateMsg from "./template"; import LoadMsg from "./load.vue"; import UnknownMsg from "./unknown.vue"; @@ -187,6 +190,7 @@ export default { components: { UnknownMsg, LoadMsg, + TemplateMsg, VoteMsg, WordChainMsg, MeetingMsg, @@ -538,14 +542,6 @@ export default { this.$emit("on-show-emoji-user", item) }, - onWordChain() { - this.$store.state.dialogDroupWordChain = { - type: 'participate', - dialog_id: this.msgData.dialog_id, - msgData: this.msgData, - } - }, - unfoldWordChain(msg) { if (this.unfoldWordChainData.indexOf(msg.id) == -1) { const data = JSON.parse(window.localStorage.getItem('__cache:unfoldWordChain__')) || []; @@ -555,6 +551,14 @@ export default { } }, + onWordChain() { + this.$store.state.dialogDroupWordChain = { + type: 'participate', + dialog_id: this.msgData.dialog_id, + msgData: this.msgData, + } + }, + onVote(type, msgData) { if (type != 'vote') { $A.modalConfirm({ @@ -594,6 +598,10 @@ export default { this.$set(msgData.msg, '_loadIng', 0) }); }, + + clickTemplate(e) { + this.$emit("on-click-template", e) + }, } } 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 new file mode 100644 index 000000000..b0194deea --- /dev/null +++ b/resources/assets/js/pages/manage/components/DialogView/template/approve-comment-notifier.vue @@ -0,0 +1,32 @@ + + + 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 new file mode 100644 index 000000000..2861803e7 --- /dev/null +++ b/resources/assets/js/pages/manage/components/DialogView/template/approve-notifier.vue @@ -0,0 +1,30 @@ + + + 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 new file mode 100644 index 000000000..6f870cae5 --- /dev/null +++ b/resources/assets/js/pages/manage/components/DialogView/template/approve-reviewer.vue @@ -0,0 +1,35 @@ + + + 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 new file mode 100644 index 000000000..c1e6fa0dd --- /dev/null +++ b/resources/assets/js/pages/manage/components/DialogView/template/approve-submitter.vue @@ -0,0 +1,35 @@ + + + diff --git a/resources/assets/js/pages/manage/components/DialogView/template/bot-api.vue b/resources/assets/js/pages/manage/components/DialogView/template/bot-api.vue new file mode 100644 index 000000000..d109c116c --- /dev/null +++ b/resources/assets/js/pages/manage/components/DialogView/template/bot-api.vue @@ -0,0 +1,42 @@ + + + diff --git a/resources/assets/js/pages/manage/components/DialogView/template/bot-clearday.vue b/resources/assets/js/pages/manage/components/DialogView/template/bot-clearday.vue new file mode 100644 index 000000000..673ad7df2 --- /dev/null +++ b/resources/assets/js/pages/manage/components/DialogView/template/bot-clearday.vue @@ -0,0 +1,24 @@ + + + diff --git a/resources/assets/js/pages/manage/components/DialogView/template/bot-deletebot.vue b/resources/assets/js/pages/manage/components/DialogView/template/bot-deletebot.vue new file mode 100644 index 000000000..4b5ef4e3c --- /dev/null +++ b/resources/assets/js/pages/manage/components/DialogView/template/bot-deletebot.vue @@ -0,0 +1,22 @@ + + + diff --git a/resources/assets/js/pages/manage/components/DialogView/template/bot-dialog.vue b/resources/assets/js/pages/manage/components/DialogView/template/bot-dialog.vue new file mode 100644 index 000000000..2b7e5ae99 --- /dev/null +++ b/resources/assets/js/pages/manage/components/DialogView/template/bot-dialog.vue @@ -0,0 +1,24 @@ + + + diff --git a/resources/assets/js/pages/manage/components/DialogView/template/bot-help.vue b/resources/assets/js/pages/manage/components/DialogView/template/bot-help.vue new file mode 100644 index 000000000..4588d5be0 --- /dev/null +++ b/resources/assets/js/pages/manage/components/DialogView/template/bot-help.vue @@ -0,0 +1,50 @@ + + + diff --git a/resources/assets/js/pages/manage/components/DialogView/template/bot-info.vue b/resources/assets/js/pages/manage/components/DialogView/template/bot-info.vue new file mode 100644 index 000000000..6f86dd769 --- /dev/null +++ b/resources/assets/js/pages/manage/components/DialogView/template/bot-info.vue @@ -0,0 +1,26 @@ + + + diff --git a/resources/assets/js/pages/manage/components/DialogView/template/bot-list.vue b/resources/assets/js/pages/manage/components/DialogView/template/bot-list.vue new file mode 100644 index 000000000..537b17c4c --- /dev/null +++ b/resources/assets/js/pages/manage/components/DialogView/template/bot-list.vue @@ -0,0 +1,22 @@ + + + diff --git a/resources/assets/js/pages/manage/components/DialogView/template/bot-newbot.vue b/resources/assets/js/pages/manage/components/DialogView/template/bot-newbot.vue new file mode 100644 index 000000000..4bdb4b285 --- /dev/null +++ b/resources/assets/js/pages/manage/components/DialogView/template/bot-newbot.vue @@ -0,0 +1,22 @@ + + + diff --git a/resources/assets/js/pages/manage/components/DialogView/template/bot-revoke.vue b/resources/assets/js/pages/manage/components/DialogView/template/bot-revoke.vue new file mode 100644 index 000000000..2da8c4997 --- /dev/null +++ b/resources/assets/js/pages/manage/components/DialogView/template/bot-revoke.vue @@ -0,0 +1,22 @@ + + + diff --git a/resources/assets/js/pages/manage/components/DialogView/template/bot-setname.vue b/resources/assets/js/pages/manage/components/DialogView/template/bot-setname.vue new file mode 100644 index 000000000..9ccaeb76f --- /dev/null +++ b/resources/assets/js/pages/manage/components/DialogView/template/bot-setname.vue @@ -0,0 +1,22 @@ + + + diff --git a/resources/assets/js/pages/manage/components/DialogView/template/bot-token.vue b/resources/assets/js/pages/manage/components/DialogView/template/bot-token.vue new file mode 100644 index 000000000..0cd0cd338 --- /dev/null +++ b/resources/assets/js/pages/manage/components/DialogView/template/bot-token.vue @@ -0,0 +1,23 @@ + + + diff --git a/resources/assets/js/pages/manage/components/DialogView/template/bot-webhook.vue b/resources/assets/js/pages/manage/components/DialogView/template/bot-webhook.vue new file mode 100644 index 000000000..a4702ff2f --- /dev/null +++ b/resources/assets/js/pages/manage/components/DialogView/template/bot-webhook.vue @@ -0,0 +1,23 @@ + + + diff --git a/resources/assets/js/pages/manage/components/DialogView/template/index.vue b/resources/assets/js/pages/manage/components/DialogView/template/index.vue new file mode 100644 index 000000000..24e3a2732 --- /dev/null +++ b/resources/assets/js/pages/manage/components/DialogView/template/index.vue @@ -0,0 +1,84 @@ + + + diff --git a/resources/assets/js/pages/manage/components/DialogView/template/notice.vue b/resources/assets/js/pages/manage/components/DialogView/template/notice.vue new file mode 100644 index 000000000..5b2dffff2 --- /dev/null +++ b/resources/assets/js/pages/manage/components/DialogView/template/notice.vue @@ -0,0 +1,16 @@ + + diff --git a/resources/assets/js/pages/manage/components/DialogView/template/other.vue b/resources/assets/js/pages/manage/components/DialogView/template/other.vue new file mode 100644 index 000000000..d86cf2b1e --- /dev/null +++ b/resources/assets/js/pages/manage/components/DialogView/template/other.vue @@ -0,0 +1,25 @@ + + + diff --git a/resources/assets/js/pages/manage/components/DialogView/text.vue b/resources/assets/js/pages/manage/components/DialogView/text.vue index 52623afca..614e3e2b9 100644 --- a/resources/assets/js/pages/manage/components/DialogView/text.vue +++ b/resources/assets/js/pages/manage/components/DialogView/text.vue @@ -14,8 +14,8 @@ export default { msg: Object, }, methods: { - viewText() { - this.$emit('viewText'); + viewText(e) { + this.$emit('viewText', e); }, }, } diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index 39d6c9721..186e2268c 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -204,6 +204,7 @@ @on-view-text="onViewText" @on-view-file="onViewFile" @on-down-file="onDownFile" + @on-click-template="onClickTemplate" @on-reply-list="onReplyList" @on-error="onError" @on-emoji="onEmoji" @@ -640,11 +641,6 @@
- - - - - @@ -668,7 +664,6 @@ import {Store} from "le5le-store"; import ImgUpload from "../../../components/ImgUpload.vue"; import {choiceEmojiOne} from "./ChatInput/one"; -import ApproveDetails from "../../../pages/manage/approve/details.vue"; import UserSelect from "../../../components/UserSelect.vue"; import UserAvatarTip from "../../../components/UserAvatar/tip.vue"; import DialogGroupWordChain from "./DialogGroupWordChain"; @@ -689,7 +684,6 @@ export default { DialogGroupInfo, DrawerOverlay, DialogUpload, - ApproveDetails, DialogGroupWordChain, DialogGroupVote, DialogComplaint, @@ -822,8 +816,6 @@ export default { scrollIng: 0, scrollGroup: null, - approveDetails: {id: 0}, - approveDetailsShow: false, approvaUserStatus: '', observers: [], @@ -3130,25 +3122,8 @@ export default { return } - // 打开审批详情 - let approveElement = target; - while (approveElement) { - if (approveElement.classList.contains('dialog-scroller')) { - break; - } - if (approveElement.classList.contains('open-approve-details')) { - const dataId = approveElement.getAttribute("data-id") - if (window.innerWidth < 426) { - this.goForward({name: 'manage-approve-details', query: {id: approveElement.getAttribute("data-id")}}); - } else { - this.approveDetailsShow = true; - this.$nextTick(() => { - this.approveDetails = {id: dataId}; - }) - } - return; - } - approveElement = approveElement.parentElement; + if (this.onClickTemplate({target})) { + return; } switch (target.nodeName) { @@ -3332,6 +3307,26 @@ export default { }); }, + onClickTemplate({target}) { + if (this.operateVisible) { + return false + } + + // 打开审批详情 + let approveElement = target; + while (approveElement) { + if (approveElement.classList.contains('dialog-scroller')) { + break; + } + if (approveElement.classList.contains('open-approve-details')) { + Store.set('approveDetails', approveElement.getAttribute("data-id")); + return true; + } + approveElement = approveElement.parentElement; + } + return false + }, + onReplyList(data) { if (this.operateVisible) { return @@ -3619,28 +3614,27 @@ export default { }, actionPermission(item, permission) { - if (permission === 'forward') { - if (['word-chain', 'vote'].includes(item.type)) { - return false // 投票、接龙 不支持转发 - } - if (item.type === 'text') { - return typeof item.msg.approve_type === 'undefined' // 审批消息不支持转发 - } - } else if (permission === 'newTask') { - if (item.type === 'text') { - return typeof item.msg.approve_type === 'undefined' // 审批消息不支持新建任务 - } - return false - } else if (permission === 'voice2text') { - if (item.type !== 'record') { - return false; - } - if (item.msg.text) { - return false; - } - if (this.isLoad(`msg-${item.id}`)) { - return false; - } + switch (permission) { + case 'forward': + if (['word-chain', 'vote', 'template'].includes(item.type)) { + return false // 投票、接龙、模板消息 不支持转发 + } + break; + + case 'newTask': + return item.type === 'text' // 只有 文本消息 才支持新建任务 + + case 'voice2text': + if (item.type !== 'record') { + return false; + } + if (item.msg.text) { + return false; + } + if (this.isLoad(`msg-${item.id}`)) { + return false; + } + break; } return true // 返回 true 允许操作 }, diff --git a/resources/assets/js/routes.js b/resources/assets/js/routes.js index a79406319..ff361d998 100755 --- a/resources/assets/js/routes.js +++ b/resources/assets/js/routes.js @@ -39,11 +39,6 @@ export default [ path: 'approve', component: () => import('./pages/manage/approve/index.vue'), }, - { - name: 'manage-approve-details', - path: 'approve/details', - component: () => import('./pages/manage/approve/details.vue'), - }, { name: 'manage-apps', path: 'apps/*', diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js index 975ddd709..ee996ae8b 100644 --- a/resources/assets/js/store/actions.js +++ b/resources/assets/js/store/actions.js @@ -235,9 +235,9 @@ export default { state.ajaxNetworkException = networkException } if (networkException) { - reject({ret: -1001, data: {}, msg: $A.L('网络异常')}) + reject({ret: -1001, data: {}, msg: $A.L('网络异常,请重试。')}) } else { - reject({ret: -1, data: {}, msg: $A.L('请求失败')}) + reject({ret: -1, data: {}, msg: $A.L('请求失败,请重试。')}) } console.error(xhr, status); } diff --git a/resources/assets/sass/pages/components/dialog-wrapper.scss b/resources/assets/sass/pages/components/dialog-wrapper.scss index dfdc8ba28..1af7746a6 100644 --- a/resources/assets/sass/pages/components/dialog-wrapper.scss +++ b/resources/assets/sass/pages/components/dialog-wrapper.scss @@ -949,52 +949,6 @@ background-color: $primary-color; } } - - .open-approve-details { - width: 260px; - display: inline-block; - max-width: 100%; - - .cause { - border-bottom: 1px solid #e3e3e3; - border-top: 1px solid #e3e3e3; - padding-bottom: 10px; - margin-top: 10px; - - > span:first-child { - display: inline-block; - padding: 15px 0; - } - - > b { - display: inline-block; - margin-bottom: 5px; - } - - > span { - display: inline-block; - margin-bottom: 3px; - } - } - - .btn-raw { - display: flex; - text-align: center; - padding: 12px 0 5px 0; - - > button { - &.ivu-btn { - flex: 1; - } - &.ivu-btn-primary { - margin-right: 12px; - } - &.ivu-btn-small { - height: 32px; - } - } - } - } } } @@ -1250,6 +1204,13 @@ } } + .content-template { + color: #ffffff; + .mark-color { + color: $primary-color; + } + } + .content-loading { display: flex; align-items: center; @@ -1422,6 +1383,58 @@ } } } + + .open-approve-details { + width: 260px; + display: inline-block; + max-width: 100%; + + .cause { + border-bottom: 1px solid #e3e3e3; + border-top: 1px solid #e3e3e3; + padding-bottom: 10px; + margin-top: 10px; + + > b { + display: inline-block; + margin-bottom: 5px; + } + + > p { + display: block; + margin-bottom: 3px; + &:first-child { + padding: 15px 0; + } + } + + > span { + display: inline-block; + margin-bottom: 3px; + &:first-child { + padding: 15px 0; + } + } + } + + .btn-raw { + display: flex; + text-align: center; + padding: 12px 0 5px 0; + + > button { + &.ivu-btn { + flex: 1; + } + &.ivu-btn-primary { + margin-right: 12px; + } + &.ivu-btn-small { + height: 32px; + } + } + } + } } .dialog-emoji { @@ -1737,6 +1750,13 @@ color: #23241f; } } + + .open-approve-details { + .ivu-btn-grey { + background-color: #efefef; + border-color: #f3f3f3; + } + } } .dialog-emoji { @@ -1768,13 +1788,6 @@ display: flex; } } - - .open-approve-details { - .ivu-btn-grey { - background-color: #efefef; - border-color: #f3f3f3; - } - } } } } diff --git a/resources/assets/sass/pages/page-approve.scss b/resources/assets/sass/pages/page-approve.scss index 695376d94..98c213981 100644 --- a/resources/assets/sass/pages/page-approve.scss +++ b/resources/assets/sass/pages/page-approve.scss @@ -60,13 +60,13 @@ .ivu-input-wrapper{ max-width: 200px; } - + @media (max-width: 515px) { .ivu-btn{ min-width: 45px; } } - + } .approve-load { @@ -200,6 +200,8 @@ display: flex; flex-direction: column; border: 1px solid #eeeeee; + height: 100%; + border-radius: 10px; background: #fff; .approve-details-nav{ @@ -466,7 +468,7 @@ font-weight: 500; color: #135de6; } - + .divider{ margin: 12px 0; margin-bottom: 9px; @@ -502,11 +504,11 @@ } } -// +// body.window-portrait { .page-approve{ .approve-head { margin: 24px 16px 6px 16px; } } -} \ No newline at end of file +} diff --git a/resources/views/push/bot.blade.php b/resources/views/push/bot.blade.php deleted file mode 100755 index a1a9bda71..000000000 --- a/resources/views/push/bot.blade.php +++ /dev/null @@ -1,185 +0,0 @@ -@if ($type === '/help') - 您可以通过发送以下命令来控制我: - - @if ($manager) - /list - 机器人列表 - /newbot {机器人名称} - 创建机器人 - @else - /info - 查看机器人详情 - @endif - - 修改机器人 - /setname {机器人ID} {机器人名称} - 修改机器人名称 - /deletebot {机器人ID} - 删除机器人 - /clearday {机器人ID} {天数} - 设置保留消息时间(默认30天) - /webhook {机器人ID} [url] - 设置消息Webhook(详情请看 Api接口文档) - - 机器人设置 - /token {机器人ID} - 生成Token令牌 - /revoke {机器人ID} - 撤销机器人Token令牌 - - 会话管理 - /dialog {机器人ID} [搜索关键词] - 查看会话ID - - Api接口文档 - /api - 查看接口列表 -@elseif ($type === '/list') - 我的机器人。 - - ID | 名称 | 清理时间 | Webhook - @foreach($data as $item) - {{$item->userid}} | {{$item->nickname}} | {{$item->clear_day}} | {{$item->webhook_url ? '✅' : '-'}} - @endforeach -@elseif ($type === '/info') - 机器人详情。 - - 机器人ID:{{$data->userid}} - 机器人名称:{{$data->nickname}} - 保留消息时间:{{$data->clear_day}} - 最后一次清理时间:{{$data->clear_at ?: '-'}} - Webhook地址:{{$data->webhook_url ?: '-'}} - Webhook请求次数:{{$data->webhook_num}} -@elseif ($type === '/newbot') - 创建成功。 - - 机器人ID:{{$data->userid}} - 机器人名称:{{$data->nickname}} -@elseif ($type === '/setname') - 设置名称成功。 - - 机器人ID:{{$data->userid}} - 机器人名称:{{$data->nickname}} -@elseif ($type === '/deletebot') - 删除成功。 - - 机器人ID:{{$data->userid}} - 机器人名称:{{$data->nickname}} -@elseif ($type === '/token') - 生成Token令牌。 - - 机器人ID:{{$data->userid}} - 机器人名称:{{$data->nickname}} - Token:{{$data->token}} -@elseif ($type === '/revoke') - 撤销机器人Token令牌。 - - 机器人ID:{{$data->userid}} - 机器人名称:{{$data->nickname}} -@elseif ($type === '/webhook') - 设置Webhook地址。 - - 机器人ID:{{$data->userid}} - 机器人名称:{{$data->nickname}} - Webhook地址:{{$data->webhook_url}} -@elseif ($type === '/clearday') - 设置保留消息时间。 - - 机器人ID:{{$data->userid}} - 机器人名称:{{$data->nickname}} - 清理周期:{{$data->clear_day}}天 - 下次清理:{{$data->clear_at}} -@elseif ($type === '/dialog') - 机器人 {{$data->nickname}} (ID:{{$data->userid}}) 已加入的会话: - - 会话ID | 会话名称 - @foreach($data->list as $item) - {{$item->id}} | {{$item->name}}{{$item->type == 'user' ? ' (个人)' : ''}} - @endforeach -@elseif ($type === '/api') - 你可以通过执行以下命令来请求我: - - 发送文本消息: - curl --request POST '{{url('api/dialog/msg/sendtext')}}' \ - --header 'version: {{ $version }}' \ - --header 'token: {机器人Token}' \ - --form 'dialog_id="{对话ID}"' \ - --form 'text="{消息内容}"' - --form 'text_type="[html|md]"' - --form 'silence="[yes|no]"' - --form 'reply_id="[回复指定消息ID]"' - - Webhook说明: - 机器人收到消息后会将消息POST推送到Webhook地址,请求超时为10秒,请求参数如下: - text: 消息文本 - token: 机器人Token - dialog_id: 对话ID - dialog_type: 对话类型 - msg_id: 消息ID - msg_uid: 消息发送人ID - mention: 是否被@到 - bot_uid: 机器人ID - version: 系统版本 -@elseif ($type === 'notice') - {{$notice}} -@elseif ($type === 'approve_reviewer') - {{$data->nickname}}提交的「{{$data->proc_def_name}}」待你审批 -
申请人:{{'@'}}{{$data->nickname}} {{$data->department}} - 详情 - @if ($data->type) - 假期类型:{{$data->type}} - @endif - 开始时间:{{$data->start_time}} ({{ $data->start_day_of_week }}) - 结束时间:{{$data->end_time}} ({{ $data->end_day_of_week }}) - 事由:{{$data->description}} -
- @if ($action === 'pass') - - @elseif ($action === 'refuse') - - @elseif ($action === 'withdraw') - - @else - - - @endif -
-@elseif ($type === 'approve_notifier') - 抄送{{$data->nickname}}提交的「{{$data->proc_def_name}}」记录 -
申请人:{{'@'}}{{$data->nickname}} {{$data->department}} - 详情 - @if ($data->type) - 假期类型:{{$data->type}} - @endif - 开始时间:{{$data->start_time}} ({{ $data->start_day_of_week }}) - 结束时间:{{$data->end_time}} ({{ $data->end_day_of_week }}) - 事由:{{$data->description}} -
- @if ($is_finished == 1) - - @else - - @endif -
-@elseif ($type === 'approve_comment_notifier') - {{$data->comment_nickname}}评论了此审批 -
申请人:{{'@'}}{{$data->nickname}} {{$data->department}} - 评论内容 - {{$data->comment_content}} - @if ($data->comment_pictures) - [图片] - @endif -
- -
-@elseif ($type === 'approve_submitter') - @if ($action === 'pass')您发起的「{{$data->proc_def_name}}」已通过 @else您发起的「{{$data->proc_def_name}}」被{{$data->nickname}}拒绝 @endif -
申请人:{{'@'}}{{$data->start_nickname}} {{$data->department}} - 详情 - @if ($data->type) - 假期类型:{{$data->type}} - @endif - 开始时间:{{$data->start_time}} ({{ $data->start_day_of_week }}) - 结束时间:{{$data->end_time}} ({{ $data->end_day_of_week }}) - 事由:{{$data->description}} -
- @if ($action === 'pass') - - @elseif ($action === 'refuse') - - @elseif ($action === 'withdraw') - - @endif -
-@else - 你好,我是你的机器人助理,你可以发送 /help 查看帮助菜单。 -@endif