修复了2个bug

This commit is contained in:
andy committed 2026-09-02 17:02:02 +08:00
1 parent ce8372e878
commit 2a64dc7395
64 files changed
+1050 -39

No files matched your search

@@ -0,0 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[323],{652:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>tW});var n=a(5155),i=a(2115),l=a(7855),r=a(7209),s=a(5299),o=a(8085),c=a(6191),d=a(8514),u=a(5917),m=a(6667),h=a(2583),p=a(9397),g=a(1786),x=a(5229),f=a(6046),b=a(9867),v=a(9559),j=a(3327),y=a(2196),w=a(4274),N=a(3586),k=a(2821),A=a(368),S=a(7937);function C(e){let{page:t,pageSize:a,total:i,label:l="分页",onPageChange:r}=e,s=M(i,a);if(s<=1)return null;let o=z(t,i,a);return(0,n.jsxs)("nav",{className:"pagination","aria-label":l,children:[(0,n.jsx)("button",{className:"icon-button",type:"button",title:"上一页",disabled:o<=1,onClick:()=>r(o-1),children:(0,n.jsx)(A.A,{size:17})}),(0,n.jsxs)("span",{className:"pager-meta",children:[o," / ",s]}),(0,n.jsx)("button",{className:"icon-button",type:"button",title:"下一页",disabled:o>=s,onClick:()=>r(o+1),children:(0,n.jsx)(S.A,{size:17})})]})}function z(e,t,a){return Math.min(Math.max(1,e),M(t,a))}function M(e,t){return Math.max(1,Math.ceil(e/t))}var I=a(3606),E=a(1873),P=a(6577),U=a(4122),T=a(6548),R=a(1360);function D(e){return"/api/assets/".concat(encodeURIComponent(e.id),"/download?inline=1")}function F(e){return"/api/assets/".concat(encodeURIComponent(e.id),"/download")}function O(e){return e.id?D({id:e.id}):e.url}function q(e,t){if(!e)return"";let a=t.find(t=>t.url===e);return a?D(a):e}function L(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"box";return"stroke"===t?"@标记".concat(e):"@标注".concat(e)}function K(e,t){var a;let n=t&&t>0?"图".concat(t):"";return"point"===e.kind&&e.point?"".concat(n,"<point>").concat(_(e.point.x)," ").concat(_(e.point.y),"</point>"):"box"===e.kind&&e.box?"".concat(n,"<bbox>").concat(_(e.box.left)," ").concat(_(e.box.top)," ").concat(_(e.box.right)," ").concat(_(e.box.bottom),"</bbox>"):"stroke"===e.kind&&(null==(a=e.points)?void 0:a.length)?"".concat(n||"图片","中的蓝色标记区域"):""}function B(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.replace(/@(图片|图)(\d+)/g,(e,a,n)=>"图".concat(t?1:Number(n)))}function _(e){return Math.max(0,Math.min(1e3,Math.round(e)))}function J(e,t){return e.sourceKey&&t.get(e.sourceKey)||1}function W(e){var t;return Number((null==(t=e.match(/\d+$/))?void 0:t[0])||0)}function V(e){let{mode:t,sources:a,selectedSources:l,source:r,uploading:o,annotations:c,onAnnotationsChange:d,onSelectSource:m,onToggleSource:h,onUpload:p,onInsertAnnotation:f}=e,[b,v]=(0,i.useState)("box"),[j,w]=(0,i.useState)(null),[N,A]=(0,i.useState)(null),[S,C]=(0,i.useState)(null),[z,M]=(0,i.useState)([]),D=(0,i.useRef)(null),F=et(r),q=(0,i.useMemo)(()=>new Set(l.map(et)),[l]),K=(0,i.useMemo)(()=>new Map(l.map((e,t)=>[et(e),t+1])),[l]),B=(0,i.useMemo)(()=>c.filter(e=>!e.sourceKey||e.sourceKey===F),[c,F]),_=B.find(e=>e.id===S),J=(0,i.useMemo)(()=>c.reduce((e,t)=>Math.max(e,t.index),0)+1,[c]),W=l.length>=10;function V(e){d([...c,{...e,sourceKey:F}]),C(e.id),M([])}(0,i.useEffect)(()=>{w(null),A(null),C(null),M([])},[F,t]),(0,i.useEffect)(()=>{"layers"===t&&"point"===b&&v("box")},[t,b]);let Y=K.get(F)||1;return(0,n.jsxs)("section",{className:(0,k.A)("seedream-workspace","interactive"===t?"interactive":"layers"),"aria-label":"interactive"===t?"Seedream 交互编辑":"Seedream 图层拆分",children:[(0,n.jsxs)("header",{className:"seedream-workspace-head",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"interactive"===t?"精准编辑画布":"指定拆分区域"}),(0,n.jsx)("span",{children:"interactive"===t?"可在最多 10 张图片间切换,使用坐标或蓝色涂鸦描述编辑位置":"可留空自动全拆,也可框选或涂鸦指定希望拆出的元素"})]}),(0,n.jsx)("span",{className:"seedream-model-pill",children:"Seedream 5.0 Pro"})]}),r?(0,n.jsxs)("div",{className:"seedream-editor-shell",children:[(0,n.jsxs)("div",{className:"seedream-editor-toolbar",role:"toolbar","aria-label":"标注工具",children:[(0,n.jsxs)("span",{className:"seedream-current-image-badge",children:["图",Y]}),(0,n.jsxs)("button",{className:(0,k.A)("box"===b&&"active"),type:"button","aria-pressed":"box"===b,title:"框选区域",onClick:()=>v("box"),children:[(0,n.jsx)(I.A,{size:16}),"框选"]}),"interactive"===t?(0,n.jsxs)("button",{className:(0,k.A)("point"===b&&"active"),type:"button","aria-pressed":"point"===b,title:"点选位置",onClick:()=>v("point"),children:[(0,n.jsx)(E.A,{size:16}),"点选"]}):null,(0,n.jsxs)("button",{className:(0,k.A)("brush"===b&&"active"),type:"button","aria-pressed":"brush"===b,title:"蓝色涂鸦标记",onClick:()=>v("brush"),children:[(0,n.jsx)(P.A,{size:16}),"涂鸦"]}),(0,n.jsx)("span",{className:"seedream-editor-toolbar-divider"}),(0,n.jsx)("button",{type:"button",disabled:!B.length,title:"撤销","aria-label":"撤销当前图片的最后一个标注",onClick:function(){let e=B.at(-1);e&&(d(c.filter(t=>t.id!==e.id)),M(t=>[...t,e]),S===e.id&&C(null))},children:(0,n.jsx)(U.A,{size:16})}),(0,n.jsx)("button",{type:"bLine truncated