2 Commits
3 changed files with 48 additions and 9 deletions
+4 -2
View File
@@ -291,8 +291,10 @@ App 从每段的动作组/任务带出来(列表里显示"动作组 · App"或
**一级:账号总表**(一行一个账号;来源 = 素材根目录下的账号文件夹 **∪** 账号库 `device_account`)
**筛选**(2026-10-17 用户要求:"账号所属手机要做个筛选,方便我快速找出来我要管的账号"):
表格上方有 **所属手机** 下拉(全部 / 每台设备 / 未登记)+ **昵称搜索**,并显示 `共 N 个 / 筛出 M 个`;
「清除筛选」一键还原。筛选只作用于账号表,进素材二级页再回来仍保留。
表格上方有 **所属手机** 下拉(全部 / 每台设备 / 未登记)+ **账号状态** 下拉
(全部 / 只看异常 / 正常 / 作品异常 / 账号异常… / 未设置)+ **昵称搜索**,
并显示 `共 N 个 / 筛出 M 个`;「清除筛选」一键还原。
筛选只作用于账号表,进素材二级页再回来仍保留。
| 列 | 内容 | 可编辑 |
|---|---|---|
+10
View File
@@ -923,3 +923,13 @@ data/accounts/周周苏州探店日记、周周苏州约会好去处/_日志/202
- 待定:要读到「作品异常」需要一个能读到的控件或 OCR;WebView 里的文字
xpath 读不到,这一点需要在任务里换读法(等用户确认走哪种)。
- 测试:`test_roster.py` ⑤ 改为"读不到 → 不覆盖原值";全量 17/17 通过。
## 33. 2026-10-21 资产管理:按账号状态快速筛选
用户:"资产管理加个筛选,能快速筛选账号状态。"
- 账号总表筛选栏新增 **账号状态** 下拉:
`全部 / 只看异常 / 正常 / 作品异常 / 账号异常… / 未设置`
(具体状态从当前账号表动态汇总,顺序:正常 → 含「异常」→ 其它)。
- 与「所属手机」「昵称搜索」**叠加**生效;「清除筛选」一并还原;计数显示 `共 N / 筛出 M`。
- 纯前端(`static/admin/account_folder.js`),刷新页面即可用(强刷加载新 JS)。
+34 -7
View File
@@ -123,8 +123,8 @@ function afAssetBack() {
// 账号总表筛选(所属手机 / 昵称)—— 用户 2026-10-17:"方便我快速找出来我要管的账号"
function afAccFilterSet(k, v, debounce) {
const F = _af.accFilter = _af.accFilter || {device: '', q: ''};
if (k === '__clear') { F.device = ''; F.q = ''; }
const F = _af.accFilter = _af.accFilter || {device: '', q: '', status: ''};
if (k === '__clear') { F.device = ''; F.q = ''; F.status = ''; }
else F[k] = v;
const redraw = function () {
afRender();
@@ -287,12 +287,16 @@ async function afDoSingleUpload() {
// ---------- 一级:账号总表 ----------
function afHtmlAsset() {
if (_af.assetView === 'items' && _af.curAccount) return afHtmlAssetItems();
// 账号总表的筛选:**所属手机** + 昵称搜索(用户 2026-10-17:"方便我快速找出来我要管的账号")
const F = _af.accFilter || (_af.accFilter = {device: '', q: ''});
// 账号总表的筛选:**所属手机** + **账号状态** + 昵称搜索
// (用户 2026-10-17:"方便我快速找出来我要管的账号";2026-10-21 加状态筛选)
const F = _af.accFilter || (_af.accFilter = {device: '', q: '', status: ''});
const all = _af.accounts || [];
let shown = all;
if (F.device === '__none') shown = shown.filter(function (a) { return !a.device_name; });
else if (F.device) shown = shown.filter(function (a) { return a.device_name === F.device; });
if (F.status === '__none') shown = shown.filter(function (a) { return !(a.account_status || '').trim(); });
else if (F.status === '__abnormal') shown = shown.filter(function (a) { return (a.account_status || '').indexOf('异常') >= 0; });
else if (F.status) shown = shown.filter(function (a) { return (a.account_status || '') === F.status; });
if (F.q) {
const kw = F.q.toLowerCase();
shown = shown.filter(function (a) {
@@ -301,6 +305,18 @@ function afHtmlAsset() {
}
const devNames = Array.from(new Set(all.map(function (a) { return a.device_name; })
.filter(Boolean))).sort();
const statusNames = Array.from(new Set(all.map(function (a) {
return (a.account_status || '').trim();
}).filter(Boolean)));
// 排序:正常 → 带「异常」的 → 其它(中文排序)
statusNames.sort(function (a, b) {
if (a === '正常') return -1;
if (b === '正常') return 1;
const ea = a.indexOf('异常') >= 0, eb = b.indexOf('异常') >= 0;
if (ea && !eb) return -1;
if (eb && !ea) return 1;
return a.localeCompare(b, 'zh');
});
const rows = shown.map(function (a) {
const devSel = afDevSelectHtml(a);
return '<tr>' +
@@ -354,12 +370,23 @@ function afHtmlAsset() {
}).join('') +
'<option value="__none"' + (F.device === '__none' ? ' selected' : '') + '>未登记</option>' +
'</select>' +
'<span style="font-size:12px">账号状态</span>' +
'<select class="form-control" style="width:150px" onchange="afAccFilterSet(\'status\', this.value)">' +
'<option value="">全部</option>' +
'<option value="__abnormal"' + (F.status === '__abnormal' ? ' selected' : '') + '>只看异常</option>' +
statusNames.map(function (s) {
return '<option value="' + esc(s) + '"' + (F.status === s ? ' selected' : '') + '>' +
esc(s) + '</option>';
}).join('') +
'<option value="__none"' + (F.status === '__none' ? ' selected' : '') + '>未设置</option>' +
'</select>' +
'<input class="form-control" style="width:200px" value="' + esc(F.q) + '" ' +
'oninput="afAccFilterSet(\'q\', this.value, 1)" placeholder="搜账号昵称">' +
((F.device || F.q)
((F.device || F.q || F.status)
? '<button class="btn btn-xs" onclick="afAccFilterSet(\'__clear\')">清除筛选</button>' : '') +
'<span class="text-muted" style="font-size:12px">共 ' + all.length + ' 个' +
(((F.device || F.q) && shown.length !== all.length) ? ',筛出 ' + shown.length + ' 个' : '') + '</span>' +
(((F.device || F.q || F.status) && shown.length !== all.length)
? ',筛出 ' + shown.length + ' 个' : '') + '</span>' +
'</div>' +
'<table class="table"><thead><tr>' +
'<th style="width:230px">账号</th><th style="width:210px">所属手机</th>' +
@@ -367,7 +394,7 @@ function afHtmlAsset() {
'<th style="width:400px">素材库</th><th style="width:140px">最近发布</th><th style="width:190px">操作</th>' +
'</tr></thead><tbody>' +
(rows || '<tr><td colspan="6" class="empty">' +
((F.device || F.q) ? '没有符合筛选条件的账号 —— 点「清除筛选」看全部'
((F.device || F.q || F.status) ? '没有符合筛选条件的账号 —— 点「清除筛选」看全部'
: '还没有账号 —— 先「导入/维护账号库」,再「批量上传素材」') +
'</td></tr>') +
'</tbody></table>';