aegon-gen 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 (86) hide show
  1. package/package.json +12 -0
  2. package/src/App.vue +3 -0
  3. package/src/api/index.ts +19 -0
  4. package/src/api/modules/gen-ai/gen-entry/index.ts +30 -0
  5. package/src/api/modules/gen-ai/model-manager/index.ts +42 -0
  6. package/src/api/modules/gen-ai/model-manager/mockApi.ts +33 -0
  7. package/src/api/modules/index.ts +98 -0
  8. package/src/api/modules/user/index.ts +4 -0
  9. package/src/api/request.ts +102 -0
  10. package/src/assets/sample-access-icon.png +0 -0
  11. package/src/assets/sample-pie-chart.png +0 -0
  12. package/src/assets/vue.svg +1 -0
  13. package/src/components/CapsuleScrollbar.vue +93 -0
  14. package/src/components/Export/ExcelExport.vue +592 -0
  15. package/src/components/Export/ExcelExport2.vue +494 -0
  16. package/src/components/Export/ExcelExport3.vue +342 -0
  17. package/src/components/Export/ExcelExport4.vue +665 -0
  18. package/src/components/Export/excelExport.js +547 -0
  19. package/src/components/Export/excelExport.ts +551 -0
  20. package/src/components/GEN-AI/index.vue +142 -0
  21. package/src/components/GEN-AI/index1.vue +456 -0
  22. package/src/components/GEN-AI/index10.vue +5 -0
  23. package/src/components/GEN-AI/index2.vue +568 -0
  24. package/src/components/GEN-AI/index3.vue +623 -0
  25. package/src/components/GEN-AI/index4.vue +629 -0
  26. package/src/components/GEN-AI/index5.vue +578 -0
  27. package/src/components/GEN-AI/index6.vue +656 -0
  28. package/src/components/GEN-AI/index7.vue +717 -0
  29. package/src/components/GEN-AI/index8.vue +405 -0
  30. package/src/components/GEN-AI/index9.vue +1065 -0
  31. package/src/components/GEN-AI/types.ts +12 -0
  32. package/src/components/GEN-AI/utils.ts +42 -0
  33. package/src/components/HelloWorld.vue +41 -0
  34. package/src/components/PageCard.vue +7 -0
  35. package/src/components/PageHeader.vue +32 -0
  36. package/src/components/backup/index5 copy.vue +556 -0
  37. package/src/components/backup/index5.vue +620 -0
  38. package/src/components/backup/index9 copy.vue +1029 -0
  39. package/src/components/backup/index9-pro.vue +1065 -0
  40. package/src/components/backup/index9.vue +1057 -0
  41. package/src/components/el-date-picker.vue +64 -0
  42. package/src/directives/btnLoading.ts +427 -0
  43. package/src/directives/debounce copy.ts +670 -0
  44. package/src/directives/debounce.ts +98 -0
  45. package/src/directives/index.ts +25 -0
  46. package/src/layouts/MainLayout.vue +101 -0
  47. package/src/main.ts +85 -0
  48. package/src/router/index.ts +76 -0
  49. package/src/router/menus.ts +28 -0
  50. package/src/style.css +79 -0
  51. package/src/styles/_variables.scss +24 -0
  52. package/src/styles/app-button.css +26 -0
  53. package/src/styles/element-overrides.css +23 -0
  54. package/src/styles/global.css +44 -0
  55. package/src/styles/index.scss +1 -0
  56. package/src/styles/page-card.css +21 -0
  57. package/src/styles/variables.css +26 -0
  58. package/src/test/mock.ts +101 -0
  59. package/src/test/test1.vue +402 -0
  60. package/src/test/test2.vue +1689 -0
  61. package/src/types/gen-ai/gen-entry/index.ts +17 -0
  62. package/src/types/gen-ai/model-manager/index.ts +19 -0
  63. package/src/utils/docxExport.ts +1610 -0
  64. package/src/utils/gen-ai-navigation.ts +37 -0
  65. package/src/utils/gen-ai-scroll.ts +455 -0
  66. package/src/utils/openDataLoaderWordExport.ts +33 -0
  67. package/src/utils/pageScrollbar.ts +115 -0
  68. package/src/utils/randomTranscode.ts +87 -0
  69. package/src/utils/reportPdfExport.ts +44 -0
  70. package/src/views/AdminCenter/index.vue +817 -0
  71. package/src/views/Blank.vue +68 -0
  72. package/src/views/Home.vue +29 -0
  73. package/src/views/ReportCenter/index.vue +1380 -0
  74. package/src/views/TemplateCenter/Knowledge.ts +83 -0
  75. package/src/views/TemplateCenter/data.d.ts +10 -0
  76. package/src/views/TemplateCenter/index.vue +1205 -0
  77. package/src/views/TemplateCenter/service.ts +69 -0
  78. package/src/views/gen-ai/components/RecentReportsTable.vue +193 -0
  79. package/src/views/gen-ai/gen-entry/index.vue +309 -0
  80. package/src/views/gen-ai/gen-entry/mockData.ts +160 -0
  81. package/src/views/gen-ai/management-center/index.vue +53 -0
  82. package/src/views/gen-ai/model-manager/ChapterTitleScroll.vue +275 -0
  83. package/src/views/gen-ai/model-manager/index.vue +1205 -0
  84. package/src/views/gen-ai/model-manager/mockData.ts +122 -0
  85. package/src/views/gen-ai/report-center/index.vue +158 -0
  86. package/src/vite-env.d.ts +38 -0
@@ -0,0 +1,122 @@
1
+ import type { TemplateItem } from '@/types/gen-ai/model-manager/index'
2
+
3
+ const INDUSTRY_RISK_ANNUAL_DESC =
4
+ '本模板用於生成年度行業風險分析報告,覆蓋宏觀環境、行業運行、風險識別、授信結構、資產質素、重點客戶/項目、新發生風險、管控措施及下年度策略等模塊,支援按章節配置與版本管理。'
5
+
6
+ const INDUSTRY_RISK_ANNUAL_CHAPTERS = [
7
+ '1. 摘要與本年總結',
8
+ '2. 宏觀經濟與政策背景',
9
+ '3. 行業運行情況與核心指標',
10
+ '4. 風險識別與評級',
11
+ '5. 授信與客戶結構分析',
12
+ '6. 資產質素與逾期/不良變化6. 資產質素與逾期/不良變化6. 資產質素與逾期/不良變化6. 資產質素與逾期/不良變化6. 資產質素與逾期/不良變化',
13
+ '7. 重點客戶/項目風險',
14
+ '8. 新發生風險與預警',
15
+ '9. 風險管控措施與成效',
16
+ '10. 下年度風險研判與策略',
17
+ '11. 附件與數據',
18
+ ]
19
+
20
+ const QUARTERLY_BRIEF_DESC =
21
+ '面向季度復盤的輕量模板,聚焦行業景氣、核心指標波動、重點風險事件與管控建議,適用於管理層例會與條線月報。'
22
+
23
+ const QUARTERLY_BRIEF_CHAPTERS = [
24
+ '1. 季度摘要',
25
+ '2. 行業景氣與政策動態',
26
+ '3. 核心指標走勢',
27
+ '4. 重點風險事件',
28
+ '5. 管控措施與下季關注',
29
+ ]
30
+
31
+ const FULL_RISK_DESC =
32
+ '完整版風險報告模板,章節可擴展至 20+,覆蓋母行、子公司、區域及產品線多維度風險拆解,支援附錄與數據口徑說明。'
33
+
34
+ const FULL_RISK_CHAPTERS = [
35
+ ...INDUSTRY_RISK_ANNUAL_CHAPTERS,
36
+ '12. 區域風險分佈',
37
+ '13. 產品線風險拆解',
38
+ '14. 關聯方與集中度',
39
+ '15. 市場與流動性風險',
40
+ '16. 操作與合規風險',
41
+ '17. 聲譽與環境風險',
42
+ '18. 壓力測試結果',
43
+ '19. 整改跟進清單',
44
+ '20. 監管關注重點',
45
+ '21. 術語與指標口徑',
46
+ '22. 修訂記錄',
47
+ ]
48
+
49
+ export const MOCK_TEMPLATES: TemplateItem[] = [
50
+ {
51
+ id: '1',
52
+ name: '行業風險年報',
53
+ description: INDUSTRY_RISK_ANNUAL_DESC,
54
+ chapters: INDUSTRY_RISK_ANNUAL_CHAPTERS,
55
+ author: '王明輝(風險管理部)',
56
+ approver: '李思琪(合規部)',
57
+ updatedAt: '2025/11/7 15:21',
58
+ unit: '風險管理部',
59
+ locked: false,
60
+ locker: '陳大文(授信審批部)',
61
+ },
62
+ {
63
+ id: '2',
64
+ name: '行業風險年報',
65
+ description: INDUSTRY_RISK_ANNUAL_DESC,
66
+ chapters: INDUSTRY_RISK_ANNUAL_CHAPTERS,
67
+ author: '張偉(風險管理部)',
68
+ approver: '劉芳(合規部)',
69
+ updatedAt: '2025/10/28 09:15',
70
+ unit: '授信審批部',
71
+ locked: true,
72
+ locker: '陳大文(授信審批部)',
73
+ },
74
+ {
75
+ id: '3',
76
+ name: '行業風險年報',
77
+ description: INDUSTRY_RISK_ANNUAL_DESC,
78
+ chapters: INDUSTRY_RISK_ANNUAL_CHAPTERS,
79
+ author: '趙敏(公司金融部)',
80
+ approver: '周傑(合規部)',
81
+ updatedAt: '2025/9/12 11:40',
82
+ unit: '風險管理部',
83
+ locked: false,
84
+ locker: '陳大文(授信審批部)',
85
+ },
86
+ {
87
+ id: '4',
88
+ name: '季度行業風險簡報',
89
+ description: QUARTERLY_BRIEF_DESC,
90
+ chapters: QUARTERLY_BRIEF_CHAPTERS,
91
+ author: '陳曉東(風險管理部)',
92
+ approver: '何靜(合規部)',
93
+ updatedAt: '2025/8/3 16:05',
94
+ unit: '合規部',
95
+ locked: false,
96
+ locker: '陳大文(授信審批部)',
97
+ },
98
+ {
99
+ id: '5',
100
+ name: '全面風險分析模板',
101
+ description: FULL_RISK_DESC,
102
+ chapters: FULL_RISK_CHAPTERS,
103
+ author: '孫麗(風險管理部)',
104
+ approver: '馬強(合規部)',
105
+ updatedAt: '2025/7/19 14:32',
106
+ unit: '公司金融部',
107
+ locked: false,
108
+ locker: '陳大文(授信審批部)',
109
+ },
110
+ {
111
+ id: '6',
112
+ name: '行業風險年報',
113
+ description: INDUSTRY_RISK_ANNUAL_DESC,
114
+ chapters: INDUSTRY_RISK_ANNUAL_CHAPTERS,
115
+ author: '黃磊(授信審批部)',
116
+ approver: '吳婷(合規部)',
117
+ updatedAt: '2025/6/25 10:18',
118
+ unit: '授信審批部',
119
+ locked: true,
120
+ locker: '陳大文(授信審批部)',
121
+ },
122
+ ]
@@ -0,0 +1,158 @@
1
+ <template>
2
+ <div class="report-center-page">
3
+ <PageHeader title="IR-DEMO" />
4
+
5
+ <main ref="pageBodyRef" class="report-center-page__body is-scrollable">
6
+ <section class="report-center-hero">
7
+ <h2 class="report-center-hero__title">報告中心</h2>
8
+ <p class="report-center-hero__desc">查看與管理全部報告</p>
9
+ </section>
10
+
11
+ <section ref="reportsSectionRef" class="report-center-reports">
12
+ <h3 class="report-center-reports__title">
13
+ <el-icon class="report-center-reports__title-icon">
14
+ <Document />
15
+ </el-icon>
16
+ 全部報告
17
+ </h3>
18
+ <RecentReportsTable ref="tableRef" :reports="recentReports" @open="openReport" />
19
+ </section>
20
+ </main>
21
+
22
+ <CapsuleScrollbar
23
+ ref="capsuleScrollbarRef"
24
+ :scroll-el="pageBodyRef"
25
+ :anchor-el="reportsSectionRef"
26
+ :active="true"
27
+ :visible-ratio="2 / 3"
28
+ :right-offset-px="1"
29
+ :auto-hide-after-ms="3000"
30
+ />
31
+ </div>
32
+ </template>
33
+
34
+ <script setup lang="ts">
35
+ import genEntryApi from '@/api/modules/gen-ai/gen-entry/index'
36
+ import type { RecentReport } from '@/types/gen-ai/gen-entry/index'
37
+ import { bindViewportBodyHeight, lockDocumentScroll } from '@/utils/gen-ai-scroll'
38
+ import { openModelManager } from '@/utils/gen-ai-navigation'
39
+ import { Document } from '@element-plus/icons-vue'
40
+ import { onMounted, onUnmounted, ref } from 'vue'
41
+ import { useRouter } from 'vue-router'
42
+ import PageHeader from '@/components/PageHeader.vue'
43
+ import CapsuleScrollbar from '@/components/CapsuleScrollbar.vue'
44
+ import RecentReportsTable from '../components/RecentReportsTable.vue'
45
+ import { MOCK_RECENT_REPORTS } from '../gen-entry/mockData'
46
+
47
+ const router = useRouter()
48
+ const recentReports = ref<RecentReport[]>([...MOCK_RECENT_REPORTS])
49
+ const pageBodyRef = ref<HTMLElement | null>(null)
50
+ const reportsSectionRef = ref<HTMLElement | null>(null)
51
+ const tableRef = ref<InstanceType<typeof RecentReportsTable> | null>(null)
52
+ const capsuleScrollbarRef = ref<InstanceType<typeof CapsuleScrollbar> | null>(null)
53
+
54
+ function isRecentReportList(data: unknown): data is RecentReport[] {
55
+ return Array.isArray(data) && data.length > 0 && typeof data[0]?.id === 'string'
56
+ }
57
+
58
+ async function loadRecentReports() {
59
+ try {
60
+ const data = await genEntryApi.fetchGenAiReportListData({})
61
+ if (isRecentReportList(data)) {
62
+ recentReports.value = data
63
+ }
64
+ } catch {
65
+ // 保留 mock
66
+ }
67
+ }
68
+
69
+ function openReport(report: RecentReport) {
70
+ openModelManager(router, { id: report.id })
71
+ }
72
+
73
+ let cleanupBodyHeight: (() => void) | undefined
74
+ let cleanupLock: (() => void) | undefined
75
+
76
+ onMounted(async () => {
77
+ await loadRecentReports()
78
+ if (pageBodyRef.value) {
79
+ cleanupBodyHeight = bindViewportBodyHeight(pageBodyRef.value, {
80
+ subtractSelector: '.page-header',
81
+ subtractRoot: pageBodyRef.value.parentElement ?? undefined,
82
+ })
83
+ }
84
+ cleanupLock = lockDocumentScroll()
85
+ tableRef.value?.doLayout()
86
+ capsuleScrollbarRef.value?.refresh()
87
+ })
88
+
89
+ onUnmounted(() => {
90
+ cleanupBodyHeight?.()
91
+ cleanupLock?.()
92
+ })
93
+ </script>
94
+
95
+ <style scoped>
96
+ .report-center-page {
97
+ display: flex;
98
+ flex-direction: column;
99
+ height: 100vh;
100
+ overflow: hidden;
101
+ background: #fff;
102
+ }
103
+
104
+ .report-center-page__body {
105
+ flex: 1;
106
+ min-height: 0;
107
+ overflow-y: auto;
108
+ overflow-x: hidden;
109
+ width: 100%;
110
+ padding: 48px 24px 40px;
111
+ box-sizing: border-box;
112
+ }
113
+
114
+ .report-center-hero {
115
+ flex-shrink: 0;
116
+ text-align: center;
117
+ margin-bottom: 48px;
118
+ }
119
+
120
+ .report-center-hero__title {
121
+ margin: 0 0 12px;
122
+ font-size: 28px;
123
+ font-weight: 700;
124
+ color: #1a1a1a;
125
+ }
126
+
127
+ .report-center-hero__desc {
128
+ margin: 0;
129
+ font-size: 14px;
130
+ line-height: 1.7;
131
+ color: #666;
132
+ }
133
+
134
+ .report-center-reports {
135
+ width: 80%;
136
+ max-width: 80%;
137
+ margin: 0 auto;
138
+ padding: 0;
139
+ box-sizing: border-box;
140
+ }
141
+
142
+ .report-center-reports__title {
143
+ display: inline-flex;
144
+ align-items: center;
145
+ gap: 8px;
146
+ margin: 0 0 16px;
147
+ padding: 0;
148
+ font-size: 16px;
149
+ font-weight: 600;
150
+ color: #1a1a1a;
151
+ width: 100%;
152
+ }
153
+
154
+ .report-center-reports__title-icon {
155
+ font-size: 18px;
156
+ color: #606266;
157
+ }
158
+ </style>
@@ -0,0 +1,38 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ interface ImportMetaEnv {
4
+ readonly VITE_APP_TITLE: string
5
+ readonly VITE_APP_ENV: string
6
+ readonly VITE_PORT: string
7
+ readonly VITE_API_BASE_URL: string
8
+ readonly VITE_REPORT_STREAM_MOCK?: string
9
+ readonly VITE_REPORT_STREAM_URL?: string
10
+ readonly VITE_API_TOKEN?: string
11
+ readonly VITE_TEMPLATE_CENTER_URL?: string
12
+ readonly VITE_MODEL_MANAGER_URL?: string
13
+ readonly VITE_CHAT_MODEL?: string
14
+ readonly VITE_CHAT_PROVIDER_LABEL?: string
15
+ }
16
+
17
+ interface ImportMeta {
18
+ readonly env: ImportMetaEnv
19
+ }
20
+
21
+ declare global {
22
+ /** registerDirectives 挂载,页面任意处可直接 closeBtnLoading() */
23
+ function closeBtnLoading(target?: HTMLElement | string): void
24
+
25
+ interface Window {
26
+ closeBtnLoading: typeof closeBtnLoading
27
+ }
28
+
29
+ var closeBtnLoading: (target?: HTMLElement | string) => void
30
+ }
31
+
32
+ declare module 'vue' {
33
+ interface ComponentCustomProperties {
34
+ closeBtnLoading: (target?: HTMLElement | string) => void
35
+ }
36
+ }
37
+
38
+ export {}