Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ function handleOpen() {
</p>

<template #footer="{ Action, ActionDropdown }">
<MkStatusLabel v-if="application.is_portal" type="custom" label="已上架" icon="icon_launch" />
<MkStatusLabel v-if="application.is_portal" type="custom" label="已上架" icon="icon_launch" class="text-N600!" />
<MkStatusLabel
v-else
:active="application.is_publish"
active-text="已发布"
inactive-text="未发布"
:icon="application.is_publish ? undefined : 'icon_time_filled'"
class="text-N600!"
/>
<template v-if="application.is_publish">
<el-divider direction="vertical" />

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

✅ No critical issues found. The change is small and low-risk, but here are some observations:

Potential Issues

  1. Inconsistent styling between branches

    • Portal status uses type="custom" with a hardcoded label "已上架" + custom class.
    • Non-portal uses :active toggle. Both now get text-N600!, which forces gray text on all states (published, unpublished, portal). If published/unpublished previously had distinct colors, forcing text-N600! everywhere may have removed that visual distinction — verify this is intentional.
  2. Magic strings / i18n

    • Hardcoded Chinese labels ("已上架", "已发布", "未发布") — consider using i18n translation keys for maintainability.
  3. Verbosity of the "已上架" branch

    • It repeats 4 props (label, icon, class) compared to the conditional branch's data-driven style. Could pass application.is_publish ? '已发布' : '未发布' as a single computed label to simplify.

Optimization Suggestions

<MkStatusLabel
  v-if="application.is_portal"
  type="custom"
  label="已上架"
  icon="icon_launch"
  class="text-N600!"
/>
  1. Consider extracting text-N600! into a shared class or making it a prop/default in MkStatusLabel if this pattern recurs, instead of repeating !important overrides at call sites.

  2. icon_launch naming — ensure the icon constants are referenced consistently (some places use 'icon_time_filled' as string; ensure they're validated).

Summary: Functionally fine; mainly check whether uniformly forcing text-N600! removes intended state colors, and consider moving hardcoded labels to i18n.

Expand Down
Loading