diff --git a/README.md b/README.md index 6b9bc4c..fc62233 100644 --- a/README.md +++ b/README.md @@ -404,7 +404,7 @@ python scripts/legacy/add_entry_date.py --force # 全部重算 - **禁用「彩色描边」**:卡片、列表、步骤条、表格一律中性灰边框(`--border` / `--border-strong`)或无边框,不用圆角多色边框表达状态。 - **重点色只出现在三处**:图标、关键数字/文本、小面积 tinted 底板(`.ic-badge`、`.tag-mini`、`.kpi.accent-*`)。状态色(`statusMeta`)与阶段色(`stageMeta`)是唯一配色来源,避免各页面自己调色。 -- **图标系统**:`web/icons.js` 内置 50 个 24×24 线性 SVG,`stroke=currentColor`,颜色跟着文字走。对外 API: +- **图标系统**:`web/icons.js` 内置 48 个 24×24 线性 SVG(每个都被界面或状态/阶段/标题映射引用,死图标随手删),`stroke=currentColor`,颜色跟着文字走。对外 API: `svg(name)` 裸图标;`badge(name)` 图标 + tinted 底板(KPI 用);`status()` / `stage()` / `pipe()` 按状态·阶段·交付环节取图标; `nameOfStatus()` / `nameOfStage()` / `statusBadge()` 出文案与徽标;`hydrate()` 填 `[data-icon]`;`auto()` 自动补前导图标;`names()` 列全部图标名。 - **自动图标**:`auto()` + `MutationObserver` 在每次渲染后按标题关键词给 `.card-head h4` / `.sec-title` / `.kcol-title` / `.wk-group-head` / `.notice` / `.empty` 加前导图标,并填充 `[data-icon]`;用 `data-ico` 属性防重复,标题里**自带** ``(如阶段看板按阶段取图标)时跳过自动补图,不会出现两个图标。新增区块只要标题里带对应关键词就自动带图标,不用手写。 diff --git a/web/app.js b/web/app.js index da58313..19f4ddc 100644 --- a/web/app.js +++ b/web/app.js @@ -16,7 +16,6 @@ meta: null, periods: null, categories: [], - drawerProject: null, // 详情抽屉:周期反馈的显示粒度 / 范围 / 往前翻页偏移 dw: { group: "week", range: 2, back: 0 }, // 定制项目 @@ -39,7 +38,6 @@ intakeType: "general", // 更新录入的两种方式:direct = 直接写入(原样存 1 条);ai = AI 整理(补结构化字段,也只存 1 条) intakeMode: "direct", - drawerCustom: null, // 周看板(左栏总览 + 右栏详情) weekly: null, weeklySel: null, @@ -2449,7 +2447,6 @@ $("#drawerBody").innerHTML = `
加载中…
`; drawerActions(""); const d = await api("/custom/projects/" + cid); - state.drawerCustom = d; const p = d.project; $("#drawerTitle").innerHTML = `${p.is_key ? starMark(true) : ""}${esc(p.name)}${p.archived ? ` 已归档` : ""}`; const progPct = (p.project_status === "进行中" || Number(p.progress || 0) > 0) ? Math.round(p.progress || 0) + "%" : null; @@ -2464,8 +2461,6 @@
${nl2br(t.content || "")}
`).join(""); - // 「添加动态」落到顶栏当前选中的那一周,与更新录入页的周期下拉一致 - const ro = (label, val) => `
${val}
`; const originOpts = optionHtml(cmOptions("origins"), p.origin); const industryOpts = optionHtml(cmOptions("industries"), p.industry); @@ -2834,7 +2829,6 @@ /* ---------------------------------------------------------------- 更新录入 */ let intakeProjectId = null; - let intakeParsed = null; async function renderIntake() { const host = $("#view-intake"); @@ -2956,7 +2950,6 @@ raw_text: raw, use_ai: useAI, }); intakeProjectId = r.project ? r.project.id : intakeProjectId; - intakeParsed = r.parsed; renderIntakePreview(r, raw); } catch (e) { $("#intakePreview").innerHTML = `
整理失败:${esc(e.message)}
`; @@ -3138,11 +3131,9 @@ $("#drawerBody").innerHTML = `
加载中…
`; drawerActions(""); let d = await api("/projects/" + pid); - state.drawerProject = d; // 弹窗里改完记录,只重画下面的周期反馈,抽屉不关闭、滚动位置不丢 const reloadFeed = async () => { d = await api("/projects/" + pid); - state.drawerProject = d; renderFeed(); }; const p = d.project; @@ -4044,7 +4035,7 @@ } /* ------------------------------------------- 界面状态(刷新后保持) */ - const UI_KEY = "unis.ui.v1"; + const UI_KEY = "unis.ui.v2"; // v2:删掉 focusFilter=later 兼容分支后升版,旧 sessionStorage 直接作废 const UI_FIELDS = ["view", "navFolded", "gran", "weekId", "monthIdx", "categoryId", "keyword", "projOwner", "projIdleOnly", "showArchived", "focusFilter", "focusArchived", "weeklyOwner", "customTab", "customArchived", "customRegion", "customOrigin", "customSort", "staffArchived", "staffGroup"]; @@ -4062,7 +4053,6 @@ UI_FIELDS.forEach((k) => { if (k in o) state[k] = o[k]; }); if (["board", "projects", "custom", "focus", "staff", "intake", "settings", "rbac"].indexOf(state.view) < 0) state.view = "board"; if (state.gran !== "month") state.gran = "week"; - if (state.focusFilter === "later") state.focusFilter = "week"; } function hostNoPermission() { diff --git a/web/icons.js b/web/icons.js index 1a2f245..bdeb237 100644 --- a/web/icons.js +++ b/web/icons.js @@ -24,12 +24,10 @@ x: '', "chevron-left": '', "chevron-right": '', - "chevron-down": '', "chevron-up": '', "log-out": '', "arrow-right": '', search: '', - download: '', check: '', "check-circle": '', circle: '', @@ -45,11 +43,9 @@ sparkles: '', trash: '', archive: '', - flag: '', /* 业务语义 */ calendar: '', "calendar-check": '', - user: '', layers: '', activity: '', pie: '', @@ -63,9 +59,7 @@ hourglass: '', note: '', database: '', - bell: '', code: '', - link: '', }; var STATUS_ICON = { @@ -166,7 +160,7 @@ if (!root) return; if (root.nodeType === 1) fill(root); if (!root.querySelectorAll) return; - var nodes = root.querySelectorAll("[data-icon], .card-head h4, .sec-title, .kcol-title, .wk-group-head, .empty, .notice"); + var nodes = root.querySelectorAll("[data-icon], .card-head h4, .sec-title, .wk-group-head, .empty, .notice"); fillAll(nodes); } @@ -180,8 +174,8 @@ el.removeAttribute("data-icon"); return; } - if (el.matches(".card-head h4, .sec-title, .kcol-title, .wk-group-head")) { - // 模板里已经自带前导图标的标题(如阶段看板的阶段图标)不再自动补第二个 + if (el.matches(".card-head h4, .sec-title, .wk-group-head")) { + // 模板里已经自带前导图标的标题不再自动补第二个 if (el.querySelector(":scope > .ic")) { el.setAttribute("data-ico", "1"); return; } leadingIcon(el, pickIcon(text(el), TITLE_ICON), "ti"); } else if (el.matches(".notice")) { @@ -203,7 +197,7 @@ window.Icon = { svg: svg, badge: badge, status: status, stage: stage, pipe: pipe, nameOfStatus: nameOfStatus, nameOfStage: nameOfStage, statusBadge: statusBadge, - hydrate: hydrate, auto: auto, names: P }; + hydrate: hydrate, auto: auto }; function boot() { hydrate(document); auto(document); diff --git a/web/styles.css b/web/styles.css index ebf2dff..da11c7e 100644 --- a/web/styles.css +++ b/web/styles.css @@ -51,7 +51,6 @@ button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus- /* ---------------- 图标基元 ---------------- */ .ic { width: 16px; height: 16px; flex: none; vertical-align: -3px; } -.ic-sm { width: 13px; height: 13px; } .ic-lg { width: 22px; height: 22px; } /* 标题前的小图标 */ .ti { width: 15px; height: 15px; flex: none; color: var(--muted); vertical-align: -2px; } @@ -102,19 +101,6 @@ button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus- .ni .ic { width: 16px; height: 16px; } .nav-item.active .ni { color: var(--primary); } -.side-block { margin-top: 22px; } -.side-title { font-size: 11px; color: var(--muted); letter-spacing: .6px; margin-bottom: 8px; padding: 0 4px; } -.side-list { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow: auto; } -.side-item { - display: flex; align-items: center; gap: 8px; - padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer; border: 0; background: transparent; - color: var(--text-2); width: 100%; text-align: left; -} -.side-item:hover { background: var(--panel-2); } -.side-item.active { background: var(--primary-soft); font-weight: 600; color: var(--text); } -.dot { width: 8px; height: 8px; border-radius: 3px; flex: 0 0 8px; } -.side-item .cnt { margin-left: auto; font-size: 11px; color: var(--muted); } - .switch { display: flex; align-items: center; gap: 8px; padding: 0 4px; cursor: pointer; color: var(--text-2); } /* 用户信息胶囊:钉在侧栏最下方,点开是向上弹出的二级菜单 */ @@ -215,7 +201,6 @@ button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus- .ab-mid ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 11px; } .ab-mid li { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: rgba(232,240,255,.85); } .ab-mid li .ic { width: 15px; height: 15px; flex: none; opacity: .85; } -.ab-foot { position: relative; font-size: 11.5px; color: rgba(232,240,255,.6); } /* 右:表单 */ .auth-form { padding: 40px 40px 32px; display: flex; flex-direction: column; } @@ -228,15 +213,13 @@ button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus- .auth-form .notice.err { margin-bottom: 14px; } .btn.block { width: 100%; height: 42px; margin-top: 8px; justify-content: center; gap: 7px; } .btn.block .ic { width: 16px; height: 16px; } -.af-foot { margin-top: auto; padding-top: 24px; font-size: 11.5px; color: var(--muted); } @media (max-width: 780px) { .auth-mask { padding: 16px; } .auth-shell { grid-template-columns: 1fr; } .auth-brand { padding: 18px 20px; gap: 0; } - .auth-brand .ab-mid, .auth-brand .ab-foot { display: none; } + .auth-brand .ab-mid { display: none; } .auth-form { padding: 26px 22px 22px; } - .af-foot { padding-top: 18px; } } /* ---------------- 权限管理 ---------------- */ @@ -438,24 +421,7 @@ tr:hover .row-ops, .row-ops:focus-within { opacity: 1; } .progress > i { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .4s; } .progress-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; } -/* ---------------- kanban (定制项目) ---------------- */ -.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; } -.kcol { - flex: 0 0 236px; background: var(--panel); border: 1px solid var(--border); - border-radius: var(--radius); box-shadow: var(--shadow); - display: flex; flex-direction: column; max-height: 640px; -} -.kcol-head { padding: 10px 12px; border-bottom: 1px solid var(--border); } -.kcol-title { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; } -.kcol-title .ic { color: var(--c, var(--muted)); } -.kcol-meta { font-size: 11px; color: var(--muted); margin-top: 3px; } -.kcol-body { padding: 10px; overflow: auto; display: flex; flex-direction: column; gap: 9px; flex: 1; } -.kcard { border: 1px solid var(--border); border-radius: 9px; padding: 10px 11px; background: #fff; cursor: pointer; transition: .12s; } -.kcard:hover { border-color: var(--border-strong); box-shadow: 0 4px 12px rgba(16,24,40,.08); } -.kcard-top { display: flex; gap: 6px; align-items: flex-start; } -.kcard-name { font-size: 12.5px; font-weight: 600; line-height: 1.45; flex: 1; } -.kcard-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; gap: 6px; font-size: 11.5px; color: var(--muted); } -.kcard-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--border); } +/* 备注块(看板右栏 / 抽屉详情共用;原阶段看板 kanban 样式已随 tab 下线删除) */ .kcard-remark { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.5; } .empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 16px; text-align: center; color: var(--muted); font-size: 13px; } @@ -719,16 +685,6 @@ table.tbl td.col-ops .btn.sm { padding: 0 7px; } /* 操作列按钮收紧,避 .pipe-arrow { align-self: center; color: var(--muted); padding-top: 12px; flex: none; } .pipe-arrow .ic { width: 14px; height: 14px; } -/* 交付漏斗 */ -.funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); gap: 12px; } -.fun-step { border: 1px solid var(--border); border-radius: 9px; padding: 11px 12px; background: var(--panel-2); } -.fun-name { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); } -.fun-name .ic { width: 13px; height: 13px; color: var(--c, var(--muted)); } -.fun-count { font-size: 22px; font-weight: 700; letter-spacing: -.5px; margin: 3px 0 8px; color: var(--c, var(--text)); } -.fun-bar { height: 6px; background: #eef0f4; border-radius: 99px; overflow: hidden; } -.fun-bar > i { display: block; height: 100%; border-radius: 99px; } -.fun-amt { font-size: 11px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; } - /* 小字段:金额补录等内联输入 */ .field-mini { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }