- 新增导出CSV文件功能,包含文本、判定结果、置信度、风险关键词 - 新增复制CSV内容到剪贴板功能 - CSV字段:文本、判定结果、置信度、垃圾概率、正常概率、风险关键词 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
85 lines
3.6 KiB
Plaintext
85 lines
3.6 KiB
Plaintext
<view class="container">
|
|
<view class="hero fade-up">
|
|
<view class="hero-badge">BATCH SCAN</view>
|
|
<view class="hero-title">批量文本筛查</view>
|
|
<view class="hero-sub">每行一条文本,适用于活动文案、客服话术、私信模板的集中检测。</view>
|
|
</view>
|
|
|
|
<view class="card fade-up fade-up-delay-1">
|
|
<view class="card-title">批量输入</view>
|
|
<view class="card-desc">请按“每行一条”粘贴文本内容,系统会自动跳过空行。</view>
|
|
<textarea class="textarea" placeholder="示例: 点击链接领取红包 今天下午三点开会" value="{{inputText}}" bindinput="onInput" />
|
|
|
|
<view class="btn-row">
|
|
<button class="btn btn-ghost" bindtap="fillDemo">填充示例</button>
|
|
<button class="btn btn-primary" loading="{{loading}}" bindtap="submit">开始识别</button>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="card fade-up fade-up-delay-2" wx:if="{{summary}}">
|
|
<view class="card-title">识别汇总</view>
|
|
<view class="grid-3">
|
|
<view class="kpi">
|
|
<view class="kpi-value">{{summary.total}}</view>
|
|
<view class="kpi-label">总条数</view>
|
|
</view>
|
|
<view class="kpi">
|
|
<view class="kpi-value">{{summary.spam_count}}</view>
|
|
<view class="kpi-label">垃圾信息</view>
|
|
</view>
|
|
<view class="kpi">
|
|
<view class="kpi-value">{{summary.ham_count}}</view>
|
|
<view class="kpi-label">正常信息</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="field">
|
|
<view class="row">
|
|
<text class="label">垃圾占比</text>
|
|
<text class="value">{{summary.spam_ratio_text}}</text>
|
|
</view>
|
|
<view class="progress-track">
|
|
<view class="progress-fill" style="width: {{summary.spam_ratio_text}};"></view>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="field">
|
|
<view class="row">
|
|
<text class="label">拦截占比</text>
|
|
<text class="value">{{summary.blocked_ratio_text}}</text>
|
|
</view>
|
|
<view class="progress-track">
|
|
<view class="progress-fill-safe" style="width: {{summary.blocked_ratio_text}};"></view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="card fade-up fade-up-delay-3" wx:if="{{items.length}}">
|
|
<view class="card-title">明细结果</view>
|
|
<view class="btn-row" style="margin-bottom: 12rpx;">
|
|
<button class="btn btn-ghost" bindtap="exportCSV">导出CSV文件</button>
|
|
<button class="btn btn-ghost" bindtap="copyCSVToClipboard">复制CSV内容</button>
|
|
</view>
|
|
<view class="list-item" wx:for="{{items}}" wx:key="index">
|
|
<view class="item-title">{{item.text}}</view>
|
|
<view class="row">
|
|
<text class="label">判定结果</text>
|
|
<text class="{{item.prediction === 'spam' ? 'status-spam' : 'status-ham'}}">{{item.prediction_text}}</text>
|
|
</view>
|
|
<view class="row">
|
|
<text class="label">置信度</text>
|
|
<text class="value">{{item.confidence_text}}</text>
|
|
</view>
|
|
<view class="progress-track">
|
|
<view class="{{item.prediction === 'spam' ? 'progress-fill' : 'progress-fill-safe'}}" style="width: {{item.confidence_text}};"></view>
|
|
</view>
|
|
<view class="field" wx:if="{{item.reason_tokens && item.reason_tokens.length}}">
|
|
<text class="field-label">风险关键词</text>
|
|
<view class="chip-group">
|
|
<text class="tag tag-danger" wx:for="{{item.reason_tokens}}" wx:for-item="tokenItem" wx:key="token" data-token="{{tokenItem.token}}" data-weight="{{tokenItem.weight}}" bindtap="showTokenWeight">{{tokenItem.token}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|