filecat 6.13.0 → 6.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "filecat",
3
- "version": "6.13.0",
3
+ "version": "6.14.1",
4
4
  "description": "FileCat File Browser Server Manager",
5
5
  "author": "xiaobaidadada",
6
6
  "repository": {
@@ -106,7 +106,7 @@
106
106
  "normalize.css": "^8.0.1",
107
107
  "noty": "^3.2.0-beta-deprecated",
108
108
  "pinyin-pro": "^3.28.0",
109
- "pty-shell": "1.5.2",
109
+ "pty-shell": "1.5.3",
110
110
  "react": "^19.2.7",
111
111
  "react-dom": "^19.2.7",
112
112
  "react-i18next": "^17.0.8",
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[3402],{72693(e,n,t){t.d(n,{w:()=>u});var s=t(96540),a=t(22022),c=t(14944),r=t(92275),o=t(34843),d=t(82893),l=t(85997),i=t(74848);function u(){const[e,n]=(0,o.fp)(d.AG.prompt_card),{t}=(0,a.Bd)(),u=(0,s.useRef)([]),f=(0,s.useRef)(!1),m=(0,s.useCallback)(()=>{if(f.current)return;if(0===u.current.length)return f.current=!1,void n({open:!1});f.current=!0;const e=u.current.shift();e?n({open:!0,title:t("命令确认"),cancel:()=>{c.ws.sendData(r.HK.ai_confirm_cmd,{askId:e.askId,approved:!1}),n({open:!1}),f.current=!1,m()},context_div:(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{style:{maxHeight:"60vh",overflow:"auto",whiteSpace:"pre-wrap",wordBreak:"break-all",background:"var(--surfaceSecondary)",padding:"0.75em",borderRadius:"0.5em",marginBottom:"0.75em",fontFamily:"monospace",fontSize:"0.9em",lineHeight:"1.5"},children:e.cmd}),(0,i.jsxs)("div",{style:{display:"flex",gap:"0.5em",justifyContent:"flex-end"},children:[(0,i.jsx)(l.$n,{text:t("拒绝"),color:"var(--red)",clickFun:()=>{c.ws.sendData(r.HK.ai_confirm_cmd,{askId:e.askId,approved:!1}),n({open:!1}),f.current=!1,m()}}),(0,i.jsx)(l.$n,{text:t("允许"),clickFun:()=>{c.ws.sendData(r.HK.ai_confirm_cmd,{askId:e.askId,approved:!0}),n({open:!1}),f.current=!1,m()}})]})]})}):f.current=!1},[t]),h=(0,s.useCallback)(e=>{u.current.push(e),m()},[m]);(0,s.useEffect)(()=>(c.ws.addMsg(r.HK.ai_confirm_cmd,e=>{const n=e.context||{};n.askId&&n.cmd&&h({askId:n.askId,cmd:n.cmd})}),()=>{c.ws.removeMsg(r.HK.ai_confirm_cmd)}),[h]),(0,s.useEffect)(()=>()=>{u.current=[],f.current=!1},[])}},63402(e,n,t){t.r(n),t.d(n,{default:()=>h});var s=t(96540),a=t(97856),c=t(92275),r=t(14944),o=t(34843),d=t(82893),l=t(64405),i=t(40505),u=t(72693),f=t(74848);const m=s.lazy(()=>Promise.all([t.e(2543),t.e(5614)]).then(t.bind(t,85614)));function h(e){const[n,t]=(0,s.useState)(null),[h,p]=(0,o.fp)(d.AG.fileShellShow),[w,k]=(0,o.fp)(d.AG.file_shell_hidden),[_,g]=(0,o.fp)(d.AG.user_base_info),x=_.user_data.theme?.includes("dark")?"#FFFFFF":"#000000";(0,u.w)();const v=()=>{n?.dispose(),t(null)};(0,s.useEffect)(()=>()=>{v()},[]),(0,s.useEffect)(()=>{h.show?n?h.cmd&&r.ws.sendData(c.HK.shell_send,h.cmd):(async()=>{const e=new a.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:x,cursor:x,selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4});let n;const s=n=>{e.write(n)};n=t=>{e.clear(),e.write(t),n=s},await r.ws.addMsg(c.HK.shell_getting,e=>{n(e.context)}),await r.ws.addMsg(c.HK.shell_copy,n=>{n.context&&(0,i.lW)(n.context),e.focus()}),e.onData(async e=>{const n=new c.hf(c.HK.shell_send);n.context=e,await r.ws.send(n)}),t(e)})():v()},[h]);return(0,f.jsx)(m,{show:h.show,file_shell_hidden:w,terminal:n,init:(e,t)=>{n.writeln("open shell... ");const s=new c.hf(c.HK.shell_open),a=new l.n;a.init_path=h.path,a.rows=e,a.cols=t,a.http_token=localStorage.getItem("token"),s.context=a,r.ws.send(s),h.cmd&&r.ws.sendData(c.HK.shell_send,h.cmd)}})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6348],{66348(e,r,t){t.r(r),t.d(r,{default:()=>f});var o=t(96540),s=(t(82893),t(14284)),n=t(62042),i=t(22022),a=t(74848);const d="var(--surfacePrimary, #ffffff)",l="var(--surfaceSecondary, #f1f3f4)",c="var(--divider, rgba(0,0,0,0.08))",p="var(--textPrimary, #202124)",x="var(--textSecondary, #5f6368)",g="var(--primary, #1a73e8)",u="var(--secondary, #34a853)";function f({dir:e,onOpenFile:r,onClose:t}){const{t:f}=(0,i.Bd)(),[y,b]=(0,o.useState)([]),[v,j]=(0,o.useState)(""),[S,k]=(0,o.useState)({exportDir:"",exportTypes:["ts"]}),[m,z]=(0,o.useState)(!1),w=e;(0,o.useEffect)(()=>{C(),$()},[e]);const C=async e=>{try{const r=await s.Si.post("list",{dir:w,search:e||v});0===r.code&&b(r.data)}catch(e){}},$=async()=>{try{const e=await s.Si.post("export_config/load",{dir:w});0===e.code&&e.data&&k(e.data)}catch(e){}},T=y.filter(e=>!v||e.toLowerCase().includes(v.toLowerCase()));return(0,a.jsxs)("div",{style:{position:"fixed",top:0,left:0,width:320,height:"100vh",zIndex:2e3,background:d,color:p,display:"flex",flexDirection:"column",borderRight:`1px solid ${c}`,boxShadow:"2px 0 10px rgba(0,0,0,0.5)"},children:[(0,a.jsxs)("div",{style:{padding:"12px 16px",background:d,borderBottom:`1px solid ${c}`,display:"flex",alignItems:"center",gap:8},children:[(0,a.jsxs)("span",{style:{fontWeight:"bold",color:g,fontSize:14},children:["📋 ",f("配置表")]}),(0,a.jsx)("div",{style:{flex:1}}),(0,a.jsx)("button",{onClick:t,style:{background:"none",border:"none",color:x,cursor:"pointer",fontSize:16},children:"✕"})]}),(0,a.jsx)("div",{style:{padding:"8px 12px"},children:(0,a.jsx)("input",{placeholder:f("搜索文件..."),value:v,onChange:e=>{j(e.target.value),C(e.target.value)},style:{width:"100%",padding:"8px 12px",borderRadius:8,border:`1px solid ${c}`,background:d,color:p,fontSize:13,boxSizing:"border-box"}})}),(0,a.jsxs)("div",{style:{flex:1,overflow:"auto",padding:"0 8px"},children:[T.map(e=>(0,a.jsxs)("div",{onClick:()=>r(e),style:{padding:"10px 12px",cursor:"pointer",borderRadius:8,margin:"2px 0",borderBottom:`1px solid ${c}`,display:"flex",alignItems:"center",gap:8,transition:"background 0.2s"},onMouseEnter:e=>e.currentTarget.style.background=l,onMouseLeave:e=>e.currentTarget.style.background="transparent",children:[(0,a.jsx)("span",{style:{color:g},children:"⚙"}),(0,a.jsxs)("span",{style:{fontSize:13},children:[e,".gcfg"]})]},e)),0===T.length&&(0,a.jsx)("p",{style:{color:x,textAlign:"center",padding:20,fontSize:12},children:f("此目录下没有 .gcfg 文件")})]}),(0,a.jsxs)("div",{style:{padding:"8px 12px",borderTop:`1px solid ${c}`,background:d},children:[(0,a.jsxs)("button",{onClick:()=>z(!m),style:{width:"100%",padding:"8px",borderRadius:8,border:`1px solid ${g}`,background:"transparent",color:g,cursor:"pointer",fontSize:13,marginBottom:m?8:0},children:["⚙ ",f("导出设置")]}),m&&(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{style:{color:x,fontSize:11},children:[f("导出目录"),":"]}),(0,a.jsx)("input",{value:S.exportDir,onChange:e=>k(r=>({...r,exportDir:e.target.value})),placeholder:"/path/to/export",style:{width:"100%",padding:"6px 8px",borderRadius:8,border:`1px solid ${c}`,background:d,color:p,fontSize:12,boxSizing:"border-box",marginTop:2}})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{style:{color:x,fontSize:11},children:[f("导出语言"),":"]}),(0,a.jsx)("div",{style:{display:"flex",gap:8,marginTop:4},children:["ts","go"].map(e=>(0,a.jsxs)("label",{style:{color:p,fontSize:12},children:[(0,a.jsx)("input",{type:"checkbox",checked:S.exportTypes.includes(e),onChange:r=>{const t=r.target.checked?[...S.exportTypes,e]:S.exportTypes.filter(r=>r!==e);k(e=>({...e,exportTypes:t}))}})," ",e.toUpperCase()]},e))})]}),(0,a.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,a.jsxs)("button",{onClick:async()=>{try{const e=await s.Si.post("export_config/save",{dir:w,config:S});0===e.code?(0,n.SK)(f("导出配置已保存")):(0,n.zN)(e.message)}catch(e){(0,n.zN)(e?.message)}},style:h(u),children:["💾 ",f("保存配置")]}),(0,a.jsxs)("button",{onClick:async()=>{if(S.exportDir)try{const e=await s.Si.post("export",{dir:w});if(0===e.code){const{generated:r,errors:t}=e.data;let o=`${f("导出完成")}: ${r.length} ${f("个文件")}`;t.length>0&&(o+=`\n${f("错误")}: ${t.join(", ")}`),(0,n.SK)(o)}else(0,n.zN)(e.message)}catch(e){(0,n.zN)(e?.message)}else(0,n.zN)(f("请先设置导出目录"))},style:h(g),children:["🚀 ",f("一键导出")]})]})]})]})]})}function h(e){return{flex:1,padding:"6px 8px",borderRadius:4,border:`1px solid ${e}`,background:"transparent",color:e,cursor:"pointer",fontSize:12}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8629],{68629(e,t,r){r.r(t),r.d(t,{default:()=>k});var s=r(96540),o=(r(82893),r(14284)),n=r(62042),a=r(22022),i=r(85997),l=r(57952),d=r(52671),c=r(87361),p=r(34289),x=r(2543),u=r(74848);const g="var(--surfacePrimary, #ffffff)",h="var(--surfaceSecondary, #f1f3f4)",f="var(--divider, rgba(0,0,0,0.08))",y="var(--textPrimary, #202124)",v="var(--textSecondary, #5f6368)",b="var(--primary, #1a73e8)",m="var(--primary-light, #d2e3fc)",j="var(--secondary, #34a853)",S=s.lazy(()=>r.e(9762).then(r.bind(r,99762)));function k(){const{t:e}=(0,a.Bd)(),t=(0,d.Zp)(),r=(0,d.zy)(),k=decodeURIComponent((0,p.GG)(c.o.gcfg_page,(0,p.vX)())),[w,C]=(0,s.useState)([]),[$,N]=(0,s.useState)(""),[R,T]=(0,s.useState)(null),[P,_]=(0,s.useState)({exportDir:"",exportTypes:["ts"]}),[L,U]=(0,s.useState)(!1),[D,E]=(0,s.useState)(16),B=(0,s.useRef)(null),I=(0,s.useRef)(null),[A,F]=(0,s.useState)(!1),G=new URLSearchParams(r.search).get("edit")||"";(0,s.useEffect)(()=>{G&&T(G)},[G]),(0,s.useEffect)(()=>{k&&(K(),M())},[k]);const K=async e=>{try{const t=await o.Si.post("list",{dir:k,search:e||$});0===t.code&&C(t.data)}catch(e){}},M=async()=>{try{const e=await o.Si.post("export_config/load",{dir:k});0===e.code&&e.data&&_(e.data)}catch(e){}},W=w.filter(e=>!$||e.toLowerCase().includes($.toLowerCase())),X=(0,s.useCallback)(x.throttle(e=>{const t=parseFloat(getComputedStyle(I.current).fontSize),r=window.innerWidth/t-4,s=e.clientX/t,o=2.25+B.current.offsetWidth/t;s<=r&&s>=o&&E(parseFloat(s.toFixed(2)))},32),[]),Z=()=>{F(!1),I.current.removeEventListener("pointermove",X)};return(0,u.jsxs)("div",{className:"studio",children:[(0,u.jsx)(l.A,{ignore_tags:!0,left_children:[(0,u.jsx)(i.rA,{title:e("取消"),icon:"close",onClick:()=>{t(-1)}},1),(0,u.jsxs)("title",{children:["📋 ",e("配置表")," - ",decodeURIComponent((k.split("/").filter(Boolean).pop()||k).replace(/\/$/,""))]},2)]}),(0,u.jsxs)("div",{className:"studio-body",ref:I,children:[(0,u.jsxs)("div",{className:"studio-nav",style:{width:D-1+"em"},children:[(0,u.jsx)("div",{style:{padding:"8px 12px"},children:(0,u.jsx)("input",{placeholder:e("搜索文件..."),value:$,onChange:e=>{N(e.target.value),K(e.target.value)},style:{width:"100%",padding:"8px 12px",borderRadius:8,border:`1px solid ${f}`,background:g,color:y,fontSize:13,boxSizing:"border-box"}})}),(0,u.jsxs)("div",{style:{flex:1,overflow:"auto",padding:"0 8px"},children:[W.map(e=>(0,u.jsxs)("div",{onClick:()=>(e=>{T(e);const s=new URLSearchParams(r.search);s.set("edit",e),t(`${r.pathname}?${s.toString()}`,{replace:!0})})(e),style:{padding:"10px 12px",cursor:"pointer",borderRadius:8,margin:"2px 0",borderBottom:`1px solid ${f}`,display:"flex",alignItems:"center",gap:8,transition:"background 0.2s",background:R===e?m:"transparent"},onMouseEnter:e=>e.currentTarget.style.background=h,onMouseLeave:t=>t.currentTarget.style.background=R===e?m:"transparent",children:[(0,u.jsx)("span",{style:{color:b},children:"⚙"}),(0,u.jsxs)("span",{style:{fontSize:13},children:[e,".gcfg"]})]},e)),0===W.length&&(0,u.jsx)("p",{style:{color:v,textAlign:"center",padding:20,fontSize:12},children:e("此目录下没有 .gcfg 文件")})]}),(0,u.jsxs)("div",{style:{padding:"8px 12px",borderTop:`1px solid ${f}`,background:g},children:[(0,u.jsxs)("button",{onClick:()=>U(!L),style:{width:"100%",padding:"8px",borderRadius:8,border:`1px solid ${b}`,background:"transparent",color:b,cursor:"pointer",fontSize:13,marginBottom:L?8:0},children:["⚙ ",e("导出设置")]}),L&&(0,u.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[(0,u.jsxs)("div",{children:[(0,u.jsxs)("label",{style:{color:v,fontSize:11},children:[e("导出目录"),":"]}),(0,u.jsx)("input",{value:P.exportDir,onChange:e=>_(t=>({...t,exportDir:e.target.value})),placeholder:"/path/to/export",style:{width:"100%",padding:"6px 8px",borderRadius:8,border:`1px solid ${f}`,background:g,color:y,fontSize:12,boxSizing:"border-box",marginTop:2}})]}),(0,u.jsxs)("div",{children:[(0,u.jsxs)("label",{style:{color:v,fontSize:11},children:[e("导出语言"),":"]}),(0,u.jsx)("div",{style:{display:"flex",gap:8,marginTop:4},children:["ts","go"].map(e=>(0,u.jsxs)("label",{style:{color:y,fontSize:12},children:[(0,u.jsx)("input",{type:"checkbox",checked:P.exportTypes.includes(e),onChange:t=>{const r=t.target.checked?[...P.exportTypes,e]:P.exportTypes.filter(t=>t!==e);_(e=>({...e,exportTypes:r}))}})," ",e.toUpperCase()]},e))})]}),(0,u.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,u.jsxs)("button",{onClick:async()=>{try{const t=await o.Si.post("export_config/save",{dir:k,config:P});0===t.code?(0,n.SK)(e("导出配置已保存")):(0,n.zN)(t.message)}catch(e){(0,n.zN)(e?.message)}},style:z(j),children:["💾 ",e("保存配置")]}),(0,u.jsxs)("button",{onClick:async()=>{if(P.exportDir)try{const t=await o.Si.post("export",{dir:k});if(0===t.code){const{generated:r,errors:s}=t.data;let o=`${e("导出完成")}: ${r.length} ${e("个文件")}`;s.length>0&&(o+=`\n${e("错误")}: ${s.join(", ")}`),(0,n.SK)(o)}else(0,n.zN)(t.message)}catch(e){(0,n.zN)(e?.message)}else(0,n.zN)(e("请先设置导出目录"))},style:z(b),children:["🚀 ",e("一键导出")]})]})]})]})]}),(0,u.jsx)("div",{className:"studio__divider",ref:B,onPointerDown:()=>{F(!0),I.current.addEventListener("pointermove",X)},onPointerUp:Z}),A&&(0,u.jsx)("div",{className:"shell__overlay",onPointerUp:Z}),(0,u.jsx)("div",{className:"studio-editor",children:R?(0,u.jsx)(s.Suspense,{fallback:(0,u.jsx)("div",{}),children:(0,u.jsx)(S,{filePath:`${k}${R}.gcfg`,fileName:`${R}.gcfg`,onClose:()=>{T(null);const e=new URLSearchParams(r.search);e.delete("edit"),t(`${r.pathname}?${e.toString()}`,{replace:!0})}})}):(0,u.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",color:v,flexDirection:"column",gap:12,height:"100%"},children:[(0,u.jsx)("span",{style:{fontSize:48},children:"📋"}),(0,u.jsx)("span",{children:e("从左侧选择一个配置表文件进行编辑")})]})},R||"placeholder")]})]})}function z(e){return{flex:1,padding:"6px 8px",borderRadius:4,border:`1px solid ${e}`,background:"transparent",color:e,cursor:"pointer",fontSize:12}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8714],{47374(e,t,i){i.d(t,{e:()=>f});var o=i(96540),n=i(52671),s=i(64694),a=i(34289),l=i(61443),r=i(75725),c=i(22022),_=i(85997),d=i(74848);function f(e){let t=(0,n.zy)();const[i,f]=(0,o.useState)([]),[p,m]=(0,o.useState)("/"),[h,u]=(0,o.useState)(void 0),{t:w,i18n:v}=(0,c.Bd)();o.useEffect(()=>{let t="",i=(0,a.vX)().split("/");i=i.filter(e=>e);const o=i.indexOf(e.baseRoute),n=[];if(-1!=o){t=(0,s.IO)(i.slice(0,o),e.baseRoute);const a=i.slice(o+1);for(let e=0;e<a.length;e++){const i=a[e];n.push({value:i,href:0===e?`${t}${i}/`:(0,s.IO)(n[e-1].href,i)})}m(t),f(n)}},[t]);const y=t=>{t.stopPropagation(),e.clickFun(t)};return(0,d.jsx)("div",{className:"breadcrumbs",onClick:e=>{u(void 0!==h?void 0:"")},children:(0,d.jsx)(o.Fragment,{children:void 0===h?(0,d.jsxs)(o.Fragment,{children:[(0,d.jsx)("span",{className:"chevron",children:(0,d.jsx)(n.N_,{to:p,onClick:y,children:(0,d.jsx)(_.In,{icon:"home"})})}),i.map((e,t)=>(0,d.jsxs)("span",{className:"chevron",children:[(0,d.jsx)(_.In,{icon:"keyboard_arrow_right"}),(0,d.jsx)(n.N_,{to:e.href,onClick:y,children:decodeURIComponent(e.value)})]},t))]}):(0,d.jsx)(r.QM,{click:()=>{u(void 0)},children:(0,d.jsx)(l.Sm,{width:"100%",placeholder:w("输入跳转的目录"),handlerEnter:t=>{e.input_path_enter&&e.input_path_enter(t),u(void 0)}})})})})}},78714(e,t,i){i.r(t),i.d(t,{default:()=>R});var o=i(96540),n=i(47374),s=i(34843),a=i(82893),l=i(14284),r=i(52671),c=i(57952),_=i(27690),d=i(34289),f=i(53459),p=i(99214),m=i(61443),h=i(47022),u=i(62042),w=i(22022),v=i(7523),y=i(78247),g=i(88815),x=i(6960),k=i(47071),j=i(14944),G=i(92275),A=i(23430);var b=i(34251),C=i(60096),z=i(85997),P=i(23496),F=i(12730),M=i(75725),S=i(70447),$=i(87361),D=i(74848);let X={};function E(){const{t:e}=(0,w.Bd)();let t=(0,r.zy)();const i=(0,r.Zp)(),{check_user_auth:n}=(0,y.MH)(),[c,f]=(0,s.fp)(a.AG.nowFileList),[m,g]=(0,s.fp)(a.AG.uploadFiles),[x,k]=(0,s.fp)(a.AG.showPrompt),[C,P]=(0,s.fp)(a.AG.selectedFileList),[E,I]=(0,s.fp)(a.AG.copyedFileList),[K,Y]=(0,s.fp)(a.AG.cutedFileList),[L,H]=(0,s.fp)(a.AG.selectedFileList),[N,R]=(0,s.fp)(a.AG.clickFileList),[W,B]=(0,s.fp)(a.AG.fileShellShow),[U,O]=(0,s.fp)(a.AG.file_root_list),[Z,q]=(0,s.fp)(a.AG.file_root_index),[V,T]=(0,o.useState)(void 0),[J,Q]=(0,o.useState)(""),[ee,te]=(0,s.fp)(a.AG.workflow_show),[ie,oe]=(0,s.fp)(a.AG.workflow_realtime_show),[ne,se]=(0,s.fp)(a.AG.work_flow_show),{initUserInfo:ae}=(0,o.useContext)(v.F),[le,re]=(0,s.fp)(a.AG.user_base_info),{click_file:ce}=(0,y.kZ)(),[_e,de]=(0,s.fp)(a.AG.prompt_card),fe=(0,o.useMemo)(()=>c.files.reduce((e,t)=>e+(t.type!==h.Iw.folder?1:0),0),[c]),pe=(0,o.useMemo)(()=>c.files.reduce((e,t)=>e+(t.type===h.Iw.folder?1:0),0)+(c.folders?.length??0),[c]);function me(e){(0,u.SK)(e)}(0,o.useEffect)(()=>{X={}},[t]),(0,o.useEffect)(()=>()=>{B({show:!1,path:""})},[]);const he=(0,p.Vs)(),ue=t=>{de({open:!0,title:e("信息"),context_div:(0,D.jsxs)("div",{style:{maxWidth:"25rem"},children:[(0,D.jsx)(M.Yh,{left:e("挂载位置磁盘"),right:t?.total_size}),(0,D.jsx)(M.Yh,{left:`${e("磁盘剩余")}`,right:t?.left_size}),(0,D.jsx)(M.Yh,{left:`${e("文件系统")}`,right:t?.fs_type}),(0,D.jsx)(M.Yh,{left:`${e("文件夹数")}`,right:pe}),(0,D.jsx)(M.Yh,{left:`${e("文件数")}`,right:fe}),(0,D.jsx)(M.Yh,{left:`${e("当前位置")}`,right:(0,D.jsx)(S.xP,{context:t?.now_absolute_path})})]}),cancel:()=>{j.ws.removeMsg(G.HK.file_info)}})};return(0,D.jsxs)(o.Fragment,{children:[C.length>0&&(0,D.jsx)(z.rA,{icon:"delete",title:e("删除"),onClick:()=>{k({show:!0,type:_.PromptEnum.FilesDelete,overlay:!0,data:{}})}}),C.length>0&&(0,D.jsx)(z.rA,{icon:"content_copy",title:e("复制"),onClick:function(){const e=(0,p.ib)(c,C);I(e.map(e=>(0,p.Ok)(e.name))),Y([]),me("已复制")}}),C.length>0&&(0,D.jsx)(z.rA,{icon:"content_cut",title:e("剪切"),onClick:function(){const e=(0,p.ib)(c,C);Y(e.map(e=>(0,p.Ok)(e.name))),I([]),me("已剪切")}}),(E.length>0||K.length>0)&&(0,D.jsx)(z.rA,{onClick:function(){k({show:!0,type:_.PromptEnum.Confirm,overlay:!0,data:{}})},icon:"content_paste",title:e("粘贴到此处"),tip:E.length+K.length}),C.length>0&&(0,D.jsx)(z.rA,{icon:"download",title:e("下载"),onClick:function(){const e=(0,p.ib)(c,C);for(let t=0;t<e.length;t++){const i=e[t];e[t]=encodeURIComponent((0,p.Ok)(i.name))}const t=l.$M.getDownloadUrl(e);window.open(t)}}),C.length>0&&(0,D.jsx)(z.rA,{icon:"compress",title:e("压缩"),onClick:function(){const e=(0,p.ib)(c,C);for(let t=0;t<e.length;t++){const i=e[t];e[t]=(0,p.Ok)(i.name)}e&&0!==e.length?k({show:!0,type:_.PromptEnum.Compress,overlay:!0,data:{files:e}}):(0,u.zN)("没有选中")}}),1===C.length&&(0,D.jsx)(z.rA,{icon:"edit_attributes",title:e("重命名"),onClick:function(){k({show:!0,type:_.PromptEnum.FileRename,overlay:!0,data:{}})}}),ne&&(0,D.jsx)(z.rA,{icon:"api",title:"workflow",onClick:()=>{te(!ee)}}),(0,D.jsx)(z.rA,{icon:"terminal",title:"shell",onClick:function(){W.show?B({show:!1,path:""}):B({show:!0,path:(0,d.GG)("file",(0,d.vX)())})}}),n(A.oV.share_file)&&(0,D.jsx)(z.rA,{icon:"share",title:e("文件分享"),onClick:()=>{i(`/${$.o.share_list_setting_page}`)}}),(0,D.jsx)(z.rA,{icon:"grid_view",title:e("切换样式"),onClick:he}),(0,D.jsx)(z.rA,{icon:"create_new_folder",title:e("创建文件夹"),onClick:function(){k({show:!0,type:_.PromptEnum.DirNew,overlay:!0,data:{dir:(0,d.GG)("file",(0,d.vX)())}})}}),(0,D.jsx)(z.rA,{icon:"note_add",title:e("创建文本文件"),onClick:function(){k({show:!0,type:_.PromptEnum.FileNew,overlay:!0,data:{dir:(0,d.GG)("file",(0,d.vX)())}})}}),(0,D.jsx)(z.rA,{icon:"upload_file",title:e("上传"),onClick:()=>{k({show:!0,type:_.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let i=!!t[0].webkitRelativePath;const o=[],n=new Set;for(let e=0;e<t.length;e++){const s=t[e],a=i?s.webkitRelativePath:`${s.webkitRelativePath}${s.name}`;s.fullPath=a,i&&n.add((0,F.S)(a)),o.push(s)}const s=[];if(i)for(const e of n)s.push({isDir:!0,fullPath:e,name:e});s.push(...o),g(s),k({show:!0,type:_.PromptEnum.FilesUpload,overlay:!1,data:{}})}}})}}),(0,D.jsx)(z.rA,{icon:"info",title:e("信息"),onClick:async()=>{let e;if(!X.now_absolute_path){j.ws.addMsg(G.HK.file_info,t=>{const i=t.context;e&&(X={...X,...i},j.ws.removeMsg(G.HK.file_info),ue(X))});const t=await j.ws.sendData(G.HK.file_info,{type:h.Iw.folder,path:(0,d.GG)("file",(0,d.vX)())});e=t.context,X=e,ue(X)}ue(X)}}),(0,D.jsx)(z.rA,{icon:"more_vert",title:e("切换目录"),onClick:t=>{const o=new b.ik;o.x=t.clientX,o.y=t.clientY,o.type=h.Iw.directory,o.items=U,o.item_pre_value=Z,o.textClick=async t=>{if(-1===t)return i(`/${$.o.setting_private_env_setting}`),k({data:void 0,overlay:!1,type:"",show:!1}),void(0,u.N9)(e("请配置 文件夹路径"));(async e=>{q(e),await l.$M.post("base_switch",{root_index:e}),await ae(),i("/file/"),H([]),R([])})(t),k({data:void 0,overlay:!1,type:"",show:!1})},k({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:o})}})]})}var I=i(2543),K=i(21499),Y=i(64694);const L=o.lazy(()=>Promise.all([i.e(7856),i.e(6349),i.e(3659)]).then(i.bind(i,63659))),H=o.lazy(()=>Promise.all([i.e(7856),i.e(1636)]).then(i.bind(i,81636)));let N;function R(){const[e,t]=(0,s.fp)(a.AG.editorSetting),[i,u]=(0,s.fp)(a.AG.file_preview),{t:F}=(0,w.Bd)();let M=(0,r.zy)();const S=(0,r.Zp)(),[X,R]=(0,s.fp)(a.AG.nowFileList),[W,B]=(0,s.fp)(a.AG.showPrompt),[U,O]=(0,s.fp)(a.AG.selectedFileList),[Z,q]=(0,s.fp)(a.AG.clickFileList),[V,T]=(0,s.fp)(a.AG.fileShellShow),[J,Q]=(0,o.useState)(""),[ee,te]=(0,s.fp)(a.AG.workflow_show),[ie,oe]=(0,s.fp)(a.AG.workflow_realtime_show),[ne,se]=(0,s.fp)(a.AG.work_flow_show),{initUserInfo:ae}=(0,o.useContext)(v.F),[le,re]=(0,s.fp)(a.AG.user_base_info),{click_file:ce}=(0,y.kZ)(),[_e,de]=(0,s.fp)(a.AG.to_running_files),[fe,pe]=(0,s.fp)(a.AG.file_page),[me]=(0,s.fp)(a.AG.blank_search_mode),[he,ue]=(0,s.fp)(a.AG.blank_search_mode_for_temp),we=function(){const[e,t]=(0,s.fp)(a.AG.user_base_info),{t:i}=(0,w.Bd)(),{check_user_auth:n}=(0,y.MH)(),[c,f]=(0,s.fp)(a.AG.router_jump),m=(0,r.Zp)(),{initUserInfo:u}=(0,o.useContext)(v.F),[g,x]=(0,s.fp)(a.AG.nowFileList),[k,C]=(0,s.fp)(a.AG.showPrompt),[z,F]=(0,s.fp)(a.AG.fileShellShow),[M,S]=(0,s.fp)(a.AG.blank_search_mode);return t=>{t.preventDefault(),t.stopPropagation();const o=new b.ik;o.x=t.clientX,o.y=t.clientY,o.type=h.Iw.directory;const s=[{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type===A.t8.time_minx_max?"green":void 0},children:i("时间逆序")}),v:A.t8.time_minx_max},{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type===A.t8.time_max_min?"green":void 0},children:i("时间顺序")}),v:A.t8.time_max_min}],a=[{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type===A.t8.size_min_max?"green":void 0},children:i("大小顺序")}),v:A.t8.size_min_max},{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type===A.t8.size_max_min?"green":void 0},children:i("大小逆序")}),v:A.t8.size_max_min}],r=[{r:(0,D.jsx)("span",{style:{color:e.user_data.file_list_pagination_mode&&e.user_data.file_list_pagination_mode!==A.yM.all?void 0:"green"},children:i("全部加载文件")}),v:A.yM.all},{r:(0,D.jsx)("span",{style:{color:e.user_data.file_list_pagination_mode===A.yM.pagination?"green":void 0},children:i("分页滚动加载文件")}),v:A.yM.pagination}],c=[{r:(0,D.jsx)("span",{style:{color:e.user_data.file_time_show_type&&e.user_data.file_time_show_type!==A.KD.current?void 0:"green"},children:i("最近时间")}),v:A.KD.current},{r:(0,D.jsx)("span",{style:{color:e.user_data.file_time_show_type===A.KD.time?"green":void 0},children:i("准确时间")}),v:A.KD.time}],w=[{r:i("文件列表展示"),items:[{r:i("文件排序"),v:"",items:[{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type?void 0:"green"},children:i("系统默认")}),v:A.t8.defualt},{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type===A.t8.name?"green":void 0},children:i("名字")}),v:A.t8.name},{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type===A.t8.time_minx_max||e.user_data.dir_show_type===A.t8.time_max_min?"green":void 0},children:i("修改时间")}),v:!1,items:s},{r:(0,D.jsx)("span",{style:{color:e.user_data.dir_show_type===A.t8.size_min_max||e.user_data.dir_show_type===A.t8.size_max_min?"green":void 0},children:i("文件大小")}),v:!1,items:a}]},{r:i("文件加载方式"),v:"",items:r},{r:i("时间展示"),v:"",items:c},{r:i("缩放调整"),v:"zoom_adjust"},{r:(0,D.jsx)("span",{style:{color:M?"green":void 0},children:i("以空白搜索模式打开目录")}),v:"blank_search_mode"}]},{r:i("以配置表方式打开目录"),v:"gcfg_dir_config"}];n(A.oV.code_resource)&&w.push({r:i("添加http资源根目录"),v:"code_resource"}),n(A.oV.http_proxy)&&w.push({r:i("在此目录下载http资源"),v:"http_resource"}),e?.user_data?.quick_cmd&&(0,p.LL)([...e.user_data.quick_cmd],w),o.items=w,o.textClick=async e=>{if(console.log(e),!1===e)return;const t={};if("gcfg_dir_config"===e){const e=(0,d.GG)("file",(0,d.vX)());return C({data:void 0,overlay:!1,type:"",show:!1}),void m(`/${$.o.gcfg_page}/${encodeURIComponent(e)}`)}if("code_resource"===e){const e=await j.ws.sendData(G.HK.file_info,{path:(0,d.GG)("file",(0,d.vX)())});return f({page_self_router_api_data:[`/api/${Date.now()}`,e.context.now_absolute_path]}),C({data:void 0,overlay:!1,type:"",show:!1}),void m("/setting/customer_router/")}if("http_resource"===e){const e=await j.ws.sendData(G.HK.file_info,{path:(0,d.GG)("file",(0,d.vX)())});return f({http_download_map_path:e.context.now_absolute_path}),C({data:void 0,overlay:!1,type:"",show:!1}),void m("/proxy/http/")}if("zoom_adjust"===e)return C({data:void 0,overlay:!1,type:"",show:!1}),void setTimeout(()=>{C({show:!0,type:_.PromptEnum.ZoomAdjust,overlay:!1,data:{}})},0);if("object"==typeof e&&"quick_cmd"===e.tag){let t=e.cmd;t&&(t.endsWith("\r")||(t+="\r",F({show:!0,path:(0,d.GG)("file",(0,d.vX)()),cmd:t})))}else{if("blank_search_mode"===e)return S(!M),void C({data:void 0,overlay:!1,type:"",show:!1});if(e===A.yM.all||e===A.yM.pagination)t.is_pagination_mode=!0;else if(e===A.KD.current||e===A.KD.time)t.is_file_show_type=!0;else{if(e!==A.t8.defualt&&e!==A.t8.name&&e!==A.t8.size_max_min&&e!==A.t8.size_min_max&&e!==A.t8.time_max_min&&e!==A.t8.time_minx_max)return;t.is_dir_list_type=!0}}await l.wm.post(P.s.user_save_private_attr,{type:e,...t}),await u(),C({data:void 0,overlay:!1,type:"",show:!1}),m((0,d.vX)())},C({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:o})}}(),ve=async()=>{const e=new k.Nd;e.dir_path=`${(0,d.GG)("file",(0,d.vX)())}`,j.ws.addMsg(G.HK.workflow_realtime,e=>{const t=e.context;if(e.context){for(const e of t.sucess_file_list)(0,p.Ys)(e);for(const e of t.failed_file_list)(0,p.V$)(e);de(new Set(t.running_file_list))}}),await j.ws.sendData(G.HK.workflow_realtime,e)},ye=async e=>{let t=!1;for(const i of e.files??[])i.origin_size=i.size,i.size=(0,g.v7)(i.size),le.user_data.file_time_show_type===A.KD.time?i.show_mtime=i.mtime?(0,K.Yq)(i.mtime):"":i.show_mtime=i.mtime?(0,x.s)(i.mtime):"",t||!i.name.endsWith(".workflow.yml")&&!i.name.endsWith(".act")||(t=!0,Promise.resolve().then(()=>{ve()})),i.name===k.SB&&(t=!0);for(const i of e.folders??[])le.user_data.file_time_show_type===A.KD.time?i.show_mtime=i.mtime?(0,K.Yq)(i.mtime):"":i.show_mtime=i.mtime?(0,x.s)(i.mtime):"",i.name===k.SB&&(t=!0);se(t)};(0,o.useEffect)(()=>async()=>{de(new Set)},[]);const ge=()=>{(async()=>{const e=(0,d.GG)("file",(0,d.vX)());if(me||he)return;let t;if(le.user_data.file_list_pagination_mode===A.yM.pagination){if(fe.page_num<0)return;t=await l.$M.post("file_get_page",{param_path:e,page_num:fe.page_num,page_size:fe.page_size});const i=t.data;i.files?.length||pe({page_size:fe.page_size,page_num:-1}),i.files=(0,I.cloneDeep)([...X.files,...i.files])}else t=await l.$M.get(e);if(t.code!==f.m.Success)return;const i=t.data;(0,p.yC)(i,le.user_data.dir_show_type),ye(t.data),R(t.data),N=t.data})(),t({open:!1}),u({open:!1}),se(!1)};(0,o.useEffect)(()=>{ge()},[M,fe]);const xe=e=>{e.target===e.currentTarget&&(O([]),q([]))};return(0,D.jsxs)(o.Fragment,{children:[(0,D.jsxs)(c.A,{left_children:(0,D.jsx)(m.$Z,{handleEnterPress:async()=>{if(me||he){if(O([]),q([]),!J||!J.trim())return void R({files:[],folders:[]});const e=(0,d.GG)("file",(0,d.vX)()),t=await l.$M.post("file_get_page",{param_path:e,page_num:1,page_size:1e4,search:J.trim()});if(t.code!==f.m.Success)return;const i=t.data;return(0,p.yC)(i,le.user_data.dir_show_type),ye(i),R(i),void(N=i)}if(!N)return;O([]),q([]);const e=[],t=[];for(const t of N.files??[])t.name.includes(J)&&e.push(t);for(const e of N.folders??[])e.name.includes(J)&&t.push(e);R({files:e,folders:t})},placeholder:F("搜索当前目录"),icon:"search",value:"",handleInputChange:e=>{Q(e)},max_width:"25em"}),children:[(0,D.jsx)("div",{className:"mobile-context-btn",children:(0,D.jsx)(z.rA,{icon:"more_horiz",title:F("右键"),onClick:()=>{const e=U[U.length-1];if(void 0!==e){const t=[...X.folders??[],...X.files??[]][e];if(t){const i=document.querySelectorAll(".item")[e],o=i?i.getBoundingClientRect():{left:window.innerWidth/2,bottom:100},n={preventDefault:()=>{},stopPropagation:()=>{},clientX:o.left+10,clientY:o.bottom??100},s=new b.ik;s.path=(0,Y.IO)((0,d.vX)(),t.name),s.filename=t.name,s.x=n.clientX,s.y=n.clientY,s.type=t.type===h.Iw.folder?h.Iw.folder:(0,b.uL)(t.name),s.size=t.origin_size,B({show:!0,type:_.PromptEnum.FileMenu,overlay:!1,data:s})}}else{const e={preventDefault:()=>{},stopPropagation:()=>{},clientX:window.innerWidth/2,clientY:window.innerHeight/2};we(e)}}})}),(0,D.jsx)(E,{})]}),(0,D.jsx)(n.e,{baseRoute:"file",clickFun:function(){O([]),q([])},input_path_enter:e=>{var t;!function(e){return"string"==typeof e&&(/^[a-zA-Z]:[\\\/]/.test(e)||/^\//.test(e))}(e)?S(function(e,t){let i=function(e){let t="\\";for(const i of e)if("/"===i||"\\"===i){t=i;break}return t}(e);if("."===t)return e;if(".."===t){if(e.length>1){let t=e[e.length-1]===i?1:0;for(let o=e.length-1-t;o>=0;o--)if(e[o]===i)return e.substring(0,o+1)}return e}return e.endsWith(i)&&t.startsWith(i)?e.slice(0,-1)+t:e.endsWith(i)||t.startsWith(i)?e+t:e+i+t}((0,d.vX)(),e)):(e=e.replace(0===(t=le.user_data).folder_item_now||void 0===t.folder_item_now?t.cwd:t.folder_items[t.folder_item_now-1].path,""),S(e)),O([]),q([]),R({files:[],folders:[]})}}),le.user_data.file_list_pagination_mode===A.yM.pagination?(0,D.jsx)(C.$J,{handleContextMenu:we,clickBlank:xe,list:X.files}):(0,D.jsx)(C.t$,{handleContextMenu:we,file_list:X.files,folder_list:X.folders,clickBlank:xe}),ee&&(0,D.jsx)(L,{}),ie.open&&(0,D.jsx)(H,{})]})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[9223],{79223(e,n,l){l.r(n),l.d(n,{default:()=>d});var s=l(96540),c=l(34843),i=l(82893),a=(l(22022),l(74848));const f=s.lazy(()=>l.e(9762).then(l.bind(l,99762))),t=s.lazy(()=>l.e(6348).then(l.bind(l,66348)));function d(){const[e,n]=(0,c.fp)(i.AG.gcfg_editor),[l,d]=(0,c.fp)(i.AG.gcfg_dir_config),[p,o]=(0,s.useState)(null),r=e=>{n({open:!0,path:`${l.dir}/${e}.gcfg`,name:`${e}.gcfg`})};return e.open?(0,a.jsx)(s.Suspense,{fallback:(0,a.jsx)("div",{}),children:(0,a.jsx)(f,{})}):l.open?(0,a.jsx)(s.Suspense,{fallback:(0,a.jsx)("div",{}),children:(0,a.jsx)(t,{dir:l.dir,onOpenFile:r,onClose:()=>d({open:!1})})}):null}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[9762],{99762(e,t,r){r.r(t),r.d(t,{default:()=>Z});var n=r(96540),l=r(34843),s=r(82893),i=r(14284),a=r(62042),o=r(22022),d=r(5275);const c={surface:"var(--surfacePrimary, #ffffff)",surface2:"var(--surfaceSecondary, #f1f3f4)",border:"var(--divider, rgba(0,0,0,0.08))",text:"var(--textPrimary, #202124)",text2:"var(--textSecondary, #5f6368)",primary:"var(--primary, #1a73e8)",primaryLight:"var(--primary-light, #d2e3fc)",green:"var(--secondary, #34a853)",red:"var(--accent, #ea4335)",yellow:"var(--warning, #fbbc04)"},x=[{value:d.V.Dict,label:"字典(Dict)"},{value:d.V.TwoDim,label:"二维表(TwoDim)"},{value:d.V.Const,label:"常量(Const)"}],p=[{value:d.S.String,label:"字符串"},{value:d.S.Number,label:"数字"},{value:d.S.Boolean,label:"布尔"}];function h(e){return/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(e)}const y={color:c.text2,fontSize:13,marginRight:4},u={padding:"6px 10px",borderRadius:8,border:`1px solid ${c.border}`,background:c.surface,color:c.text,fontSize:13},m={padding:"4px 8px",borderRadius:4,border:`1px solid ${c.border}`,background:c.surface,color:c.text,fontSize:12,width:"100%",boxSizing:"border-box",minWidth:80},g={width:"100%",borderCollapse:"collapse",border:`1px solid ${c.border}`,fontSize:13},f={padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${c.border}`,color:c.primary,fontWeight:"bold"},j={padding:"4px 8px",borderBottom:`1px solid ${c.border}`,color:c.text},v={padding:"6px 12px",borderRadius:8,border:`1px solid ${c.green}`,background:"transparent",color:c.green,cursor:"pointer",fontSize:12},b={padding:"4px 8px",borderRadius:8,border:`1px solid ${c.red}`,background:"transparent",color:c.red,cursor:"pointer",fontSize:11};function S(e,t){return{padding:"6px 16px",border:`1px solid ${t||(e?c.primary:c.border)}`,borderRadius:8,background:e?c.primaryLight:"transparent",color:e?c.primary:t||c.text2,cursor:"pointer",fontSize:13}}var N=r(74848);function k({cfg:e,updateConfig:t,t:r}){const l=e.dict,s=function(e){if(0===e.length||"id"!==e[0].enName)return[{enName:"id",desc:"编号",valueType:d.S.String},...e.filter(e=>"id"!==e.enName)];const t=e[0];if(t.valueType!==d.S.String||"编号"!==t.desc)return[{...t,desc:"编号",valueType:d.S.String},...e.slice(1).filter(e=>"id"!==e.enName)];return e}(l.keys);s!==l.keys&&t({dict:{keys:s}});const[i,a]=(0,n.useState)(""),[o,x]=(0,n.useState)(""),[m,S]=(0,n.useState)(d.S.String),k=e=>{t({dict:{...l,...e}})};return(0,N.jsxs)("div",{children:[(0,N.jsx)("h3",{style:{color:c.primary,marginTop:0},children:r("字典(Dict) 表结构")}),(0,N.jsx)("p",{style:{color:c.text2,fontSize:12,marginBottom:16},children:r("字典表:第一列固定为「编号」(id),类型为字符串。可添加更多列并选择类型。每行数据填写各列的值。")}),(0,N.jsx)("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:16},children:(0,N.jsxs)("label",{children:[(0,N.jsxs)("span",{style:y,children:[r("英文表名"),": "]}),(0,N.jsx)("input",{value:e.enName,onChange:e=>t({enName:e.target.value}),placeholder:"CamelCaseName",style:u})]})}),(0,N.jsxs)("h4",{style:{color:c.text},children:[r("列定义")," (",s.length,")"]}),(0,N.jsxs)("table",{style:g,children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{style:{background:c.primaryLight},children:[(0,N.jsx)("th",{style:f,children:r("中文名")}),(0,N.jsx)("th",{style:f,children:r("英文名(变量名)")}),(0,N.jsx)("th",{style:f,children:r("类型")}),(0,N.jsx)("th",{style:f,children:r("操作")})]})}),(0,N.jsx)("tbody",{children:s.map((e,t)=>(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:j,children:0===t?(0,N.jsxs)("span",{style:{fontWeight:"bold",color:c.primary},children:["🔒 ",e.desc]}):e.desc}),(0,N.jsx)("td",{style:j,children:(0,N.jsx)("span",{style:{color:h(e.enName)?c.green:c.red,fontFamily:"monospace"},children:e.enName||"(空)"})}),(0,N.jsx)("td",{style:j,children:0===t?(0,N.jsx)("span",{style:{color:c.text2,fontSize:12},children:"字符串 (固定)"}):(0,N.jsx)("select",{value:e.valueType,onChange:t=>{return r=e.enName,n=t.target.value,void("id"!==r&&k({keys:s.map(e=>e.enName===r?{...e,valueType:n}:e)}));var r,n},style:{...u,padding:"2px 6px",fontSize:12},children:p.map(e=>(0,N.jsx)("option",{value:e.value,children:e.label},e.value))})}),(0,N.jsx)("td",{style:j,children:0===t?(0,N.jsx)("span",{style:{color:c.text2,fontSize:11},children:r("固定列")}):(0,N.jsx)("button",{onClick:()=>{var t;"id"!==(t=e.enName)?k({keys:s.filter(e=>e.enName!==t)}):alert(r("编号列不可删除"))},style:b,children:"✕"})})]},e.enName))})]}),(0,N.jsxs)("div",{style:{display:"flex",gap:8,marginTop:12,alignItems:"center",flexWrap:"wrap"},children:[(0,N.jsx)("input",{placeholder:r("中文名"),value:o,onChange:e=>x(e.target.value),style:u}),(0,N.jsx)("input",{placeholder:r("英文名(必需,如 heroId)"),value:i,onChange:e=>a(e.target.value),style:u}),(0,N.jsx)("select",{value:m,onChange:e=>S(e.target.value),style:u,children:p.map(e=>(0,N.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,N.jsxs)("button",{onClick:()=>{if(!o.trim()||!i.trim())return;if(!h(i.trim()))return void alert(r("英文名不符合变量命名规范"));if(s.find(e=>e.enName===i.trim()))return void alert(r("该英文名已存在"));const e={enName:i.trim(),desc:o.trim(),valueType:m};k({keys:[...s,e]}),a(""),x(""),S(d.S.String)},style:v,children:["+ ",r("添加列")]})]})]})}function C({cfg:e,updateConfig:t,t:r}){const l=e.twoDim,[s,i]=(0,n.useState)(""),[a,o]=(0,n.useState)(""),[d,x]=(0,n.useState)(""),[m,S]=(0,n.useState)(""),k=e=>{t({twoDim:{...l,...e}})};return(0,N.jsxs)("div",{children:[(0,N.jsx)("h3",{style:{color:c.primary,marginTop:0},children:r("二维表(TwoDim) 表结构")}),(0,N.jsx)("p",{style:{color:c.text2,fontSize:12,marginBottom:16},children:r("二维表:X 轴 keys(列头)× Y 轴 keys(行头),用户在表格中填入对应的 value。")}),(0,N.jsx)("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:16},children:(0,N.jsxs)("label",{children:[(0,N.jsxs)("span",{style:y,children:[r("英文表名"),": "]}),(0,N.jsx)("input",{value:e.enName,onChange:e=>t({enName:e.target.value}),placeholder:"CamelCaseName",style:u})]})}),(0,N.jsx)("div",{style:{marginBottom:16},children:(0,N.jsxs)("label",{children:[(0,N.jsxs)("span",{style:y,children:[r("Value 类型"),": "]}),(0,N.jsx)("select",{value:l.valueType,onChange:e=>k({valueType:e.target.value}),style:u,children:p.map(e=>(0,N.jsx)("option",{value:e.value,children:e.label},e.value))})]})}),(0,N.jsxs)("div",{style:{marginBottom:20},children:[(0,N.jsxs)("h4",{style:{color:c.text},children:[r("X 轴 Keys(列头)")," (",l.xKeys.length,")",(0,N.jsx)("span",{style:{color:c.text2,fontSize:11,marginLeft:8},children:r("每个 X key 类型为 string,都展示在列头")})]}),(0,N.jsxs)("table",{style:g,children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{style:{background:c.primaryLight},children:[(0,N.jsx)("th",{style:f,children:r("中文名")}),(0,N.jsx)("th",{style:f,children:r("英文名")}),(0,N.jsx)("th",{style:f,children:r("类型")}),(0,N.jsx)("th",{style:f,children:r("操作")})]})}),(0,N.jsxs)("tbody",{children:[l.xKeys.map(e=>(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:j,children:e.desc}),(0,N.jsx)("td",{style:j,children:(0,N.jsx)("span",{style:{fontFamily:"monospace",color:c.primary},children:e.enName})}),(0,N.jsx)("td",{style:j,children:"string"}),(0,N.jsx)("td",{style:j,children:(0,N.jsx)("button",{onClick:()=>{return t=e.enName,void k({xKeys:l.xKeys.filter(e=>e.enName!==t)});var t},style:b,children:"✕"})})]},e.enName)),0===l.xKeys.length&&(0,N.jsx)("tr",{children:(0,N.jsx)("td",{colSpan:4,style:{...j,textAlign:"center",color:c.text2},children:r("暂无 X 轴 key")})})]})]}),(0,N.jsxs)("div",{style:{display:"flex",gap:8,marginTop:8,alignItems:"center"},children:[(0,N.jsx)("input",{placeholder:r("中文名"),value:a,onChange:e=>o(e.target.value),style:u}),(0,N.jsx)("input",{placeholder:r("英文名(如 heroId)"),value:s,onChange:e=>i(e.target.value),style:u}),(0,N.jsxs)("button",{onClick:()=>{if(!a.trim()||!s.trim())return;if(!h(s.trim()))return void alert(r("英文名不符合变量命名规范"));if(l.xKeys.find(e=>e.enName===s.trim()))return void alert(r("该英文名已存在"));const e={enName:s.trim(),desc:a.trim()};k({xKeys:[...l.xKeys,e]}),i(""),o("")},style:v,children:["+ ",r("添加 X Key")]})]})]}),(0,N.jsxs)("div",{children:[(0,N.jsxs)("h4",{style:{color:c.text},children:[r("Y 轴 Keys(行头)")," (",l.yKeys.length,")",(0,N.jsx)("span",{style:{color:c.text2,fontSize:11,marginLeft:8},children:r("每个 Y key 类型为 string,都展示在行头")})]}),(0,N.jsxs)("table",{style:g,children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{style:{background:c.primaryLight},children:[(0,N.jsx)("th",{style:f,children:r("中文名")}),(0,N.jsx)("th",{style:f,children:r("英文名")}),(0,N.jsx)("th",{style:f,children:r("类型")}),(0,N.jsx)("th",{style:f,children:r("操作")})]})}),(0,N.jsxs)("tbody",{children:[l.yKeys.map(e=>(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:j,children:e.desc}),(0,N.jsx)("td",{style:j,children:(0,N.jsx)("span",{style:{fontFamily:"monospace",color:c.primary},children:e.enName})}),(0,N.jsx)("td",{style:j,children:"string"}),(0,N.jsx)("td",{style:j,children:(0,N.jsx)("button",{onClick:()=>{return t=e.enName,void k({yKeys:l.yKeys.filter(e=>e.enName!==t)});var t},style:b,children:"✕"})})]},e.enName)),0===l.yKeys.length&&(0,N.jsx)("tr",{children:(0,N.jsx)("td",{colSpan:4,style:{...j,textAlign:"center",color:c.text2},children:r("暂无 Y 轴 key")})})]})]}),(0,N.jsxs)("div",{style:{display:"flex",gap:8,marginTop:8,alignItems:"center"},children:[(0,N.jsx)("input",{placeholder:r("中文名"),value:m,onChange:e=>S(e.target.value),style:u}),(0,N.jsx)("input",{placeholder:r("英文名(如 itemId)"),value:d,onChange:e=>x(e.target.value),style:u}),(0,N.jsxs)("button",{onClick:()=>{if(!m.trim()||!d.trim())return;if(!h(d.trim()))return void alert(r("英文名不符合变量命名规范"));if(l.yKeys.find(e=>e.enName===d.trim()))return void alert(r("该英文名已存在"));const e={enName:d.trim(),desc:m.trim()};k({yKeys:[...l.yKeys,e]}),x(""),S("")},style:v,children:["+ ",r("添加 Y Key")]})]})]})]})}const w={width:"100%",borderCollapse:"collapse",border:`1px solid ${c.border}`,fontSize:13},z={padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${c.border}`,color:c.primary,fontWeight:"bold",background:c.primaryLight},T={padding:"4px 8px",borderBottom:`1px solid ${c.border}`,color:c.text};function D({cfg:e,updateConfig:t,t:r}){const l=e.const_.keys||[],[s,i]=(0,n.useState)(""),[a,o]=(0,n.useState)(""),[x,m]=(0,n.useState)(d.S.String),g=e=>{t({const_:{keys:e}})};return(0,N.jsxs)("div",{children:[(0,N.jsx)("h3",{style:{color:c.primary,marginTop:0},children:r("常量(Const) 表结构")}),(0,N.jsx)("p",{style:{color:c.text2,fontSize:12,marginBottom:16},children:r("常量表:每行一个常量,可设置中文名、英文名和各自的值类型。")}),(0,N.jsx)("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:16},children:(0,N.jsxs)("label",{children:[(0,N.jsxs)("span",{style:y,children:[r("英文表名"),": "]}),(0,N.jsx)("input",{value:e.enName,onChange:e=>t({enName:e.target.value}),placeholder:"CamelCaseName",style:u})]})}),(0,N.jsxs)("h4",{style:{color:c.text},children:[r("常量定义列表")," (",l.length,")"]}),(0,N.jsxs)("table",{style:w,children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{style:z,children:r("中文名")}),(0,N.jsx)("th",{style:z,children:r("英文名(变量名)")}),(0,N.jsx)("th",{style:z,children:r("值类型")}),(0,N.jsx)("th",{style:z,children:r("操作")})]})}),(0,N.jsxs)("tbody",{children:[l.map(e=>(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:T,children:e.desc}),(0,N.jsx)("td",{style:T,children:(0,N.jsx)("span",{style:{color:h(e.enName)?c.green:c.red,fontFamily:"monospace"},children:e.enName||"(空)"})}),(0,N.jsx)("td",{style:T,children:(0,N.jsx)("select",{value:e.valueType,onChange:t=>{return r=e.enName,n=t.target.value,void g(l.map(e=>e.enName===r?{...e,valueType:n}:e));var r,n},style:{...u,fontSize:12,padding:"4px 8px"},children:p.map(e=>(0,N.jsx)("option",{value:e.value,children:e.label},e.value))})}),(0,N.jsx)("td",{style:T,children:(0,N.jsx)("button",{onClick:()=>{return t=e.enName,void g(l.filter(e=>e.enName!==t));var t},style:b,children:"✕"})})]},e.enName)),0===l.length&&(0,N.jsx)("tr",{children:(0,N.jsx)("td",{colSpan:4,style:{...T,textAlign:"center",color:c.text2},children:r("暂无常量定义,请在下方添加")})})]})]}),(0,N.jsxs)("div",{style:{display:"flex",gap:8,marginTop:12,alignItems:"center",flexWrap:"wrap"},children:[(0,N.jsx)("input",{placeholder:r("中文名"),value:s,onChange:e=>i(e.target.value),style:u}),(0,N.jsx)("input",{placeholder:r("英文名(如 MAX_HP)"),value:a,onChange:e=>o(e.target.value),style:u}),(0,N.jsx)("select",{value:x,onChange:e=>m(e.target.value),style:u,children:p.map(e=>(0,N.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,N.jsxs)("button",{onClick:()=>{if(!s.trim()||!a.trim())return;if(!h(a.trim()))return void alert(r("英文名不符合变量命名规范"));if(l.find(e=>e.enName===a.trim()))return void alert(r("该英文名已存在"));const e={enName:a.trim(),desc:s.trim(),valueType:x};g([...l,e]),i(""),o(""),m(d.S.String)},style:v,children:["+ ",r("添加常量")]})]})]})}const K={overflowX:"auto",width:"100%",border:`1px solid ${c.border}`,borderRadius:8},$={width:"100%",borderCollapse:"collapse",fontSize:13,minWidth:600},B={padding:"8px 12px",textAlign:"left",borderBottom:`2px solid ${c.border}`,background:c.primaryLight,color:c.primary,fontWeight:"bold",whiteSpace:"nowrap",position:"sticky",top:0},W={padding:"2px 4px",borderBottom:`1px solid ${c.border}`},A={width:"100%",padding:"6px 8px",borderRadius:6,border:"1px solid transparent",background:"transparent",color:c.text,fontSize:13,boxSizing:"border-box",minWidth:100},L={width:"100%",padding:"6px 8px",borderRadius:6,border:`1px dashed ${c.primary}`,background:c.surface,color:c.text,fontSize:13,boxSizing:"border-box",minWidth:100};function R(e){return e.desc||e.enName}function V({cfg:e,data:t,updateData:r,t:l}){const s=e.dict.keys,i=t?.rows||[],[a,o]=(0,n.useState)({});if(0===s.length)return(0,N.jsx)("p",{style:{color:c.text2},children:l("请先在表结构中添加列定义")});const d=()=>{if(!(a.id||"").trim())return;const e={};for(const t of s)e[t.enName]=a[t.enName]||"";r({rows:[...i,e]}),o({})},x=e=>{"Enter"===e.key&&d()};return(0,N.jsxs)("div",{children:[(0,N.jsx)("h3",{style:{color:c.primary,marginTop:0},children:l("字典数据编辑")}),(0,N.jsx)("p",{style:{color:c.text2,fontSize:12,marginBottom:12},children:l("表格式编辑:表头为各列定义,每行填写各列的值。编号列不可为空。")}),(0,N.jsx)("div",{style:K,children:(0,N.jsxs)("table",{style:$,children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{style:{...B,width:60},children:"#"}),s.map(e=>(0,N.jsxs)("th",{style:B,children:[(0,N.jsx)("div",{children:e.desc||e.enName}),(0,N.jsxs)("div",{style:{fontSize:10,fontWeight:"normal",color:c.text2},children:[e.enName," (",e.valueType,")"]})]},e.enName)),(0,N.jsx)("th",{style:{...B,width:60},children:l("操作")})]})}),(0,N.jsxs)("tbody",{children:[(0,N.jsxs)("tr",{style:{background:c.surface2},children:[(0,N.jsx)("td",{style:{...W,textAlign:"center",color:c.text2},children:"+"}),s.map(e=>(0,N.jsx)("td",{style:W,children:(0,N.jsx)("input",{value:a[e.enName]||"",onChange:t=>{return r=e.enName,n=t.target.value,void o(e=>({...e,[r]:n}));var r,n},onKeyDown:x,placeholder:R(e),style:L})},e.enName)),(0,N.jsx)("td",{style:{...W,textAlign:"center"},children:(0,N.jsx)("button",{onClick:d,style:v,children:"+"})})]}),i.map((e,t)=>(0,N.jsxs)("tr",{onMouseEnter:e=>{e.currentTarget.style.background=c.primaryLight},onMouseLeave:e=>{e.currentTarget.style.background=""},children:[(0,N.jsx)("td",{style:{...W,textAlign:"center",color:c.text2,fontSize:12},children:t+1}),s.map(n=>(0,N.jsx)("td",{style:W,children:(0,N.jsx)("input",{value:e[n.enName]||"",onChange:e=>((e,t,n)=>{const l=i.map((r,l)=>l!==e?r:{...r,[t]:n});r({rows:l})})(t,n.enName,e.target.value),placeholder:R(n),style:{...A,borderColor:"transparent"},onFocus:e=>{e.target.style.border=`1px solid ${c.primary}`,e.target.style.background=c.surface},onBlur:e=>{e.target.style.border="1px solid transparent",e.target.style.background="transparent"}})},n.enName)),(0,N.jsx)("td",{style:{...W,textAlign:"center"},children:(0,N.jsx)("button",{onClick:()=>(e=>{r({rows:i.filter((t,r)=>r!==e)})})(t),style:b,children:"✕"})})]},t))]})]})}),0===i.length&&(0,N.jsx)("div",{style:{textAlign:"center",color:c.text2,padding:20},children:l("暂无数据,请在上方添加行")})]})}function I({cfg:e,data:t,updateData:r,t:n}){const l=e.twoDim,s=l.xKeys,i=l.yKeys;if(0===s.length||0===i.length)return(0,N.jsx)("p",{style:{color:c.text2},children:n("请先在表结构中添加 X 轴和 Y 轴的 key")});const a=t?.cells||{},o=Math.max(100,120);return(0,N.jsxs)("div",{children:[(0,N.jsx)("h3",{style:{color:c.primary,marginTop:0},children:n("二维表数据编辑")}),(0,N.jsxs)("p",{style:{color:c.text2,fontSize:12,marginBottom:8},children:[n("X 轴(列头):"),s.map(e=>e.desc).join(", ")," | ",n("Y 轴(行头):"),i.map(e=>e.desc).join(", ")," | Value类型:",l.valueType]}),(0,N.jsx)("div",{style:{overflow:"auto"},children:(0,N.jsxs)("table",{style:{...g,borderCollapse:"collapse"},children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{style:{...f,background:c.surface2,minWidth:140},children:(0,N.jsx)("span",{style:{fontSize:11,color:c.text2},children:"Y ↓ / X →"})}),s.map(e=>(0,N.jsxs)("th",{style:{...f,minWidth:o,background:c.primaryLight,textAlign:"center"},children:[(0,N.jsx)("div",{style:{fontWeight:"bold"},children:e.desc}),(0,N.jsx)("div",{style:{fontSize:11,color:c.text2,fontFamily:"monospace"},children:e.enName})]},e.enName))]})}),(0,N.jsx)("tbody",{children:i.map(e=>(0,N.jsxs)("tr",{children:[(0,N.jsxs)("td",{style:{...j,background:c.primaryLight,fontWeight:"bold"},children:[(0,N.jsx)("div",{children:e.desc}),(0,N.jsx)("div",{style:{fontSize:11,color:c.text2,fontFamily:"monospace"},children:e.enName})]}),s.map(t=>(0,N.jsx)("td",{style:j,children:(0,N.jsx)("input",{value:a[t.enName]?.[e.enName]||"",onChange:n=>((e,t,n)=>{const l={...a};l[e]||(l[e]={}),l[e]={...l[e],[t]:n},""===n&&Object.keys(l[e]).every(t=>!l[e][t])&&delete l[e],r({cells:l})})(t.enName,e.enName,n.target.value),placeholder:l.valueType,style:m})},t.enName))]},e.enName))})]})})]})}const X={display:"flex",alignItems:"center",gap:8,marginBottom:6,padding:"6px 8px",borderRadius:8,background:c.surface,border:`1px solid ${c.border}`},_={width:160,minWidth:160,fontFamily:"monospace",fontWeight:"bold",color:c.primary,fontSize:13,wordBreak:"break-all",padding:"4px 8px",background:c.primaryLight,borderRadius:4,flexShrink:0},F={fontSize:11,color:c.text2,minWidth:80,flexShrink:0},Y={flex:1,padding:"6px 10px",borderRadius:8,border:`1px solid ${c.border}`,background:c.surface,color:c.text,fontSize:13,minWidth:120},E={fontSize:10,color:c.text2,background:c.surface2,padding:"2px 6px",borderRadius:4,flexShrink:0};function M({cfg:e,data:t,updateData:r,t:n}){const l=e.const_.keys||[],s=t?.values||{};return 0===l.length?(0,N.jsx)("p",{style:{color:c.text2},children:n("请先在表结构中添加常量定义")}):(0,N.jsxs)("div",{children:[(0,N.jsx)("h3",{style:{color:c.primary,marginTop:0},children:n("常量数据编辑")}),(0,N.jsx)("p",{style:{color:c.text2,fontSize:12,marginBottom:12},children:n("根据表结构中定义的常量,为每个常量输入对应的值。")}),l.map(e=>(0,N.jsxs)("div",{style:X,children:[(0,N.jsx)("div",{style:_,title:e.enName,children:e.enName}),(0,N.jsx)("div",{style:F,children:e.desc}),(0,N.jsx)("input",{value:s[e.enName]||"",onChange:t=>{return n=e.enName,l=t.target.value,void r({values:{...s,[n]:l}});var n,l},style:Y,placeholder:`${e.desc||e.enName}`}),(0,N.jsx)("span",{style:E,children:e.valueType})]},e.enName))]})}function P(){return{config:{type:d.V.Dict,enName:"",dict:{keys:[{enName:"id",desc:"编号",valueType:"string"}]}}}}function G(e){const t={...e};switch(t.type){case d.V.Const:t.const_||(t.const_={keys:[]});break;case d.V.Dict:t.dict||(t.dict={keys:[{enName:"id",desc:"编号",valueType:"string"}]});break;case d.V.TwoDim:t.twoDim||(t.twoDim={xKeys:[],yKeys:[],valueType:d.S.String})}return t}function Z(e){const[t,r]=(0,l.fp)(s.AG.gcfg_editor),{t:p}=(0,o.Bd)(),[y,u]=(0,n.useState)(P()),[m,g]=(0,n.useState)(!1),[f,j]=(0,n.useState)(!1),[v,b]=(0,n.useState)("config"),w=e?.filePath||t.path,z=e?.fileName||t.name,T=e?.onClose,[K,$]=(0,n.useState)(!1);(0,n.useEffect)(()=>{w&&W()},[w]);const B=()=>w||"",W=async()=>{g(!0);try{const e=await i.Si.post("load",{path:B()});if(0===e.code){const t=G(e.data.config),r=e.data.data||{};u({config:t,data:r}),$(!0),b("data")}else u(P()),$(!1)}catch(e){u(P()),$(!1)}g(!1)},A=()=>j(!0),L=e=>{K&&void 0!==e.type&&e.type!==y.config.type||(u(t=>({config:G({...t.config,...e}),data:t.data})),A())},R=e=>{u(t=>({...t,data:e})),A()},X=y.config;if(m)return(0,N.jsx)("div",{style:{padding:20,color:c.text2},children:"Loading..."});const _=!!T;return(0,N.jsxs)("div",{style:_?{width:"100%",height:"100%",background:c.surface,color:c.text,display:"flex",flexDirection:"column",overflow:"hidden"}:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:2e3,background:c.surface,color:c.text,display:"flex",flexDirection:"column"},children:[(0,N.jsxs)("div",{style:{display:"flex",alignItems:"center",padding:"8px 16px",background:c.surface,borderBottom:`1px solid ${c.border}`,gap:12,flexShrink:0},children:[(0,N.jsx)("span",{style:{fontWeight:"bold",fontSize:16,color:c.primary},children:"⚙ Gcfg Editor"}),(0,N.jsx)("span",{style:{color:c.text2},children:z}),K?(0,N.jsxs)("span",{style:{padding:"3px 10px",borderRadius:12,fontSize:12,background:c.BG2,color:c.text2,border:`1px solid ${c.border}`},children:["🔒 ",x.find(e=>e.value===X.type)?.label||X.type]}):(0,N.jsx)("select",{value:X.type,onChange:e=>L({type:e.target.value}),style:{padding:"3px 10px",borderRadius:12,fontSize:12,background:c.primaryLight,color:c.primary,border:`1px solid ${c.primary}`,cursor:"pointer",outline:"none"},children:x.map(e=>(0,N.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,N.jsx)("div",{style:{flex:1}}),(0,N.jsx)("button",{onClick:()=>b("config"),style:S("config"===v),children:p("表结构")}),(0,N.jsx)("button",{onClick:()=>b("data"),style:S("data"===v),children:p("数据")}),(0,N.jsxs)("button",{onClick:async()=>{const e=y.config;if(e.enName&&h(e.enName))try{const e=await i.Si.post("save",{path:B(),content:y});0===e.code?((0,a.SK)(p("保存成功")),j(!1)):(0,a.zN)(e.message||p("保存失败"))}catch(e){(0,a.zN)(e?.message||p("保存失败"))}else(0,a.zN)(p("英文表名不符合变量命名规范"))},style:S(!1,c.green),children:["💾 ",p("保存")," ",f?"●":""]}),(0,N.jsxs)("button",{onClick:()=>{f&&!window.confirm(p("有未保存的更改,确定关闭吗?"))||(T?T():(r({open:!1}),t.close?.()))},style:S(!1,c.red),children:["✕ ",p("关闭")]})]}),(0,N.jsxs)("div",{style:{flex:1,overflow:"auto",padding:16},children:["config"===v&&(()=>{switch(X.type){case d.V.Dict:return(0,N.jsx)(k,{cfg:X,updateConfig:L,t:p});case d.V.TwoDim:return(0,N.jsx)(C,{cfg:X,updateConfig:L,t:p});case d.V.Const:return(0,N.jsx)(D,{cfg:X,updateConfig:L,t:p});default:return(0,N.jsx)(k,{cfg:X,updateConfig:L,t:p})}})(),"data"===v&&(()=>{const e=y.data;switch(X.type){case d.V.Dict:return(0,N.jsx)(V,{cfg:X,data:e,updateData:R,t:p});case d.V.TwoDim:return(0,N.jsx)(I,{cfg:X,data:e,updateData:R,t:p});case d.V.Const:return(0,N.jsx)(M,{cfg:X,data:e,updateData:R,t:p});default:return(0,N.jsx)(V,{cfg:X,data:e,updateData:R,t:p})}})()]})]})}}}]);