no message
This commit is contained in:
parent
438f74fac9
commit
3f69a3e6dd
@ -169,13 +169,26 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['userId', 'userInfo', 'dialogMsgUnread', 'projectList', 'projectOpenTask']),
|
...mapState(['userId', 'userInfo', 'dialogMsgUnread', 'projectList', 'projectOpenTask', 'projectChatShow']),
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
'$route' (route) {
|
'$route' (route) {
|
||||||
this.curPath = route.path;
|
this.curPath = route.path;
|
||||||
},
|
},
|
||||||
|
'projectOpenTask._show' (show) {
|
||||||
|
if (show) {
|
||||||
|
if (this.projectChatShow) {
|
||||||
|
this._projectChatShow = true;
|
||||||
|
this.$store.dispatch("toggleBoolean", "projectChatShow");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (this._projectChatShow) {
|
||||||
|
this._projectChatShow = false;
|
||||||
|
this.$store.dispatch("toggleBoolean", "projectChatShow");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -267,7 +267,7 @@
|
|||||||
<li v-for="file in taskDetail.files">
|
<li v-for="file in taskDetail.files">
|
||||||
<img v-if="file.id" class="file-ext" :src="file.thumb"/>
|
<img v-if="file.id" class="file-ext" :src="file.thumb"/>
|
||||||
<Loading v-else class="file-load"/>
|
<Loading v-else class="file-load"/>
|
||||||
<div class="file-name">{{file.name}}</div>
|
<a class="file-name" :href="file.path||'javascript:;'" target="_blank">{{file.name}}</a>
|
||||||
<div class="file-size">{{$A.bytesToSize(file.size)}}</div>
|
<div class="file-size">{{$A.bytesToSize(file.size)}}</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -583,14 +583,14 @@ export default {
|
|||||||
openTask: {
|
openTask: {
|
||||||
handler(data) {
|
handler(data) {
|
||||||
this.taskDetail = $A.cloneJSON(data);
|
this.taskDetail = $A.cloneJSON(data);
|
||||||
this.$store.dispatch("getDialogMsgList", this.taskDetail.dialog_id);
|
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true,
|
||||||
deep: true
|
deep: true
|
||||||
},
|
},
|
||||||
'openTask._show' (v) {
|
'openTask._show' (show) {
|
||||||
if (v) {
|
if (show) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
this.$store.dispatch("getDialogMsgList", this.taskDetail.dialog_id)
|
||||||
this.$refs.input.focus()
|
this.$refs.input.focus()
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
</EDropdownMenu>
|
</EDropdownMenu>
|
||||||
</EDropdown>
|
</EDropdown>
|
||||||
<div class="item-title" @click="openTask(item)">{{item.name}}</div>
|
<div class="item-title" @click="openTask(item)">{{item.name}}</div>
|
||||||
<div class="item-icons">
|
<div class="item-icons" @click="openTask(item)">
|
||||||
<div v-if="item.file_num > 0" class="item-icon">{{item.file_num}}<Icon type="ios-link-outline" /></div>
|
<div v-if="item.file_num > 0" class="item-icon">{{item.file_num}}<Icon type="ios-link-outline" /></div>
|
||||||
<div v-if="item.msg_num > 0" class="item-icon">{{item.msg_num}}<Icon type="ios-chatbubbles-outline" /></div>
|
<div v-if="item.msg_num > 0" class="item-icon">{{item.msg_num}}<Icon type="ios-chatbubbles-outline" /></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -8,6 +8,12 @@
|
|||||||
<Input prefix="ios-search" v-model="dialogKey" :placeholder="$L('搜索...')" clearable />
|
<Input prefix="ios-search" v-model="dialogKey" :placeholder="$L('搜索...')" clearable />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="tabActive==='dialog'" class="messenger-nav">
|
||||||
|
<p :class="{active:dialogType==''}" @click="dialogType=''">{{$L('全部')}}</p>
|
||||||
|
<p :class="{active:dialogType=='project'}" @click="dialogType='project'">{{$L('项目')}}</p>
|
||||||
|
<p :class="{active:dialogType=='task'}" @click="dialogType='task'">{{$L('任务')}}</p>
|
||||||
|
<p :class="{active:dialogType=='user'}" @click="dialogType='user'">{{$L('个人')}}</p>
|
||||||
|
</div>
|
||||||
<div ref="list" class="messenger-list overlay-y">
|
<div ref="list" class="messenger-list overlay-y">
|
||||||
<ul v-if="tabActive==='dialog'" class="dialog">
|
<ul v-if="tabActive==='dialog'" class="dialog">
|
||||||
<li
|
<li
|
||||||
@ -15,7 +21,11 @@
|
|||||||
:key="key"
|
:key="key"
|
||||||
:class="{active: dialog.id == dialogId}"
|
:class="{active: dialog.id == dialogId}"
|
||||||
@click="openDialog(dialog, true)">
|
@click="openDialog(dialog, true)">
|
||||||
<Icon v-if="dialog.type=='group'" class="icon-avatar" type="ios-people" />
|
<template v-if="dialog.type=='group'">
|
||||||
|
<Icon v-if="dialog.group_type=='project'" class="icon-avatar project" type="logo-buffer" />
|
||||||
|
<Icon v-else-if="dialog.group_type=='task'" class="icon-avatar task" type="md-checkbox-outline" />
|
||||||
|
<Icon v-else class="icon-avatar" type="ios-people" />
|
||||||
|
</template>
|
||||||
<div v-else-if="dialog.dialog_user" class="user-avatar"><UserAvatar :userid="dialog.dialog_user.userid" :size="46" hide-icon-menu/></div>
|
<div v-else-if="dialog.dialog_user" class="user-avatar"><UserAvatar :userid="dialog.dialog_user.userid" :size="46" hide-icon-menu/></div>
|
||||||
<Icon v-else class="icon-avatar" type="md-person" />
|
<Icon v-else class="icon-avatar" type="md-person" />
|
||||||
<div class="dialog-box">
|
<div class="dialog-box">
|
||||||
@ -72,6 +82,7 @@ export default {
|
|||||||
|
|
||||||
dialogLoad: 0,
|
dialogLoad: 0,
|
||||||
dialogKey: '',
|
dialogKey: '',
|
||||||
|
dialogType: '',
|
||||||
|
|
||||||
contactsLoad: 0,
|
contactsLoad: 0,
|
||||||
contactsLists: null,
|
contactsLists: null,
|
||||||
@ -97,18 +108,36 @@ export default {
|
|||||||
...mapState(['userId', 'dialogId', 'dialogList']),
|
...mapState(['userId', 'dialogId', 'dialogList']),
|
||||||
|
|
||||||
dialogLists() {
|
dialogLists() {
|
||||||
const {dialogKey} = this;
|
const {dialogType, dialogKey} = this;
|
||||||
if (dialogKey == '') {
|
if (dialogType == '' && dialogKey == '') {
|
||||||
return this.dialogList;
|
return this.dialogList;
|
||||||
}
|
}
|
||||||
return this.dialogList.filter(({name, last_msg}) => {
|
return this.dialogList.filter(({name, type, group_type, last_msg}) => {
|
||||||
if ($A.strExists(name, dialogKey)) {
|
if (dialogType) {
|
||||||
return true;
|
switch (dialogType) {
|
||||||
|
case 'project':
|
||||||
|
case 'task':
|
||||||
|
if (group_type != dialogType) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'user':
|
||||||
|
if (type != 'user') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (last_msg && last_msg.type === 'text' && $A.strExists(last_msg.msg.text, dialogKey)) {
|
if (dialogKey) {
|
||||||
return true;
|
let existName = $A.strExists(name, dialogKey);
|
||||||
|
let existMsg = last_msg && last_msg.type === 'text' && $A.strExists(last_msg.msg.text, dialogKey);
|
||||||
|
if (!existName && !existMsg) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return true;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -223,6 +252,20 @@ export default {
|
|||||||
behavior: smooth === true ? 'smooth' : 'instant',
|
behavior: smooth === true ? 'smooth' : 'instant',
|
||||||
scrollMode: 'if-needed',
|
scrollMode: 'if-needed',
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
let dialog = this.dialogList.find(({id}) => id == this.dialogId)
|
||||||
|
if (dialog && this.dialogType) {
|
||||||
|
this.dialogType = '';
|
||||||
|
this.$nextTick(() => {
|
||||||
|
let active = this.$refs.list.querySelector(".active")
|
||||||
|
if (active) {
|
||||||
|
scrollIntoView(active, {
|
||||||
|
behavior: smooth === true ? 'smooth' : 'instant',
|
||||||
|
scrollMode: 'if-needed',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
4
resources/assets/js/store/actions.js
vendored
4
resources/assets/js/store/actions.js
vendored
@ -507,10 +507,6 @@ export default {
|
|||||||
* @param task_id
|
* @param task_id
|
||||||
*/
|
*/
|
||||||
openTask({state, dispatch}, task_id) {
|
openTask({state, dispatch}, task_id) {
|
||||||
if (state.projectChatShow) {
|
|
||||||
dispatch("toggleBoolean", "projectChatShow");
|
|
||||||
}
|
|
||||||
//
|
|
||||||
let data = state.method.isJson(task_id) ? task_id : {id: task_id};
|
let data = state.method.isJson(task_id) ? task_id : {id: task_id};
|
||||||
state.projectDetail.project_column.some(({project_task}) => {
|
state.projectDetail.project_column.some(({project_task}) => {
|
||||||
const task = project_task.find(({id}) => id === data.id);
|
const task = project_task.find(({id}) => id === data.id);
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
margin-left: 16px;
|
margin-left: 16px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.3s;
|
transition: box-shadow 0.3s;
|
||||||
&:hover {
|
&:hover {
|
||||||
box-shadow: 0 0 6px #cccccc;
|
box-shadow: 0 0 6px #cccccc;
|
||||||
}
|
}
|
||||||
|
@ -157,10 +157,14 @@
|
|||||||
width: 16px;
|
width: 16px;
|
||||||
}
|
}
|
||||||
.file-name {
|
.file-name {
|
||||||
|
color: #515a6e;
|
||||||
padding-left: 8px;
|
padding-left: 8px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
&:hover {
|
||||||
|
color: #2d8cf0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.file-size {
|
.file-size {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
26
resources/assets/sass/pages/page-messenger.scss
vendored
26
resources/assets/sass/pages/page-messenger.scss
vendored
@ -46,6 +46,25 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.messenger-nav {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 2px 0 12px;
|
||||||
|
> p {
|
||||||
|
line-height: 1;
|
||||||
|
padding: 0 16px;
|
||||||
|
color: #888888;
|
||||||
|
cursor: pointer;
|
||||||
|
&.active {
|
||||||
|
color: #555555;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
color: #777777;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
.messenger-list {
|
.messenger-list {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
height: 0;
|
height: 0;
|
||||||
@ -91,6 +110,13 @@
|
|||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
background-color: #61B2F9;
|
background-color: #61B2F9;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
|
&.project {
|
||||||
|
background-color: #7274E3;
|
||||||
|
}
|
||||||
|
&.task {
|
||||||
|
background-color: #4EA3F4;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.dialog-box {
|
.dialog-box {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user