|
@@ -1,67 +1,69 @@
|
|
|
<template>
|
|
|
<div class="container">
|
|
|
- <div class="timer">
|
|
|
- <van-cell :title="pageTitle.dateTitle" :value="today" />
|
|
|
- </div>
|
|
|
- <div class="title">{{ pageTitle.contentTitle }}</div>
|
|
|
- <van-field
|
|
|
- v-model="formData.reportContent"
|
|
|
- rows="5"
|
|
|
- autosize
|
|
|
- type="textarea"
|
|
|
- readonly
|
|
|
- />
|
|
|
- <div class="title">工作量分配</div>
|
|
|
- <div class="workload-list">
|
|
|
- <van-highlight
|
|
|
- v-for="item in formData.workloadList"
|
|
|
- :key="item.id"
|
|
|
- :keywords="`(${item.workTime}小时)`"
|
|
|
- :source-string="`(${item.workTime}小时) ${item.projectName}`"
|
|
|
+ <div class="container-content">
|
|
|
+ <div class="timer">
|
|
|
+ <van-cell :title="pageTitle.dateTitle" :value="today" />
|
|
|
+ </div>
|
|
|
+ <div class="title">{{ pageTitle.contentTitle }}</div>
|
|
|
+ <van-field
|
|
|
+ v-model="formData.reportContent"
|
|
|
+ rows="5"
|
|
|
+ autosize
|
|
|
+ type="textarea"
|
|
|
+ readonly
|
|
|
/>
|
|
|
- </div>
|
|
|
- <div class="title">接收人</div>
|
|
|
- <div class="receive-names">
|
|
|
- <van-tag
|
|
|
- plain
|
|
|
- class="names-tag"
|
|
|
- type="primary"
|
|
|
- v-for="item in formData.receiveNames"
|
|
|
- :key="item"
|
|
|
- >{{ item }}</van-tag
|
|
|
- >
|
|
|
- </div>
|
|
|
- <div class="title">评论</div>
|
|
|
- <div class="comment-title">
|
|
|
- {{
|
|
|
- commentList.length === 0
|
|
|
- ? "暂无评论"
|
|
|
- : `共有${commentList.length}条评论`
|
|
|
- }}
|
|
|
- </div>
|
|
|
- <div class="comment-content" v-if="commentList.length > 0">
|
|
|
- <div
|
|
|
- v-for="(item, index) in commentList"
|
|
|
- :key="index"
|
|
|
- class="comment-item"
|
|
|
- >
|
|
|
- <div class="left">
|
|
|
- <span>{{ item.commentUserName.substr(-2) }}</span>
|
|
|
- </div>
|
|
|
- <div class="right">
|
|
|
- <div class="title">
|
|
|
- {{
|
|
|
- `${item.commentUserName} ${moment(item.commentDate).format(
|
|
|
- "YYYY-MM-DD HH:mm:ss"
|
|
|
- )}`
|
|
|
- }}
|
|
|
- <span v-if="isMyComment(item)" @click="deleteComment(item)"
|
|
|
- >删除</span
|
|
|
- >
|
|
|
- <span v-if="!item.isReply" @click="replyComment(item)">回复</span>
|
|
|
- <span v-else @click="replyComment(item, true)">取消回复</span>
|
|
|
+ <div class="title">工作量分配</div>
|
|
|
+ <div class="workload-list">
|
|
|
+ <van-highlight
|
|
|
+ v-for="item in formData.workloadList"
|
|
|
+ :key="item.id"
|
|
|
+ :keywords="`(${item.workTime}小时)`"
|
|
|
+ :source-string="`(${item.workTime}小时) ${item.projectName}`"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="title">接收人</div>
|
|
|
+ <div class="receive-names">
|
|
|
+ <van-tag
|
|
|
+ plain
|
|
|
+ class="names-tag"
|
|
|
+ type="primary"
|
|
|
+ v-for="item in formData.receiveNames"
|
|
|
+ :key="item"
|
|
|
+ >{{ item }}</van-tag
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div class="title">评论</div>
|
|
|
+ <div class="comment-title">
|
|
|
+ {{
|
|
|
+ commentList.length === 0
|
|
|
+ ? "暂无评论"
|
|
|
+ : `共有${commentList.length}条评论`
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
+ <div class="comment-content" v-if="commentList.length > 0">
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in commentList"
|
|
|
+ :key="index"
|
|
|
+ class="comment-item"
|
|
|
+ >
|
|
|
+ <div class="left">
|
|
|
+ <span>{{ item.commentUserName.substr(-2) }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="right">
|
|
|
+ <div class="title">
|
|
|
+ {{
|
|
|
+ `${item.commentUserName} ${moment(item.commentDate).format(
|
|
|
+ "YYYY-MM-DD HH:mm:ss"
|
|
|
+ )}`
|
|
|
+ }}
|
|
|
+ <span v-if="isMyComment(item)" @click="deleteComment(item)"
|
|
|
+ >删除</span
|
|
|
+ >
|
|
|
+ <span v-if="!item.isReply" @click="replyComment(item)">回复</span>
|
|
|
+ <span v-else @click="replyComment(item, true)">取消回复</span>
|
|
|
+ </div>
|
|
|
+ <div class="item-content">{{ item.commentContent }}</div>
|
|
|
</div>
|
|
|
- <div class="item-content">{{ item.commentContent }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -162,6 +164,7 @@ const initCommentList = async () => {
|
|
|
commentList.value =
|
|
|
result?.map((item: any) => ({
|
|
|
...item,
|
|
|
+ commentContent: decodeURI(item.commentContent), // 将评论转换一下
|
|
|
isReply: false,
|
|
|
})) ?? [];
|
|
|
};
|
|
@@ -222,9 +225,10 @@ const submitComment = async (content?: string) => {
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
+ const commentContent = content ?? commentInput.value;
|
|
|
const params: any = {
|
|
|
reportId: route.query?.id ?? "",
|
|
|
- commentContent: content ?? commentInput.value,
|
|
|
+ commentContent: encodeURI(commentContent), // 将评论转换一下
|
|
|
};
|
|
|
// 判断是否是回复评论
|
|
|
const isReply = commentList.value.find((item) => item.isReply === true);
|