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.
- package/build-report/components/AiPromptGenerateDialog.vue +349 -0
- package/build-report/components/CapsuleScrollbar.vue +145 -0
- package/build-report/components/ChapterTitleScroll.vue +292 -0
- package/build-report/components/PromptField.vue +314 -0
- package/build-report/components/RecentReportsTable.vue +408 -0
- package/build-report/components/ReportChapterPreview.vue +437 -0
- package/build-report/components/ReportChapterWorkspace.vue +923 -0
- package/build-report/components/ReportCollapsibleSection.vue +132 -0
- package/build-report/components/ReportConfigPanel.vue +609 -0
- package/build-report/components/ReportGenerateSettingsPanel.vue +403 -0
- package/build-report/components/ReportGeneratingPanel.vue +908 -0
- package/build-report/components/ReportHistoryList.vue +157 -0
- package/build-report/components/ReportHistoryPanel.vue +140 -0
- package/build-report/components/ReportPromptPanel.vue +445 -0
- package/build-report/components/ReportSectionConfirmPopover.vue +232 -0
- package/build-report/components/ReportSourceFileSummary.vue +544 -0
- package/build-report/components/ReportSourcesMoreOverlay.vue +279 -0
- package/build-report/components/ReportSourcesPanel.vue +1055 -0
- package/build-report/components/ReportTemplateDetail.vue +176 -0
- package/build-report/components/ReportTemplateEditorFormPanel.vue +602 -0
- package/build-report/components/ReportTemplatePicker.vue +802 -0
- package/build-report/components/ReportTemplatePromptField.vue +314 -0
- package/build-report/components/ReportWorkflowSidebar.vue +104 -0
- package/build-report/components/reportEdit.vue +334 -0
- package/build-report/index.vue +646 -0
- package/build-report/report-list.vue +407 -0
- package/build-report/report-template-data.ts +248 -0
- package/build-report/styles/report-workflow-dialog.css +33 -0
- package/build-report/useReportWorkflow.ts +343 -0
- package/build-report/utils/report-edit-route.ts +109 -0
- package/build-report/utils/scroll.ts +361 -0
- package/package.json +12 -0
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="report-sources-more-overlay" aria-label="信息源檔案列表">
|
|
3
|
+
<header class="report-sources-more-overlay__header">
|
|
4
|
+
<el-breadcrumb class="report-sources-more-overlay__breadcrumb" separator="/">
|
|
5
|
+
<el-breadcrumb-item>
|
|
6
|
+
<button type="button" class="report-sources-more-overlay__breadcrumb-link" @click="emit('close')">
|
|
7
|
+
{{ parentLabel }}
|
|
8
|
+
</button>
|
|
9
|
+
</el-breadcrumb-item>
|
|
10
|
+
<el-breadcrumb-item>信息源檔案</el-breadcrumb-item>
|
|
11
|
+
</el-breadcrumb>
|
|
12
|
+
<button type="button" class="report-sources-more-overlay__close" aria-label="關閉" @click="emit('close')">
|
|
13
|
+
<el-icon>
|
|
14
|
+
<Close />
|
|
15
|
+
</el-icon>
|
|
16
|
+
</button>
|
|
17
|
+
</header>
|
|
18
|
+
|
|
19
|
+
<div ref="bodyRef" class="report-sources-more-overlay__body">
|
|
20
|
+
<table class="report-source-table report-sources-more-overlay__table">
|
|
21
|
+
<colgroup>
|
|
22
|
+
<col />
|
|
23
|
+
<col class="report-source-table__col-action" />
|
|
24
|
+
<col class="report-source-table__col-action" />
|
|
25
|
+
<col class="report-source-table__col-action" />
|
|
26
|
+
</colgroup>
|
|
27
|
+
<thead>
|
|
28
|
+
<tr>
|
|
29
|
+
<th>檔案名稱</th>
|
|
30
|
+
<th class="report-source-table__action">預覽</th>
|
|
31
|
+
<th class="report-source-table__action">下載</th>
|
|
32
|
+
<th class="report-source-table__action">刪除</th>
|
|
33
|
+
</tr>
|
|
34
|
+
</thead>
|
|
35
|
+
<tbody>
|
|
36
|
+
<tr v-for="file in sourceFiles" :key="file.id">
|
|
37
|
+
<td class="report-source-table__name">{{ file.name }}</td>
|
|
38
|
+
<td class="report-source-table__action">
|
|
39
|
+
<button type="button" class="report-icon-btn" aria-label="預覽" @click="previewSource(file)">
|
|
40
|
+
<el-icon>
|
|
41
|
+
<View />
|
|
42
|
+
</el-icon>
|
|
43
|
+
</button>
|
|
44
|
+
</td>
|
|
45
|
+
<td class="report-source-table__action">
|
|
46
|
+
<button type="button" class="report-icon-btn" aria-label="下載" @click="downloadSource(file)">
|
|
47
|
+
<el-icon>
|
|
48
|
+
<Download />
|
|
49
|
+
</el-icon>
|
|
50
|
+
</button>
|
|
51
|
+
</td>
|
|
52
|
+
<td class="report-source-table__action">
|
|
53
|
+
<button type="button" class="report-icon-btn" aria-label="刪除" @click="requestDeleteSource(file)">
|
|
54
|
+
<el-icon>
|
|
55
|
+
<Close />
|
|
56
|
+
</el-icon>
|
|
57
|
+
</button>
|
|
58
|
+
</td>
|
|
59
|
+
</tr>
|
|
60
|
+
<tr v-if="!sourceFiles.length">
|
|
61
|
+
<td colspan="4" class="report-source-table__empty">暫無檔案</td>
|
|
62
|
+
</tr>
|
|
63
|
+
</tbody>
|
|
64
|
+
</table>
|
|
65
|
+
</div>
|
|
66
|
+
</section>
|
|
67
|
+
</template>
|
|
68
|
+
|
|
69
|
+
<script setup lang="ts">
|
|
70
|
+
import { Close, Download, View } from '@element-plus/icons-vue'
|
|
71
|
+
import { ElBreadcrumb, ElBreadcrumbItem, ElIcon, ElMessageBox } from 'element-plus'
|
|
72
|
+
import { onMounted, ref } from 'vue'
|
|
73
|
+
import { useReportWorkflow, type SourceFile } from '../useReportWorkflow'
|
|
74
|
+
|
|
75
|
+
withDefaults(
|
|
76
|
+
defineProps<{
|
|
77
|
+
parentLabel?: string
|
|
78
|
+
}>(),
|
|
79
|
+
{
|
|
80
|
+
parentLabel: '選擇模板',
|
|
81
|
+
},
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
const emit = defineEmits<{
|
|
85
|
+
close: []
|
|
86
|
+
}>()
|
|
87
|
+
|
|
88
|
+
const { sourceFiles } = useReportWorkflow()
|
|
89
|
+
|
|
90
|
+
const bodyRef = ref<HTMLElement | null>(null)
|
|
91
|
+
|
|
92
|
+
onMounted(() => {
|
|
93
|
+
bodyRef.value?.scrollTo({ top: 0 })
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
function resetBodyScroll() {
|
|
97
|
+
bodyRef.value?.scrollTo({ top: 0 })
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
defineExpose({
|
|
101
|
+
resetBodyScroll,
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
function previewSource(file: SourceFile) {
|
|
105
|
+
console.log('preview', file.name)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function downloadSource(file: SourceFile) {
|
|
109
|
+
console.log('download', file.name)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function deleteSource(id: string) {
|
|
113
|
+
sourceFiles.value = sourceFiles.value.filter((file) => file.id !== id)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async function requestDeleteSource(file: SourceFile) {
|
|
117
|
+
try {
|
|
118
|
+
await ElMessageBox.confirm(`確定刪除「${file.name}」?`, '確認刪除', {
|
|
119
|
+
confirmButtonText: '確認',
|
|
120
|
+
cancelButtonText: '取消',
|
|
121
|
+
type: 'warning',
|
|
122
|
+
})
|
|
123
|
+
deleteSource(file.id)
|
|
124
|
+
} catch {
|
|
125
|
+
// cancelled
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
</script>
|
|
129
|
+
|
|
130
|
+
<style scoped>
|
|
131
|
+
.report-sources-more-overlay {
|
|
132
|
+
--report-source-action-col: 56px;
|
|
133
|
+
--report-source-row-h: 36px;
|
|
134
|
+
position: absolute;
|
|
135
|
+
inset: 0;
|
|
136
|
+
z-index: 10;
|
|
137
|
+
display: flex;
|
|
138
|
+
flex-direction: column;
|
|
139
|
+
box-sizing: border-box;
|
|
140
|
+
padding: 16px 20px 20px;
|
|
141
|
+
border: 1px solid #ebeef5;
|
|
142
|
+
border-radius: 8px;
|
|
143
|
+
background: #fff;
|
|
144
|
+
overflow: hidden;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.report-sources-more-overlay__header {
|
|
148
|
+
display: flex;
|
|
149
|
+
align-items: center;
|
|
150
|
+
justify-content: space-between;
|
|
151
|
+
flex-shrink: 0;
|
|
152
|
+
margin-bottom: 16px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.report-sources-more-overlay__breadcrumb {
|
|
156
|
+
flex: 1;
|
|
157
|
+
min-width: 0;
|
|
158
|
+
font-size: 14px;
|
|
159
|
+
line-height: 1.4;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.report-sources-more-overlay__breadcrumb-link {
|
|
163
|
+
padding: 0;
|
|
164
|
+
border: 0;
|
|
165
|
+
background: none;
|
|
166
|
+
color: #409eff;
|
|
167
|
+
font: inherit;
|
|
168
|
+
cursor: pointer;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.report-sources-more-overlay__breadcrumb-link:hover {
|
|
172
|
+
color: #66b1ff;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.report-sources-more-overlay__close {
|
|
176
|
+
display: inline-flex;
|
|
177
|
+
align-items: center;
|
|
178
|
+
justify-content: center;
|
|
179
|
+
width: 28px;
|
|
180
|
+
height: 28px;
|
|
181
|
+
padding: 0;
|
|
182
|
+
border: 0;
|
|
183
|
+
border-radius: 4px;
|
|
184
|
+
background: none;
|
|
185
|
+
color: #909399;
|
|
186
|
+
font-size: 18px;
|
|
187
|
+
cursor: pointer;
|
|
188
|
+
transition: color 0.2s ease, background-color 0.2s ease;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.report-sources-more-overlay__close:hover {
|
|
192
|
+
color: #c53355;
|
|
193
|
+
background: #fff5f6;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.report-sources-more-overlay__body {
|
|
197
|
+
flex: 1;
|
|
198
|
+
min-height: 0;
|
|
199
|
+
overflow: auto;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.report-sources-more-overlay__table {
|
|
203
|
+
width: 100%;
|
|
204
|
+
table-layout: fixed;
|
|
205
|
+
border-collapse: separate;
|
|
206
|
+
border-spacing: 0;
|
|
207
|
+
font-size: 13px;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.report-sources-more-overlay__table th,
|
|
211
|
+
.report-sources-more-overlay__table td {
|
|
212
|
+
height: var(--report-source-row-h);
|
|
213
|
+
padding: 0 10px;
|
|
214
|
+
text-align: left;
|
|
215
|
+
background: #fff;
|
|
216
|
+
vertical-align: middle;
|
|
217
|
+
box-sizing: border-box;
|
|
218
|
+
transition: background-color 0.2s ease;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.report-sources-more-overlay__table th.report-source-table__action,
|
|
222
|
+
.report-sources-more-overlay__table td.report-source-table__action {
|
|
223
|
+
width: var(--report-source-action-col);
|
|
224
|
+
text-align: right;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.report-sources-more-overlay__table tbody tr:hover > td {
|
|
228
|
+
background-color: #f5f7fa;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.report-sources-more-overlay__table tbody tr:hover > td:first-child {
|
|
232
|
+
border-radius: 4px 0 0 4px;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.report-sources-more-overlay__table tbody tr:hover > td:last-child {
|
|
236
|
+
border-radius: 0 4px 4px 0;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.report-sources-more-overlay__table th {
|
|
240
|
+
background: #fafafa;
|
|
241
|
+
font-weight: 600;
|
|
242
|
+
color: #1a1a1a;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.report-source-table__name {
|
|
246
|
+
overflow: hidden;
|
|
247
|
+
text-overflow: ellipsis;
|
|
248
|
+
white-space: nowrap;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.report-source-table__empty {
|
|
252
|
+
text-align: center;
|
|
253
|
+
color: #86909c;
|
|
254
|
+
height: auto;
|
|
255
|
+
padding: 24px;
|
|
256
|
+
}
|
|
257
|
+
</style>
|
|
258
|
+
|
|
259
|
+
<style>
|
|
260
|
+
.report-sources-more-overlay .report-icon-btn {
|
|
261
|
+
display: inline-flex;
|
|
262
|
+
align-items: center;
|
|
263
|
+
justify-content: center;
|
|
264
|
+
width: 24px;
|
|
265
|
+
height: 24px;
|
|
266
|
+
padding: 0;
|
|
267
|
+
border: 0;
|
|
268
|
+
background: none;
|
|
269
|
+
color: #4e5969;
|
|
270
|
+
cursor: pointer;
|
|
271
|
+
border-radius: 4px;
|
|
272
|
+
vertical-align: middle;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.report-sources-more-overlay .report-icon-btn:hover {
|
|
276
|
+
color: #c53355;
|
|
277
|
+
background: #fff5f6;
|
|
278
|
+
}
|
|
279
|
+
</style>
|