From 4ff4349ef59ae4cfe208e91a1e6f9a56b3de9df9 Mon Sep 17 00:00:00 2001 From: nanguaboss <602995148@qq.com> Date: Sun, 9 Aug 2026 22:49:47 +0800 Subject: [PATCH] =?UTF-8?q?v1.0.37:=20=E7=A2=8E=E7=89=87=E5=A4=84=E7=90=86?= =?UTF-8?q?=E7=9C=8B=E6=9D=BF=E8=B0=83=E6=95=B4=20-=20=E5=88=A0=E5=BE=85?= =?UTF-8?q?=E5=A4=84=E7=90=86=E7=A2=8E=E7=89=87=E5=8D=A1(4=E5=BC=A0)+?= =?UTF-8?q?=E7=A1=AC=E7=A2=8E=E7=89=87=E6=96=B0=E5=A2=9E=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E4=B8=8E=E5=BD=95=E5=85=A5=E5=BC=B9=E7=AA=97(hard=5Fadd.php)+?= =?UTF-8?q?=E7=BB=BC=E5=90=88=E6=A6=82=E8=A7=88=E5=BE=85=E5=A4=84=E7=90=86?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=A2=8E=E7=89=87=3D=E7=A1=AC+=E8=BD=AF+?= =?UTF-8?q?=E7=9C=8B=E6=9D=BF=E6=93=8D=E4=BD=9C=E5=90=8E=E5=AE=9E=E6=97=B6?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/dashboard/stats.php | 7 +++- api/fragment/hard_add.php | 65 ++++++++++++++++++++++++++++++++++ static/css/style.css | 4 --- static/js/config.js | 2 +- static/js/fragment.js | 73 +++++++++++++++++++++++++++++++++++++-- 5 files changed, 142 insertions(+), 9 deletions(-) create mode 100644 api/fragment/hard_add.php 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( - '
' + + '' + // ================= 硬碎片 ================= '| 完整度 | 类型 | 内容摘要 | 来源 | 录入人 | 录入时间 | 状态 | 操作 |
|---|