Files
aiData/static/index_old.html
HuangHai 9d1ce0c3c5 'commit'
2026-01-21 07:51:52 +08:00

353 lines
16 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>驿来特AI智能数据分析平台</title>
<link rel="stylesheet" href="css/element-plus.index.css">
<link rel="stylesheet" href="css/app.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.9/katex.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.9/katex.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.9/contrib/auto-render.min.js"></script>
</head>
<body>
<div id="app">
<!-- Ad Overlay -->
<transition name="fade">
<div class="ad-overlay" v-if="showAd">
<div class="ad-content">
<div class="ad-header">
<h2>⚡ 系统特性介绍</h2>
</div>
<div class="ad-body">
<div class="ad-item">
<div class="ad-icon-wrapper">
<span class="ad-icon">📱</span>
</div>
<p>本系统采用 <strong>手机爬虫</strong> 获取4家充电供应商准实时各时段电价</p>
</div>
<div class="ad-item">
<div class="ad-icon-wrapper">
<span class="ad-icon">🧠</span>
</div>
<p>结合 <strong>数据仓库与AI技术</strong>,对我司电价进行智能分析,给出定价建议</p>
</div>
<div class="ad-item">
<div class="ad-icon-wrapper">
<span class="ad-icon">📊</span>
</div>
<p>对我司的各场站营业情况进行 <strong>分析,查询</strong></p>
</div>
<div class="ad-item">
<div class="ad-icon-wrapper">
<span class="ad-icon">🎨</span>
</div>
<p>新增 <strong>智能海报生成</strong> 功能,未来将结合业务数据,一键生成精美的数据战报与营销海报</p>
</div>
<div class="ad-item">
<div class="ad-icon-wrapper">
<span class="ad-icon">🎥</span>
</div>
<p>新增 <strong>抖音知识库</strong>:支持视频解析、知识获取与总结、博主专栏订阅,自动生成 <strong>充电企业知识日报</strong>,助力企业构建专属知识库</p>
</div>
<div class="ad-item">
<div class="ad-icon-wrapper">
<span class="ad-icon">🎯</span>
</div>
<p>未来:可以根据用户充电信息,形成用户画像,结合企业微信,实现 <strong>用户广告的精准推送</strong></p>
</div>
<div class="ad-item">
<div class="ad-icon-wrapper">
<span class="ad-icon">🧭</span>
</div>
<p>未来:基于 <strong>LBS位置服务</strong>,智能对比周边竞对场站的价格与配套(快充、休息室等),精准引导用户选择我司优势站点</p>
</div>
</div>
<div class="ad-footer">
<button class="ad-close-btn" @click="closeAd">
关闭 ({{ adCountdown }}s)
</button>
</div>
</div>
</div>
</transition>
<header class="dashboard-header">
<div class="dashboard-title">⚡ 驿来特AI智能数据分析平台</div>
<div class="nav-tabs">
<button class="nav-tab" :class="{active: activeTab==='dashboard'}" @click="activeTab='dashboard'">分时电价分析</button>
<button class="nav-tab" :class="{active: activeTab==='degree'}" @click="activeTab='degree'">智能数据查询</button>
<button class="nav-tab" :class="{active: activeTab==='douyin'}" @click="activeTab='douyin'">抖音知识库</button>
<a href="HaiBao/index.html" class="nav-tab" style="text-decoration: none; display: inline-block;">智能海报生成</a>
</div>
<div class="controls" v-if="activeTab==='dashboard'">
<button class="btn-primary" @click="exportAllPrices" :disabled="exporting">
<span v-if="!exporting">📊 导出分时段电价表</span>
<span v-else>⏳ 导出中...</span>
</button>
<button class="btn-primary" @click="exportAiReport" :disabled="exportingReport || !aiText" :title="!aiText ? '请先生成AI分析报告' : ''">
<span v-if="!exportingReport">📑 导出分析报告</span>
<span v-else>⏳ 生成中...</span>
</button>
</div>
<div class="controls" v-else>
<!-- Placeholder for degree tab specific controls if any -->
</div>
</header>
<!-- Dashboard Tab -->
<div class="main-content" v-show="activeTab==='dashboard'">
<div class="left-panel">
<div class="station-list">
<div class="station-list-header">全网供应商24小时电价监控</div>
<div class="station-table-container">
<table class="station-table">
<thead>
<tr>
<th style="width:15%;">时段</th>
<th v-for="op in operators" :key="op.value" :style="{width: (85/operators.length) + '%'}">{{ op.label }}</th>
</tr>
</thead>
<tbody>
<tr v-for="(row, idx) in priceTableRows" :key="idx">
<td style="font-family: monospace; color: var(--text-secondary);">{{ row.hour }}</td>
<td v-for="cell in row.values" :key="cell.operator" :style="{color: getPriceColor(cell.price)}">
{{ formatCell(cell.price) }}
</td>
</tr>
<tr v-if="priceTableRows.length===0">
<td :colspan="operators.length + 1" style="text-align:center; padding: 32px; color: var(--text-secondary);">
数据加载中...
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="chart"></div>
</div>
<div class="right-panel">
<div class="ai-title">
智能决策分析助手
<button class="btn-primary" @click="startAiAnalysis" :disabled="aiLoading" style="margin-left: auto; font-size: 0.8rem; padding: 4px 12px; height: auto;">
<span v-if="!aiLoading">🚀 开始分析</span>
<span v-else>⏳ 分析中...</span>
</button>
</div>
<div class="ai-box" ref="aiBoxRef">
<div class="ai-question">
<div class="label">当前分析任务</div>
<div class="question-text">
请根据爬取的各供应商分时电价等信息,对各司的定价策略,
与我司(驿来特)的定价策略进行综合对比,分析我司可能存在的潜在问题。
</div>
</div>
<div class="ai-result" v-html="renderedAiText || placeholder" style="opacity: 0.9;"></div>
</div>
</div>
</div>
<!-- Douyin Tab -->
<div class="douyin-container" v-show="activeTab==='douyin'" style="padding: 24px; max-width: 95%; margin: 0 auto;">
<!-- Summary Dialog -->
<el-dialog v-model="showSummaryDialog" title="💡 知识精华总结" width="60%" :before-close="handleSummaryClose">
<div class="dialog-content" style="max-height: 60vh; overflow-y: auto; padding: 10px;">
<div v-if="summaryLoading && !summaryText" style="text-align: center; padding: 20px; color: #6b7280;">
<p>⚡ AI正在阅读您的知识库并提炼精华请稍候...</p>
</div>
<div class="markdown-body" v-html="renderedSummary" style="font-size: 15px; line-height: 1.8; color: #1f2937;"></div>
<span v-if="summaryLoading && summaryText" class="cursor-blink">|</span>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="handleSummaryClose">关闭</el-button>
<el-button type="primary" @click="fetchDouyinSummary" :loading="summaryLoading">
{{ summaryText ? '重新生成' : '开始总结' }}
</el-button>
</span>
</template>
</el-dialog>
<div class="douyin-header" style="text-align: center; margin-bottom: 40px;">
<h1 style="font-size: 2.5rem; font-weight: bold; color: #f1f5f9; margin-bottom: 0.5rem;">
抖音知识库
<button class="btn-primary" @click="fetchDouyinRecords" style="font-size: 1rem; padding: 4px 12px; margin-left: 12px; vertical-align: middle;">
🔄 刷新列表
</button>
<button class="btn-primary" @click="openSummaryDialog" style="font-size: 1rem; padding: 4px 12px; margin-left: 12px; vertical-align: middle; background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%); border: none;">
✨ 提取知识精华
</button>
</h1>
<p style="color: #94a3b8;">自动解析视频、提取文案,构建企业充电知识图谱</p>
</div>
<!-- Input Section -->
<el-card class="box-card" style="margin-bottom: 32px;">
<template #header>
<div class="card-header">
<span style="font-weight: bold; font-size: 1.2rem;">粘贴抖音分享链接</span>
</div>
</template>
<el-input
v-model="shareText"
:rows="15"
type="textarea"
placeholder="支持批量粘贴!
例如:
1.23 复制打开抖音,看看【...】 https://v.douyin.com/...
7.89 复制打开抖音,看看【...】 https://v.douyin.com/..."
style="margin-bottom: 20px; font-size: 16px;"
></el-input>
<div style="display: flex; justify-content: flex-end;">
<el-button type="primary" @click="startParsing" :loading="douyinLoading" :disabled="!shareText.trim()">
{{ douyinLoading ? '解析处理中...' : '开始解析' }}
</el-button>
</div>
</el-card>
<!-- Records List -->
<div class="records-list">
<el-card v-for="record in douyinRecords" :key="record.id" style="margin-bottom: 20px;" :body-style="{ padding: '0px' }">
<div style="display: flex; border-left: 4px solid;" :style="{borderColor: statusColor(record.status)}">
<div style="padding: 24px; flex: 1;">
<div style="display: flex; justify-content: space-between; align-items: start; margin-bottom: 16px;">
<div>
<div style="display: flex; align-items: center; margin-bottom: 8px;">
<el-tag :type="statusType(record.status)" effect="dark" size="small" style="margin-right: 8px;">
{{ record.status }}
</el-tag>
<span style="color: #9ca3af; font-size: 12px;">
{{ formatDate(record.create_time) }}
</span>
</div>
<h3 style="font-size: 1.25rem; font-weight: bold; color: #1f2937; line-height: 1.4;">
{{ record.video_name || '处理中...' }}
</h3>
<a v-if="record.obs_url" :href="record.obs_url" target="_blank" style="color: #3b82f6; font-size: 14px; margin-top: 4px; display: inline-block; text-decoration: none;">
📺 点击观看视频
</a>
</div>
<el-button type="danger" circle @click="deleteRecord(record.id)" plain>
<span style="font-size: 12px;">Del</span>
</el-button>
</div>
<!-- Error Message -->
<div v-if="record.status === 'FAILED' && record.error_msg" style="margin-top: 12px; color: #ef4444; font-size: 13px; background: #fee2e2; padding: 8px; border-radius: 4px; word-break: break-all;">
<strong>Error:</strong> {{ record.error_msg }}
</div>
<!-- Transcript -->
<div v-if="record.transcript" style="background-color: #f9fafb; border-radius: 8px; padding: 16px; margin-top: 16px;">
<h4 style="font-size: 14px; font-weight: 600; color: #4b5563; margin-bottom: 8px; text-transform: uppercase;">视频文案</h4>
<p style="color: #374151; white-space: pre-wrap; font-size: 14px; line-height: 1.6;" :style="record.expanded ? {} : {display: '-webkit-box', '-webkit-line-clamp': '3', '-webkit-box-orient': 'vertical', overflow: 'hidden'}">
{{ record.transcript }}
</p>
<el-button type="primary" link @click="record.expanded = !record.expanded" style="margin-top: 8px; font-size: 12px;">
{{ record.expanded ? '收起' : '展开全文' }}
</el-button>
</div>
<!-- Original Text -->
<div style="margin-top: 16px;">
<div style="cursor: pointer; color: #9ca3af; font-size: 12px;" @click="record.showOriginal = !record.showOriginal">
{{ record.showOriginal ? '收起原始链接' : '查看原始链接信息' }}
</div>
<div v-if="record.showOriginal" style="color: #6b7280; font-size: 12px; background: #f3f4f6; padding: 8px; border-radius: 4px; margin-top: 4px;">
{{ record.original_text }}
</div>
</div>
</div>
</div>
</el-card>
<div v-if="douyinRecords.length === 0" style="text-align: center; color: #9ca3af; padding: 40px;">
<p>暂无记录,请粘贴链接开始解析</p>
</div>
</div>
</div>
<!-- Degree Query Tab -->
<div class="degree-container" v-show="activeTab==='degree'">
<!-- 悬浮二维码 -->
<div class="qr-sidebar">
<div id="qrcode" class="qr-code"></div>
<p class="qr-text">手机扫码访问</p>
</div>
<div class="query-section">
<h1 class="page-title">驿来特AI智能数据查询</h1>
<p class="page-subtitle">基于大语言模型,为您提供实时、精准的业务数据分析</p>
<div class="input-wrapper">
<el-input
v-model="userQuery"
placeholder="请输入您的问题例如帮我查询12月份充电量TOP 10场站的充电情况"
class="search-input"
size="large"
@keyup.enter="handleDegreeSearch"
:disabled="queryLoading"
>
<template #append>
<el-button @click="handleDegreeSearch" :loading="queryLoading" type="primary">
{{ queryLoading ? '分析中...' : '开始查询' }}
</el-button>
</template>
</el-input>
</div>
<div class="example-tags">
<el-tag
v-for="(text, index) in examples"
:key="index"
class="example-tag"
effect="plain"
round
size="large"
@click="setExample(text)"
>
{{ text }}
</el-tag>
</div>
</div>
<div class="result-section" v-if="queryResult || queryLoading">
<div class="result-header">
<div class="result-title">
<span>分析结果</span>
<el-tag size="small" type="success" effect="dark" v-if="!queryLoading">完成</el-tag>
<el-tag size="small" type="warning" effect="dark" v-if="queryLoading">生成中</el-tag>
</div>
<el-button
v-if="queryLoading"
type="danger"
link
@click="stopDegreeGeneration"
>
停止生成
</el-button>
</div>
<div class="markdown-body" v-html="renderedResult"></div>
<div v-if="queryLoading && !queryResult" class="loading-container">
<p>正在分析数据,请稍候...</p>
</div>
<span v-if="queryLoading" class="cursor-blink">|</span>
</div>
</div>
</div>
<script src="js/vue.global.js"></script>
<script src="js/element-plus.index.full.js"></script>
<script src="js/element-plus.zh-cn.min.js"></script>
<script src="js/qrcode.min.js"></script>
<script src="js/axios.min.js"></script>
<script src="js/echarts.min.js"></script>
<script src="js/app.js"></script>
</body>
</html>