zhangwencui
2026-10-26 460a5d91ff38ea0d16a034d5bf4b564b3553afa8
中亿装配首页增加考勤打卡快捷模块
已修改1个文件
11 ■■■■■ 文件已修改
src/pages/home/zhongyi-assembly.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/home/zhongyi-assembly.vue
@@ -33,6 +33,7 @@
  mark: string;
  tone: string;
  component: string;
  permanent?: boolean;
}
const peopleCards: DashboardCard[] = [
@@ -50,7 +51,7 @@
];
const quickEntries: QuickEntry[] = [
  { name: "考勤打卡", detail: "上下班打卡", mark: "勤", tone: "orange", component: "hrm/attendance/clock/index" },
  { name: "考勤打卡", detail: "上下班打卡", mark: "勤", tone: "orange", component: "hrm/attendance/clock/index", permanent: true },
  // 人事申请入口暂不在首页展示。
  // { name: "请假申请", detail: "提交请假", mark: "假", tone: "blue", component: "hrm/leave/index" },
  // { name: "加班申请", detail: "提交加班", mark: "班", tone: "violet", component: "hrm/overtime/index" },
@@ -92,6 +93,10 @@
  const route = routeFor(component);
  if (route) uni.navigateTo({ url: route });
}
function openQuickEntry(item: QuickEntry) {
  const route = item.permanent ? appRouteMap[item.component] : routeFor(item.component);
  if (route) uni.navigateTo({ url: route });
}
const userName = computed(() => state.user?.nickname || state.user?.username || "同事");
const greeting = computed(() => {
@@ -108,7 +113,7 @@
  const weeks = ["日", "一", "二", "三", "四", "五", "六"];
  return `${value.getMonth() + 1}月${value.getDate()}日 星期${weeks[value.getDay()]}`;
});
const availableQuickEntries = computed(() => quickEntries.filter(item => canOpen(item.component)));
const availableQuickEntries = computed(() => quickEntries.filter(item => item.permanent || canOpen(item.component)));
function displayCount(key: string) {
  const value = counts.value[key];
@@ -193,7 +198,7 @@
        <view class="section quick-section">
          <view class="section-head"><view><text>快捷操作</text><text>员工自助服务</text></view><text @click="goWorkbench">全部应用</text></view>
          <view v-if="availableQuickEntries.length" class="quick-grid">
            <view v-for="item in availableQuickEntries" :key="item.component" class="quick-card" @click="openComponent(item.component)">
            <view v-for="item in availableQuickEntries" :key="item.component" class="quick-card" @click="openQuickEntry(item)">
              <view :class="['quick-mark', item.tone]">{{ item.mark }}</view><text>{{ item.name }}</text><text>{{ item.detail }}</text>
            </view>
          </view>