@gientech/modual 2.3.22 → 2.3.24
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/README.md +761 -761
- package/assets/{GientechStreamReader-DXwJoB4O.js → GientechStreamReader-CnAI3q38.js} +12 -17
- package/assets/ReviewSetting-C3B98Nq2.js +415 -0
- package/assets/chevron-right-CrkLSPrQ.js +6 -0
- package/assets/database.svg +11 -11
- package/assets/database_add.svg +53 -53
- package/assets/database_connect.svg +66 -66
- package/assets/database_upload.svg +29 -29
- package/assets/databse.svg +6 -6
- package/assets/defaultWeLogo.svg +14 -14
- package/assets/empty2.png +0 -0
- package/assets/graph.svg +4 -4
- package/assets/{index-w3uoyJPy.js → index-C1CXeTnS.js} +2 -2
- package/assets/{index-CBoQAuTU.js → index-C9Vc57_N.js} +33 -33
- package/assets/knowledge.svg +4 -4
- package/assets/mysql.svg +14 -14
- package/assets/sensitive.svg +5 -5
- package/assets/style-BzPoYUHb.js +191 -0
- package/assets/style10.css +1 -0
- package/assets/style2.css +1 -1
- package/assets/style3.css +1 -1
- package/assets/style4.css +1 -1
- package/assets/style5.css +1 -1
- package/assets/style6.css +1 -1
- package/assets/style7.css +1 -1
- package/assets/style8.css +1 -1
- package/assets/style9.css +1 -1
- package/assistantConfig.js +1 -1
- package/chat.js +1 -1
- package/chatCompare.js +1 -1
- package/database.js +2 -2
- package/databaseId.js +1 -1
- package/graphBase.js +1 -1
- package/index.js +1 -1
- package/modelManage.js +1 -1
- package/package.json +16 -6
- package/reviewManage.d.ts +26 -0
- package/reviewManage.js +184 -0
- package/reviewSetting.d.ts +80 -0
- package/reviewSetting.js +1 -0
- package/streamFilesReader.js +1 -1
- package/worker/pdf.worker.min.js +21 -21
- package/assets/Empty2.png +0 -0
- package/assets/ReviewManage-D7aZe-m0.js +0 -690
- package/assets/allUser.png +0 -0
- package/assets/group.png +0 -0
- package/assets/iconAi.svg +0 -9
- /package/assets/{index-CJfOfBmA.js → index-CxKRvyc8.js} +0 -0
package/databaseId.js
CHANGED
|
@@ -13,4 +13,4 @@ import{jsx as u,jsxs as I,Fragment as Be}from"react/jsx-runtime";import se,{useM
|
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const Oe=ge("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]),Xe="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%201C13.4997%201.50025%2013.25%201.99975%2013.25%202.5C13.25%203.00025%2013.4997%203.49975%2014%204C13.4997%203.49975%2013.0003%203.25%2012.5%203.25C11.9997%203.25%2011.5003%203.49975%2011%204C11.5003%203.49975%2011.75%203.00025%2011.75%202.5C11.75%201.99975%2011.5003%201.50025%2011%201C11.5003%201.50025%2011.9997%201.75%2012.5%201.75C13.0003%201.75%2013.4997%201.50025%2014%201Z'%20fill='%23055AFF'/%3e%3cpath%20d='M13%206.28571V13C13%2013.5523%2012.5523%2014%2012%2014H4C3.44772%2014%203%2013.5523%203%2013V3C3%202.44772%203.44772%202%204%202H9.25'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='6.35'%20x2='10.35'%20y2='6.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='9.35'%20x2='8.35'%20y2='9.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3c/svg%3e",Pe="data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42%2022C43.1046%2022%2044%2022.8954%2044%2024V42C44%2043.1046%2043.1046%2044%2042%2044H6C4.89543%2044%204%2043.1046%204%2042V24.0088C4%2022.9042%204.89543%2022.0078%206%2022.0078C7.10457%2022.0078%208%2022.9042%208%2024.0088V40H40V24C40%2022.8954%2040.8954%2022%2042%2022ZM24.0293%204.00195C24.0808%204.00272%2024.1322%204.00504%2024.1836%204.00977C24.1904%204.01042%2024.1973%204.011%2024.2041%204.01172C24.2673%204.01819%2024.3301%204.02757%2024.3926%204.04004C24.3939%204.04031%2024.3952%204.04075%2024.3965%204.04102C24.7693%204.11623%2025.125%204.29691%2025.4141%204.58594L34.4141%2013.5859C35.1951%2014.367%2035.1951%2015.633%2034.4141%2016.4141C33.633%2017.1951%2032.367%2017.1951%2031.5859%2016.4141L25.9922%2010.8203V32C25.9922%2033.1046%2025.0968%2034%2023.9922%2034C22.8876%2034%2021.9922%2033.1046%2021.9922%2032V10.8359L16.4141%2016.4141C15.633%2017.1951%2014.367%2017.1951%2013.5859%2016.4141C12.8049%2015.633%2012.8049%2014.367%2013.5859%2013.5859L22.498%204.67285C22.8016%204.33138%2023.2194%204.09559%2023.6924%204.02441C23.7122%204.02135%2023.732%204.01809%2023.752%204.01562C23.7862%204.01152%2023.8207%204.00919%2023.8555%204.00684C23.8887%204.00446%2023.9218%204.00268%2023.9551%204.00195C23.9674%204.00173%2023.9798%204%2023.9922%204C24.0046%204%2024.0169%204.00173%2024.0293%204.00195Z'%20fill='url(%23paint0_linear_4072_34663)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_4072_34663'%20x1='4'%20y1='-7.25'%20x2='54.4707'%20y2='1.556'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%232B69FF'/%3e%3cstop%20offset='1'%20stop-color='%238F91FF'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",Me=({url:t,token:C,role:r,eventsEmit:d})=>{const f=qe.create({baseURL:t,timeout:1e6});return f.interceptors.request.use(a=>{let s=C;return!s&&!["user/login","user/kaptcha","user/regist"].some(n=>a.url.includes(n))?(d&&d("request:error_auth",{errorMsg:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F",redirect:"/login"}),Promise.reject(new Error("\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"))):(a.headers.Authorization=s||"",a.headers.userName=r==="\u672A\u767B\u5F55\u7528\u6237"?"":r,a)}),f.interceptors.response.use(a=>{const s=["user/kaptcha"],l=a.data;if(s.some(_=>a.config.url&&a.config.url.includes(_))||l.size&&l.type)return l;const{success:n,errorMsg:y,errorCode:B}=l;if(n)return l;d&&d("request:error_business",{errorCode:B,errorMsg:y||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",response:l})},a=>{var s,l,n,y,B,_,p,h,q;if(a.message==="canceled")return Promise.reject(a);if(d){let O="request:error_network",Z={errorMsg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:a};((s=a==null?void 0:a.response)==null?void 0:s.status)===401?(O="request:error_auth",Z={errorMsg:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",error:a,redirect:"/login"}):(((n=(l=a==null?void 0:a.response)==null?void 0:l.data)==null?void 0:n.errorCode)==="30013"||((B=(y=a==null?void 0:a.response)==null?void 0:y.data)==null?void 0:B.errorCode)==="30023")&&(O="request:error_business",Z={errorCode:(p=(_=a==null?void 0:a.response)==null?void 0:_.data)==null?void 0:p.errorCode,errorMsg:((q=(h=a==null?void 0:a.response)==null?void 0:h.data)==null?void 0:q.errorMsg)||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",error:a}),d(O,Z)}return Promise.reject(a)}),{getTableList:async a=>{try{const s=await f.get(`/directDB/queryTableList/${a}`),{success:l,data:n}=s;if(l)return n}catch(s){console.log("getTableList error:",s)}},getTableTreeList:async a=>{try{const s=await f.get(`/dataTable/queryTableFileTreeList/${a}`),{success:l,data:n}=s;if(l)return n}catch(s){console.log("getTableTreeList error:",s)}},getDBDetailById:async(a,s)=>{const l=ye(s);try{const n=await f.get(`/${l}/queryDBInfo/${a}`),{success:y,data:B}=n;if(y)return B}catch(n){console.log("getDBDetailById error:",n)}},delTableById:async(a,s)=>{const l=ye(s);try{const n=await f.delete(`/${l}/deleteTable/${a}`),{success:y,data:B}=n;if(y)return B}catch(n){console.log("delTableById error:",n)}},delFileById:async a=>{try{const s=await f.delete(`/dataTable/deleteTableFileData/${a}`),{success:l,data:n}=s;if(l)return n}catch(s){console.log("delFileById",s)}},parseFiles:async({fileIds:a,isGenDescription:s,tableDescriptionMap:l})=>{try{const n=await f.post("/dataTable/parseFiles",{fileIds:a,isGenDescription:s,tableDescriptionMap:l}),{success:y,data:B}=n;if(y)return B}catch(n){console.log("parseFiles error:",n)}},reParseFile:async a=>{try{const s=await f.post(`/dataTable/reParseFile/${a}`),{success:l,data:n}=s;if(l)return n}catch(s){console.log("reParseFile error:",s)}},parseAppendFile:async({fileIds:a,tableId:s})=>{try{const l=await f.post("/dataTable/parseAppendFiles",{fileIds:a,tableId:s}),{success:n,data:y}=l;if(n)return y}catch(l){console.log("parseAppendFile error:",l)}},deleteUploadedFiles:async a=>{try{const s=await f.post("/dataTable/cancelUploadFile",{fileIds:a}),{success:l,data:n}=s;if(l)return n}catch(s){console.log("deleteUploadedFiles error:",s)}},getTableInfoById:async a=>{try{const s=await f.get(`/dataTable/queryTableMeta/${a}`),{success:l,data:n}=s;if(l)return n}catch(s){console.log("getTableInfoById error:",s)}},updateTableInfo:async({tableId:a,description:s,businessName:l})=>{try{const n=await f.post("/dataTable/updateTableInfo",{tableId:a,businessName:l,description:s}),{success:y,data:B}=n;if(y)return B}catch(n){console.log("updateTableInfo error:",n)}},optimizeDesc:async a=>{try{const s=await f.get(`/genTableDescription/${a}`),{success:l,data:n}=s;if(l)return n}catch(s){console.log("optimizeDesc error:",s)}}}},ye=t=>t=="DataTable"?"dataTable":"directDB",Fe='<template key="type" placeholder="\u8F93\u5165\u8868\u683C\u7C7B\u578B"></template>\u8868\u683C\u4E3B\u8981\u5C55\u793A\u4E86<template key="scene" placeholder="\u8F93\u5165\u573A\u666F\u540D\u79F0"></template>\u573A\u666F\u7684\u6570\u636E,\u5305\u542B<template key="primary_key" placeholder="\u4E3B\u8981\u5B57\u6BB5(\u53EF\u5199\u591A\u4E2A,\u7528\u987F\u53F7\u5206\u9694)"></template>\u7B49\u4E3B\u8981\u5B57\u6BB5,\u652F\u6301\u7528\u6237\u67E5\u8BE2<template key="search_direction" placeholder="\u5927\u6982\u4ECB\u7ECD\u9700\u8981\u67E5\u8BE2\u7684\u65B9\u5411"></template>\u95EE\u9898,\u5982\u679C\u8BBE\u8BA1\u591A\u8868\u5173\u8054\u67E5\u8BE2,\u6700\u597D\u8BF4\u660E\u6B64\u8868\u683C\u901A\u8FC7<template key="key_name" placeholder="\u5B57\u6BB5\u540D\u79F0"></template>\u5B57\u6BB5\u53EF\u4EE5\u5173\u8054\u53E6\u4E00\u4E2A<template key="table_name" placeholder="\u8868\u683C\u540D\u79F0"></template>\u8868\u683C\u3002',Ke={colors:{background:"#ffffff",border:"#e5e7eb",appBackground:"#ffffff",listBackground:"#ffffff",dashboardBackground:"#ffffff"},space:{padding:"0",margin:"md",shadow:"none"}},Je=({drawerTitle:t,drawerVisible:C,uploadUrl:r,handleDrawerClose:d,dbId:f,tableInfo:D,token:M,url:P,role:E})=>{const z=Q(()=>({id:"upload",layout:"vertical",formWidth:"670px",fields:[{id:"fileIds",name:"fileIds",type:"uploader",required:!1,defaultValue:"",uploaderConfig:{multiple:!D,accept:".csv,.xlsx,.xls",maxFiles:D?1:20,url:r,autoUpload:!0,headers:{Authorization:M},queryParams:{databaseId:f,...D&&{tableId:D.tableId}},placeholder:I("div",{children:[u("div",{className:"text-lg font-bold",children:"\u70B9\u51FB\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u5904\u4E0A\u4F20"}),I("div",{className:"flex flex-col gap-1.8 mt-[12px]",children:[u("div",{className:"text-[#888888] font-[12px]",children:"\u6570\u91CF\uFF1A\u226420 \u6587\u4EF6\uFF08\u5F53\u524D 0/20\uFF09"}),u("div",{className:"text-[#888888] font-[12px]",style:{width:"580px"},children:"\u683C\u5F0F\uFF1A.xlsx / .xls / .csv /\uFF08\u7B2C\u4E00\u884C\u662F\u8868\u5934\uFF0C\u5176\u4ED6\u884C\u662F\u6570\u636E\uFF1BCSV \u652F\u6301 UTF-8/GBK/GB2312\u2026\uFF09"}),u("div",{className:"text-[#888888] font-[12px]",children:"\u5355\u6587\u4EF6\u9650\u5236\uFF1A \u226410\u4E07\u884C\uFF0C\u226460\u5217\uFF08\u8D85\u51FA\u81EA\u52A8\u5FFD\u7565\uFF09\uFF1B \u6BCF\u6587\u4EF6 \u22641\u4E2ASheet"}),u("div",{className:"text-[#888888] font-[12px]",children:"\u4E0A\u4F20\u7684\u6587\u4EF6\uFF0C\u5982\u679C\u6709\u4E0D\u7B26\u5408\u6587\u672C\u683C\u5F0F\u7684\u6570\u636E\u7CFB\u7EDF\u81EA\u52A8\u5FFD\u7565"})]})]}),listName:D?"\u8FFD\u52A0\u6587\u4EF6":"\u4E0A\u4F20\u6587\u4EF6\u5217\u8868",icons:{dragUpload:u("img",{src:Pe,width:40}),itemStatus:{pending:u("span",{style:{fontSize:"12px",color:"#6b7280"}}),uploading:u("span",{style:{fontSize:"12px",color:"#007bff"}}),success:u("span",{style:{fontSize:"12px",color:"#10b981"}}),error:u("span",{style:{fontSize:"12px",color:"#ef4444"},children:"\u5931\u8D25"})},fileType:{default:u(Ye,{size:20,style:{color:"#6b7280"}})}},...!D&&{buttons:[{label:"\u4F7F\u7528\u6A21\u7248",icon:u("img",{src:Xe}),mode:"text",onClick:()=>{n(!0)}}]},...!D&&{itemForm:[{type:"textarea",name:"description",counter:150,placeholder:"\u4E3A\u4E86\u63D0\u9AD8\u95EE\u7B54\u51C6\u786E\u7387\uFF0C\u8BF7\u8F93\u5165\u63CF\u8FF0"}]}}}]}),[D]),[i,Y]=b(!1),[V,A]=b({}),m=Ce(null),[W,H]=b(!1),[a,s]=b([]);console.log(a,"+++++file");const[l,n]=b(!1),[y,B]=b(Fe),[_,p]=b(null),[h,q]=b(Fe),[O,Z]=b(0),{parseFiles:ie,parseAppendFile:le,deleteUploadedFiles:ne}=Me({url:P,token:M,role:E});Ee(()=>()=>{s([])},[C]);const K=X(async(F,c,k)=>{var v;switch(console.log("[DynamicFormAdopter] \u4E8B\u4EF6:",F,c),F){case"form:ready":c.formRef?m.current=c.formRef:console.log("\u274C data.formRef \u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u4FDD\u5B58\u8868\u5355\u5F15\u7528");break;case"form:submit":ee();break;case"form_field_change":A(x=>({...x,[c.fieldId]:c.value}));break;case"uploader:error":(v=c.item)!=null&&v.id?s(x=>[{id:c.item.id,status:c.item.status},...x]):G.error(c==null?void 0:c.message);break;case"uploader:success":s(x=>[{id:c.item.id,status:c.item.status},...x]);break;case"uploader:remove":const R=c.item.status;s(x=>x.filter(j=>j.id!==c.item.id)),R=="success"&&await te([c.item.uploadApiRes]);break;default:console.log("\u672A\u5904\u7406\u7684\u4E8B\u4EF6:",F)}},[]),oe=Q(()=>({label:"\u52A8\u6001\u8868\u5355\u793A\u4F8B",defaultActiveId:"form-view",model:null,views:[{label:"\u7528\u6237\u6CE8\u518C\u8868\u5355",id:"form-view",type:"form",size:"md",formWidth:z.formWidth,formConfig:{layout:z.layout,showReset:!1,showSubmit:!1,formWidth:z.formWidth,getFormData:()=>({...V,timestamp:new Date().toISOString(),formId:z.id}),onFieldChange:(F,c)=>{K("form_field_change",{fieldId:F,value:c},void 0)},onValidationError:F=>{K("form_validation_error",F,void 0)}}}],dataSource:[{id:z.id,fields:z.fields,defaultValues:{}}],eventsEmit:K,styles:{theme:Ke}}),[D,z]),ee=async()=>{var F;try{Y(!0);const c=await m.current.getAllData();if(c.isValid){const k=(F=c.fields.find(v=>v.name=="fileIds"))==null?void 0:F.value;if(Array.isArray(k)&&(k==null?void 0:k.length)>0){let v;if(D)v=await le({fileIds:k.map(R=>R.uploadApiRes),tableId:D.id});else{const R={fileIds:k.map(x=>x.uploadApiRes),tableDescriptionMap:k.reduce((x,j)=>(x[j.uploadApiRes]=j.formData.description,x),{}),isGenDescription:W};v=await ie(R)}v&&(d("refresh"),s([]))}}}catch(c){console.error("\u8868\u5355\u6570\u636E\u5931\u8D25:",c)}finally{d(),Y(!1),H(!1),s([])}},ue=async F=>{var c;try{const k=await m.current.getAllData();if(k.isValid){const v=(c=k.fields.find(R=>R.name=="fileIds"))==null?void 0:c.value;if(v&&Array.isArray(v)&&(v==null?void 0:v.length)>0){const R=v.map(j=>j.uploadApiRes),x=await te(R)}}}catch(k){console.error("\u8868\u5355\u6570\u636E\u5931\u8D25:",k)}finally{d(),H(!1),s([])}},te=async F=>{try{const c=await ne(F);if(c)return c}catch(c){console.error("\u5220\u9664\u6587\u4EF6\u6570\u636E\u5931\u8D25:",c)}},re=F=>{H(F)},ce=X(F=>{B(F),console.log("\u6A21\u7248\u5185\u5BB9\u53D8\u5316:",F)},[]),ae=X(F=>{p(()=>F),console.log("getData\u51FD\u6570\u5DF2\u8BBE\u7F6E")},[]),de=X(async()=>{try{if(!_){console.error("getData\u51FD\u6570\u5C1A\u672A\u51C6\u5907\u597D\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}const F=_("pure_string");await navigator.clipboard.writeText(F),G.success("\u5DF2\u590D\u5236",1)}catch(F){console.error("\u590D\u5236\u5931\u8D25:",F)}finally{n(!1)}},[_]);return I(Te,{title:t,rootClassName:"database-upload-drawer",placement:"right",width:700,closeIcon:!1,extra:u(De,{size:20,color:"#888888",onClick:()=>ue(),className:"cursor-pointer"}),open:C,destroyOnHidden:!0,footer:I("div",{className:"flex items-center",style:{justifyContent:D?"end":"space-between"},children:[!D&&I("div",{className:"flex gap-2 items-center text-[#555555]",children:[u("span",{children:"\u81EA\u52A8\u751F\u6210\u6570\u636E\u8868\u63CF\u8FF0"})," ",u(fe,{title:"\u81EA\u52A8\u751F\u6210\u5F00\u542F\u65F6\u5C06\u57FA\u4E8E\u6570\u636E\u667A\u80FD\u751F\u6210\u63CF\u8FF0\uFF1B\u82E5\u5F00\u542F\u6B64\u529F\u80FD\u5E76\u624B\u52A8\u586B\u5199\u63CF\u8FF0\uFF0C\u5C06\u4F18\u5148\u91C7\u7528\u7528\u6237\u586B\u5199\u7684\u5185\u5BB9\u3002",children:u(je,{size:14})}),u(He,{onChange:re})]}),I("div",{className:"flex self-end gap-3",children:[u($,{mode:"default",style:{marginRight:10},label:"\u53D6\u6D88",onClick:ue}),u($,{mode:"primary",label:"\u786E\u8BA4\u5BFC\u5165",loading:i,disabled:a.some(F=>F.status=="error"),onClick:async()=>{await ee()}})]})]}),children:[u(Ie,{...oe},"upload-file"),u(be,{title:I("div",{children:["\u6A21\u7248",u("span",{className:"text-[12px] text-[#888888]",style:{marginLeft:8},children:"\u5B8C\u6210\u7F16\u8F91\u540E\uFF0C\u53EF\u5C06\u6587\u672C\u590D\u5236\u7C98\u8D34\u5230\u76F8\u5E94\u63CF\u8FF0\u6846\u4E2D\u3002"})]}),width:672,destroyOnHidden:!0,open:l,onCancel:()=>n(!1),footer:I("div",{className:"flex justify-end items-center gap-3",children:[u($,{mode:"default",label:"\u91CD\u7F6E",onClick:()=>{q(Fe),Z(F=>F+1)}}),u($,{mode:"primary",label:"\u590D\u5236",onClick:de})]}),children:u(ke,{data:h,onChange:ce,onGetData:ae,styles:{theme:{colors:{primary:"#0969da",secondary:"#6b7280",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6",background:"#ffffff",text:"#1f2937",border:"#e5e7eb",disabled:"#9ca3af",disabledBackground:"#f3f4f6",disabledText:"#6b7280",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)",appBackground:"transparent",listBackground:"#f9fafb",dashboardBackground:"#ffffff",textSecondary:"#6b7280"},space:{sidebar:"260px",size:"12px",radius:"8px",padding:"1rem",margin:"1rem",shadow:"0 2px 8px rgba(0,0,0,0.1)",lineHeight:"1.8"},icons:{},fonts:{body:{size:"14px",weight:"normal",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"},heading:{size:"14px",weight:"600",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"}},others:{baseFontWeight:"normal"}},templateField:{backgroundColor:"#E5EEFF",borderColor:"#84ADFF",borderRadius:"6px",padding:"6px 12px",margin:"2px",fontSize:"14px",fontWeight:"500",minWidth:"80px",textColor:"#84ADFF"}}},O)})]})},Qe="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%201C13.4997%201.50025%2013.25%201.99975%2013.25%202.5C13.25%203.00025%2013.4997%203.49975%2014%204C13.4997%203.49975%2013.0003%203.25%2012.5%203.25C11.9997%203.25%2011.5003%203.49975%2011%204C11.5003%203.49975%2011.75%203.00025%2011.75%202.5C11.75%201.99975%2011.5003%201.50025%2011%201C11.5003%201.50025%2011.9997%201.75%2012.5%201.75C13.0003%201.75%2013.4997%201.50025%2014%201Z'%20fill='%23055AFF'/%3e%3cpath%20d='M13%206.28571V13C13%2013.5523%2012.5523%2014%2012%2014H4C3.44772%2014%203%2013.5523%203%2013V3C3%202.44772%203.44772%202%204%202H9.25'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='6.35'%20x2='10.35'%20y2='6.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='9.35'%20x2='8.35'%20y2='9.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3c/svg%3e",eu="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_4199_8826)'%3e%3cpath%20d='M15.5554%2012.4444C14.9626%2013.0373%2014.6666%2013.6293%2014.6666%2014.2222C14.6666%2014.8151%2014.9626%2015.4071%2015.5554%2016C14.9626%2015.4071%2014.3706%2015.1111%2013.7777%2015.1111C13.1848%2015.1111%2012.5928%2015.4071%2011.9999%2016C12.5928%2015.4071%2012.8888%2014.8151%2012.8888%2014.2222C12.8888%2013.6293%2012.5928%2013.0373%2011.9999%2012.4444C12.5928%2013.0373%2013.1848%2013.3333%2013.7777%2013.3333C14.3706%2013.3333%2014.9626%2013.0373%2015.5554%2012.4444ZM14.6488%204.01778C15.1905%204.55954%2015.4948%205.29431%2015.4948%206.06044C15.4948%206.82658%2015.1905%207.56135%2014.6488%208.10311L7.735%2015.0169C7.46766%2015.2892%207.14901%2015.5058%206.79746%2015.6543C6.44592%2015.8028%206.06844%2015.8801%205.68684%2015.8819C5.30523%2015.8836%204.92706%2015.8097%204.57417%2015.6645C4.22127%2015.5193%203.90065%2015.3056%203.63081%2015.0357C3.36097%2014.7659%203.14727%2014.4453%203.00205%2014.0924C2.85682%2013.7395%202.78295%2013.3613%202.7847%2012.9797C2.78646%2012.5981%202.8638%2012.2206%203.01226%2011.8691C3.16072%2011.5176%203.37736%2011.1989%203.64967%2010.9316L3.95545%2010.6249L3.85145%2010.5244C3.30922%2010.0267%202.76522%209.77778%202.22211%209.77778C1.62923%209.77778%201.03722%2010.0738%200.444336%2010.6667C1.03722%2010.0738%201.33322%209.48178%201.33322%208.88889C1.33322%208.296%201.03722%207.704%200.444336%207.11111C1.03722%207.704%201.62923%208%202.22211%208C2.815%208%203.407%207.704%203.99989%207.11111C3.407%207.704%203.111%208.296%203.111%208.88889C3.111%209.46667%203.39278%2010.0444%203.95545%2010.6222L10.5634%204.01778C11.1052%203.47606%2011.84%203.17173%2012.6061%203.17173C13.3723%203.17173%2014.107%203.47606%2014.6488%204.01778ZM9.55189%206.91378L4.59189%2011.8738C4.30004%2012.1655%204.13603%2012.5612%204.13594%2012.9739C4.1359%2013.1782%204.17611%2013.3806%204.25426%2013.5694C4.33242%2013.7582%204.44699%2013.9297%204.59145%2014.0742C4.7359%2014.2187%204.9074%2014.3334%205.09617%2014.4116C5.28493%2014.4898%205.48725%2014.5301%205.69158%2014.5302C6.10424%2014.5303%206.50004%2014.3664%206.79189%2014.0747L11.7519%209.11378L9.55189%206.91378ZM11.5066%204.96089L10.495%205.97156L12.695%208.17156L13.7057%207.16C13.9846%206.86582%2014.1377%206.47437%2014.1323%206.069C14.1269%205.66364%2013.9635%205.27639%2013.6768%204.98973C13.3902%204.70306%2013.0029%204.53964%2012.5976%204.53425C12.1922%204.52887%2011.8007%204.68194%2011.5066%204.96089ZM9.59545%200C8.85589%200.740444%208.48434%201.48178%208.48434%202.22222C8.48434%202.96267%208.85589%203.704%209.59545%204.44444C8.85589%203.704%208.11456%203.33333%207.37322%203.33333C6.63367%203.33333%205.89234%203.704%205.151%204.44444C5.89234%203.704%206.26211%202.96267%206.26211%202.22222C6.26211%201.48178%205.89322%200.740444%205.15189%200C5.89322%200.740444%206.63456%201.11111%207.37411%201.11111C8.11545%201.11111%208.85678%200.740444%209.59634%200H9.59545Z'%20fill='%23055AFF'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_4199_8826'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",{confirm:uu}=be,tu='<template key="type" placeholder="\u8F93\u5165\u8868\u683C\u7C7B\u578B"></template>\u8868\u683C\u4E3B\u8981\u5C55\u793A\u4E86<template key="scene" placeholder="\u8F93\u5165\u573A\u666F\u540D\u79F0"></template>\u573A\u666F\u7684\u6570\u636E,\u5305\u542B<template key="primary_key" placeholder="\u4E3B\u8981\u5B57\u6BB5(\u53EF\u5199\u591A\u4E2A,\u7528\u987F\u53F7\u5206\u9694)"></template>\u7B49\u4E3B\u8981\u5B57\u6BB5,\u652F\u6301\u7528\u6237\u67E5\u8BE2<template key="search_direction" placeholder="\u5927\u6982\u4ECB\u7ECD\u9700\u8981\u67E5\u8BE2\u7684\u65B9\u5411"></template>\u95EE\u9898,\u5982\u679C\u8BBE\u8BA1\u591A\u8868\u5173\u8054\u67E5\u8BE2,\u6700\u597D\u8BF4\u660E\u6B64\u8868\u683C\u901A\u8FC7<template key="key_name" placeholder="\u5B57\u6BB5\u540D\u79F0"></template>\u5B57\u6BB5\u53EF\u4EE5\u5173\u8054\u53E6\u4E00\u4E2A<template key="table_name" placeholder="\u8868\u683C\u540D\u79F0"></template>\u8868\u683C\u3002',au=({drawerTitle:t,drawerVisible:C,tableInfo:r,handleDrawerClose:d,optimizeDesc:f,eventsEmit:D})=>{const M=Q(()=>(r==null?void 0:r.data.find(p=>p.columnId=="name").value)||"-",[r]),[P,E]=b(""),[z,i]=b(null),[Y,V]=b(""),[A,m]=b(0),[W,H]=b(!1),[a,s]=b(!1);Ee(()=>{const p=(r==null?void 0:r.data.find(h=>h.columnId=="description").value)||"-";V(p)},[r]);const l=()=>{uu({title:"\u4F60\u786E\u5B9A\u8981\u4F7F\u7528\u6A21\u677F\u5417\uFF1F",content:"\u8FD9\u5C06\u66FF\u6362\u4F60\u5F53\u524D\u5DF2\u586B\u5199\u7684\u5185\u5BB9\uFF0C\u4E14\u65E0\u6CD5\u64A4\u9500\u3002",okText:"\u786E\u8BA4\u66FF\u6362",cancelText:"\u53D6\u6D88",onOk(){V(tu),m(p=>p+1)},onCancel(){console.log("Cancel")}})},n=X(p=>{E(p),console.log("\u6A21\u7248\u5185\u5BB9\u53D8\u5316:",p)},[]),y=X(p=>{i(()=>p),console.log("getData\u51FD\u6570\u5DF2\u8BBE\u7F6E")},[]),B=async()=>{try{H(!0);const p=await f(r.tableId);p&&(V(p),m(h=>h+1),H(!1))}catch{G.error("AI \u4F18\u5316\u5931\u8D25")}},_=X(()=>{if(!z){console.error("getData\u51FD\u6570\u5C1A\u672A\u51C6\u5907\u597D\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}const p=z("pure_string");D("table_info:update",p)},[z,D]);return I(Te,{title:t,placement:"right",width:700,onClose:d,closeIcon:!1,extra:u(De,{size:20,color:"#888888",onClick:d,className:"cursor-pointer"}),open:C,destroyOnHidden:!0,footer:u("div",{className:"flex items-center",style:{justifyContent:"end"},children:I("div",{className:"flex self-end gap-3",children:[u($,{mode:"default",label:"\u53D6\u6D88",onClick:d}),u($,{mode:"primary",label:"\u786E\u8BA4",onClick:()=>_(),disabled:W})]})}),children:[u("div",{className:"mb-[10px] font-bold",children:M}),I("div",{className:"mb-[10px]",children:[u("span",{style:{color:"#FF3B30",marginRight:"4px"},children:"*"}),u("span",{children:"\u6570\u636E\u8868\u63CF\u8FF0"}),u("span",{className:"text-[#888888] ml-[4px]",children:"(\u8BF7\u51C6\u786E\u586B\u5199\u8868\u683C\u7684\u5E94\u7528\u573A\u666F\u63CF\u8FF0\uFF0C\u5927\u6A21\u578B\u5C06\u4F9D\u8D56\u6B64\u4FE1\u606F\u8BC6\u522B\u5E76\u6B63\u786E\u8C03\u7528\u8BE5\u6570\u636E\u8868\u3002)"})]}),u(ke,{data:Y,onChange:n,onGetData:y,styles:{theme:{colors:{primary:"#0969da",secondary:"#6b7280",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6",background:"#ffffff",text:"#1f2937",border:"#e5e7eb",disabled:"#9ca3af",disabledBackground:"#f3f4f6",disabledText:"#6b7280",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)",appBackground:"transparent",listBackground:"#f9fafb",dashboardBackground:"#ffffff",textSecondary:"#6b7280"},space:{sidebar:"260px",size:"12px",radius:"8px",padding:"1rem",margin:"1rem",shadow:"0 2px 8px rgba(0,0,0,0.1)",lineHeight:"1.8"},icons:{},fonts:{body:{size:"14px",weight:"normal",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"},heading:{size:"14px",weight:"600",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"}},others:{baseFontWeight:"normal"}},templateField:{backgroundColor:"#E5EEFF",borderColor:"#84ADFF",borderRadius:"6px",padding:"6px 12px",margin:"2px",fontSize:"14px",fontWeight:"500",minWidth:"80px",textColor:"#84ADFF"}}},A),I("div",{children:[u(Ne,{open:a,onOpenChange:p=>s(!!p),content:u("div",{style:{width:"600px",margin:"10px",padding:"10px"},onClick:l,className:"hover:bg-gray-100 h-[80px] cursor-pointer rounded",children:"______\u8868\u683C\u4E3B\u8981\u5C55\u793A\u4E86______\u573A\u666F\u7684\u6570\u636E\uFF0C\u5305\u542B______\u3001______\u3001______\u7B49\u4E3B\u8981\u5B57\u6BB5\uFF0C\u652F\u6301\u7528\u6237\u67E5\u8BE2______\u95EE\u9898(\u5927\u6982\u4ECB\u7ECD)\u5982\u679C\u6D89\u53CA\u591A\u8868\u5173\u8054\u67E5\u8BE2\uFF0C\u6700\u597D\u8BF4\u660E\u6B64\u8868\u683C\u901A\u8FC7______\u5B57\u6BB5\u53EF\u4EE5\u5173\u8054\u53E6\u4E00\u4E2A______\u8868\u683C\u3002"}),title:I("div",{className:"flex justify-between items-center",style:{margin:"10px"},children:[u("div",{className:"text-[16px]",children:"\u6A21\u7248"}),u(De,{size:20,color:"#888888",onClick:()=>s(!1),className:"cursor-pointer"})]}),trigger:"click",destroyOnHidden:!0,placement:"bottomRight",getPopupContainer:p=>p,children:u("span",{children:u($,{mode:"text",icon:u("img",{src:Qe}),children:"\u4F7F\u7528\u6A21\u7248"})})}),u($,{onClick:B,mode:"text",icon:u("img",{src:eu}),loading:W,children:"AI\u4F18\u5316"})]})]})},su=""+new URL("assets/empty.png",import.meta.url).href;var N=(t=>(t[t.DATE=0]="DATE",t[t.VIEW=1]="VIEW",t[t.ERROR=2]="ERROR",t[t.AUTHORIZE=3]="AUTHORIZE",t[t.DELETE=4]="DELETE",t[t.ANALYSIS_OR_EXTRACT=5]="ANALYSIS_OR_EXTRACT",t[t.DOWNLOAD=6]="DOWNLOAD",t[t.EDIT=7]="EDIT",t[t.ADD=8]="ADD",t[t.ANALYSIS_CONFIG=9]="ANALYSIS_CONFIG",t[t.AUTHORIZE_CONFIG=10]="AUTHORIZE_CONFIG",t))(N||{}),ze=(t=>(t.GENERATING="generating",t.SUCCESS="success",t.FAIL="fail",t))(ze||{});const pe={success:"green",error:"red",warning:"orange",processing:"blue",info:"cyan",default:"default"},iu=t=>typeof t=="string"&&t in pe?pe[t]:pe.default,me=t=>{const{value:C,cell:r}=t;switch(r.columnId){case"importstatus":return C?u(fe,{title:"\u6709\u8FFD\u52A0\u5931\u8D25\u7684\u6587\u4EF6\uFF0C\u8BF7\u53CA\u65F6\u5904\u7406",children:u(Ge,{color:"red",bordered:!1,children:"\u8FFD\u52A0\u5931\u8D25"})}):u(Be,{});case"status":const d=iu(t.cell.statusType);return C=="\u5BFC\u5165\u5931\u8D25"?u(fe,{title:r.errorMsg,children:I("div",{className:"flex items-center gap-2",children:[u(he,{color:d,text:C}),u(Se,{size:14,color:"red"})]})}):u(he,{color:d,text:C});default:return u(Be,{})}},we=[{statusType:"success",value:"\u5BFC\u5165\u6210\u529F",status:"30"},{statusType:"error",value:"\u5BFC\u5165\u5931\u8D25",status:"00"},{statusType:"default",value:"\u5F85\u5BFC\u5165",status:"10"},{statusType:"processing",value:"\u5BFC\u5165\u4E2D",status:"20"},{statusType:"processing",value:"\u5BFC\u5165\u4E2D",status:"11"}],lu=t=>{var d,f;const{cell:C,value:r}=t;return typeof r=="string"?u("div",{title:r,style:{maxWidth:240,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r}):(d=C.tableMeta)!=null&&d.isGenDescription&&((f=C.tableMeta)==null?void 0:f.generateDescriptionStatus)=="generating"?I("div",{className:"flex items-center gap-1 text-[#84ADFF]",style:{color:"#84ADFF"},children:[u("span",{children:"\u751F\u6210\u4E2D"}),u(Ze,{size:14})]}):"-"},nu=({dbInfo:t,setDrawerTitle:C,setDrawerVisible:r,getBtnDisabled:d})=>I("div",{className:"flex flex-col items-center justify-center h-full",children:[u("div",{className:"text-xl font-semibold mb-3",children:u("img",{src:su,width:120})}),u("div",{className:"text-base mb-2",style:{color:"#888888"},children:"\u6682\u65E0\u6570\u636E\u6587\u4EF6"}),u("div",{className:"flex gap-3",children:u($,{mode:"primary",label:"\u4E0A\u4F20\u6570\u636E\u6587\u4EF6",disabled:d&&d(8,t==null?void 0:t.permission),onClick:()=>{C("\u4E0A\u4F20\u6570\u636E\u6587\u4EF6"),r(!0)}})})]}),Ae={views:{directDB:{label:"\u6570\u636E\u8868\u7BA1\u7406",columns:{name:"\u6570\u636E\u8868\u82F1\u6587\u540D\u79F0",cnname:"\u6570\u636E\u8868\u4E2D\u6587\u540D\u79F0",colcount:"\u5B57\u6BB5\u6570",count:"\u6570\u636E\u91CF",actions:"\u64CD\u4F5C"},toolbar:{search:"\u641C\u7D22",config:"\u914D\u7F6E"}},dataTable:{label:"\u6570\u636E\u8868\u7BA1\u7406",columns:{name:"\u6587\u4EF6\u540D",description:"\u63CF\u8FF0",descriptionHelp:"\u6253\u5F00\u81EA\u52A8\u751F\u6210\u63CF\u8FF0\u5F00\u5173\u540E\uFF0C\u82E5\u63CF\u8FF0\u672A\u6B63\u5E38\u751F\u6210\uFF0C\u5219\u63CF\u8FF0\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u5982\u60A8\u4ECD\u7136\u9700\u8981\u63CF\u8FF0\uFF0C\u5219\u9700\u8981\u624B\u52A8\u6DFB\u52A0",count:"\u6570\u636E\u91CF",status:"\u5BFC\u5165\u72B6\u6001",importStatus:"\u8FFD\u52A0\u63D0\u793A",createdAt:"\u521B\u5EFA\u65F6\u95F4",updatedAt:"\u66F4\u65B0\u65F6\u95F4",actions:"\u64CD\u4F5C"},toolbar:{upload:"\u4E0A\u4F20\u6570\u636E\u6587\u4EF6",search:"\u641C\u7D22",config:"\u914D\u7F6E"},subTable:{name:"\u8FFD\u52A0\u6587\u4EF6\u540D",count:"\u6570\u636E\u91CF",status:"\u5BFC\u5165\u72B6\u6001",createdAt:"\u521B\u5EFA\u65F6\u95F4",updatedAt:"\u66F4\u6539\u65F6\u95F4",actions:"\u64CD\u4F5C"}}},actions:{view:"\u67E5\u770B",editConfig:"\u4FEE\u6539\u914D\u7F6E",appendData:"\u8FFD\u52A0\u6570\u636E",reImport:"\u91CD\u65B0\u5BFC\u5165",delete:"\u5220\u9664",deleteSub:"\u5220\u9664",uploadDataFile:"\u4E0A\u4F20\u6570\u636E\u6587\u4EF6"},drawer:{uploadTitle:"\u4E0A\u4F20\u6570\u636E\u6587\u4EF6",appendTitle:"\u8FFD\u52A0\u6570\u636E",editConfigTitle:"\u4FEE\u6539\u6570\u636E\u914D\u7F6E"},confirm:{deleteDatabaseTitle:"\u786E\u8BA4\u5220\u9664\u6570\u636E\u5E93\uFF1F",deleteDatabaseContent:"\u8BE5\u6570\u636E\u8868\u53CA\u5176\u8FFD\u52A0\u6570\u636E\u90FD\u5C06\u88AB\u5220\u9664\u4E14\u65E0\u6CD5\u6062\u590D",deleteDataTitle:"\u786E\u8BA4\u5220\u9664\u6570\u636E\uFF1F",deleteDataContent:"\u5220\u9664\u540E\uFF0C\u8BE5\u6570\u636E\u5C06\u65E0\u6CD5\u6062\u590D",okTextDelete:"\u5220\u9664",cancelText:"\u53D6\u6D88"},message:{deleteSuccess:"\u5220\u9664\u6210\u529F",deleteFailed:"\u5220\u9664\u5931\u8D25",deleteDataFailed:"\u5220\u9664\u6570\u636E\u5931\u8D25",deleteAppendSuccess:"\u8FFD\u52A0\u6587\u4EF6\u6570\u636E\u5220\u9664\u6210\u529F",editConfigSuccess:"\u4FEE\u6539\u914D\u7F6E\u6210\u529F",editConfigFailed:"\u4FEE\u6539\u914D\u7F6E\u5931\u8D25"}},ou={views:{directDB:{label:"Table management",columns:{name:"Table name (EN)",cnname:"Table name (CN)",colcount:"Columns",count:"Rows",actions:"Actions"},toolbar:{search:"Search",config:"Settings"}},dataTable:{label:"Table management",columns:{name:"File name",description:"Description",descriptionHelp:"When auto description is enabled but not generated, the description will be empty and you can fill it manually.",count:"Rows",status:"Import status",importStatus:"Append status",createdAt:"Created at",updatedAt:"Updated at",actions:"Actions"},toolbar:{upload:"Upload data file",search:"Search",config:"Settings"},subTable:{name:"Append file name",count:"Rows",status:"Import status",createdAt:"Created at",updatedAt:"Updated at",actions:"Actions"}}},actions:{view:"View",editConfig:"Edit config",appendData:"Append data",reImport:"Re-import",delete:"Delete",deleteSub:"Delete",uploadDataFile:"Upload data file"},drawer:{uploadTitle:"Upload data file",appendTitle:"Append data",editConfigTitle:"Edit table config"},confirm:{deleteDatabaseTitle:"Delete database table?",deleteDatabaseContent:"This table and its appended data will be deleted and cannot be recovered.",deleteDataTitle:"Delete data?",deleteDataContent:"This data will be permanently deleted.",okTextDelete:"Delete",cancelText:"Cancel"},message:{deleteSuccess:"Deleted successfully",deleteFailed:"Delete failed",deleteDataFailed:"Delete failed",deleteAppendSuccess:"Append file data deleted",editConfigSuccess:"Config updated",editConfigFailed:"Config update failed"}},ru={views:{directDB:{label:"\u30C6\u30FC\u30D6\u30EB\u7BA1\u7406",columns:{name:"\u30C6\u30FC\u30D6\u30EB\u540D\uFF08\u82F1\u8A9E\uFF09",cnname:"\u30C6\u30FC\u30D6\u30EB\u540D\uFF08\u4E2D\u56FD\u8A9E\uFF09",colcount:"\u5217\u6570",count:"\u30C7\u30FC\u30BF\u91CF",actions:"\u64CD\u4F5C"},toolbar:{search:"\u691C\u7D22",config:"\u8A2D\u5B9A"}},dataTable:{label:"\u30C6\u30FC\u30D6\u30EB\u7BA1\u7406",columns:{name:"\u30D5\u30A1\u30A4\u30EB\u540D",description:"\u8AAC\u660E",descriptionHelp:"\u81EA\u52D5\u8AAC\u660E\u751F\u6210\u304C\u6709\u52B9\u3067\u3082\u8AAC\u660E\u304C\u751F\u6210\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u3001\u8AAC\u660E\u306F\u7A7A\u306B\u306A\u308A\u307E\u3059\u3002\u305D\u306E\u5834\u5408\u306F\u624B\u52D5\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",count:"\u30C7\u30FC\u30BF\u91CF",status:"\u30A4\u30F3\u30DD\u30FC\u30C8\u72B6\u614B",importStatus:"\u8FFD\u52A0\u30B9\u30C6\u30FC\u30BF\u30B9",createdAt:"\u4F5C\u6210\u65E5\u6642",updatedAt:"\u66F4\u65B0\u65E5\u6642",actions:"\u64CD\u4F5C"},toolbar:{upload:"\u30C7\u30FC\u30BF\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",search:"\u691C\u7D22",config:"\u8A2D\u5B9A"},subTable:{name:"\u8FFD\u52A0\u30D5\u30A1\u30A4\u30EB\u540D",count:"\u30C7\u30FC\u30BF\u91CF",status:"\u30A4\u30F3\u30DD\u30FC\u30C8\u72B6\u614B",createdAt:"\u4F5C\u6210\u65E5\u6642",updatedAt:"\u66F4\u65B0\u65E5\u6642",actions:"\u64CD\u4F5C"}}},actions:{view:"\u8868\u793A",editConfig:"\u8A2D\u5B9A\u3092\u7DE8\u96C6",appendData:"\u30C7\u30FC\u30BF\u3092\u8FFD\u52A0",reImport:"\u518D\u30A4\u30F3\u30DD\u30FC\u30C8",delete:"\u524A\u9664",deleteSub:"\u524A\u9664",uploadDataFile:"\u30C7\u30FC\u30BF\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9"},drawer:{uploadTitle:"\u30C7\u30FC\u30BF\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",appendTitle:"\u30C7\u30FC\u30BF\u3092\u8FFD\u52A0",editConfigTitle:"\u30C6\u30FC\u30D6\u30EB\u8A2D\u5B9A\u3092\u7DE8\u96C6"},confirm:{deleteDatabaseTitle:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F",deleteDatabaseContent:"\u3053\u306E\u30C6\u30FC\u30D6\u30EB\u3068\u305D\u306E\u8FFD\u52A0\u30C7\u30FC\u30BF\u306F\u524A\u9664\u3055\u308C\u3001\u5143\u306B\u623B\u305B\u307E\u305B\u3093\u3002",deleteDataTitle:"\u30C7\u30FC\u30BF\u3092\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F",deleteDataContent:"\u3053\u306E\u30C7\u30FC\u30BF\u306F\u5B8C\u5168\u306B\u524A\u9664\u3055\u308C\u307E\u3059\u3002",okTextDelete:"\u524A\u9664",cancelText:"\u30AD\u30E3\u30F3\u30BB\u30EB"},message:{deleteSuccess:"\u524A\u9664\u3057\u307E\u3057\u305F",deleteFailed:"\u524A\u9664\u306B\u5931\u6557\u3057\u307E\u3057\u305F",deleteDataFailed:"\u30C7\u30FC\u30BF\u306E\u524A\u9664\u306B\u5931\u6557\u3057\u307E\u3057\u305F",deleteAppendSuccess:"\u8FFD\u52A0\u30D5\u30A1\u30A4\u30EB\u306E\u30C7\u30FC\u30BF\u3092\u524A\u9664\u3057\u307E\u3057\u305F",editConfigSuccess:"\u8A2D\u5B9A\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F",editConfigFailed:"\u8A2D\u5B9A\u306E\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F"}},cu={zh:Ae,en:ou,ja:ru};function du(t,C){const r=cu[t]??Ae;return C?{...r,...C}:r}const Le=se.createContext({locale:"zh",messages:Ae});function Fu(){return se.useContext(Le)}function pu({locale:t,messages:C,children:r}){const d=se.useMemo(()=>({locale:t,messages:du(t,C)}),[t,C]);return se.createElement(Le.Provider,{value:d},r)}const{confirm:ve}=be;function mu(t,C){const{url:r,token:d,role:f,id:D,dbType:M,CustomComponents:P,getBtnDisabled:E,uploadUrl:z}=t,{messages:i}=Fu(),[Y,V]=b({container:"ready",content:"ready"}),A=Ce(null),m=Ce(null),[W,H]=b(),[a,s]=b({}),[l,n]=b(),[y,B]=b(!1),[_,p]=b(""),[h,q]=b(),[O,Z]=b(!1),[ie,le]=b(""),{getTableList:ne,delTableById:K,delFileById:oe,updateTableInfo:ee,optimizeDesc:ue,getTableTreeList:te,reParseFile:re,getDBDetailById:ce}=Me({url:r,token:d,role:f,eventsEmit:t.eventsEmit});Ee(()=>(D&&M&&(V(o=>({...o,container:"loading"})),ae()),()=>{m.current&&(clearTimeout(m.current),m.current=null)}),[D,M]);const ae=async()=>{try{const o=await ce(D,M);o&&(n(o),V(e=>({...e,container:"ready",content:"loading"})))}catch(o){console.log("[TableApiError] getDBInfo:",o)}await J()};Ue(C,()=>({getDatabaseDetail:ae}));const de=async()=>{try{if(M=="DirectDB"){const o=await ne(D);if(o){const e=c(o);return H(e||[]),V(T=>({...T,content:"ready"})),e||[]}else V(e=>({...e,content:"error"}))}else{const o=await te(D);if(o){const e=F(o);return H(e||[]),V(T=>({...T,content:"ready"})),e||[]}else V(e=>({...e,content:"error"}))}}catch(o){console.log("[TableApiError] getTableList:",o)}};function F(o){return(o||[]).map((e,T)=>{var L,U;let g=we.find(w=>w.status==e.status);const S=e.children.some(w=>w.status=="00");return{id:e.fileId.toString(),tableId:e.tableId,data:[{columnId:"name",value:(e==null?void 0:e.originalFilename)||"-",type:"label"},{columnId:"description",value:(L=e==null?void 0:e.tableMeta)==null?void 0:L.description,type:"customized",tableMeta:e==null?void 0:e.tableMeta},{columnId:"count",value:`${e.rowCount}\u884C\uFF0C${e.columnCount}\u5217`,type:"text"},{columnId:"status",...g,type:"customized",errorMsg:e.errorMsg},{columnId:"importstatus",value:S,type:"customized"},{columnId:"createdAt",value:e.gmtCreate,type:"date"},{columnId:"updatedAt",value:e.gmtModified,type:"date"},...e.status=="30"?[{columnId:"actions",value:"view",label:"\u67E5\u770B",type:"action",disabled:E&&E(N.VIEW,e.permission)},{columnId:"actions",value:"edit",label:"\u4FEE\u6539\u914D\u7F6E",type:"action",disabled:E&&E(N.EDIT,e.permission)},{columnId:"actions",value:"addData",label:"\u8FFD\u52A0\u6570\u636E",type:"action",disabled:E&&E(N.EDIT,e.permission)}]:[],...e.status=="00"?[{columnId:"actions",value:"reValidate",label:"\u91CD\u65B0\u5BFC\u5165",type:"action"}]:[],{columnId:"actions",value:"delete",label:"\u5220\u9664",type:"action",disabled:E&&E(N.DELETE,e.permission)}],expanded:!1,...e.children&&((U=e.children)==null?void 0:U.length)>0&&{children:[...(e.children||[]).map(w=>{const Ve=we.find(Re=>Re.status==w.status),_e=[{columnId:"name",value:w.originalFilename,type:"text"},{columnId:"count",value:`${w.rowCount}\u884C\uFF0C${w.columnCount}\u5217`,type:"text"},{columnId:"status",...Ve,errorMsg:w.errorMsg,type:"customized"},{columnId:"createdAt",value:w.gmtCreate,type:"date"},{columnId:"updatedAt",value:w.gmtModified,type:"date"},...w.status=="30"?[{columnId:"actions",value:"view",label:"\u67E5\u770B",type:"action",disabled:E&&E(N.VIEW,w.permission)}]:[],...w.status=="00"?[{columnId:"actions",value:"reValidate",label:"\u91CD\u65B0\u5BFC\u5165",type:"action",disabled:E&&E(N.ADD,w.permission)}]:[],{columnId:"actions",value:"delete_sub",label:"\u5220\u9664",type:"action",disabled:E&&E(N.DELETE,w.permission)}];return{id:w.fileId.toString(),tableId:w.tableId,data:_e}})]}}})}function c(o){return(o||[]).map((e,T)=>({id:e.id||We(8),data:[{columnId:"name",value:e.physicalName},{columnId:"cnname",value:e.businessName},{columnId:"colcount",value:e.columnCount},{columnId:"count",value:`${e.rowCount}\u884C\uFF0C${e.columnCount}\u5217`},{columnId:"actions",value:"view",label:"\u67E5\u770B",disabled:E&&E(N.VIEW,e.permission)}]}))}async function k(o,e,T){switch(console.log("[adopter] mergedEventsEmit",o,e,T),o){case"table_action_delete":{try{if(console.log("[delete] \u5220\u9664\u4E8B\u4EF6\u6570\u636E:",e),!e||!e.tableId&&!e.id){console.error("[delete] \u5220\u9664\u4E8B\u4EF6\u6570\u636E\u4E0D\u5B8C\u6574:",e),G.error("\u5220\u9664\u5931\u8D25\uFF1A\u6570\u636E\u4E0D\u5B8C\u6574");return}const g=e.tableId||e.id,S=e.id;ve({title:i.confirm.deleteDatabaseTitle,content:i.confirm.deleteDatabaseContent,icon:u(Se,{color:"#FF4D4F",className:"mr-[8px]"}),okText:i.confirm.okTextDelete,cancelText:i.confirm.cancelText,async onOk(){await K(g,M)&&(A!=null&&A.current)?(A==null||A.current.appFn.removeItem(S),G.success(i.message.deleteSuccess)):G.error(i.message.deleteFailed)}})}catch(g){console.error("\u5220\u9664\u8868\u6570\u636E\u5931\u8D25:",g),G.error("\u5220\u9664\u5931\u8D25")}break}case"table_action_edit":{le(i.drawer.editConfigTitle),Z(!0),q(e);break}case"toolbar_upload":{p(i.drawer.uploadTitle),B(!0);break}case"table_action_addData":{p(i.drawer.appendTitle),B(!0),q(e);break}case"table_action_reValidate":{await re(e.id)&&(m.current&&(clearTimeout(m.current),m.current=null),await J());break}case"table_info:update":{try{if(h!=null&&h.id){const g=(h==null?void 0:h.data.find(L=>L.columnId=="name").value)||"-";if(await ee({tableId:h.tableId,description:e,businessName:g})&&(A!=null&&A.current)){const L={...h,data:h.data.map(U=>U.columnId=="description"?{...U,value:e}:U)};A==null||A.current.appFn.updateItem(L,h.id),G.success("\u4FEE\u6539\u914D\u7F6E\u6210\u529F")}}}catch(g){console.error("\u4FEE\u6539\u914D\u7F6E\u5931\u8D25",g)}finally{x()}break}case"table_action_delete_sub":{try{ve({title:i.confirm.deleteDataTitle,content:i.confirm.deleteDataContent,okText:i.confirm.okTextDelete,cancelText:i.confirm.cancelText,async onOk(){const{id:g,tableId:S}=e;await oe(e.id)&&(A!=null&&A.current)&&(s(U=>({...U,[S]:[...U[S]||[],g]})),e.data.find(U=>U.status=="00")&&(m.current&&(clearTimeout(m.current),m.current=null),J()),T.removeItem(g,S),G.success(i.message.deleteAppendSuccess))}})}catch{console.log("\u5220\u9664\u8868\u6570\u636E\u5931\u8D25"),G.error(i.message.deleteDataFailed)}break}case"toolbar_auth":{typeof t.eventsEmit=="function"&&t.eventsEmit("toolbar_auth",l);break}default:typeof t.eventsEmit=="function"&&t.eventsEmit(o,e);break}}const v=Q(()=>({label:i.views.directDB.label,model:null,defaultActiveId:"direct-table-view",views:[{label:"\u6211\u7684\u6570\u636E\u5E93",id:"direct-table-view",type:"table",viewBehavior:"pagination",allowMultiSelect:!1,columns:[{id:"name",title:i.views.directDB.columns.name,type:"label"},{id:"cnname",title:i.views.directDB.columns.cnname,type:"text"},{id:"colcount",title:i.views.directDB.columns.colcount,type:"text"},{id:"count",title:i.views.directDB.columns.count,type:"text"},{id:"actions",title:i.views.directDB.columns.actions,type:"action",align:"left"}],toolbar:[{type:"fuzzy_search",key:"search",label:i.views.directDB.toolbar.search,searchKeys:["name","description"],position:"right"},{type:"button",key:"auth",label:i.views.directDB.toolbar.config,btnType:"default",position:"right"}]}]}),[W,M]),R=Q(()=>({label:i.views.dataTable.label,model:null,defaultActiveId:"data-table-view",views:[{label:i.views.dataTable.label,id:"data-table-view",type:"table",viewBehavior:"pagination",allowMultiSelect:!1,viewPageSize:10,columns:[{id:"name",title:i.views.dataTable.columns.name,type:"label",tip:i.views.dataTable.columns.name},{id:"description",title:i.views.dataTable.columns.description,type:"customized",component:u(lu,{}),helpText:i.views.dataTable.columns.descriptionHelp},{id:"count",title:i.views.dataTable.columns.count,type:"text",tip:i.views.dataTable.columns.count},{id:"status",title:i.views.dataTable.columns.status,type:"customized",component:u(me,{})},{id:"importstatus",title:i.views.dataTable.columns.importStatus,type:"customized",component:u(me,{})},{id:"createdAt",title:i.views.dataTable.columns.createdAt,type:"date",tip:i.views.dataTable.columns.createdAt},{id:"updatedAt",title:i.views.dataTable.columns.updatedAt,type:"date",tip:i.views.dataTable.columns.updatedAt},{id:"actions",title:i.views.dataTable.columns.actions,type:"action",align:"left"}],toolbar:[{type:"button",key:"upload",label:i.actions.uploadDataFile,btnType:"primary",disabled:E&&E(N.ADD,l==null?void 0:l.permission),icon:u(Oe,{size:12})},{type:"fuzzy_search",key:"search",label:i.views.dataTable.toolbar.search,searchKeys:["name","description",["name"]],position:"right"},{type:"button",key:"auth",label:i.views.dataTable.toolbar.config,btnType:"default",position:"right"}]}],subTableConfig:{type:"table",allowMultiSelect:!1,viewBehavior:"pagination",viewPageSize:5,columns:[{title:i.views.dataTable.subTable.name,id:"name",type:"text",tip:i.views.dataTable.subTable.name},{title:i.views.dataTable.subTable.count,id:"count",type:"text",tip:i.views.dataTable.subTable.count},{id:"status",title:i.views.dataTable.subTable.status,type:"customized",tip:i.views.dataTable.subTable.status,component:u(me,{})},{title:i.views.dataTable.subTable.createdAt,id:"createdAt",type:"date",tip:i.views.dataTable.subTable.createdAt},{title:i.views.dataTable.subTable.updatedAt,id:"updatedAt",type:"date",tip:i.views.dataTable.subTable.updatedAt},{title:i.views.dataTable.subTable.actions,id:"actions",type:"action",align:"left"}]},subTablePendingIds:a,onSubTableRowAnimationComplete:(o,e)=>{s(T=>({...T,[o]:(T[o]||[]).filter(g=>g!==e)}))}}),[a,W,M,l,i]),x=o=>{B(!1),Z(!1),q(void 0),o=="refresh"&&(m.current&&(clearTimeout(m.current),m.current=null),J())};function j(o){var e;if(!Array.isArray(o))return!0;for(const T of o){if(T.data){const g=T.data.find(L=>L.columnId==="status"),S=T.data.find(L=>L.columnId==="description");if(g&&(g.status==="20"||g.status==="11"||((e=S==null?void 0:S.tableMeta)==null?void 0:e.generateDescriptionStatus)==ze.GENERATING))return!1}if(Array.isArray(T.children)){for(const g of T.children)if(g.data){const S=g.data.find(L=>L.columnId==="status");if(S&&(S.status==="20"||S.status==="11"))return!1}}}return!0}const J=async()=>{const o=await de();j(o||[])?m.current&&(clearTimeout(m.current),m.current=null):(m.current&&(clearTimeout(m.current),m.current=null),m.current=setTimeout(()=>{J()},5e3))};return I($e,{title:l==null?void 0:l.name,description:(l==null?void 0:l.description)||"-",goBack:()=>{var o;(o=t.eventsEmit)==null||o.call(t,"goBack",{})},children:[u(Ie,{dataSource:W,ref:A,eventsEmit:k,status:Y,CustomComponents:{EmptyData:()=>u(nu,{dbInfo:l,setDrawerTitle:p,setDrawerVisible:B,getBtnDisabled:E}),...P},...M=="DataTable"?R:v}),u(Je,{drawerTitle:_,drawerVisible:y,handleDrawerClose:x,dbId:D,token:d,url:r,uploadUrl:z,role:f,tableInfo:h}),u(au,{drawerTitle:ie,drawerVisible:O,handleDrawerClose:x,tableInfo:h,optimizeDesc:ue,eventsEmit:k})]})}const Cu=xe(mu),ku=xe(function(C,r){const{locale:d="zh",messages:f,...D}=C;return u(pu,{locale:d,messages:f,children:u(Cu,{...D,ref:r})})});export{Le as DatabaseIdI18nContext,pu as DatabaseIdI18nProvider,ku as default,du as getDatabaseIdMessages,Fu as useDatabaseIdI18n};
|
|
16
|
+
*/const Oe=ge("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]),Xe="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%201C13.4997%201.50025%2013.25%201.99975%2013.25%202.5C13.25%203.00025%2013.4997%203.49975%2014%204C13.4997%203.49975%2013.0003%203.25%2012.5%203.25C11.9997%203.25%2011.5003%203.49975%2011%204C11.5003%203.49975%2011.75%203.00025%2011.75%202.5C11.75%201.99975%2011.5003%201.50025%2011%201C11.5003%201.50025%2011.9997%201.75%2012.5%201.75C13.0003%201.75%2013.4997%201.50025%2014%201Z'%20fill='%23055AFF'/%3e%3cpath%20d='M13%206.28571V13C13%2013.5523%2012.5523%2014%2012%2014H4C3.44772%2014%203%2013.5523%203%2013V3C3%202.44772%203.44772%202%204%202H9.25'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='6.35'%20x2='10.35'%20y2='6.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='9.35'%20x2='8.35'%20y2='9.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3c/svg%3e",Pe="data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42%2022C43.1046%2022%2044%2022.8954%2044%2024V42C44%2043.1046%2043.1046%2044%2042%2044H6C4.89543%2044%204%2043.1046%204%2042V24.0088C4%2022.9042%204.89543%2022.0078%206%2022.0078C7.10457%2022.0078%208%2022.9042%208%2024.0088V40H40V24C40%2022.8954%2040.8954%2022%2042%2022ZM24.0293%204.00195C24.0808%204.00272%2024.1322%204.00504%2024.1836%204.00977C24.1904%204.01042%2024.1973%204.011%2024.2041%204.01172C24.2673%204.01819%2024.3301%204.02757%2024.3926%204.04004C24.3939%204.04031%2024.3952%204.04075%2024.3965%204.04102C24.7693%204.11623%2025.125%204.29691%2025.4141%204.58594L34.4141%2013.5859C35.1951%2014.367%2035.1951%2015.633%2034.4141%2016.4141C33.633%2017.1951%2032.367%2017.1951%2031.5859%2016.4141L25.9922%2010.8203V32C25.9922%2033.1046%2025.0968%2034%2023.9922%2034C22.8876%2034%2021.9922%2033.1046%2021.9922%2032V10.8359L16.4141%2016.4141C15.633%2017.1951%2014.367%2017.1951%2013.5859%2016.4141C12.8049%2015.633%2012.8049%2014.367%2013.5859%2013.5859L22.498%204.67285C22.8016%204.33138%2023.2194%204.09559%2023.6924%204.02441C23.7122%204.02135%2023.732%204.01809%2023.752%204.01562C23.7862%204.01152%2023.8207%204.00919%2023.8555%204.00684C23.8887%204.00446%2023.9218%204.00268%2023.9551%204.00195C23.9674%204.00173%2023.9798%204%2023.9922%204C24.0046%204%2024.0169%204.00173%2024.0293%204.00195Z'%20fill='url(%23paint0_linear_4072_34663)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_4072_34663'%20x1='4'%20y1='-7.25'%20x2='54.4707'%20y2='1.556'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%232B69FF'/%3e%3cstop%20offset='1'%20stop-color='%238F91FF'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",Me=({url:t,token:C,role:r,eventsEmit:d})=>{const f=qe.create({baseURL:t,timeout:1e6});return f.interceptors.request.use(a=>{let s=C;return!s&&!["user/login","user/kaptcha","user/regist"].some(n=>a.url.includes(n))?(d&&d("request:error_auth",{errorMsg:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F",redirect:"/login"}),Promise.reject(new Error("\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"))):(a.headers.Authorization=s||"",a.headers.userName=r==="\u672A\u767B\u5F55\u7528\u6237"?"":r,a)}),f.interceptors.response.use(a=>{const s=["user/kaptcha"],l=a.data;if(s.some(_=>a.config.url&&a.config.url.includes(_))||l.size&&l.type)return l;const{success:n,errorMsg:y,errorCode:B}=l;if(n)return l;d&&d("request:error_business",{errorCode:B,errorMsg:y||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",response:l})},a=>{var s,l,n,y,B,_,p,h,q;if(a.message==="canceled")return Promise.reject(a);if(d){let O="request:error_network",Z={errorMsg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:a};((s=a==null?void 0:a.response)==null?void 0:s.status)===401?(O="request:error_auth",Z={errorMsg:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",error:a,redirect:"/login"}):(((n=(l=a==null?void 0:a.response)==null?void 0:l.data)==null?void 0:n.errorCode)==="30013"||((B=(y=a==null?void 0:a.response)==null?void 0:y.data)==null?void 0:B.errorCode)==="30023")&&(O="request:error_business",Z={errorCode:(p=(_=a==null?void 0:a.response)==null?void 0:_.data)==null?void 0:p.errorCode,errorMsg:((q=(h=a==null?void 0:a.response)==null?void 0:h.data)==null?void 0:q.errorMsg)||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",error:a}),d(O,Z)}return Promise.reject(a)}),{getTableList:async a=>{try{const s=await f.get(`/directDB/queryTableList/${a}`),{success:l,data:n}=s;if(l)return n}catch(s){console.log("getTableList error:",s)}},getTableTreeList:async a=>{try{const s=await f.get(`/dataTable/queryTableFileTreeList/${a}`),{success:l,data:n}=s;if(l)return n}catch(s){console.log("getTableTreeList error:",s)}},getDBDetailById:async(a,s)=>{const l=ye(s);try{const n=await f.get(`/${l}/queryDBInfo/${a}`),{success:y,data:B}=n;if(y)return B}catch(n){console.log("getDBDetailById error:",n)}},delTableById:async(a,s)=>{const l=ye(s);try{const n=await f.delete(`/${l}/deleteTable/${a}`),{success:y,data:B}=n;if(y)return B}catch(n){console.log("delTableById error:",n)}},delFileById:async a=>{try{const s=await f.delete(`/dataTable/deleteTableFileData/${a}`),{success:l,data:n}=s;if(l)return n}catch(s){console.log("delFileById",s)}},parseFiles:async({fileIds:a,isGenDescription:s,tableDescriptionMap:l})=>{try{const n=await f.post("/dataTable/parseFiles",{fileIds:a,isGenDescription:s,tableDescriptionMap:l}),{success:y,data:B}=n;if(y)return B}catch(n){console.log("parseFiles error:",n)}},reParseFile:async a=>{try{const s=await f.post(`/dataTable/reParseFile/${a}`),{success:l,data:n}=s;if(l)return n}catch(s){console.log("reParseFile error:",s)}},parseAppendFile:async({fileIds:a,tableId:s})=>{try{const l=await f.post("/dataTable/parseAppendFiles",{fileIds:a,tableId:s}),{success:n,data:y}=l;if(n)return y}catch(l){console.log("parseAppendFile error:",l)}},deleteUploadedFiles:async a=>{try{const s=await f.post("/dataTable/cancelUploadFile",{fileIds:a}),{success:l,data:n}=s;if(l)return n}catch(s){console.log("deleteUploadedFiles error:",s)}},getTableInfoById:async a=>{try{const s=await f.get(`/dataTable/queryTableMeta/${a}`),{success:l,data:n}=s;if(l)return n}catch(s){console.log("getTableInfoById error:",s)}},updateTableInfo:async({tableId:a,description:s,businessName:l})=>{try{const n=await f.post("/dataTable/updateTableInfo",{tableId:a,businessName:l,description:s}),{success:y,data:B}=n;if(y)return B}catch(n){console.log("updateTableInfo error:",n)}},optimizeDesc:async a=>{try{const s=await f.get(`/genTableDescription/${a}`),{success:l,data:n}=s;if(l)return n}catch(s){console.log("optimizeDesc error:",s)}}}},ye=t=>t=="DataTable"?"dataTable":"directDB",Fe='<template key="type" placeholder="\u8F93\u5165\u8868\u683C\u7C7B\u578B"></template>\u8868\u683C\u4E3B\u8981\u5C55\u793A\u4E86<template key="scene" placeholder="\u8F93\u5165\u573A\u666F\u540D\u79F0"></template>\u573A\u666F\u7684\u6570\u636E,\u5305\u542B<template key="primary_key" placeholder="\u4E3B\u8981\u5B57\u6BB5(\u53EF\u5199\u591A\u4E2A,\u7528\u987F\u53F7\u5206\u9694)"></template>\u7B49\u4E3B\u8981\u5B57\u6BB5,\u652F\u6301\u7528\u6237\u67E5\u8BE2<template key="search_direction" placeholder="\u5927\u6982\u4ECB\u7ECD\u9700\u8981\u67E5\u8BE2\u7684\u65B9\u5411"></template>\u95EE\u9898,\u5982\u679C\u8BBE\u8BA1\u591A\u8868\u5173\u8054\u67E5\u8BE2,\u6700\u597D\u8BF4\u660E\u6B64\u8868\u683C\u901A\u8FC7<template key="key_name" placeholder="\u5B57\u6BB5\u540D\u79F0"></template>\u5B57\u6BB5\u53EF\u4EE5\u5173\u8054\u53E6\u4E00\u4E2A<template key="table_name" placeholder="\u8868\u683C\u540D\u79F0"></template>\u8868\u683C\u3002',Ke={colors:{background:"#ffffff",border:"#e5e7eb",appBackground:"#ffffff",listBackground:"#ffffff",dashboardBackground:"#ffffff"},space:{padding:"0",margin:"md",shadow:"none"}},Je=({drawerTitle:t,drawerVisible:C,uploadUrl:r,handleDrawerClose:d,dbId:f,tableInfo:D,token:M,url:P,role:E})=>{const z=Q(()=>({id:"upload",layout:"vertical",formWidth:"670px",fields:[{id:"fileIds",name:"fileIds",type:"uploader",required:!1,defaultValue:"",uploaderConfig:{multiple:!D,accept:".csv,.xlsx,.xls",maxFiles:D?1:20,url:r,autoUpload:!0,headers:{Authorization:M},queryParams:{databaseId:f,...D&&{tableId:D.tableId}},placeholder:I("div",{children:[u("div",{className:"text-lg font-bold",children:"\u70B9\u51FB\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u5904\u4E0A\u4F20"}),I("div",{className:"flex flex-col gap-1.8 mt-[12px]",children:[u("div",{className:"text-[#888888] font-[12px]",children:"\u6570\u91CF\uFF1A\u226420 \u6587\u4EF6\uFF08\u5F53\u524D 0/20\uFF09"}),u("div",{className:"text-[#888888] font-[12px]",style:{width:"580px"},children:"\u683C\u5F0F\uFF1A.xlsx / .xls / .csv /\uFF08\u7B2C\u4E00\u884C\u662F\u8868\u5934\uFF0C\u5176\u4ED6\u884C\u662F\u6570\u636E\uFF1BCSV \u652F\u6301 UTF-8/GBK/GB2312\u2026\uFF09"}),u("div",{className:"text-[#888888] font-[12px]",children:"\u5355\u6587\u4EF6\u9650\u5236\uFF1A \u226410\u4E07\u884C\uFF0C\u226460\u5217\uFF08\u8D85\u51FA\u81EA\u52A8\u5FFD\u7565\uFF09\uFF1B \u6BCF\u6587\u4EF6 \u22641\u4E2ASheet"}),u("div",{className:"text-[#888888] font-[12px]",children:"\u4E0A\u4F20\u7684\u6587\u4EF6\uFF0C\u5982\u679C\u6709\u4E0D\u7B26\u5408\u6587\u672C\u683C\u5F0F\u7684\u6570\u636E\u7CFB\u7EDF\u81EA\u52A8\u5FFD\u7565"})]})]}),listName:D?"\u8FFD\u52A0\u6587\u4EF6":"\u4E0A\u4F20\u6587\u4EF6\u5217\u8868",icons:{dragUpload:u("img",{src:Pe,width:40}),itemStatus:{pending:u("span",{style:{fontSize:"12px",color:"#6b7280"}}),uploading:u("span",{style:{fontSize:"12px",color:"#007bff"}}),success:u("span",{style:{fontSize:"12px",color:"#10b981"}}),error:u("span",{style:{fontSize:"12px",color:"#ef4444"},children:"\u5931\u8D25"})},fileType:{default:u(Ye,{size:20,style:{color:"#6b7280"}})}},...!D&&{buttons:[{label:"\u4F7F\u7528\u6A21\u7248",icon:u("img",{src:Xe}),mode:"text",onClick:()=>{n(!0)}}]},...!D&&{itemForm:[{type:"textarea",name:"description",counter:150,placeholder:"\u4E3A\u4E86\u63D0\u9AD8\u95EE\u7B54\u51C6\u786E\u7387\uFF0C\u8BF7\u8F93\u5165\u63CF\u8FF0"}]}}}]}),[D]),[i,Y]=b(!1),[V,A]=b({}),m=Ce(null),[W,H]=b(!1),[a,s]=b([]);console.log(a,"+++++file");const[l,n]=b(!1),[y,B]=b(Fe),[_,p]=b(null),[h,q]=b(Fe),[O,Z]=b(0),{parseFiles:ie,parseAppendFile:le,deleteUploadedFiles:ne}=Me({url:P,token:M,role:E});Ee(()=>()=>{s([])},[C]);const K=X(async(F,c,k)=>{var v;switch(console.log("[DynamicFormAdopter] \u4E8B\u4EF6:",F,c),F){case"form:ready":c.formRef?m.current=c.formRef:console.log("\u274C data.formRef \u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u4FDD\u5B58\u8868\u5355\u5F15\u7528");break;case"form:submit":ee();break;case"form_field_change":A(x=>({...x,[c.fieldId]:c.value}));break;case"uploader:error":(v=c.item)!=null&&v.id?s(x=>[{id:c.item.id,status:c.item.status},...x]):G.error(c==null?void 0:c.message);break;case"uploader:success":s(x=>[{id:c.item.id,status:c.item.status},...x]);break;case"uploader:remove":const R=c.item.status;s(x=>x.filter(j=>j.id!==c.item.id)),R=="success"&&await te([c.item.uploadApiRes]);break;default:console.log("\u672A\u5904\u7406\u7684\u4E8B\u4EF6:",F)}},[]),oe=Q(()=>({label:"\u52A8\u6001\u8868\u5355\u793A\u4F8B",defaultActiveId:"form-view",model:null,views:[{label:"\u7528\u6237\u6CE8\u518C\u8868\u5355",id:"form-view",type:"form",size:"md",formWidth:z.formWidth,formConfig:{layout:z.layout,showReset:!1,showSubmit:!1,formWidth:z.formWidth,getFormData:()=>({...V,timestamp:new Date().toISOString(),formId:z.id}),onFieldChange:(F,c)=>{K("form_field_change",{fieldId:F,value:c},void 0)},onValidationError:F=>{K("form_validation_error",F,void 0)}}}],dataSource:[{id:z.id,fields:z.fields,defaultValues:{}}],eventsEmit:K,styles:{theme:Ke}}),[D,z]),ee=async()=>{var F;try{Y(!0);const c=await m.current.getAllData();if(c.isValid){const k=(F=c.fields.find(v=>v.name=="fileIds"))==null?void 0:F.value;if(Array.isArray(k)&&(k==null?void 0:k.length)>0){let v;if(D)v=await le({fileIds:k.map(R=>R.uploadApiRes),tableId:D.id});else{const R={fileIds:k.map(x=>x.uploadApiRes),tableDescriptionMap:k.reduce((x,j)=>(x[j.uploadApiRes]=j.formData.description,x),{}),isGenDescription:W};v=await ie(R)}v&&(d("refresh"),s([]))}}}catch(c){console.error("\u8868\u5355\u6570\u636E\u5931\u8D25:",c)}finally{d(),Y(!1),H(!1),s([])}},ue=async F=>{var c;try{const k=await m.current.getAllData();if(k.isValid){const v=(c=k.fields.find(R=>R.name=="fileIds"))==null?void 0:c.value;if(v&&Array.isArray(v)&&(v==null?void 0:v.length)>0){const R=v.map(j=>j.uploadApiRes),x=await te(R)}}}catch(k){console.error("\u8868\u5355\u6570\u636E\u5931\u8D25:",k)}finally{d(),H(!1),s([])}},te=async F=>{try{const c=await ne(F);if(c)return c}catch(c){console.error("\u5220\u9664\u6587\u4EF6\u6570\u636E\u5931\u8D25:",c)}},re=F=>{H(F)},ce=X(F=>{B(F),console.log("\u6A21\u7248\u5185\u5BB9\u53D8\u5316:",F)},[]),ae=X(F=>{p(()=>F),console.log("getData\u51FD\u6570\u5DF2\u8BBE\u7F6E")},[]),de=X(async()=>{try{if(!_){console.error("getData\u51FD\u6570\u5C1A\u672A\u51C6\u5907\u597D\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}const F=_("pure_string");await navigator.clipboard.writeText(F),G.success("\u5DF2\u590D\u5236",1)}catch(F){console.error("\u590D\u5236\u5931\u8D25:",F)}finally{n(!1)}},[_]);return I(Te,{title:t,rootClassName:"database-upload-drawer",placement:"right",width:700,closeIcon:!1,extra:u(De,{size:20,color:"#888888",onClick:()=>ue(),className:"cursor-pointer"}),open:C,destroyOnHidden:!0,footer:I("div",{className:"flex items-center",style:{justifyContent:D?"end":"space-between"},children:[!D&&I("div",{className:"flex gap-2 items-center text-[#555555]",children:[u("span",{children:"\u81EA\u52A8\u751F\u6210\u6570\u636E\u8868\u63CF\u8FF0"})," ",u(fe,{title:"\u81EA\u52A8\u751F\u6210\u5F00\u542F\u65F6\u5C06\u57FA\u4E8E\u6570\u636E\u667A\u80FD\u751F\u6210\u63CF\u8FF0\uFF1B\u82E5\u5F00\u542F\u6B64\u529F\u80FD\u5E76\u624B\u52A8\u586B\u5199\u63CF\u8FF0\uFF0C\u5C06\u4F18\u5148\u91C7\u7528\u7528\u6237\u586B\u5199\u7684\u5185\u5BB9\u3002",children:u(je,{size:14})}),u(He,{onChange:re})]}),I("div",{className:"flex self-end gap-3",children:[u($,{mode:"default",style:{marginRight:10},label:"\u53D6\u6D88",onClick:ue}),u($,{mode:"primary",label:"\u786E\u8BA4\u5BFC\u5165",loading:i,disabled:a.some(F=>F.status=="error"),onClick:async()=>{await ee()}})]})]}),children:[u(Ie,{...oe},"upload-file"),u(be,{title:I("div",{children:["\u6A21\u7248",u("span",{className:"text-[12px] text-[#888888]",style:{marginLeft:8},children:"\u5B8C\u6210\u7F16\u8F91\u540E\uFF0C\u53EF\u5C06\u6587\u672C\u590D\u5236\u7C98\u8D34\u5230\u76F8\u5E94\u63CF\u8FF0\u6846\u4E2D\u3002"})]}),width:672,destroyOnHidden:!0,open:l,onCancel:()=>n(!1),footer:I("div",{className:"flex justify-end items-center gap-3",children:[u($,{mode:"default",label:"\u91CD\u7F6E",onClick:()=>{q(Fe),Z(F=>F+1)}}),u($,{mode:"primary",label:"\u590D\u5236",onClick:de})]}),children:u(ke,{data:h,onChange:ce,onGetData:ae,styles:{theme:{colors:{primary:"#0969da",secondary:"#6b7280",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6",background:"#ffffff",text:"#1f2937",border:"#e5e7eb",disabled:"#9ca3af",disabledBackground:"#f3f4f6",disabledText:"#6b7280",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)",appBackground:"transparent",listBackground:"#f9fafb",dashboardBackground:"#ffffff",textSecondary:"#6b7280"},space:{sidebar:"260px",size:"12px",radius:"8px",padding:"1rem",margin:"1rem",shadow:"0 2px 8px rgba(0,0,0,0.1)",lineHeight:"1.8"},icons:{},fonts:{body:{size:"14px",weight:"normal",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"},heading:{size:"14px",weight:"600",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"}},others:{baseFontWeight:"normal"}},templateField:{backgroundColor:"#E5EEFF",borderColor:"#84ADFF",borderRadius:"6px",padding:"6px 12px",margin:"2px",fontSize:"14px",fontWeight:"500",minWidth:"80px",textColor:"#84ADFF"}}},O)})]})},Qe="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%201C13.4997%201.50025%2013.25%201.99975%2013.25%202.5C13.25%203.00025%2013.4997%203.49975%2014%204C13.4997%203.49975%2013.0003%203.25%2012.5%203.25C11.9997%203.25%2011.5003%203.49975%2011%204C11.5003%203.49975%2011.75%203.00025%2011.75%202.5C11.75%201.99975%2011.5003%201.50025%2011%201C11.5003%201.50025%2011.9997%201.75%2012.5%201.75C13.0003%201.75%2013.4997%201.50025%2014%201Z'%20fill='%23055AFF'/%3e%3cpath%20d='M13%206.28571V13C13%2013.5523%2012.5523%2014%2012%2014H4C3.44772%2014%203%2013.5523%203%2013V3C3%202.44772%203.44772%202%204%202H9.25'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='6.35'%20x2='10.35'%20y2='6.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='9.35'%20x2='8.35'%20y2='9.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3c/svg%3e",eu="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_4199_8826)'%3e%3cpath%20d='M15.5554%2012.4444C14.9626%2013.0373%2014.6666%2013.6293%2014.6666%2014.2222C14.6666%2014.8151%2014.9626%2015.4071%2015.5554%2016C14.9626%2015.4071%2014.3706%2015.1111%2013.7777%2015.1111C13.1848%2015.1111%2012.5928%2015.4071%2011.9999%2016C12.5928%2015.4071%2012.8888%2014.8151%2012.8888%2014.2222C12.8888%2013.6293%2012.5928%2013.0373%2011.9999%2012.4444C12.5928%2013.0373%2013.1848%2013.3333%2013.7777%2013.3333C14.3706%2013.3333%2014.9626%2013.0373%2015.5554%2012.4444ZM14.6488%204.01778C15.1905%204.55954%2015.4948%205.29431%2015.4948%206.06044C15.4948%206.82658%2015.1905%207.56135%2014.6488%208.10311L7.735%2015.0169C7.46766%2015.2892%207.14901%2015.5058%206.79746%2015.6543C6.44592%2015.8028%206.06844%2015.8801%205.68684%2015.8819C5.30523%2015.8836%204.92706%2015.8097%204.57417%2015.6645C4.22127%2015.5193%203.90065%2015.3056%203.63081%2015.0357C3.36097%2014.7659%203.14727%2014.4453%203.00205%2014.0924C2.85682%2013.7395%202.78295%2013.3613%202.7847%2012.9797C2.78646%2012.5981%202.8638%2012.2206%203.01226%2011.8691C3.16072%2011.5176%203.37736%2011.1989%203.64967%2010.9316L3.95545%2010.6249L3.85145%2010.5244C3.30922%2010.0267%202.76522%209.77778%202.22211%209.77778C1.62923%209.77778%201.03722%2010.0738%200.444336%2010.6667C1.03722%2010.0738%201.33322%209.48178%201.33322%208.88889C1.33322%208.296%201.03722%207.704%200.444336%207.11111C1.03722%207.704%201.62923%208%202.22211%208C2.815%208%203.407%207.704%203.99989%207.11111C3.407%207.704%203.111%208.296%203.111%208.88889C3.111%209.46667%203.39278%2010.0444%203.95545%2010.6222L10.5634%204.01778C11.1052%203.47606%2011.84%203.17173%2012.6061%203.17173C13.3723%203.17173%2014.107%203.47606%2014.6488%204.01778ZM9.55189%206.91378L4.59189%2011.8738C4.30004%2012.1655%204.13603%2012.5612%204.13594%2012.9739C4.1359%2013.1782%204.17611%2013.3806%204.25426%2013.5694C4.33242%2013.7582%204.44699%2013.9297%204.59145%2014.0742C4.7359%2014.2187%204.9074%2014.3334%205.09617%2014.4116C5.28493%2014.4898%205.48725%2014.5301%205.69158%2014.5302C6.10424%2014.5303%206.50004%2014.3664%206.79189%2014.0747L11.7519%209.11378L9.55189%206.91378ZM11.5066%204.96089L10.495%205.97156L12.695%208.17156L13.7057%207.16C13.9846%206.86582%2014.1377%206.47437%2014.1323%206.069C14.1269%205.66364%2013.9635%205.27639%2013.6768%204.98973C13.3902%204.70306%2013.0029%204.53964%2012.5976%204.53425C12.1922%204.52887%2011.8007%204.68194%2011.5066%204.96089ZM9.59545%200C8.85589%200.740444%208.48434%201.48178%208.48434%202.22222C8.48434%202.96267%208.85589%203.704%209.59545%204.44444C8.85589%203.704%208.11456%203.33333%207.37322%203.33333C6.63367%203.33333%205.89234%203.704%205.151%204.44444C5.89234%203.704%206.26211%202.96267%206.26211%202.22222C6.26211%201.48178%205.89322%200.740444%205.15189%200C5.89322%200.740444%206.63456%201.11111%207.37411%201.11111C8.11545%201.11111%208.85678%200.740444%209.59634%200H9.59545Z'%20fill='%23055AFF'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_4199_8826'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",{confirm:uu}=be,tu='<template key="type" placeholder="\u8F93\u5165\u8868\u683C\u7C7B\u578B"></template>\u8868\u683C\u4E3B\u8981\u5C55\u793A\u4E86<template key="scene" placeholder="\u8F93\u5165\u573A\u666F\u540D\u79F0"></template>\u573A\u666F\u7684\u6570\u636E,\u5305\u542B<template key="primary_key" placeholder="\u4E3B\u8981\u5B57\u6BB5(\u53EF\u5199\u591A\u4E2A,\u7528\u987F\u53F7\u5206\u9694)"></template>\u7B49\u4E3B\u8981\u5B57\u6BB5,\u652F\u6301\u7528\u6237\u67E5\u8BE2<template key="search_direction" placeholder="\u5927\u6982\u4ECB\u7ECD\u9700\u8981\u67E5\u8BE2\u7684\u65B9\u5411"></template>\u95EE\u9898,\u5982\u679C\u8BBE\u8BA1\u591A\u8868\u5173\u8054\u67E5\u8BE2,\u6700\u597D\u8BF4\u660E\u6B64\u8868\u683C\u901A\u8FC7<template key="key_name" placeholder="\u5B57\u6BB5\u540D\u79F0"></template>\u5B57\u6BB5\u53EF\u4EE5\u5173\u8054\u53E6\u4E00\u4E2A<template key="table_name" placeholder="\u8868\u683C\u540D\u79F0"></template>\u8868\u683C\u3002',au=({drawerTitle:t,drawerVisible:C,tableInfo:r,handleDrawerClose:d,optimizeDesc:f,eventsEmit:D})=>{const M=Q(()=>(r==null?void 0:r.data.find(p=>p.columnId=="name").value)||"-",[r]),[P,E]=b(""),[z,i]=b(null),[Y,V]=b(""),[A,m]=b(0),[W,H]=b(!1),[a,s]=b(!1);Ee(()=>{const p=(r==null?void 0:r.data.find(h=>h.columnId=="description").value)||"-";V(p)},[r]);const l=()=>{uu({title:"\u4F60\u786E\u5B9A\u8981\u4F7F\u7528\u6A21\u677F\u5417\uFF1F",content:"\u8FD9\u5C06\u66FF\u6362\u4F60\u5F53\u524D\u5DF2\u586B\u5199\u7684\u5185\u5BB9\uFF0C\u4E14\u65E0\u6CD5\u64A4\u9500\u3002",okText:"\u786E\u8BA4\u66FF\u6362",cancelText:"\u53D6\u6D88",onOk(){V(tu),m(p=>p+1)},onCancel(){console.log("Cancel")}})},n=X(p=>{E(p),console.log("\u6A21\u7248\u5185\u5BB9\u53D8\u5316:",p)},[]),y=X(p=>{i(()=>p),console.log("getData\u51FD\u6570\u5DF2\u8BBE\u7F6E")},[]),B=async()=>{try{H(!0);const p=await f(r.tableId);p&&(V(p),m(h=>h+1),H(!1))}catch{G.error("AI \u4F18\u5316\u5931\u8D25")}},_=X(()=>{if(!z){console.error("getData\u51FD\u6570\u5C1A\u672A\u51C6\u5907\u597D\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}const p=z("pure_string");D("table_info:update",p)},[z,D]);return I(Te,{title:t,placement:"right",width:700,onClose:d,closeIcon:!1,extra:u(De,{size:20,color:"#888888",onClick:d,className:"cursor-pointer"}),open:C,destroyOnHidden:!0,footer:u("div",{className:"flex items-center",style:{justifyContent:"end"},children:I("div",{className:"flex self-end gap-3",children:[u($,{mode:"default",label:"\u53D6\u6D88",onClick:d}),u($,{mode:"primary",label:"\u786E\u8BA4",onClick:()=>_(),disabled:W})]})}),children:[u("div",{className:"mb-[10px] font-bold",children:M}),I("div",{className:"mb-[10px]",children:[u("span",{style:{color:"#FF3B30",marginRight:"4px"},children:"*"}),u("span",{children:"\u6570\u636E\u8868\u63CF\u8FF0"}),u("span",{className:"text-[#888888] ml-[4px]",children:"(\u8BF7\u51C6\u786E\u586B\u5199\u8868\u683C\u7684\u5E94\u7528\u573A\u666F\u63CF\u8FF0\uFF0C\u5927\u6A21\u578B\u5C06\u4F9D\u8D56\u6B64\u4FE1\u606F\u8BC6\u522B\u5E76\u6B63\u786E\u8C03\u7528\u8BE5\u6570\u636E\u8868\u3002)"})]}),u(ke,{data:Y,onChange:n,onGetData:y,styles:{theme:{colors:{primary:"#0969da",secondary:"#6b7280",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6",background:"#ffffff",text:"#1f2937",border:"#e5e7eb",disabled:"#9ca3af",disabledBackground:"#f3f4f6",disabledText:"#6b7280",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)",appBackground:"transparent",listBackground:"#f9fafb",dashboardBackground:"#ffffff",textSecondary:"#6b7280"},space:{sidebar:"260px",size:"12px",radius:"8px",padding:"1rem",margin:"1rem",shadow:"0 2px 8px rgba(0,0,0,0.1)",lineHeight:"1.8"},icons:{},fonts:{body:{size:"14px",weight:"normal",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"},heading:{size:"14px",weight:"600",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"}},others:{baseFontWeight:"normal"}},templateField:{backgroundColor:"#E5EEFF",borderColor:"#84ADFF",borderRadius:"6px",padding:"6px 12px",margin:"2px",fontSize:"14px",fontWeight:"500",minWidth:"80px",textColor:"#84ADFF"}}},A),I("div",{children:[u(Ne,{open:a,onOpenChange:p=>s(!!p),content:u("div",{style:{width:"600px",margin:"10px",padding:"10px"},onClick:l,className:"hover:bg-gray-100 h-[80px] cursor-pointer rounded",children:"______\u8868\u683C\u4E3B\u8981\u5C55\u793A\u4E86______\u573A\u666F\u7684\u6570\u636E\uFF0C\u5305\u542B______\u3001______\u3001______\u7B49\u4E3B\u8981\u5B57\u6BB5\uFF0C\u652F\u6301\u7528\u6237\u67E5\u8BE2______\u95EE\u9898(\u5927\u6982\u4ECB\u7ECD)\u5982\u679C\u6D89\u53CA\u591A\u8868\u5173\u8054\u67E5\u8BE2\uFF0C\u6700\u597D\u8BF4\u660E\u6B64\u8868\u683C\u901A\u8FC7______\u5B57\u6BB5\u53EF\u4EE5\u5173\u8054\u53E6\u4E00\u4E2A______\u8868\u683C\u3002"}),title:I("div",{className:"flex justify-between items-center",style:{margin:"10px"},children:[u("div",{className:"text-[16px]",children:"\u6A21\u7248"}),u(De,{size:20,color:"#888888",onClick:()=>s(!1),className:"cursor-pointer"})]}),trigger:"click",destroyOnHidden:!0,placement:"bottomRight",getPopupContainer:p=>p,children:u("span",{children:u($,{mode:"text",icon:u("img",{src:Qe}),children:"\u4F7F\u7528\u6A21\u7248"})})}),u($,{onClick:B,mode:"text",icon:u("img",{src:eu}),loading:W,children:"AI\u4F18\u5316"})]})]})},su=""+new URL("assets/empty2.png",import.meta.url).href;var N=(t=>(t[t.DATE=0]="DATE",t[t.VIEW=1]="VIEW",t[t.ERROR=2]="ERROR",t[t.AUTHORIZE=3]="AUTHORIZE",t[t.DELETE=4]="DELETE",t[t.ANALYSIS_OR_EXTRACT=5]="ANALYSIS_OR_EXTRACT",t[t.DOWNLOAD=6]="DOWNLOAD",t[t.EDIT=7]="EDIT",t[t.ADD=8]="ADD",t[t.ANALYSIS_CONFIG=9]="ANALYSIS_CONFIG",t[t.AUTHORIZE_CONFIG=10]="AUTHORIZE_CONFIG",t))(N||{}),ze=(t=>(t.GENERATING="generating",t.SUCCESS="success",t.FAIL="fail",t))(ze||{});const pe={success:"green",error:"red",warning:"orange",processing:"blue",info:"cyan",default:"default"},iu=t=>typeof t=="string"&&t in pe?pe[t]:pe.default,me=t=>{const{value:C,cell:r}=t;switch(r.columnId){case"importstatus":return C?u(fe,{title:"\u6709\u8FFD\u52A0\u5931\u8D25\u7684\u6587\u4EF6\uFF0C\u8BF7\u53CA\u65F6\u5904\u7406",children:u(Ge,{color:"red",bordered:!1,children:"\u8FFD\u52A0\u5931\u8D25"})}):u(Be,{});case"status":const d=iu(t.cell.statusType);return C=="\u5BFC\u5165\u5931\u8D25"?u(fe,{title:r.errorMsg,children:I("div",{className:"flex items-center gap-2",children:[u(he,{color:d,text:C}),u(Se,{size:14,color:"red"})]})}):u(he,{color:d,text:C});default:return u(Be,{})}},we=[{statusType:"success",value:"\u5BFC\u5165\u6210\u529F",status:"30"},{statusType:"error",value:"\u5BFC\u5165\u5931\u8D25",status:"00"},{statusType:"default",value:"\u5F85\u5BFC\u5165",status:"10"},{statusType:"processing",value:"\u5BFC\u5165\u4E2D",status:"20"},{statusType:"processing",value:"\u5BFC\u5165\u4E2D",status:"11"}],lu=t=>{var d,f;const{cell:C,value:r}=t;return typeof r=="string"?u("div",{title:r,style:{maxWidth:240,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r}):(d=C.tableMeta)!=null&&d.isGenDescription&&((f=C.tableMeta)==null?void 0:f.generateDescriptionStatus)=="generating"?I("div",{className:"flex items-center gap-1 text-[#84ADFF]",style:{color:"#84ADFF"},children:[u("span",{children:"\u751F\u6210\u4E2D"}),u(Ze,{size:14})]}):"-"},nu=({dbInfo:t,setDrawerTitle:C,setDrawerVisible:r,getBtnDisabled:d})=>I("div",{className:"flex flex-col items-center justify-center h-full",children:[u("div",{className:"text-xl font-semibold mb-3",children:u("img",{src:su,width:120})}),u("div",{className:"text-base mb-2",style:{color:"#888888"},children:"\u6682\u65E0\u6570\u636E\u6587\u4EF6"}),u("div",{className:"flex gap-3",children:u($,{mode:"primary",label:"\u4E0A\u4F20\u6570\u636E\u6587\u4EF6",disabled:d&&d(8,t==null?void 0:t.permission),onClick:()=>{C("\u4E0A\u4F20\u6570\u636E\u6587\u4EF6"),r(!0)}})})]}),Ae={views:{directDB:{label:"\u6570\u636E\u8868\u7BA1\u7406",columns:{name:"\u6570\u636E\u8868\u82F1\u6587\u540D\u79F0",cnname:"\u6570\u636E\u8868\u4E2D\u6587\u540D\u79F0",colcount:"\u5B57\u6BB5\u6570",count:"\u6570\u636E\u91CF",actions:"\u64CD\u4F5C"},toolbar:{search:"\u641C\u7D22",config:"\u914D\u7F6E"}},dataTable:{label:"\u6570\u636E\u8868\u7BA1\u7406",columns:{name:"\u6587\u4EF6\u540D",description:"\u63CF\u8FF0",descriptionHelp:"\u6253\u5F00\u81EA\u52A8\u751F\u6210\u63CF\u8FF0\u5F00\u5173\u540E\uFF0C\u82E5\u63CF\u8FF0\u672A\u6B63\u5E38\u751F\u6210\uFF0C\u5219\u63CF\u8FF0\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u5982\u60A8\u4ECD\u7136\u9700\u8981\u63CF\u8FF0\uFF0C\u5219\u9700\u8981\u624B\u52A8\u6DFB\u52A0",count:"\u6570\u636E\u91CF",status:"\u5BFC\u5165\u72B6\u6001",importStatus:"\u8FFD\u52A0\u63D0\u793A",createdAt:"\u521B\u5EFA\u65F6\u95F4",updatedAt:"\u66F4\u65B0\u65F6\u95F4",actions:"\u64CD\u4F5C"},toolbar:{upload:"\u4E0A\u4F20\u6570\u636E\u6587\u4EF6",search:"\u641C\u7D22",config:"\u914D\u7F6E"},subTable:{name:"\u8FFD\u52A0\u6587\u4EF6\u540D",count:"\u6570\u636E\u91CF",status:"\u5BFC\u5165\u72B6\u6001",createdAt:"\u521B\u5EFA\u65F6\u95F4",updatedAt:"\u66F4\u6539\u65F6\u95F4",actions:"\u64CD\u4F5C"}}},actions:{view:"\u67E5\u770B",editConfig:"\u4FEE\u6539\u914D\u7F6E",appendData:"\u8FFD\u52A0\u6570\u636E",reImport:"\u91CD\u65B0\u5BFC\u5165",delete:"\u5220\u9664",deleteSub:"\u5220\u9664",uploadDataFile:"\u4E0A\u4F20\u6570\u636E\u6587\u4EF6"},drawer:{uploadTitle:"\u4E0A\u4F20\u6570\u636E\u6587\u4EF6",appendTitle:"\u8FFD\u52A0\u6570\u636E",editConfigTitle:"\u4FEE\u6539\u6570\u636E\u914D\u7F6E"},confirm:{deleteDatabaseTitle:"\u786E\u8BA4\u5220\u9664\u6570\u636E\u5E93\uFF1F",deleteDatabaseContent:"\u8BE5\u6570\u636E\u8868\u53CA\u5176\u8FFD\u52A0\u6570\u636E\u90FD\u5C06\u88AB\u5220\u9664\u4E14\u65E0\u6CD5\u6062\u590D",deleteDataTitle:"\u786E\u8BA4\u5220\u9664\u6570\u636E\uFF1F",deleteDataContent:"\u5220\u9664\u540E\uFF0C\u8BE5\u6570\u636E\u5C06\u65E0\u6CD5\u6062\u590D",okTextDelete:"\u5220\u9664",cancelText:"\u53D6\u6D88"},message:{deleteSuccess:"\u5220\u9664\u6210\u529F",deleteFailed:"\u5220\u9664\u5931\u8D25",deleteDataFailed:"\u5220\u9664\u6570\u636E\u5931\u8D25",deleteAppendSuccess:"\u8FFD\u52A0\u6587\u4EF6\u6570\u636E\u5220\u9664\u6210\u529F",editConfigSuccess:"\u4FEE\u6539\u914D\u7F6E\u6210\u529F",editConfigFailed:"\u4FEE\u6539\u914D\u7F6E\u5931\u8D25"}},ou={views:{directDB:{label:"Table management",columns:{name:"Table name (EN)",cnname:"Table name (CN)",colcount:"Columns",count:"Rows",actions:"Actions"},toolbar:{search:"Search",config:"Settings"}},dataTable:{label:"Table management",columns:{name:"File name",description:"Description",descriptionHelp:"When auto description is enabled but not generated, the description will be empty and you can fill it manually.",count:"Rows",status:"Import status",importStatus:"Append status",createdAt:"Created at",updatedAt:"Updated at",actions:"Actions"},toolbar:{upload:"Upload data file",search:"Search",config:"Settings"},subTable:{name:"Append file name",count:"Rows",status:"Import status",createdAt:"Created at",updatedAt:"Updated at",actions:"Actions"}}},actions:{view:"View",editConfig:"Edit config",appendData:"Append data",reImport:"Re-import",delete:"Delete",deleteSub:"Delete",uploadDataFile:"Upload data file"},drawer:{uploadTitle:"Upload data file",appendTitle:"Append data",editConfigTitle:"Edit table config"},confirm:{deleteDatabaseTitle:"Delete database table?",deleteDatabaseContent:"This table and its appended data will be deleted and cannot be recovered.",deleteDataTitle:"Delete data?",deleteDataContent:"This data will be permanently deleted.",okTextDelete:"Delete",cancelText:"Cancel"},message:{deleteSuccess:"Deleted successfully",deleteFailed:"Delete failed",deleteDataFailed:"Delete failed",deleteAppendSuccess:"Append file data deleted",editConfigSuccess:"Config updated",editConfigFailed:"Config update failed"}},ru={views:{directDB:{label:"\u30C6\u30FC\u30D6\u30EB\u7BA1\u7406",columns:{name:"\u30C6\u30FC\u30D6\u30EB\u540D\uFF08\u82F1\u8A9E\uFF09",cnname:"\u30C6\u30FC\u30D6\u30EB\u540D\uFF08\u4E2D\u56FD\u8A9E\uFF09",colcount:"\u5217\u6570",count:"\u30C7\u30FC\u30BF\u91CF",actions:"\u64CD\u4F5C"},toolbar:{search:"\u691C\u7D22",config:"\u8A2D\u5B9A"}},dataTable:{label:"\u30C6\u30FC\u30D6\u30EB\u7BA1\u7406",columns:{name:"\u30D5\u30A1\u30A4\u30EB\u540D",description:"\u8AAC\u660E",descriptionHelp:"\u81EA\u52D5\u8AAC\u660E\u751F\u6210\u304C\u6709\u52B9\u3067\u3082\u8AAC\u660E\u304C\u751F\u6210\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u3001\u8AAC\u660E\u306F\u7A7A\u306B\u306A\u308A\u307E\u3059\u3002\u305D\u306E\u5834\u5408\u306F\u624B\u52D5\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",count:"\u30C7\u30FC\u30BF\u91CF",status:"\u30A4\u30F3\u30DD\u30FC\u30C8\u72B6\u614B",importStatus:"\u8FFD\u52A0\u30B9\u30C6\u30FC\u30BF\u30B9",createdAt:"\u4F5C\u6210\u65E5\u6642",updatedAt:"\u66F4\u65B0\u65E5\u6642",actions:"\u64CD\u4F5C"},toolbar:{upload:"\u30C7\u30FC\u30BF\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",search:"\u691C\u7D22",config:"\u8A2D\u5B9A"},subTable:{name:"\u8FFD\u52A0\u30D5\u30A1\u30A4\u30EB\u540D",count:"\u30C7\u30FC\u30BF\u91CF",status:"\u30A4\u30F3\u30DD\u30FC\u30C8\u72B6\u614B",createdAt:"\u4F5C\u6210\u65E5\u6642",updatedAt:"\u66F4\u65B0\u65E5\u6642",actions:"\u64CD\u4F5C"}}},actions:{view:"\u8868\u793A",editConfig:"\u8A2D\u5B9A\u3092\u7DE8\u96C6",appendData:"\u30C7\u30FC\u30BF\u3092\u8FFD\u52A0",reImport:"\u518D\u30A4\u30F3\u30DD\u30FC\u30C8",delete:"\u524A\u9664",deleteSub:"\u524A\u9664",uploadDataFile:"\u30C7\u30FC\u30BF\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9"},drawer:{uploadTitle:"\u30C7\u30FC\u30BF\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",appendTitle:"\u30C7\u30FC\u30BF\u3092\u8FFD\u52A0",editConfigTitle:"\u30C6\u30FC\u30D6\u30EB\u8A2D\u5B9A\u3092\u7DE8\u96C6"},confirm:{deleteDatabaseTitle:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F",deleteDatabaseContent:"\u3053\u306E\u30C6\u30FC\u30D6\u30EB\u3068\u305D\u306E\u8FFD\u52A0\u30C7\u30FC\u30BF\u306F\u524A\u9664\u3055\u308C\u3001\u5143\u306B\u623B\u305B\u307E\u305B\u3093\u3002",deleteDataTitle:"\u30C7\u30FC\u30BF\u3092\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F",deleteDataContent:"\u3053\u306E\u30C7\u30FC\u30BF\u306F\u5B8C\u5168\u306B\u524A\u9664\u3055\u308C\u307E\u3059\u3002",okTextDelete:"\u524A\u9664",cancelText:"\u30AD\u30E3\u30F3\u30BB\u30EB"},message:{deleteSuccess:"\u524A\u9664\u3057\u307E\u3057\u305F",deleteFailed:"\u524A\u9664\u306B\u5931\u6557\u3057\u307E\u3057\u305F",deleteDataFailed:"\u30C7\u30FC\u30BF\u306E\u524A\u9664\u306B\u5931\u6557\u3057\u307E\u3057\u305F",deleteAppendSuccess:"\u8FFD\u52A0\u30D5\u30A1\u30A4\u30EB\u306E\u30C7\u30FC\u30BF\u3092\u524A\u9664\u3057\u307E\u3057\u305F",editConfigSuccess:"\u8A2D\u5B9A\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F",editConfigFailed:"\u8A2D\u5B9A\u306E\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F"}},cu={zh:Ae,en:ou,ja:ru};function du(t,C){const r=cu[t]??Ae;return C?{...r,...C}:r}const Le=se.createContext({locale:"zh",messages:Ae});function Fu(){return se.useContext(Le)}function pu({locale:t,messages:C,children:r}){const d=se.useMemo(()=>({locale:t,messages:du(t,C)}),[t,C]);return se.createElement(Le.Provider,{value:d},r)}const{confirm:ve}=be;function mu(t,C){const{url:r,token:d,role:f,id:D,dbType:M,CustomComponents:P,getBtnDisabled:E,uploadUrl:z}=t,{messages:i}=Fu(),[Y,V]=b({container:"ready",content:"ready"}),A=Ce(null),m=Ce(null),[W,H]=b(),[a,s]=b({}),[l,n]=b(),[y,B]=b(!1),[_,p]=b(""),[h,q]=b(),[O,Z]=b(!1),[ie,le]=b(""),{getTableList:ne,delTableById:K,delFileById:oe,updateTableInfo:ee,optimizeDesc:ue,getTableTreeList:te,reParseFile:re,getDBDetailById:ce}=Me({url:r,token:d,role:f,eventsEmit:t.eventsEmit});Ee(()=>(D&&M&&(V(o=>({...o,container:"loading"})),ae()),()=>{m.current&&(clearTimeout(m.current),m.current=null)}),[D,M]);const ae=async()=>{try{const o=await ce(D,M);o&&(n(o),V(e=>({...e,container:"ready",content:"loading"})))}catch(o){console.log("[TableApiError] getDBInfo:",o)}await J()};Ue(C,()=>({getDatabaseDetail:ae}));const de=async()=>{try{if(M=="DirectDB"){const o=await ne(D);if(o){const e=c(o);return H(e||[]),V(T=>({...T,content:"ready"})),e||[]}else V(e=>({...e,content:"error"}))}else{const o=await te(D);if(o){const e=F(o);return H(e||[]),V(T=>({...T,content:"ready"})),e||[]}else V(e=>({...e,content:"error"}))}}catch(o){console.log("[TableApiError] getTableList:",o)}};function F(o){return(o||[]).map((e,T)=>{var L,U;let g=we.find(w=>w.status==e.status);const S=e.children.some(w=>w.status=="00");return{id:e.fileId.toString(),tableId:e.tableId,data:[{columnId:"name",value:(e==null?void 0:e.originalFilename)||"-",type:"label"},{columnId:"description",value:(L=e==null?void 0:e.tableMeta)==null?void 0:L.description,type:"customized",tableMeta:e==null?void 0:e.tableMeta},{columnId:"count",value:`${e.rowCount}\u884C\uFF0C${e.columnCount}\u5217`,type:"text"},{columnId:"status",...g,type:"customized",errorMsg:e.errorMsg},{columnId:"importstatus",value:S,type:"customized"},{columnId:"createdAt",value:e.gmtCreate,type:"date"},{columnId:"updatedAt",value:e.gmtModified,type:"date"},...e.status=="30"?[{columnId:"actions",value:"view",label:"\u67E5\u770B",type:"action",disabled:E&&E(N.VIEW,e.permission)},{columnId:"actions",value:"edit",label:"\u4FEE\u6539\u914D\u7F6E",type:"action",disabled:E&&E(N.EDIT,e.permission)},{columnId:"actions",value:"addData",label:"\u8FFD\u52A0\u6570\u636E",type:"action",disabled:E&&E(N.EDIT,e.permission)}]:[],...e.status=="00"?[{columnId:"actions",value:"reValidate",label:"\u91CD\u65B0\u5BFC\u5165",type:"action"}]:[],{columnId:"actions",value:"delete",label:"\u5220\u9664",type:"action",disabled:E&&E(N.DELETE,e.permission)}],expanded:!1,...e.children&&((U=e.children)==null?void 0:U.length)>0&&{children:[...(e.children||[]).map(w=>{const Ve=we.find(Re=>Re.status==w.status),_e=[{columnId:"name",value:w.originalFilename,type:"text"},{columnId:"count",value:`${w.rowCount}\u884C\uFF0C${w.columnCount}\u5217`,type:"text"},{columnId:"status",...Ve,errorMsg:w.errorMsg,type:"customized"},{columnId:"createdAt",value:w.gmtCreate,type:"date"},{columnId:"updatedAt",value:w.gmtModified,type:"date"},...w.status=="30"?[{columnId:"actions",value:"view",label:"\u67E5\u770B",type:"action",disabled:E&&E(N.VIEW,w.permission)}]:[],...w.status=="00"?[{columnId:"actions",value:"reValidate",label:"\u91CD\u65B0\u5BFC\u5165",type:"action",disabled:E&&E(N.ADD,w.permission)}]:[],{columnId:"actions",value:"delete_sub",label:"\u5220\u9664",type:"action",disabled:E&&E(N.DELETE,w.permission)}];return{id:w.fileId.toString(),tableId:w.tableId,data:_e}})]}}})}function c(o){return(o||[]).map((e,T)=>({id:e.id||We(8),data:[{columnId:"name",value:e.physicalName},{columnId:"cnname",value:e.businessName},{columnId:"colcount",value:e.columnCount},{columnId:"count",value:`${e.rowCount}\u884C\uFF0C${e.columnCount}\u5217`},{columnId:"actions",value:"view",label:"\u67E5\u770B",disabled:E&&E(N.VIEW,e.permission)}]}))}async function k(o,e,T){switch(console.log("[adopter] mergedEventsEmit",o,e,T),o){case"table_action_delete":{try{if(console.log("[delete] \u5220\u9664\u4E8B\u4EF6\u6570\u636E:",e),!e||!e.tableId&&!e.id){console.error("[delete] \u5220\u9664\u4E8B\u4EF6\u6570\u636E\u4E0D\u5B8C\u6574:",e),G.error("\u5220\u9664\u5931\u8D25\uFF1A\u6570\u636E\u4E0D\u5B8C\u6574");return}const g=e.tableId||e.id,S=e.id;ve({title:i.confirm.deleteDatabaseTitle,content:i.confirm.deleteDatabaseContent,icon:u(Se,{color:"#FF4D4F",className:"mr-[8px]"}),okText:i.confirm.okTextDelete,cancelText:i.confirm.cancelText,async onOk(){await K(g,M)&&(A!=null&&A.current)?(A==null||A.current.appFn.removeItem(S),G.success(i.message.deleteSuccess)):G.error(i.message.deleteFailed)}})}catch(g){console.error("\u5220\u9664\u8868\u6570\u636E\u5931\u8D25:",g),G.error("\u5220\u9664\u5931\u8D25")}break}case"table_action_edit":{le(i.drawer.editConfigTitle),Z(!0),q(e);break}case"toolbar_upload":{p(i.drawer.uploadTitle),B(!0);break}case"table_action_addData":{p(i.drawer.appendTitle),B(!0),q(e);break}case"table_action_reValidate":{await re(e.id)&&(m.current&&(clearTimeout(m.current),m.current=null),await J());break}case"table_info:update":{try{if(h!=null&&h.id){const g=(h==null?void 0:h.data.find(L=>L.columnId=="name").value)||"-";if(await ee({tableId:h.tableId,description:e,businessName:g})&&(A!=null&&A.current)){const L={...h,data:h.data.map(U=>U.columnId=="description"?{...U,value:e}:U)};A==null||A.current.appFn.updateItem(L,h.id),G.success("\u4FEE\u6539\u914D\u7F6E\u6210\u529F")}}}catch(g){console.error("\u4FEE\u6539\u914D\u7F6E\u5931\u8D25",g)}finally{x()}break}case"table_action_delete_sub":{try{ve({title:i.confirm.deleteDataTitle,content:i.confirm.deleteDataContent,okText:i.confirm.okTextDelete,cancelText:i.confirm.cancelText,async onOk(){const{id:g,tableId:S}=e;await oe(e.id)&&(A!=null&&A.current)&&(s(U=>({...U,[S]:[...U[S]||[],g]})),e.data.find(U=>U.status=="00")&&(m.current&&(clearTimeout(m.current),m.current=null),J()),T.removeItem(g,S),G.success(i.message.deleteAppendSuccess))}})}catch{console.log("\u5220\u9664\u8868\u6570\u636E\u5931\u8D25"),G.error(i.message.deleteDataFailed)}break}case"toolbar_auth":{typeof t.eventsEmit=="function"&&t.eventsEmit("toolbar_auth",l);break}default:typeof t.eventsEmit=="function"&&t.eventsEmit(o,e);break}}const v=Q(()=>({label:i.views.directDB.label,model:null,defaultActiveId:"direct-table-view",views:[{label:"\u6211\u7684\u6570\u636E\u5E93",id:"direct-table-view",type:"table",viewBehavior:"pagination",allowMultiSelect:!1,columns:[{id:"name",title:i.views.directDB.columns.name,type:"label"},{id:"cnname",title:i.views.directDB.columns.cnname,type:"text"},{id:"colcount",title:i.views.directDB.columns.colcount,type:"text"},{id:"count",title:i.views.directDB.columns.count,type:"text"},{id:"actions",title:i.views.directDB.columns.actions,type:"action",align:"left"}],toolbar:[{type:"fuzzy_search",key:"search",label:i.views.directDB.toolbar.search,searchKeys:["name","description"],position:"right"},{type:"button",key:"auth",label:i.views.directDB.toolbar.config,btnType:"default",position:"right"}]}]}),[W,M]),R=Q(()=>({label:i.views.dataTable.label,model:null,defaultActiveId:"data-table-view",views:[{label:i.views.dataTable.label,id:"data-table-view",type:"table",viewBehavior:"pagination",allowMultiSelect:!1,viewPageSize:10,columns:[{id:"name",title:i.views.dataTable.columns.name,type:"label",tip:i.views.dataTable.columns.name},{id:"description",title:i.views.dataTable.columns.description,type:"customized",component:u(lu,{}),helpText:i.views.dataTable.columns.descriptionHelp},{id:"count",title:i.views.dataTable.columns.count,type:"text",tip:i.views.dataTable.columns.count},{id:"status",title:i.views.dataTable.columns.status,type:"customized",component:u(me,{})},{id:"importstatus",title:i.views.dataTable.columns.importStatus,type:"customized",component:u(me,{})},{id:"createdAt",title:i.views.dataTable.columns.createdAt,type:"date",tip:i.views.dataTable.columns.createdAt},{id:"updatedAt",title:i.views.dataTable.columns.updatedAt,type:"date",tip:i.views.dataTable.columns.updatedAt},{id:"actions",title:i.views.dataTable.columns.actions,type:"action",align:"left"}],toolbar:[{type:"button",key:"upload",label:i.actions.uploadDataFile,btnType:"primary",disabled:E&&E(N.ADD,l==null?void 0:l.permission),icon:u(Oe,{size:12})},{type:"fuzzy_search",key:"search",label:i.views.dataTable.toolbar.search,searchKeys:["name","description",["name"]],position:"right"},{type:"button",key:"auth",label:i.views.dataTable.toolbar.config,btnType:"default",position:"right"}]}],subTableConfig:{type:"table",allowMultiSelect:!1,viewBehavior:"pagination",viewPageSize:5,columns:[{title:i.views.dataTable.subTable.name,id:"name",type:"text",tip:i.views.dataTable.subTable.name},{title:i.views.dataTable.subTable.count,id:"count",type:"text",tip:i.views.dataTable.subTable.count},{id:"status",title:i.views.dataTable.subTable.status,type:"customized",tip:i.views.dataTable.subTable.status,component:u(me,{})},{title:i.views.dataTable.subTable.createdAt,id:"createdAt",type:"date",tip:i.views.dataTable.subTable.createdAt},{title:i.views.dataTable.subTable.updatedAt,id:"updatedAt",type:"date",tip:i.views.dataTable.subTable.updatedAt},{title:i.views.dataTable.subTable.actions,id:"actions",type:"action",align:"left"}]},subTablePendingIds:a,onSubTableRowAnimationComplete:(o,e)=>{s(T=>({...T,[o]:(T[o]||[]).filter(g=>g!==e)}))}}),[a,W,M,l,i]),x=o=>{B(!1),Z(!1),q(void 0),o=="refresh"&&(m.current&&(clearTimeout(m.current),m.current=null),J())};function j(o){var e;if(!Array.isArray(o))return!0;for(const T of o){if(T.data){const g=T.data.find(L=>L.columnId==="status"),S=T.data.find(L=>L.columnId==="description");if(g&&(g.status==="20"||g.status==="11"||((e=S==null?void 0:S.tableMeta)==null?void 0:e.generateDescriptionStatus)==ze.GENERATING))return!1}if(Array.isArray(T.children)){for(const g of T.children)if(g.data){const S=g.data.find(L=>L.columnId==="status");if(S&&(S.status==="20"||S.status==="11"))return!1}}}return!0}const J=async()=>{const o=await de();j(o||[])?m.current&&(clearTimeout(m.current),m.current=null):(m.current&&(clearTimeout(m.current),m.current=null),m.current=setTimeout(()=>{J()},5e3))};return I($e,{title:l==null?void 0:l.name,description:(l==null?void 0:l.description)||"-",goBack:()=>{var o;(o=t.eventsEmit)==null||o.call(t,"goBack",{})},children:[u(Ie,{dataSource:W,ref:A,eventsEmit:k,status:Y,CustomComponents:{EmptyData:()=>u(nu,{dbInfo:l,setDrawerTitle:p,setDrawerVisible:B,getBtnDisabled:E}),...P},...M=="DataTable"?R:v}),u(Je,{drawerTitle:_,drawerVisible:y,handleDrawerClose:x,dbId:D,token:d,url:r,uploadUrl:z,role:f,tableInfo:h}),u(au,{drawerTitle:ie,drawerVisible:O,handleDrawerClose:x,tableInfo:h,optimizeDesc:ue,eventsEmit:k})]})}const Cu=xe(mu),ku=xe(function(C,r){const{locale:d="zh",messages:f,...D}=C;return u(pu,{locale:d,messages:f,children:u(Cu,{...D,ref:r})})});export{Le as DatabaseIdI18nContext,pu as DatabaseIdI18nProvider,ku as default,du as getDatabaseIdMessages,Fu as useDatabaseIdI18n};
|
package/graphBase.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"react/jsx-runtime";import"react";import"react-dom";import"@mxmweb/zui";import"@mxmweb/xviewer";/* empty css */import"styled-components";import{G as b}from"./assets/index-
|
|
1
|
+
import"react/jsx-runtime";import"react";import"react-dom";import"@mxmweb/zui";import"@mxmweb/xviewer";/* empty css */import"styled-components";import{G as b}from"./assets/index-C1CXeTnS.js";import"antd";import"./assets/index-DGd2bq9F.js";import"dayjs";import"axios";import"./assets/lodash-Damzdmsp.js";import"./assets/index-CpW6Dhpp.js";export{b as default};
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as c,a as
|
|
1
|
+
import{D as c,a as k,L as y,g as F,u as W}from"./assets/style-BzPoYUHb.js";import"./assets/index-C1CXeTnS.js";import{C as q}from"./assets/index-C9Vc57_N.js";import"./database.js";import{DatabaseIdI18nContext as B,DatabaseIdI18nProvider as E,getDatabaseIdMessages as H,useDatabaseIdI18n as J}from"./databaseId.js";import"./databaseTable.js";import"react/jsx-runtime";import"antd";import"react";import"axios";import{ModelManageI18nContext as N,ModelManageI18nProvider as O,getModelManageMessages as Q,interpolateModelManage as U,useModelManageI18n as V}from"./modelManage.js";import{SensitiveI18nContext as Y,SensitiveI18nProvider as Z,getSensitiveMessages as _,interpolate as $,useSensitiveI18n as ee}from"./sensitive.js";import"./oprecords.js";import{R as oe,a as re,u as ie}from"./assets/ReviewSetting-C3B98Nq2.js";import{default as se}from"./reviewManage.js";import{G as pe}from"./assets/GientechStreamReader-CnAI3q38.js";import{a as ge,A as Ie,p as de,g as fe,u as Me}from"./assets/index-CxKRvyc8.js";import{registerPDFWorker as ve}from"@mxmweb/fviewer";import"@mxmweb/aichat";import"@mxmweb/rtext";import"./assets/index-CpW6Dhpp.js";import"@mxmweb/zui";import"./assets/lodash-Damzdmsp.js";import"dayjs";import"./assets/createLucideIcon-Bj5DlX2s.js";import"./assets/plus-B679mjyt.js";import"./assets/search-CEuIa9-_.js";import"./assets/x-CdZQbi--.js";import"./assets/chevron-right-CrkLSPrQ.js";import"./assets/index-DGd2bq9F.js";import"react-dom";/* empty css *//* empty css */import"@mxmweb/xviewer";import"styled-components";import"./assets/loader-circle-C1Oa97Sz.js";import"./assets/circle-plus-RlDPoPkb.js";import"./assets/triangle-alert-LqO4u4ts.js";/* empty css */export{ge as AssistantConfigI18nContext,Ie as AssistantConfigI18nProvider,q as ChatCompareComponent,B as DatabaseIdI18nContext,E as DatabaseIdI18nProvider,c as DrawerType,pe as GientechStreamReader,k as LoginI18nContext,y as LoginI18nProvider,N as ModelManageI18nContext,O as ModelManageI18nProvider,se as ReviewManage,oe as ReviewSetting,re as ReviewSettingI18nProvider,Y as SensitiveI18nContext,Z as SensitiveI18nProvider,de as defaultTheme,fe as getAssistantConfigMessages,H as getDatabaseIdMessages,F as getLoginMessages,Q as getModelManageMessages,_ as getSensitiveMessages,$ as interpolate,U as interpolateModelManage,ve as registerPDFWorker,Me as useAssistantConfigI18n,J as useDatabaseIdI18n,W as useLoginI18n,V as useModelManageI18n,ie as useReviewSettingI18n,ee as useSensitiveI18n};
|
package/modelManage.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as l,jsxs as q}from"react/jsx-runtime";import Z,{useState as w,useMemo as j,useRef as se,useEffect as Fe}from"react";import{message as z,Drawer as Re,Form as O,Modal as pe,Select as ce,Tooltip as oe,Badge as ie}from"antd";import{Button as R,DashboardContainer as Ne}from"@mxmweb/zui";import{Xviwer as Ee}from"@mxmweb/xviewer";import Pe from"axios";import Ue from"styled-components";import{X as qe}from"./assets/x-CdZQbi--.js";import{T as He}from"./assets/triangle-alert-LqO4u4ts.js";/* empty css *//* empty css */import{P as ze}from"./assets/plus-B679mjyt.js";import"./assets/createLucideIcon-Bj5DlX2s.js";const Ve=""+new URL("assets/empty.png",import.meta.url).href,We=({url:t,token:F,role:r,eventsEmit:c,getMessage:B})=>{const b=(e,o)=>B?B(e):o,m=Pe.create({baseURL:t,timeout:1e6});return m.interceptors.request.use(e=>{let o=F;return!o&&!["user/login","user/kaptcha","user/regist"].some(n=>e.url.includes(n))?(c&&c("request:error_auth",{errorMsg:b("server.notLoggedIn","\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"),redirect:"/login"}),Promise.reject(new Error(b("server.notLoggedIn","\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F")))):(e.headers.Authorization=o||"",e.headers.userName=r==="\u672A\u767B\u5F55\u7528\u6237"?"":r,e)}),m.interceptors.response.use(e=>{const o=["user/kaptcha"],a=e.data;if(o.some(x=>e.config.url&&e.config.url.includes(x))||a.size&&a.type)return a;const{success:n,errorMsg:f,errorCode:h}=a;return n?a:c?(c("request:error_business",{errorCode:h,errorMsg:f||b("server.requestError","\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5"),response:a}),a):!1},e=>{var o,a,n,f,h,x,W,T,M;if(e.message==="canceled")return Promise.reject(e);if(c){let U="request:error_network",S={errorMsg:b("server.requestError","\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25"),error:e};((o=e==null?void 0:e.response)==null?void 0:o.status)===401?(U="request:error_auth",S={errorMsg:b("server.noPermission","\u6CA1\u6709\u8DB3\u591F\u6743\u9650"),error:e,redirect:"/login"}):(((n=(a=e==null?void 0:e.response)==null?void 0:a.data)==null?void 0:n.errorCode)==="30013"||((h=(f=e==null?void 0:e.response)==null?void 0:f.data)==null?void 0:h.errorCode)==="30023")&&(U="request:error_business",S={errorCode:(W=(x=e==null?void 0:e.response)==null?void 0:x.data)==null?void 0:W.errorCode,errorMsg:((M=(T=e==null?void 0:e.response)==null?void 0:T.data)==null?void 0:M.message)||b("server.requestError","\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5"),error:e}),c(U,S)}return Promise.reject(e)}),{getModelList:async e=>{try{const o=await m.get(`/allPage?${new URLSearchParams(e).toString()}`),{success:a,data:n}=o;if(a)return n}catch(o){return console.log("getModelList error:",o),!1}},delModelById:async e=>{try{const o=await m.delete(`/delete?id=${e}`),{success:a,data:n}=o;if(a)return n}catch(o){console.log("delModelById error:",o)}},createModel:async e=>{try{const o=await m.post("/create",e),{success:a,data:n}=o;if(a)return n}catch(o){console.log("createModel error:",o)}},updateModelById:async e=>{try{const o=await m.put("/update",e),{success:a,data:n}=o;if(a)return n;console.log("====eee==",o),z.error(`\u4FDD\u5B58\u5931\u8D25: ${o==null?void 0:o.errorMsg}`)}catch(o){console.log("updateModelById error:",o)}},getUseTypeList:async()=>{try{const e=await m.get("/getModelTypes"),{success:o,data:a}=e;if(o)return a}catch(e){return console.log("getUseTypeList error:",e),!1}},getModelProtocolsList:async()=>{try{const e=await m.get("/getModelProtocols"),{success:o,data:a}=e;if(o)return a}catch(e){return console.log("getModelProtocolsList error:",e),!1}},testStatus:async()=>{try{const e=await m.post("/check"),{success:o,data:a}=e;if(o)return a}catch(e){console.log("testStatus error:",e)}},replaceModel:async(e,o)=>{try{const a=await m.get(`/replaceModel?sourceModelId=${e}&targetModelId=${o}`),{success:n,data:f}=a;if(n)return f}catch(a){console.log("replaceModel error:",a)}},checkModel:async e=>{try{const o=await m.get(`/checkModelReference?modelName=${e}`),{success:a,data:n}=o;if(a)return n}catch(o){console.log("checkModelReference error:",o)}}}},Y={common:{loading:"\u52A0\u8F7D\u4E2D..."},dashboard:{title:"\u6A21\u578B\u7BA1\u7406"},table:{viewLabel:"\u6A21\u578B",columns:{modelName:"\u6A21\u578B\u540D\u79F0",modelProtocol:"\u6A21\u578B\u4F20\u8F93\u534F\u8BAE",type:"\u4F7F\u7528\u7C7B\u578B",dec:"\u8BF4\u660E",status:"\u72B6\u6001",actions:"\u64CD\u4F5C"},statusHelpText:"\u5F53\u524D\u6A21\u578B\u72B6\u6001\u4E3A\u521D\u6B21\u65B0\u589E\u6821\u9A8C\u72B6\u6001\uFF0C\u82E5\u6A21\u578B\u4E0B\u7EBF\uFF0C\u6B64\u72B6\u6001\u4E0D\u4F1A\u4E3B\u52A8\u66F4\u65B0\uFF0C\u9700\u624B\u52A8\u6267\u884C\u6A21\u578B\u5220\u9664",toolbar:{add:"\u65B0\u5EFA",test:"\u6A21\u578B\u72B6\u6001\u68C0\u6D4B",replace:"\u6A21\u578B\u66FF\u6362"},actionEdit:"\u7F16\u8F91",actionAuth:"\u6388\u6743",actionDelete:"\u5220\u9664",tooltipChecking:"\u68C0\u6D4B\u4E2D\uFF0C\u8BF7\u7A0D\u540E",tooltipNoPermission:"\u89D2\u8272\u65E0\u6743\u9650\u64CD\u4F5C"},status:{available:"\u53EF\u7528",unavailable:"\u4E0D\u53EF\u7528",checking:"\u68C0\u6D4B\u4E2D"},empty:{noDataHint:"\u6682\u65E0\u6570\u636E\uFF0C\u8BF7\u5148\u65B0\u5EFA\u6A21\u578B",createModelBtn:"\u65B0\u5EFA\u6A21\u578B"},drawer:{titleNew:"\u65B0\u5EFA",titleEdit:"\u7F16\u8F91",cancel:"\u53D6\u6D88",confirm:"\u786E\u8BA4"},form:{labels:{modelName:"\u6A21\u578B\u540D\u79F0",modelIde:"\u6A21\u578BID",apiKey:"APIKey",url:"\u8BF7\u6C42URL",modelProtocol:"\u6A21\u578B\u4F20\u8F93\u534F\u8BAE",type:"\u4F7F\u7528\u7C7B\u578B",maxTokens:"\u4E0A\u4E0B\u6587\u957F\u5EA6",dec:"\u8BF4\u660E"},placeholders:{modelName:"\u8BF7\u8F93\u5165\u6A21\u578B\u540D\u79F0",modelIde:"\u8BF7\u8F93\u5165\u6A21\u578BID",apiKey:"\u8BF7\u8F93\u5165APIKey",url:"\u8BF7\u8F93\u5165\u8BF7\u6C42URL"},maxTokensHelpText:"\u8BF7\u5411\u6A21\u578B\u90E8\u7F72\u6216\u8FD0\u7EF4\u4EBA\u5458\u786E\u8BA4\u5F53\u524D\u6A21\u578B\u7684\u6700\u5927\u4E0A\u4E0B\u6587\u957F\u5EA6\uFF08Max Tokens / Context Length\uFF09\uFF0C\u5E76\u786E\u8BA4\u63A8\u7406\u670D\u52A1\uFF08\u5982 vLLM\uFF09\u662F\u5426\u914D\u7F6E\u4E86\u989D\u5916\u7684\u8F93\u5165\u957F\u5EA6\u9650\u5236"},replaceModal:{title:"\u6A21\u578B\u66FF\u6362",warningParagraph:"\u5982\u9700\u66F4\u6362\u6A21\u578B\uFF0C\u5728\u4E00\u952E\u66FF\u6362\u65F6\uFF0C\u7CFB\u7EDF\u5C06\u81EA\u52A8\u66F4\u65B0\u77E5\u8BC6\u89E3\u6790\u914D\u7F6E\u3001\u68C0\u7D22\u6D4B\u8BD5\u548C\u52A9\u624B\u914D\u7F6E\u4E2D\u7684\u6A21\u578B\u3002\u82E5\u66FF\u6362\u7684\u662F\u6587\u6863\u89E3\u6790\u7528\u7684Embedding\u6A21\u578B\uFF0C\u5219\u4F7F\u7528\u8BE5\u6A21\u578B\u7684\u6587\u6863\u5C06\u5168\u90E8\u91CD\u65B0\u6392\u961F\u89E3\u6790\uFF0C\u72B6\u6001\u53D8\u4E3A\u201C\u89E3\u6790\u4E2D\u201D\uFF0C\u4E14\u672A\u89E3\u6790\u5B8C\u6210\u7684\u6587\u6863\u6682\u4E0D\u53EF\u68C0\u7D22\uFF01",sourceLabel:"\u6A21\u578B\u540D\u79F0",targetLabel:"\u66FF\u6362\u4E3A",placeholderSelect:"\u8BF7\u9009\u62E9",cancel:"\u53D6\u6D88",confirm:"\u786E\u8BA4",messageSuccess:"\u6A21\u578B\u66FF\u6362\u6210\u529F"},message:{testSuccess:"\u6A21\u578B\u68C0\u6D4B\u4E2D\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5F85\u72B6\u6001\u66F4\u65B0\uFF01",deleteSuccess:"\u5220\u9664\u6210\u529F",createSuccess:"\u6A21\u578B\u65B0\u589E\u6210\u529F\uFF01",editSuccess:"\u6A21\u578B\u7F16\u8F91\u6210\u529F\uFF01"},deleteConfirm:{title:"\u786E\u8BA4\u5220\u9664\uFF1F",content:'\u786E\u5B9A\u8981\u5220\u9664\u6A21\u578B "{{name}}" \u5417\uFF1F\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002',titleWhenInUse:"\u5220\u9664\u6A21\u578B",contentWhenInUse:"\u5F53\u524D\u6A21\u578B\u5728\u7CFB\u7EDF\u5185\u5DF2\u88AB\u914D\u7F6E\u4F7F\u7528\uFF0C\u5220\u9664\u53EF\u80FD\u5F71\u54CD\u6587\u6863\u89E3\u6790\u3001\u95EE\u7B54\u3001\u591A\u6A21\u6001\u80FD\u529B\u4F7F\u7528\u7B49\uFF0C\u8BF7\u60A8\u5148\u4F7F\u7528\u201C\u6A21\u578B\u4E00\u952E\u66FF\u6362\u201D\u80FD\u529B\u5C06\u8BE5\u6A21\u578B\u66FF\u6362\u4E3A\u540C\u7C7B\u578B\u6A21\u578B\uFF0C\u518D\u5220\u9664\u6A21\u578B",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",deleteOkText:"\u5220\u9664"},server:{requestError:"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",noPermission:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",notLoggedIn:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"}},Ke={common:{loading:"Loading..."},dashboard:{title:"Model management"},table:{viewLabel:"Models",columns:{modelName:"Model name",modelProtocol:"Protocol",type:"Use type",dec:"Description",status:"Status",actions:"Actions"},statusHelpText:"Status is validated on first add; if the model goes offline, it will not update automatically. Delete the model manually if needed.",toolbar:{add:"Add",test:"Test model status",replace:"Replace model"},actionEdit:"Edit",actionAuth:"Authorize",actionDelete:"Delete",tooltipChecking:"Checking, please wait",tooltipNoPermission:"No permission"},status:{available:"Available",unavailable:"Unavailable",checking:"Checking"},empty:{noDataHint:"No data. Add a model first.",createModelBtn:"Add model"},drawer:{titleNew:"Add",titleEdit:"Edit",cancel:"Cancel",confirm:"Confirm"},form:{labels:{modelName:"Model name",modelIde:"Model ID",apiKey:"API Key",url:"Request URL",modelProtocol:"Protocol",type:"Use type",maxTokens:"Context length",dec:"Description"},placeholders:{modelName:"Enter model name",modelIde:"Enter model ID",apiKey:"Enter API Key",url:"Enter request URL"},maxTokensHelpText:"Confirm with your deployment team the model's max context length (Max Tokens) and any limits set by the inference service (e.g. vLLM)."},replaceModal:{title:"Replace model",warningParagraph:'When you replace a model, the system will update knowledge parsing, retrieval tests, and assistant configs. If you replace an Embedding model used for documents, all documents using it will be re-queued for parsing and become "Parsing"; unparsed documents will not be searchable until done.',sourceLabel:"Model name",targetLabel:"Replace with",placeholderSelect:"Select",cancel:"Cancel",confirm:"Confirm",messageSuccess:"Model replaced successfully"},message:{testSuccess:"Model check in progress. Status will update shortly.",deleteSuccess:"Deleted",createSuccess:"Model added.",editSuccess:"Model updated."},deleteConfirm:{title:"Confirm delete?",content:'Delete model "{{name}}"? This cannot be undone.',titleWhenInUse:"Delete model",contentWhenInUse:'This model is in use. Deleting it may affect document parsing, Q&A, and multimodal features. Use "Replace model" to switch to another model of the same type first, then delete.',okText:"OK",cancelText:"Cancel",deleteOkText:"Delete"},server:{requestError:"Request failed, please try again.",noPermission:"Insufficient permission",notLoggedIn:"Not logged in or token expired"}},je={common:{loading:"\u8AAD\u307F\u8FBC\u307F\u4E2D..."},dashboard:{title:"\u30E2\u30C7\u30EB\u7BA1\u7406"},table:{viewLabel:"\u30E2\u30C7\u30EB",columns:{modelName:"\u30E2\u30C7\u30EB\u540D",modelProtocol:"\u30D7\u30ED\u30C8\u30B3\u30EB",type:"\u7528\u9014",dec:"\u8AAC\u660E",status:"\u72B6\u614B",actions:"\u64CD\u4F5C"},statusHelpText:"\u72B6\u614B\u306F\u521D\u56DE\u8FFD\u52A0\u6642\u306B\u691C\u8A3C\u3055\u308C\u307E\u3059\u3002\u30E2\u30C7\u30EB\u304C\u30AA\u30D5\u30E9\u30A4\u30F3\u306B\u306A\u3063\u3066\u3082\u81EA\u52D5\u3067\u306F\u66F4\u65B0\u3055\u308C\u307E\u305B\u3093\u3002\u5FC5\u8981\u306B\u5FDC\u3058\u3066\u624B\u52D5\u3067\u524A\u9664\u3057\u3066\u304F\u3060\u3055\u3044\u3002",toolbar:{add:"\u65B0\u898F",test:"\u30E2\u30C7\u30EB\u72B6\u614B\u691C\u8A3C",replace:"\u30E2\u30C7\u30EB\u7F6E\u63DB"},actionEdit:"\u7DE8\u96C6",actionAuth:"\u6A29\u9650",actionDelete:"\u524A\u9664",tooltipChecking:"\u691C\u8A3C\u4E2D\u3001\u3057\u3070\u3089\u304F\u304A\u5F85\u3061\u304F\u3060\u3055\u3044",tooltipNoPermission:"\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093"},status:{available:"\u5229\u7528\u53EF",unavailable:"\u5229\u7528\u4E0D\u53EF",checking:"\u691C\u8A3C\u4E2D"},empty:{noDataHint:"\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u5148\u306B\u30E2\u30C7\u30EB\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002",createModelBtn:"\u30E2\u30C7\u30EB\u3092\u8FFD\u52A0"},drawer:{titleNew:"\u65B0\u898F",titleEdit:"\u7DE8\u96C6",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",confirm:"\u78BA\u8A8D"},form:{labels:{modelName:"\u30E2\u30C7\u30EB\u540D",modelIde:"\u30E2\u30C7\u30EBID",apiKey:"API\u30AD\u30FC",url:"\u30EA\u30AF\u30A8\u30B9\u30C8URL",modelProtocol:"\u30D7\u30ED\u30C8\u30B3\u30EB",type:"\u7528\u9014",maxTokens:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u9577",dec:"\u8AAC\u660E"},placeholders:{modelName:"\u30E2\u30C7\u30EB\u540D\u3092\u5165\u529B",modelIde:"\u30E2\u30C7\u30EBID\u3092\u5165\u529B",apiKey:"API\u30AD\u30FC\u3092\u5165\u529B",url:"\u30EA\u30AF\u30A8\u30B9\u30C8URL\u3092\u5165\u529B"},maxTokensHelpText:"\u30E2\u30C7\u30EB\u306E\u6700\u5927\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u9577\uFF08Max Tokens\uFF09\u3068\u63A8\u8AD6\u30B5\u30FC\u30D3\u30B9\uFF08vLLM\u7B49\uFF09\u306E\u5236\u9650\u3092\u30C7\u30D7\u30ED\u30A4\u62C5\u5F53\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},replaceModal:{title:"\u30E2\u30C7\u30EB\u7F6E\u63DB",warningParagraph:"\u30E2\u30C7\u30EB\u3092\u7F6E\u63DB\u3059\u308B\u3068\u3001\u77E5\u8B58\u89E3\u6790\u30FB\u691C\u7D22\u30C6\u30B9\u30C8\u30FB\u30A2\u30B7\u30B9\u30BF\u30F3\u30C8\u8A2D\u5B9A\u304C\u66F4\u65B0\u3055\u308C\u307E\u3059\u3002\u6587\u66F8\u89E3\u6790\u7528Embedding\u30E2\u30C7\u30EB\u3092\u7F6E\u63DB\u3057\u305F\u5834\u5408\u3001\u305D\u306E\u30E2\u30C7\u30EB\u3092\u4F7F\u3046\u6587\u66F8\u306F\u518D\u89E3\u6790\u30AD\u30E5\u30FC\u306B\u5165\u308A\u300C\u89E3\u6790\u4E2D\u300D\u3068\u306A\u308A\u3001\u89E3\u6790\u5B8C\u4E86\u307E\u3067\u691C\u7D22\u3067\u304D\u307E\u305B\u3093\u3002",sourceLabel:"\u30E2\u30C7\u30EB\u540D",targetLabel:"\u7F6E\u63DB\u5148",placeholderSelect:"\u9078\u629E",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",confirm:"\u78BA\u8A8D",messageSuccess:"\u30E2\u30C7\u30EB\u3092\u7F6E\u63DB\u3057\u307E\u3057\u305F"},message:{testSuccess:"\u30E2\u30C7\u30EB\u3092\u691C\u8A3C\u4E2D\u3067\u3059\u3002\u72B6\u614B\u304C\u66F4\u65B0\u3055\u308C\u308B\u307E\u3067\u304A\u5F85\u3061\u304F\u3060\u3055\u3044\u3002",deleteSuccess:"\u524A\u9664\u3057\u307E\u3057\u305F",createSuccess:"\u30E2\u30C7\u30EB\u3092\u8FFD\u52A0\u3057\u307E\u3057\u305F\u3002",editSuccess:"\u30E2\u30C7\u30EB\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F\u3002"},deleteConfirm:{title:"\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F",content:"\u30E2\u30C7\u30EB\u300C{{name}}\u300D\u3092\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F\u5143\u306B\u623B\u305B\u307E\u305B\u3093\u3002",titleWhenInUse:"\u30E2\u30C7\u30EB\u3092\u524A\u9664",contentWhenInUse:"\u3053\u306E\u30E2\u30C7\u30EB\u306F\u4F7F\u7528\u4E2D\u3067\u3059\u3002\u524A\u9664\u3059\u308B\u3068\u6587\u66F8\u89E3\u6790\u30FBQ&A\u30FB\u30DE\u30EB\u30C1\u30E2\u30FC\u30C0\u30EB\u306B\u5F71\u97FF\u3059\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002\u5148\u306B\u300C\u30E2\u30C7\u30EB\u7F6E\u63DB\u300D\u3067\u540C\u7A2E\u306E\u30E2\u30C7\u30EB\u306B\u7F6E\u304D\u63DB\u3048\u3066\u304B\u3089\u524A\u9664\u3057\u3066\u304F\u3060\u3055\u3044\u3002",okText:"\u78BA\u8A8D",cancelText:"\u30AD\u30E3\u30F3\u30BB\u30EB",deleteOkText:"\u524A\u9664"},server:{requestError:"\u30EA\u30AF\u30A8\u30B9\u30C8\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u3057\u3070\u3089\u304F\u3057\u3066\u304B\u3089\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002",noPermission:"\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093",notLoggedIn:"\u672A\u30ED\u30B0\u30A4\u30F3\u307E\u305F\u306F\u30C8\u30FC\u30AF\u30F3\u671F\u9650\u5207\u308C"}},_e={zh:Y,en:Ke,ja:je};function $e(t,F){return t.replace(/\{\{(\w+)\}\}/g,(r,c)=>F[c]??"")}function Oe(t,F){const r=_e[t]??Y;return F?{...r,...F}:r}function Be(t,F){const r=F.split(".");let c=t;for(const B of r)c=c==null?void 0:c[B];return typeof c=="string"?c:F}const Ae=Z.createContext({locale:"zh",messages:Y,getMessage:t=>Be(Y,t)});function le(){return Z.useContext(Ae)}function Xe({locale:t,messages:F,children:r}){const c=Z.useMemo(()=>{const B=Oe(t,F);return{locale:t,messages:B,getMessage:b=>Be(B,b)}},[t,F]);return Z.createElement(Ae.Provider,{value:c},r)}const Ze=Ue.div.attrs({className:"config-model-drawer-scroll-wrap"})`
|
|
1
|
+
import{jsx as l,jsxs as q}from"react/jsx-runtime";import Z,{useState as w,useMemo as j,useRef as se,useEffect as Fe}from"react";import{message as z,Drawer as Re,Form as O,Modal as pe,Select as ce,Tooltip as oe,Badge as ie}from"antd";import{Button as R,DashboardContainer as Ne}from"@mxmweb/zui";import{Xviwer as Ee}from"@mxmweb/xviewer";import Pe from"axios";import Ue from"styled-components";import{X as qe}from"./assets/x-CdZQbi--.js";import{T as He}from"./assets/triangle-alert-LqO4u4ts.js";/* empty css *//* empty css */import{P as ze}from"./assets/plus-B679mjyt.js";import"./assets/createLucideIcon-Bj5DlX2s.js";const Ve=""+new URL("assets/empty2.png",import.meta.url).href,We=({url:t,token:F,role:r,eventsEmit:c,getMessage:B})=>{const b=(e,o)=>B?B(e):o,m=Pe.create({baseURL:t,timeout:1e6});return m.interceptors.request.use(e=>{let o=F;return!o&&!["user/login","user/kaptcha","user/regist"].some(n=>e.url.includes(n))?(c&&c("request:error_auth",{errorMsg:b("server.notLoggedIn","\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"),redirect:"/login"}),Promise.reject(new Error(b("server.notLoggedIn","\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F")))):(e.headers.Authorization=o||"",e.headers.userName=r==="\u672A\u767B\u5F55\u7528\u6237"?"":r,e)}),m.interceptors.response.use(e=>{const o=["user/kaptcha"],a=e.data;if(o.some(x=>e.config.url&&e.config.url.includes(x))||a.size&&a.type)return a;const{success:n,errorMsg:f,errorCode:h}=a;return n?a:c?(c("request:error_business",{errorCode:h,errorMsg:f||b("server.requestError","\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5"),response:a}),a):!1},e=>{var o,a,n,f,h,x,W,T,M;if(e.message==="canceled")return Promise.reject(e);if(c){let U="request:error_network",S={errorMsg:b("server.requestError","\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25"),error:e};((o=e==null?void 0:e.response)==null?void 0:o.status)===401?(U="request:error_auth",S={errorMsg:b("server.noPermission","\u6CA1\u6709\u8DB3\u591F\u6743\u9650"),error:e,redirect:"/login"}):(((n=(a=e==null?void 0:e.response)==null?void 0:a.data)==null?void 0:n.errorCode)==="30013"||((h=(f=e==null?void 0:e.response)==null?void 0:f.data)==null?void 0:h.errorCode)==="30023")&&(U="request:error_business",S={errorCode:(W=(x=e==null?void 0:e.response)==null?void 0:x.data)==null?void 0:W.errorCode,errorMsg:((M=(T=e==null?void 0:e.response)==null?void 0:T.data)==null?void 0:M.message)||b("server.requestError","\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5"),error:e}),c(U,S)}return Promise.reject(e)}),{getModelList:async e=>{try{const o=await m.get(`/allPage?${new URLSearchParams(e).toString()}`),{success:a,data:n}=o;if(a)return n}catch(o){return console.log("getModelList error:",o),!1}},delModelById:async e=>{try{const o=await m.delete(`/delete?id=${e}`),{success:a,data:n}=o;if(a)return n}catch(o){console.log("delModelById error:",o)}},createModel:async e=>{try{const o=await m.post("/create",e),{success:a,data:n}=o;if(a)return n}catch(o){console.log("createModel error:",o)}},updateModelById:async e=>{try{const o=await m.put("/update",e),{success:a,data:n}=o;if(a)return n;console.log("====eee==",o),z.error(`\u4FDD\u5B58\u5931\u8D25: ${o==null?void 0:o.errorMsg}`)}catch(o){console.log("updateModelById error:",o)}},getUseTypeList:async()=>{try{const e=await m.get("/getModelTypes"),{success:o,data:a}=e;if(o)return a}catch(e){return console.log("getUseTypeList error:",e),!1}},getModelProtocolsList:async()=>{try{const e=await m.get("/getModelProtocols"),{success:o,data:a}=e;if(o)return a}catch(e){return console.log("getModelProtocolsList error:",e),!1}},testStatus:async()=>{try{const e=await m.post("/check"),{success:o,data:a}=e;if(o)return a}catch(e){console.log("testStatus error:",e)}},replaceModel:async(e,o)=>{try{const a=await m.get(`/replaceModel?sourceModelId=${e}&targetModelId=${o}`),{success:n,data:f}=a;if(n)return f}catch(a){console.log("replaceModel error:",a)}},checkModel:async e=>{try{const o=await m.get(`/checkModelReference?modelName=${e}`),{success:a,data:n}=o;if(a)return n}catch(o){console.log("checkModelReference error:",o)}}}},Y={common:{loading:"\u52A0\u8F7D\u4E2D..."},dashboard:{title:"\u6A21\u578B\u7BA1\u7406"},table:{viewLabel:"\u6A21\u578B",columns:{modelName:"\u6A21\u578B\u540D\u79F0",modelProtocol:"\u6A21\u578B\u4F20\u8F93\u534F\u8BAE",type:"\u4F7F\u7528\u7C7B\u578B",dec:"\u8BF4\u660E",status:"\u72B6\u6001",actions:"\u64CD\u4F5C"},statusHelpText:"\u5F53\u524D\u6A21\u578B\u72B6\u6001\u4E3A\u521D\u6B21\u65B0\u589E\u6821\u9A8C\u72B6\u6001\uFF0C\u82E5\u6A21\u578B\u4E0B\u7EBF\uFF0C\u6B64\u72B6\u6001\u4E0D\u4F1A\u4E3B\u52A8\u66F4\u65B0\uFF0C\u9700\u624B\u52A8\u6267\u884C\u6A21\u578B\u5220\u9664",toolbar:{add:"\u65B0\u5EFA",test:"\u6A21\u578B\u72B6\u6001\u68C0\u6D4B",replace:"\u6A21\u578B\u66FF\u6362"},actionEdit:"\u7F16\u8F91",actionAuth:"\u6388\u6743",actionDelete:"\u5220\u9664",tooltipChecking:"\u68C0\u6D4B\u4E2D\uFF0C\u8BF7\u7A0D\u540E",tooltipNoPermission:"\u89D2\u8272\u65E0\u6743\u9650\u64CD\u4F5C"},status:{available:"\u53EF\u7528",unavailable:"\u4E0D\u53EF\u7528",checking:"\u68C0\u6D4B\u4E2D"},empty:{noDataHint:"\u6682\u65E0\u6570\u636E\uFF0C\u8BF7\u5148\u65B0\u5EFA\u6A21\u578B",createModelBtn:"\u65B0\u5EFA\u6A21\u578B"},drawer:{titleNew:"\u65B0\u5EFA",titleEdit:"\u7F16\u8F91",cancel:"\u53D6\u6D88",confirm:"\u786E\u8BA4"},form:{labels:{modelName:"\u6A21\u578B\u540D\u79F0",modelIde:"\u6A21\u578BID",apiKey:"APIKey",url:"\u8BF7\u6C42URL",modelProtocol:"\u6A21\u578B\u4F20\u8F93\u534F\u8BAE",type:"\u4F7F\u7528\u7C7B\u578B",maxTokens:"\u4E0A\u4E0B\u6587\u957F\u5EA6",dec:"\u8BF4\u660E"},placeholders:{modelName:"\u8BF7\u8F93\u5165\u6A21\u578B\u540D\u79F0",modelIde:"\u8BF7\u8F93\u5165\u6A21\u578BID",apiKey:"\u8BF7\u8F93\u5165APIKey",url:"\u8BF7\u8F93\u5165\u8BF7\u6C42URL"},maxTokensHelpText:"\u8BF7\u5411\u6A21\u578B\u90E8\u7F72\u6216\u8FD0\u7EF4\u4EBA\u5458\u786E\u8BA4\u5F53\u524D\u6A21\u578B\u7684\u6700\u5927\u4E0A\u4E0B\u6587\u957F\u5EA6\uFF08Max Tokens / Context Length\uFF09\uFF0C\u5E76\u786E\u8BA4\u63A8\u7406\u670D\u52A1\uFF08\u5982 vLLM\uFF09\u662F\u5426\u914D\u7F6E\u4E86\u989D\u5916\u7684\u8F93\u5165\u957F\u5EA6\u9650\u5236"},replaceModal:{title:"\u6A21\u578B\u66FF\u6362",warningParagraph:"\u5982\u9700\u66F4\u6362\u6A21\u578B\uFF0C\u5728\u4E00\u952E\u66FF\u6362\u65F6\uFF0C\u7CFB\u7EDF\u5C06\u81EA\u52A8\u66F4\u65B0\u77E5\u8BC6\u89E3\u6790\u914D\u7F6E\u3001\u68C0\u7D22\u6D4B\u8BD5\u548C\u52A9\u624B\u914D\u7F6E\u4E2D\u7684\u6A21\u578B\u3002\u82E5\u66FF\u6362\u7684\u662F\u6587\u6863\u89E3\u6790\u7528\u7684Embedding\u6A21\u578B\uFF0C\u5219\u4F7F\u7528\u8BE5\u6A21\u578B\u7684\u6587\u6863\u5C06\u5168\u90E8\u91CD\u65B0\u6392\u961F\u89E3\u6790\uFF0C\u72B6\u6001\u53D8\u4E3A\u201C\u89E3\u6790\u4E2D\u201D\uFF0C\u4E14\u672A\u89E3\u6790\u5B8C\u6210\u7684\u6587\u6863\u6682\u4E0D\u53EF\u68C0\u7D22\uFF01",sourceLabel:"\u6A21\u578B\u540D\u79F0",targetLabel:"\u66FF\u6362\u4E3A",placeholderSelect:"\u8BF7\u9009\u62E9",cancel:"\u53D6\u6D88",confirm:"\u786E\u8BA4",messageSuccess:"\u6A21\u578B\u66FF\u6362\u6210\u529F"},message:{testSuccess:"\u6A21\u578B\u68C0\u6D4B\u4E2D\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5F85\u72B6\u6001\u66F4\u65B0\uFF01",deleteSuccess:"\u5220\u9664\u6210\u529F",createSuccess:"\u6A21\u578B\u65B0\u589E\u6210\u529F\uFF01",editSuccess:"\u6A21\u578B\u7F16\u8F91\u6210\u529F\uFF01"},deleteConfirm:{title:"\u786E\u8BA4\u5220\u9664\uFF1F",content:'\u786E\u5B9A\u8981\u5220\u9664\u6A21\u578B "{{name}}" \u5417\uFF1F\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002',titleWhenInUse:"\u5220\u9664\u6A21\u578B",contentWhenInUse:"\u5F53\u524D\u6A21\u578B\u5728\u7CFB\u7EDF\u5185\u5DF2\u88AB\u914D\u7F6E\u4F7F\u7528\uFF0C\u5220\u9664\u53EF\u80FD\u5F71\u54CD\u6587\u6863\u89E3\u6790\u3001\u95EE\u7B54\u3001\u591A\u6A21\u6001\u80FD\u529B\u4F7F\u7528\u7B49\uFF0C\u8BF7\u60A8\u5148\u4F7F\u7528\u201C\u6A21\u578B\u4E00\u952E\u66FF\u6362\u201D\u80FD\u529B\u5C06\u8BE5\u6A21\u578B\u66FF\u6362\u4E3A\u540C\u7C7B\u578B\u6A21\u578B\uFF0C\u518D\u5220\u9664\u6A21\u578B",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",deleteOkText:"\u5220\u9664"},server:{requestError:"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",noPermission:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",notLoggedIn:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"}},Ke={common:{loading:"Loading..."},dashboard:{title:"Model management"},table:{viewLabel:"Models",columns:{modelName:"Model name",modelProtocol:"Protocol",type:"Use type",dec:"Description",status:"Status",actions:"Actions"},statusHelpText:"Status is validated on first add; if the model goes offline, it will not update automatically. Delete the model manually if needed.",toolbar:{add:"Add",test:"Test model status",replace:"Replace model"},actionEdit:"Edit",actionAuth:"Authorize",actionDelete:"Delete",tooltipChecking:"Checking, please wait",tooltipNoPermission:"No permission"},status:{available:"Available",unavailable:"Unavailable",checking:"Checking"},empty:{noDataHint:"No data. Add a model first.",createModelBtn:"Add model"},drawer:{titleNew:"Add",titleEdit:"Edit",cancel:"Cancel",confirm:"Confirm"},form:{labels:{modelName:"Model name",modelIde:"Model ID",apiKey:"API Key",url:"Request URL",modelProtocol:"Protocol",type:"Use type",maxTokens:"Context length",dec:"Description"},placeholders:{modelName:"Enter model name",modelIde:"Enter model ID",apiKey:"Enter API Key",url:"Enter request URL"},maxTokensHelpText:"Confirm with your deployment team the model's max context length (Max Tokens) and any limits set by the inference service (e.g. vLLM)."},replaceModal:{title:"Replace model",warningParagraph:'When you replace a model, the system will update knowledge parsing, retrieval tests, and assistant configs. If you replace an Embedding model used for documents, all documents using it will be re-queued for parsing and become "Parsing"; unparsed documents will not be searchable until done.',sourceLabel:"Model name",targetLabel:"Replace with",placeholderSelect:"Select",cancel:"Cancel",confirm:"Confirm",messageSuccess:"Model replaced successfully"},message:{testSuccess:"Model check in progress. Status will update shortly.",deleteSuccess:"Deleted",createSuccess:"Model added.",editSuccess:"Model updated."},deleteConfirm:{title:"Confirm delete?",content:'Delete model "{{name}}"? This cannot be undone.',titleWhenInUse:"Delete model",contentWhenInUse:'This model is in use. Deleting it may affect document parsing, Q&A, and multimodal features. Use "Replace model" to switch to another model of the same type first, then delete.',okText:"OK",cancelText:"Cancel",deleteOkText:"Delete"},server:{requestError:"Request failed, please try again.",noPermission:"Insufficient permission",notLoggedIn:"Not logged in or token expired"}},je={common:{loading:"\u8AAD\u307F\u8FBC\u307F\u4E2D..."},dashboard:{title:"\u30E2\u30C7\u30EB\u7BA1\u7406"},table:{viewLabel:"\u30E2\u30C7\u30EB",columns:{modelName:"\u30E2\u30C7\u30EB\u540D",modelProtocol:"\u30D7\u30ED\u30C8\u30B3\u30EB",type:"\u7528\u9014",dec:"\u8AAC\u660E",status:"\u72B6\u614B",actions:"\u64CD\u4F5C"},statusHelpText:"\u72B6\u614B\u306F\u521D\u56DE\u8FFD\u52A0\u6642\u306B\u691C\u8A3C\u3055\u308C\u307E\u3059\u3002\u30E2\u30C7\u30EB\u304C\u30AA\u30D5\u30E9\u30A4\u30F3\u306B\u306A\u3063\u3066\u3082\u81EA\u52D5\u3067\u306F\u66F4\u65B0\u3055\u308C\u307E\u305B\u3093\u3002\u5FC5\u8981\u306B\u5FDC\u3058\u3066\u624B\u52D5\u3067\u524A\u9664\u3057\u3066\u304F\u3060\u3055\u3044\u3002",toolbar:{add:"\u65B0\u898F",test:"\u30E2\u30C7\u30EB\u72B6\u614B\u691C\u8A3C",replace:"\u30E2\u30C7\u30EB\u7F6E\u63DB"},actionEdit:"\u7DE8\u96C6",actionAuth:"\u6A29\u9650",actionDelete:"\u524A\u9664",tooltipChecking:"\u691C\u8A3C\u4E2D\u3001\u3057\u3070\u3089\u304F\u304A\u5F85\u3061\u304F\u3060\u3055\u3044",tooltipNoPermission:"\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093"},status:{available:"\u5229\u7528\u53EF",unavailable:"\u5229\u7528\u4E0D\u53EF",checking:"\u691C\u8A3C\u4E2D"},empty:{noDataHint:"\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u5148\u306B\u30E2\u30C7\u30EB\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002",createModelBtn:"\u30E2\u30C7\u30EB\u3092\u8FFD\u52A0"},drawer:{titleNew:"\u65B0\u898F",titleEdit:"\u7DE8\u96C6",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",confirm:"\u78BA\u8A8D"},form:{labels:{modelName:"\u30E2\u30C7\u30EB\u540D",modelIde:"\u30E2\u30C7\u30EBID",apiKey:"API\u30AD\u30FC",url:"\u30EA\u30AF\u30A8\u30B9\u30C8URL",modelProtocol:"\u30D7\u30ED\u30C8\u30B3\u30EB",type:"\u7528\u9014",maxTokens:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u9577",dec:"\u8AAC\u660E"},placeholders:{modelName:"\u30E2\u30C7\u30EB\u540D\u3092\u5165\u529B",modelIde:"\u30E2\u30C7\u30EBID\u3092\u5165\u529B",apiKey:"API\u30AD\u30FC\u3092\u5165\u529B",url:"\u30EA\u30AF\u30A8\u30B9\u30C8URL\u3092\u5165\u529B"},maxTokensHelpText:"\u30E2\u30C7\u30EB\u306E\u6700\u5927\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u9577\uFF08Max Tokens\uFF09\u3068\u63A8\u8AD6\u30B5\u30FC\u30D3\u30B9\uFF08vLLM\u7B49\uFF09\u306E\u5236\u9650\u3092\u30C7\u30D7\u30ED\u30A4\u62C5\u5F53\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},replaceModal:{title:"\u30E2\u30C7\u30EB\u7F6E\u63DB",warningParagraph:"\u30E2\u30C7\u30EB\u3092\u7F6E\u63DB\u3059\u308B\u3068\u3001\u77E5\u8B58\u89E3\u6790\u30FB\u691C\u7D22\u30C6\u30B9\u30C8\u30FB\u30A2\u30B7\u30B9\u30BF\u30F3\u30C8\u8A2D\u5B9A\u304C\u66F4\u65B0\u3055\u308C\u307E\u3059\u3002\u6587\u66F8\u89E3\u6790\u7528Embedding\u30E2\u30C7\u30EB\u3092\u7F6E\u63DB\u3057\u305F\u5834\u5408\u3001\u305D\u306E\u30E2\u30C7\u30EB\u3092\u4F7F\u3046\u6587\u66F8\u306F\u518D\u89E3\u6790\u30AD\u30E5\u30FC\u306B\u5165\u308A\u300C\u89E3\u6790\u4E2D\u300D\u3068\u306A\u308A\u3001\u89E3\u6790\u5B8C\u4E86\u307E\u3067\u691C\u7D22\u3067\u304D\u307E\u305B\u3093\u3002",sourceLabel:"\u30E2\u30C7\u30EB\u540D",targetLabel:"\u7F6E\u63DB\u5148",placeholderSelect:"\u9078\u629E",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",confirm:"\u78BA\u8A8D",messageSuccess:"\u30E2\u30C7\u30EB\u3092\u7F6E\u63DB\u3057\u307E\u3057\u305F"},message:{testSuccess:"\u30E2\u30C7\u30EB\u3092\u691C\u8A3C\u4E2D\u3067\u3059\u3002\u72B6\u614B\u304C\u66F4\u65B0\u3055\u308C\u308B\u307E\u3067\u304A\u5F85\u3061\u304F\u3060\u3055\u3044\u3002",deleteSuccess:"\u524A\u9664\u3057\u307E\u3057\u305F",createSuccess:"\u30E2\u30C7\u30EB\u3092\u8FFD\u52A0\u3057\u307E\u3057\u305F\u3002",editSuccess:"\u30E2\u30C7\u30EB\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F\u3002"},deleteConfirm:{title:"\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F",content:"\u30E2\u30C7\u30EB\u300C{{name}}\u300D\u3092\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F\u5143\u306B\u623B\u305B\u307E\u305B\u3093\u3002",titleWhenInUse:"\u30E2\u30C7\u30EB\u3092\u524A\u9664",contentWhenInUse:"\u3053\u306E\u30E2\u30C7\u30EB\u306F\u4F7F\u7528\u4E2D\u3067\u3059\u3002\u524A\u9664\u3059\u308B\u3068\u6587\u66F8\u89E3\u6790\u30FBQ&A\u30FB\u30DE\u30EB\u30C1\u30E2\u30FC\u30C0\u30EB\u306B\u5F71\u97FF\u3059\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002\u5148\u306B\u300C\u30E2\u30C7\u30EB\u7F6E\u63DB\u300D\u3067\u540C\u7A2E\u306E\u30E2\u30C7\u30EB\u306B\u7F6E\u304D\u63DB\u3048\u3066\u304B\u3089\u524A\u9664\u3057\u3066\u304F\u3060\u3055\u3044\u3002",okText:"\u78BA\u8A8D",cancelText:"\u30AD\u30E3\u30F3\u30BB\u30EB",deleteOkText:"\u524A\u9664"},server:{requestError:"\u30EA\u30AF\u30A8\u30B9\u30C8\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u3057\u3070\u3089\u304F\u3057\u3066\u304B\u3089\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002",noPermission:"\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093",notLoggedIn:"\u672A\u30ED\u30B0\u30A4\u30F3\u307E\u305F\u306F\u30C8\u30FC\u30AF\u30F3\u671F\u9650\u5207\u308C"}},_e={zh:Y,en:Ke,ja:je};function $e(t,F){return t.replace(/\{\{(\w+)\}\}/g,(r,c)=>F[c]??"")}function Oe(t,F){const r=_e[t]??Y;return F?{...r,...F}:r}function Be(t,F){const r=F.split(".");let c=t;for(const B of r)c=c==null?void 0:c[B];return typeof c=="string"?c:F}const Ae=Z.createContext({locale:"zh",messages:Y,getMessage:t=>Be(Y,t)});function le(){return Z.useContext(Ae)}function Xe({locale:t,messages:F,children:r}){const c=Z.useMemo(()=>{const B=Oe(t,F);return{locale:t,messages:B,getMessage:b=>Be(B,b)}},[t,F]);return Z.createElement(Ae.Provider,{value:c},r)}const Ze=Ue.div.attrs({className:"config-model-drawer-scroll-wrap"})`
|
|
2
2
|
width: 100%;
|
|
3
3
|
flex: 1 1 0;
|
|
4
4
|
min-height: min-content;
|
package/package.json
CHANGED
|
@@ -3,11 +3,15 @@
|
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"style": "assets/style.css",
|
|
5
5
|
"private": false,
|
|
6
|
-
"version": "2.3.
|
|
6
|
+
"version": "2.3.24",
|
|
7
7
|
"author": "hanfeng_Zhang",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "index.js",
|
|
10
10
|
"types": "index.d.ts",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"test": "yarn link",
|
|
13
|
+
"disconnect": "yarn unlink"
|
|
14
|
+
},
|
|
11
15
|
"peerDependencies": {
|
|
12
16
|
"@mxmweb/aichat": "^1.8.0",
|
|
13
17
|
"@mxmweb/fviewer": "^1.5.3",
|
|
@@ -86,6 +90,16 @@
|
|
|
86
90
|
"import": "./oprecords.js",
|
|
87
91
|
"default": "./oprecords.js"
|
|
88
92
|
},
|
|
93
|
+
"./reviewSetting": {
|
|
94
|
+
"types": "./reviewSetting.d.ts",
|
|
95
|
+
"import": "./reviewSetting.js",
|
|
96
|
+
"default": "./reviewSetting.js"
|
|
97
|
+
},
|
|
98
|
+
"./reviewManage": {
|
|
99
|
+
"types": "./reviewManage.d.ts",
|
|
100
|
+
"import": "./reviewManage.js",
|
|
101
|
+
"default": "./reviewManage.js"
|
|
102
|
+
},
|
|
89
103
|
"./style.css": "./assets/style.css",
|
|
90
104
|
"./assets/style.css": "./assets/style.css"
|
|
91
105
|
},
|
|
@@ -97,9 +111,5 @@
|
|
|
97
111
|
"@mxmweb/zui": "1.4.0",
|
|
98
112
|
"antd": "^5.18.0",
|
|
99
113
|
"axios": "^1.7.2"
|
|
100
|
-
},
|
|
101
|
-
"scripts": {
|
|
102
|
-
"test": "yarn link",
|
|
103
|
-
"disconnect": "yarn unlink"
|
|
104
114
|
}
|
|
105
|
-
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CustomComponents } from '@mxmweb/xviewer';
|
|
2
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
3
|
+
import { Styles } from '@mxmweb/zui';
|
|
4
|
+
|
|
5
|
+
declare function ReviewManage({ url, token, role, styles, CustomComponents, eventsEmit }: ReviewManageProps): JSX_2.Element;
|
|
6
|
+
export default ReviewManage;
|
|
7
|
+
|
|
8
|
+
declare interface ReviewManageProps {
|
|
9
|
+
url: string;
|
|
10
|
+
token: string;
|
|
11
|
+
role: string;
|
|
12
|
+
styles?: Styles;
|
|
13
|
+
CustomComponents?: CustomComponents;
|
|
14
|
+
eventsEmit?: (name: string, data?: any, innerFn?: any) => void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { }
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
declare module 'slate' {
|
|
21
|
+
interface CustomTypes {
|
|
22
|
+
Editor: BaseEditor & ReactEditor;
|
|
23
|
+
Element: CustomElement;
|
|
24
|
+
Text: CustomText;
|
|
25
|
+
}
|
|
26
|
+
}
|