Browse Source

Merge remote-tracking branch 'origin/master'

ljy121 1 year ago
parent
commit
0962b7f2b5

+ 3 - 1
client/src/views/OaSystem/personnelManagement/components/DetailBox.vue

@@ -36,10 +36,11 @@ const submitComment = async (content?) => {
     message.info('评论内容不能为空!')
     return
   }
+  const commentContent = content ?? commentInput.value
   const data: any = {
     reportId: detail.value.id,
     commentUserId: userInfo.id ?? '',
-    commentContent: content ?? commentInput.value
+    commentContent: encodeURI(commentContent)
   }
   // 判断是否是回复评论
   const isReply = commentList.value.find((item) => item.isReply === true)
@@ -72,6 +73,7 @@ const getCommentList = async () => {
   })
   commentList.value = result.map((item) => ({
     ...item,
+    commentContent: decodeURI(item.commentContent), // 将评论转换一下
     isReply: false
   }))
 }

+ 3 - 1
client/src/views/OaSystem/personnelManagement/components/DetailBoxWeek.vue

@@ -47,10 +47,11 @@ const submitComment = async (content?) => {
     message.info('评论内容不能为空!')
     return
   }
+  const commentContent = content ?? commentInput.value
   const data: any = {
     reportId: detail.value.id,
     commentUserId: detail.value.userId ?? userInfo.id ?? '',
-    commentContent: content ?? commentInput.value
+    commentContent: encodeURI(commentContent)
   }
   // 判断是否是回复评论
   const isReply = commentList.value.find((item) => item.isReply === true)
@@ -83,6 +84,7 @@ const getCommentList = async () => {
   })
   commentList.value = result.map((item) => ({
     ...item,
+    commentContent: decodeURI(item.commentContent), // 将评论转换一下
     isReply: false
   }))
 }

+ 31 - 8
client_h5/src/pages/myLogs/Weekly/index.vue

@@ -60,14 +60,27 @@ interface FormData {
   reportMonth: string | number; // 月
   reportWeek: string | number; // 周
 }
-
-// 页面数据
-const thisWeek = ref(
-  `${moment().startOf("week").add(1, "day").format("YYYY/MM/DD")} ~ ${moment()
+const defWeek = () => {
+  if (moment().day() == 0) {
+    const today = moment().subtract(1, "day");
+    return `${moment(today)
+      .startOf("week")
+      .add(1, "day")
+      .format("YYYY/MM/DD")} ~ ${moment(today)
+      .endOf("week")
+      .add(1, "day")
+      .format("YYYY/MM/DD")}`;
+  }
+  return `${moment()
+    .startOf("week")
+    .add(1, "day")
+    .format("YYYY/MM/DD")} ~ ${moment()
     .endOf("week")
     .add(1, "day")
-    .format("YYYY/MM/DD")}`
-);
+    .format("YYYY/MM/DD")}`;
+};
+// 页面数据
+const thisWeek = ref(defWeek());
 const formData = reactive<FormData>({
   reportContent: "",
   weeklyWorkloadList: [],
@@ -100,13 +113,23 @@ onMounted(async () => {
 // 判断一下本周是否已经填了,如果是填了的就跳转到详情页
 const isFillLog = async () => {
   const date = thisWeek.value.split(" ~ ");
-  const searchList = await http.getMonthLogList(
+  let searchList = await http.getMonthLogList(
     "weekly",
     moment(date[1]).format("YYYY"),
     moment(date[1]).format("M")
   );
+  // 以防万一
+  if (searchList.length == 0) {
+    searchList = await http.getMonthLogList(
+      "weekly",
+      moment(date[0]).format("YYYY"),
+      moment(date[0]).format("M")
+    );
+  }
   const searchLog = searchList.find(
-    (item: any) => item.reportEndDate == moment(date[1]).format("YYYY-MM-DD")
+    (item: any) =>
+      moment(item.reportEndDate).format("YYYY-MM-DD") ==
+      moment(date[1]).format("YYYY-MM-DD")
   );
 
   if (searchLog) {

+ 65 - 61
client_h5/src/pages/myLogs/components/LogDetail.vue

@@ -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);

+ 8 - 5
client_h5/src/pages/myLogs/page.scss

@@ -4,6 +4,10 @@
   padding: 10px 10px;
   overflow-y: scroll;
   box-sizing: border-box;
+  >.container-content {
+    height: calc( 100% - 90px);
+    overflow-y: auto;
+  }
   .timer {
     :deep(.van-cell__title) {
       width: 70px !important;
@@ -54,9 +58,8 @@
   .comment-content {
     font-size: 14px;
     padding-left: 15px;
-    max-height: 32vh;
-    overflow: scroll;
-    margin-bottom: 70px;
+    max-height: 200px;
+    overflow: auto;
   }
 
   .comment-item {
@@ -104,10 +107,10 @@
   }
 
   .comment-input {
+    width: 100%;
+    height: 90px;
     position: fixed;
-    left: 0;
     bottom: 10px;
-    width: 100%;
     .comment-emoji {
       padding: 5px 15px;
       overflow-x: auto;

+ 3 - 0
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/controller/admin/report/dto/report/ReportListQueryDTO.java

@@ -22,6 +22,9 @@ public class ReportListQueryDTO {
     @Schema(description = "报告月份")
     private Short reportMonth;
 
+    @Schema(description = "报告周")
+    private Short reportWeek;
+
     @NotBlank(message = "用户ID不能为空")
     @Schema(description = "用户ID", example = "11742")
     private String userId;

+ 1 - 1
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/service/report/ReportServiceImpl.java

@@ -207,7 +207,7 @@ public class ReportServiceImpl implements ReportService {
         if ("daily".equals(reqVO.getReportType())) {
             queryWrapperX.betweenIfPresent(ReportDO::getReportStartDate, DateUtils.getStartDateTime(reqVO.getReportYear(), reqVO.getReportMonth()), DateUtils.getEndDateTime(reqVO.getReportYear(), reqVO.getReportMonth()));
         } else {
-            queryWrapperX.eqIfPresent(ReportDO::getReportYear, reqVO.getReportYear()).eqIfPresent(ReportDO::getReportMonth, reqVO.getReportMonth());
+            queryWrapperX.eqIfPresent(ReportDO::getReportYear, reqVO.getReportYear()).eqIfPresent(ReportDO::getReportMonth, reqVO.getReportMonth()).eqIfPresent(ReportDO::getReportWeek,reqVO.getReportWeek());
         }
         List<ReportRespVO> reportList = ReportConvert.INSTANCE.convertList(reportMapper.selectList(queryWrapperX));
         if (CollectionUtil.isEmpty(reportList)) {