feat(v1.3): 管理员(打手)颜色,客户归属打手,日历/待办按颜色标识
1) 管理员颜色 - users 表新增 color;设置 → 管理员 每行一个颜色选择器,保存即生效 - 新建管理员自动从 8 色调色板分配,尽量不重复;支持 #RRGGBB 校验,非法值拒绝 2) 客户归属打手 - customers 表新增 assignee_id(可空,指向 users) - 新建/编辑客户时可选择「归属打手」,客户详情页也能直接改派 - 语义:一个客户一个打手,该客户之后的所有单子都归这个打手 - 停用的账户不出现在打手候选里;未指派显示灰色「未指派」 3) 日历 - 每个日期格左侧新增 5px 竖条,按当天涉及的打手颜色等分显示(几种颜色几段) - 竖条按“当天全部任务”去重计算,不受格内色签 3 条上限影响 - 未指派的任务用中性灰段落 4) 待办与大屏 - 「当日待完成」每条任务左侧 3px 打手色条 + 圆点色标 + 打手名字,未指派灰字 - 大屏:今日待打列表、热力格竖条、悬停浮层(新增 who / who_color 字段)统一使用同一套颜色 - 加急样式改为红底,避免与打手色左边框冲突 数据库兼容性: - 只做加法:users.color、customers.assignee_id 两列;老库打开时自动 ALTER,可重复迁移 - 原有表结构、字段、页面接口不变;未指派的存量数据照常工作 测试: - 新增单测:颜色自动分配/规范化/非法值拒绝、客户指派与取消、订阅联表带出打手、停用账户不进候选 - 旧库迁移测试扩展:老 users / customers 表自动补列并可写 - 功能验证 16 项(颜色保存、指派、详情展示、日历多色竖条分段、大屏列表与浮层接口)全部通过 - 原有 119 项验收回归全绿;go vet / go test ./... 通过;版本号 1.3.0
This commit is contained in:
@@ -845,3 +845,57 @@ fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
* { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
|
||||
}
|
||||
|
||||
|
||||
/* ---------- 打手颜色 ---------- */
|
||||
|
||||
/* 日历格左侧竖条:同一天有几种打手就分几段 */
|
||||
.asg-strip {
|
||||
position: absolute; left: 0; top: 0; bottom: 0;
|
||||
display: flex; flex-direction: column;
|
||||
width: 5px; overflow: hidden;
|
||||
border-radius: 2px 0 0 2px;
|
||||
z-index: 1;
|
||||
}
|
||||
.asg-strip i { display: block; flex: 1 1 0; min-height: 3px; background: var(--muted); }
|
||||
.asg-strip.sm { width: 3px; }
|
||||
|
||||
.cal-cell { padding-left: 12px; }
|
||||
|
||||
/* 打手标签:小圆点 + 名字 */
|
||||
.asg {
|
||||
display: inline-flex; align-items: center; gap: 4px;
|
||||
font-size: 11px; color: var(--ink-2); white-space: nowrap;
|
||||
}
|
||||
.asg i {
|
||||
width: 8px; height: 8px; border-radius: 2px;
|
||||
display: inline-block; flex: 0 0 auto;
|
||||
}
|
||||
.asg.none { color: var(--muted); }
|
||||
.asg.none i { background: var(--muted); opacity: 0.55; }
|
||||
|
||||
/* 待办行左侧打手色(加急时红底仍在,色条让位给背景) */
|
||||
.task { border-left: 3px solid var(--asg, transparent); padding-left: 8px; margin-left: -3px; }
|
||||
.task.urgent { border-left-color: var(--danger); }
|
||||
|
||||
/* 设置页颜色表单 */
|
||||
.color-form { display: flex; align-items: center; gap: 6px; }
|
||||
.color-form input[type="color"] {
|
||||
width: 34px; height: 26px; padding: 1px;
|
||||
border: 1px solid var(--line); border-radius: var(--radius);
|
||||
background: var(--surface); cursor: pointer;
|
||||
}
|
||||
|
||||
/* 客户详情里的快速指派 */
|
||||
.assign-form { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; }
|
||||
.assign-form select {
|
||||
height: 26px; padding: 0 6px; font-size: 12px;
|
||||
border: 1px solid var(--line); border-radius: var(--radius);
|
||||
background: var(--surface); color: var(--ink);
|
||||
}
|
||||
.cust-meta dd { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
|
||||
|
||||
@media (max-width: 560px) {
|
||||
.asg { font-size: 10px; }
|
||||
.assign-form { margin-left: 0; }
|
||||
}
|
||||
|
||||
@@ -381,3 +381,31 @@ body::before {
|
||||
.scr-main, .scr-bottom { grid-template-columns: 1fr; }
|
||||
.scr-tabs, .scr-links { display: none; }
|
||||
}
|
||||
|
||||
|
||||
/* ---------- 打手颜色(大屏) ---------- */
|
||||
|
||||
.asg-strip {
|
||||
position: absolute; left: 0; top: 0; bottom: 0;
|
||||
display: flex; flex-direction: column;
|
||||
width: 3px; overflow: hidden;
|
||||
}
|
||||
.asg-strip i { display: block; flex: 1 1 0; min-height: 3px; }
|
||||
|
||||
.heat-cell { padding-left: 9px; }
|
||||
|
||||
.asg {
|
||||
display: inline-flex; align-items: center; gap: 4px;
|
||||
font-size: 10px; color: var(--ink-2); white-space: nowrap;
|
||||
overflow: hidden; text-overflow: ellipsis;
|
||||
}
|
||||
.asg i { width: 7px; height: 7px; border-radius: 1px; flex: 0 0 auto; }
|
||||
.asg.none { color: var(--muted); }
|
||||
.asg.none i { opacity: 0.5; }
|
||||
|
||||
.today-list li { grid-template-columns: auto minmax(0, 1fr) auto auto auto; }
|
||||
|
||||
.pop-who {
|
||||
display: inline-block; width: 7px; height: 7px;
|
||||
border-radius: 1px; margin-right: 4px; vertical-align: 0;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
data.items.forEach(function (it) {
|
||||
html += '<li class="' + (it.urgent ? 'urgent ' : '') + (it.done ? 'done' : '') + '">' +
|
||||
'<span class="pop-tail">' + esc(it.tail) + '</span>' +
|
||||
'<span class="pop-name">' + esc(it.name) + ' · ' + esc(it.pkg) + '</span>' +
|
||||
'<span class="pop-name"><i class="pop-who" style="background:' + esc(it.who_color || '#8A8F98') + '"></i>' + esc(it.who || '未指派') + ' · ' + esc(it.pkg) + '</span>' +
|
||||
'<span class="pop-rem">' + (it.urgent ? '加急 · ' : '') + esc(it.remain) + '</span>' +
|
||||
'</li>';
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user