{% extends 'base.html' %} {% block title %}导入预览 · {{ meta.cn }}台账{% endblock %} {% block body %}
更新的是这几列:{{ plan.upd_cols|join('、') or '(CSV 里只有主键,没有要改的列)' }}。 确认写库只会 update 上面「真的要改」那 {{ plan.changed }} 行,不新增、不删除任何记录。
{% if ignored %}这些表头不是台账列,已忽略:{{ ignored|join('、') }}
{% endif %} {% if dup_head %}这些表头在同一列上出现了两次,只认第一次:{{ dup_head|join('、') }}
{% endif %} {% if dupes %}CSV 里有 {{ dupes }} 行主键和前面的重复,已按后出现的那一行取值——多半是导出时没筛干净,先回去核对。
{% endif %} {% if blanks %}CSV 里有 {{ blanks }} 行整行是空的(Excel 常见尾部空行),已跳过。
{% endif %} {% if plan.total and plan.changed %} {% elif plan.total %}这一份和库里的值完全一致,没有要写的改动。
{% else %} {% endif %}按 {{ meta.pk|join(' + ') }} 排好的前 {{ plan.missing_sample|length }} 个: {{ plan.missing_sample|join(' ') }}
{% if table == 'signal' %}对不上通常是端口/公共地址/对象地址被改过,或者这份 CSV 是别的风场导出的。
{% endif %}{% endif %}
| {{ cn.get(c, c) }} | {% endfor %}改动(旧 → 新) |
|---|---|
| {{ v }} | {% endfor %}{% for x in d.cols %}{{ x.cn }}:{{ x.old or '(空)' }} → {{ x.new or '(空)' }}{% endfor %} |
还有 {{ plan.changed - plan.diffs|length }} 行没列出来。
{% endif %}