提交 e48d8c32 authored 作者: kxjia's avatar kxjia

更新程序

上级 0c4531a3
...@@ -56,6 +56,7 @@ public class PenaltyCrawler { ...@@ -56,6 +56,7 @@ public class PenaltyCrawler {
case "cbirc" -> crawlCBIRC(source); case "cbirc" -> crawlCBIRC(source);
case "csrc" -> crawlCSRC(source); case "csrc" -> crawlCSRC(source);
case "safe" -> crawlSAFE(source); case "safe" -> crawlSAFE(source);
case "nfraf" -> crawlNFRAF(source);
default -> crawlDefault(source); default -> crawlDefault(source);
}; };
...@@ -482,4 +483,84 @@ public class PenaltyCrawler { ...@@ -482,4 +483,84 @@ public class PenaltyCrawler {
.isNew(entity.getIsNew()) .isNew(entity.getIsNew())
.build(); .build();
} }
private List<PenaltyRecord> crawlNFRAF(CrawlerConfig.SourceConfig source) throws Exception {
List<PenaltyRecord> records = new ArrayList<>();
log.info("正在连接国家金融监督管理总局网站...");
try {
Document doc = fetchWithRetry(source.getListUrl(), 3);
if (doc == null) {
log.warn("NFRAF: 无法获取页面内容");
return records;
}
Elements items = doc.select("ul li, div.list-item, tr, div.article-item, div.news-item");
for (Element item : items) {
try {
Element link = item.selectFirst("a[href]");
if (link == null) continue;
String title = link.text().trim();
String href = link.attr("href");
if (isPenaltyRelated(title)) {
String dateStr = extractDate(item.text());
PenaltyRecord record = PenaltyRecord.builder()
.penaltyNumber(generatePenaltyNumber(source.getName()))
.institutionName(extractInstitutionName(title))
.institutionType(guessInstitutionType(title))
.penaltyType("行政处罚")
.penaltyDate(LocalDate.parse(dateStr, DATE_FORMATTER))
.regulator("国家金融监督管理总局")
.illegalFacts(title)
.sourceUrl(buildFullUrl(source.getBaseUrl(), href))
.build();
records.add(record);
}
} catch (Exception e) {
log.debug("解析NFRAF列表项失败: {}", e.getMessage());
}
}
if (records.isEmpty()) {
log.info("NFRAF: 未找到处罚列表,尝试其他选择器...");
Elements altItems = doc.select("a[href*='punish'], a[href*='penalty'], a[href*='cf']");
for (Element link : altItems) {
try {
String title = link.text().trim();
if (title.length() > 5 && isPenaltyRelated(title)) {
String href = link.attr("href");
PenaltyRecord record = PenaltyRecord.builder()
.penaltyNumber(generatePenaltyNumber(source.getName()))
.institutionName(extractInstitutionName(title))
.institutionType(guessInstitutionType(title))
.penaltyType("行政处罚")
.penaltyDate(LocalDate.now())
.regulator("国家金融监督管理总局")
.illegalFacts(title)
.sourceUrl(buildFullUrl(source.getBaseUrl(), href))
.build();
records.add(record);
}
} catch (Exception e) {
log.debug("解析NFRAF备选链接失败: {}", e.getMessage());
}
}
}
log.info("NFRAF: 共解析{}条记录", records.size());
} catch (Exception e) {
log.error("NFRAF爬取失败: {}", e.getMessage(), e);
throw e;
}
return records;
}
} }
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
<link rel="icon" href="/favicon.ico"> <link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>金融监管处罚监控系统</title> <title>金融监管处罚监控系统</title>
<script type="module" crossorigin src="/assets/index-BmCe9MoE.js"></script> <script type="module" crossorigin src="/assets/index-DLhtj81y.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-CIYNnUWJ.css"> <link rel="stylesheet" crossorigin href="/assets/index-D_lRsYFa.css">
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
......
...@@ -2,8 +2,10 @@ import axios from 'axios' ...@@ -2,8 +2,10 @@ import axios from 'axios'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import router from '../router' import router from '../router'
const isDev = import.meta.env.DEV
const request = axios.create({ const request = axios.create({
baseURL: '/api', baseURL: isDev ? '/api' : (import.meta.env.VITE_API_BASE_URL || '/api'),
timeout: 300000 timeout: 300000
}) })
......
...@@ -116,3 +116,135 @@ html, body { ...@@ -116,3 +116,135 @@ html, body {
} }
} }
} }
// AI分析报告样式
.report-dialog {
.el-dialog__body {
padding: 0;
}
}
.markdown-body {
font-family: 'Microsoft YaHei', 'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif !important;
font-size: 18px !important;
line-height: 2.5 !important;
color: #303133 !important;
padding: 30px !important;
background: #fff !important;
> h1 {
font-size: 28px !important;
font-weight: 700 !important;
color: #409eff !important;
padding-bottom: 15px !important;
border-bottom: 3px solid #409eff !important;
margin-bottom: 30px !important;
line-height: 2.5 !important;
}
> h2 {
font-size: 22px !important;
font-weight: 700 !important;
color: #303133 !important;
padding-bottom: 10px !important;
border-bottom: 2px solid #e4e7ed !important;
margin: 40px 0 25px !important;
line-height: 2.5 !important;
}
> h3 {
font-size: 20px !important;
font-weight: 700 !important;
color: #303133 !important;
margin: 35px 0 20px !important;
line-height: 2.5 !important;
}
> p {
margin-bottom: 28px !important;
line-height: 2.5 !important;
}
> ul, > ol {
padding-left: 40px !important;
margin-bottom: 28px !important;
> li {
margin-bottom: 16px !important;
line-height: 2.5 !important;
}
}
code {
padding: 4px 10px !important;
margin: 0 6px !important;
font-size: 95% !important;
background-color: #f5f7fa !important;
border-radius: 4px !important;
font-family: 'Consolas', monospace !important;
color: #c7254e !important;
}
pre {
padding: 24px !important;
overflow: auto !important;
font-size: 90% !important;
line-height: 2.5 !important;
background-color: #282c34 !important;
border-radius: 6px !important;
margin: 24px 0 !important;
code {
padding: 0 !important;
background-color: transparent !important;
color: #abb2bf !important;
}
}
blockquote {
padding: 20px 24px !important;
margin: 24px 0 !important;
border-left: 6px solid #409eff !important;
background-color: #f0f7ff !important;
color: #606266 !important;
p {
margin-bottom: 0 !important;
line-height: 2.5 !important;
}
}
table {
width: 100% !important;
border-collapse: collapse !important;
margin: 24px 0 !important;
th, td {
padding: 16px 20px !important;
border: 1px solid #e4e7ed !important;
text-align: left !important;
line-height: 2.5 !important;
}
th {
background-color: #f5f7fa !important;
font-weight: 700 !important;
}
tr:nth-child(even) {
background-color: #fafafa !important;
}
}
hr {
height: 2px !important;
margin: 40px 0 !important;
background-color: #e4e7ed !important;
border: none !important;
}
strong {
font-weight: 700 !important;
color: #1a1a1a !important;
}
}
...@@ -97,17 +97,18 @@ ...@@ -97,17 +97,18 @@
<span v-else>-</span> <span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="200" fixed="right"> <el-table-column label="操作" width="250" fixed="right">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="primary" link @click="viewDetail(row)">详情</el-button> <el-button type="primary" link @click="viewDetail(row)">详情</el-button>
<el-button type="primary" link @click="viewReport(row)">报告</el-button>
<el-button <el-button
type="success" type="warning"
link link
@click="analyzeContent(row)" @click="analyzeContent(row)"
:loading="row.analysisStatus === 'analyzing'" :loading="row.analysisStatus === 'analyzing'"
:disabled="row.analysisStatus === 'analyzing'" :disabled="row.analysisStatus === 'analyzing'"
> >
内容分析 分析
</el-button> </el-button>
<el-button type="primary" link @click="markRead(row)" v-if="row.isNew">已读</el-button> <el-button type="primary" link @click="markRead(row)" v-if="row.isNew">已读</el-button>
</template> </template>
...@@ -129,7 +130,15 @@ ...@@ -129,7 +130,15 @@
</el-card> </el-card>
<!-- 详情弹窗 --> <!-- 详情弹窗 -->
<el-dialog v-model="detailVisible" title="处罚详情" width="750px"> <el-dialog v-model="detailVisible" title="处罚详情" width="825px" :fullscreen="detailFullscreen" show-fullscreen>
<template #header>
<div class="detail-header">
<span>处罚详情</span>
<el-button link @click="detailFullscreen = !detailFullscreen">
<el-icon><FullScreen /></el-icon>
</el-button>
</div>
</template>
<el-descriptions v-if="currentRecord" :column="2" border> <el-descriptions v-if="currentRecord" :column="2" border>
<el-descriptions-item label="处罚编号" :span="2">{{ currentRecord.penaltyNumber }}</el-descriptions-item> <el-descriptions-item label="处罚编号" :span="2">{{ currentRecord.penaltyNumber }}</el-descriptions-item>
<el-descriptions-item label="被处罚机构" :span="2">{{ currentRecord.institutionName }}</el-descriptions-item> <el-descriptions-item label="被处罚机构" :span="2">{{ currentRecord.institutionName }}</el-descriptions-item>
...@@ -158,8 +167,8 @@ ...@@ -158,8 +167,8 @@
</template> </template>
</el-dialog> </el-dialog>
<!-- 分析报告弹窗 --> <!-- 分析报告弹窗 -->
<el-dialog v-model="reportVisible" title="AI分析报告" width="50%"> <el-dialog v-model="reportVisible" title="AI分析报告" width="55%" :fullscreen="reportFullscreen" show-fullscreen class="report-dialog">
<div v-loading="reportLoading" class="report-content"> <div v-loading="reportLoading" class="report-content">
<div <div
v-if="currentReport" v-if="currentReport"
...@@ -244,7 +253,7 @@ ...@@ -244,7 +253,7 @@
<script setup> <script setup>
import { ref, reactive, onMounted, computed } from 'vue' import { ref, reactive, onMounted, computed } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import { Search, Refresh, Download, Check } from '@element-plus/icons-vue' import { Search, Refresh, Download, Check, FullScreen } from '@element-plus/icons-vue'
import { marked } from 'marked' import { marked } from 'marked'
import api from '../api' import api from '../api'
...@@ -259,7 +268,9 @@ marked.setOptions({ ...@@ -259,7 +268,9 @@ marked.setOptions({
const loading = ref(false) const loading = ref(false)
const tableData = ref([]) const tableData = ref([])
const detailVisible = ref(false) const detailVisible = ref(false)
const detailFullscreen = ref(false)
const reportVisible = ref(false) const reportVisible = ref(false)
const reportFullscreen = ref(false)
const reportLoading = ref(false) const reportLoading = ref(false)
const currentRecord = ref(null) const currentRecord = ref(null)
const currentReport = ref(null) const currentReport = ref(null)
...@@ -515,6 +526,13 @@ const handleSubmitTemplate = async () => { ...@@ -515,6 +526,13 @@ const handleSubmitTemplate = async () => {
justify-content: flex-end; justify-content: flex-end;
} }
.detail-header {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
.report-content { .report-content {
max-height: 60vh; max-height: 60vh;
overflow-y: auto; overflow-y: auto;
...@@ -634,125 +652,135 @@ const handleSubmitTemplate = async () => { ...@@ -634,125 +652,135 @@ const handleSubmitTemplate = async () => {
} }
.markdown-body { .markdown-body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-family: 'Microsoft YaHei', 'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif !important;
font-size: 14px; font-size: 18px !important;
line-height: 1.6; line-height: 2.5 !important;
color: #24292e; color: #303133 !important;
padding: 30px !important;
background: #fff !important;
border-radius: 8px !important;
h1, h2, h3, h4, h5, h6 { h1, h2, h3, h4, h5, h6 {
margin-top: 24px; margin-top: 30px !important;
margin-bottom: 16px; margin-bottom: 15px !important;
font-weight: 600; font-weight: 700 !important;
line-height: 1.25; line-height: 2.5 !important;
color: #409eff !important;
} }
h1 { h1 {
font-size: 2em; font-size: 26px !important;
border-bottom: 1px solid #eaecef; padding-bottom: 12px !important;
padding-bottom: 0.3em; border-bottom: 3px solid #409eff !important;
} }
h2 { h2 {
font-size: 1.5em; font-size: 22px !important;
border-bottom: 1px solid #eaecef; color: #303133 !important;
padding-bottom: 0.3em; padding-bottom: 8px !important;
border-bottom: 2px solid #e4e7ed !important;
} }
h3 { h3 {
font-size: 1.25em; font-size: 18px !important;
} }
h4 { h4 {
font-size: 1em; font-size: 16px !important;
} }
p { p {
margin-bottom: 16px; margin-bottom: 24px !important;
line-height: 2.5 !important;
} }
a { ul, ol {
color: #0366d6; padding-left: 36px !important;
text-decoration: none; margin-bottom: 24px !important;
&:hover { li {
text-decoration: underline; margin-bottom: 12px !important;
line-height: 2.5 !important;
} }
} }
code { a {
padding: 0.2em 0.4em; color: #409eff !important;
margin: 0; text-decoration: none;
font-size: 85%;
background-color: rgba(27, 31, 35, 0.05);
border-radius: 3px;
font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
} }
code {
padding: 4px 10px !important;
margin: 0 6px !important;
font-size: 95% !important;
background-color: #f5f7fa !important;
border-radius: 4px !important;
font-family: 'Consolas', monospace !important;
color: #c7254e !important;
}
pre { pre {
padding: 16px; padding: 24px !important;
overflow: auto; overflow: auto !important;
font-size: 85%; font-size: 90% !important;
line-height: 1.45; line-height: 2.5 !important;
background-color: #f6f8fa; background-color: #282c34 !important;
border-radius: 3px; border-radius: 6px !important;
margin-bottom: 16px; margin: 24px 0 !important;
code { code {
padding: 0; padding: 0 !important;
background-color: transparent; background-color: transparent !important;
font-size: 100%; color: #abb2bf !important;
word-break: normal;
white-space: pre;
} }
} }
blockquote { blockquote {
padding: 0 1em; padding: 20px 24px !important;
color: #6a737d; margin: 24px 0 !important;
border-left: 0.25em solid #dfe2e5; border-left: 6px solid #409eff !important;
margin: 0 0 16px 0; background-color: #f0f7ff !important;
} color: #606266 !important;
ul, ol { p {
padding-left: 2em; margin-bottom: 0 !important;
margin-bottom: 16px; line-height: 2.5 !important;
} }
li {
margin-bottom: 4px;
} }
table { table {
border-collapse: collapse; width: 100% !important;
width: 100%; border-collapse: collapse !important;
margin-bottom: 16px; margin: 24px 0 !important;
th, td { th, td {
padding: 6px 13px; padding: 16px 20px !important;
border: 1px solid #dfe2e5; border: 1px solid #e4e7ed !important;
text-align: left !important;
line-height: 2.5 !important;
} }
th { th {
font-weight: 600; background-color: #f5f7fa !important;
background-color: #f6f8fa; font-weight: 700 !important;
color: #409eff !important;
} }
tr:nth-child(2n) { tr:nth-child(even) {
background-color: #f6f8fa; background-color: #fafafa !important;
} }
} }
img { hr {
max-width: 100%; height: 2px !important;
box-sizing: content-box; margin: 32px 0 !important;
background-color: #e4e7ed !important;
border: none !important;
} }
hr { strong, b {
height: 0.25em; font-weight: 700 !important;
padding: 0; color: #1a1a1a !important;
margin: 24px 0;
background-color: #e1e4e8;
border: 0;
} }
} }
</style> </style>
\ No newline at end of file
...@@ -7,7 +7,7 @@ export default defineConfig({ ...@@ -7,7 +7,7 @@ export default defineConfig({
port: 3000, port: 3000,
proxy: { proxy: {
'/api': { '/api': {
target: 'http://localhost:8080', target: process.env.VITE_API_BASE_URL || 'http://localhost:8080',
changeOrigin: true changeOrigin: true
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论