diff --git a/resources/assets/js/pages/manage.vue b/resources/assets/js/pages/manage.vue index 234b55f70..c60cdd1aa 100644 --- a/resources/assets/js/pages/manage.vue +++ b/resources/assets/js/pages/manage.vue @@ -186,7 +186,9 @@ + {{$L('新建项目')}} ({{mateName}}+B) {{$L('新建任务')}} ({{mateName}}+K) + {{$L('创建群组')}} ({{mateName}}+U) {{$L('新会议')}} ({{mateName}}+J) {{$L('加入会议')}} @@ -242,6 +244,28 @@ + + +
+ + + + + + + + + +
+
+ + +
+
+ @@ -335,9 +359,12 @@ import MicroApps from "../components/MicroApps.vue"; import notificationKoro from "notification-koro1"; import {Store} from "le5le-store"; import {MarkdownPreview} from "../store/markdown"; +import UserSelect from "../components/UserSelect.vue"; +import ImgUpload from "../components/ImgUpload.vue"; export default { components: { + ImgUpload, UserSelect, TaskExport, CheckinExport, ApproveExport, @@ -379,6 +406,11 @@ export default { addTaskShow: false, addTaskSubscribe: null, + createGroupShow: false, + createGroupData: {}, + createGroupLoad: 0, + createGroupSubscribe: null, + exportTaskShow: false, exportCheckinShow: false, exportApproveShow: false, @@ -418,6 +450,7 @@ export default { this.notificationInit(); // this.addTaskSubscribe = Store.subscribe('addTask', this.onAddTask); + this.createGroupSubscribe = Store.subscribe('createGroup', this.onCreateGroup); this.dialogMsgSubscribe = Store.subscribe('dialogMsgPush', this.addDialogMsg); // document.addEventListener('keydown', this.shortcutEvent); @@ -441,6 +474,10 @@ export default { this.addTaskSubscribe.unsubscribe(); this.addTaskSubscribe = null; } + if (this.createGroupSubscribe) { + this.createGroupSubscribe.unsubscribe(); + this.createGroupSubscribe = null; + } if (this.dialogMsgSubscribe) { this.dialogMsgSubscribe.unsubscribe(); this.dialogMsgSubscribe = null; @@ -846,10 +883,18 @@ export default { onAddMenu(name) { switch (name) { + case 'project': + this.onAddShow() + break; + case 'task': this.onAddTask(0) break; + case 'group': + this.onCreateGroup([this.userId]) + break; + case 'createMeeting': Store.set('addMeeting', { type: 'create', @@ -922,15 +967,19 @@ export default { this.onAddShow() break; - case 74: // J - 新会议 + case 75: + case 78: // K/N - 新建任务 e.preventDefault(); - this.onAddMenu('createMeeting') + this.onAddMenu('task') break; - case 75: - case 78: // K/N - 加入会议 + case 85: // U - 创建群组 + this.onCreateGroup([this.userId]) + break; + + case 74: // J - 新会议 e.preventDefault(); - this.onAddMenu('task') + this.onAddMenu('createMeeting') break; case 83: // S - 保存任务 @@ -966,6 +1015,33 @@ export default { this.$store.dispatch("openTask", task) }, + onCreateGroup(userids) { + if (!$A.isArray(userids)) { + userids = [] + } + this.createGroupData = {userids, uncancelable: [this.userId]} + this.createGroupShow = true + }, + + submitCreateGroup() { + this.createGroupLoad++; + this.$store.dispatch("call", { + url: 'dialog/group/add', + data: this.createGroupData + }).then(({data, msg}) => { + $A.messageSuccess(msg); + this.createGroupShow = false; + this.createGroupData = {}; + this.$store.dispatch("saveDialog", data); + this.$store.dispatch('openDialog', data.id) + this.toggleRoute('messenger', {dialogAction: 'dialog'}) + }).catch(({msg}) => { + $A.modalError(msg); + }).finally(_ => { + this.createGroupLoad--; + }); + }, + addDialogMsg(data) { if (!this.natificationReady && !this.$isEEUiApp) { return; // 通知未准备好不通知 diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index 3d8c29f15..4be08af58 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -395,28 +395,6 @@ - - -
- - - - - - - - - -
-
- - -
-
- { - $A.messageSuccess(msg); - this.createGroupShow = false; - this.createGroupData = {}; - this.$store.dispatch("saveDialog", data); - this.$store.dispatch('openDialog', data.id) - }).catch(({msg}) => { - $A.modalError(msg); - }).finally(_ => { - this.createGroupLoad--; - }); - }, - onModify() { if (this.modifyData.userid) { // 个人头像(机器人)