mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-06 13:15:35 +00:00
perf: 支持在团队管理打开群聊
This commit is contained in:
parent
1dd4e8da71
commit
3cafac99ff
@ -259,6 +259,9 @@ class DialogController extends AbstractController
|
|||||||
->where('d.id', $dialog_id)
|
->where('d.id', $dialog_id)
|
||||||
->whereNull('d.deleted_at')
|
->whereNull('d.deleted_at')
|
||||||
->first();
|
->first();
|
||||||
|
if (empty($item)) {
|
||||||
|
return Base::retError('不在成员列表内');
|
||||||
|
}
|
||||||
return Base::retSuccess('success', WebSocketDialog::synthesizeData($item, $user->userid));
|
return Base::retSuccess('success', WebSocketDialog::synthesizeData($item, $user->userid));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1959,3 +1959,4 @@ API请求的URL路径
|
|||||||
获取本地模型列表
|
获取本地模型列表
|
||||||
|
|
||||||
任务超期未完成
|
任务超期未完成
|
||||||
|
打开部门群
|
||||||
|
|||||||
@ -299,7 +299,7 @@
|
|||||||
v-model="allUserShow"
|
v-model="allUserShow"
|
||||||
placement="right"
|
placement="right"
|
||||||
:size="1380">
|
:size="1380">
|
||||||
<TeamManagement v-if="allUserShow"/>
|
<TeamManagement v-if="allUserShow" @on-close="allUserShow=false"/>
|
||||||
</DrawerOverlay>
|
</DrawerOverlay>
|
||||||
|
|
||||||
<!--查看所有项目-->
|
<!--查看所有项目-->
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
<li
|
<li
|
||||||
v-for="item in departmentList"
|
v-for="item in departmentList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:class="[`level-${item.level}`, departmentSelect === item.id ? 'active' : '']"
|
:class="[`level-${item.level}`, departmentSelect === item.id || departmentOperation === item.id ? 'active' : '']"
|
||||||
@click="onSelectDepartment(item.id)">
|
@click="onSelectDepartment(item.id)">
|
||||||
<UserAvatarTip :userid="item.owner_userid" :size="20" class="department-icon">
|
<UserAvatarTip :userid="item.owner_userid" :size="20" class="department-icon">
|
||||||
<p><strong>{{$L('部门负责人')}}</strong></p>
|
<p><strong>{{$L('部门负责人')}}</strong></p>
|
||||||
@ -40,12 +40,16 @@
|
|||||||
<EDropdown
|
<EDropdown
|
||||||
size="medium"
|
size="medium"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
|
@visible-change="onVcDepartment($event, item.id)"
|
||||||
@command="onOpDepartment">
|
@command="onOpDepartment">
|
||||||
<i @click.stop="" class="taskfont department-menu"></i>
|
<i @click.stop="" class="taskfont department-menu"></i>
|
||||||
<EDropdownMenu slot="dropdown">
|
<EDropdownMenu slot="dropdown">
|
||||||
<EDropdownItem v-if="item.level <= 2" :command="`add_${item.id}`">
|
<EDropdownItem v-if="item.level <= 2" :command="`add_${item.id}`">
|
||||||
<div>{{$L('添加子部门')}}</div>
|
<div>{{$L('添加子部门')}}</div>
|
||||||
</EDropdownItem>
|
</EDropdownItem>
|
||||||
|
<EDropdownItem v-if="item.dialog_id" :command="`dialog_${item.dialog_id}`">
|
||||||
|
<div>{{$L('打开部门群')}}</div>
|
||||||
|
</EDropdownItem>
|
||||||
<EDropdownItem :command="`edit_${item.id}`">
|
<EDropdownItem :command="`edit_${item.id}`">
|
||||||
<div>{{$L('编辑')}}</div>
|
<div>{{$L('编辑')}}</div>
|
||||||
</EDropdownItem>
|
</EDropdownItem>
|
||||||
@ -795,6 +799,7 @@ export default {
|
|||||||
dialog_useid: 0
|
dialog_useid: 0
|
||||||
},
|
},
|
||||||
departmentList: [],
|
departmentList: [],
|
||||||
|
departmentOperation: 0,
|
||||||
|
|
||||||
dialogLoad: false,
|
dialogLoad: false,
|
||||||
dialogList: [],
|
dialogList: [],
|
||||||
@ -1259,17 +1264,38 @@ export default {
|
|||||||
this.departmentSelect = id
|
this.departmentSelect = id
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onVcDepartment(visible, id) {
|
||||||
|
this.departmentOperation = visible ? id : 0;
|
||||||
|
},
|
||||||
|
|
||||||
onOpDepartment(val) {
|
onOpDepartment(val) {
|
||||||
if ($A.leftExists(val, 'add_')) {
|
if ($A.leftExists(val, 'add_')) {
|
||||||
this.onShowDepartment({
|
this.onShowDepartment({
|
||||||
parent_id: parseInt(val.substr(4))
|
parent_id: parseInt(val.substr(4))
|
||||||
})
|
})
|
||||||
} else if ($A.leftExists(val, 'edit_')) {
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($A.leftExists(val, 'edit_')) {
|
||||||
const editItem = this.departmentList.find(({id}) => id === parseInt(val.substr(5)))
|
const editItem = this.departmentList.find(({id}) => id === parseInt(val.substr(5)))
|
||||||
if (editItem) {
|
if (editItem) {
|
||||||
this.onShowDepartment(editItem)
|
this.onShowDepartment(editItem)
|
||||||
}
|
}
|
||||||
} else if ($A.leftExists(val, 'del_')) {
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($A.leftExists(val, 'dialog_')) {
|
||||||
|
const dialogId = parseInt(val.substr(7))
|
||||||
|
this.$store.dispatch("openDialog", dialogId).then(() => {
|
||||||
|
this.goForward({name: 'manage-messenger'})
|
||||||
|
this.$emit('on-close')
|
||||||
|
}).catch(({msg}) => {
|
||||||
|
$A.modalError(msg || this.$L('打开会话失败'))
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($A.leftExists(val, 'del_')) {
|
||||||
const delItem = this.departmentList.find(({id}) => id === parseInt(val.substr(4)))
|
const delItem = this.departmentList.find(({id}) => id === parseInt(val.substr(4)))
|
||||||
if (delItem) {
|
if (delItem) {
|
||||||
$A.modalConfirm({
|
$A.modalConfirm({
|
||||||
|
|||||||
5
resources/assets/js/store/actions.js
vendored
5
resources/assets/js/store/actions.js
vendored
@ -2919,7 +2919,7 @@ export default {
|
|||||||
* @returns {Promise<unknown>}
|
* @returns {Promise<unknown>}
|
||||||
*/
|
*/
|
||||||
openDialog({state, dispatch}, dialog_id) {
|
openDialog({state, dispatch}, dialog_id) {
|
||||||
return new Promise(async resolve => {
|
return new Promise(async (resolve, reject) => {
|
||||||
let search_msg_id;
|
let search_msg_id;
|
||||||
let dialog_msg_id;
|
let dialog_msg_id;
|
||||||
if ($A.isJson(dialog_id)) {
|
if ($A.isJson(dialog_id)) {
|
||||||
@ -2933,7 +2933,8 @@ export default {
|
|||||||
try {
|
try {
|
||||||
await dispatch("getDialogOne", dialog_id)
|
await dispatch("getDialogOne", dialog_id)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn(e);
|
reject(e);
|
||||||
|
return;
|
||||||
} finally {
|
} finally {
|
||||||
dispatch("hiddenSpinner")
|
dispatch("hiddenSpinner")
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user