mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 19:35:50 +00:00
perf: 优化快捷创建群组
This commit is contained in:
parent
78ad3468ae
commit
617fe902a4
@ -186,7 +186,9 @@
|
|||||||
<Icon type="ios-arrow-down"></Icon>
|
<Icon type="ios-arrow-down"></Icon>
|
||||||
</Button>
|
</Button>
|
||||||
<DropdownMenu slot="list">
|
<DropdownMenu slot="list">
|
||||||
|
<DropdownItem name="project">{{$L('新建项目')}} ({{mateName}}+B)</DropdownItem>
|
||||||
<DropdownItem name="task">{{$L('新建任务')}} ({{mateName}}+K)</DropdownItem>
|
<DropdownItem name="task">{{$L('新建任务')}} ({{mateName}}+K)</DropdownItem>
|
||||||
|
<DropdownItem name="group">{{$L('创建群组')}} ({{mateName}}+U)</DropdownItem>
|
||||||
<DropdownItem name="createMeeting">{{$L('新会议')}} ({{mateName}}+J)</DropdownItem>
|
<DropdownItem name="createMeeting">{{$L('新会议')}} ({{mateName}}+J)</DropdownItem>
|
||||||
<DropdownItem name="joinMeeting">{{$L('加入会议')}}</DropdownItem>
|
<DropdownItem name="joinMeeting">{{$L('加入会议')}}</DropdownItem>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
@ -242,6 +244,28 @@
|
|||||||
<TaskAdd ref="addTask" v-model="addTaskShow"/>
|
<TaskAdd ref="addTask" v-model="addTaskShow"/>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
|
<!--创建群组-->
|
||||||
|
<Modal
|
||||||
|
v-model="createGroupShow"
|
||||||
|
:title="$L('创建群组')"
|
||||||
|
:mask-closable="false">
|
||||||
|
<Form :model="createGroupData" label-width="auto" @submit.native.prevent>
|
||||||
|
<FormItem prop="avatar" :label="$L('群头像')">
|
||||||
|
<ImgUpload v-model="createGroupData.avatar" :num="1" :width="512" :height="512" :whcut="1"/>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem prop="userids" :label="$L('群成员')">
|
||||||
|
<UserSelect v-model="createGroupData.userids" :uncancelable="createGroupData.uncancelable" :multiple-max="100" show-bot :title="$L('选择项目成员')"/>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem prop="chat_name" :label="$L('群名称')">
|
||||||
|
<Input v-model="createGroupData.chat_name" :placeholder="$L('输入群名称(选填)')"/>
|
||||||
|
</FormItem>
|
||||||
|
</Form>
|
||||||
|
<div slot="footer" class="adaption">
|
||||||
|
<Button type="default" @click="createGroupShow=false">{{$L('取消')}}</Button>
|
||||||
|
<Button type="primary" :loading="createGroupLoad > 0" @click="submitCreateGroup">{{$L('创建')}}</Button>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
|
||||||
<!--导出任务统计-->
|
<!--导出任务统计-->
|
||||||
<TaskExport v-model="exportTaskShow"/>
|
<TaskExport v-model="exportTaskShow"/>
|
||||||
|
|
||||||
@ -335,9 +359,12 @@ import MicroApps from "../components/MicroApps.vue";
|
|||||||
import notificationKoro from "notification-koro1";
|
import notificationKoro from "notification-koro1";
|
||||||
import {Store} from "le5le-store";
|
import {Store} from "le5le-store";
|
||||||
import {MarkdownPreview} from "../store/markdown";
|
import {MarkdownPreview} from "../store/markdown";
|
||||||
|
import UserSelect from "../components/UserSelect.vue";
|
||||||
|
import ImgUpload from "../components/ImgUpload.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
ImgUpload, UserSelect,
|
||||||
TaskExport,
|
TaskExport,
|
||||||
CheckinExport,
|
CheckinExport,
|
||||||
ApproveExport,
|
ApproveExport,
|
||||||
@ -379,6 +406,11 @@ export default {
|
|||||||
addTaskShow: false,
|
addTaskShow: false,
|
||||||
addTaskSubscribe: null,
|
addTaskSubscribe: null,
|
||||||
|
|
||||||
|
createGroupShow: false,
|
||||||
|
createGroupData: {},
|
||||||
|
createGroupLoad: 0,
|
||||||
|
createGroupSubscribe: null,
|
||||||
|
|
||||||
exportTaskShow: false,
|
exportTaskShow: false,
|
||||||
exportCheckinShow: false,
|
exportCheckinShow: false,
|
||||||
exportApproveShow: false,
|
exportApproveShow: false,
|
||||||
@ -418,6 +450,7 @@ export default {
|
|||||||
this.notificationInit();
|
this.notificationInit();
|
||||||
//
|
//
|
||||||
this.addTaskSubscribe = Store.subscribe('addTask', this.onAddTask);
|
this.addTaskSubscribe = Store.subscribe('addTask', this.onAddTask);
|
||||||
|
this.createGroupSubscribe = Store.subscribe('createGroup', this.onCreateGroup);
|
||||||
this.dialogMsgSubscribe = Store.subscribe('dialogMsgPush', this.addDialogMsg);
|
this.dialogMsgSubscribe = Store.subscribe('dialogMsgPush', this.addDialogMsg);
|
||||||
//
|
//
|
||||||
document.addEventListener('keydown', this.shortcutEvent);
|
document.addEventListener('keydown', this.shortcutEvent);
|
||||||
@ -441,6 +474,10 @@ export default {
|
|||||||
this.addTaskSubscribe.unsubscribe();
|
this.addTaskSubscribe.unsubscribe();
|
||||||
this.addTaskSubscribe = null;
|
this.addTaskSubscribe = null;
|
||||||
}
|
}
|
||||||
|
if (this.createGroupSubscribe) {
|
||||||
|
this.createGroupSubscribe.unsubscribe();
|
||||||
|
this.createGroupSubscribe = null;
|
||||||
|
}
|
||||||
if (this.dialogMsgSubscribe) {
|
if (this.dialogMsgSubscribe) {
|
||||||
this.dialogMsgSubscribe.unsubscribe();
|
this.dialogMsgSubscribe.unsubscribe();
|
||||||
this.dialogMsgSubscribe = null;
|
this.dialogMsgSubscribe = null;
|
||||||
@ -846,10 +883,18 @@ export default {
|
|||||||
|
|
||||||
onAddMenu(name) {
|
onAddMenu(name) {
|
||||||
switch (name) {
|
switch (name) {
|
||||||
|
case 'project':
|
||||||
|
this.onAddShow()
|
||||||
|
break;
|
||||||
|
|
||||||
case 'task':
|
case 'task':
|
||||||
this.onAddTask(0)
|
this.onAddTask(0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'group':
|
||||||
|
this.onCreateGroup([this.userId])
|
||||||
|
break;
|
||||||
|
|
||||||
case 'createMeeting':
|
case 'createMeeting':
|
||||||
Store.set('addMeeting', {
|
Store.set('addMeeting', {
|
||||||
type: 'create',
|
type: 'create',
|
||||||
@ -922,17 +967,21 @@ export default {
|
|||||||
this.onAddShow()
|
this.onAddShow()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 75:
|
||||||
|
case 78: // K/N - 新建任务
|
||||||
|
e.preventDefault();
|
||||||
|
this.onAddMenu('task')
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 85: // U - 创建群组
|
||||||
|
this.onCreateGroup([this.userId])
|
||||||
|
break;
|
||||||
|
|
||||||
case 74: // J - 新会议
|
case 74: // J - 新会议
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.onAddMenu('createMeeting')
|
this.onAddMenu('createMeeting')
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 75:
|
|
||||||
case 78: // K/N - 加入会议
|
|
||||||
e.preventDefault();
|
|
||||||
this.onAddMenu('task')
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 83: // S - 保存任务
|
case 83: // S - 保存任务
|
||||||
if (this.$refs.taskModal.checkUpdate()) {
|
if (this.$refs.taskModal.checkUpdate()) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@ -966,6 +1015,33 @@ export default {
|
|||||||
this.$store.dispatch("openTask", task)
|
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) {
|
addDialogMsg(data) {
|
||||||
if (!this.natificationReady && !this.$isEEUiApp) {
|
if (!this.natificationReady && !this.$isEEUiApp) {
|
||||||
return; // 通知未准备好不通知
|
return; // 通知未准备好不通知
|
||||||
|
|||||||
@ -395,28 +395,6 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<!--创建群组-->
|
|
||||||
<Modal
|
|
||||||
v-model="createGroupShow"
|
|
||||||
:title="$L('创建群组')"
|
|
||||||
:mask-closable="false">
|
|
||||||
<Form :model="createGroupData" label-width="auto" @submit.native.prevent>
|
|
||||||
<FormItem prop="avatar" :label="$L('群头像')">
|
|
||||||
<ImgUpload v-model="createGroupData.avatar" :num="1" :width="512" :height="512" :whcut="1"/>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem prop="userids" :label="$L('群成员')">
|
|
||||||
<UserSelect v-model="createGroupData.userids" :uncancelable="createGroupData.uncancelable" :multiple-max="100" show-bot :title="$L('选择项目成员')"/>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem prop="chat_name" :label="$L('群名称')">
|
|
||||||
<Input v-model="createGroupData.chat_name" :placeholder="$L('输入群名称(选填)')"/>
|
|
||||||
</FormItem>
|
|
||||||
</Form>
|
|
||||||
<div slot="footer" class="adaption">
|
|
||||||
<Button type="default" @click="createGroupShow=false">{{$L('取消')}}</Button>
|
|
||||||
<Button type="primary" :loading="createGroupLoad > 0" @click="onCreateGroup">{{$L('创建')}}</Button>
|
|
||||||
</div>
|
|
||||||
</Modal>
|
|
||||||
|
|
||||||
<!--修改资料-->
|
<!--修改资料-->
|
||||||
<Modal
|
<Modal
|
||||||
v-model="modifyShow"
|
v-model="modifyShow"
|
||||||
@ -772,10 +750,6 @@ export default {
|
|||||||
searchLocation: 1,
|
searchLocation: 1,
|
||||||
searchResult: [],
|
searchResult: [],
|
||||||
|
|
||||||
createGroupShow: false,
|
|
||||||
createGroupData: {},
|
|
||||||
createGroupLoad: 0,
|
|
||||||
|
|
||||||
modifyShow: false,
|
modifyShow: false,
|
||||||
modifyData: {},
|
modifyData: {},
|
||||||
modifyLoad: 0,
|
modifyLoad: 0,
|
||||||
@ -2460,8 +2434,7 @@ export default {
|
|||||||
if (this.dialogData.dialog_user && this.userId != this.dialogData.dialog_user.userid) {
|
if (this.dialogData.dialog_user && this.userId != this.dialogData.dialog_user.userid) {
|
||||||
userids.push(this.dialogData.dialog_user.userid)
|
userids.push(this.dialogData.dialog_user.userid)
|
||||||
}
|
}
|
||||||
this.createGroupData = {userids, uncancelable: [this.userId]}
|
Store.set('createGroup', userids);
|
||||||
this.createGroupShow = true
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "modifyNormal":
|
case "modifyNormal":
|
||||||
@ -2606,24 +2579,6 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onCreateGroup() {
|
|
||||||
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)
|
|
||||||
}).catch(({msg}) => {
|
|
||||||
$A.modalError(msg);
|
|
||||||
}).finally(_ => {
|
|
||||||
this.createGroupLoad--;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
onModify() {
|
onModify() {
|
||||||
if (this.modifyData.userid) {
|
if (this.modifyData.userid) {
|
||||||
// 个人头像(机器人)
|
// 个人头像(机器人)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user