aegon-dangerious 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/build-report/components/AiPromptGenerateDialog.vue +349 -0
  2. package/build-report/components/CapsuleScrollbar.vue +145 -0
  3. package/build-report/components/ChapterTitleScroll.vue +292 -0
  4. package/build-report/components/PromptField.vue +314 -0
  5. package/build-report/components/RecentReportsTable.vue +408 -0
  6. package/build-report/components/ReportChapterPreview.vue +437 -0
  7. package/build-report/components/ReportChapterWorkspace.vue +923 -0
  8. package/build-report/components/ReportCollapsibleSection.vue +132 -0
  9. package/build-report/components/ReportConfigPanel.vue +609 -0
  10. package/build-report/components/ReportGenerateSettingsPanel.vue +403 -0
  11. package/build-report/components/ReportGeneratingPanel.vue +908 -0
  12. package/build-report/components/ReportHistoryList.vue +157 -0
  13. package/build-report/components/ReportHistoryPanel.vue +140 -0
  14. package/build-report/components/ReportPromptPanel.vue +445 -0
  15. package/build-report/components/ReportSectionConfirmPopover.vue +232 -0
  16. package/build-report/components/ReportSourceFileSummary.vue +544 -0
  17. package/build-report/components/ReportSourcesMoreOverlay.vue +279 -0
  18. package/build-report/components/ReportSourcesPanel.vue +1055 -0
  19. package/build-report/components/ReportTemplateDetail.vue +176 -0
  20. package/build-report/components/ReportTemplateEditorFormPanel.vue +602 -0
  21. package/build-report/components/ReportTemplatePicker.vue +802 -0
  22. package/build-report/components/ReportTemplatePromptField.vue +314 -0
  23. package/build-report/components/ReportWorkflowSidebar.vue +104 -0
  24. package/build-report/components/reportEdit.vue +334 -0
  25. package/build-report/index.vue +646 -0
  26. package/build-report/report-list.vue +407 -0
  27. package/build-report/report-template-data.ts +248 -0
  28. package/build-report/styles/report-workflow-dialog.css +33 -0
  29. package/build-report/useReportWorkflow.ts +343 -0
  30. package/build-report/utils/report-edit-route.ts +109 -0
  31. package/build-report/utils/scroll.ts +361 -0
  32. package/package.json +12 -0
@@ -0,0 +1,176 @@
1
+ <template>
2
+ <section class="report-template-detail">
3
+ <div class="report-template-detail__toolbar">
4
+ <button type="button" class="app-btn app-btn--wide app-btn--outline" @click="$emit('back')">返回</button>
5
+ </div>
6
+
7
+ <section class="report-template-detail__hero">
8
+ <h2 class="report-template-detail__hero-title">模板配置</h2>
9
+ <p class="report-template-detail__hero-desc gen-ai-page-hero-desc">配置報告生成的基礎參數,確定分析視角</p>
10
+ </section>
11
+
12
+ <div class="report-template-detail__body">
13
+ <ReportTemplateEditorFormPanel v-model="form" editor-mode="edit">
14
+ <template #footer-actions>
15
+ <button type="button" class="app-btn app-btn--wide" :disabled="!canGenerate" @click="handleGenerate">
16
+ 一鍵生成
17
+ </button>
18
+ </template>
19
+ </ReportTemplateEditorFormPanel>
20
+ </div>
21
+ </section>
22
+ </template>
23
+
24
+ <script setup lang="ts">
25
+ import { computed, ref, watch } from 'vue'
26
+ import ReportTemplateEditorFormPanel from './ReportTemplateEditorFormPanel.vue'
27
+ import {
28
+ buildEditorFormFromTemplate,
29
+ findTemplateById,
30
+ type TemplateEditorForm,
31
+ type TemplateItem,
32
+ } from '../report-template-data'
33
+ import { useReportWorkflow } from '../useReportWorkflow'
34
+ import type { ReportTemplateCard } from '../report-template-data'
35
+
36
+ const props = defineProps<{
37
+ template: ReportTemplateCard
38
+ }>()
39
+
40
+ const emit = defineEmits<{
41
+ back: []
42
+ generate: []
43
+ }>()
44
+
45
+ const { sourceFiles } = useReportWorkflow()
46
+ const canGenerate = computed(() => sourceFiles.value.length > 0)
47
+
48
+ function handleGenerate() {
49
+ if (!canGenerate.value) return
50
+ emit('generate')
51
+ }
52
+
53
+ const form = ref<TemplateEditorForm>({
54
+ language: 'zh',
55
+ title: '',
56
+ description: '',
57
+ chapters: [],
58
+ })
59
+
60
+ function toTemplateItem(card: ReportTemplateCard): TemplateItem {
61
+ return (
62
+ findTemplateById(card.id) ?? {
63
+ id: card.id,
64
+ name: card.name,
65
+ description: card.description,
66
+ chapters: [...card.chapters],
67
+ author: card.author,
68
+ approver: '',
69
+ updatedAt: card.updatedAt,
70
+ unit: '',
71
+ locked: false,
72
+ locker: '',
73
+ }
74
+ )
75
+ }
76
+
77
+ function syncFormFromTemplate(card: ReportTemplateCard) {
78
+ form.value = buildEditorFormFromTemplate(toTemplateItem(card))
79
+ }
80
+
81
+ watch(
82
+ () => props.template,
83
+ (card) => syncFormFromTemplate(card),
84
+ { immediate: true, deep: true },
85
+ )
86
+ </script>
87
+
88
+ <style scoped>
89
+ .report-template-detail {
90
+ --gen-ai-fs-hero: clamp(26px, calc(32 * 100vw / 1920), 32px);
91
+ --gen-ai-fw-bold: 700;
92
+ display: flex;
93
+ flex-direction: column;
94
+ gap: 0;
95
+ min-height: 100%;
96
+ box-sizing: border-box;
97
+ }
98
+
99
+ .report-template-detail__toolbar {
100
+ flex-shrink: 0;
101
+ margin-bottom: 12px;
102
+ }
103
+
104
+ .report-template-detail__hero {
105
+ text-align: center;
106
+ margin-bottom: 28px;
107
+ }
108
+
109
+ .report-template-detail__hero-title {
110
+ margin: 0 0 12px;
111
+ font-size: var(--gen-ai-fs-hero);
112
+ font-weight: var(--gen-ai-fw-bold);
113
+ color: #1a1a1a;
114
+ }
115
+
116
+ .report-template-detail__hero-desc {
117
+ margin: 0;
118
+ }
119
+
120
+ .gen-ai-page-hero-desc {
121
+ font-size: 16px;
122
+ font-weight: 600;
123
+ line-height: 1.7;
124
+ color: #666;
125
+ }
126
+
127
+ .report-template-detail__body {
128
+ flex: 1;
129
+ min-height: 0;
130
+ overflow: auto;
131
+ }
132
+
133
+ .app-btn {
134
+ display: inline-flex;
135
+ align-items: center;
136
+ justify-content: center;
137
+ box-sizing: border-box;
138
+ width: 160px;
139
+ height: 39px;
140
+ min-width: 160px;
141
+ padding: 0;
142
+ border: 1px solid #c53355;
143
+ border-radius: 4px;
144
+ background: #c53355;
145
+ color: #fff;
146
+ font-size: 14px;
147
+ font-weight: 600;
148
+ line-height: 1;
149
+ cursor: pointer;
150
+ }
151
+
152
+ .app-btn:hover:not(:disabled) {
153
+ background: #fff;
154
+ color: #c53355;
155
+ }
156
+
157
+ .app-btn:disabled {
158
+ opacity: 0.45;
159
+ cursor: not-allowed;
160
+ }
161
+
162
+ .app-btn--wide {
163
+ width: 160px;
164
+ min-width: 160px;
165
+ }
166
+
167
+ .app-btn--outline {
168
+ background: #fff;
169
+ color: #c53355;
170
+ }
171
+
172
+ .app-btn--outline:hover {
173
+ background: #c53355;
174
+ color: #fff;
175
+ }
176
+ </style>