diff --git a/api/dashboard/stats.php b/api/dashboard/stats.php index 2947dba..0d20d02 100644 --- a/api/dashboard/stats.php +++ b/api/dashboard/stats.php @@ -18,7 +18,12 @@ $sqlMetrics = [ 'person_total' => "SELECT COUNT(*) AS c FROM persons WHERE is_active = 1", 'company_new' => "SELECT COUNT(*) AS c FROM companies WHERE is_active = 1 AND DATE(created_at) = CURDATE() - INTERVAL 1 DAY", 'person_new' => "SELECT COUNT(*) AS c FROM persons WHERE is_active = 1 AND DATE(created_at) = CURDATE() - INTERVAL 1 DAY", - 'preliminary' => "SELECT COUNT(*) AS c FROM preliminary_data WHERE status = '待处理' AND is_active = 1", + 'preliminary' => "SELECT + (SELECT COUNT(*) FROM preliminary_data WHERE is_active = 1 AND status NOT IN ('已转换','已废弃')) + + (SELECT COUNT(*) FROM companies WHERE is_incomplete = 1) + + (SELECT COUNT(*) FROM persons WHERE is_incomplete = 1) + + (SELECT COUNT(*) FROM social_accounts WHERE is_incomplete = 1) + + (SELECT COUNT(*) FROM media_commercial_attributes WHERE is_incomplete = 1) AS c", 'industry_count' => "SELECT COUNT(DISTINCT industry) AS c FROM companies WHERE industry IS NOT NULL AND industry <> ''", 'manufacturer' => "SELECT COUNT(*) AS c FROM companies WHERE business_role = 'manufacturer' AND is_active = 1", 'integrator' => "SELECT COUNT(*) AS c FROM companies WHERE business_role IN ('integrator','distributor') AND is_active = 1", diff --git a/api/fragment/hard_add.php b/api/fragment/hard_add.php new file mode 100644 index 0000000..9af47c2 --- /dev/null +++ b/api/fragment/hard_add.php @@ -0,0 +1,65 @@ +getPdo(); +$pdo->prepare( + "INSERT INTO preliminary_data + (source_type, company_name, person_name, contact_phone, contact_email, + target_product_category, description, source_channel, recorded_by, status) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, '待处理')" +)->execute([ + $sourceType, + $companyName !== '' ? $companyName : null, + $personName !== '' ? $personName : null, + $phone !== '' ? $phone : null, + $email !== '' ? $email : null, + $category !== '' ? $category : null, + $description !== '' ? $description : null, + $sourceChannel, + $_SESSION['username'] ?? null, +]); +$newId = (int)$pdo->lastInsertId(); + +logCurrent('add', 'fragment', 'preliminary_data', $newId, [ + 'source_type' => $sourceType, + 'company_name' => $companyName, + 'person_name' => $personName, + 'phone' => $phone, + 'email' => $email, +]); + +Response::success(['id' => $newId], '新增成功'); diff --git a/static/css/style.css b/static/css/style.css index bc08d00..abd5967 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -476,10 +476,6 @@ table.grid .ops a:hover { text-decoration: underline; } gap: 14px; margin-bottom: 16px; } -/* 碎片处理中心专用:5 张指标卡一行排布(不影响其它页面) */ -.stat-cards.stat-cards-5 { - grid-template-columns: repeat(5, 1fr); -} .stat-card { background: #fff; border-radius: 6px; diff --git a/static/js/config.js b/static/js/config.js index 147f0ad..84f8895 100644 --- a/static/js/config.js +++ b/static/js/config.js @@ -5,7 +5,7 @@ var BASE_URL = '/api/'; var PAGE_SIZE = 20; /** 系统版本号(logo旁展示):修改代码后运行 tools/bump_version.php 自动递增 */ -var APP_VERSION = 'v1.0.36'; +var APP_VERSION = 'v1.0.37'; /** 页脚版权/备案信息(在 config.js 中修改) */ var FOOTER_TEXT = '© 2026 SuperLink 管理系统 版权所有 | 备案号:请替换为真实备案号'; diff --git a/static/js/fragment.js b/static/js/fragment.js index 4ef28ef..4beb1bc 100644 --- a/static/js/fragment.js +++ b/static/js/fragment.js @@ -38,7 +38,7 @@ $(function () { /** 渲染页面内容:指标卡 + 硬碎片 + 软碎片 两个独立区块 */ function renderPage() { $('#page-content').html( - '
' + + '' + // ================= 硬碎片 ================= '| 完整度 | 类型 | 内容摘要 | 来源 | 录入人 | 录入时间 | 状态 | 操作 |
|---|