Skip to content

Commit

Permalink
fix: 修复针对于还未到发布时间的公告状态
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoofff committed Sep 1, 2023
1 parent 8fac268 commit 46cc4c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,17 @@ public class AnnouncementVO extends BaseVO {
*
* @return 公告状态
*/
@Schema(description = "状态(1:已发布,2:已过期)", example = "1")
@Schema(description = "状态(1:待发布,2:已发布,3:已过期)", example = "1")
public Integer getStatus() {
int status = 1;
int status = 2;
if (null != this.effectiveTime) {
if (this.effectiveTime.isAfter(LocalDateTime.now())) {
status = 2;
status = 1;
}
}
if (null != this.terminateTime) {
if (this.terminateTime.isBefore(LocalDateTime.now())) {
status = 2;
status = 3;
}
}
return status;
Expand Down
5 changes: 3 additions & 2 deletions continew-admin-ui/src/views/system/announcement/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@
</a-table-column>
<a-table-column title="状态" align="center">
<template #cell="{ record }">
<a-tag v-if="record.status === 1" color="green">已发布</a-tag>
<a-tag v-else color="orangered">已过期</a-tag>
<a-tag v-if="record.status === 1" color="blue">待发布</a-tag>
<a-tag v-else-if="record.status === 2" color="green">已发布</a-tag>
<a-tag v-else color="red">已过期</a-tag>
</template>
</a-table-column>
<a-table-column title="生效时间">
Expand Down

0 comments on commit 46cc4c9

Please sign in to comment.