feat(console): 上传媒体行点击=直接切换当前媒体并收起菜单;右侧滑杆才进二级菜单;无媒体时点击自动进二级引导上传
This commit is contained in:
@@ -17510,9 +17510,14 @@ function ConsolePane() {
|
|||||||
};
|
};
|
||||||
const onBg = (m) => {
|
const onBg = (m) => {
|
||||||
if (m === "photo") {
|
if (m === "photo") {
|
||||||
|
if (photoList.length === 0) {
|
||||||
setBgEdit("photo");
|
setBgEdit("photo");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
setBgState("photo");
|
||||||
|
splitEnv?.console?.setBg?.("photo");
|
||||||
|
return;
|
||||||
|
}
|
||||||
setBgState(m);
|
setBgState(m);
|
||||||
splitEnv?.console?.setBg?.(m);
|
splitEnv?.console?.setBg?.(m);
|
||||||
};
|
};
|
||||||
@@ -17800,7 +17805,10 @@ function ConsolePane() {
|
|||||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "dsh-wt_dropGear", title: T("console.bgEdit"), "aria-label": T("console.bgEdit"), onClick: () => setBgEdit("glow"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SliderIcon, {}) })
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "dsh-wt_dropGear", title: T("console.bgEdit"), "aria-label": T("console.bgEdit"), onClick: () => setBgEdit("glow"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SliderIcon, {}) })
|
||||||
] }),
|
] }),
|
||||||
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-wt_dropRow", children: [
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-wt_dropRow", children: [
|
||||||
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: "dsh-wt_dropItem" + (bg === "photo" ? " dsh-wt_dropItemOn" : ""), onClick: () => onBg("photo"), children: [
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: "dsh-wt_dropItem" + (bg === "photo" ? " dsh-wt_dropItemOn" : ""), onClick: () => {
|
||||||
|
onBg("photo");
|
||||||
|
setOpenMenu(null);
|
||||||
|
}, children: [
|
||||||
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { width: "13", height: "13", viewBox: "0 0 16 16", "aria-hidden": true, children: [
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { width: "13", height: "13", viewBox: "0 0 16 16", "aria-hidden": true, children: [
|
||||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "2.5", y: "3.5", width: "11", height: "9", rx: "1.5", fill: "none", stroke: "currentColor", strokeWidth: "1.2" }),
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "2.5", y: "3.5", width: "11", height: "9", rx: "1.5", fill: "none", stroke: "currentColor", strokeWidth: "1.2" }),
|
||||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "5.8", cy: "6.6", r: "1.1", fill: "currentColor" }),
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "5.8", cy: "6.6", r: "1.1", fill: "currentColor" }),
|
||||||
|
|||||||
@@ -1196,8 +1196,10 @@ function ConsolePane() {
|
|||||||
}
|
}
|
||||||
const onBg = (m: 'plain' | 'glow' | 'photo') => {
|
const onBg = (m: 'plain' | 'glow' | 'photo') => {
|
||||||
if (m === 'photo') {
|
if (m === 'photo') {
|
||||||
// 上传照片 → 统一进入二级照片库菜单
|
// 直接切换到当前媒体;没有媒体时才进入二级菜单引导上传
|
||||||
setBgEdit('photo')
|
if (photoList.length === 0) { setBgEdit('photo'); return }
|
||||||
|
setBgState('photo')
|
||||||
|
splitEnv?.console?.setBg?.('photo')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
setBgState(m)
|
setBgState(m)
|
||||||
@@ -1415,7 +1417,7 @@ function ConsolePane() {
|
|||||||
<button type="button" className="dsh-wt_dropGear" title={T('console.bgEdit')} aria-label={T('console.bgEdit')} onClick={() => setBgEdit('glow')}><SliderIcon /></button>
|
<button type="button" className="dsh-wt_dropGear" title={T('console.bgEdit')} aria-label={T('console.bgEdit')} onClick={() => setBgEdit('glow')}><SliderIcon /></button>
|
||||||
</div>
|
</div>
|
||||||
<div className="dsh-wt_dropRow">
|
<div className="dsh-wt_dropRow">
|
||||||
<button type="button" className={'dsh-wt_dropItem' + (bg === 'photo' ? ' dsh-wt_dropItemOn' : '')} onClick={() => onBg('photo')}><svg width="13" height="13" viewBox="0 0 16 16" aria-hidden><rect x="2.5" y="3.5" width="11" height="9" rx="1.5" fill="none" stroke="currentColor" strokeWidth="1.2" /><circle cx="5.8" cy="6.6" r="1.1" fill="currentColor" /><path d="M3.2 11.2l2.8-2.8 2.2 2.2 1.8-1.8 2.8 2.4" fill="none" stroke="currentColor" strokeWidth="1.2" /></svg>{T('console.bgPhoto')}</button>
|
<button type="button" className={'dsh-wt_dropItem' + (bg === 'photo' ? ' dsh-wt_dropItemOn' : '')} onClick={() => { onBg('photo'); setOpenMenu(null) }}><svg width="13" height="13" viewBox="0 0 16 16" aria-hidden><rect x="2.5" y="3.5" width="11" height="9" rx="1.5" fill="none" stroke="currentColor" strokeWidth="1.2" /><circle cx="5.8" cy="6.6" r="1.1" fill="currentColor" /><path d="M3.2 11.2l2.8-2.8 2.2 2.2 1.8-1.8 2.8 2.4" fill="none" stroke="currentColor" strokeWidth="1.2" /></svg>{T('console.bgPhoto')}</button>
|
||||||
<button type="button" className="dsh-wt_dropGear" title={T('console.bgEdit')} aria-label={T('console.bgEdit')} onClick={() => setBgEdit('photo')}><SliderIcon /></button>
|
<button type="button" className="dsh-wt_dropGear" title={T('console.bgEdit')} aria-label={T('console.bgEdit')} onClick={() => setBgEdit('photo')}><SliderIcon /></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user