maestro(tsk_tqxHX6NRQ3iA): 前端 NewTaskPanel:剪贴板粘贴图片 + 拖拽上传 + 统一 files 状态 + 缩略图预览 + 单个删除 + 客户端去重 + 5 语 i18n
This commit is contained in:
@@ -354,13 +354,101 @@ function TaskDetail({ task, t, byId, onJump, onTakeover, taskOps }) {
|
||||
);
|
||||
}
|
||||
|
||||
// 新建任务面板的附件区样式(dropzone 高亮 / 缩略图 chip / 删除角标),一次性注入避免污染全局
|
||||
function ensureNewTaskCss() {
|
||||
if (document.getElementById('maestro-kit-newtask-css')) return;
|
||||
const s = document.createElement('style');
|
||||
s.id = 'maestro-kit-newtask-css';
|
||||
s.textContent = `
|
||||
.m-nt-drop { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px dashed var(--line); border-radius: var(--radius-sm, 4px); background: var(--bg-deep); transition: border-color .12s, background .12s; }
|
||||
.m-nt-drop.is-over { border-color: var(--green-dim); background: var(--panel-2); }
|
||||
.m-nt-hint { font-size: 10.5px; color: var(--faint); letter-spacing: .04em; }
|
||||
.m-nt-hint.is-over { color: var(--green); }
|
||||
.m-nt-grid { display: flex; flex-wrap: wrap; gap: 8px; }
|
||||
.m-nt-chip { position: relative; width: 92px; display: flex; flex-direction: column; gap: 3px; }
|
||||
.m-nt-thumb { width: 92px; height: 64px; border: 1px solid var(--line); border-radius: var(--radius-sm, 4px); background: var(--panel-2); overflow: hidden; display: flex; align-items: center; justify-content: center; }
|
||||
.m-nt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
|
||||
.m-nt-ext { font-family: var(--mono); font-size: 12px; color: var(--cyan); text-transform: uppercase; letter-spacing: .06em; }
|
||||
.m-nt-name { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.m-nt-size { font-size: 9.5px; color: var(--faint); font-family: var(--mono); }
|
||||
.m-nt-del { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; padding: 0; line-height: 1; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); color: var(--muted); cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; transition: color .12s, border-color .12s, background .12s; }
|
||||
.m-nt-del:hover { color: var(--red); border-color: var(--red-dim); background: var(--panel-2); }
|
||||
`;
|
||||
document.head.appendChild(s);
|
||||
}
|
||||
|
||||
// 三来源(选择/粘贴/拖拽)统一去重键:name+size+lastModified
|
||||
function ntFileKey(f) { return (f.name || '') + ' | ||||