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:
maogeigei committed 2026-09-02 18:08:24 +08:00
1 parent c40bc228fd
commit 446c5119d2
3 files changed
+51 -11

No files matched your search

@@ -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;