| | |
| | | mark: string; |
| | | tone: string; |
| | | component: string; |
| | | permanent?: boolean; |
| | | } |
| | | |
| | | const peopleCards: DashboardCard[] = [ |
| | |
| | | ]; |
| | | |
| | | 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" }, |
| | |
| | | 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(() => { |
| | |
| | | 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]; |
| | |
| | | <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> |