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