Merge Optimization

This commit is contained in:
Pang 2023-08-11 08:29:41 +08:00
parent 952836e1f1
commit b5d63dfd12
11 changed files with 189 additions and 142 deletions

View File

@ -74,7 +74,7 @@ class ApproveController extends AbstractController
$ret = Ihttp::ihttp_post($this->flow_url.'/api/v1/workflow/procdef/findAll', json_encode($data)); $ret = Ihttp::ihttp_post($this->flow_url.'/api/v1/workflow/procdef/findAll', json_encode($data));
$procdef = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); $procdef = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true);
if (!$procdef || $procdef['status'] != 200 || $ret['ret'] == 0) { if (!$procdef || $procdef['status'] != 200 || $ret['ret'] == 0) {
info($ret); // info($ret);
return Base::retError($procdef['message'] ?? '查询失败'); return Base::retError($procdef['message'] ?? '查询失败');
} }
return Base::retSuccess('success', Base::arrayKeyToUnderline($procdef['data'])); return Base::retSuccess('success', Base::arrayKeyToUnderline($procdef['data']));
@ -209,7 +209,7 @@ class ApproveController extends AbstractController
$this->approveMsg('approve_comment_notifier', $dialog, $botUser, $processInst, $processInst); $this->approveMsg('approve_comment_notifier', $dialog, $botUser, $processInst, $processInst);
} }
} }
$res = Base::arrayKeyToUnderline($process['data']); $res = Base::arrayKeyToUnderline($process['data']);
return Base::retSuccess('success', $res); return Base::retSuccess('success', $res);
} }
@ -220,7 +220,7 @@ class ApproveController extends AbstractController
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
* @apiGroup approve * @apiGroup approve
* @apiName task__complete * @apiName task__complete
* *
* @apiQuery {Number} task_id 流程ID * @apiQuery {Number} task_id 流程ID
* @apiQuery {String} pass 标题 [true-通过false-拒绝] * @apiQuery {String} pass 标题 [true-通过false-拒绝]
@ -1058,10 +1058,10 @@ class ApproveController extends AbstractController
} }
$info = User::whereUserid($res['start_user_id'])->first(); $info = User::whereUserid($res['start_user_id'])->first();
$res['userimg'] = $info ? User::getAvatar($info->userid, $info->userimg, $info->email, $info->nickname) : ''; $res['userimg'] = $info ? User::getAvatar($info->userid, $info->userimg, $info->email, $info->nickname) : '';
// //
$res['userids'][] = $info->userid; $res['userids'][] = $info->userid;
$res['userids'] = array_unique($res['userids']); $res['userids'] = array_unique($res['userids']);
// //
return $res; return $res;
} }

View File

@ -849,8 +849,8 @@ class WebSocketDialogMsg extends AbstractModel
$dialogMsg->updateInstance($updateData); $dialogMsg->updateInstance($updateData);
$dialogMsg->key = $dialogMsg->generateMsgKey(); $dialogMsg->key = $dialogMsg->generateMsgKey();
$dialogMsg->save(); $dialogMsg->save();
// //
$dialogMsg->msgJoinGroup($dialog, $dialogMsg); $dialogMsg->msgJoinGroup($dialog);
// //
$dialog->pushMsg('update', array_merge($updateData, [ $dialog->pushMsg('update', array_merge($updateData, [
'id' => $dialogMsg->id 'id' => $dialogMsg->id
@ -901,11 +901,10 @@ class WebSocketDialogMsg extends AbstractModel
/** /**
* 将被@的人加入群 * 将被@的人加入群
* @param $dialogMsg 发送的消息 * @param WebSocketDialog $dialog 对话
* @param $dialog 对话
* @return array * @return array
*/ */
public static function msgJoinGroup($dialog, $dialogMsg) public function msgJoinGroup(WebSocketDialog $dialog)
{ {
$updateds = []; $updateds = [];
$silences = []; $silences = [];
@ -914,20 +913,22 @@ class WebSocketDialogMsg extends AbstractModel
$silences[$dialogUser->userid] = $dialogUser->silence; $silences[$dialogUser->userid] = $dialogUser->silence;
} }
$userids = array_keys($silences); $userids = array_keys($silences);
// 提及会员 // 提及会员
$mentions = []; $mentions = [];
if ($dialogMsg->type === 'text') { if ($this->type === 'text') {
preg_match_all("/<span class=\"mention user\" data-id=\"(\d+)\">/", $dialogMsg->msg['text'], $matchs); preg_match_all("/<span class=\"mention user\" data-id=\"(\d+)\">/", $this->msg['text'], $matchs);
if ($matchs) { if ($matchs) {
$mentions = array_values(array_filter(array_unique($matchs[1]))); $mentions = array_values(array_filter(array_unique($matchs[1])));
} }
} }
// 将会话以外的成员加入会话内 // 将会话以外的成员加入会话内
$diffids = array_values(array_diff($mentions, $userids)); $diffids = array_values(array_diff($mentions, $userids));
if ($diffids) { if ($diffids) {
// 仅(群聊)且(是群主或没有群主)才可以@成员以外的人 // 仅(群聊)且(是群主或没有群主)才可以@成员以外的人
if ($dialog->type === 'group' && in_array($dialog->owner_id, [0, $dialogMsg->userid])) { if ($dialog->type === 'group' && in_array($dialog->owner_id, [0, $this->userid])) {
$dialog->joinGroup($diffids, $dialogMsg->userid); $dialog->joinGroup($diffids, $this->userid);
$dialog->pushMsg("groupJoin", null, $diffids); $dialog->pushMsg("groupJoin", null, $diffids);
$userids = array_values(array_unique(array_merge($mentions, $userids))); $userids = array_values(array_unique(array_merge($mentions, $userids)));
} }

View File

@ -313,7 +313,7 @@ class BotReceiveMsgTask extends AbstractTask
$nameKey = $isManager ? $array[2] : $array[1]; $nameKey = $isManager ? $array[2] : $array[1];
$data = $this->botManagerOne($botId, $msg->userid); $data = $this->botManagerOne($botId, $msg->userid);
if ($data) { if ($data) {
$list = WebSocketDialog::select(['web_socket_dialogs.*', 'u.top_at', 'u.mark_unread', 'u.silence', 'u.updated_at as user_at']) $list = WebSocketDialog::select(['web_socket_dialogs.*', 'u.top_at', 'u.mark_unread', 'u.silence', 'u.color', 'u.updated_at as user_at'])
->join('web_socket_dialog_users as u', 'web_socket_dialogs.id', '=', 'u.dialog_id') ->join('web_socket_dialog_users as u', 'web_socket_dialogs.id', '=', 'u.dialog_id')
->where('web_socket_dialogs.name', 'LIKE', "%{$nameKey}%") ->where('web_socket_dialogs.name', 'LIKE', "%{$nameKey}%")
->where('u.userid', $data->userid) ->where('u.userid', $data->userid)
@ -466,7 +466,7 @@ class BotReceiveMsgTask extends AbstractTask
} }
if($res['data'] && $data = json_decode($res['data'])){ if($res['data'] && $data = json_decode($res['data'])){
if($data['code'] != 200 && $data['message']){ if($data['code'] != 200 && $data['message']){
WebSocketDialogMsg::sendMsg(null, $msg->dialog_id, 'text', ['text' => $res['data']['message']], $botUser->userid, false, false, true); WebSocketDialogMsg::sendMsg(null, $msg->dialog_id, 'text', ['text' => $res['data']['message']], $botUser->userid, false, false, true);
} }
} }
} catch (\Throwable $th) { } catch (\Throwable $th) {

View File

@ -93,7 +93,7 @@ class WebSocketDialogMsgTask extends AbstractTask
} }
// 将会话以外的成员加入会话内 // 将会话以外的成员加入会话内
$msgJoinGroupResult = $msg->msgJoinGroup($dialog, $msg); $msgJoinGroupResult = $msg->msgJoinGroup($dialog);
$updateds = $msgJoinGroupResult['updateds']; $updateds = $msgJoinGroupResult['updateds'];
$silences = $msgJoinGroupResult['silences']; $silences = $msgJoinGroupResult['silences'];
$userids = $msgJoinGroupResult['userids']; $userids = $msgJoinGroupResult['userids'];

View File

@ -16,7 +16,7 @@
{"name": "给你个眼神", "key": "眼神 真的 质疑 疑问 不确定", "path": "9.gif"}, {"name": "给你个眼神", "key": "眼神 真的 质疑 疑问 不确定", "path": "9.gif"},
{"name": "恭喜发财", "key": "新年好 新年 拜年", "path": "10.gif"}, {"name": "恭喜发财", "key": "新年好 新年 拜年", "path": "10.gif"},
{"name": "跪谢", "key": "谢谢 感动 跪", "path": "11.gif"}, {"name": "跪谢", "key": "谢谢 感动 跪", "path": "11.gif"},
{"name": "Hi", "key": "打招呼 欢迎 招呼 你好", "path": "12.gif"}, {"name": "Hi", "key": "打招呼 欢迎 招呼 你好", "path": "12.gif"},
{"name": "欢迎欢迎", "key": "欢迎 新人 兴奋 开心 庆祝 喝彩 气氛组", "path": "13.gif"}, {"name": "欢迎欢迎", "key": "欢迎 新人 兴奋 开心 庆祝 喝彩 气氛组", "path": "13.gif"},
{"name": "加油", "key": "喝彩 气氛组", "path": "14.gif"}, {"name": "加油", "key": "喝彩 气氛组", "path": "14.gif"},
{"name": "静静看着你", "key": "静静 看着 不说话 沉默", "path": "15.gif"}, {"name": "静静看着你", "key": "静静 看着 不说话 沉默", "path": "15.gif"},

View File

@ -1,5 +1,6 @@
<template> <template>
<div class="approve-details" :style="{'z-index':modalTransferIndex}"> <div class="approve-details" :style="{'z-index':modalTransferIndex}">
<!-- 审批详情 -->
<div class="approve-details-box" ref="approveDetailsBox"> <div class="approve-details-box" ref="approveDetailsBox">
<h2 class="approve-details-title"> <h2 class="approve-details-title">
<span>{{$L(datas.proc_def_name)}}</span> <span>{{$L(datas.proc_def_name)}}</span>
@ -20,16 +21,16 @@
</div> </div>
<div class="approve-details-text"> <div class="approve-details-text">
<h4>{{$L('开始时间')}}</h4> <h4>{{$L('开始时间')}}</h4>
<div> <div class="time-text">
<span>{{datas.var?.start_time}}</span> <span>{{datas.var?.start_time}}</span>
<span>&nbsp;&nbsp;&nbsp;({{getWeekday(datas.var?.start_time)}})</span> <span>({{getWeekday(datas.var?.start_time)}})</span>
</div> </div>
</div> </div>
<div class="approve-details-text"> <div class="approve-details-text">
<h4>{{$L('结束时间')}}</h4> <h4>{{$L('结束时间')}}</h4>
<div> <div class="time-text">
<span>{{datas.var?.end_time}}</span> <span>{{datas.var?.end_time}}</span>
<span>&nbsp;&nbsp;&nbsp;({{getWeekday(datas.var?.end_time)}})</span> <span>({{getWeekday(datas.var?.end_time)}})</span>
</div> </div>
</div> </div>
<div class="approve-details-text"> <div class="approve-details-text">
@ -72,9 +73,10 @@
</TimelineItem> </TimelineItem>
<!-- 审批 --> <!-- 审批 -->
<TimelineItem :key="key" v-if="item.type == 'approver' && item._show" <TimelineItem
:color="item.identitylink ? (item.identitylink?.state > 1 ? '#f03f3f' :'green') : '#ccc'" v-if="item.type == 'approver' && item._show"
> :key="key"
:color="item.identitylink ? (item.identitylink?.state > 1 ? '#f03f3f' :'green') : '#ccc'">
<p class="timeline-title">{{$L('审批')}}</p> <p class="timeline-title">{{$L('审批')}}</p>
<div class="timeline-body"> <div class="timeline-body">
<Avatar :src="(item.node_user_list && item.node_user_list[0]?.userimg) || item.userimg" size="38"/> <Avatar :src="(item.node_user_list && item.node_user_list[0]?.userimg) || item.userimg" size="38"/>
@ -90,9 +92,9 @@
</div> </div>
<div class="approve-process-right"> <div class="approve-process-right">
<p v-if="parseInt(getTimeAgo(item.claim_time)) < showTimeNum"> <p v-if="parseInt(getTimeAgo(item.claim_time)) < showTimeNum">
{{ item.identitylink?.state==0 ? {{ item.identitylink?.state==0 ?
($L('已等待') + " " + getTimeAgo( datas.node_infos[key-1].claim_time,2)) : ($L('已等待') + " " + getTimeAgo( datas.node_infos[key-1].claim_time,2)) :
(item.claim_time ? getTimeAgo(item.claim_time) : '') (item.claim_time ? getTimeAgo(item.claim_time) : '')
}} }}
</p> </p>
<p>{{item.claim_time?.substr(0,16)}}</p> <p>{{item.claim_time?.substr(0,16)}}</p>
@ -100,7 +102,7 @@
</div> </div>
<p class="comment" v-if="item.identitylink?.comment"><span>{{ item.identitylink?.comment }}</span></p> <p class="comment" v-if="item.identitylink?.comment"><span>{{ item.identitylink?.comment }}</span></p>
</TimelineItem> </TimelineItem>
<!-- 抄送 --> <!-- 抄送 -->
<TimelineItem :key="key" :color="item.is_finished ? 'green' : '#ccc'" v-if="item.type == 'notifier' && item._show"> <TimelineItem :key="key" :color="item.is_finished ? 'green' : '#ccc'" v-if="item.type == 'notifier' && item._show">
<p class="timeline-title">{{$L('抄送')}}</p> <p class="timeline-title">{{$L('抄送')}}</p>
@ -110,9 +112,9 @@
<p class="approve-process-name">{{$L('系统')}}</p> <p class="approve-process-name">{{$L('系统')}}</p>
<p class="approve-process-desc">{{$L('自动抄送')}} <p class="approve-process-desc">{{$L('自动抄送')}}
<span style="color: #486fed;"> <span style="color: #486fed;">
{{ item.node_user_list?.map(h=>h.name).join(',') }} {{ item.node_user_list?.map(h=>h.name).join(',') }}
{{$L('等'+item.node_user_list?.length+'人')}} {{$L('等'+item.node_user_list?.length+'人')}}
</span> </span>
</p> </p>
</div> </div>
</div> </div>
@ -129,7 +131,7 @@
</div> </div>
</div> </div>
</TimelineItem> </TimelineItem>
</template> </template>
</Timeline> </Timeline>
@ -139,9 +141,9 @@
<div class="approve-record-comment"> <div class="approve-record-comment">
<List :split="false" :border="false"> <List :split="false" :border="false">
<ListItem v-for="(item,key) in datas.global_comments" :key="key"> <ListItem v-for="(item,key) in datas.global_comments" :key="key">
<div> <div>
<div class="top"> <div class="top">
<Avatar :src="item.userimg" size="38"/> <Avatar :src="item.userimg" size="38"/>
<div> <div>
<p>{{item.nickname}}</p> <p>{{item.nickname}}</p>
<p class="time">{{item.created_at}}</p> <p class="time">{{item.created_at}}</p>
@ -156,21 +158,26 @@
<ImgView :src="src" class="img-view"/> <ImgView :src="src" class="img-view"/>
</div> </div>
</div> </div>
</div> </div>
</ListItem> </ListItem>
</List> </List>
</div> </div>
</template> </template>
</div> </div>
<!--审批操作-->
<div class="approve-operation"> <div class="approve-operation">
<div style="flex: 1;"></div>
<Button type="success" v-if="isShowAgreeBtn" @click="approve(1)">{{$L('同意')}}</Button> <Button type="success" v-if="isShowAgreeBtn" @click="approve(1)">{{$L('同意')}}</Button>
<Button type="error" v-if="isShowAgreeBtn" @click="approve(2)">{{$L('拒绝')}}</Button> <Button type="error" v-if="isShowAgreeBtn" @click="approve(2)">{{$L('拒绝')}}</Button>
<Button type="warning" v-if="isShowWarningBtn" @click="revocation">{{$L('撤销')}}</Button> <Button type="warning" v-if="isShowWarningBtn" @click="revocation">{{$L('撤销')}}</Button>
<Button @click="comment" type="success" ghost>+{{$L('添加评论')}}</Button> <Button @click="comment" type="success" ghost>+{{$L('添加评论')}}</Button>
</div> </div>
<!--加载中-->
<div v-if="loadIng > 0" class="approve-load">
<Loading/>
</div>
<!--评论--> <!--评论-->
<Modal v-model="commentShow" :title="$L('评论')" :mask-closable="false" class="page-approve-initiate"> <Modal v-model="commentShow" :title="$L('评论')" :mask-closable="false" class="page-approve-initiate">
<Form ref="initiateRef" :model="commentData" :rules="commentRule" label-width="auto" @submit.native.prevent> <Form ref="initiateRef" :model="commentData" :rules="commentRule" label-width="auto" @submit.native.prevent>
@ -183,20 +190,19 @@
</Form> </Form>
<div slot="footer" class="adaption"> <div slot="footer" class="adaption">
<Button type="default" @click="commentShow=false">{{$L('取消')}}</Button> <Button type="default" @click="commentShow=false">{{$L('取消')}}</Button>
<Button type="primary" :loading="loadIng > 0" @click="confirmComment">{{$L('确认')}}</Button> <Button type="primary" :loading="commentLoad > 0" @click="confirmComment">{{$L('确认')}}</Button>
</div> </div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import ImgView from "../../../components/ImgView"; import ImgView from "../../../components/ImgView";
import ImgUpload from "../../../components/ImgUpload"; import ImgUpload from "../../../components/ImgUpload";
export default { export default {
name: "details", name: "ApproveDetails",
components:{ImgView,ImgUpload}, components: {ImgView, ImgUpload},
props: { props: {
data: { data: {
type: Object, type: Object,
@ -208,29 +214,31 @@ export default {
data() { data() {
return { return {
modalTransferIndex:window.modalTransferIndex, datas: {},
datas:{}, loadIng: 0,
showTimeNum:24, showTimeNum: 24,
commentShow:false, modalTransferIndex: window.modalTransferIndex,
loadIng:0,
commentLoad: 0,
commentShow: false,
commentData: { commentData: {
content:"", content: "",
pictures:[] pictures: []
}, },
commentRule: { commentRule: {
content: { type: 'string',required: true, message: this.$L('请输入内容!'), trigger: 'change' }, content: {type: 'string', required: true, message: this.$L('请输入内容!'), trigger: 'change'},
} }
} }
}, },
watch: { watch: {
'$route' (to, from) { '$route'(to, from) {
if(to.name == 'manage-approve-details'){ if (to.name == 'manage-approve-details') {
this.init() this.init()
} }
}, },
data: { data: {
handler(newValue,oldValue) { handler(newValue, oldValue) {
if(newValue.id){ if (newValue.id) {
this.getInfo() this.getInfo()
} }
}, },
@ -238,13 +246,13 @@ export default {
}, },
}, },
computed: { computed: {
isShowAgreeBtn(){ isShowAgreeBtn() {
return (this.datas.candidate || '').split(',').indexOf(this.userId + '') != -1 && !this.datas.is_finished return (this.datas.candidate || '').split(',').indexOf(this.userId + '') != -1 && !this.datas.is_finished
}, },
isShowWarningBtn(){ isShowWarningBtn() {
let is = (this.userId == this.datas.start_user_id) && this.datas?.is_finished != true; let is = (this.userId == this.datas.start_user_id) && this.datas?.is_finished != true;
(this.datas.node_infos || []).map(h=>{ (this.datas.node_infos || []).map(h => {
if( h.type != 'starter' && h.is_finished == true && h.identitylink?.userid != this.userId) { if (h.type != 'starter' && h.is_finished == true && h.identitylink?.userid != this.userId) {
is = false; is = false;
} }
}) })
@ -254,29 +262,29 @@ export default {
mounted() { mounted() {
this.init() this.init()
}, },
methods:{ methods: {
init(){ init() {
this.modalTransferIndex = window.modalTransferIndex = window.modalTransferIndex + 1 this.modalTransferIndex = window.modalTransferIndex = window.modalTransferIndex + 1
if(this.$route.query.id){ if (this.$route.query.id) {
this.data.id = this.$route.query.id; this.data.id = this.$route.query.id;
this.getInfo() this.getInfo()
} }
}, },
// //
getTimeAgo(time,type) { getTimeAgo(time, type) {
const currentTime = new Date(); const currentTime = new Date();
const timeDiff = (currentTime - new Date((time + '').replace(/-/g,"/"))) / 1000; // convert to seconds const timeDiff = (currentTime - new Date((time + '').replace(/-/g, "/"))) / 1000; // convert to seconds
if (timeDiff < 60) { if (timeDiff < 60) {
return type == 2 ? "0"+this.$L('分钟') : this.$L('刚刚'); return type == 2 ? "0" + this.$L('分钟') : this.$L('刚刚');
} else if (timeDiff < 3600) { } else if (timeDiff < 3600) {
const minutes = Math.floor(timeDiff / 60); const minutes = Math.floor(timeDiff / 60);
return type == 2 ? `${minutes}${this.$L('分钟')}` : `${minutes} ${this.$L('分钟前')}`; return type == 2 ? `${minutes}${this.$L('分钟')}` : `${minutes} ${this.$L('分钟前')}`;
} else if(timeDiff < 3600 * 24) { } else if (timeDiff < 3600 * 24) {
const hours = Math.floor(timeDiff / 3600); const hours = Math.floor(timeDiff / 3600);
return type == 2 ? `${hours}${this.$L('小时')}` : `${hours} ${this.$L('小时前')}`; return type == 2 ? `${hours}${this.$L('小时')}` : `${hours} ${this.$L('小时前')}`;
} else { } else {
const days = Math.floor(timeDiff / 3600 / 24); const days = Math.floor(timeDiff / 3600 / 24);
return type == 2 ? `${days+1}${this.$L('天')}` : `${days+1} ${this.$L('天')}`; return type == 2 ? `${days + 1}${this.$L('天')}` : `${days + 1} ${this.$L('天')}`;
} }
}, },
// //
@ -284,21 +292,21 @@ export default {
return ['周日', '周一', '周二', '周三', '周四', '周五', '周六'][new Date(dateString).getDay()]; return ['周日', '周一', '周二', '周三', '周四', '周五', '周六'][new Date(dateString).getDay()];
}, },
// //
getTimeDifference(startTime,endTime) { getTimeDifference(startTime, endTime) {
const currentTime = new Date((endTime + '').replace(/-/g,"/")); const currentTime = new Date((endTime + '').replace(/-/g, "/"));
const endTimes = new Date((startTime + '').replace(/-/g,"/")); const endTimes = new Date((startTime + '').replace(/-/g, "/"));
const timeDiff = (currentTime - endTimes) / 1000; // convert to seconds const timeDiff = (currentTime - endTimes) / 1000; // convert to seconds
if (timeDiff < 60) { if (timeDiff < 60) {
return {time:timeDiff,unit:this.$L('秒')}; return {time: timeDiff, unit: this.$L('秒')};
} else if (timeDiff < 3600) { } else if (timeDiff < 3600) {
const minutes = Math.floor(timeDiff / 60); const minutes = Math.floor(timeDiff / 60);
return {time:minutes,unit:this.$L('分钟')}; return {time: minutes, unit: this.$L('分钟')};
} else if(timeDiff < 3600 * 24) { } else if (timeDiff < 3600 * 24) {
const hours = (currentTime - endTimes) / (1000 * 60 * 60); const hours = (currentTime - endTimes) / (1000 * 60 * 60);
return {time:hours,unit:this.$L('小时')}; return {time: hours, unit: this.$L('小时')};
} else { } else {
const days = Math.floor(timeDiff / 3600 / 24); const days = Math.floor(timeDiff / 3600 / 24);
return {time:days + 1,unit:this.$L('天')}; return {time: days + 1, unit: this.$L('天')};
} }
}, },
// //
@ -308,13 +316,13 @@ export default {
method: 'get', method: 'get',
url: 'approve/process/detail', url: 'approve/process/detail',
data: { data: {
id:this.data.id, id: this.data.id,
} }
}).then(({data}) => { }).then(({data}) => {
var show = true; var show = true;
data.node_infos = data.node_infos.map(item=>{ data.node_infos = data.node_infos.map(item => {
item._show = show; item._show = show;
if( item.identitylink?.state==2 || item.identitylink?.state==3 ){ if (item.identitylink?.state == 2 || item.identitylink?.state == 3) {
show = false; show = false;
} }
return item; return item;
@ -330,15 +338,15 @@ export default {
}); });
}, },
// //
approve(type){ approve(type) {
$A.modalInput({ $A.modalInput({
title: `审批`, title: `审批`,
placeholder: `请输入审批意见`, placeholder: `请输入审批意见`,
type:"textarea", type: "textarea",
okText: type == 1 ? "同意" : "拒绝", okText: type == 1 ? "同意" : "拒绝",
okType: type == 1 ? "primary" : "error", okType: type == 1 ? "primary" : "error",
onOk: (desc) => { onOk: (desc) => {
if (type !=1 && !desc) { if (type != 1 && !desc) {
return `请输入审批意见` return `请输入审批意见`
} }
this.$store.dispatch("call", { this.$store.dispatch("call", {
@ -350,9 +358,9 @@ export default {
} }
}).then(({msg}) => { }).then(({msg}) => {
$A.messageSuccess(msg); $A.messageSuccess(msg);
if(this.$route.name=='manage-approve-details' || this.$route.name=='manage-messenger'){ if (this.$route.name == 'manage-approve-details' || this.$route.name == 'manage-messenger') {
this.getInfo() this.getInfo()
}else{ } else {
this.$emit('approve') this.$emit('approve')
} }
}).catch(({msg}) => { }).catch(({msg}) => {
@ -363,7 +371,7 @@ export default {
}); });
}, },
// //
revocation(){ revocation() {
$A.modalConfirm({ $A.modalConfirm({
content: "你确定要撤销吗?", content: "你确定要撤销吗?",
loading: true, loading: true,
@ -379,9 +387,9 @@ export default {
}).then(({msg}) => { }).then(({msg}) => {
$A.messageSuccess(msg); $A.messageSuccess(msg);
resolve(); resolve();
if(this.$route.name=='manage-approve-details' || this.$route.name=='manage-messenger'){ if (this.$route.name == 'manage-approve-details' || this.$route.name == 'manage-messenger') {
this.getInfo() this.getInfo()
}else{ } else {
this.$emit('revocation') this.$emit('revocation')
} }
}).catch(({msg}) => { }).catch(({msg}) => {
@ -394,29 +402,31 @@ export default {
}); });
}, },
// //
comment(){ comment() {
this.commentData.content = "" this.commentData.content = ""
this.commentData.pictures = [] this.commentData.pictures = []
this.commentShow = true; this.commentShow = true;
}, },
// //
confirmComment(){ confirmComment() {
this.loadIng = 1; this.commentLoad++;
this.$store.dispatch("call", { this.$store.dispatch("call", {
method: 'post', method: 'post',
url: 'approve/process/addGlobalComment', url: 'approve/process/addGlobalComment',
data: { data: {
proc_inst_id:this.data.id, proc_inst_id: this.data.id,
content:JSON.stringify({ content: JSON.stringify({
'content': this.commentData.content, 'content': this.commentData.content,
'pictures': this.commentData.pictures.map(h =>{ return h.path; }) 'pictures': this.commentData.pictures.map(h => {
return h.path;
})
}) })
} }
}).then(({msg}) => { }).then(({msg}) => {
$A.messageSuccess("添加成功"); $A.messageSuccess("添加成功");
if(this.$route.name=='manage-approve-details' || this.$route.name=='manage-messenger'){ if (this.$route.name == 'manage-approve-details' || this.$route.name == 'manage-messenger') {
this.getInfo(true) this.getInfo(true)
}else{ } else {
this.$emit('approve') this.$emit('approve')
setTimeout(() => { setTimeout(() => {
this.scrollToBottom() this.scrollToBottom()
@ -426,7 +436,7 @@ export default {
}).catch(({msg}) => { }).catch(({msg}) => {
$A.modalError(msg); $A.modalError(msg);
}).finally(_ => { }).finally(_ => {
this.loadIng--; this.commentLoad--;
}); });
}, },
// //
@ -434,11 +444,11 @@ export default {
const container = this.$refs.approveDetailsBox const container = this.$refs.approveDetailsBox
container.scrollTo({ container.scrollTo({
top: container.scrollHeight + 1000, top: container.scrollHeight + 1000,
behavior: 'smooth' behavior: 'smooth'
}); });
}, },
// //
getContent(content){ getContent(content) {
try { try {
return JSON.parse(content).content || '' return JSON.parse(content).content || ''
} catch (error) { } catch (error) {
@ -446,7 +456,7 @@ export default {
} }
}, },
// //
getPictures(content){ getPictures(content) {
try { try {
return JSON.parse(content).pictures || [] return JSON.parse(content).pictures || []
} catch (error) { } catch (error) {
@ -455,12 +465,8 @@ export default {
}, },
// //
onViewPicture(currentUrl) { onViewPicture(currentUrl) {
this.$store.dispatch("previewImage", $A.apiUrl('../'+currentUrl) ) this.$store.dispatch("previewImage", $A.apiUrl('../' + currentUrl))
} }
} }
} }
</script> </script>
<style scoped>
</style>

View File

@ -9,7 +9,7 @@
</div> </div>
<Button :loading="addLoadIng" type="primary" @click="addApply">{{$L("添加申请")}}</Button> <Button :loading="addLoadIng" type="primary" @click="addApply">{{$L("添加申请")}}</Button>
</div> </div>
<Tabs :value="tabsValue" @on-click="tabsClick" style="margin: 0 20px;height: 100%;" size="small"> <Tabs :value="tabsValue" @on-click="tabsClick" style="margin: 0 20px;height: 100%;" size="small">
<TabPane :label="$L('待办') + (unreadTotal > 0 ? ('('+unreadTotal+')') : '')" name="unread" style="height: 100%;"> <TabPane :label="$L('待办') + (unreadTotal > 0 ? ('('+unreadTotal+')') : '')" name="unread" style="height: 100%;">
<div class="approve-main-search"> <div class="approve-main-search">
@ -131,7 +131,7 @@
</div> </div>
</TabPane> </TabPane>
</Tabs> </Tabs>
</div> </div>
<!--详情--> <!--详情-->
@ -256,17 +256,17 @@ export default {
unreadPage: 1, unreadPage: 1,
unreadTotal: 0, unreadTotal: 0,
unreadLoad: false, unreadLoad: false,
// //
doneList: [], doneList: [],
donePage: 1, donePage: 1,
doneLoad: false, doneLoad: false,
doneTotal: 0, doneTotal: 0,
// //
notifyList: [], notifyList: [],
notifyPage: 1, notifyPage: 1,
notifyLoad: false, notifyLoad: false,
notifyTotal: 0, notifyTotal: 0,
// //
initiatedList: [], initiatedList: [],
initiatedPage: 1, initiatedPage: 1,
initiatedLoad: false, initiatedLoad: false,
@ -423,7 +423,7 @@ export default {
}) })
}, },
// //
handleScroll(e){ handleScroll(e){
if (e.target.scrollTop + e.target.clientHeight >= e.target.scrollHeight) { if (e.target.scrollTop + e.target.clientHeight >= e.target.scrollHeight) {
if(this.tabsValue == 'unread' && !this.unreadLoad && this.unreadList.length < this.unreadTotal){ if(this.tabsValue == 'unread' && !this.unreadLoad && this.unreadList.length < this.unreadTotal){
@ -502,7 +502,7 @@ export default {
} }
}).then(({data}) => { }).then(({data}) => {
let activeId = 0; let activeId = 0;
let activeIndex = 0; let activeIndex = 0;
this.doneTotal = data.total; this.doneTotal = data.total;
if( this.doneList.length == 0 || this.doneList.length == data.total){ if( this.doneList.length == 0 || this.doneList.length == data.total){
this.doneList?.map((res)=>{ if(res._active) activeId = res.id }) this.doneList?.map((res)=>{ if(res._active) activeId = res.id })

View File

@ -148,7 +148,7 @@
@on-clickoutside="operateVisible = false" @on-clickoutside="operateVisible = false"
transfer> transfer>
<div :style="{userSelect:operateVisible ? 'none' : 'auto', height: operateStyles.height}"></div> <div :style="{userSelect:operateVisible ? 'none' : 'auto', height: operateStyles.height}"></div>
<DropdownMenu slot="list"> <DropdownMenu slot="list" class="messenger-dialog-operation">
<DropdownItem @click.native="handleTopClick"> <DropdownItem @click.native="handleTopClick">
{{ $L(operateItem.top_at ? '取消置顶' : '置顶') }} {{ $L(operateItem.top_at ? '取消置顶' : '置顶') }}
</DropdownItem> </DropdownItem>

View File

@ -227,6 +227,12 @@
gap: 10px; gap: 10px;
margin-top: 3px; margin-top: 3px;
} }
.time-text {
> span + span {
padding-left: 4px;
}
}
} }
.approve-record-timeline { .approve-record-timeline {
@ -337,6 +343,7 @@
border-top: 1px solid #F4F4F5; border-top: 1px solid #F4F4F5;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-end;
button { button {
margin: 10px 0; margin: 10px 0;
@ -344,6 +351,17 @@
} }
} }
.approve-load {
position: absolute;
top: 0;
left: 24px;
right: 0;
bottom: 0;
display: flex;
z-index: 9;
background: #ffffff;
}
.comment { .comment {
margin-top: 5px; margin-top: 5px;
margin-left: 45px; margin-left: 45px;

View File

@ -591,6 +591,28 @@
} }
} }
.messenger-dialog-operation {
.item {
display: flex;
align-items: center;
> i {
flex-shrink: 0;
width: 18px;
height: 18px;
line-height: 18px;
font-size: 18px;
margin-right: 8px;
padding: 0;
color: #bbbbbb;
&.ivu-icon {
font-size: 16px;
}
}
}
}
body.window-touch { body.window-touch {
.page-messenger { .page-messenger {
.messenger-wrapper { .messenger-wrapper {

View File

@ -5,40 +5,40 @@
"path": "18", "path": "18",
"icon": "icon.png", "icon": "icon.png",
"list": [ "list": [
{"name": "爱你", "key": "爱你 爱你哟 爱老虎油 爱你啦 亲亲 亲一个 啵啵 比心 笔芯 爱心", "path": "1.gif"}, {"name": "爱你", "key": "爱你哟 爱老虎油 爱你啦 亲亲 亲一个 啵啵", "path": "1.gif"},
{"name": "搬砖", "key": "搬砖 工作 努力", "path": "2.gif"}, {"name": "搬砖", "key": "工作 努力", "path": "2.gif"},
{"name": "不愧是精英", "key": "不愧是精英 精英 大佬 厉害 真棒 你真棒 牛逼 6 666 不愧是你 还得是你", "path": "3.gif"}, {"name": "不愧是精英", "key": "精英 大佬 厉害 真棒 你真棒 牛逼", "path": "3.gif"},
{"name": "不想理你", "key": "生气 不理 不开心 哼 不想理你", "path": "4.gif"}, {"name": "不想理你", "key": "生气 不理 不开心", "path": "4.gif"},
{"name": "不想面对", "key": "不想面对 瑟瑟发抖 体重 担忧 不想理你 又胖了", "path": "5.gif"}, {"name": "不想面对", "key": "瑟瑟发抖 体重", "path": "5.gif"},
{"name": "沉迷工作", "key": "工作 认真 做事 干活 电脑 沉迷工作", "path": "6.gif"}, {"name": "沉迷工作", "key": "工作 认真 做事 干活 电脑", "path": "6.gif"},
{"name": "打卡了么", "key": "打卡 上班 报 记得打卡", "path": "7.gif"}, {"name": "打卡了么", "key": "打卡 上班 报", "path": "7.gif"},
{"name": "发生了啥", "key": "冒泡 浮出水面 发生了啥 八卦 露头 我看看 怎么个事 怎么了", "path": "8.gif"}, {"name": "发生了啥", "key": "冒泡 浮出水面 八卦 露头", "path": "8.gif"},
{"name": "给你个眼神", "key": "眼神 真的 质疑 疑问 不确定 给你个眼神", "path": "9.gif"}, {"name": "给你个眼神", "key": "眼神 真的 质疑 疑问 不确定", "path": "9.gif"},
{"name": "恭喜发财", "key": "恭喜发财 新年好 新年 拜年", "path": "10.gif"}, {"name": "恭喜发财", "key": "新年好 新年 拜年", "path": "10.gif"},
{"name": "跪谢", "key": "谢谢 感动 跪 多谢 THANKS THANK YOU 谢了", "path": "11.gif"}, {"name": "跪谢", "key": "谢谢 感动 跪", "path": "11.gif"},
{"name": "Hi", "key": "Hi 打招呼 欢迎 招呼 你好 哈喽 哈啰 hello 大家好", "path": "12.gif"}, {"name": "Hi", "key": "打招呼 欢迎 招呼 你好", "path": "12.gif"},
{"name": "欢迎欢迎", "key": "欢迎 新人 兴奋 开心 庆祝 喝彩 气氛组", "path": "13.gif"}, {"name": "欢迎欢迎", "key": "欢迎 新人 兴奋 开心 庆祝 喝彩 气氛组", "path": "13.gif"},
{"name": "加油", "key": "加油 喝彩 气氛组", "path": "14.gif"}, {"name": "加油", "key": "喝彩 气氛组", "path": "14.gif"},
{"name": "静静看着你", "key": "静静 看着 不说话 沉默 静静看着你 无语 看你表演", "path": "15.gif"}, {"name": "静静看着你", "key": "静静 看着 不说话 沉默", "path": "15.gif"},
{"name": "开会啦", "key": "开会 会 通知 敲锣 开会啦 开会了", "path": "16.gif"}, {"name": "开会啦", "key": "开会 会 通知 敲锣", "path": "16.gif"},
{"name": "可以吗", "key": "可以吗 害羞 不好意思 脸红 可以 可以不", "path": "17.gif"}, {"name": "可以吗", "key": "害羞 不好意思", "path": "17.gif"},
{"name": "迷之自信", "key": "自信 迷之自信 自我欣赏 自恋 我真帅", "path": "18.gif"}, {"name": "迷之自信", "key": "自信 自我欣赏", "path": "18.gif"},
{"name": "明白", "key": "明白 收到 好的 收 OK", "path": "19.gif"}, {"name": "明白", "key": "收到 好的 收", "path": "19.gif"},
{"name": "摸摸", "key": "摸摸 摸头 你真乖 乖 棒", "path": "20.gif"}, {"name": "摸摸", "key": "摸头 你真乖 乖 棒", "path": "20.gif"},
{"name": "你真棒", "key": "大拇指 你真棒 太棒了 太棒啦 棒棒棒 棒", "path": "21.gif"}, {"name": "你真棒", "key": "大拇指 太棒了 太棒啦 棒棒棒 棒", "path": "21.gif"},
{"name": "佩服", "key": "佩服 五体投地 崇拜 仰慕 牛逼 厉害", "path": "22.gif"}, {"name": "佩服", "key": "五体投地 崇拜 仰慕 牛逼 厉害", "path": "22.gif"},
{"name": "撒花", "key": "撒花 欢迎 花 开心 耶 真好 真棒", "path": "23.gif"}, {"name": "撒花", "key": "欢迎 花 开心", "path": "23.gif"},
{"name": "生日快乐", "key": "生日快乐 吃蛋糕 蛋糕 生日", "path": "24.gif"}, {"name": "生日快乐", "key": "吃蛋糕 蛋糕", "path": "24.gif"},
{"name": "收到", "key": "明白 收到 好的 收 已阅 已读", "path": "25.gif"}, {"name": "收到", "key": "明白 好的 收 已阅 已读", "path": "25.gif"},
{"name": "送你花花", "key": "送花 送你花 花 兴奋 开心 庆祝 喝彩 气氛组", "path": "26.gif"}, {"name": "送你花花", "key": "送花 送你花 花 兴奋 开心 庆祝 喝彩 气氛组", "path": "26.gif"},
{"name": "在线吃瓜", "key": "吃瓜 八卦 看戏 看热闹 在线吃瓜 凑热闹 吃瓜群众 围观", "path": "27.gif"}, {"name": "在线吃瓜", "key": "吃瓜 八卦", "path": "27.gif"},
{"name": "我错了", "key": "认错 错了 哭 难过 悲伤 我错了 对不起 道歉", "path": "28.gif"}, {"name": "我错了", "key": "认错 错了 哭 难过", "path": "28.gif"},
{"name": "我太难了", "key": "我太难了 太难了 难过 不开心 委屈", "path": "29.gif"}, {"name": "我太难了", "key": "太难了 难过 不开心 委屈", "path": "29.gif"},
{"name": "笑而不语", "key": "笑 不说话 静静 不发表 沉默", "path": "30.gif"}, {"name": "笑而不语", "key": "笑 不说话 静静 不发表", "path": "30.gif"},
{"name": "行行好吧", "key": "行行好 乞丐 乞求 请求 求助 给点吧", "path": "31.gif"}, {"name": "行行好吧", "key": "行行好 乞丐 乞求 请求 求助", "path": "31.gif"},
{"name": "幸福", "key": "幸福 满足 洗澡 泡澡 开心", "path": "32.gif"}, {"name": "幸福", "key": "满足 洗澡 泡澡", "path": "32.gif"},
{"name": "赞", "key": "大拇指 点赞 厉害 你真棒 太棒了 太棒啦 棒棒棒 棒 6 666 牛", "path": "33.gif"}, {"name": "赞", "key": "大拇指 点赞 厉害 你真棒 太棒了 太棒啦 棒棒棒 棒", "path": "33.gif"},
{"name": "走人了", "key": "下班 闪人 走人 溜人 走了 关机", "path": "34.gif"} {"name": "走人了", "key": "下班 闪人 走人 溜人", "path": "34.gif"}
] ]
}, },
{ {