feat: 系统设置新增通报时间配置 + 亮灯表30天滚动窗口 + 相关人员文案统一 + 周报数据补全

- 亮灯表从自然月改为30天滚动窗口(30/60天阈值),解决月底覆盖断崖
- 系统设置新增「定时通报时间」选择器,支局长可配置每日企微通报时刻
- 新增 SystemConfig 键值表 + scheduler_manager APScheduler 运行时重调度
- 拜访记录/导入模板/弹窗表单统一「同访人员」→「相关人员」
- 仪表盘周报数据补全:companion_names_resolved、visitor_name/phone 等字段
- 新增 weekly_report_template.xlsx 模板文件

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-07-06 11:51:07 +08:00
parent cd47d1aed5
commit 336b60b3af
8 changed files with 226 additions and 24 deletions
+1
View File
@@ -40,6 +40,7 @@ declare module 'vue' {
ElTabs: typeof import('element-plus/es')['ElTabs']
ElTag: typeof import('element-plus/es')['ElTag']
ElTimePicker: typeof import('element-plus/es')['ElTimePicker']
ElTimeSelect: typeof import('element-plus/es')['ElTimeSelect']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ImagePreview: typeof import('./components/ImagePreview.vue')['default']
MobileLayout: typeof import('./components/MobileLayout.vue')['default']
+44 -2
View File
@@ -10,6 +10,8 @@ const announcementContent = ref('')
const remindLoading = ref(false)
const announceLoading = ref(false)
const dailyCheckLoading = ref(false)
const notificationTime = ref('17:30')
const notificationTimeLoading = ref(false)
const importLoading = ref(false)
const importFile = ref<File | null>(null)
@@ -21,6 +23,13 @@ onMounted(async () => {
const res = await api.get('/users/', { params: { role: 'manager' } })
managers.value = res.data
} catch (_) {}
// Load current notification time
try {
const res = await api.get('/system-config')
if (res.data?.notification_time) {
notificationTime.value = res.data.notification_time
}
} catch (_) {}
})
async function handleRemind() {
@@ -53,6 +62,16 @@ async function handleDailyCheck() {
finally { dailyCheckLoading.value = false }
}
async function handleSaveNotificationTime() {
notificationTimeLoading.value = true
try {
await api.put('/system-config/notification_time', { value: notificationTime.value })
ElMessage.success(`通报时间已更新为 ${notificationTime.value}`)
} catch (e: any) {
ElMessage.error(e.response?.data?.detail || '保存失败')
} finally { notificationTimeLoading.value = false }
}
function handleImportFile(e: Event) {
const target = e.target as HTMLInputElement
if (target.files?.[0]) importFile.value = target.files[0]
@@ -141,8 +160,28 @@ async function handleImportPreview() {
填报检查
</div>
</template>
<p style="color: var(--warm-gray); font-family: 'Noto Serif SC', STSong, serif;">手动触发今日填报检查通常每日 18:00 自动执行</p>
<el-button :loading="dailyCheckLoading" @click="handleDailyCheck">立即检查</el-button>
<div class="setting-row">
<div class="setting-col">
<label class="setting-label">定时通报时间</label>
<div style="display:flex;gap:8px;align-items:center">
<el-time-select
v-model="notificationTime"
start="08:00"
step="00:05"
end="21:00"
placeholder="选择时间"
format="HH:mm"
style="width:140px"
/>
<el-button type="primary" :loading="notificationTimeLoading" @click="handleSaveNotificationTime" size="small">保存</el-button>
</div>
<p style="color:var(--warm-gray);font-size:12px;margin-top:6px">每日定时向未填报人员推送催办提醒并向支局长发送汇总</p>
</div>
<div class="setting-col">
<label class="setting-label">手动触发</label>
<el-button :loading="dailyCheckLoading" @click="handleDailyCheck">立即检查</el-button>
</div>
</div>
</el-card>
<!-- Import -->
@@ -222,4 +261,7 @@ async function handleImportPreview() {
font-family: 'ZCOOL XiaoWei', STSong, serif;
font-size: 15px; color: var(--ink); letter-spacing: 0.05em;
}
.setting-row { display: flex; gap: 32px; align-items: flex-start; flex-wrap: wrap; }
.setting-col { display: flex; flex-direction: column; gap: 8px; }
.setting-label { font-family: 'Noto Serif SC', STSong, serif; font-size: 13px; color: var(--ink); }
</style>