This commit is contained in:
2026-05-06 22:25:48 +08:00
parent 4cbb266bec
commit 6c70392a98
4 changed files with 24 additions and 23 deletions
+10 -10
View File
@@ -81,17 +81,17 @@ func ScheduleUpdateAdminsCash() {
func ApiScheduleInit() { func ApiScheduleInit() {
//先初始化数据表 //先初始化数据表
models.DB.AutoMigrate(&TabSchedule{}) // models.DB.AutoMigrate(&TabSchedule{})
models.DB.AutoMigrate(&TabScheduleLog{}) // models.DB.AutoMigrate(&TabScheduleLog{})
//先检查用户组有没有这个key // //先检查用户组有没有这个key
userGroup.Name = "schedule_admin" // userGroup.Name = "schedule_admin"
if models.DB.Where(&userGroup).First(&userGroup).Error == nil { // if models.DB.Where(&userGroup).First(&userGroup).Error == nil {
ScheduleUpdateAdminsCash() // ScheduleUpdateAdminsCash()
} else { // } else {
userGroup.Type = "usergroup" // userGroup.Type = "usergroup"
models.DB.Create(&userGroup) // models.DB.Create(&userGroup)
} // }
} }
func ApiSchedule(r *gin.RouterGroup) { func ApiSchedule(r *gin.RouterGroup) {
@@ -53,7 +53,7 @@ const normalClass = "rounded-md px-3 py-2 text-sm font-medium text-gray-600 tran
const navItems = computed(() => [ const navItems = computed(() => [
{ label: t("appname.home"), to: "/" }, { label: t("appname.home"), to: "/" },
{ label: t("appname.schedule"), to: "/schedule" }, // { label: t("appname.schedule"), to: "/schedule" },
{ label: t("appname.calendar"), to: "/calendars" }, { label: t("appname.calendar"), to: "/calendars" },
{ label: t("appname.purchase"), to: "/purchase" }, { label: t("appname.purchase"), to: "/purchase" },
{ label: t("appname.work_order"), to: "/work_order" }, { label: t("appname.work_order"), to: "/work_order" },
+10 -10
View File
@@ -131,19 +131,19 @@ onMounted(() => {
<h2 class="mb-6 text-2xl font-bold text-gray-900 dark:text-white">{{ t('message.welcome') }}</h2> <h2 class="mb-6 text-2xl font-bold text-gray-900 dark:text-white">{{ t('message.welcome') }}</h2>
<!-- 日程卡片 --> <!-- 日程卡片 -->
<div class="mb-6 rounded-xl border border-gray-200 bg-white px-5 py-4 dark:border-dk-muted dark:bg-dk-card"> <!-- <div class="mb-6 rounded-xl border border-gray-200 bg-white px-5 py-4 dark:border-dk-muted dark:bg-dk-card"> -->
<div class="mb-3 flex items-center justify-between"> <!-- <div class="mb-3 flex items-center justify-between">
<h3 class="text-lg font-semibold text-gray-900 dark:text-white">{{ t('appname.schedule') }}</h3> <h3 class="text-lg font-semibold text-gray-900 dark:text-white">{{ t('appname.schedule') }}</h3>
<span class="text-sm text-gray-500 dark:text-gray-400">{{ t('home.today', { date: todayDisplay }) }}</span> <span class="text-sm text-gray-500 dark:text-gray-400">{{ t('home.today', { date: todayDisplay }) }}</span>
</div> </div> -->
<!-- 加载状态 --> <!-- 加载状态 -->
<div v-if="loadingSchedules" class="py-4 text-center text-gray-500"> <!-- <div v-if="loadingSchedules" class="py-4 text-center text-gray-500">
{{ t('home.loading') }} {{ t('home.loading') }}
</div> </div> -->
<!-- 日程列表 --> <!-- 日程列表 -->
<div v-else-if="todaySchedules.length > 0"> <!-- <div v-else-if="todaySchedules.length > 0">
<div class="mb-2 text-sm text-gray-600 dark:text-gray-400"> <div class="mb-2 text-sm text-gray-600 dark:text-gray-400">
{{ t('home.today_schedule_count', { count: todayCount }) }} {{ t('home.today_schedule_count', { count: todayCount }) }}
</div> </div>
@@ -173,13 +173,13 @@ onMounted(() => {
</div> </div>
</li> </li>
</ul> </ul>
</div> </div> -->
<!-- 无日程 --> <!-- 无日程 -->
<div v-else class="py-4 text-center text-gray-500 dark:text-gray-400"> <!-- <div v-else class="py-4 text-center text-gray-500 dark:text-gray-400">
{{ t('home.today_no_schedule') }} {{ t('home.today_no_schedule') }}
</div> </div> -->
</div> <!-- </div> -->
<!-- 功能入口卡片 --> <!-- 功能入口卡片 -->
<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-3"> <div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
@@ -19,12 +19,13 @@ const totalPages = computed(() => Math.ceil(total.value / pageSize.value))
// 模块列表 // 模块列表
const modules = [ const modules = [
{ id: 'all', label: 'operation_logs.all' }, { id: 'all', label: 'operation_logs.all' },
{ id: 'calendar', label: 'calendar.calendars' },
{ id: 'customer', label: 'customer.title' }, { id: 'customer', label: 'customer.title' },
{ id: 'purchase', label: 'purchase.title' }, { id: 'purchase', label: 'purchase.title' },
{ id: 'schedule', label: 'schedule.title' }, // { id: 'schedule', label: 'schedule.title' },
{ id: 'warehouse', label: 'warehouse.title' }, { id: 'warehouse', label: 'warehouse.title' },
{ id: 'work_order', label: 'work_order.title' }, { id: 'work_order', label: 'work_order.title' },
{ id: 'calendar', label: 'calendar.calendars' },
] ]
const activeModule = ref('all') const activeModule = ref('all')