mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-15 05:12:49 +00:00
perf: 评论审批图片和投票深色按钮
This commit is contained in:
parent
ea40e95cae
commit
f757749282
@ -207,7 +207,7 @@ class ApproveController extends AbstractController
|
||||
if ($id != $user->userid) {
|
||||
$dialog = WebSocketDialog::checkUserDialog($botUser, $id);
|
||||
$processInst['comment_user_id'] = $user->userid;
|
||||
$processInst['comment_content'] = json_decode($data['content'], true)['content'];
|
||||
$processInst['comment_contents'] = json_decode($data['content'], true) ?? [];
|
||||
$this->approveMsg('approve_comment_notifier', $dialog, $botUser, $processInst, $processInst);
|
||||
}
|
||||
}
|
||||
@ -983,7 +983,8 @@ class ApproveController extends AbstractController
|
||||
'end_day_of_week' => '周' . Base::getTimeWeek(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_content'] ?? ''
|
||||
'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);
|
||||
|
||||
@ -420,27 +420,33 @@ export default {
|
||||
// 提交评论
|
||||
confirmComment() {
|
||||
this.commentLoad++;
|
||||
this.$store.dispatch("call", {
|
||||
method: 'post',
|
||||
url: 'approve/process/addGlobalComment',
|
||||
data: {
|
||||
proc_inst_id: this.$route.query.id || this.data.id,
|
||||
content: JSON.stringify({
|
||||
'content': this.commentData.content,
|
||||
'pictures': this.commentData.pictures.map(h => {
|
||||
return h.path;
|
||||
})
|
||||
})
|
||||
this.$refs["initiateRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch("call", {
|
||||
method: 'post',
|
||||
url: 'approve/process/addGlobalComment',
|
||||
data: {
|
||||
proc_inst_id: this.$route.query.id || this.data.id,
|
||||
content: JSON.stringify({
|
||||
'content': this.commentData.content,
|
||||
'pictures': this.commentData.pictures.map(h => {
|
||||
return h.path;
|
||||
})
|
||||
})
|
||||
}
|
||||
}).then(({msg}) => {
|
||||
$A.messageSuccess("添加成功");
|
||||
this.getInfo(true)
|
||||
this.commentShow = false;
|
||||
}).catch(({msg}) => {
|
||||
$A.modalError(msg);
|
||||
}).finally(_ => {
|
||||
this.commentLoad--;
|
||||
});
|
||||
} else {
|
||||
this.commentLoad--;
|
||||
}
|
||||
}).then(({msg}) => {
|
||||
$A.messageSuccess("添加成功");
|
||||
this.getInfo(true)
|
||||
this.commentShow = false;
|
||||
}).catch(({msg}) => {
|
||||
$A.modalError(msg);
|
||||
}).finally(_ => {
|
||||
this.commentLoad--;
|
||||
});
|
||||
})
|
||||
},
|
||||
// 滚动到容器底部
|
||||
scrollToBottom() {
|
||||
|
||||
@ -115,8 +115,8 @@
|
||||
</Checkbox>
|
||||
</CheckboxGroup>
|
||||
<div class="btn-row">
|
||||
<Button v-if="(voteData[msgData.msg.uuid] || []).length == 0" disabled>{{$L("请选择后投票")}}</Button>
|
||||
<Button v-else type="warning" :loading="msgData.msg._loadIng > 0" @click="onVote('vote',msgData)">{{$L("立即投票")}}</Button>
|
||||
<Button v-if="(voteData[msgData.msg.uuid] || []).length == 0" type="grey" disabled>{{$L("请选择后投票")}}</Button>
|
||||
<Button v-else type="warning" :loading="msgData.msg._loadIng > 0" class="no-dark-content" @click="onVote('vote',msgData)">{{$L("立即投票")}}</Button>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
|
||||
@ -155,6 +155,9 @@
|
||||
<div class="cause"><span>申请人:<span style="color:#84c56a">{{'@'}}{{$data->nickname}}</span> {{$data->department}}</span>
|
||||
<b>评论内容</b>
|
||||
<span>{{$data->comment_content}}</span>
|
||||
@if ($data->comment_pictures)
|
||||
<span>[图片]</span>
|
||||
@endif
|
||||
</div><div class="btn-raw no-dark-content">
|
||||
@if ($is_finished == 1)
|
||||
<button class="ivu-btn ivu-btn-grey">已同意</button>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user