feat: 项目层级树+合作方绑定KOC资源+客户群全量可选+精简编辑表单,移除复盘报表
- 项目支持父子层级:树形折叠展示、详情面板内联管理总群成员、推送聚合子项目任务、环检测与子项目删除守卫 - 外部KOC合作方绑定 KOC 资源账号(唯一占用、换绑/解绑、资源页一键设为合作方),列表直显联系方式 - 绑定客户群改为全量外部群缓存(含各群主),同步按钮强刷;member_count 缺失以 member_list 兜底 - 任务/项目编辑模式隐藏不可变字段(平台/内容类型/品牌/总群成员),详情面板维护成员时保留 parent_id - 删除复盘报表整栏(导航/页面/task_report_list/导出路由/CSV lib 及测试)
This commit is contained in:
@@ -5,7 +5,6 @@ import {
|
||||
isTaskOwner,
|
||||
ownerScopeUserid,
|
||||
} from "../lib/owner-scope.ts";
|
||||
import { getTaskReportData } from "../lib/mvp-db.ts";
|
||||
|
||||
function captureDb(rowsByPattern) {
|
||||
const captured = [];
|
||||
@@ -121,29 +120,3 @@ test("ownerScopeUserid maps scope kinds to filter value", () => {
|
||||
assert.equal(ownerScopeUserid({ kind: "owner", wecomUserId: "zhangsan" }), "zhangsan");
|
||||
assert.equal(ownerScopeUserid({ kind: "owner", wecomUserId: "" }), "");
|
||||
});
|
||||
|
||||
test("getTaskReportData filters by owner when ownerUserid given", async () => {
|
||||
const { db, captured } = captureDb([[/FROM tasks t/, () => []]]);
|
||||
await getTaskReportData(db, "zhangsan");
|
||||
assert.equal(captured.length, 1);
|
||||
assert.match(
|
||||
captured[0].sql,
|
||||
/WHERE \(t\.owner_userid = \? OR p\.owner_userid = \?\)/,
|
||||
);
|
||||
assert.deepEqual(captured[0].values, ["zhangsan", "zhangsan"]);
|
||||
});
|
||||
|
||||
test("getTaskReportData keeps global aggregation without ownerUserid", async () => {
|
||||
const { db, captured } = captureDb([[/FROM tasks t/, () => []]]);
|
||||
await getTaskReportData(db);
|
||||
assert.equal(captured.length, 1);
|
||||
assert.ok(!/owner_userid = \?/.test(captured[0].sql));
|
||||
assert.ok(!captured[0].values?.length);
|
||||
});
|
||||
|
||||
test("getTaskReportData returns empty list for unbound owner (empty string scope)", async () => {
|
||||
const { db, captured } = captureDb([[/FROM tasks t/, () => [{ id: "task-x" }]]]);
|
||||
const rows = await getTaskReportData(db, "");
|
||||
assert.deepEqual(rows, []);
|
||||
assert.equal(captured.length, 0, "空范围不应执行查询(绑定 '' 会误配 owner_userid='' 的任务)");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user