From 11293769817943e564ccacc0e32cd84bd5d0797a Mon Sep 17 00:00:00 2001
From: coldenMac <1119472557@qq.com>
Date: Mon, 19 Jan 2026 21:14:58 +0800
Subject: [PATCH] strong all
---
001/001_r.html | 68 +-
002/002_r.html | 1154 ++++++++++++++++++++++------------
003/003_r.html | 390 +++++++++++-
004/004_r.html | 58 +-
005/005_r.html | 71 ++-
006/006_r.html | 721 +++++++++++++++++++--
007/007_r.html | 1405 ++++++++++++++++++++++++++++++++---------
008/008_r.html | 1640 ++++++++++++++++++++++++++++++++++--------------
009/009_r.html | 1512 +++++++++++++++++++++++++-------------------
010/010_r.html | 898 ++++++++++++++++++++------
10 files changed, 5827 insertions(+), 2090 deletions(-)
diff --git a/001/001_r.html b/001/001_r.html
index 2b044ca..4b06d14 100644
--- a/001/001_r.html
+++ b/001/001_r.html
@@ -258,7 +258,7 @@
@@ -708,12 +708,70 @@
+
+
+
+
+
+
+
+ },
+ // 初始化
+ init() {
+ // 1. 保留核心“故事”数据 (V9.2)
+ const storyOrders = [
+ { id: '20251221-A001', user: 'user_9921', userScore: 780, items: [{name: 'RTX 5090 显卡', qty: 2, price: 17499}], total: 34999.00, address: '北京市海淀区中关村软件园...', date: '2025-12-21 14:30', risk: 'low', score: 12, status: 'pending', tags: ['urgent'], logs: '支付指纹匹配,IP归属地一致。' },
+ { id: '20251221-A002', user: 'temp_user_001', userScore: null, items: [{name: '游戏点卡充值 (虚拟)', qty: 50, price: 100}], total: 5000.00, address: '虚拟发货 (自动)', date: '2025-12-21 14:31', risk: 'high', score: 92, status: 'pending', tags: ['risk'], logs: '警告:该IP今日已尝试下单5次失败,建议拦截。' },
+ { id: '20251221-A003', user: 'loyal_cust_88', userScore: 900, items: [{name: '爱他美婴儿奶粉 3段', qty: 6, price: 200}], total: 1200.00, address: '上海市浦东新区陆家嘴...', date: '2025-12-21 14:32', risk: 'low', score: 5, status: 'pending', tags: [], logs: '历史购买记录匹配,常规复购。' },
+ { id: '20251221-A004', user: 'company_buyer_22', userScore: 850, items: [{name: '人体工学办公椅', qty: 50, price: 300}], total: 15000.00, address: '深圳市南山区科技园...', date: '2025-12-21 14:35', risk: 'medium', score: 45, status: 'pending', tags: ['large'], logs: '首次大额采购,需电话核实企业资质。' },
+ { id: '20251221-A007', user: 'unknown_proxy', userScore: 120, items: [{name: '亚马逊礼品卡 $100', qty: 10, price: 7100}], total: 7100.00, address: 'Email Delivery', date: '2025-12-21 14:40', risk: 'high', score: 98, status: 'pending', tags: ['risk'], logs: '检测到高危代理IP,建议立即封锁。' }
+ ];
+
+ // 2. 混合数据生成:自动生成200条仿真数据
+ const randomData = this.generateBulkData(200);
+
+ this.data.orders = [...storyOrders, ...randomData];
+
+ // 渲染初始界面
+ this.renderTable();
+ this.updateDashboard();
+
+ console.log(`System Initialized: Loaded ${this.data.orders.length} orders.`);
+ this.showToast(`系统就绪,已加载 ${this.data.orders.length} 条数据`, 'success');
+ },
+
+ // --- 数据生成引擎 (适配 V9.2 结构) ---
+ generateBulkData(count) {
+ const products = [
+ {n: 'iPhone 16 Pro Max', p: 9999}, {n: 'AirPods Pro 3', p: 1899}, {n: 'Dyson 吹风机', p: 2999},
+ {n: 'Sony WH-1000XM5', p: 2499}, {n: 'Nike Dunk Low', p: 899}, {n: 'Logitech MX Master 3S', p: 799},
+ {n: 'Starbucks 星礼卡', p: 200}, {n: 'Switch OLED 日版', p: 2100}, {n: 'La Mer 面霜', p: 3500}
+ ];
+ const users = ['alex', 'bill', 'candy', 'david', 'echo', 'frank', 'grace', 'helen', 'ivy', 'jack'];
+ const cities = ['北京', '上海', '广州', '深圳', '杭州', '成都', '武汉', '南京'];
+ const res = [];
+
+ for(let i=0; i 60) risk = 'medium';
+ if(score > 85) risk = 'high';
+
+ // 随机状态 (80% pending)
+ const status = Math.random() > 0.8 ? (Math.random()>0.5 ? 'approved' : 'rejected') : 'pending';
+
+ // 随机标签
+ const tags = [];
+ if(risk === 'high') tags.push('risk');
+ if(prod.p * qty > 10000) tags.push('large');
+ if(Math.random() > 0.9) tags.push('vip');
+
+ res.push({
+ id: `20251222-R${(1000+i).toString()}`,
+ user: `${users[Math.floor(Math.random()*users.length)]}_${Math.floor(Math.random()*999)}`,
+ userScore: Math.floor(Math.random() * 500) + 300,
+ items: [{ name: prod.n, qty: qty, price: prod.p }],
+ total: prod.p * qty,
+ address: `${cities[Math.floor(Math.random()*cities.length)]}市...`,
+ date: `2025-12-22 14:${Math.floor(Math.random()*60).toString().padStart(2,'0')}`,
+ risk: risk,
+ score: score,
+ status: status,
+ tags: tags,
+ logs: '系统自动生成的仿真日志记录。'
+ });
+ }
+ return res;
+ },
+
+ // --- 导航与视图 ---
+ nav(viewId) {
+ document.querySelectorAll('.view-panel').forEach(el => el.classList.remove('active'));
+ document.getElementById(`view-${viewId}`).classList.add('active');
+
+ document.querySelectorAll('.menu-item').forEach(el => el.classList.remove('active'));
+ const menuId = `menu-${viewId}`;
+ const menuEl = document.getElementById(menuId);
+ if(menuEl) menuEl.classList.add('active');
+
+ document.querySelectorAll('.nav-top a').forEach(el => el.classList.remove('active'));
+ if(viewId === 'orders') document.querySelector('.nav-top a:nth-child(2)').classList.add('active');
+ if(viewId === 'dashboard') document.querySelector('.nav-top a:nth-child(1)').classList.add('active');
+ if(viewId === 'settings') document.querySelector('.nav-top a:nth-child(3)').classList.add('active');
+ },
+
+ toggleTheme() {
+ const isDark = document.getElementById('theme-toggle').checked;
+ document.documentElement.setAttribute('data-theme', isDark ? 'dark' : 'light');
+ },
+
+ // --- 核心业务逻辑:筛选与渲染 ---
+ applyFilter() {
+ const btn = event.target.closest('button');
+ if(btn) {
+ const originalHtml = btn.innerHTML;
+ btn.innerHTML = ' 查询中';
+ btn.disabled = true;
+ setTimeout(() => {
+ this._executeFilter();
+ this.showToast('筛选已更新');
+ btn.innerHTML = originalHtml;
+ btn.disabled = false;
+ }, 300);
+ } else {
+ this._executeFilter();
+ }
+ },
+
+ _executeFilter() {
+ this.data.filter.keyword = document.getElementById('search-keyword').value.toLowerCase();
+ this.data.filter.risk = document.getElementById('search-risk').value;
+ this.data.filter.status = document.getElementById('search-status').value;
+ this.renderTable();
+ },
+
+ resetFilter() {
+ document.getElementById('search-keyword').value = '';
+ document.getElementById('search-risk').value = 'all';
+ document.getElementById('search-status').value = 'pending';
+ this.applyFilter();
+ },
+
+ renderTable() {
+ const tbody = document.getElementById('table-body');
+ tbody.innerHTML = '';
+
+ const filtered = this.data.orders.filter(order => {
+ const matchKw = !this.data.filter.keyword ||
+ order.id.toLowerCase().includes(this.data.filter.keyword) ||
+ order.user.toLowerCase().includes(this.data.filter.keyword) ||
+ order.items.some(i => i.name.toLowerCase().includes(this.data.filter.keyword));
+
+ const matchRisk = this.data.filter.risk === 'all' || order.risk === this.data.filter.risk;
+ const matchStatus = this.data.filter.status === 'all_history' ? true : order.status === this.data.filter.status;
+ return matchKw && matchRisk && matchStatus;
+ });
+
+ // 限制渲染数量以保证性能(如果超过500条)
+ const displayList = filtered.slice(0, 500);
+
+ // 更新计数
+ const pendingCount = this.data.orders.filter(o => o.status === 'pending').length;
+ document.getElementById('sidebar-count').innerText = pendingCount;
+ document.getElementById('empty-state').style.display = displayList.length ? 'none' : 'block';
+ document.getElementById('current-count').innerText = displayList.length;
+ document.getElementById('total-db-count').innerText = this.data.orders.length;
+
+ // 生成 HTML
+ let htmlBuffer = '';
+ displayList.forEach(order => {
+ let riskColor = '#10b981';
+ if(order.risk === 'medium') riskColor = '#f59e0b';
+ if(order.risk === 'high') riskColor = '#ef4444';
+
+ let statusBadge = `Pending`;
+ if(order.status === 'approved') statusBadge = `Approved`;
+ if(order.status === 'rejected') statusBadge = `Rejected`;
+
+ const itemSummary = `${order.items[0].name} ${order.items.length > 1 ? `等 ${order.items.length} 件` : ''}`;
+
+ const tagsHtml = order.tags.map(t => {
+ if(t === 'urgent') return `加急`;
+ if(t === 'large') return `大宗`;
+ if(t === 'risk') return `风险`;
+ if(t === 'vip') return `VIP`;
+ return '';
+ }).join('');
+
+ htmlBuffer += `
+
+ |
+
+ ${order.id}
+ ${order.date}
+ ${tagsHtml}
+ |
+
+ ${order.user}
+ 信誉分: ${order.userScore || 'N/A'}
+ |
+ ${itemSummary} |
+ ¥ ${order.total.toLocaleString()} |
+
+ ${order.score} / 100
+
+ |
+ ${statusBadge} |
+
+
+ |
+
+ `;
+ });
+ tbody.innerHTML = htmlBuffer;
+
+ document.getElementById('check-all').checked = false;
+ },
+
+ updateDashboard() {
+ const pending = this.data.orders.filter(o => o.status === 'pending');
+ const highRisk = this.data.orders.filter(o => o.risk === 'high' && o.status === 'pending');
+ const totalAmt = pending.reduce((sum, o) => sum + o.total, 0);
+
+ document.getElementById('dash-pending').innerText = pending.length;
+ document.getElementById('dash-risk').innerText = highRisk.length;
+ document.getElementById('dash-risk-rate').innerText = ((highRisk.length / (pending.length || 1)) * 100).toFixed(1) + '%';
+ document.getElementById('dash-amount').innerText = totalAmt.toLocaleString();
+ },
+
+ // --- 详情抽屉逻辑 ---
+ openDrawer(id) {
+ this.data.currentId = id;
+ const order = this.data.orders.find(o => o.id === id);
+ if(!order) return;
+
+ document.getElementById('d-id').innerText = `#${order.id}`;
+ const content = document.getElementById('d-content');
+
+ let itemsHtml = order.items.map(item => `
+
+ ${item.name} x ${item.qty}
+ ¥ ${(item.price * item.qty).toLocaleString()}
+
+ `).join('');
+
+ content.innerHTML = `
+
+
风控决策引擎
+
+
+ 综合风险分: ${order.score} (${order.risk.toUpperCase()})
+
+
${order.logs}
+
+
+
+
收货信息
+
+ 收货人: ${order.user}
+ 收货地址: ${order.address}
+
+
+
+
商品清单
+ ${itemsHtml}
+
+ 总计: ¥ ${order.total.toLocaleString()}
+
+
+ `;
+
+ const footer = document.getElementById('d-footer');
+ footer.style.display = order.status !== 'pending' ? 'none' : 'flex';
+
+ document.getElementById('drawer-backdrop').classList.add('open');
+ document.getElementById('drawer-panel').classList.add('open');
+ },
+
+ closeDrawer() {
+ document.getElementById('drawer-backdrop').classList.remove('open');
+ document.getElementById('drawer-panel').classList.remove('open');
+ this.data.currentId = null;
+ },
+
+ // --- 操作逻辑 ---
+ approveCurrent() {
+ const id = this.data.currentId;
+ const order = this.data.orders.find(o => o.id === id);
+ if(order && order.status === 'pending') {
+ order.status = 'approved';
+ this.showToast(`订单 ${id} 已审核通过`, 'success');
+ this.refreshAll();
+ this.closeDrawer();
+ }
+ },
+
+ rejectCurrent() {
+ document.getElementById('modal-reject').style.display = 'flex';
+ setTimeout(() => document.getElementById('modal-reject').querySelector('.modal').classList.add('open'), 10);
+ },
+
+ confirmReject() {
+ const id = this.data.currentId;
+ const reason = document.getElementById('reject-reason').value;
+
+ if (id === 'batch') {
+ let count = 0;
+ this.data.selectedIds.forEach(sid => {
+ const o = this.data.orders.find(x => x.id === sid);
+ if(o && o.status === 'pending') {
+ o.status = 'rejected';
+ count++;
+ }
+ });
+ this.data.selectedIds.clear();
+ this.showToast(`已批量驳回 ${count} 个订单`, 'success');
+ } else {
+ const order = this.data.orders.find(o => o.id === id);
+ if(order) {
+ order.status = 'rejected';
+ order.logs += ` [人工驳回: ${reason}]`;
+ }
+ this.showToast(`订单 ${id} 已驳回`, 'success');
+ }
+
+ this.closeModal('modal-reject');
+ this.refreshAll();
+ this.closeDrawer();
+ },
+
+ toggleSelectAll() {
+ const checkAll = document.getElementById('check-all').checked;
+ const checkboxes = document.querySelectorAll('.row-check:not(:disabled)');
+ checkboxes.forEach(cb => {
+ cb.checked = checkAll;
+ this.toggleSelect(cb.value);
+ });
+ },
+
+ toggleSelect(id) {
+ if(this.data.selectedIds.has(id)) this.data.selectedIds.delete(id);
+ else this.data.selectedIds.add(id);
+ },
+
+ batchAction(type) {
+ if(this.data.selectedIds.size === 0) return this.showToast('请先选择订单', 'error');
+
+ if(type === 'approve') {
+ let count = 0;
+ this.data.selectedIds.forEach(id => {
+ const o = this.data.orders.find(x => x.id === id);
+ if(o && o.status === 'pending') {
+ o.status = 'approved';
+ count++;
+ }
+ });
+ this.showToast(`成功批量通过 ${count} 单`, 'success');
+ this.data.selectedIds.clear();
+ this.refreshAll();
+ } else if (type === 'reject') {
+ this.data.currentId = 'batch';
+ this.rejectCurrent();
+ }
+ },
+
+ refreshAll() {
+ this.renderTable();
+ this.updateDashboard();
+ },
+
+ showLogout() {
+ document.getElementById('modal-logout').style.display = 'flex';
+ setTimeout(() => document.getElementById('modal-logout').querySelector('.modal').classList.add('open'), 10);
+ },
+
+ closeModal(id) {
+ document.getElementById(id).querySelector('.modal').classList.remove('open');
+ setTimeout(() => document.getElementById(id).style.display = 'none', 200);
+ },
+
+ showToast(msg, type='info') {
+ const container = document.getElementById('toast-root');
+ const el = document.createElement('div');
+ el.className = `toast ${type}`;
+ el.innerHTML = `${msg}`;
+ container.appendChild(el);
+ setTimeout(() => el.classList.add('show'), 10);
+ setTimeout(() => {
+ el.classList.remove('show');
+ setTimeout(() => el.remove(), 300);
+ }, 3000);
+ }
+};
+
+window.addEventListener('DOMContentLoaded', () => app.init());
+