v1.0.29: 碎片处理按dp方案2修订 - 完整度改三层独立判定(核心100%/重要60%/非必要40%,任一不达标即碎片)+字段分层调整(persons email升核心,companies核心扩5字段)+指标卡5张(新增累计处理,本月/累计=硬+软合计)+软碎片列表加各层完整度列+硬碎片完整度改已填/总可填

This commit is contained in:
nanguaboss
2026-08-09 21:13:33 +08:00
parent 616da931fa
commit 17dc5d434b
11 changed files with 216 additions and 151 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ var BASE_URL = '/api/';
var PAGE_SIZE = 20;
/** 系统版本号(logo旁展示):修改代码后运行 tools/bump_version.php 自动递增 */
var APP_VERSION = 'v1.0.28';
var APP_VERSION = 'v1.0.29';
/** 页脚版权/备案信息(在 config.js 中修改) */
var FOOTER_TEXT = '© 2026 SuperLink 管理系统 版权所有 | 备案号:请替换为真实备案号';
+17 -11
View File
@@ -22,7 +22,7 @@ $(function () {
function levelTagHtml(level) {
if (level === 'core') return '<span class="tag tag-red">缺核心</span>';
if (level === 'important') return '<span class="tag tag-orange">缺重要</span>';
if (level === 'supplementary') return '<span class="tag tag-blue">待补充</span>';
if (level === 'optional') return '<span class="tag tag-blue">待补充</span>';
return '<span class="tag tag-green">完整</span>';
}
@@ -75,13 +75,13 @@ $(function () {
' <option value="social_accounts">联系方式</option><option value="media">媒体</option></select>' +
' <select id="soft-level"><option value="">全部缺失层级</option>' +
' <option value="core">缺核心</option><option value="important">缺重要</option>' +
' <option value="supplementary">待补充</option></select>' +
' <option value="optional">待补充</option></select>' +
' <input type="text" id="soft-keyword" placeholder="名称关键词">' +
' <button class="btn btn-primary" id="soft-search">搜索</button>' +
' <button class="btn" id="soft-reset">重置</button>' +
' </div>' +
' <div class="table-wrap"><table class="grid">' +
' <thead><tr><th>完整度</th><th>缺失层级</th><th>名称</th><th>缺失字段</th><th>所属表</th><th>录入时间</th><th>操作</th></tr></thead>' +
' <thead><tr><th>完整度</th><th>缺失层级</th><th>名称</th><th>各层完整度</th><th>缺失字段</th><th>所属表</th><th>录入时间</th><th>操作</th></tr></thead>' +
' <tbody id="soft-tbody"></tbody>' +
' </table></div>' +
' <div class="pagination" id="soft-pagination"></div>' +
@@ -113,13 +113,14 @@ $(function () {
}).catch(function () {});
}
/* ================= 顶部指标卡 ================= */
/* ================= 顶部概览指标卡 ================= */
function loadStats() {
httpGet('fragment/stats_overview.php').then(function (d) {
$('#stat-cards').html(
'<div class="stat-card c-blue"><div class="num">' + d.hard_total + '/' + d.soft_total + '</div><div class="label">碎片总数(硬/软)</div></div>' +
'<div class="stat-card c-green"><div class="num">' + d.month_new + '</div><div class="label">本月新增</div></div>' +
'<div class="stat-card c-orange"><div class="num">' + d.month_processed + '</div><div class="label">本月处理</div></div>' +
'<div class="stat-card c-teal"><div class="num">' + d.cumulative + '</div><div class="label">累计处理</div></div>' +
'<div class="stat-card c-red"><div class="num">' + d.pending + '</div><div class="label">待处理碎片</div></div>'
);
});
@@ -175,17 +176,20 @@ $(function () {
var html = '';
softRows.forEach(function (r) {
var missing = (r.missing_fields || []).join('、') || '-';
var layers = r.layer_rates || {};
var layerHtml = '核心' + (layers.core !== undefined ? layers.core : '-') + '% / 重要' + (layers.important !== undefined ? layers.important : '-') + '% / 非必要' + (layers.optional !== undefined ? layers.optional : '-') + '%';
html += '<tr>' +
'<td>' + completenessHtml(r.score) + '</td>' +
'<td>' + completenessHtml(r.overall) + '</td>' +
'<td>' + levelTagHtml(r.level) + '</td>' +
'<td>' + escHtml(r.name) + '</td>' +
'<td style="max-width:260px;">' + escHtml(missing) + '</td>' +
'<td style="font-size:12px;color:#5a6472;white-space:nowrap;">' + layerHtml + '</td>' +
'<td style="max-width:240px;">' + escHtml(missing) + '</td>' +
'<td>' + escHtml(r.table_label) + '</td>' +
'<td>' + fmtDate(r.created_at) + '</td>' +
'<td class="ops"><a onclick="completeSoft(\'' + r.table + '\',' + r.id + ')">补全</a></td></tr>';
});
if (!softRows.length) {
html = '<tr><td colspan="7" class="empty-tip" style="padding:30px 0;">暂无软碎片</td></tr>';
html = '<tr><td colspan="8" class="empty-tip" style="padding:30px 0;">暂无软碎片</td></tr>';
}
$('#soft-tbody').html(html);
renderPagination($('#soft-pagination'), d, loadSoftList);
@@ -195,7 +199,6 @@ $(function () {
/* ================= 硬碎片:查看 ================= */
window.viewHard = function (id) {
httpGet('fragment/hard_detail.php', { id: id }).then(function (d) {
var missing = [].concat(d.missing.core || [], d.missing.important || [], d.missing.supplementary || []);
var rowHtml = '';
var fields = [
['类型', d.source_type_label], ['公司名称', d.company_name], ['联系人', d.person_name],
@@ -301,16 +304,19 @@ $(function () {
/* ================= 软碎片:补全 ================= */
window.completeSoft = function (table, id) {
httpGet('fragment/soft_detail.php', { table: table, id: id }).then(function (d) {
var allMissing = [].concat(d.missing_core || [], d.missing_important || [], d.missing_supp || []);
var allMissing = [].concat(d.missing_core || [], d.missing_important || [], d.missing_optional || []);
var inputs = '';
allMissing.forEach(function (m) {
var isDate = (m.key === 'established_date');
inputs += '<div class="form-item"><label>' + escHtml(m.label) + (m.key === 'full_name' || m.key === 'display_name' ? '<span class="req">*</span>' : '') + '</label>' +
'<input type="' + (isDate ? 'date' : 'text') + '" name="' + m.key + '"></div>';
});
var layers = d.layers || {};
var layerDesc = '核心' + (layers.core ? layers.core.rate : '-') + '% / 重要' + (layers.important ? layers.important.rate : '-') + '% / 非必要' + (layers.optional ? layers.optional.rate : '-') + '%';
var content =
'<form id="soft-form" style="padding:16px 22px 4px;">' +
'<div style="font-size:12px;color:#8a94a6;margin-bottom:10px;">当前完整度 <b style="color:#d9534f;">' + d.score + '%</b>(阈值 ' + d.threshold + '%),补全后自动重新计算。</div>' +
'<div style="font-size:12px;color:#8a94a6;margin-bottom:4px;">整体完整度 <b style="color:#d9534f;">' + d.overall + '%</b>,各层:' + layerDesc + '</div>' +
'<div style="font-size:12px;color:#8a94a6;margin-bottom:10px;">核心层须 100%、重要层 ≥60%、非必要层 ≥40%,补全后自动重新计算。</div>' +
'<div class="form-grid">' + inputs + '</div>' +
'<div class="dialog-footer"><button type="button" class="btn" id="soft-cancel">取消</button>' +
'<button type="submit" class="btn btn-primary">保存补全</button></div>' +
@@ -332,7 +338,7 @@ $(function () {
if (name) fd[name] = $(this).val();
});
httpPost('fragment/soft_update.php', fd).then(function (res) {
Dialog.success(res && res.is_complete ? '补全完成' : '已保存(完整度 ' + (res && res.score) + '%)', function () {
Dialog.success(res && res.is_complete ? '补全完成' : '已保存(整体完整度 ' + (res && res.overall) + '%)', function () {
Dialog.close(idx);
loadStats();
loadSoftList(softPage);