feat: 可点击标注图标查看标注人员

This commit is contained in:
kuaifan 2025-03-16 22:16:02 +08:00
parent 4430d85242
commit 04acd7c56d
5 changed files with 54 additions and 14 deletions

View File

@ -905,6 +905,10 @@ import {convertLocalResourcePath} from "../components/Replace/utils";
$A.Message.success($A.L(msg));
},
messageInfo(msg) {
$A.Message.info($A.L(msg));
},
messageWarning(msg) {
if (msg === false) {
return;

View File

@ -1074,19 +1074,7 @@ export default {
this.__notificationId = id;
//
const notificationFuncA = async (title) => {
let tempUser = this.cacheUserBasic.find(item => item.userid == userid);
if (!tempUser) {
try {
const {data} = await this.$store.dispatch("call", {
url: 'users/basic',
data: {
userid: [userid]
},
checkAuth: false
});
tempUser = data.find(item => item.userid == userid);
} catch (_) {}
}
const tempUser = (await this.$store.dispatch("getUserData", userid).catch(_ => {}))?.data;
if (dialog_type === 'group' && tempUser) {
title = `${title} (${tempUser.nickname})`
}

View File

@ -76,7 +76,7 @@
{{msgData.reply_num}}条回复
</div>
<!--标注-->
<div v-if="msgData.tag" class="tag">
<div v-if="msgData.tag" class="tag" @click="openTag">
<i class="taskfont">&#xe61e;</i>
</div>
<!--待办-->
@ -399,6 +399,20 @@ export default {
}
},
openTag() {
if (!this.msgData.tag) {
return
}
this.$store.dispatch("showSpinner", 600)
this.$store.dispatch("getUserData", this.msgData.tag).then(user => {
$A.messageInfo(`标注人员:${user.nickname} (ID: ${user.userid})`)
}).catch(_ => {
$A.messageError('标注人员不存在')
}).finally(_ => {
this.$store.dispatch("hiddenSpinner")
});
},
openTodo() {
if (this.todoLoad > 0) {
return;

View File

@ -795,6 +795,36 @@ export default {
});
},
/**
* 获取用户基础信息缓存没有则请求网络
* @param state
* @param dispatch
* @param userid
* @returns {Promise<unknown>}
*/
getUserData({state, dispatch}, userid) {
return new Promise(async (resolve, reject) => {
let tempUser = state.cacheUserBasic.find(item => item.userid == userid);
if (!tempUser) {
try {
const {data} = await dispatch("call", {
url: 'users/basic',
data: {
userid: [userid]
},
checkAuth: false
});
tempUser = data.find(item => item.userid == userid);
} catch (_) {}
}
if (tempUser) {
resolve(tempUser);
} else {
reject();
}
})
},
/**
* 保存用户基础信息
* @param commit

View File

@ -1632,6 +1632,10 @@
}
}
.tag {
cursor: pointer;
}
.todo {
position: relative;
cursor: pointer;