mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-19 14:18:10 +00:00
76 lines
2.3 KiB
Vue
76 lines
2.3 KiB
Vue
<template>
|
|
<DialogWrapper v-if="dialogShow" :dialog-id="projectData.dialog_id" class="project-dialog">
|
|
<template slot="head">
|
|
<div class="dialog-user">
|
|
<div class="member-head">
|
|
<div class="member-title">{{$L('项目成员')}}<span @click="memberShowAll=!memberShowAll">({{projectData.project_user.length}})</span></div>
|
|
<div class="member-close" @click="onClose">
|
|
<Icon type="ios-close"/>
|
|
</div>
|
|
</div>
|
|
<ul :class="['member-list', memberShowAll ? 'member-all' : '']">
|
|
<li v-for="item in projectData.project_user">
|
|
<UserAvatar :userid="item.userid" :size="36"/>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="nav-wrapper">
|
|
<div class="dialog-title">
|
|
<h2>{{$L('群聊')}}</h2>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</DialogWrapper>
|
|
</template>
|
|
|
|
<script>
|
|
import {mapGetters, mapState} from "vuex";
|
|
import DialogWrapper from "./DialogWrapper";
|
|
|
|
export default {
|
|
name: "ProjectDialog",
|
|
components: {DialogWrapper},
|
|
data() {
|
|
return {
|
|
loadIng: false,
|
|
memberShowAll: false,
|
|
}
|
|
},
|
|
|
|
computed: {
|
|
...mapState(['cacheDialogs']),
|
|
...mapGetters(['projectData']),
|
|
|
|
dialogShow() {
|
|
return this.windowLarge && this.projectData.dialog_id && this.projectData.cacheParameter.chat
|
|
}
|
|
},
|
|
|
|
watch: {
|
|
dialogShow: {
|
|
handler(show) {
|
|
if (show) {
|
|
const {dialog_id} = this.projectData
|
|
if (!this.cacheDialogs.find(({id}) => id == dialog_id)) {
|
|
if (this.loadIng === true) {
|
|
return
|
|
}
|
|
this.loadIng = true
|
|
this.$store.dispatch("getDialogOne", dialog_id).catch(() => {}).finally(_ => {
|
|
this.loadIng = false
|
|
})
|
|
}
|
|
}
|
|
},
|
|
immediate: true
|
|
}
|
|
},
|
|
|
|
methods: {
|
|
onClose() {
|
|
this.$store.dispatch('toggleProjectParameter', 'chat');
|
|
}
|
|
}
|
|
}
|
|
</script>
|