-
{{$L('聊天')}}
-
{{$L('动态')}}
+
+ {{$L('聊天')}}
+
+
+ {{getTypeLabel(msgType)}}
+
+
+
{{$L('动态')}}
@@ -663,6 +673,7 @@ export default {
msgText: '',
msgFile: [],
msgRecord: {},
+ msgType: '',
navActive: 'dialog',
logLoadIng: false,
@@ -740,6 +751,7 @@ export default {
'cacheProjects',
'cacheColumns',
'cacheTasks',
+ 'cacheDialogs',
'taskContents',
'taskFiles',
@@ -966,7 +978,36 @@ export default {
&& !taskDetail.complete_at
&& taskDetail.end_at
&& taskDetail.end_at != mainEndAt
- }
+ },
+
+ dialogData({taskDetail}) {
+ if (!taskDetail.dialog_id) {
+ return {}
+ }
+ return this.cacheDialogs.find(({id}) => id == taskDetail.dialog_id) || {}
+ },
+
+ msgTypes({dialogData}) {
+ const array = [
+ {value: '', label: this.$L('全部')},
+ ];
+ if (dialogData.has_tag) {
+ array.push({value: 'tag', label: this.$L('标注')})
+ }
+ if (dialogData.has_todo) {
+ array.push({value: 'todo', label: this.$L('事项')})
+ }
+ if (dialogData.has_image) {
+ array.push({value: 'image', label: this.$L('图片')})
+ }
+ if (dialogData.has_file) {
+ array.push({value: 'file', label: this.$L('文件')})
+ }
+ if (dialogData.has_link) {
+ array.push({value: 'link', label: this.$L('链接')})
+ }
+ return array
+ },
},
watch: {
@@ -2043,6 +2084,36 @@ export default {
];
// 触发更新
this.updateData('tag', mergedTags);
+ },
+
+ getTypeLabel(type) {
+ this.msgTypes.some(item => {
+ if (item.value === type) {
+ type = item.label
+ return true
+ }
+ })
+ return type
+ },
+
+ onTypeChange(type) {
+ this.msgType = type
+ },
+
+ openTypeClick(event) {
+ if (this.msgTypes.length === 0) {
+ return
+ }
+ this.$store.state.menuOperation = {
+ event,
+ list: this.msgTypes,
+ active: this.msgType,
+ activeClick: true,
+ onUpdate: (type) => {
+ this.navActive = 'dialog'
+ this.$refs.dialog?.onMsgType(type)
+ }
+ }
}
}
}
diff --git a/resources/assets/sass/pages/components/dialog-wrapper.scss b/resources/assets/sass/pages/components/dialog-wrapper.scss
index 66c8ce8a1..56bac52c6 100644
--- a/resources/assets/sass/pages/components/dialog-wrapper.scss
+++ b/resources/assets/sass/pages/components/dialog-wrapper.scss
@@ -262,7 +262,7 @@
}
}
- .title-tags {
+ .title-types {
display: flex;
align-items: center;
@@ -2618,7 +2618,7 @@ body.window-portrait {
display: flex;
justify-content: center;
}
- .title-tags {
+ .title-types {
position: absolute;
left: 0;
right: 0;
diff --git a/resources/assets/sass/pages/components/task-detail.scss b/resources/assets/sass/pages/components/task-detail.scss
index e105149ca..0fb757c82 100644
--- a/resources/assets/sass/pages/components/task-detail.scss
+++ b/resources/assets/sass/pages/components/task-detail.scss
@@ -618,7 +618,7 @@
padding-left: 18px;
font-weight: 500;
color: $primary-text-color;
- > p {
+ .nav-item {
display: flex;
align-items: center;
margin-right: 24px;
@@ -630,6 +630,32 @@
color: #555555;
cursor: default;
}
+ &.nav-chat {
+ .msg-type {
+ display: flex;
+ align-items: center;
+ padding-left: 6px;
+ opacity: 0.8;
+ transition: opacity 0.2s;
+ cursor: pointer;
+ &:hover {
+ opacity: 1;
+ }
+ .taskfont {
+ display: inline-block;
+ font-size: 12px;
+ padding-top: 1px;
+ font-weight: normal;
+ opacity: 0.9;
+ }
+ > em {
+ padding-left: 4px;
+ font-style: normal;
+ font-size: 12px;
+ font-weight: normal;
+ }
+ }
+ }
}
.refresh {
display: flex;
@@ -801,7 +827,7 @@
}
.nav {
padding-left: 0;
- > p {
+ .nav-item {
margin-right: 28px;
&.active {
font-size: 18px;