#feature: update SQL generator

This commit is contained in:
2026-05-19 14:57:11 +08:00
parent 53bca7d609
commit 3c628eb391
10 changed files with 1043 additions and 165 deletions
+29 -4
View File
@@ -3,12 +3,12 @@
<!-- 页面标题 -->
<div class="mb-6">
<h1 class="text-2xl font-bold text-gray-900">生成周报</h1>
<p class="text-gray-600 mt-2">生成上周的工作周报</p>
<p class="text-gray-600 mt-2">按周选择统计范围生成对应周期的工作周报</p>
</div>
<!-- 周报生成区域 -->
<div class="bg-white rounded-xl shadow-sm border border-gray-200 p-6">
<h2 class="text-xl font-semibold text-gray-700 mb-4">生成上周周报</h2>
<h2 class="text-xl font-semibold text-gray-700 mb-4">生成{{ selectedPeriodLabel }}周报</h2>
<div class="flex flex-wrap gap-4 mb-4">
<div class="flex-1 min-w-64">
@@ -20,6 +20,17 @@
placeholder="输入 JIRA 用户名"
>
</div>
<div class="w-40">
<label class="block text-sm font-medium text-gray-700 mb-2">统计周期</label>
<select
v-model="weeklyReport.period"
@change="resetWeeklyReportResult"
class="w-full px-3 py-2 border border-gray-300 rounded-md bg-white focus:outline-none focus:ring-2 focus:ring-blue-500"
>
<option value="last_week">上周</option>
<option value="this_week">本周</option>
</select>
</div>
<div class="flex items-end">
<button
@click="generateWeeklyReport"
@@ -73,6 +84,7 @@ export default {
return {
weeklyReport: {
username: '',
period: 'this_week',
loading: false,
result: '',
error: ''
@@ -80,11 +92,22 @@ export default {
}
},
computed: {
selectedPeriodLabel() {
return this.weeklyReport.period === 'this_week' ? '本周' : '上周';
}
},
async mounted() {
// 获取默认用户名
await this.loadDefaultUser();
},
methods: {
resetWeeklyReportResult() {
this.weeklyReport.result = '';
this.weeklyReport.error = '';
},
async loadDefaultUser() {
this.weeklyReport.username = resolveJiraDefaultQueryUser('');
@@ -118,7 +141,8 @@ export default {
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').getAttribute('content')
},
body: JSON.stringify({
username: this.weeklyReport.username
username: this.weeklyReport.username,
period: this.weeklyReport.period
})
});
@@ -163,7 +187,8 @@ export default {
}
const params = new URLSearchParams({
username: this.weeklyReport.username
username: this.weeklyReport.username,
period: this.weeklyReport.period
});
window.open(`/api/jira/weekly-report/download?${params}`, '_blank');