@gientech/modual 1.8.8 → 1.9.0
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 +643 -643
- package/assets/GientechStreamReader-DqJjNXCO.js +449 -0
- package/assets/{mysql.svg → MySQL.svg} +14 -14
- 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/graph.svg +4 -4
- package/assets/{index-CPOAXITM.js → index-BKe5FgcC.js} +1 -1
- package/assets/{index-BbpyNfEd.js → index-BO-w4FPz.js} +1 -1
- package/assets/index-CIwaLPGb.js +6 -0
- package/assets/{index-DnJqVq9Q.js → index-D72cKELw.js} +1 -1
- package/assets/index-DdVFXD_y.js +6 -0
- package/assets/{index-CuySCBtZ.js → index-DwoTKC3G.js} +1 -1
- package/assets/{index-CCjG4bD0.js → index-FiuM-Chj.js} +1 -1
- package/assets/{index-BbHMAb8g.js → index-g-SUxfJH.js} +1 -1
- package/assets/{index-Wjs4Vb6x.js → index-j0kQJd0a.js} +1 -1
- package/assets/{index-fhKUis2J.js → index-x8IlxRuv.js} +2 -2
- package/assets/knowledge.svg +4 -4
- package/assets/{plus-Dmpl3gd8.js → plus-V9zUoSq6.js} +1 -1
- package/assets/sensitive.svg +5 -5
- package/assets/{style-CNIDlcUL.js → style-CGmZ5osp.js} +1 -1
- package/assets/{x-BjRa5XLp.js → x-CnaaLGJF.js} +1 -1
- package/assistantConfig.js +1 -1
- package/chat.js +2 -2
- package/database.js +2 -2
- package/databaseId.js +1 -1
- package/databaseTable.js +1 -1
- package/index.js +1 -1
- package/modelManage.js +1 -1
- package/package.json +6 -6
- package/sensitive.js +1 -1
- package/streamFilesReader.js +1 -1
- package/worker/pdf.worker.min.js +21 -21
- package/assets/GientechStreamReader-CNnsTqyV.js +0 -449
- package/assets/index-BH8au9G9.js +0 -11
- package/assets/index-Dkwp9YpO.js +0 -1
package/assets/index-BH8au9G9.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{jsx as u,jsxs as _,Fragment as Be}from"react/jsx-runtime";import*as W from"react";import{isValidElement as Re,useMemo as oe,useState as h,useRef as Ee,useCallback as ae,useEffect as ke}from"react";import{u as je}from"./index-CpW6Dhpp.js";import{F as We,J as K,c as Ue,T as He,U as Ge,m as Ze}from"./index-fhKUis2J.js";import{a as Ie,g as qe,m as Ye,$ as Ke,a0 as Xe,r as Je,a1 as Qe,a2 as et,a3 as tt,l as ut,f as de,a4 as at,u as st,a5 as ot,T as pe,Y as nt,o as rt,M as it,b as lt,a6 as ct,h as dt,i as fe}from"./index-BbHMAb8g.js";import{O as Te}from"./index-CuySCBtZ.js";/* empty css */import{s as Y,M as De}from"./style-CNIDlcUL.js";import{U as Se}from"./index-BbpyNfEd.js";import{D as Me}from"./index-DnJqVq9Q.js";import{X as he}from"./x-BjRa5XLp.js";import"react-dom";import{B as Ae}from"./index-Dkwp9YpO.js";/**
|
|
2
|
-
* @license lucide-react v0.456.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const pt=Ie("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
7
|
-
* @license lucide-react v0.456.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const ze=Ie("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),me=e=>e?typeof e=="function"?e():e:null,mt=e=>{const{componentCls:i,popoverColor:o,titleMinWidth:a,fontWeightStrong:l,innerPadding:d,boxShadowSecondary:k,colorTextHeading:V,borderRadiusLG:m,zIndexPopup:D,titleMarginBottom:I,colorBgElevated:P,popoverBg:x,titleBorderBottom:y,innerContentPadding:F,titlePadding:v}=e;return[{[i]:Object.assign(Object.assign({},Je(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:D,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:["var(--valid-offset-x, 50%)","var(--arrow-y, 50%)"].join(" "),"--antd-arrow-background-color":P,width:"max-content",maxWidth:"100vw","&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${i}-content`]:{position:"relative"},[`${i}-inner`]:{backgroundColor:x,backgroundClip:"padding-box",borderRadius:m,boxShadow:k,padding:d},[`${i}-title`]:{minWidth:a,marginBottom:I,color:V,fontWeight:l,borderBottom:y,padding:v},[`${i}-inner-content`]:{color:o,padding:F}})},Xe(e,"var(--antd-arrow-background-color)"),{[`${i}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",[`${i}-content`]:{display:"inline-block"}}}]},Ft=e=>{const{componentCls:i}=e;return{[i]:Qe.map(o=>{const a=e[`${o}6`];return{[`&${i}-${o}`]:{"--antd-arrow-background-color":a,[`${i}-inner`]:{backgroundColor:a},[`${i}-arrow`]:{background:"transparent"}}}})}},ft=e=>{const{lineWidth:i,controlHeight:o,fontHeight:a,padding:l,wireframe:d,zIndexPopupBase:k,borderRadiusLG:V,marginXS:m,lineType:D,colorSplit:I,paddingSM:P}=e,x=o-a,y=x/2,F=x/2-i,v=l;return Object.assign(Object.assign(Object.assign({titleMinWidth:177,zIndexPopup:k+30},et(e)),tt({contentRadius:V,limitVerticalRadius:!0})),{innerPadding:d?0:12,titleMarginBottom:d?0:m,titlePadding:d?`${y}px ${v}px ${F}px`:0,titleBorderBottom:d?`${i}px ${D} ${I}`:"none",innerContentPadding:d?`${P}px ${v}px`:0})},Ne=qe("Popover",e=>{const{colorBgElevated:i,colorText:o}=e,a=Ye(e,{popoverBg:i,popoverColor:o});return[mt(a),Ft(a),Ke(a,"zoom-big")]},ft,{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]});var Ct=function(e,i){var o={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&i.indexOf(a)<0&&(o[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(e);l<a.length;l++)i.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(e,a[l])&&(o[a[l]]=e[a[l]]);return o};const Oe=({title:e,content:i,prefixCls:o})=>!e&&!i?null:W.createElement(W.Fragment,null,e&&W.createElement("div",{className:`${o}-title`},e),i&&W.createElement("div",{className:`${o}-inner-content`},i)),gt=e=>{const{hashId:i,prefixCls:o,className:a,style:l,placement:d="top",title:k,content:V,children:m}=e,D=me(k),I=me(V),P=de(i,o,`${o}-pure`,`${o}-placement-${d}`,a);return W.createElement("div",{className:P,style:l},W.createElement("div",{className:`${o}-arrow`}),W.createElement(at,Object.assign({},e,{className:i,prefixCls:o}),m||W.createElement(Oe,{prefixCls:o,title:D,content:I})))},yt=e=>{const{prefixCls:i,className:o}=e,a=Ct(e,["prefixCls","className"]),{getPrefixCls:l}=W.useContext(ut),d=l("popover",i),[k,V,m]=Ne(d);return k(W.createElement(gt,Object.assign({},a,{prefixCls:d,hashId:V,className:de(o,m)})))};var Et=function(e,i){var o={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&i.indexOf(a)<0&&(o[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(e);l<a.length;l++)i.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(e,a[l])&&(o[a[l]]=e[a[l]]);return o};const ht=W.forwardRef((e,i)=>{var o,a;const{prefixCls:l,title:d,content:k,overlayClassName:V,placement:m="top",trigger:D="hover",children:I,mouseEnterDelay:P=.1,mouseLeaveDelay:x=.1,onOpenChange:y,overlayStyle:F={},styles:v,classNames:S}=e,s=Et(e,["prefixCls","title","content","overlayClassName","placement","trigger","children","mouseEnterDelay","mouseLeaveDelay","onOpenChange","overlayStyle","styles","classNames"]),{getPrefixCls:n,className:r,style:c,classNames:B,styles:E}=st("popover"),L=n("popover",l),[C,b,H]=Ne(L),q=n(),G=de(V,b,H,r,B.root,S==null?void 0:S.root),ne=de(B.body,S==null?void 0:S.body),[re,ie]=ot(!1,{value:(o=e.open)!==null&&o!==void 0?o:e.visible,defaultValue:(a=e.defaultOpen)!==null&&a!==void 0?a:e.defaultVisible}),X=(R,J)=>{ie(R,!0),y==null||y(R,J)},le=R=>{R.keyCode===it.ESC&&X(!1,R)},se=R=>{X(R)},ee=me(d),te=me(k);return C(W.createElement(pe,Object.assign({placement:m,trigger:D,mouseEnterDelay:P,mouseLeaveDelay:x},s,{prefixCls:L,classNames:{root:G,body:ne},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},E.root),c),F),v==null?void 0:v.root),body:Object.assign(Object.assign({},E.body),v==null?void 0:v.body)},ref:i,open:re,onOpenChange:se,overlay:ee||te?W.createElement(Oe,{prefixCls:L,title:ee,content:te}):null,transitionName:nt(q,"zoom-big",s.transitionName),"data-popover-inject":!0}),rt(I,{onKeyDown:R=>{var J,ue;Re(I)&&((ue=I==null?void 0:(J=I.props).onKeyDown)===null||ue===void 0||ue.call(J,R)),le(R)}})))}),_e=ht;_e._InternalPanelDoNotUseOrYouWillBeFired=yt;const bt="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",Dt="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",Le=({url:e,token:i,role:o,eventsEmit:a})=>{const l=lt.create({baseURL:e,timeout:1e6});return l.interceptors.request.use(s=>{let n=i;return!n&&!["user/login","user/kaptcha","user/regist"].some(c=>s.url.includes(c))?(a&&a("request:error_auth",{errorMsg:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F",redirect:"/login"}),Promise.reject(new Error("\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"))):(s.headers.Authorization=n||"",s.headers.userName=o==="\u672A\u767B\u5F55\u7528\u6237"?"":o,s)}),l.interceptors.response.use(s=>{const n=["user/kaptcha"],r=s.data;if(n.some(L=>s.config.url&&s.config.url.includes(L))||r.size&&r.type)return r;const{success:c,errorMsg:B,errorCode:E}=r;if(c)return r;a&&a("request:error_business",{errorCode:E,errorMsg:B||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",response:r})},s=>{var n,r,c,B,E,L,C,b,H;if(s.message==="canceled")return Promise.reject(s);if(a){let q="request:error_network",G={errorMsg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:s};((n=s==null?void 0:s.response)==null?void 0:n.status)===401?(q="request:error_auth",G={errorMsg:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",error:s,redirect:"/login"}):(((c=(r=s==null?void 0:s.response)==null?void 0:r.data)==null?void 0:c.errorCode)==="30013"||((E=(B=s==null?void 0:s.response)==null?void 0:B.data)==null?void 0:E.errorCode)==="30023")&&(q="request:error_business",G={errorCode:(C=(L=s==null?void 0:s.response)==null?void 0:L.data)==null?void 0:C.errorCode,errorMsg:((H=(b=s==null?void 0:s.response)==null?void 0:b.data)==null?void 0:H.errorMsg)||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",error:s}),a(q,G)}return Promise.reject(s)}),{getTableList:async s=>{try{const n=await l.get(`/directDB/queryTableList/${s}`),{success:r,data:c}=n;if(r)return c}catch(n){console.log("getTableList error:",n)}},getTableTreeList:async s=>{try{const n=await l.get(`/dataTable/queryTableFileTreeList/${s}`),{success:r,data:c}=n;if(r)return c}catch(n){console.log("getTableTreeList error:",n)}},getDBDetailById:async(s,n)=>{const r=ve(n);try{const c=await l.get(`/${r}/queryDBInfo/${s}`),{success:B,data:E}=c;if(B)return E}catch(c){console.log("getDBDetailById error:",c)}},delTableById:async(s,n)=>{const r=ve(n);try{const c=await l.delete(`/${r}/deleteTable/${s}`),{success:B,data:E}=c;if(B)return E}catch(c){console.log("delTableById error:",c)}},delFileById:async s=>{try{const n=await l.delete(`/dataTable/deleteTableFileData/${s}`),{success:r,data:c}=n;if(r)return c}catch(n){console.log("delFileById",n)}},parseFiles:async({fileIds:s,isGenDescription:n,tableDescriptionMap:r})=>{try{const c=await l.post("/dataTable/parseFiles",{fileIds:s,isGenDescription:n,tableDescriptionMap:r}),{success:B,data:E}=c;if(B)return E}catch(c){console.log("parseFiles error:",c)}},reParseFile:async s=>{try{const n=await l.post(`/dataTable/reParseFile/${s}`),{success:r,data:c}=n;if(r)return c}catch(n){console.log("reParseFile error:",n)}},parseAppendFile:async({fileIds:s,tableId:n})=>{try{const r=await l.post("/dataTable/parseAppendFiles",{fileIds:s,tableId:n}),{success:c,data:B}=r;if(c)return B}catch(r){console.log("parseAppendFile error:",r)}},deleteUploadedFiles:async s=>{try{const n=await l.post("/dataTable/cancelUploadFile",{fileIds:s}),{success:r,data:c}=n;if(r)return c}catch(n){console.log("deleteUploadedFiles error:",n)}},getTableInfoById:async s=>{try{const n=await l.get(`/dataTable/queryTableMeta/${s}`),{success:r,data:c}=n;if(r)return c}catch(n){console.log("getTableInfoById error:",n)}},updateTableInfo:async({tableId:s,description:n,businessName:r})=>{try{const c=await l.post("/dataTable/updateTableInfo",{tableId:s,businessName:r,description:n}),{success:B,data:E}=c;if(B)return E}catch(c){console.log("updateTableInfo error:",c)}},optimizeDesc:async s=>{try{const n=await l.get(`/genTableDescription/${s}`),{success:r,data:c}=n;if(r)return c}catch(n){console.log("optimizeDesc error:",n)}}}},ve=e=>e=="DataTable"?"dataTable":"directDB",Ce='<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',Bt={colors:{background:"#ffffff",border:"#e5e7eb",appBackground:"#ffffff",listBackground:"#ffffff",dashboardBackground:"#ffffff"},space:{padding:"0",margin:"md",shadow:"none"}},At=({drawerTitle:e,drawerVisible:i,uploadUrl:o,handleDrawerClose:a,dbId:l,tableInfo:d,token:k,url:V,role:m})=>{const D=oe(()=>({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:o,autoUpload:!0,headers:{Authorization:k},queryParams:{databaseId:l,...d&&{tableId:d.tableId}},placeholder:_("div",{children:[u("div",{className:"text-lg font-bold",children:"\u70B9\u51FB\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u5904\u4E0A\u4F20"}),_("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:Dt,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(We,{size:20,style:{color:"#6b7280"}})}},...!d&&{buttons:[{label:"\u4F7F\u7528\u6A21\u7248",icon:u("img",{src:bt}),mode:"text",onClick:()=>{c(!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,P]=h(!1),[x,y]=h({}),F=Ee(null),[v,S]=h(!1),[s,n]=h([]),[r,c]=h(!1),[B,E]=h(Ce),[L,C]=h(null),[b,H]=h(Ce),[q,G]=h(0),{parseFiles:ne,parseAppendFile:re,deleteUploadedFiles:ie}=Le({url:V,token:k,role:m}),X=ae(async(g,f,$)=>{var M;switch(console.log("[DynamicFormAdopter] \u4E8B\u4EF6:",g,f),g){case"form:ready":f.formRef?F.current=f.formRef:console.log("\u274C data.formRef \u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u4FDD\u5B58\u8868\u5355\u5F15\u7528");break;case"form:submit":se();break;case"form_field_change":y(z=>({...z,[f.fieldId]:f.value}));break;case"uploader:error":(M=f.item)!=null&&M.id?n(z=>[{id:f.item.id,status:f.item.status},...z]):Y.error(f==null?void 0:f.message);break;case"uploader:success":n(z=>[{id:f.item.id,status:f.item.status},...z]);break;case"uploader:remove":const U=f.item.status;n(z=>z.filter(Q=>Q.id!==f.item.id)),U=="success"&&await te([f.item.uploadApiRes]);break;default:console.log("\u672A\u5904\u7406\u7684\u4E8B\u4EF6:",g)}},[]),le=oe(()=>({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:D.formWidth,formConfig:{layout:D.layout,showReset:!1,showSubmit:!1,formWidth:D.formWidth,getFormData:()=>({...x,timestamp:new Date().toISOString(),formId:D.id}),onFieldChange:(g,f)=>{X("form_field_change",{fieldId:g,value:f},void 0)},onValidationError:g=>{X("form_validation_error",g,void 0)}}}],dataSource:[{id:D.id,fields:D.fields,defaultValues:{}}],eventsEmit:X,styles:{theme:Bt}}),[d,D]),se=async()=>{var g;try{P(!0);const f=await F.current.getAllData();if(f.isValid){const $=(g=f.fields.find(M=>M.name=="fileIds"))==null?void 0:g.value;if(Array.isArray($)&&($==null?void 0:$.length)>0){let M;if(d)M=await re({fileIds:$.map(U=>U.uploadApiRes),tableId:d.id});else{const U={fileIds:$.map(z=>z.uploadApiRes),tableDescriptionMap:$.reduce((z,Q)=>(z[Q.uploadApiRes]=Q.formData.description,z),{}),isGenDescription:v};M=await ne(U)}M&&a("refresh")}}}catch(f){console.error("\u8868\u5355\u6570\u636E\u5931\u8D25:",f)}finally{a(),P(!1),S(!1)}},ee=async g=>{var f;try{const $=await F.current.getAllData();if($.isValid){const M=(f=$.fields.find(U=>U.name=="fileIds"))==null?void 0:f.value;if(M&&Array.isArray(M)&&(M==null?void 0:M.length)>0){const U=M.map(Q=>Q.uploadApiRes),z=await te(U)}}}catch($){console.error("\u8868\u5355\u6570\u636E\u5931\u8D25:",$)}finally{a(),S(!1)}},te=async g=>{try{const f=await ie(g);if(f)return f}catch(f){console.error("\u5220\u9664\u6587\u4EF6\u6570\u636E\u5931\u8D25:",f)}},R=g=>{S(g)},J=ae(g=>{E(g),console.log("\u6A21\u7248\u5185\u5BB9\u53D8\u5316:",g)},[]),ue=ae(g=>{C(()=>g),console.log("getData\u51FD\u6570\u5DF2\u8BBE\u7F6E")},[]),Fe=ae(async()=>{try{if(!L){console.error("getData\u51FD\u6570\u5C1A\u672A\u51C6\u5907\u597D\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}const g=L("pure_string");await navigator.clipboard.writeText(g),Y.success("\u5DF2\u590D\u5236",1)}catch(g){console.error("\u590D\u5236\u5931\u8D25:",g)}finally{c(!1)}},[L]);return _(Me,{title:e,className:"database-upload-drawer",placement:"right",width:720,closeIcon:!1,extra:u(he,{size:20,color:"#888888",onClick:()=>ee(),className:"cursor-pointer"}),open:i,destroyOnHidden:!0,footer:_("div",{className:"flex items-center",style:{justifyContent:d?"end":"space-between"},children:[!d&&_("div",{className:"flex gap-2 items-center",children:[u("span",{children:"\u81EA\u52A8\u751F\u6210\u6570\u636E\u8868\u63CF\u8FF0"})," ",u(pe,{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(Ue,{size:14})}),u(ct,{onChange:R})]}),_("div",{className:"flex self-end gap-3",children:[u(K,{mode:"default",style:{marginRight:10},label:"\u53D6\u6D88",onClick:ee}),u(K,{mode:"primary",label:"\u786E\u8BA4\u5BFC\u5165",loading:I,disabled:s.some(g=>g.status=="error"),onClick:async()=>{await se()}})]})]}),children:[u(Te,{...le},"upload-file"),u(De,{title:_("div",{children:["\u6A21\u7248",u("span",{className:"text-[12px] text-[#888888] ml-[8px]",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:r,onCancel:()=>c(!1),footer:_("div",{className:"flex justify-end items-center gap-3",children:[u(K,{mode:"default",label:"\u91CD\u7F6E",onClick:()=>{H(Ce),G(g=>g+1)}}),u(K,{mode:"primary",label:"\u590D\u5236",onClick:Fe})]}),children:u(Se,{data:b,onChange:J,onGetData:ue,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"}}},q)})]})},vt="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",xt="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:wt}=De,kt='<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',It=({drawerTitle:e,drawerVisible:i,tableInfo:o,handleDrawerClose:a,optimizeDesc:l,eventsEmit:d})=>{const k=oe(()=>(o==null?void 0:o.data.find(C=>C.columnId=="name").value)||"-",[o]),[V,m]=h(""),[D,I]=h(null),[P,x]=h(""),[y,F]=h(0),[v,S]=h(!1),[s,n]=h(!1);ke(()=>{const C=(o==null?void 0:o.data.find(b=>b.columnId=="description").value)||"-";x(C)},[o]);const r=()=>{wt({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(){x(kt),F(C=>C+1)},onCancel(){console.log("Cancel")}})},c=ae(C=>{m(C),console.log("\u6A21\u7248\u5185\u5BB9\u53D8\u5316:",C)},[]),B=ae(C=>{I(()=>C),console.log("getData\u51FD\u6570\u5DF2\u8BBE\u7F6E")},[]),E=async()=>{try{S(!0);const C=await l(o.tableId);C&&(x(C),F(b=>b+1),S(!1))}catch{Y.error("AI \u4F18\u5316\u5931\u8D25")}},L=ae(()=>{if(!D){console.error("getData\u51FD\u6570\u5C1A\u672A\u51C6\u5907\u597D\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}const C=D("pure_string");d("table_info:update",C)},[D,d]);return _(Me,{title:e,placement:"right",width:720,onClose:a,closeIcon:!1,extra:u(he,{size:20,color:"#888888",onClick:a,className:"cursor-pointer"}),open:i,destroyOnHidden:!0,footer:u("div",{className:"flex items-center",style:{justifyContent:"end"},children:_("div",{className:"flex self-end gap-3",children:[u(K,{mode:"default",style:{marginRight:10},label:"\u53D6\u6D88",onClick:a}),u(K,{mode:"primary",label:"\u786E\u8BA4",onClick:()=>L(),disabled:v})]})}),children:[u("div",{className:"mb-[10px] font-bold",children:k}),_("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(Se,{data:P,onChange:c,onGetData:B,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"}}},y),_("div",{children:[u(_e,{open:s,onOpenChange:C=>n(!!C),content:u("div",{style:{width:"600px",margin:"10px",padding:"10px"},onClick:r,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:_("div",{className:"flex justify-between items-center",style:{margin:"10px"},children:[u("div",{className:"text-[16px]",children:"\u6A21\u7248"}),u(he,{size:20,color:"#888888",onClick:()=>n(!1),className:"cursor-pointer"})]}),trigger:"click",destroyOnHidden:!0,placement:"bottomRight",getPopupContainer:C=>C,children:u("span",{children:u(K,{mode:"text",icon:u("img",{src:vt}),children:"\u4F7F\u7528\u6A21\u7248"})})}),u(K,{onClick:E,mode:"text",icon:u("img",{src:xt}),loading:v,children:"AI\u4F18\u5316"})]})]})},Tt=""+new URL("empty.png",import.meta.url).href;var Z=(e=>(e[e.DATE=0]="DATE",e[e.VIEW=1]="VIEW",e[e.ERROR=2]="ERROR",e[e.AUTHORIZE=3]="AUTHORIZE",e[e.DELETE=4]="DELETE",e[e.ANALYSIS_OR_EXTRACT=5]="ANALYSIS_OR_EXTRACT",e[e.DOWNLOAD=6]="DOWNLOAD",e[e.EDIT=7]="EDIT",e[e.ADD=8]="ADD",e[e.ANALYSIS_CONFIG=9]="ANALYSIS_CONFIG",e[e.AUTHORIZE_CONFIG=10]="AUTHORIZE_CONFIG",e))(Z||{}),be=(e=>(e.GENERATING="generating",e.SUCCESS="success",e.FAIL="fail",e))(be||{});const ge={success:"green",error:"red",warning:"orange",processing:"blue",info:"cyan",default:"default"},St=e=>typeof e=="string"&&e in ge?ge[e]:ge.default,ye=e=>{const{value:i,cell:o}=e;switch(o.columnId){case"importstatus":return i?u(pe,{title:"\u6709\u8FFD\u52A0\u5931\u8D25\u7684\u6587\u4EF6\uFF0C\u8BF7\u53CA\u65F6\u5904\u7406",children:u(He,{color:"red",bordered:!1,children:"\u8FFD\u52A0\u5931\u8D25"})}):u(Be,{});case"status":const a=St(e.cell.statusType);return i=="\u5BFC\u5165\u5931\u8D25"?u(pe,{title:o.errorMsg,children:_("div",{className:"flex items-center gap-2",children:[u(Ae,{color:a,text:i}),u(ze,{size:14,color:"red"})]})}):u(Ae,{color:a,text:i});default:return u(Be,{})}},xe=[{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"}],Mt=e=>{var a,l;const{cell:i,value:o}=e;return typeof o=="string"?u("div",{title:o,style:{maxWidth:240,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o}):(a=i.tableMeta)!=null&&a.isGenDescription&&((l=i.tableMeta)==null?void 0:l.generateDescriptionStatus)=="generating"?_("div",{className:"flex items-center gap-1 text-[#84ADFF]",style:{color:"#84ADFF"},children:[u("span",{children:"\u751F\u6210\u4E2D"}),u(pt,{size:14})]}):"-"},zt=({dbInfo:e,setDrawerTitle:i,setDrawerVisible:o,getBtnDisabled:a})=>_("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:Tt,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(K,{mode:"primary",label:"\u4E0A\u4F20\u6570\u636E\u6587\u4EF6",disabled:a&&a(8,e==null?void 0:e.permission),onClick:()=>{i("\u4E0A\u4F20\u6570\u636E\u6587\u4EF6"),o(!0)}})})]}),{confirm:we}=De,Zt=e=>{const{url:i,token:o,role:a,id:l,dbType:d,styles:k,CustomComponents:V,getBtnDisabled:m,uploadUrl:D}=e,I=oe(()=>dt({theme:fe,mode:"light"},k),[k]),[P,x]=h({container:"ready",content:"ready"}),y=Ee(null),F=Ee(null),[v,S]=h(),[s,n]=h({}),[r,c]=h(),[B,E]=h(!1),[L,C]=h(""),[b,H]=h(),[q,G]=h(!1),[ne,re]=h(""),{getTableList:ie,delTableById:X,delFileById:le,updateTableInfo:se,optimizeDesc:ee,getTableTreeList:te,reParseFile:R,getDBDetailById:J}=Le({url:i,token:o,role:a,eventsEmit:e.eventsEmit});ke(()=>(l&&d&&(x(p=>({...p,container:"loading"})),ue()),()=>{F.current&&(clearTimeout(F.current),F.current=null)}),[l,d]);const ue=async()=>{try{const p=await J(l,d);p&&(c(p),x(t=>({...t,container:"ready",content:"loading"})))}catch(p){console.log("[TableApiError] getDBInfo:",p)}await ce()},Fe=async()=>{try{if(d=="DirectDB"){const p=await ie(l);if(p){const t=f(p);return S(t||[]),x(j=>({...j,content:"ready"})),t||[]}else x(t=>({...t,content:"error"}))}else{const p=await te(l);if(p){const t=g(p);return S(t||[]),x(j=>({...j,content:"ready"})),t||[]}else x(t=>({...t,content:"error"}))}}catch(p){console.log("[TableApiError] getTableList:",p)}};function g(p){return(p||[]).map((t,j)=>{var w,O;let A=xe.find(T=>T.status==t.status);const N=t.children.some(T=>T.status=="00");return{id:t.fileId.toString(),tableId:t.tableId,data:[{columnId:"name",value:(t==null?void 0:t.originalFilename)||"-",type:"label"},{columnId:"description",value:(w=t==null?void 0:t.tableMeta)==null?void 0:w.description,type:"customized",tableMeta:t==null?void 0:t.tableMeta},{columnId:"count",value:`${t.rowCount}\u884C\uFF0C${t.columnCount}\u5217`,type:"text"},{columnId:"status",...A,type:"customized",errorMsg:t.errorMsg},{columnId:"importstatus",value:N,type:"customized"},{columnId:"createdAt",value:t.gmtCreate,type:"date"},{columnId:"updatedAt",value:t.gmtModified,type:"date"},...t.status=="30"?[{columnId:"actions",value:"view",label:"\u67E5\u770B",type:"action",disabled:m&&m(Z.VIEW,t.permission)},{columnId:"actions",value:"edit",label:"\u4FEE\u6539\u914D\u7F6E",type:"action",disabled:m&&m(Z.EDIT,t.permission)},{columnId:"actions",value:"addData",label:"\u8FFD\u52A0\u6570\u636E",type:"action",disabled:m&&m(Z.EDIT,t.permission)}]:[],...t.status=="00"?[{columnId:"actions",value:"reValidate",label:"\u91CD\u65B0\u5BFC\u5165",type:"action"}]:[],{columnId:"actions",value:"delete",label:"\u5220\u9664",type:"action",disabled:m&&m(Z.DELETE,t.permission)}],expanded:!1,...t.children&&((O=t.children)==null?void 0:O.length)>0&&{children:[...(t.children||[]).map(T=>{const $e=xe.find(Pe=>Pe.status==T.status),Ve=[{columnId:"name",value:T.originalFilename,type:"text"},{columnId:"count",value:`${T.rowCount}\u884C\uFF0C${T.columnCount}\u5217`,type:"text"},{columnId:"status",...$e,errorMsg:T.errorMsg,type:"customized"},{columnId:"createdAt",value:T.gmtCreate,type:"date"},{columnId:"updatedAt",value:T.gmtModified,type:"date"},...T.status=="30"?[{columnId:"actions",value:"view",label:"\u67E5\u770B",type:"action",disabled:m&&m(Z.VIEW,T.permission)}]:[],...T.status=="00"?[{columnId:"actions",value:"reValidate",label:"\u91CD\u65B0\u5BFC\u5165",type:"action",disabled:m&&m(Z.ADD,T.permission)}]:[],{columnId:"actions",value:"delete_sub",label:"\u5220\u9664",type:"action",disabled:m&&m(Z.DELETE,T.permission)}];return{id:T.fileId.toString(),tableId:T.tableId,data:Ve}})]}}})}function f(p){return(p||[]).map((t,j)=>({id:t.id||je(8),data:[{columnId:"name",value:t.physicalName},{columnId:"cnname",value:t.businessName},{columnId:"colcount",value:t.columnCount},{columnId:"count",value:`${t.rowCount}\u884C\uFF0C${t.columnCount}\u5217`},{columnId:"actions",value:"view",label:"\u67E5\u770B",disabled:m&&m(Z.VIEW,t.permission)}]}))}async function $(p,t,j){switch(console.log("[adopter] mergedEventsEmit",p,t,j),p){case"table_action_delete":{try{if(console.log("[delete] \u5220\u9664\u4E8B\u4EF6\u6570\u636E:",t),!t||!t.tableId&&!t.id){console.error("[delete] \u5220\u9664\u4E8B\u4EF6\u6570\u636E\u4E0D\u5B8C\u6574:",t),Y.error("\u5220\u9664\u5931\u8D25\uFF1A\u6570\u636E\u4E0D\u5B8C\u6574");return}const A=t.tableId||t.id,N=t.id;we({title:"\u786E\u8BA4\u5220\u9664\u6570\u636E\u5E93\uFF1F",content:"\u8BE5\u6570\u636E\u8868\u53CA\u5176\u8FFD\u52A0\u6570\u636E\u90FD\u5C06\u88AB\u5220\u9664\u4E14\u65E0\u6CD5\u6062\u590D",icon:u(ze,{color:"#FF4D4F",className:"mr-[8px]"}),okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",async onOk(){await X(A,d)&&(y!=null&&y.current)?(y==null||y.current.appFn.removeItem(N),Y.success("\u5220\u9664\u6210\u529F")):Y.error("\u5220\u9664\u5931\u8D25")}})}catch(A){console.error("\u5220\u9664\u8868\u6570\u636E\u5931\u8D25:",A),Y.error("\u5220\u9664\u5931\u8D25")}break}case"table_action_edit":{re("\u4FEE\u6539\u6570\u636E\u914D\u7F6E"),G(!0),H(t);break}case"toolbar_upload":{C("\u4E0A\u4F20\u6570\u636E\u6587\u4EF6"),E(!0);break}case"table_action_addData":{C("\u8FFD\u52A0\u6570\u636E"),E(!0),H(t);break}case"table_action_reValidate":{await R(t.id)&&(F.current&&(clearTimeout(F.current),F.current=null),await ce());break}case"table_info:update":{try{if(b!=null&&b.id){const A=(b==null?void 0:b.data.find(w=>w.columnId=="name").value)||"-";if(await se({tableId:b.tableId,description:t,businessName:A})&&(y!=null&&y.current)){const w={...b,data:b.data.map(O=>O.columnId=="description"?{...O,value:t}:O)};y==null||y.current.appFn.updateItem(w,b.id),Y.success("\u4FEE\u6539\u914D\u7F6E\u6210\u529F")}}}catch(A){console.error("\u4FEE\u6539\u914D\u7F6E\u5931\u8D25",A)}finally{z()}break}case"table_action_delete_sub":{try{we({title:"\u786E\u8BA4\u5220\u9664\u6570\u636E\uFF1F",content:"\u5220\u9664\u540E\uFF0C\u8BE5\u6570\u636E\u5C06\u65E0\u6CD5\u6062\u590D",okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",async onOk(){const{id:A,tableId:N}=t;await le(t.id)&&(y!=null&&y.current)&&(n(O=>({...O,[N]:[...O[N]||[],A]})),t.data.find(O=>O.status=="00")&&(F.current&&(clearTimeout(F.current),F.current=null),ce()),j.removeItem(A,N),Y.success("\u8FFD\u52A0\u6587\u4EF6\u6570\u636E\u5220\u9664\u6210\u529F"))}})}catch{console.log("\u5220\u9664\u8868\u6570\u636E\u5931\u8D25")}break}case"toolbar_auth":{typeof e.eventsEmit=="function"&&e.eventsEmit("toolbar_auth",r);break}default:typeof e.eventsEmit=="function"&&e.eventsEmit(p,t);break}}const M=oe(()=>({label:"\u6570\u636E\u8868\u7BA1\u7406",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:"\u6570\u636E\u8868\u82F1\u6587\u540D\u79F0",type:"label"},{id:"cnname",title:"\u6570\u636E\u8868\u4E2D\u6587\u540D\u79F0",type:"label"},{id:"colcount",title:"\u5B57\u6BB5\u6570",type:"text"},{id:"count",title:"\u6570\u636E\u91CF",type:"text"},{id:"actions",title:"\u64CD\u4F5C",type:"action"}],toolbar:[{type:"fuzzy_search",key:"search",label:"\u641C\u7D22",searchKeys:["name","description"],position:"right"},{type:"button",key:"auth",label:"\u914D\u7F6E",btnType:"default",position:"right"}]}]}),[v,d]),U=oe(()=>({label:"\u6570\u636E\u8868\u7BA1\u7406",model:null,defaultActiveId:"data-table-view",views:[{label:"\u4E0A\u4F20\u6570\u636E\u5217\u8868",id:"data-table-view",type:"table",viewBehavior:"pagination",allowMultiSelect:!1,viewPageSize:10,columns:[{id:"name",title:"\u6587\u4EF6\u540D",type:"label",tip:"\u6587\u4EF6\u540D"},{id:"description",title:"\u63CF\u8FF0",type:"customized",component:u(Mt,{}),helpText:"\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"},{id:"count",title:"\u6570\u636E\u91CF",type:"text",tip:"\u6570\u636E\u91CF"},{id:"status",title:"\u5BFC\u5165\u72B6\u6001",type:"customized",component:u(ye,{})},{id:"importstatus",title:"\u8FFD\u52A0\u63D0\u793A",type:"customized",component:u(ye,{})},{id:"createdAt",title:"\u521B\u5EFA\u65F6\u95F4",type:"date",tip:"\u521B\u5EFA\u65F6\u95F4"},{id:"updatedAt",title:"\u66F4\u65B0\u65F6\u95F4",type:"date",tip:"\u66F4\u65B0\u65F6\u95F4"},{id:"actions",title:"\u64CD\u4F5C",type:"action"}],toolbar:[{type:"button",key:"upload",label:"\u4E0A\u4F20\u6570\u636E\u6587\u4EF6",btnType:"primary",disabled:m&&m(Z.ADD,r==null?void 0:r.permission),icon:u(Ge,{size:12})},{type:"fuzzy_search",key:"search",label:"\u641C\u7D22",searchKeys:["name","description",["name"]],position:"right"},{type:"button",key:"auth",label:"\u914D\u7F6E",btnType:"default",position:"right"}]}],subTableConfig:{type:"table",allowMultiSelect:!1,viewBehavior:"pagination",viewPageSize:5,columns:[{title:"\u8FFD\u52A0\u6587\u4EF6\u540D",id:"name",type:"text",tip:"\u8FFD\u52A0\u6587\u4EF6\u540D"},{title:"\u6570\u636E\u91CF",id:"count",type:"text",tip:"\u6570\u636E\u91CF"},{id:"status",title:"\u5BFC\u5165\u72B6\u6001",type:"customized",tip:"\u5BFC\u5165\u72B6\u6001",component:u(ye,{})},{title:"\u521B\u5EFA\u65F6\u95F4",id:"createdAt",type:"date",tip:"\u521B\u5EFA\u65F6\u95F4"},{title:"\u66F4\u6539\u65F6\u95F4",id:"updatedAt",type:"date",tip:"\u66F4\u6539\u65F6\u95F4"},{title:"\u64CD\u4F5C",id:"actions",type:"action"}]},subTablePendingIds:s,onSubTableRowAnimationComplete:(p,t)=>{n(j=>({...j,[p]:(j[p]||[]).filter(A=>A!==t)}))}}),[s,v,d,r]),z=p=>{E(!1),G(!1),H(void 0),p=="refresh"&&(F.current&&(clearTimeout(F.current),F.current=null),ce())};function Q(p){var t,j;if(!Array.isArray(p))return!0;for(const A of p){if(A.data){const N=A.data.find(O=>O.columnId==="status"),w=A.data.find(O=>O.columnId==="description");if(console.log("+++++",N.status==="20"||N.status==="11"||((t=w==null?void 0:w.tableMeta)==null?void 0:t.generateDescriptionStatus)==be.GENERATING),N&&(N.status==="20"||N.status==="11"||((j=w==null?void 0:w.tableMeta)==null?void 0:j.generateDescriptionStatus)==be.GENERATING))return!1}if(Array.isArray(A.children)){for(const N of A.children)if(N.data){const w=N.data.find(O=>O.columnId==="status");if(w&&(w.status==="20"||w.status==="11"))return!1}}}return!0}const ce=async()=>{const p=await Fe();Q(p||[])?F.current&&(clearTimeout(F.current),F.current=null):(F.current&&(clearTimeout(F.current),F.current=null),F.current=setTimeout(()=>{ce()},5e3))};return console.log("-----normalizedStyles",I),_(Ze,{title:r==null?void 0:r.name,description:(r==null?void 0:r.description)||"-",goBack:()=>{var p;(p=e.eventsEmit)==null||p.call(e,"goBack",{})},children:[u(Te,{dataSource:v,ref:y,eventsEmit:$,status:P,styles:{theme:{...fe,colors:{...fe.colors,tableFirstColumnBg:"#ffffff",tableLastColumnBg:"#ffffff",paginationBackground:"#ffffff",subTableBackground:"#F5F5F5",tableHeaderBg:"#F5F5F5"}},mode:"light"},CustomComponents:{EmptyData:()=>u(zt,{dbInfo:r,setDrawerTitle:C,setDrawerVisible:E,getBtnDisabled:m}),...V},...d=="DataTable"?U:M}),u(At,{drawerTitle:L,drawerVisible:B,handleDrawerClose:z,dbId:l,token:o,url:i,uploadUrl:D,role:a,tableInfo:b}),u(It,{drawerTitle:ne,drawerVisible:q,handleDrawerClose:z,tableInfo:b,optimizeDesc:ee,eventsEmit:$})]})};export{Zt as D,yt as P,_e as a,me as g};
|
package/assets/index-Dkwp9YpO.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as c from"react";import{useMemo as rt,useRef as U}from"react";import{g as it,m as Nt,j as at,r as lt,K as T,k as j,l as K,n as ct,f as w,o as dt,p as xt}from"./index-BbHMAb8g.js";const Ot=new T("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),wt=new T("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),jt=new T("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),Et=new T("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),Pt=new T("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),It=new T("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),Tt=t=>{const{componentCls:e,iconCls:i,antCls:n,badgeShadowSize:o,textFontSize:d,textFontSizeSM:a,statusSize:$,dotSize:v,textFontWeight:C,indicatorHeight:l,indicatorHeightSM:r,marginXS:m,calc:g}=t,u=`${n}-scroll-number`,h=at(t,(f,{darkColor:y})=>({[`&${e} ${e}-color-${f}`]:{background:y,[`&:not(${e}-count)`]:{color:y},"a:hover &":{background:y}}}));return{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},lt(t)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,[`${e}-count`]:{display:"inline-flex",justifyContent:"center",zIndex:t.indicatorZIndex,minWidth:l,height:l,color:t.badgeTextColor,fontWeight:C,fontSize:d,lineHeight:j(l),whiteSpace:"nowrap",textAlign:"center",background:t.badgeColor,borderRadius:g(l).div(2).equal(),boxShadow:`0 0 0 ${j(o)} ${t.badgeShadowColor}`,transition:`background ${t.motionDurationMid}`,a:{color:t.badgeTextColor},"a:hover":{color:t.badgeTextColor},"a:hover &":{background:t.badgeColorHover}},[`${e}-count-sm`]:{minWidth:r,height:r,fontSize:a,lineHeight:j(r),borderRadius:g(r).div(2).equal()},[`${e}-multiple-words`]:{padding:`0 ${j(t.paddingXS)}`,bdi:{unicodeBidi:"plaintext"}},[`${e}-dot`]:{zIndex:t.indicatorZIndex,width:v,minWidth:v,height:v,background:t.badgeColor,borderRadius:"100%",boxShadow:`0 0 0 ${j(o)} ${t.badgeShadowColor}`},[`${e}-count, ${e}-dot, ${u}-custom-component`]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",[`&${i}-spin`]:{animationName:It,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&${e}-status`]:{lineHeight:"inherit",verticalAlign:"baseline",[`${e}-status-dot`]:{position:"relative",top:-1,display:"inline-block",width:$,height:$,verticalAlign:"middle",borderRadius:"50%"},[`${e}-status-success`]:{backgroundColor:t.colorSuccess},[`${e}-status-processing`]:{overflow:"visible",color:t.colorInfo,backgroundColor:t.colorInfo,borderColor:"currentcolor","&::after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderWidth:o,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:Ot,animationDuration:t.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},[`${e}-status-default`]:{backgroundColor:t.colorTextPlaceholder},[`${e}-status-error`]:{backgroundColor:t.colorError},[`${e}-status-warning`]:{backgroundColor:t.colorWarning},[`${e}-status-text`]:{marginInlineStart:m,color:t.colorText,fontSize:t.fontSize}}}),h),{[`${e}-zoom-appear, ${e}-zoom-enter`]:{animationName:wt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack,animationFillMode:"both"},[`${e}-zoom-leave`]:{animationName:jt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack,animationFillMode:"both"},[`&${e}-not-a-wrapper`]:{[`${e}-zoom-appear, ${e}-zoom-enter`]:{animationName:Et,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack},[`${e}-zoom-leave`]:{animationName:Pt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack},[`&:not(${e}-status)`]:{verticalAlign:"middle"},[`${u}-custom-component, ${e}-count`]:{transform:"none"},[`${u}-custom-component, ${u}`]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},[u]:{overflow:"hidden",transition:`all ${t.motionDurationMid} ${t.motionEaseOutBack}`,[`${u}-only`]:{position:"relative",display:"inline-block",height:l,transition:`all ${t.motionDurationSlow} ${t.motionEaseOutBack}`,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",[`> p${u}-only-unit`]:{height:l,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},[`${u}-symbol`]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",[`${e}-count, ${e}-dot, ${u}-custom-component`]:{transform:"translate(-50%, -50%)"}}})}},ut=t=>{const{fontHeight:e,lineWidth:i,marginXS:n,colorBorderBg:o}=t,d=e,a=i,$=t.colorTextLightSolid,v=t.colorError,C=t.colorErrorHover;return Nt(t,{badgeFontHeight:d,badgeShadowSize:a,badgeTextColor:$,badgeColor:v,badgeColorHover:C,badgeShadowColor:o,badgeProcessingDuration:"1.2s",badgeRibbonOffset:n,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},mt=t=>{const{fontSize:e,lineHeight:i,fontSizeSM:n,lineWidth:o}=t;return{indicatorZIndex:"auto",indicatorHeight:Math.round(e*i)-2*o,indicatorHeightSM:e,dotSize:n/2,textFontSize:n,textFontSizeSM:n,textFontWeight:"normal",statusSize:n/2}},zt=it("Badge",t=>{const e=ut(t);return Tt(e)},mt),Bt=t=>{const{antCls:e,badgeFontHeight:i,marginXS:n,badgeRibbonOffset:o,calc:d}=t,a=`${e}-ribbon`,$=`${e}-ribbon-wrapper`,v=at(t,(C,{darkColor:l})=>({[`&${a}-color-${C}`]:{background:l,color:l}}));return{[$]:{position:"relative"},[a]:Object.assign(Object.assign(Object.assign(Object.assign({},lt(t)),{position:"absolute",top:n,padding:`0 ${j(t.paddingXS)}`,color:t.colorPrimary,lineHeight:j(i),whiteSpace:"nowrap",backgroundColor:t.colorPrimary,borderRadius:t.borderRadiusSM,[`${a}-text`]:{color:t.badgeTextColor},[`${a}-corner`]:{position:"absolute",top:"100%",width:o,height:o,color:"currentcolor",border:`${j(d(o).div(2).equal())} solid`,transform:t.badgeRibbonCornerTransform,transformOrigin:"top",filter:t.badgeRibbonCornerFilter}}),v),{[`&${a}-placement-end`]:{insetInlineEnd:d(o).mul(-1).equal(),borderEndEndRadius:0,[`${a}-corner`]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},[`&${a}-placement-start`]:{insetInlineStart:d(o).mul(-1).equal(),borderEndStartRadius:0,[`${a}-corner`]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}},Rt=it(["Badge","Ribbon"],t=>{const e=ut(t);return Bt(e)},mt),Dt=t=>{const{className:e,prefixCls:i,style:n,color:o,children:d,text:a,placement:$="end",rootClassName:v}=t,{getPrefixCls:C,direction:l}=c.useContext(K),r=C("ribbon",i),m=`${r}-wrapper`,[g,u,h]=Rt(r,m),f=ct(o,!1),y=w(r,`${r}-placement-${$}`,{[`${r}-rtl`]:l==="rtl",[`${r}-color-${o}`]:f},e),b={},N={};return o&&!f&&(b.background=o,N.color=o),g(c.createElement("div",{className:w(m,v,u,h)},d,c.createElement("div",{className:w(y,u),style:Object.assign(Object.assign({},b),n)},c.createElement("span",{className:`${r}-text`},a),c.createElement("div",{className:`${r}-corner`,style:N}))))},st=t=>{const{prefixCls:e,value:i,current:n,offset:o=0}=t;let d;return o&&(d={position:"absolute",top:`${o}00%`,left:0}),c.createElement("span",{style:d,className:w(`${e}-only-unit`,{current:n})},i)};function Wt(t,e,i){let n=t,o=0;for(;(n+10)%10!==e;)n+=i,o+=i;return o}const Ft=t=>{const{prefixCls:e,count:i,value:n}=t,o=Number(n),d=Math.abs(i),[a,$]=c.useState(o),[v,C]=c.useState(d),l=()=>{$(o),C(d)};c.useEffect(()=>{const g=setTimeout(l,1e3);return()=>clearTimeout(g)},[o]);let r,m;if(a===o||Number.isNaN(o)||Number.isNaN(a))r=[c.createElement(st,Object.assign({},t,{key:o,current:!0}))],m={transition:"none"};else{r=[];const g=o+10,u=[];for(let b=o;b<=g;b+=1)u.push(b);const h=v<d?1:-1,f=u.findIndex(b=>b%10===a);r=(h<0?u.slice(0,f+1):u.slice(f)).map((b,N)=>{const H=b%10;return c.createElement(st,Object.assign({},t,{key:b,value:H,offset:h<0?N-f:N,current:N===f}))}),m={transform:`translateY(${-Wt(a,o,h)}00%)`}}return c.createElement("span",{className:`${e}-only`,style:m,onTransitionEnd:l},r)};var Ht=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(i[n[o]]=t[n[o]]);return i};const Mt=c.forwardRef((t,e)=>{const{prefixCls:i,count:n,className:o,motionClassName:d,style:a,title:$,show:v,component:C="sup",children:l}=t,r=Ht(t,["prefixCls","count","className","motionClassName","style","title","show","component","children"]),{getPrefixCls:m}=c.useContext(K),g=m("scroll-number",i),u=Object.assign(Object.assign({},r),{"data-show":v,style:a,className:w(g,o,d),title:$});let h=n;if(n&&Number(n)%1===0){const f=String(n).split("");h=c.createElement("bdi",null,f.map((y,b)=>c.createElement(Ft,{prefixCls:g,count:Number(n),value:y,key:f.length-b})))}return a!=null&&a.borderColor&&(u.style=Object.assign(Object.assign({},a),{boxShadow:`0 0 0 1px ${a.borderColor} inset`})),l?dt(l,f=>({className:w(`${g}-custom-component`,f==null?void 0:f.className,d)})):c.createElement(C,Object.assign({},u,{ref:e}),h)});var Zt=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(i[n[o]]=t[n[o]]);return i};const _t=c.forwardRef((t,e)=>{var i,n,o,d,a;const{prefixCls:$,scrollNumberPrefixCls:v,children:C,status:l,text:r,color:m,count:g=null,overflowCount:u=99,dot:h=!1,size:f="default",title:y,offset:b,style:N,className:H,rootClassName:bt,classNames:O,styles:S,showZero:R=!1}=t,Y=Zt(t,["prefixCls","scrollNumberPrefixCls","children","status","text","color","count","overflowCount","dot","size","title","offset","style","className","rootClassName","classNames","styles","showZero"]),{getPrefixCls:G,direction:M,badge:s}=c.useContext(K),p=G("badge",$),[J,gt,ft]=zt(p),Z=g>u?`${u}+`:g,z=Z==="0"||Z===0||r==="0"||r===0,Q=g===null||z&&!R,_=(l!=null||m!=null)&&Q,pt=l!=null||!z,B=h&&!z,E=B?"":Z,P=rt(()=>((E==null||E==="")&&(r==null||r==="")||z&&!R)&&!B,[E,z,R,B,r]),k=U(g);P||(k.current=g);const I=k.current,tt=U(E);P||(tt.current=E);const V=tt.current,et=U(B);P||(et.current=B);const D=rt(()=>{if(!b)return Object.assign(Object.assign({},s==null?void 0:s.style),N);const x={marginTop:b[1]};return M==="rtl"?x.left=Number.parseInt(b[0],10):x.right=-Number.parseInt(b[0],10),Object.assign(Object.assign(Object.assign({},x),s==null?void 0:s.style),N)},[M,b,N,s==null?void 0:s.style]),vt=y??(typeof I=="string"||typeof I=="number"?I:void 0),ot=!P&&(r===0?R:!!r&&r!==!0),Ct=ot?c.createElement("span",{className:`${p}-status-text`},r):null,$t=!I||typeof I!="object"?void 0:dt(I,x=>({style:Object.assign(Object.assign({},D),x.style)})),W=ct(m,!1),ht=w(O==null?void 0:O.indicator,(i=s==null?void 0:s.classNames)===null||i===void 0?void 0:i.indicator,{[`${p}-status-dot`]:_,[`${p}-status-${l}`]:!!l,[`${p}-color-${m}`]:W}),A={};m&&!W&&(A.color=m,A.background=m);const nt=w(p,{[`${p}-status`]:_,[`${p}-not-a-wrapper`]:!C,[`${p}-rtl`]:M==="rtl"},H,bt,s==null?void 0:s.className,(n=s==null?void 0:s.classNames)===null||n===void 0?void 0:n.root,O==null?void 0:O.root,gt,ft);if(!C&&_&&(r||pt||!Q)){const x=D.color;return J(c.createElement("span",Object.assign({},Y,{className:nt,style:Object.assign(Object.assign(Object.assign({},S==null?void 0:S.root),(o=s==null?void 0:s.styles)===null||o===void 0?void 0:o.root),D)}),c.createElement("span",{className:ht,style:Object.assign(Object.assign(Object.assign({},S==null?void 0:S.indicator),(d=s==null?void 0:s.styles)===null||d===void 0?void 0:d.indicator),A)}),ot&&c.createElement("span",{style:{color:x},className:`${p}-status-text`},r)))}return J(c.createElement("span",Object.assign({ref:e},Y,{className:nt,style:Object.assign(Object.assign({},(a=s==null?void 0:s.styles)===null||a===void 0?void 0:a.root),S==null?void 0:S.root)}),C,c.createElement(xt,{visible:!P,motionName:`${p}-zoom`,motionAppear:!1,motionDeadline:1e3},({className:x})=>{var L,q;const yt=G("scroll-number",v),X=et.current,St=w(O==null?void 0:O.indicator,(L=s==null?void 0:s.classNames)===null||L===void 0?void 0:L.indicator,{[`${p}-dot`]:X,[`${p}-count`]:!X,[`${p}-count-sm`]:f==="small",[`${p}-multiple-words`]:!X&&V&&V.toString().length>1,[`${p}-status-${l}`]:!!l,[`${p}-color-${m}`]:W});let F=Object.assign(Object.assign(Object.assign({},S==null?void 0:S.indicator),(q=s==null?void 0:s.styles)===null||q===void 0?void 0:q.indicator),D);return m&&!W&&(F=F||{},F.background=m),c.createElement(Mt,{prefixCls:yt,show:!P,motionClassName:x,className:St,count:V,title:vt,style:F,key:"scrollNumber"},$t)}),Ct))}),Vt=_t;Vt.Ribbon=Dt;export{Vt as B};
|