mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-11 18:42:54 +00:00
perf: 审批内容禁止转发
This commit is contained in:
parent
3c93ad18b2
commit
8d39b4aa0d
@ -993,14 +993,14 @@ class ApproveController extends AbstractController
|
||||
if ($action == 'withdraw' || $action == 'pass' || $action == 'refuse') {
|
||||
// 任务完成,给发起人发送消息
|
||||
if ($type == 'approve_submitter' && $action != 'withdraw') {
|
||||
return WebSocketDialogMsg::sendMsg($msg_action, $dialog->id, 'text', ['text' => $text], $botUser->userid, false, false, true);
|
||||
return WebSocketDialogMsg::sendMsg($msg_action, $dialog->id, 'text', ['text' => $text, 'approve_type' => $type], $botUser->userid, false, false, true);
|
||||
}
|
||||
// 查找最后一条消息msg_id
|
||||
$msg_action = 'change-' . $toUser['msg_id'];
|
||||
}
|
||||
//
|
||||
try {
|
||||
$msg = WebSocketDialogMsg::sendMsg($msg_action, $dialog->id, 'text', ['text' => $text], $botUser->userid, false, false, true);
|
||||
$msg = WebSocketDialogMsg::sendMsg($msg_action, $dialog->id, 'text', ['text' => $text, 'approve_type' => $type], $botUser->userid, false, false, true);
|
||||
// 关联信息
|
||||
if ($action == 'start') {
|
||||
$proc_msg = new ApproveProcMsg();
|
||||
|
||||
@ -298,7 +298,7 @@
|
||||
<i class="taskfont" v-html="item.icon"></i>
|
||||
<span>{{ $L(item.label) }}</span>
|
||||
</li>
|
||||
<li v-if="operateItem.type !== 'word-chain' && operateItem.type !== 'vote'" @click="onOperate('forward')">
|
||||
<li v-if="actionPermission(operateItem, 'forward')" @click="onOperate('forward')">
|
||||
<i class="taskfont"></i>
|
||||
<span>{{ $L('转发') }}</span>
|
||||
</li>
|
||||
@ -320,7 +320,7 @@
|
||||
<i class="taskfont"></i>
|
||||
<span>{{ $L(operateItem.tag ? '取消标注' : '标注') }}</span>
|
||||
</li>
|
||||
<li v-if="operateItem.type === 'text'" @click="onOperate('newTask')">
|
||||
<li v-if="actionPermission(operateItem, 'newTask')" @click="onOperate('newTask')">
|
||||
<i class="taskfont"></i>
|
||||
<span>{{ $L('新任务') }}</span>
|
||||
</li>
|
||||
@ -3437,6 +3437,23 @@ 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
|
||||
}
|
||||
return true // 返回 true 允许操作
|
||||
},
|
||||
|
||||
findOperateFile(msgId, link) {
|
||||
const file = this.fileLinks.find(item => item.link === link)
|
||||
if (file) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user