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

更新程序

上级 0c4531a3
......@@ -56,6 +56,7 @@ public class PenaltyCrawler {
case "cbirc" -> crawlCBIRC(source);
case "csrc" -> crawlCSRC(source);
case "safe" -> crawlSAFE(source);
case "nfraf" -> crawlNFRAF(source);
default -> crawlDefault(source);
};
......@@ -482,4 +483,84 @@ public class PenaltyCrawler {
.isNew(entity.getIsNew())
.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 @@
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>金融监管处罚监控系统</title>
<script type="module" crossorigin src="/assets/index-BmCe9MoE.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-CIYNnUWJ.css">
<script type="module" crossorigin src="/assets/index-DLhtj81y.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-D_lRsYFa.css">
</head>
<body>
<div id="app"></div>
......
......@@ -2,8 +2,10 @@ import axios from 'axios'
import { ElMessage } from 'element-plus'
import router from '../router'
const isDev = import.meta.env.DEV
const request = axios.create({
baseURL: '/api',
baseURL: isDev ? '/api' : (import.meta.env.VITE_API_BASE_URL || '/api'),
timeout: 300000
})
......
......@@ -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 @@
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="操作" width="200" fixed="right">
<el-table-column label="操作" width="250" fixed="right">
<template #default="{ row }">
<el-button type="primary" link @click="viewDetail(row)">详情</el-button>
<el-button type="primary" link @click="viewReport(row)">报告</el-button>
<el-button
type="success"
type="warning"
link
@click="analyzeContent(row)"
:loading="row.analysisStatus === 'analyzing'"
:disabled="row.analysisStatus === 'analyzing'"
>
内容分析
分析
</el-button>
<el-button type="primary" link @click="markRead(row)" v-if="row.isNew">已读</el-button>
</template>
......@@ -129,7 +130,15 @@
</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-item label="处罚编号" :span="2">{{ currentRecord.penaltyNumber }}</el-descriptions-item>
<el-descriptions-item label="被处罚机构" :span="2">{{ currentRecord.institutionName }}</el-descriptions-item>
......@@ -158,8 +167,8 @@
</template>
</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-if="currentReport"
......@@ -244,7 +253,7 @@
<script setup>
import { ref, reactive, onMounted, computed } from 'vue'
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 api from '../api'
......@@ -259,7 +268,9 @@ marked.setOptions({
const loading = ref(false)
const tableData = ref([])
const detailVisible = ref(false)
const detailFullscreen = ref(false)
const reportVisible = ref(false)
const reportFullscreen = ref(false)
const reportLoading = ref(false)
const currentRecord = ref(null)
const currentReport = ref(null)
......@@ -515,6 +526,13 @@ const handleSubmitTemplate = async () => {
justify-content: flex-end;
}
.detail-header {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
.report-content {
max-height: 60vh;
overflow-y: auto;
......@@ -634,125 +652,135 @@ const handleSubmitTemplate = async () => {
}
.markdown-body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.6;
color: #24292e;
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;
border-radius: 8px !important;
h1, h2, h3, h4, h5, h6 {
margin-top: 24px;
margin-bottom: 16px;
font-weight: 600;
line-height: 1.25;
margin-top: 30px !important;
margin-bottom: 15px !important;
font-weight: 700 !important;
line-height: 2.5 !important;
color: #409eff !important;
}
h1 {
font-size: 2em;
border-bottom: 1px solid #eaecef;
padding-bottom: 0.3em;
font-size: 26px !important;
padding-bottom: 12px !important;
border-bottom: 3px solid #409eff !important;
}
h2 {
font-size: 1.5em;
border-bottom: 1px solid #eaecef;
padding-bottom: 0.3em;
font-size: 22px !important;
color: #303133 !important;
padding-bottom: 8px !important;
border-bottom: 2px solid #e4e7ed !important;
}
h3 {
font-size: 1.25em;
font-size: 18px !important;
}
h4 {
font-size: 1em;
font-size: 16px !important;
}
p {
margin-bottom: 16px;
margin-bottom: 24px !important;
line-height: 2.5 !important;
}
a {
color: #0366d6;
text-decoration: none;
ul, ol {
padding-left: 36px !important;
margin-bottom: 24px !important;
&:hover {
text-decoration: underline;
li {
margin-bottom: 12px !important;
line-height: 2.5 !important;
}
}
a {
color: #409eff !important;
text-decoration: none;
}
code {
padding: 0.2em 0.4em;
margin: 0;
font-size: 85%;
background-color: rgba(27, 31, 35, 0.05);
border-radius: 3px;
font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
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: 16px;
overflow: auto;
font-size: 85%;
line-height: 1.45;
background-color: #f6f8fa;
border-radius: 3px;
margin-bottom: 16px;
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;
background-color: transparent;
font-size: 100%;
word-break: normal;
white-space: pre;
padding: 0 !important;
background-color: transparent !important;
color: #abb2bf !important;
}
}
blockquote {
padding: 0 1em;
color: #6a737d;
border-left: 0.25em solid #dfe2e5;
margin: 0 0 16px 0;
}
padding: 20px 24px !important;
margin: 24px 0 !important;
border-left: 6px solid #409eff !important;
background-color: #f0f7ff !important;
color: #606266 !important;
ul, ol {
padding-left: 2em;
margin-bottom: 16px;
p {
margin-bottom: 0 !important;
line-height: 2.5 !important;
}
li {
margin-bottom: 4px;
}
table {
border-collapse: collapse;
width: 100%;
margin-bottom: 16px;
width: 100% !important;
border-collapse: collapse !important;
margin: 24px 0 !important;
th, td {
padding: 6px 13px;
border: 1px solid #dfe2e5;
padding: 16px 20px !important;
border: 1px solid #e4e7ed !important;
text-align: left !important;
line-height: 2.5 !important;
}
th {
font-weight: 600;
background-color: #f6f8fa;
background-color: #f5f7fa !important;
font-weight: 700 !important;
color: #409eff !important;
}
tr:nth-child(2n) {
background-color: #f6f8fa;
tr:nth-child(even) {
background-color: #fafafa !important;
}
}
img {
max-width: 100%;
box-sizing: content-box;
hr {
height: 2px !important;
margin: 32px 0 !important;
background-color: #e4e7ed !important;
border: none !important;
}
hr {
height: 0.25em;
padding: 0;
margin: 24px 0;
background-color: #e1e4e8;
border: 0;
strong, b {
font-weight: 700 !important;
color: #1a1a1a !important;
}
}
</style>
\ No newline at end of file
......@@ -7,7 +7,7 @@ export default defineConfig({
port: 3000,
proxy: {
'/api': {
target: 'http://localhost:8080',
target: process.env.VITE_API_BASE_URL || 'http://localhost:8080',
changeOrigin: true
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论