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']));

View File

@ -850,7 +850,7 @@ class WebSocketDialogMsg extends AbstractModel
$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)

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"/>
@ -161,16 +163,21 @@
</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,19 +190,18 @@
</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: {
@ -208,11 +214,13 @@ export default {
data() { data() {
return { return {
modalTransferIndex:window.modalTransferIndex,
datas: {}, datas: {},
showTimeNum:24,
commentShow:false,
loadIng: 0, loadIng: 0,
showTimeNum: 24,
modalTransferIndex: window.modalTransferIndex,
commentLoad: 0,
commentShow: false,
commentData: { commentData: {
content: "", content: "",
pictures: [] pictures: []
@ -401,7 +409,7 @@ export default {
}, },
// //
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',
@ -409,7 +417,9 @@ export default {
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}) => {
@ -426,7 +436,7 @@ export default {
}).catch(({msg}) => { }).catch(({msg}) => {
$A.modalError(msg); $A.modalError(msg);
}).finally(_ => { }).finally(_ => {
this.loadIng--; this.commentLoad--;
}); });
}, },
// //
@ -460,7 +470,3 @@ export default {
} }
} }
</script> </script>
<style scoped>
</style>

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"}
] ]
}, },
{ {