fix(workshop): AI创作弹窗需求区改单列清单(一行一维度) + 提交创作加确认弹窗
- style.css: .req-sheet 双列卡片网格→单列清单式(grid 1fr);.req-field 改 flex 维度名左标签+内容同行;max-height 290→340;新增 .req-confirm-* 确认弹窗样式 - data-pages.js: reqCreate 点击先 loadPersona 再弹确认弹窗(达人/S1-S11说明/已填需求 n/10/人设附件状态),确认后才 executeTask;取消/遮罩/X 均不提交
This commit is contained in:
1 parent
3864589768
commit
e3c188e6ea
3 files changed
+51
-11
No files matched your search
@@ -348,3 +348,10 @@
|
||||
- `docs/AI会话任务输入输出对照.md` 全面升级:新增**功能入口×技能调用契约总表**(8 入口的按钮/label/skills/前缀常量/prompt 边界/代码位置)+ **★新增入口检查清单 7 项** + 复盘动态分支说明;prompt 模板统一为「前缀+正文」分层结构(原 09-01 版为裸 prompt 已过时)
|
||||
- **验证**:源技能与用户环境 junction 同 inode(2533274790401285)自动同步 ✅
|
||||
- 未 push(距上次 push 17:50 不足 2h,按节奏攒到下次同步点;下次同步点=清 tmp+push 一起执行)
|
||||
|
||||
## AI创作弹窗 v7:需求区单列 + 提交创作确认弹窗(18:00-18:03,用户要求)
|
||||
- **需求原话**:「输入框中 提交创作 按钮需要确认弹窗,需求部分 一个维度一行,不要左右卡片显示」
|
||||
- **CSS**(style.css):`.req-sheet` grid 双列(1fr 1fr)→ **单列清单式**(grid-template-columns: 1fr + gap 6px);`.req-field` 改 flex(维度名=左标签 104px + 内容右侧同行),去 min-height;empty 态保留灰字「(待定 · 由 AI 按人设自决)」;max-height 290→340
|
||||
- **JS**(data-pages.js reqCreate 提交处理器):点击 ✓ 不再直接 executeTask → 先 `await loadPersona()` 再弹**确认弹窗**(modal-mask 内层 modal:标题「确认提交创作」+ 达人名 + 「S1-S11 全流程,自动模式」说明 + 已填需求清单 `reqLines`(n/10)+ 人设已加载/暂无 + 附件有无 + 取消/确认提交创作);点确认后才 `close()` + executeTask
|
||||
- 语法 node --check 通过;纯静态资源 no-store,服务未重启;重开 `?v=20260902-v7#/accounts`
|
||||
- git commit 未做(与 6cd96c9/c40bc22 一起攒到下次同步点)
|
||||
@@ -391,10 +391,34 @@ async function confirmAiScript(accountName, btn) {
|
||||
q('#reqSend').addEventListener('click', () => sendTurn(inputEl.value));
|
||||
q('#reqCreate').addEventListener('click', async () => {
|
||||
if (busy) return;
|
||||
await loadPersona();
|
||||
const prompt = `${SKILL_HINT_CREATE}\n${buildCreatePrompt(accountName, w, personaBlock(), pHas, attach.text)}`;
|
||||
close();
|
||||
executeTask({ prompt, label: '创作指令', btn, skills: ['短视频脚本创作'] });
|
||||
await loadPersona(); // 先加载人设,供确认弹窗展示人设/附件状态
|
||||
const lines = reqLines(w);
|
||||
const reqTxt = lines.length ? lines.map((l) => esc(l)).join('\n') : '(未填写 · 由 AI 按人设自决)';
|
||||
const perTxt = pHas ? '已加载账号设定(人设卡)' : '暂无账号设定(创作前将先提取)';
|
||||
const atTxt = attach.name ? `已附附件:${esc(attach.name)}` : '无附件';
|
||||
const ck = document.createElement('div'); ck.className = 'modal-mask';
|
||||
ck.innerHTML = `<div class="modal">
|
||||
<div class="modal-title-row"><span>确认提交创作</span><button class="btn btn-icon" data-x title="取消">${svgIcon('x', 16)}</button></div>
|
||||
<div class="dim">将为达人「${esc(accountName)}」创建一条完整脚本创作任务(S1-S11 全流程,自动模式)。</div>
|
||||
<div class="req-confirm-label">创作需求(${lines.length}/${REQ_FIELDS.length} 项已填)</div>
|
||||
<div class="req-confirm-box">${reqTxt}</div>
|
||||
<div class="req-confirm-attach">${perTxt} · ${atTxt}</div>
|
||||
<div class="modal-actions">
|
||||
<button class="btn" data-cancel>取消</button>
|
||||
<button class="btn btn-primary" data-ok>确认提交创作</button>
|
||||
</div>
|
||||
</div>`;
|
||||
const rm = () => ck.remove();
|
||||
ck.addEventListener('click', (e) => { if (e.target === ck) rm(); });
|
||||
ck.querySelector('[data-x]').addEventListener('click', rm);
|
||||
ck.querySelector('[data-cancel]').addEventListener('click', rm);
|
||||
ck.querySelector('[data-ok]').addEventListener('click', async () => {
|
||||
rm();
|
||||
const prompt = `${SKILL_HINT_CREATE}\n${buildCreatePrompt(accountName, w, personaBlock(), pHas, attach.text)}`;
|
||||
close();
|
||||
executeTask({ prompt, label: '创作指令', btn, skills: ['短视频脚本创作'] });
|
||||
});
|
||||
document.body.appendChild(ck);
|
||||
});
|
||||
|
||||
renderSheet();
|
||||
|
||||
@@ -213,19 +213,28 @@ main { height: calc(100vh - 54px); }
|
||||
}
|
||||
.req-modal .modal-title-row { flex: none; margin-bottom: 0; }
|
||||
.req-head { flex: none; color: var(--dim); font-size: 13px; line-height: 1.6; }
|
||||
/* 需求区:10 个维度块(维度名=标题在上,内容在下),双列网格,超高内部滚动 */
|
||||
/* 需求区:一个维度一行(09-02 改:去双列左右卡片 → 单列清单,维度名=左标签 + 内容同行),超高内部滚动 */
|
||||
.req-sheet {
|
||||
flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px;
|
||||
max-height: 290px; overflow: auto; align-content: start; padding: 2px;
|
||||
flex: none; display: grid; grid-template-columns: 1fr; gap: 6px 0;
|
||||
max-height: 340px; overflow: auto; align-content: start; padding: 2px;
|
||||
}
|
||||
.req-field {
|
||||
background: #f6f8fb; border: 1px solid #edf0f4; border-radius: 10px;
|
||||
padding: 7px 11px 8px; min-height: 42px;
|
||||
display: flex; align-items: flex-start; gap: 10px;
|
||||
background: #f6f8fb; border: 1px solid #edf0f4; border-radius: 8px;
|
||||
padding: 6px 10px;
|
||||
}
|
||||
.req-field.empty { background: #fafbfd; }
|
||||
.rf-title { font-size: 12px; color: #7a8494; font-weight: 600; letter-spacing: .2px; margin-bottom: 2px; }
|
||||
.rf-val { font-size: 14px; color: var(--text); line-height: 1.5; word-break: break-word; white-space: pre-wrap; }
|
||||
.rf-title { flex: none; width: 104px; font-size: 12px; color: #7a8494; font-weight: 600; letter-spacing: .2px; line-height: 1.4; padding-top: 3px; }
|
||||
.rf-val { flex: 1; font-size: 14px; color: var(--text); line-height: 1.5; word-break: break-word; white-space: pre-wrap; }
|
||||
.req-field.empty .rf-val { color: #c6ccd6; font-size: 13px; }
|
||||
/* 提交创作确认弹窗 */
|
||||
.req-confirm-label { font-size: 13px; color: var(--dim); margin: 10px 0 6px; }
|
||||
.req-confirm-box {
|
||||
background: #f6f8fb; border: 1px solid #edf0f4; border-radius: 8px;
|
||||
padding: 10px 12px; font-size: 14px; line-height: 1.6; color: var(--text);
|
||||
max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word;
|
||||
}
|
||||
.req-confirm-attach { font-size: 13px; color: var(--primary); margin-top: 8px; }
|
||||
.req-dialog {
|
||||
flex: 1 1 auto; min-height: 130px; overflow: auto;
|
||||
display: flex; flex-direction: column; gap: 6px; padding: 2px;
|
||||
|
||||
Reference in new issue
Block a user