@gientech/modual 1.8.9 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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-BO-w4FPz.js +1088 -0
- 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-JwQuPQqQ.js +157 -0
- 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/style.css +1 -1
- package/assets/{x-BjRa5XLp.js → x-CnaaLGJF.js} +1 -1
- package/assistantConfig.js +1 -1
- package/chat.js +78 -78
- 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-BnMJn-0g.js +0 -449
- package/assets/index-3eb9O5m7.js +0 -1393
- package/assets/index-CCjG4bD0.js +0 -157
- package/assets/index-DKBFsnpa.js +0 -11
- package/assets/index-Dkwp9YpO.js +0 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{jsx as a,jsxs as O,Fragment as he}from"react/jsx-runtime";import*as j from"react";import{isValidElement as $e,useMemo as ie,useState as h,useRef as Ce,useCallback as ue,useEffect as xe}from"react";import{u as Ve}from"./index-CpW6Dhpp.js";import{F as Pe,J as K,C as Re,T as je,U as We,m as Ue}from"./index-x8IlxRuv.js";import{a as He,g as Ge,m as Ze,$ as qe,a0 as Ye,r as Ke,a1 as Xe,a2 as Je,a3 as Qe,l as et,f as le,a4 as tt,u as ut,a5 as at,T as ce,Z as st,o as ot,M as nt,b as rt,a6 as it,i as be}from"./index-g-SUxfJH.js";import{O as we}from"./index-DwoTKC3G.js";/* empty css */import{s as Y,M as ye}from"./style-CGmZ5osp.js";import{U as ke}from"./index-BO-w4FPz.js";import{D as Ie}from"./index-D72cKELw.js";import{X as ge}from"./x-CnaaLGJF.js";import"react-dom";import{B as De,T as Te}from"./index-DdVFXD_y.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 lt=He("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),de=e=>e?typeof e=="function"?e():e:null,ct=e=>{const{componentCls:r,popoverColor:o,titleMinWidth:s,fontWeightStrong:i,innerPadding:p,boxShadowSecondary:S,colorTextHeading:m,borderRadiusLG:_,zIndexPopup:B,titleMarginBottom:b,colorBgElevated:E,popoverBg:F,titleBorderBottom:L,innerContentPadding:$,titlePadding:x}=e;return[{[r]:Object.assign(Object.assign({},Ke(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:B,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":E,width:"max-content",maxWidth:"100vw","&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${r}-content`]:{position:"relative"},[`${r}-inner`]:{backgroundColor:F,backgroundClip:"padding-box",borderRadius:_,boxShadow:S,padding:p},[`${r}-title`]:{minWidth:s,marginBottom:b,color:m,fontWeight:i,borderBottom:L,padding:x},[`${r}-inner-content`]:{color:o,padding:$}})},Ye(e,"var(--antd-arrow-background-color)"),{[`${r}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",[`${r}-content`]:{display:"inline-block"}}}]},dt=e=>{const{componentCls:r}=e;return{[r]:Xe.map(o=>{const s=e[`${o}6`];return{[`&${r}-${o}`]:{"--antd-arrow-background-color":s,[`${r}-inner`]:{backgroundColor:s},[`${r}-arrow`]:{background:"transparent"}}}})}},pt=e=>{const{lineWidth:r,controlHeight:o,fontHeight:s,padding:i,wireframe:p,zIndexPopupBase:S,borderRadiusLG:m,marginXS:_,lineType:B,colorSplit:b,paddingSM:E}=e,F=o-s,L=F/2,$=F/2-r,x=i;return Object.assign(Object.assign(Object.assign({titleMinWidth:177,zIndexPopup:S+30},Je(e)),Qe({contentRadius:m,limitVerticalRadius:!0})),{innerPadding:p?0:12,titleMarginBottom:p?0:_,titlePadding:p?`${L}px ${x}px ${$}px`:0,titleBorderBottom:p?`${r}px ${B} ${b}`:"none",innerContentPadding:p?`${E}px ${x}px`:0})},Se=Ge("Popover",e=>{const{colorBgElevated:r,colorText:o}=e,s=Ze(e,{popoverBg:r,popoverColor:o});return[ct(s),dt(s),qe(s,"zoom-big")]},pt,{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]});var mt=function(e,r){var o={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&r.indexOf(s)<0&&(o[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(e);i<s.length;i++)r.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(o[s[i]]=e[s[i]]);return o};const Me=({title:e,content:r,prefixCls:o})=>!e&&!r?null:j.createElement(j.Fragment,null,e&&j.createElement("div",{className:`${o}-title`},e),r&&j.createElement("div",{className:`${o}-inner-content`},r)),Ft=e=>{const{hashId:r,prefixCls:o,className:s,style:i,placement:p="top",title:S,content:m,children:_}=e,B=de(S),b=de(m),E=le(r,o,`${o}-pure`,`${o}-placement-${p}`,s);return j.createElement("div",{className:E,style:i},j.createElement("div",{className:`${o}-arrow`}),j.createElement(tt,Object.assign({},e,{className:r,prefixCls:o}),_||j.createElement(Me,{prefixCls:o,title:B,content:b})))},ft=e=>{const{prefixCls:r,className:o}=e,s=mt(e,["prefixCls","className"]),{getPrefixCls:i}=j.useContext(et),p=i("popover",r),[S,m,_]=Se(p);return S(j.createElement(Ft,Object.assign({},s,{prefixCls:p,hashId:m,className:le(o,_)})))};var Ct=function(e,r){var o={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&r.indexOf(s)<0&&(o[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(e);i<s.length;i++)r.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(o[s[i]]=e[s[i]]);return o};const gt=j.forwardRef((e,r)=>{var o,s;const{prefixCls:i,title:p,content:S,overlayClassName:m,placement:_="top",trigger:B="hover",children:b,mouseEnterDelay:E=.1,mouseLeaveDelay:F=.1,onOpenChange:L,overlayStyle:$={},styles:x,classNames:M}=e,t=Ct(e,["prefixCls","title","content","overlayClassName","placement","trigger","children","mouseEnterDelay","mouseLeaveDelay","onOpenChange","overlayStyle","styles","classNames"]),{getPrefixCls:n,className:c,style:l,classNames:A,styles:D}=ut("popover"),y=n("popover",i),[C,W,G]=Se(y),Z=n(),q=le(m,W,G,c,A.root,M==null?void 0:M.root),se=le(A.body,M==null?void 0:M.body),[oe,ne]=at(!1,{value:(o=e.open)!==null&&o!==void 0?o:e.visible,defaultValue:(s=e.defaultOpen)!==null&&s!==void 0?s:e.defaultVisible}),X=(P,J)=>{ne(P,!0),L==null||L(P,J)},re=P=>{P.keyCode===nt.ESC&&X(!1,P)},ae=P=>{X(P)},Q=de(p),ee=de(S);return C(j.createElement(ce,Object.assign({placement:_,trigger:B,mouseEnterDelay:E,mouseLeaveDelay:F},t,{prefixCls:y,classNames:{root:q,body:se},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},D.root),l),$),x==null?void 0:x.root),body:Object.assign(Object.assign({},D.body),x==null?void 0:x.body)},ref:r,open:oe,onOpenChange:ae,overlay:Q||ee?j.createElement(Me,{prefixCls:y,title:Q,content:ee}):null,transitionName:st(Z,"zoom-big",t.transitionName),"data-popover-inject":!0}),ot(b,{onKeyDown:P=>{var J,te;$e(b)&&((te=b==null?void 0:(J=b.props).onKeyDown)===null||te===void 0||te.call(J,P)),re(P)}})))}),Ne=gt;Ne._InternalPanelDoNotUseOrYouWillBeFired=ft;const Et="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",yt="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",ze=({url:e,token:r,role:o,eventsEmit:s})=>{const i=rt.create({baseURL:e,timeout:1e6});return i.interceptors.request.use(t=>{let n=r;return!n&&!["user/login","user/kaptcha","user/regist"].some(l=>t.url.includes(l))?(s&&s("request:error_auth",{errorMsg:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F",redirect:"/login"}),Promise.reject(new Error("\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"))):(t.headers.Authorization=n||"",t.headers.userName=o==="\u672A\u767B\u5F55\u7528\u6237"?"":o,t)}),i.interceptors.response.use(t=>{const n=["user/kaptcha"],c=t.data;if(n.some(y=>t.config.url&&t.config.url.includes(y))||c.size&&c.type)return c;const{success:l,errorMsg:A,errorCode:D}=c;if(l)return c;s&&s("request:error_business",{errorCode:D,errorMsg:A||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",response:c})},t=>{var n,c,l,A,D,y,C,W,G;if(t.message==="canceled")return Promise.reject(t);if(s){let Z="request:error_network",q={errorMsg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:t};((n=t==null?void 0:t.response)==null?void 0:n.status)===401?(Z="request:error_auth",q={errorMsg:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",error:t,redirect:"/login"}):(((l=(c=t==null?void 0:t.response)==null?void 0:c.data)==null?void 0:l.errorCode)==="30013"||((D=(A=t==null?void 0:t.response)==null?void 0:A.data)==null?void 0:D.errorCode)==="30023")&&(Z="request:error_business",q={errorCode:(C=(y=t==null?void 0:t.response)==null?void 0:y.data)==null?void 0:C.errorCode,errorMsg:((G=(W=t==null?void 0:t.response)==null?void 0:W.data)==null?void 0:G.errorMsg)||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",error:t}),s(Z,q)}return Promise.reject(t)}),{getTableList:async t=>{try{const n=await i.get(`/directDB/queryTableList/${t}`),{success:c,data:l}=n;if(c)return l}catch(n){console.log("getTableList error:",n)}},getTableTreeList:async t=>{try{const n=await i.get(`/dataTable/queryTableFileTreeList/${t}`),{success:c,data:l}=n;if(c)return l}catch(n){console.log("getTableTreeList error:",n)}},getDBDetailById:async(t,n)=>{const c=Be(n);try{const l=await i.get(`/${c}/queryDBInfo/${t}`),{success:A,data:D}=l;if(A)return D}catch(l){console.log("getDBDetailById error:",l)}},delTableById:async(t,n)=>{const c=Be(n);try{const l=await i.delete(`/${c}/deleteTable/${t}`),{success:A,data:D}=l;if(A)return D}catch(l){console.log("delTableById error:",l)}},delFileById:async t=>{try{const n=await i.delete(`/dataTable/deleteTableFileData/${t}`),{success:c,data:l}=n;if(c)return l}catch(n){console.log("delFileById",n)}},parseFiles:async({fileIds:t,isGenDescription:n,tableDescriptionMap:c})=>{try{const l=await i.post("/dataTable/parseFiles",{fileIds:t,isGenDescription:n,tableDescriptionMap:c}),{success:A,data:D}=l;if(A)return D}catch(l){console.log("parseFiles error:",l)}},reParseFile:async t=>{try{const n=await i.post(`/dataTable/reParseFile/${t}`),{success:c,data:l}=n;if(c)return l}catch(n){console.log("reParseFile error:",n)}},parseAppendFile:async({fileIds:t,tableId:n})=>{try{const c=await i.post("/dataTable/parseAppendFiles",{fileIds:t,tableId:n}),{success:l,data:A}=c;if(l)return A}catch(c){console.log("parseAppendFile error:",c)}},deleteUploadedFiles:async t=>{try{const n=await i.post("/dataTable/cancelUploadFile",{fileIds:t}),{success:c,data:l}=n;if(c)return l}catch(n){console.log("deleteUploadedFiles error:",n)}},getTableInfoById:async t=>{try{const n=await i.get(`/dataTable/queryTableMeta/${t}`),{success:c,data:l}=n;if(c)return l}catch(n){console.log("getTableInfoById error:",n)}},updateTableInfo:async({tableId:t,description:n,businessName:c})=>{try{const l=await i.post("/dataTable/updateTableInfo",{tableId:t,businessName:c,description:n}),{success:A,data:D}=l;if(A)return D}catch(l){console.log("updateTableInfo error:",l)}},optimizeDesc:async t=>{try{const n=await i.get(`/genTableDescription/${t}`),{success:c,data:l}=n;if(c)return l}catch(n){console.log("optimizeDesc error:",n)}}}},Be=e=>e=="DataTable"?"dataTable":"directDB",me='<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',ht={colors:{background:"#ffffff",border:"#e5e7eb",appBackground:"#ffffff",listBackground:"#ffffff",dashboardBackground:"#ffffff"},space:{padding:"0",margin:"md",shadow:"none"}},bt=({drawerTitle:e,drawerVisible:r,uploadUrl:o,handleDrawerClose:s,dbId:i,tableInfo:p,token:S,url:m,role:_})=>{const B=ie(()=>({id:"upload",layout:"vertical",formWidth:"670px",fields:[{id:"fileIds",name:"fileIds",type:"uploader",required:!1,defaultValue:"",uploaderConfig:{multiple:!p,accept:".csv,.xlsx,.xls",maxFiles:p?1:20,url:o,autoUpload:!0,headers:{Authorization:S},queryParams:{databaseId:i,...p&&{tableId:p.tableId}},placeholder:O("div",{children:[a("div",{className:"text-lg font-bold",children:"\u70B9\u51FB\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u5904\u4E0A\u4F20"}),O("div",{className:"flex flex-col gap-1.8 mt-[12px]",children:[a("div",{className:"text-[#888888] font-[12px]",children:"\u6570\u91CF\uFF1A\u226420 \u6587\u4EF6\uFF08\u5F53\u524D 0/20\uFF09"}),a("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"}),a("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"}),a("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:p?"\u8FFD\u52A0\u6587\u4EF6":"\u4E0A\u4F20\u6587\u4EF6\u5217\u8868",icons:{dragUpload:a("img",{src:yt,width:40}),itemStatus:{pending:a("span",{style:{fontSize:"12px",color:"#6b7280"}}),uploading:a("span",{style:{fontSize:"12px",color:"#007bff"}}),success:a("span",{style:{fontSize:"12px",color:"#10b981"}}),error:a("span",{style:{fontSize:"12px",color:"#ef4444"},children:"\u5931\u8D25"})},fileType:{default:a(Pe,{size:20,style:{color:"#6b7280"}})}},...!p&&{buttons:[{label:"\u4F7F\u7528\u6A21\u7248",icon:a("img",{src:Et}),mode:"text",onClick:()=>{l(!0)}}]},...!p&&{itemForm:[{type:"textarea",name:"description",counter:150,placeholder:"\u4E3A\u4E86\u63D0\u9AD8\u95EE\u7B54\u51C6\u786E\u7387\uFF0C\u8BF7\u8F93\u5165\u63CF\u8FF0"}]}}}]}),[p]),[b,E]=h(!1),[F,L]=h({}),$=Ce(null),[x,M]=h(!1),[t,n]=h([]),[c,l]=h(!1),[A,D]=h(me),[y,C]=h(null),[W,G]=h(me),[Z,q]=h(0),{parseFiles:se,parseAppendFile:oe,deleteUploadedFiles:ne}=ze({url:m,token:S,role:_}),X=ue(async(g,f,V)=>{var w;switch(console.log("[DynamicFormAdopter] \u4E8B\u4EF6:",g,f),g){case"form:ready":f.formRef?$.current=f.formRef:console.log("\u274C data.formRef \u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u4FDD\u5B58\u8868\u5355\u5F15\u7528");break;case"form:submit":ae();break;case"form_field_change":L(k=>({...k,[f.fieldId]:f.value}));break;case"uploader:error":(w=f.item)!=null&&w.id?n(k=>[{id:f.item.id,status:f.item.status},...k]):Y.error(f==null?void 0:f.message);break;case"uploader:success":n(k=>[{id:f.item.id,status:f.item.status},...k]);break;case"uploader:remove":const U=f.item.status;n(k=>k.filter(d=>d.id!==f.item.id)),U=="success"&&await ee([f.item.uploadApiRes]);break;default:console.log("\u672A\u5904\u7406\u7684\u4E8B\u4EF6:",g)}},[]),re=ie(()=>({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:B.formWidth,formConfig:{layout:B.layout,showReset:!1,showSubmit:!1,formWidth:B.formWidth,getFormData:()=>({...F,timestamp:new Date().toISOString(),formId:B.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:B.id,fields:B.fields,defaultValues:{}}],eventsEmit:X,styles:{theme:ht}}),[p,B]),ae=async()=>{var g;try{E(!0);const f=await $.current.getAllData();if(f.isValid){const V=(g=f.fields.find(w=>w.name=="fileIds"))==null?void 0:g.value;if(Array.isArray(V)&&(V==null?void 0:V.length)>0){let w;if(p)w=await oe({fileIds:V.map(U=>U.uploadApiRes),tableId:p.id});else{const U={fileIds:V.map(k=>k.uploadApiRes),tableDescriptionMap:V.reduce((k,d)=>(k[d.uploadApiRes]=d.formData.description,k),{}),isGenDescription:x};w=await se(U)}w&&s("refresh")}}}catch(f){console.error("\u8868\u5355\u6570\u636E\u5931\u8D25:",f)}finally{s(),E(!1),M(!1)}},Q=async g=>{var f;try{const V=await $.current.getAllData();if(V.isValid){const w=(f=V.fields.find(U=>U.name=="fileIds"))==null?void 0:f.value;if(w&&Array.isArray(w)&&(w==null?void 0:w.length)>0){const U=w.map(d=>d.uploadApiRes),k=await ee(U)}}}catch(V){console.error("\u8868\u5355\u6570\u636E\u5931\u8D25:",V)}finally{s(),M(!1)}},ee=async g=>{try{const f=await ne(g);if(f)return f}catch(f){console.error("\u5220\u9664\u6587\u4EF6\u6570\u636E\u5931\u8D25:",f)}},P=g=>{M(g)},J=ue(g=>{D(g),console.log("\u6A21\u7248\u5185\u5BB9\u53D8\u5316:",g)},[]),te=ue(g=>{C(()=>g),console.log("getData\u51FD\u6570\u5DF2\u8BBE\u7F6E")},[]),pe=ue(async()=>{try{if(!y){console.error("getData\u51FD\u6570\u5C1A\u672A\u51C6\u5907\u597D\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}const g=y("pure_string");await navigator.clipboard.writeText(g),Y.success("\u5DF2\u590D\u5236",1)}catch(g){console.error("\u590D\u5236\u5931\u8D25:",g)}finally{l(!1)}},[y]);return O(Ie,{title:e,className:"database-upload-drawer",placement:"right",width:720,closeIcon:!1,extra:a(ge,{size:20,color:"#888888",onClick:()=>Q(),className:"cursor-pointer"}),open:r,destroyOnHidden:!0,footer:O("div",{className:"flex items-center",style:{justifyContent:p?"end":"space-between"},children:[!p&&O("div",{className:"flex gap-2 items-center",children:[a("span",{children:"\u81EA\u52A8\u751F\u6210\u6570\u636E\u8868\u63CF\u8FF0"})," ",a(ce,{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:a(Re,{size:14})}),a(it,{onChange:P})]}),O("div",{className:"flex self-end gap-3",children:[a(K,{mode:"default",style:{marginRight:10},label:"\u53D6\u6D88",onClick:Q}),a(K,{mode:"primary",label:"\u786E\u8BA4\u5BFC\u5165",loading:b,disabled:t.some(g=>g.status=="error"),onClick:async()=>{await ae()}})]})]}),children:[a(we,{...re},"upload-file"),a(ye,{title:O("div",{children:["\u6A21\u7248",a("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:c,onCancel:()=>l(!1),footer:O("div",{className:"flex justify-end items-center gap-3",children:[a(K,{mode:"default",label:"\u91CD\u7F6E",onClick:()=>{G(me),q(g=>g+1)}}),a(K,{mode:"primary",label:"\u590D\u5236",onClick:pe})]}),children:a(ke,{data:W,onChange:J,onGetData:te,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"}}},Z)})]})},Dt="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",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%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:At}=ye,vt='<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',xt=({drawerTitle:e,drawerVisible:r,tableInfo:o,handleDrawerClose:s,optimizeDesc:i,eventsEmit:p})=>{const S=ie(()=>(o==null?void 0:o.data.find(C=>C.columnId=="name").value)||"-",[o]),[m,_]=h(""),[B,b]=h(null),[E,F]=h(""),[L,$]=h(0),[x,M]=h(!1),[t,n]=h(!1);xe(()=>{const C=(o==null?void 0:o.data.find(W=>W.columnId=="description").value)||"-";F(C)},[o]);const c=()=>{At({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(){F(vt),$(C=>C+1)},onCancel(){console.log("Cancel")}})},l=ue(C=>{_(C),console.log("\u6A21\u7248\u5185\u5BB9\u53D8\u5316:",C)},[]),A=ue(C=>{b(()=>C),console.log("getData\u51FD\u6570\u5DF2\u8BBE\u7F6E")},[]),D=async()=>{try{M(!0);const C=await i(o.tableId);C&&(F(C),$(W=>W+1),M(!1))}catch{Y.error("AI \u4F18\u5316\u5931\u8D25")}},y=ue(()=>{if(!B){console.error("getData\u51FD\u6570\u5C1A\u672A\u51C6\u5907\u597D\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}const C=B("pure_string");p("table_info:update",C)},[B,p]);return O(Ie,{title:e,placement:"right",width:720,onClose:s,closeIcon:!1,extra:a(ge,{size:20,color:"#888888",onClick:s,className:"cursor-pointer"}),open:r,destroyOnHidden:!0,footer:a("div",{className:"flex items-center",style:{justifyContent:"end"},children:O("div",{className:"flex self-end gap-3",children:[a(K,{mode:"default",style:{marginRight:10},label:"\u53D6\u6D88",onClick:s}),a(K,{mode:"primary",label:"\u786E\u8BA4",onClick:()=>y(),disabled:x})]})}),children:[a("div",{className:"mb-[10px] font-bold",children:S}),O("div",{className:"mb-[10px]",children:[a("span",{style:{color:"#FF3B30",marginRight:"4px"},children:"*"}),a("span",{children:"\u6570\u636E\u8868\u63CF\u8FF0"}),a("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)"})]}),a(ke,{data:E,onChange:l,onGetData:A,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"}}},L),O("div",{children:[a(Ne,{open:t,onOpenChange:C=>n(!!C),content:a("div",{style:{width:"600px",margin:"10px",padding:"10px"},onClick:c,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:O("div",{className:"flex justify-between items-center",style:{margin:"10px"},children:[a("div",{className:"text-[16px]",children:"\u6A21\u7248"}),a(ge,{size:20,color:"#888888",onClick:()=>n(!1),className:"cursor-pointer"})]}),trigger:"click",destroyOnHidden:!0,placement:"bottomRight",getPopupContainer:C=>C,children:a("span",{children:a(K,{mode:"text",icon:a("img",{src:Dt}),children:"\u4F7F\u7528\u6A21\u7248"})})}),a(K,{onClick:D,mode:"text",icon:a("img",{src:Bt}),loading:x,children:"AI\u4F18\u5316"})]})]})},wt=""+new URL("empty.png",import.meta.url).href;var H=(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))(H||{}),Ee=(e=>(e.GENERATING="generating",e.SUCCESS="success",e.FAIL="fail",e))(Ee||{});const Fe={success:"green",error:"red",warning:"orange",processing:"blue",info:"cyan",default:"default"},kt=e=>typeof e=="string"&&e in Fe?Fe[e]:Fe.default,fe=e=>{const{value:r,cell:o}=e;switch(o.columnId){case"importstatus":return r?a(ce,{title:"\u6709\u8FFD\u52A0\u5931\u8D25\u7684\u6587\u4EF6\uFF0C\u8BF7\u53CA\u65F6\u5904\u7406",children:a(je,{color:"red",bordered:!1,children:"\u8FFD\u52A0\u5931\u8D25"})}):a(he,{});case"status":const s=kt(e.cell.statusType);return r=="\u5BFC\u5165\u5931\u8D25"?a(ce,{title:o.errorMsg,children:O("div",{className:"flex items-center gap-2",children:[a(De,{color:s,text:r}),a(Te,{size:14,color:"red"})]})}):a(De,{color:s,text:r});default:return a(he,{})}},Ae=[{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"}],It=e=>{var s,i;const{cell:r,value:o}=e;return typeof o=="string"?a("div",{title:o,style:{maxWidth:240,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o}):(s=r.tableMeta)!=null&&s.isGenDescription&&((i=r.tableMeta)==null?void 0:i.generateDescriptionStatus)=="generating"?O("div",{className:"flex items-center gap-1 text-[#84ADFF]",style:{color:"#84ADFF"},children:[a("span",{children:"\u751F\u6210\u4E2D"}),a(lt,{size:14})]}):"-"},Tt=({dbInfo:e,setDrawerTitle:r,setDrawerVisible:o,getBtnDisabled:s})=>O("div",{className:"flex flex-col items-center justify-center h-full",children:[a("div",{className:"text-xl font-semibold mb-3",children:a("img",{src:wt,width:120})}),a("div",{className:"text-base mb-2",style:{color:"#888888"},children:"\u6682\u65E0\u6570\u636E\u6587\u4EF6"}),a("div",{className:"flex gap-3",children:a(K,{mode:"primary",label:"\u4E0A\u4F20\u6570\u636E\u6587\u4EF6",disabled:s&&s(8,e==null?void 0:e.permission),onClick:()=>{r("\u4E0A\u4F20\u6570\u636E\u6587\u4EF6"),o(!0)}})})]}),{confirm:ve}=ye,Ut=e=>{const{url:r,token:o,role:s,id:i,dbType:p,CustomComponents:S,getBtnDisabled:m,uploadUrl:_}=e,[B,b]=h({container:"ready",content:"ready"}),E=Ce(null),F=Ce(null),[L,$]=h(),[x,M]=h({}),[t,n]=h(),[c,l]=h(!1),[A,D]=h(""),[y,C]=h(),[W,G]=h(!1),[Z,q]=h(""),{getTableList:se,delTableById:oe,delFileById:ne,updateTableInfo:X,optimizeDesc:re,getTableTreeList:ae,reParseFile:Q,getDBDetailById:ee}=ze({url:r,token:o,role:s,eventsEmit:e.eventsEmit});xe(()=>(i&&p&&(b(d=>({...d,container:"loading"})),P()),()=>{F.current&&(clearTimeout(F.current),F.current=null)}),[i,p]);const P=async()=>{try{const d=await ee(i,p);d&&(n(d),b(u=>({...u,container:"ready",content:"loading"})))}catch(d){console.log("[TableApiError] getDBInfo:",d)}await k()},J=async()=>{try{if(p=="DirectDB"){const d=await se(i);if(d){const u=pe(d);return $(u||[]),b(R=>({...R,content:"ready"})),u||[]}else b(u=>({...u,content:"error"}))}else{const d=await ae(i);if(d){const u=te(d);return $(u||[]),b(R=>({...R,content:"ready"})),u||[]}else b(u=>({...u,content:"error"}))}}catch(d){console.log("[TableApiError] getTableList:",d)}};function te(d){return(d||[]).map((u,R)=>{var I,z;let v=Ae.find(T=>T.status==u.status);const N=u.children.some(T=>T.status=="00");return{id:u.fileId.toString(),tableId:u.tableId,data:[{columnId:"name",value:(u==null?void 0:u.originalFilename)||"-",type:"label"},{columnId:"description",value:(I=u==null?void 0:u.tableMeta)==null?void 0:I.description,type:"customized",tableMeta:u==null?void 0:u.tableMeta},{columnId:"count",value:`${u.rowCount}\u884C\uFF0C${u.columnCount}\u5217`,type:"text"},{columnId:"status",...v,type:"customized",errorMsg:u.errorMsg},{columnId:"importstatus",value:N,type:"customized"},{columnId:"createdAt",value:u.gmtCreate,type:"date"},{columnId:"updatedAt",value:u.gmtModified,type:"date"},...u.status=="30"?[{columnId:"actions",value:"view",label:"\u67E5\u770B",type:"action",disabled:m&&m(H.VIEW,u.permission)},{columnId:"actions",value:"edit",label:"\u4FEE\u6539\u914D\u7F6E",type:"action",disabled:m&&m(H.EDIT,u.permission)},{columnId:"actions",value:"addData",label:"\u8FFD\u52A0\u6570\u636E",type:"action",disabled:m&&m(H.EDIT,u.permission)}]:[],...u.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(H.DELETE,u.permission)}],expanded:!1,...u.children&&((z=u.children)==null?void 0:z.length)>0&&{children:[...(u.children||[]).map(T=>{const Oe=Ae.find(Le=>Le.status==T.status),_e=[{columnId:"name",value:T.originalFilename,type:"text"},{columnId:"count",value:`${T.rowCount}\u884C\uFF0C${T.columnCount}\u5217`,type:"text"},{columnId:"status",...Oe,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(H.VIEW,T.permission)}]:[],...T.status=="00"?[{columnId:"actions",value:"reValidate",label:"\u91CD\u65B0\u5BFC\u5165",type:"action",disabled:m&&m(H.ADD,T.permission)}]:[],{columnId:"actions",value:"delete_sub",label:"\u5220\u9664",type:"action",disabled:m&&m(H.DELETE,T.permission)}];return{id:T.fileId.toString(),tableId:T.tableId,data:_e}})]}}})}function pe(d){return(d||[]).map((u,R)=>({id:u.id||Ve(8),data:[{columnId:"name",value:u.physicalName},{columnId:"cnname",value:u.businessName},{columnId:"colcount",value:u.columnCount},{columnId:"count",value:`${u.rowCount}\u884C\uFF0C${u.columnCount}\u5217`},{columnId:"actions",value:"view",label:"\u67E5\u770B",disabled:m&&m(H.VIEW,u.permission)}]}))}async function g(d,u,R){switch(console.log("[adopter] mergedEventsEmit",d,u,R),d){case"table_action_delete":{try{if(console.log("[delete] \u5220\u9664\u4E8B\u4EF6\u6570\u636E:",u),!u||!u.tableId&&!u.id){console.error("[delete] \u5220\u9664\u4E8B\u4EF6\u6570\u636E\u4E0D\u5B8C\u6574:",u),Y.error("\u5220\u9664\u5931\u8D25\uFF1A\u6570\u636E\u4E0D\u5B8C\u6574");return}const v=u.tableId||u.id,N=u.id;ve({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:a(Te,{color:"#FF4D4F",className:"mr-[8px]"}),okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",async onOk(){await oe(v,p)&&(E!=null&&E.current)?(E==null||E.current.appFn.removeItem(N),Y.success("\u5220\u9664\u6210\u529F")):Y.error("\u5220\u9664\u5931\u8D25")}})}catch(v){console.error("\u5220\u9664\u8868\u6570\u636E\u5931\u8D25:",v),Y.error("\u5220\u9664\u5931\u8D25")}break}case"table_action_edit":{q("\u4FEE\u6539\u6570\u636E\u914D\u7F6E"),G(!0),C(u);break}case"toolbar_upload":{D("\u4E0A\u4F20\u6570\u636E\u6587\u4EF6"),l(!0);break}case"table_action_addData":{D("\u8FFD\u52A0\u6570\u636E"),l(!0),C(u);break}case"table_action_reValidate":{await Q(u.id)&&(F.current&&(clearTimeout(F.current),F.current=null),await k());break}case"table_info:update":{try{if(y!=null&&y.id){const v=(y==null?void 0:y.data.find(I=>I.columnId=="name").value)||"-";if(await X({tableId:y.tableId,description:u,businessName:v})&&(E!=null&&E.current)){const I={...y,data:y.data.map(z=>z.columnId=="description"?{...z,value:u}:z)};E==null||E.current.appFn.updateItem(I,y.id),Y.success("\u4FEE\u6539\u914D\u7F6E\u6210\u529F")}}}catch(v){console.error("\u4FEE\u6539\u914D\u7F6E\u5931\u8D25",v)}finally{w()}break}case"table_action_delete_sub":{try{ve({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:v,tableId:N}=u;await ne(u.id)&&(E!=null&&E.current)&&(M(z=>({...z,[N]:[...z[N]||[],v]})),u.data.find(z=>z.status=="00")&&(F.current&&(clearTimeout(F.current),F.current=null),k()),R.removeItem(v,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",t);break}default:typeof e.eventsEmit=="function"&&e.eventsEmit(d,u);break}}const f=ie(()=>({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"}]}]}),[L,p]),V=ie(()=>({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:a(It,{}),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:a(fe,{})},{id:"importstatus",title:"\u8FFD\u52A0\u63D0\u793A",type:"customized",component:a(fe,{})},{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(H.ADD,t==null?void 0:t.permission),icon:a(We,{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:a(fe,{})},{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:x,onSubTableRowAnimationComplete:(d,u)=>{M(R=>({...R,[d]:(R[d]||[]).filter(v=>v!==u)}))}}),[x,L,p,t]),w=d=>{l(!1),G(!1),C(void 0),d=="refresh"&&(F.current&&(clearTimeout(F.current),F.current=null),k())};function U(d){var u,R;if(!Array.isArray(d))return!0;for(const v of d){if(v.data){const N=v.data.find(z=>z.columnId==="status"),I=v.data.find(z=>z.columnId==="description");if(console.log("+++++",N.status==="20"||N.status==="11"||((u=I==null?void 0:I.tableMeta)==null?void 0:u.generateDescriptionStatus)==Ee.GENERATING),N&&(N.status==="20"||N.status==="11"||((R=I==null?void 0:I.tableMeta)==null?void 0:R.generateDescriptionStatus)==Ee.GENERATING))return!1}if(Array.isArray(v.children)){for(const N of v.children)if(N.data){const I=N.data.find(z=>z.columnId==="status");if(I&&(I.status==="20"||I.status==="11"))return!1}}}return!0}const k=async()=>{const d=await J();U(d||[])?F.current&&(clearTimeout(F.current),F.current=null):(F.current&&(clearTimeout(F.current),F.current=null),F.current=setTimeout(()=>{k()},5e3))};return O(Ue,{title:t==null?void 0:t.name,description:(t==null?void 0:t.description)||"-",goBack:()=>{var d;(d=e.eventsEmit)==null||d.call(e,"goBack",{})},children:[a(we,{dataSource:L,ref:E,eventsEmit:g,status:B,styles:{theme:{...be,colors:{...be.colors,tableFirstColumnBg:"#ffffff",tableLastColumnBg:"#ffffff",paginationBackground:"#ffffff",subTableBackground:"#F5F5F5",tableHeaderBg:"#F5F5F5"}},mode:"light"},CustomComponents:{EmptyData:()=>a(Tt,{dbInfo:t,setDrawerTitle:D,setDrawerVisible:l,getBtnDisabled:m}),...S},...p=="DataTable"?V:f}),a(bt,{drawerTitle:A,drawerVisible:c,handleDrawerClose:w,dbId:i,token:o,url:r,uploadUrl:_,role:s,tableInfo:y}),a(xt,{drawerTitle:Z,drawerVisible:W,handleDrawerClose:w,tableInfo:y,optimizeDesc:re,eventsEmit:g})]})};export{Ut as D,ft as P,Ne as a,de as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as n from"react";import{y as je,z as Ie,A as re,f as x,E as ce,G as Me,H as de,p as me,J as j,L as fe,M as ie,N as ve,P as _e,u as Ce,O as ze,Q as ge,g as He,m as Le,k as Z,S as We,U as Ke,V as Te,W as Ae,X as Be,Y as he,l as Fe}from"./index-BbHMAb8g.js";import{S as Ve,u as Ue}from"./style-CNIDlcUL.js";var be=n.createContext(null),we=n.createContext({}),Xe=["prefixCls","className","containerRef"],Ye=function(t){var a=t.prefixCls,o=t.className,r=t.containerRef,l=je(t,Xe),i=n.useContext(we),s=i.panel,b=Ie(s,r);return n.createElement("div",re({className:x("".concat(a,"-content"),o),role:"dialog",ref:b},ce(t,{aria:!0}),{"aria-modal":"true"},l))};function ye(e){return typeof e=="string"&&String(Number(e))===e?(Me(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(e)):e}var pe={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function Ge(e,t){var a,o,r,l=e.prefixCls,i=e.open,s=e.placement,b=e.inline,C=e.push,O=e.forceRender,y=e.autoFocus,E=e.keyboard,f=e.classNames,d=e.rootClassName,u=e.rootStyle,v=e.zIndex,p=e.className,I=e.id,P=e.style,S=e.motion,D=e.width,N=e.height,g=e.children,w=e.mask,M=e.maskClosable,R=e.maskMotion,J=e.maskClassName,L=e.maskStyle,z=e.afterOpenChange,$=e.onClose,K=e.onMouseEnter,Q=e.onMouseOver,ee=e.onMouseLeave,X=e.onClick,te=e.onKeyDown,ne=e.onKeyUp,h=e.styles,T=e.drawerRender,_=n.useRef(),A=n.useRef(),B=n.useRef();n.useImperativeHandle(t,function(){return _.current});var ae=function(k){var Y=k.keyCode,G=k.shiftKey;switch(Y){case ie.TAB:{if(Y===ie.TAB){if(!G&&document.activeElement===B.current){var q;(q=A.current)===null||q===void 0||q.focus({preventScroll:!0})}else if(G&&document.activeElement===A.current){var le;(le=B.current)===null||le===void 0||le.focus({preventScroll:!0})}}break}case ie.ESC:{$&&E&&(k.stopPropagation(),$(k));break}}};n.useEffect(function(){if(i&&y){var c;(c=_.current)===null||c===void 0||c.focus({preventScroll:!0})}},[i]);var oe=n.useState(!1),F=de(oe,2),H=F[0],W=F[1],m=n.useContext(be),se;typeof C=="boolean"?se=C?{}:{distance:0}:se=C||{};var V=(a=(o=(r=se)===null||r===void 0?void 0:r.distance)!==null&&o!==void 0?o:m==null?void 0:m.pushDistance)!==null&&a!==void 0?a:180,Ne=n.useMemo(function(){return{pushDistance:V,push:function(){W(!0)},pull:function(){W(!1)}}},[V]);n.useEffect(function(){if(i){var c;m==null||(c=m.push)===null||c===void 0||c.call(m)}else{var k;m==null||(k=m.pull)===null||k===void 0||k.call(m)}},[i]),n.useEffect(function(){return function(){var c;m==null||(c=m.pull)===null||c===void 0||c.call(m)}},[]);var Ee=n.createElement(me,re({key:"mask"},R,{visible:w&&i}),function(c,k){var Y=c.className,G=c.style;return n.createElement("div",{className:x("".concat(l,"-mask"),Y,f==null?void 0:f.mask,J),style:j(j(j({},G),L),h==null?void 0:h.mask),onClick:M&&i?$:void 0,ref:k})}),Pe=typeof S=="function"?S(s):S,U={};if(H&&V)switch(s){case"top":U.transform="translateY(".concat(V,"px)");break;case"bottom":U.transform="translateY(".concat(-V,"px)");break;case"left":U.transform="translateX(".concat(V,"px)");break;default:U.transform="translateX(".concat(-V,"px)");break}s==="left"||s==="right"?U.width=ye(D):U.height=ye(N);var De={onMouseEnter:K,onMouseOver:Q,onMouseLeave:ee,onClick:X,onKeyDown:te,onKeyUp:ne},Re=n.createElement(me,re({key:"panel"},Pe,{visible:i,forceRender:O,onVisibleChanged:function(k){z==null||z(k)},removeOnLeave:!1,leavedClassName:"".concat(l,"-content-wrapper-hidden")}),function(c,k){var Y=c.className,G=c.style,q=n.createElement(Ye,re({id:I,containerRef:k,prefixCls:l,className:x(p,f==null?void 0:f.content),style:j(j({},P),h==null?void 0:h.content)},ce(e,{aria:!0}),De),g);return n.createElement("div",re({className:x("".concat(l,"-content-wrapper"),f==null?void 0:f.wrapper,Y),style:j(j(j({},U),G),h==null?void 0:h.wrapper)},ce(e,{data:!0})),T?T(q):q)}),ue=j({},u);return v&&(ue.zIndex=v),n.createElement(be.Provider,{value:Ne},n.createElement("div",{className:x(l,"".concat(l,"-").concat(s),d,fe(fe({},"".concat(l,"-open"),i),"".concat(l,"-inline"),b)),style:ue,tabIndex:-1,ref:_,onKeyDown:ae},Ee,n.createElement("div",{tabIndex:0,ref:A,style:pe,"aria-hidden":"true","data-sentinel":"start"}),Re,n.createElement("div",{tabIndex:0,ref:B,style:pe,"aria-hidden":"true","data-sentinel":"end"})))}var qe=n.forwardRef(Ge),Ze=function(t){var a=t.open,o=a===void 0?!1:a,r=t.prefixCls,l=r===void 0?"rc-drawer":r,i=t.placement,s=i===void 0?"right":i,b=t.autoFocus,C=b===void 0?!0:b,O=t.keyboard,y=O===void 0?!0:O,E=t.width,f=E===void 0?378:E,d=t.mask,u=d===void 0?!0:d,v=t.maskClosable,p=v===void 0?!0:v,I=t.getContainer,P=t.forceRender,S=t.afterOpenChange,D=t.destroyOnClose,N=t.onMouseEnter,g=t.onMouseOver,w=t.onMouseLeave,M=t.onClick,R=t.onKeyDown,J=t.onKeyUp,L=t.panelRef,z=n.useState(!1),$=de(z,2),K=$[0],Q=$[1],ee=n.useState(!1),X=de(ee,2),te=X[0],ne=X[1];ve(function(){ne(!0)},[]);var h=te?o:!1,T=n.useRef(),_=n.useRef();ve(function(){h&&(_.current=document.activeElement)},[h]);var A=function(H){var W;if(Q(H),S==null||S(H),!H&&_.current&&!((W=T.current)!==null&&W!==void 0&&W.contains(_.current))){var m;(m=_.current)===null||m===void 0||m.focus({preventScroll:!0})}},B=n.useMemo(function(){return{panel:L}},[L]);if(!P&&!K&&!h&&D)return null;var ae={onMouseEnter:N,onMouseOver:g,onMouseLeave:w,onClick:M,onKeyDown:R,onKeyUp:J},oe=j(j({},t),{},{open:h,prefixCls:l,placement:s,autoFocus:C,keyboard:y,width:f,mask:u,maskClosable:p,inline:I===!1,afterOpenChange:A,ref:T},ae);return n.createElement(we.Provider,{value:B},n.createElement(_e,{open:h||P||K,autoDestroy:!1,getContainer:I,autoLock:u&&(h||K)},n.createElement(qe,oe)))};const xe=e=>{var t,a;const{prefixCls:o,title:r,footer:l,extra:i,closable:s,loading:b,onClose:C,headerStyle:O,bodyStyle:y,footerStyle:E,children:f,classNames:d,styles:u}=e,v=Ce("drawer");let p;s===!1?p=void 0:s===void 0||s===!0?p="start":p=(s==null?void 0:s.placement)==="end"?"end":"start";const I=n.useCallback(g=>n.createElement("button",{type:"button",onClick:C,className:x(`${o}-close`,{[`${o}-close-${p}`]:p==="end"})},g),[C,o,p]),[P,S]=ze(ge(e),ge(v),{closable:!0,closeIconRender:I}),D=()=>{var g,w;return!r&&!P?null:n.createElement("div",{style:Object.assign(Object.assign(Object.assign({},(g=v.styles)===null||g===void 0?void 0:g.header),O),u==null?void 0:u.header),className:x(`${o}-header`,{[`${o}-header-close-only`]:P&&!r&&!i},(w=v.classNames)===null||w===void 0?void 0:w.header,d==null?void 0:d.header)},n.createElement("div",{className:`${o}-header-title`},p==="start"&&S,r&&n.createElement("div",{className:`${o}-title`},r)),i&&n.createElement("div",{className:`${o}-extra`},i),p==="end"&&S)},N=()=>{var g,w;if(!l)return null;const M=`${o}-footer`;return n.createElement("div",{className:x(M,(g=v.classNames)===null||g===void 0?void 0:g.footer,d==null?void 0:d.footer),style:Object.assign(Object.assign(Object.assign({},(w=v.styles)===null||w===void 0?void 0:w.footer),E),u==null?void 0:u.footer)},l)};return n.createElement(n.Fragment,null,D(),n.createElement("div",{className:x(`${o}-body`,d==null?void 0:d.body,(t=v.classNames)===null||t===void 0?void 0:t.body),style:Object.assign(Object.assign(Object.assign({},(a=v.styles)===null||a===void 0?void 0:a.body),y),u==null?void 0:u.body)},b?n.createElement(Ve,{active:!0,title:!1,paragraph:{rows:5},className:`${o}-body-skeleton`}):f),N())},Je=e=>{const t="100%";return{left:`translateX(-${t})`,right:`translateX(${t})`,top:`translateY(-${t})`,bottom:`translateY(${t})`}[e]},Se=(e,t)=>({"&-enter, &-appear":Object.assign(Object.assign({},e),{"&-active":t}),"&-leave":Object.assign(Object.assign({},t),{"&-active":e})}),ke=(e,t)=>Object.assign({"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${t}`}}},Se({opacity:e},{opacity:1})),Qe=(e,t)=>[ke(.7,t),Se({transform:Je(e)},{transform:"none"})],et=e=>{const{componentCls:t,motionDurationSlow:a}=e;return{[t]:{[`${t}-mask-motion`]:ke(0,a),[`${t}-panel-motion`]:["left","right","top","bottom"].reduce((o,r)=>Object.assign(Object.assign({},o),{[`&-${r}`]:Qe(r,a)}),{})}}},tt=e=>{const{borderRadiusSM:t,componentCls:a,zIndexPopup:o,colorBgMask:r,colorBgElevated:l,motionDurationSlow:i,motionDurationMid:s,paddingXS:b,padding:C,paddingLG:O,fontSizeLG:y,lineHeightLG:E,lineWidth:f,lineType:d,colorSplit:u,marginXS:v,colorIcon:p,colorIconHover:I,colorBgTextHover:P,colorBgTextActive:S,colorText:D,fontWeightStrong:N,footerPaddingBlock:g,footerPaddingInline:w,calc:M}=e,R=`${a}-content-wrapper`;return{[a]:{position:"fixed",inset:0,zIndex:o,pointerEvents:"none",color:D,"&-pure":{position:"relative",background:l,display:"flex",flexDirection:"column",[`&${a}-left`]:{boxShadow:e.boxShadowDrawerLeft},[`&${a}-right`]:{boxShadow:e.boxShadowDrawerRight},[`&${a}-top`]:{boxShadow:e.boxShadowDrawerUp},[`&${a}-bottom`]:{boxShadow:e.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${a}-mask`]:{position:"absolute",inset:0,zIndex:o,background:r,pointerEvents:"auto"},[R]:{position:"absolute",zIndex:o,maxWidth:"100vw",transition:`all ${i}`,"&-hidden":{display:"none"}},[`&-left > ${R}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowDrawerLeft},[`&-right > ${R}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:e.boxShadowDrawerRight},[`&-top > ${R}`]:{top:0,insetInline:0,boxShadow:e.boxShadowDrawerUp},[`&-bottom > ${R}`]:{bottom:0,insetInline:0,boxShadow:e.boxShadowDrawerDown},[`${a}-content`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"auto",background:l,pointerEvents:"auto"},[`${a}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${Z(C)} ${Z(O)}`,fontSize:y,lineHeight:E,borderBottom:`${Z(f)} ${d} ${u}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${a}-extra`]:{flex:"none"},[`${a}-close`]:Object.assign({display:"inline-flex",width:M(y).add(b).equal(),height:M(y).add(b).equal(),borderRadius:t,justifyContent:"center",alignItems:"center",color:p,fontWeight:N,fontSize:y,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,cursor:"pointer",transition:`all ${s}`,textRendering:"auto",[`&${a}-close-end`]:{marginInlineStart:v},[`&:not(${a}-close-end)`]:{marginInlineEnd:v},"&:hover":{color:I,backgroundColor:P,textDecoration:"none"},"&:active":{backgroundColor:S}},We(e)),[`${a}-title`]:{flex:1,margin:0,fontWeight:e.fontWeightStrong,fontSize:y,lineHeight:E},[`${a}-body`]:{flex:1,minWidth:0,minHeight:0,padding:O,overflow:"auto",[`${a}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center"}},[`${a}-footer`]:{flexShrink:0,padding:`${Z(g)} ${Z(w)}`,borderTop:`${Z(f)} ${d} ${u}`},"&-rtl":{direction:"rtl"}}}},nt=e=>({zIndexPopup:e.zIndexPopupBase,footerPaddingBlock:e.paddingXS,footerPaddingInline:e.padding}),Oe=He("Drawer",e=>{const t=Le(e,{});return[tt(t),et(t)]},nt);var $e=function(e,t){var a={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(a[o[r]]=e[o[r]]);return a};const at={distance:180},ot=e=>{const{rootClassName:t,width:a,height:o,size:r="default",mask:l=!0,push:i=at,open:s,afterOpenChange:b,onClose:C,prefixCls:O,getContainer:y,panelRef:E=null,style:f,className:d,visible:u,afterVisibleChange:v,maskStyle:p,drawerStyle:I,contentWrapperStyle:P,destroyOnClose:S,destroyOnHidden:D}=e,N=$e(e,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","panelRef","style","className","visible","afterVisibleChange","maskStyle","drawerStyle","contentWrapperStyle","destroyOnClose","destroyOnHidden"]),{getPopupContainer:g,getPrefixCls:w,direction:M,className:R,style:J,classNames:L,styles:z}=Ce("drawer"),$=w("drawer",O),[K,Q,ee]=Oe($),X=y===void 0&&g?()=>g(document.body):y,te=x({"no-mask":!l,[`${$}-rtl`]:M==="rtl"},t,Q,ee),ne=n.useMemo(()=>a??(r==="large"?736:378),[a,r]),h=n.useMemo(()=>o??(r==="large"?736:378),[o,r]),T={motionName:he($,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},_=W=>({motionName:he($,`panel-motion-${W}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),A=Ue(),B=Ke(E,A),[ae,oe]=Te("Drawer",N.zIndex),{classNames:F={},styles:H={}}=N;return K(n.createElement(Ae,{form:!0,space:!0},n.createElement(Be.Provider,{value:oe},n.createElement(Ze,Object.assign({prefixCls:$,onClose:C,maskMotion:T,motion:_},N,{classNames:{mask:x(F.mask,L.mask),content:x(F.content,L.content),wrapper:x(F.wrapper,L.wrapper)},styles:{mask:Object.assign(Object.assign(Object.assign({},H.mask),p),z.mask),content:Object.assign(Object.assign(Object.assign({},H.content),I),z.content),wrapper:Object.assign(Object.assign(Object.assign({},H.wrapper),P),z.wrapper)},open:s??u,mask:l,push:i,width:ne,height:h,style:Object.assign(Object.assign({},J),f),className:x(R,d),rootClassName:te,getContainer:X,afterOpenChange:b??v,panelRef:B,zIndex:ae,destroyOnClose:D??S}),n.createElement(xe,Object.assign({prefixCls:$},N,{onClose:C}))))))},rt=e=>{const{prefixCls:t,style:a,className:o,placement:r="right"}=e,l=$e(e,["prefixCls","style","className","placement"]),{getPrefixCls:i}=n.useContext(Fe),s=i("drawer",t),[b,C,O]=Oe(s),y=x(s,`${s}-pure`,`${s}-${r}`,C,O,o);return b(n.createElement("div",{className:y,style:a},n.createElement(xe,Object.assign({prefixCls:s},l))))};ot._InternalPanelDoNotUseOrYouWillBeFired=rt;export{ot as D};
|
|
1
|
+
import*as n from"react";import{y as je,z as Ie,A as re,f as x,E as ce,G as Me,H as de,p as me,J as j,L as fe,M as ie,N as ve,P as _e,u as Ce,O as ze,Q as ge,g as He,m as Le,k as q,U as We,V as Ke,W as Te,X as Ae,Y as Be,Z as he,l as Fe}from"./index-g-SUxfJH.js";import{S as Ve,u as Ue}from"./style-CGmZ5osp.js";var be=n.createContext(null),we=n.createContext({}),Xe=["prefixCls","className","containerRef"],Ye=function(t){var a=t.prefixCls,o=t.className,r=t.containerRef,l=je(t,Xe),i=n.useContext(we),s=i.panel,b=Ie(s,r);return n.createElement("div",re({className:x("".concat(a,"-content"),o),role:"dialog",ref:b},ce(t,{aria:!0}),{"aria-modal":"true"},l))};function ye(e){return typeof e=="string"&&String(Number(e))===e?(Me(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(e)):e}var pe={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function Ge(e,t){var a,o,r,l=e.prefixCls,i=e.open,s=e.placement,b=e.inline,C=e.push,O=e.forceRender,y=e.autoFocus,E=e.keyboard,f=e.classNames,d=e.rootClassName,u=e.rootStyle,v=e.zIndex,p=e.className,I=e.id,P=e.style,S=e.motion,D=e.width,N=e.height,g=e.children,w=e.mask,M=e.maskClosable,R=e.maskMotion,J=e.maskClassName,L=e.maskStyle,z=e.afterOpenChange,$=e.onClose,K=e.onMouseEnter,Q=e.onMouseOver,ee=e.onMouseLeave,X=e.onClick,te=e.onKeyDown,ne=e.onKeyUp,h=e.styles,T=e.drawerRender,_=n.useRef(),A=n.useRef(),B=n.useRef();n.useImperativeHandle(t,function(){return _.current});var ae=function(k){var Y=k.keyCode,G=k.shiftKey;switch(Y){case ie.TAB:{if(Y===ie.TAB){if(!G&&document.activeElement===B.current){var Z;(Z=A.current)===null||Z===void 0||Z.focus({preventScroll:!0})}else if(G&&document.activeElement===A.current){var le;(le=B.current)===null||le===void 0||le.focus({preventScroll:!0})}}break}case ie.ESC:{$&&E&&(k.stopPropagation(),$(k));break}}};n.useEffect(function(){if(i&&y){var c;(c=_.current)===null||c===void 0||c.focus({preventScroll:!0})}},[i]);var oe=n.useState(!1),F=de(oe,2),H=F[0],W=F[1],m=n.useContext(be),se;typeof C=="boolean"?se=C?{}:{distance:0}:se=C||{};var V=(a=(o=(r=se)===null||r===void 0?void 0:r.distance)!==null&&o!==void 0?o:m==null?void 0:m.pushDistance)!==null&&a!==void 0?a:180,Ne=n.useMemo(function(){return{pushDistance:V,push:function(){W(!0)},pull:function(){W(!1)}}},[V]);n.useEffect(function(){if(i){var c;m==null||(c=m.push)===null||c===void 0||c.call(m)}else{var k;m==null||(k=m.pull)===null||k===void 0||k.call(m)}},[i]),n.useEffect(function(){return function(){var c;m==null||(c=m.pull)===null||c===void 0||c.call(m)}},[]);var Ee=n.createElement(me,re({key:"mask"},R,{visible:w&&i}),function(c,k){var Y=c.className,G=c.style;return n.createElement("div",{className:x("".concat(l,"-mask"),Y,f==null?void 0:f.mask,J),style:j(j(j({},G),L),h==null?void 0:h.mask),onClick:M&&i?$:void 0,ref:k})}),Pe=typeof S=="function"?S(s):S,U={};if(H&&V)switch(s){case"top":U.transform="translateY(".concat(V,"px)");break;case"bottom":U.transform="translateY(".concat(-V,"px)");break;case"left":U.transform="translateX(".concat(V,"px)");break;default:U.transform="translateX(".concat(-V,"px)");break}s==="left"||s==="right"?U.width=ye(D):U.height=ye(N);var De={onMouseEnter:K,onMouseOver:Q,onMouseLeave:ee,onClick:X,onKeyDown:te,onKeyUp:ne},Re=n.createElement(me,re({key:"panel"},Pe,{visible:i,forceRender:O,onVisibleChanged:function(k){z==null||z(k)},removeOnLeave:!1,leavedClassName:"".concat(l,"-content-wrapper-hidden")}),function(c,k){var Y=c.className,G=c.style,Z=n.createElement(Ye,re({id:I,containerRef:k,prefixCls:l,className:x(p,f==null?void 0:f.content),style:j(j({},P),h==null?void 0:h.content)},ce(e,{aria:!0}),De),g);return n.createElement("div",re({className:x("".concat(l,"-content-wrapper"),f==null?void 0:f.wrapper,Y),style:j(j(j({},U),G),h==null?void 0:h.wrapper)},ce(e,{data:!0})),T?T(Z):Z)}),ue=j({},u);return v&&(ue.zIndex=v),n.createElement(be.Provider,{value:Ne},n.createElement("div",{className:x(l,"".concat(l,"-").concat(s),d,fe(fe({},"".concat(l,"-open"),i),"".concat(l,"-inline"),b)),style:ue,tabIndex:-1,ref:_,onKeyDown:ae},Ee,n.createElement("div",{tabIndex:0,ref:A,style:pe,"aria-hidden":"true","data-sentinel":"start"}),Re,n.createElement("div",{tabIndex:0,ref:B,style:pe,"aria-hidden":"true","data-sentinel":"end"})))}var Ze=n.forwardRef(Ge),qe=function(t){var a=t.open,o=a===void 0?!1:a,r=t.prefixCls,l=r===void 0?"rc-drawer":r,i=t.placement,s=i===void 0?"right":i,b=t.autoFocus,C=b===void 0?!0:b,O=t.keyboard,y=O===void 0?!0:O,E=t.width,f=E===void 0?378:E,d=t.mask,u=d===void 0?!0:d,v=t.maskClosable,p=v===void 0?!0:v,I=t.getContainer,P=t.forceRender,S=t.afterOpenChange,D=t.destroyOnClose,N=t.onMouseEnter,g=t.onMouseOver,w=t.onMouseLeave,M=t.onClick,R=t.onKeyDown,J=t.onKeyUp,L=t.panelRef,z=n.useState(!1),$=de(z,2),K=$[0],Q=$[1],ee=n.useState(!1),X=de(ee,2),te=X[0],ne=X[1];ve(function(){ne(!0)},[]);var h=te?o:!1,T=n.useRef(),_=n.useRef();ve(function(){h&&(_.current=document.activeElement)},[h]);var A=function(H){var W;if(Q(H),S==null||S(H),!H&&_.current&&!((W=T.current)!==null&&W!==void 0&&W.contains(_.current))){var m;(m=_.current)===null||m===void 0||m.focus({preventScroll:!0})}},B=n.useMemo(function(){return{panel:L}},[L]);if(!P&&!K&&!h&&D)return null;var ae={onMouseEnter:N,onMouseOver:g,onMouseLeave:w,onClick:M,onKeyDown:R,onKeyUp:J},oe=j(j({},t),{},{open:h,prefixCls:l,placement:s,autoFocus:C,keyboard:y,width:f,mask:u,maskClosable:p,inline:I===!1,afterOpenChange:A,ref:T},ae);return n.createElement(we.Provider,{value:B},n.createElement(_e,{open:h||P||K,autoDestroy:!1,getContainer:I,autoLock:u&&(h||K)},n.createElement(Ze,oe)))};const xe=e=>{var t,a;const{prefixCls:o,title:r,footer:l,extra:i,closable:s,loading:b,onClose:C,headerStyle:O,bodyStyle:y,footerStyle:E,children:f,classNames:d,styles:u}=e,v=Ce("drawer");let p;s===!1?p=void 0:s===void 0||s===!0?p="start":p=(s==null?void 0:s.placement)==="end"?"end":"start";const I=n.useCallback(g=>n.createElement("button",{type:"button",onClick:C,className:x(`${o}-close`,{[`${o}-close-${p}`]:p==="end"})},g),[C,o,p]),[P,S]=ze(ge(e),ge(v),{closable:!0,closeIconRender:I}),D=()=>{var g,w;return!r&&!P?null:n.createElement("div",{style:Object.assign(Object.assign(Object.assign({},(g=v.styles)===null||g===void 0?void 0:g.header),O),u==null?void 0:u.header),className:x(`${o}-header`,{[`${o}-header-close-only`]:P&&!r&&!i},(w=v.classNames)===null||w===void 0?void 0:w.header,d==null?void 0:d.header)},n.createElement("div",{className:`${o}-header-title`},p==="start"&&S,r&&n.createElement("div",{className:`${o}-title`},r)),i&&n.createElement("div",{className:`${o}-extra`},i),p==="end"&&S)},N=()=>{var g,w;if(!l)return null;const M=`${o}-footer`;return n.createElement("div",{className:x(M,(g=v.classNames)===null||g===void 0?void 0:g.footer,d==null?void 0:d.footer),style:Object.assign(Object.assign(Object.assign({},(w=v.styles)===null||w===void 0?void 0:w.footer),E),u==null?void 0:u.footer)},l)};return n.createElement(n.Fragment,null,D(),n.createElement("div",{className:x(`${o}-body`,d==null?void 0:d.body,(t=v.classNames)===null||t===void 0?void 0:t.body),style:Object.assign(Object.assign(Object.assign({},(a=v.styles)===null||a===void 0?void 0:a.body),y),u==null?void 0:u.body)},b?n.createElement(Ve,{active:!0,title:!1,paragraph:{rows:5},className:`${o}-body-skeleton`}):f),N())},Je=e=>{const t="100%";return{left:`translateX(-${t})`,right:`translateX(${t})`,top:`translateY(-${t})`,bottom:`translateY(${t})`}[e]},Se=(e,t)=>({"&-enter, &-appear":Object.assign(Object.assign({},e),{"&-active":t}),"&-leave":Object.assign(Object.assign({},t),{"&-active":e})}),ke=(e,t)=>Object.assign({"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${t}`}}},Se({opacity:e},{opacity:1})),Qe=(e,t)=>[ke(.7,t),Se({transform:Je(e)},{transform:"none"})],et=e=>{const{componentCls:t,motionDurationSlow:a}=e;return{[t]:{[`${t}-mask-motion`]:ke(0,a),[`${t}-panel-motion`]:["left","right","top","bottom"].reduce((o,r)=>Object.assign(Object.assign({},o),{[`&-${r}`]:Qe(r,a)}),{})}}},tt=e=>{const{borderRadiusSM:t,componentCls:a,zIndexPopup:o,colorBgMask:r,colorBgElevated:l,motionDurationSlow:i,motionDurationMid:s,paddingXS:b,padding:C,paddingLG:O,fontSizeLG:y,lineHeightLG:E,lineWidth:f,lineType:d,colorSplit:u,marginXS:v,colorIcon:p,colorIconHover:I,colorBgTextHover:P,colorBgTextActive:S,colorText:D,fontWeightStrong:N,footerPaddingBlock:g,footerPaddingInline:w,calc:M}=e,R=`${a}-content-wrapper`;return{[a]:{position:"fixed",inset:0,zIndex:o,pointerEvents:"none",color:D,"&-pure":{position:"relative",background:l,display:"flex",flexDirection:"column",[`&${a}-left`]:{boxShadow:e.boxShadowDrawerLeft},[`&${a}-right`]:{boxShadow:e.boxShadowDrawerRight},[`&${a}-top`]:{boxShadow:e.boxShadowDrawerUp},[`&${a}-bottom`]:{boxShadow:e.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${a}-mask`]:{position:"absolute",inset:0,zIndex:o,background:r,pointerEvents:"auto"},[R]:{position:"absolute",zIndex:o,maxWidth:"100vw",transition:`all ${i}`,"&-hidden":{display:"none"}},[`&-left > ${R}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowDrawerLeft},[`&-right > ${R}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:e.boxShadowDrawerRight},[`&-top > ${R}`]:{top:0,insetInline:0,boxShadow:e.boxShadowDrawerUp},[`&-bottom > ${R}`]:{bottom:0,insetInline:0,boxShadow:e.boxShadowDrawerDown},[`${a}-content`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"auto",background:l,pointerEvents:"auto"},[`${a}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${q(C)} ${q(O)}`,fontSize:y,lineHeight:E,borderBottom:`${q(f)} ${d} ${u}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${a}-extra`]:{flex:"none"},[`${a}-close`]:Object.assign({display:"inline-flex",width:M(y).add(b).equal(),height:M(y).add(b).equal(),borderRadius:t,justifyContent:"center",alignItems:"center",color:p,fontWeight:N,fontSize:y,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,cursor:"pointer",transition:`all ${s}`,textRendering:"auto",[`&${a}-close-end`]:{marginInlineStart:v},[`&:not(${a}-close-end)`]:{marginInlineEnd:v},"&:hover":{color:I,backgroundColor:P,textDecoration:"none"},"&:active":{backgroundColor:S}},We(e)),[`${a}-title`]:{flex:1,margin:0,fontWeight:e.fontWeightStrong,fontSize:y,lineHeight:E},[`${a}-body`]:{flex:1,minWidth:0,minHeight:0,padding:O,overflow:"auto",[`${a}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center"}},[`${a}-footer`]:{flexShrink:0,padding:`${q(g)} ${q(w)}`,borderTop:`${q(f)} ${d} ${u}`},"&-rtl":{direction:"rtl"}}}},nt=e=>({zIndexPopup:e.zIndexPopupBase,footerPaddingBlock:e.paddingXS,footerPaddingInline:e.padding}),Oe=He("Drawer",e=>{const t=Le(e,{});return[tt(t),et(t)]},nt);var $e=function(e,t){var a={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(a[o[r]]=e[o[r]]);return a};const at={distance:180},ot=e=>{const{rootClassName:t,width:a,height:o,size:r="default",mask:l=!0,push:i=at,open:s,afterOpenChange:b,onClose:C,prefixCls:O,getContainer:y,panelRef:E=null,style:f,className:d,visible:u,afterVisibleChange:v,maskStyle:p,drawerStyle:I,contentWrapperStyle:P,destroyOnClose:S,destroyOnHidden:D}=e,N=$e(e,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","panelRef","style","className","visible","afterVisibleChange","maskStyle","drawerStyle","contentWrapperStyle","destroyOnClose","destroyOnHidden"]),{getPopupContainer:g,getPrefixCls:w,direction:M,className:R,style:J,classNames:L,styles:z}=Ce("drawer"),$=w("drawer",O),[K,Q,ee]=Oe($),X=y===void 0&&g?()=>g(document.body):y,te=x({"no-mask":!l,[`${$}-rtl`]:M==="rtl"},t,Q,ee),ne=n.useMemo(()=>a??(r==="large"?736:378),[a,r]),h=n.useMemo(()=>o??(r==="large"?736:378),[o,r]),T={motionName:he($,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},_=W=>({motionName:he($,`panel-motion-${W}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),A=Ue(),B=Ke(E,A),[ae,oe]=Te("Drawer",N.zIndex),{classNames:F={},styles:H={}}=N;return K(n.createElement(Ae,{form:!0,space:!0},n.createElement(Be.Provider,{value:oe},n.createElement(qe,Object.assign({prefixCls:$,onClose:C,maskMotion:T,motion:_},N,{classNames:{mask:x(F.mask,L.mask),content:x(F.content,L.content),wrapper:x(F.wrapper,L.wrapper)},styles:{mask:Object.assign(Object.assign(Object.assign({},H.mask),p),z.mask),content:Object.assign(Object.assign(Object.assign({},H.content),I),z.content),wrapper:Object.assign(Object.assign(Object.assign({},H.wrapper),P),z.wrapper)},open:s??u,mask:l,push:i,width:ne,height:h,style:Object.assign(Object.assign({},J),f),className:x(R,d),rootClassName:te,getContainer:X,afterOpenChange:b??v,panelRef:B,zIndex:ae,destroyOnClose:D??S}),n.createElement(xe,Object.assign({prefixCls:$},N,{onClose:C}))))))},rt=e=>{const{prefixCls:t,style:a,className:o,placement:r="right"}=e,l=$e(e,["prefixCls","style","className","placement"]),{getPrefixCls:i}=n.useContext(Fe),s=i("drawer",t),[b,C,O]=Oe(s),y=x(s,`${s}-pure`,`${s}-${r}`,C,O,o);return b(n.createElement("div",{className:y,style:a},n.createElement(xe,Object.assign({prefixCls:s},l))))};ot._InternalPanelDoNotUseOrYouWillBeFired=rt;export{ot as D};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{a as Nt,g as it,m as xt,j as at,r as lt,K as P,k as j,l as K,n as ct,f as w,o as dt,p as Ot}from"./index-g-SUxfJH.js";import*as c from"react";import{useMemo as rt,useRef as U}from"react";/**
|
|
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 Xt=Nt("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"}]]),wt=new P("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),jt=new P("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),Et=new P("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),Tt=new P("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),It=new P("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),Pt=new P("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),zt=t=>{const{componentCls:e,iconCls:i,antCls:n,badgeShadowSize:o,textFontSize:d,textFontSizeSM:a,statusSize:C,dotSize:v,textFontWeight:h,indicatorHeight:l,indicatorHeightSM:r,marginXS:m,calc:g}=t,u=`${n}-scroll-number`,y=at(t,(f,{darkColor:$})=>({[`&${e} ${e}-color-${f}`]:{background:$,[`&:not(${e}-count)`]:{color:$},"a:hover &":{background:$}}}));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:h,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:Pt,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&${e}-status`]:{lineHeight:"inherit",verticalAlign:"baseline",[`${e}-status-dot`]:{position:"relative",top:-1,display:"inline-block",width:C,height:C,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:wt,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}}}),y),{[`${e}-zoom-appear, ${e}-zoom-enter`]:{animationName:jt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack,animationFillMode:"both"},[`${e}-zoom-leave`]:{animationName:Et,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack,animationFillMode:"both"},[`&${e}-not-a-wrapper`]:{[`${e}-zoom-appear, ${e}-zoom-enter`]:{animationName:Tt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack},[`${e}-zoom-leave`]:{animationName:It,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,C=t.colorTextLightSolid,v=t.colorError,h=t.colorErrorHover;return xt(t,{badgeFontHeight:d,badgeShadowSize:a,badgeTextColor:C,badgeColor:v,badgeColorHover:h,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}},Bt=it("Badge",t=>{const e=ut(t);return zt(e)},mt),Rt=t=>{const{antCls:e,badgeFontHeight:i,marginXS:n,badgeRibbonOffset:o,calc:d}=t,a=`${e}-ribbon`,C=`${e}-ribbon-wrapper`,v=at(t,(h,{darkColor:l})=>({[`&${a}-color-${h}`]:{background:l,color:l}}));return{[C]:{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"}})}},Dt=it(["Badge","Ribbon"],t=>{const e=ut(t);return Rt(e)},mt),Wt=t=>{const{className:e,prefixCls:i,style:n,color:o,children:d,text:a,placement:C="end",rootClassName:v}=t,{getPrefixCls:h,direction:l}=c.useContext(K),r=h("ribbon",i),m=`${r}-wrapper`,[g,u,y]=Dt(r,m),f=ct(o,!1),$=w(r,`${r}-placement-${C}`,{[`${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,y)},d,c.createElement("div",{className:w($,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 Ft(t,e,i){let n=t,o=0;for(;(n+10)%10!==e;)n+=i,o+=i;return o}const Ht=t=>{const{prefixCls:e,count:i,value:n}=t,o=Number(n),d=Math.abs(i),[a,C]=c.useState(o),[v,h]=c.useState(d),l=()=>{C(o),h(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 y=v<d?1:-1,f=u.findIndex(b=>b%10===a);r=(y<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:y<0?N-f:N,current:N===f}))}),m={transform:`translateY(${-Ft(a,o,y)}00%)`}}return c.createElement("span",{className:`${e}-only`,style:m,onTransitionEnd:l},r)};var Mt=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 Zt=c.forwardRef((t,e)=>{const{prefixCls:i,count:n,className:o,motionClassName:d,style:a,title:C,show:v,component:h="sup",children:l}=t,r=Mt(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:C});let y=n;if(n&&Number(n)%1===0){const f=String(n).split("");y=c.createElement("bdi",null,f.map(($,b)=>c.createElement(Ht,{prefixCls:g,count:Number(n),value:$,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(h,Object.assign({},u,{ref:e}),y)});var _t=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 At=c.forwardRef((t,e)=>{var i,n,o,d,a;const{prefixCls:C,scrollNumberPrefixCls:v,children:h,status:l,text:r,color:m,count:g=null,overflowCount:u=99,dot:y=!1,size:f="default",title:$,offset:b,style:N,className:H,rootClassName:bt,classNames:O,styles:S,showZero:R=!1}=t,Y=_t(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",C),[J,gt,ft]=Bt(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=y&&!z,E=B?"":Z,T=rt(()=>((E==null||E==="")&&(r==null||r==="")||z&&!R)&&!B,[E,z,R,B,r]),k=U(g);T||(k.current=g);const I=k.current,tt=U(E);T||(tt.current=E);const A=tt.current,et=U(B);T||(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=$??(typeof I=="string"||typeof I=="number"?I:void 0),ot=!T&&(r===0?R:!!r&&r!==!0),ht=ot?c.createElement("span",{className:`${p}-status-text`},r):null,Ct=!I||typeof I!="object"?void 0:dt(I,x=>({style:Object.assign(Object.assign({},D),x.style)})),W=ct(m,!1),yt=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}),V={};m&&!W&&(V.color=m,V.background=m);const nt=w(p,{[`${p}-status`]:_,[`${p}-not-a-wrapper`]:!h,[`${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(!h&&_&&(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:yt,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),V)}),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)}),h,c.createElement(Ot,{visible:!T,motionName:`${p}-zoom`,motionAppear:!1,motionDeadline:1e3},({className:x})=>{var L,q;const $t=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&&A&&A.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(Zt,{prefixCls:$t,show:!T,motionClassName:x,className:St,count:A,title:vt,style:F,key:"scrollNumber"},Ct)}),ht))}),Vt=At;Vt.Ribbon=Wt;export{Vt as B,Xt as T};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as Ee,jsx as B,Fragment as _l}from"react/jsx-runtime";import*as p from"react";import X,{forwardRef as sr,createElement as Ya,version as dm,useMemo as _t,useState as vt,useRef as Pe,useCallback as Xe,useEffect as wt,useImperativeHandle as Ki,createContext as Li,useContext as An,Children as fm,useLayoutEffect as pm,isValidElement as mm}from"react";import{l as gm,b as hm,a as vm,J as ym,i as bm}from"./index-
|
|
1
|
+
import{jsxs as Ee,jsx as B,Fragment as _l}from"react/jsx-runtime";import*as p from"react";import X,{forwardRef as sr,createElement as Ya,version as dm,useMemo as _t,useState as vt,useRef as Pe,useCallback as Xe,useEffect as wt,useImperativeHandle as Ki,createContext as Li,useContext as An,Children as fm,useLayoutEffect as pm,isValidElement as mm}from"react";import{l as gm,b as hm,a as vm,J as ym,i as bm}from"./index-x8IlxRuv.js";import{d as Ht,c as xm,h as Cm,i as Js}from"./index-g-SUxfJH.js";import"./style-CGmZ5osp.js";import*as wm from"react-dom";import $s,{flushSync as Xa,createPortal as dd,unstable_batchedUpdates as km}from"react-dom";var Gr=(e=>(e.FLAT="files",e.NAV="nav",e))(Gr||{});const Em=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-2xl font-bold",children:"\u5E94\u7528\u52A0\u8F7D\u4E2D..."})}),Sm=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-2xl font-bold",children:"\u5E94\u7528\u9519\u8BEF"})}),Am=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-lg font-medium",children:"\u5BB9\u5668\u52A0\u8F7D\u4E2D..."})}),Om=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-lg font-medium",children:"\u5BB9\u5668\u9519\u8BEF"})}),Im=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-base font-medium",children:"\u5185\u5BB9\u52A0\u8F7D\u4E2D..."})}),Nm=()=>B("div",{className:"main relative h-full w-full flex items-center justify-center",children:B("div",{className:"text-base font-medium",children:"\u5185\u5BB9\u9519\u8BEF"})}),Mm=({viewType:e,cardType:t})=>Ee("div",{className:"main relative h-full w-full flex flex-col items-center justify-center",children:[B("div",{className:"text-6xl mb-4",style:{color:"#d1d5db"},children:"\u{1F4ED}"}),B("div",{className:"text-lg font-medium mb-2",style:{color:"#6b7280"},children:e==="card"?"\u6682\u65E0\u6570\u636E":e==="table"?"\u6682\u65E0\u8868\u683C\u6570\u636E":"\u6682\u65E0\u6570\u636E"}),B("div",{className:"text-sm",style:{color:"#9ca3af"},children:e==="card"?"\u70B9\u51FB\u4E0A\u65B9\u6309\u94AE\u6DFB\u52A0\u6570\u636E":e==="table"?"\u8BF7\u5148\u6DFB\u52A0\u6570\u636E\u5230\u8868\u683C\u4E2D":"\u8BF7\u5148\u6DFB\u52A0\u6570\u636E"})]}),xn=(e,t)=>{console.log("[findNodeById] Searching for id:",t,"in nodes:",e);for(const n of e){if(console.log("[findNodeById] Checking node:",n),n.id===t)return console.log("[findNodeById] Found node:",n),n;if(n.children){const r=Array.isArray(n.children)?n.children:Object.values(n.children);console.log("[findNodeById] Searching in children:",r);const o=xn(r,t);if(o)return console.log("[findNodeById] Found in children:",o),o}}return console.log("[findNodeById] Node not found for id:",t),null},Za=e=>{for(const t of e){if(t.type)return t.id;if(t.children){const n=Array.isArray(t.children)?t.children:Object.values(t.children),r=Za(n);if(r)return r}}},Pm=e=>{const t=n=>{let r=[];return n.children&&(r=Array.isArray(n.children)?n.children:Object.values(n.children)),{title:n.label,key:n.id,children:r.length>0?r.map(t):void 0,selectable:!0}};return e.map(t)},Fm=(e,t)=>Array.isArray(e)?t==="table"?e.filter(n=>n&&n.data&&Array.isArray(n.data)):e:e&&typeof e=="object"?[e]:[],Rm=e=>{const t=new Set;return e.forEach(n=>{n.adding&&t.add(n.id)}),t},Bm=(e,t)=>{const[n,r]=vt(()=>{const g=Array.isArray(e)?e:[];return console.log("[useAppState] \u521D\u59CB\u5316innerData:",g),g}),[o,i]=vt(new Set),[a,s]=vt(new Set),[l,c]=vt(""),[u,d]=vt([]);wt(()=>{if(console.log("[useAppState] \u6570\u636E\u6E90\u53D8\u5316:",{dataSource:e,activeNodeType:t}),t==="form"){const f=Array.isArray(e)?e:[];r(f);return}const g=Fm(e,t);console.log("[useAppState] \u9A8C\u8BC1\u540E\u7684\u6570\u636E:",g),r(g);const v=Rm(g);s(v),d([])},[e,t]);const m=Xe(()=>{d([]),c(""),i(new Set)},[]);return{innerData:n,setInnerData:r,pendingIds:o,setPendingIds:i,addingIds:a,setAddingIds:s,fuzzyValue:l,setFuzzyValue:c,selectedIds:u,setSelectedIds:d,resetStateOnNodeChange:m}},jm=(e,t,n,r,o,i,a)=>{const s=Xe((S,M)=>{const{tableId:P,...O}=M||{};M!=null&&M.animate?(r(S.id),e(N=>{if(P)return N.map(R=>{if(R.id===P){const T=[...R.children||[],{...S,adding:!0}];return{...R,children:T}}return R});const F={...S,adding:!0};if((O==null?void 0:O.position)==="start"||(O==null?void 0:O.position)===void 0)return[F,...N];if(typeof(O==null?void 0:O.position)=="number"){const R=[...N];return R.splice(O.position,0,F),R}return[F,...N]})):e(N=>{if(P)return N.map(F=>{if(F.id===P){const R=[...F.children||[],S];return{...F,children:R}}return F});if((O==null?void 0:O.position)==="start")return[S,...N];if(typeof(O==null?void 0:O.position)=="number"){const F=[...N];return F.splice(O.position,0,S),F}return[...N,S]})},[e,r]),l=Xe((S,M)=>{S&&e(P=>{if(!Array.isArray(P))return console.warn("[useAppFunctions] removeItem: prev\u4E0D\u662F\u6570\u7EC4\uFF0C\u91CD\u7F6E\u4E3A\u7A7A\u6570\u7EC4"),[];if(M)return P.map(N=>{if(N.id===M&&N.children){const F=N.children.map(R=>R.id===S?{...R,removing:!0}:R);return{...N,children:F}}return N});const O=P.map(N=>N.id===S?{...N,removing:!0}:N);return console.log("[useAppFunctions] removeItem \u8BBE\u7F6Eremoving",S,O),O})},[e]),c=Xe((S,M)=>{e(P=>Array.isArray(P)?P.map(O=>{if(O.id===M&&O.children){const N=O.children.filter(F=>F.id!==S);if(N.length===0){const{children:F,...R}=O;return R}return{...O,children:N}}return O}):[])},[e]),u=Xe((S,M)=>{!S||S.length===0||e(P=>{if(!Array.isArray(P))return console.warn("[useAppFunctions] removeItems: prev\u4E0D\u662F\u6570\u7EC4\uFF0C\u91CD\u7F6E\u4E3A\u7A7A\u6570\u7EC4"),[];if(M)return P.map(N=>{if(N.id===M&&N.children){const F=N.children.map(R=>S.includes(R.id)?{...R,removing:!0}:R);return{...N,children:F}}return N});const O=P.map(N=>S.includes(N.id)?{...N,removing:!0}:N);return console.log("[useAppFunctions] removeItems \u8BBE\u7F6Eremoving",S,O),O})},[e]),d=Xe(S=>{e(M=>{const P=M.find(O=>O.id===S);return P?P.hasOwnProperty("children")?(console.error(`[addSubTable] \u884C ${S} \u5DF2\u7ECF\u6709\u5B50table\u529F\u80FD\uFF0C\u65E0\u9700\u91CD\u590D\u6DFB\u52A0`),M):M.map(O=>O.id===S?{...O,children:[]}:O):(console.error(`[addSubTable] \u672A\u627E\u5230ID\u4E3A ${S} \u7684\u884C`),M)})},[e]),m=Xe(S=>{e(M=>{const P=M.find(N=>N.id===S);if(!P)return console.error(`[deleteSubTable] \u672A\u627E\u5230ID\u4E3A ${S} \u7684\u884C`),M;if(!P.hasOwnProperty("children"))return console.error(`[deleteSubTable] \u884C ${S} \u6CA1\u6709\u5B50table\u529F\u80FD`),M;const O=(P.children||[]).filter(N=>!N.removing).length;return O>0?(console.error(`[deleteSubTable] \u884C ${S} \u7684\u5B50table\u8FD8\u6709 ${O} \u6761\u6570\u636E\uFF0C\u65E0\u6CD5\u5220\u9664\u5B50table\u529F\u80FD\u3002\u8BF7\u5148\u5220\u9664\u6240\u6709\u5B50table\u6570\u636E\u3002`),M):M.map(N=>{if(N.id===S&&N.hasOwnProperty("children")){const{children:F,...R}=N;return R}return N})})},[e]),g=Xe((S,M,P)=>{M&&e(O=>O.map(N=>P&&N.id===P&&N.children?{...N,children:N.children.map(F=>F.id===M&&typeof F=="object"?v(F,S):F)}:N.id===M&&typeof N=="object"?v(N,S):N))},[e]),v=Xe((S,M)=>{if(Array.isArray(M)){const P=[...S.data];return M.forEach(O=>{const N=P.findIndex(F=>F.columnId===O.columnId);N>=0?P[N]={...P[N],value:O.value}:P.push(O)}),{...S,data:P}}else if(typeof M=="object")return{...S,...M};return S},[]),f=Xe(S=>{if(!S)return;const M=document.querySelector(`[data-item-id="${S}"]`);M&&M.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})},[]),h=Xe((S,M)=>{e(M?P=>P.map(O=>{if(O.id!==M)return O;if(!O.hasOwnProperty("children"))return console.warn(`[useAppFunctions] \u884C ${M} \u6CA1\u6709children\u5B57\u6BB5\uFF0C\u8DF3\u8FC7\u66F4\u65B0`),O;const N=O.children||[],F=N.findIndex(R=>R.id===S.id);if(F>=0){const R=[...N];return R[F]=S,{...O,children:R}}else return{...O,children:[...N,S]}}):Array.isArray(S)?S:[])},[e]);Xe(S=>{e(M=>Array.isArray(M)?Array.isArray(S)?[...M,...S]:M:Array.isArray(S)?S:[])},[e]);const y=Xe(S=>{t(S)},[t]),x=Xe(S=>{e(M=>M.map(P=>P.id===S?{...P,tableLoading:!0}:P))},[e]),b=Xe(S=>{e(M=>M.map(P=>P.id===S?{...P,tableLoading:!1}:P))},[e]),E=Xe(S=>{n(S)},[n]),w=Xe(S=>i.has(S),[i]),k=Xe(S=>{r(S)},[r]),A=Xe(S=>{o(S)},[o]),C=Xe(S=>a.has(S),[a]);return{addItem:s,removeItem:l,removeItems:u,updateItem:g,scrollToItem:f,syncSourceData:h,addPending:y,removePending:E,isPending:w,addAdding:k,removeAdding:A,isAdding:C,tablePending:x,removeTablePending:b,addSubTable:d,deleteSubTable:m,removeSubTableRow:c}};/**
|
|
2
2
|
* @license lucide-react v0.456.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import{jsxs as i,jsx as e,Fragment as Me}from"react/jsx-runtime";import qe,{useState as _,forwardRef as He,useEffect as W,useMemo as ie,useImperativeHandle as Ve,useRef as ne}from"react";import{a as ge,a8 as ve,b as Ke,B as se,d as q,c as We,h as ke,i as O,F as de,a9 as _e,I as fe,S as Y,aa as Ze,ab as Ue,q as te,R as re,a6 as oe}from"./index-g-SUxfJH.js";import{X as Xe}from"./x-CnaaLGJF.js";import{P as Fe}from"./plus-V9zUoSq6.js";import{M as Ee,s as Be}from"./style-CGmZ5osp.js";import{S as Ge}from"./index-j0kQJd0a.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 Je=ge("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
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 De=ge("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
12
|
+
* @license lucide-react v0.456.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const Oe=ge("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
17
|
+
* @license lucide-react v0.456.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const Ye=ge("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),ye=({title:n,defaultExpanded:s=!0,className:a,children:u})=>{const[h,F]=_(s);return i("div",{className:a,children:[i("div",{className:"flex items-center justify-between",style:{marginBottom:"10px"},children:[i("div",{className:"flex items-center",children:[e("div",{style:{width:"3px",height:"12px",backgroundColor:"#4E6EF2",borderRadius:"6px",marginRight:"6px"}}),e("div",{className:"font-bold",children:n})]}),h?e(De,{onClick:()=>F(b=>!b),color:"#4E6EF2",size:18}):e(ve,{onClick:()=>F(b=>!b),color:"#4E5969",size:18})]}),u?e("div",{style:{display:h?"block":"none"},children:u}):null]})},ce=()=>i("div",{className:"w-full h-[80px] rounded-md flex flex-col justify-center items-center",children:[e("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg",children:i("g",{transform:"translate(0 1)",fill:"none","fill-rule":"evenodd",children:[e("ellipse",{fill:"#f5f5f5",cx:"32",cy:"33",rx:"32",ry:"7"}),i("g",{"fill-rule":"nonzero",stroke:"#d9d9d9",children:[e("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),e("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:"#fafafa"})]})]})}),e("div",{children:"\u6682\u65E0\u53EF\u7528\u6A21\u578B"})]}),Qe="\u63D0\u793A\u8BCD\u7528\u4E8E\u6307\u5B9A\u804A\u5929\u7684\u80CC\u666F\u548C\u4E0A\u4E0B\u6587\uFF0C\u6216\u8005\u8BA9\u52A9\u624B\u91C7\u53D6\u67D0\u4E2A\u4EBA\u683C\u6765\u56DE\u7B54\u4F60\u7684\u95EE\u9898\uFF1B",eu="\u5F00\u5173\u5F00\u542F\uFF0C\u5219\u82E5\u7CFB\u7EDF\u672A\u5728\u77E5\u8BC6\u5E93\u3001\u6570\u636E\u5E93\u7B49\u4F01\u4E1A\u77E5\u8BC6\u6570\u636E\u8303\u56F4\u5185\u68C0\u7D22\u5230\u7B54\u6848\uFF0C\u5219\u76F4\u63A5\u62D2\u7EDD\u56DE\u7B54\u76F8\u5173\u95EE\u9898\uFF1B",uu='\u4F60\u662F\u4E00\u4E2A\u667A\u80FD\u52A9\u624B\uFF0C\u8BF7\u603B\u7ED3\u77E5\u8BC6\u5E93\u7684\u5185\u5BB9\u6765\u56DE\u7B54\u95EE\u9898,\u8BF7\u5217\u4E3E\u77E5\u8BC6\u5E93\u4E2D\u7684\u6570\u636E\u8BE6\u7EC6\u56DE\u7B54\u3002\u5F53\u6240\u6709\u77E5\u8BC6\u5E93\u5185\u5BB9\u90FD\u4E0E\u95EE\u9898\u65E0\u5173\u65F6\uFF0C\u4F60\u7684\u56DE\u7B54\u5FC5\u987B\u5305\u62EC"\u77E5\u8BC6\u5E93\u4E2D\u672A\u627E\u5230\u60A8\u8981\u7684\u7B54\u6848!"',tu="\u60A8\u597D\uFF01\u6211\u6CE8\u610F\u5230\u60A8\u7684\u6D88\u606F\u4E2D\u53EF\u80FD\u5305\u542B\u4E86\u4E00\u4E9B\u654F\u611F\u7684\u5185\u5BB9\u3002\u4E3A\u4E86\u4FDD\u8BC1\u793E\u533A\u7684\u53CB\u597D\u6C1B\u56F4\uFF0C\u6211\u4EEC\u65E0\u6CD5\u7EE7\u7EED\u5C31\u6B64\u8BDD\u9898\u8FDB\u884C\u8BA8\u8BBA\u3002\u5982\u679C\u60A8\u6709\u5176\u4ED6\u95EE\u9898\u6216\u9700\u8981\u5E2E\u52A9\uFF0C\u6211\u5F88\u4E50\u610F\u7EE7\u7EED\u4E3A\u60A8\u670D\u52A1\uFF01\u8C22\u8C22\u60A8\u7684\u7406\u89E3\u548C\u652F\u6301\u3002",ue={top_k:{default:10,min:1,max:15,step:1,tooltip:"top_k\u4EE3\u8868\u6A21\u578B\u6700\u7EC8\u53D6\u4FE1\u7684\u6587\u672C\u5757\u6570\uFF0C\u4F8B\u5982\u95E8\u69DBtop_p = 0.8\uFF0Ctop_k = 3\uFF0C\u610F\u5473\u7740\u6A21\u578B\u4F1A\u4F9D\u636E\u76F8\u4F3C\u5EA6\u9AD8\u4F4E\u53D6\u524D3\u4E2A\u5927\u4E8E0.8\u7684\u6587\u672C\u5757\uFF0C\u5373\u4F7F\u5F53\u524D\u53EF\u80FD\u6709\u5927\u4E8E3\u4E2A\u6587\u672C\u5757\u7684\u76F8\u4F3C\u5EA6\u5927\u4E8E0.8\uFF1B"},max_tokens:{default:4096,min:0,max:1e4,step:64,tooltip:"max_tokens\u4EE3\u8868\u6A21\u578B\u7A97\u53E3\u5927\u5C0F\uFF0C\u5373\u4E00\u6B21\u95EE\u7B54\u5927\u6A21\u578B\u4E00\u6B21\u80FD\u591F\u63A5\u53D7\u7684\u5B57\u7B26\u4E32\u6700\u5927\u957F\u5EA6\uFF0C\u5305\u62EC\u7528\u6237\u7684\u63D0\u95EE\u548C\u6A21\u578B\u7684\u56DE\u7B54\uFF1B\u591A\u8F6E\u5BF9\u8BDD\u4E2D\u5386\u53F2\u5BF9\u8BDD\u5185\u5BB9\u4E5F\u5305\u62EC\u5728\u5185\uFF1B\u6700\u5927\u503C\u53D6\u51B3\u4E8E\u5927\u6A21\u578B\u672C\u8EAB\u662F\u5426\u652F\u6301\uFF1B"},max_round:{default:5,min:0,max:32,step:1,tooltip:"\u4EA4\u4E92\u5BF9\u8BDD\u573A\u666F\u91CC\uFF0C\u7CFB\u7EDF\u80FD\u591F\u8BB0\u5FC6\u5E76\u6709\u6548\u5173\u8054\u7684\u7528\u6237\u4E0E\u6A21\u578B\u4E4B\u95F4\u6765\u56DE\u4EA4\u6D41\u7684\u6700\u5927\u6B21\u6570\uFF1B"},temperature:{default:.3,min:.1,max:1,step:.1,tooltip:"\u6E29\u5EA6\u662F\u6A21\u578B\u56DE\u7B54\u7684\u503E\u5411\u6027\uFF0C\u53D6\u503C\u8303\u56F4\u4E00\u822C\u662F0\uFF5E1; \u53D6\u503C\u8D8B\u8FD10\u4EE3\u8868\u7740\u6A21\u578B\u56DE\u7B54\u4F1A\u66F4\u4E25\u8C28\uFF0C\u9002\u5408\u56DE\u7B54\u68C0\u7D22\u7C7B\u95EE\u9898; \u53D6\u503C\u8D8B\u8FD11\u5219\u4EE3\u8868\u56DE\u7B54\u66F4\u53D1\u6563\uFF0C\u9002\u5408\u56DE\u7B54\u521B\u65B0\u6027\u7684\u95EE\u9898\uFF1B"},top_p:{default:.8,min:.1,max:1,step:.1,tooltip:"top_p \u7528\u4E8E\u63A7\u5236\u5927\u6A21\u578B\u751F\u6210\u7B56\u7565\uFF0C\u51B3\u5B9A\u4E86\u6A21\u578B\u5728\u751F\u6210\u4E0B\u4E00\u4E2A\u8BCD\u65F6\uFF0C\u4ECE\u7D2F\u79EF\u6982\u7387\u8FBE\u5230 p \u7684\u6700\u5C0F\u8BCD\u96C6\u5408\u4E2D\u8FDB\u884C\u91C7\u6837\u3002\u901A\u5E38\u8BBE\u7F6E\u57280.8 - 0.95\u4E4B\u95F4\uFF0Ctop_p\u8D8A\u4F4E\u6A21\u578B\u7528\u8BCD\u8D8A\u4FDD\u5B88\uFF0C\u8D8A\u9AD8\u8D8A\u6D3B\u8DC3\u3002"},score_threshold:{default:.1,min:.1,max:1,step:.1,tooltip:"score_threshold\u53C2\u6570\u662F\u6A21\u578B\u8FDB\u884C\u91CD\u6392\u5E8F\u65F6\uFF0C\u5BF9\u4E8E\u6587\u672C\u5757\u53D6\u820D\u7684\u95E8\u69DB\u503C\uFF1B"}},nu={search_policy:1,enabled_rerank:!0,need_trace_source:!0,trace_by_llm:!0,is_download:!1,dependOnKb:0,enabled_faq:!1,enabled_graph:!1,enabled_question_rewrite:!1,isDefault:0},su=[{label:"\u6DF7\u5408\u68C0\u7D22",value:1},{label:"\u5168\u6587\u68C0\u7D22",value:2},{label:"\u8BED\u4E49\u68C0\u7D22",value:3}],ru=[{label:"\u89C4\u5219\u6EAF\u6E90",value:!1},{label:"\u5927\u6A21\u578B\u6EAF\u6E90",value:!0}],he=({url:n,token:s,role:a,eventsEmit:u})=>{const h=Ke.create({baseURL:n,timeout:1e6});return h.interceptors.request.use(l=>{let t=s;return!t&&!["user/login","user/kaptcha","user/regist"].some(d=>l.url.includes(d))?(u&&u("request:error_auth",{errorMsg:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F",redirect:"/login"}),Promise.reject(new Error("\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"))):(l.headers.Authorization=t||"",l.headers.userName=a==="\u672A\u767B\u5F55\u7528\u6237"?"":a,l)}),h.interceptors.response.use(l=>{const t=["user/kaptcha"],r=l.data;if(t.some(D=>l.config.url&&l.config.url.includes(D))||r.size&&r.type)return r;const{success:d,errorMsg:E,errorCode:m}=r;if(d)return r;u&&u("request:error_business",{errorCode:m,errorMsg:E||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",response:r})},l=>{var t,r,d,E,m,D,k,I,Z;if(l.message==="canceled")return Promise.reject(l);if(u){let g="request:error_network",A={errorMsg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:l};((t=l==null?void 0:l.response)==null?void 0:t.status)===401?(g="request:error_auth",A={errorMsg:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",error:l,redirect:"/login"}):(((d=(r=l==null?void 0:l.response)==null?void 0:r.data)==null?void 0:d.errorCode)==="30013"||((m=(E=l==null?void 0:l.response)==null?void 0:E.data)==null?void 0:m.errorCode)==="30023")&&(g="request:error_business",A={errorCode:(k=(D=l==null?void 0:l.response)==null?void 0:D.data)==null?void 0:k.errorCode,errorMsg:((Z=(I=l==null?void 0:l.response)==null?void 0:I.data)==null?void 0:Z.errorMsg)||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",error:l}),u(g,A)}return Promise.reject(l)}),{getConfigById:async l=>{try{const t=await h.get(`/qa/search/config/getById?configId=${l}`),{success:r,data:d}=t;return r?d:!1}catch(t){console.error("getConfigById",t)}},fetchDatabases:async()=>{try{const l=await h.get("/index/database/queryAllDBList"),{success:t,data:r}=l;return t?r:!1}catch(l){console.error("fetchDatabases",l)}},fetchModels:async l=>{try{const t=await h.get(`/index/modelInfo/allPage?${new URLSearchParams(l).toString()}`),{success:r,data:d}=t;return r?d:!1}catch(t){return console.log("fetchModels error",t),!1}},fetchSensitiveLibrary:async l=>{try{const t=await h.get(`/sensitive/library?${new URLSearchParams(l).toString()}`),{success:r,data:d}=t;return r?d:!1}catch(t){return console.log("fetchSensitiveLibrary error",t),!1}},fetchConfigItemLimit:async()=>{try{const l=await h.get("/qa/search/config/configItemLimit"),{success:t,data:r}=l;return t?r:!1}catch(l){console.error("fetchConfigItemLimit error",l)}},fetchKnowledgeBase:async l=>{try{const t=l?`?userName=${l}`:"";console.log("+++",t);const r=await h.get(`/index/knowledgeBase/searchList${t}`),{success:d,data:E}=r;return d?E:!1}catch(t){console.log("e",t)}},fetchGraphs:async()=>{try{const l=await h.get("/index/graph/platform/querySnapshotList?pageSize=999&pageNo=1"),{success:t,data:r}=l;return t?r:!1}catch(l){console.error("fetchGraphs",l)}},checkName:async(l,t)=>{try{const r=await h.get(`/qa/search/config/checkName?configName=${l}${t?`&configId=${t}`:""}`),{success:d,data:E}=r;if(d)return E}catch(r){return console.log("updateConversationAssistant error:",r),!1}},getBizLabelLabels:async l=>{try{const t=await h.post("/index/bizLabel/labels",l),{success:r,data:d}=t;if(r)return d}catch(t){return console.log("updateConversationAssistant error:",t),!1}},addConversationAssistant:async l=>{try{const t=await h.post("/qa/search/config/add",{...l}),{success:r,data:d}=t;if(r)return d}catch(t){return console.log("addConversationAssistant error:",t),!1}},updateConversationAssistant:async(l,t)=>{try{const r=await h.put("/qa/search/config/update",{id:l,...t}),{success:d,data:E}=r;if(d)return E}catch(r){return console.log("updateConversationAssistant error:",r),!1}}}},Ce=({countText:n,eventsEmit:s,data:a})=>{const[u,h]=_(!0);return i("div",{style:{marginTop:8},children:[n&&i("div",{className:"flex items-center gap-2",children:[e("span",{style:{color:u?"#4E6EF2":"#4E5969"},children:n}),u?e(De,{onClick:()=>h(F=>!F),color:"#4E6EF2",size:14}):e(ve,{onClick:()=>h(F=>!F),color:"#4E5969",size:14})]}),e("div",{style:{display:u?"block":"none"},children:a.map(F=>e(au,{item:F,eventsEmit:s},F.key))})]})},au=({item:n,eventsEmit:s})=>{var h,F,b;const[a,u]=_(!0);return i("div",{className:"flex items-center justify-between",style:{padding:"8px 12px",borderRadius:6},children:[i("div",{children:[i("div",{style:{color:"#1D2129"},className:"flex items-center",children:[n.label,((h=n==null?void 0:n.tags)==null?void 0:h.length)>0&&i(Me,{children:[i("span",{style:{color:"#4E5969",marginLeft:"6px",marginRight:6},children:["(",(F=n==null?void 0:n.tags)==null?void 0:F.length,"\u4E2A\u6807\u7B7E)"]}),a?e(De,{onClick:()=>u(p=>!p),color:"#4E6EF2",size:14}):e(ve,{onClick:()=>u(p=>!p),color:"#4E5969",size:14})]})]}),((b=n==null?void 0:n.tags)==null?void 0:b.length)>0&&e("div",{className:"flex flex-wrap gap-4",style:{display:a?"block":"none",marginTop:8},children:((n==null?void 0:n.tags)||[]).map(p=>e(se,{iconPosition:"end",type:"text",style:{backgroundColor:"#F0F0F0",padding:"2px 6px",height:22,borderRadius:2,color:"#1D2129",margin:5},icon:e(Xe,{size:14,color:"#86909C",onClick:()=>{const c={...n,tags:n.tags.filter(B=>B!==p)};s("removeTag",c)}}),children:p},p))})]}),e(se,{type:"text",icon:e(Oe,{size:14}),onClick:()=>s("removeItem",n)})]},n.key)},lu=q.div`
|
|
22
|
+
display: flex;
|
|
23
|
+
background-color: #ffffff;
|
|
24
|
+
border: 1px solid ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.border)==null?void 0:u.default)||"#e5e7eb"}};
|
|
25
|
+
border-radius: ${n=>{var s,a;return((a=(s=n.$theme)==null?void 0:s.space)==null?void 0:a.radius)||"8px"}};
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
width: ${n=>n.$width||"600px"};
|
|
28
|
+
height: ${n=>n.$height||"400px"};
|
|
29
|
+
position: relative;
|
|
30
|
+
`,Se=q.div`
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
border-right: 1px solid ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.border)==null?void 0:u.default)||"#e5e7eb"}};
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
|
|
36
|
+
&:last-child {
|
|
37
|
+
border-right: none;
|
|
38
|
+
}
|
|
39
|
+
`,ou=q.div`
|
|
40
|
+
padding: 12px 16px;
|
|
41
|
+
font-weight: 400;
|
|
42
|
+
font-size: 14px;
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: space-between;
|
|
46
|
+
color: ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.text)==null?void 0:u.primary)||"#4E5969"}};
|
|
47
|
+
`,cu=q.div`
|
|
48
|
+
font-weight: 400;
|
|
49
|
+
font-size: 14px;
|
|
50
|
+
color: ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.text)==null?void 0:u.primary)||"#4E6EF2"}};
|
|
51
|
+
`,iu=q.div`
|
|
52
|
+
padding: 12px;
|
|
53
|
+
background-color: ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.background)==null?void 0:u.default)||"#ffffff"}};
|
|
54
|
+
`,du=q.input`
|
|
55
|
+
width: 100%;
|
|
56
|
+
padding: 8px 12px 8px 12px;
|
|
57
|
+
border: 1px solid ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.border)==null?void 0:u.default)||"#e5e7eb"}};
|
|
58
|
+
border-radius: ${n=>{var s,a;return((a=(s=n.$theme)==null?void 0:s.space)==null?void 0:a.radius)||"6px"}};
|
|
59
|
+
font-size: 14px;
|
|
60
|
+
outline: none;
|
|
61
|
+
transition: all 0.2s;
|
|
62
|
+
|
|
63
|
+
&:focus {
|
|
64
|
+
border-color: ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.primary)==null?void 0:u.default)||"#3b82f6"}};
|
|
65
|
+
box-shadow: 0 0 0 3px ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.primary)==null?void 0:u.default)||"#3b82f6"}}20;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&::placeholder {
|
|
69
|
+
color: ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.text)==null?void 0:u.tertiary)||"#9ca3af"}};
|
|
70
|
+
}
|
|
71
|
+
`,hu=q.div`
|
|
72
|
+
position: absolute;
|
|
73
|
+
right: 20px;
|
|
74
|
+
top: 50%;
|
|
75
|
+
transform: translateY(-50%);
|
|
76
|
+
color: #9ca3af;
|
|
77
|
+
pointer-events: none;
|
|
78
|
+
`,Ne=q.div`
|
|
79
|
+
flex: 1;
|
|
80
|
+
overflow-y: auto;
|
|
81
|
+
overflow-x: hidden;
|
|
82
|
+
|
|
83
|
+
&::-webkit-scrollbar {
|
|
84
|
+
width: 6px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&::-webkit-scrollbar-track {
|
|
88
|
+
background: #f1f1f1;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&::-webkit-scrollbar-thumb {
|
|
92
|
+
background: #c1c1c1;
|
|
93
|
+
border-radius: 3px;
|
|
94
|
+
|
|
95
|
+
&:hover {
|
|
96
|
+
background: #a8a8a8;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
`,$e=q.div`
|
|
100
|
+
padding: 10px 16px;
|
|
101
|
+
cursor: ${n=>n.$disabled?"not-allowed":"pointer"};
|
|
102
|
+
transition: all 0.2s;
|
|
103
|
+
display: flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
justify-content: space-between;
|
|
106
|
+
opacity: ${n=>n.$disabled?.5:1};
|
|
107
|
+
|
|
108
|
+
&:hover {
|
|
109
|
+
background-color: ${n=>{var s,a,u;return n.$disabled?"transparent":((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.background)==null?void 0:u.hover)||"#f3f4f6"}};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&:last-child {
|
|
113
|
+
border-bottom: none;
|
|
114
|
+
}
|
|
115
|
+
`,Ie=q.span`
|
|
116
|
+
flex: 1;
|
|
117
|
+
font-size: 14px;
|
|
118
|
+
color: ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.text)==null?void 0:u.primary)||"#111827"}};
|
|
119
|
+
overflow: hidden;
|
|
120
|
+
text-overflow: ellipsis;
|
|
121
|
+
white-space: nowrap;
|
|
122
|
+
`,Le=q.button`
|
|
123
|
+
display: flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
justify-content: center;
|
|
126
|
+
width: 68px;
|
|
127
|
+
border: none;
|
|
128
|
+
background-color: #ebecf3;
|
|
129
|
+
border-radius: 4px;
|
|
130
|
+
cursor: pointer;
|
|
131
|
+
font-size: 12px;
|
|
132
|
+
color: ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.text)==null?void 0:u.secondary)||"#1D2129"}};
|
|
133
|
+
transition: all 0.2s;
|
|
134
|
+
|
|
135
|
+
&:disabled {
|
|
136
|
+
cursor: not-allowed;
|
|
137
|
+
color: ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.text)==null?void 0:u.secondary)||"#C9CDD4"}};
|
|
138
|
+
}
|
|
139
|
+
`,ze=q.div`
|
|
140
|
+
padding: 40px 20px;
|
|
141
|
+
text-align: center;
|
|
142
|
+
color: ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.text)==null?void 0:u.tertiary)||"#9ca3af"}};
|
|
143
|
+
font-size: 14px;
|
|
144
|
+
`;q.span`
|
|
145
|
+
display: inline-flex;
|
|
146
|
+
align-items: center;
|
|
147
|
+
justify-content: center;
|
|
148
|
+
min-width: 20px;
|
|
149
|
+
height: 20px;
|
|
150
|
+
padding: 0 6px;
|
|
151
|
+
background-color: ${n=>{var s,a,u;return((u=(a=(s=n.$theme)==null?void 0:s.colors)==null?void 0:a.primary)==null?void 0:u.default)||"#3b82f6"}};
|
|
152
|
+
color: white;
|
|
153
|
+
border-radius: 10px;
|
|
154
|
+
font-size: 12px;
|
|
155
|
+
font-weight: 500;
|
|
156
|
+
margin-left: 8px;
|
|
157
|
+
`;const me=He(({dataSource:n,value:s=[],onConfirm:a,maxCount:u=0,searchPlaceholder:h="\u641C\u7D22...",title:F="",showSearch:b=!0,filterOption:p,renderItem:c,renderSelectedItem:B,className:z,style:y,styles:f,height:R,width:x},j)=>{const l=We(),t=ke(ke({theme:O,mode:"light"},l),f),[r,d]=_(s),[E,m]=_("");W(()=>{d(s)},[s]),ie(()=>new Set(s.map(o=>o.key)),[s]);const D=ie(()=>new Set(r.map(o=>o.key)),[r]);Ve(j,()=>({getSelectedItems:()=>r,confirm:()=>{a==null||a(r)}}),[r,a]);const I=p||((o,v)=>{var H;if(!o)return!0;const w=o.toLowerCase();return v.label.toLowerCase().includes(w)||((H=v.tags)==null?void 0:H.some(V=>V.toLowerCase().includes(w)))||!1}),Z=ie(()=>(n||[]).filter(o=>I(E,o)),[n,E,I]),g=o=>{const v=D.has(o.key);let w;if(v)w=(r||[]).filter(H=>H.key!==o.key);else{if(u>0&&r.length>=u)return;w=[...r,o]}d(w)},A=(o,v)=>{d(w=>w.map(V=>V.key==o?{...V,tags:v}:V))},N=o=>{const v=(r||[]).filter(w=>w.key!==o.key);d(v)},$=o=>D.has(o);return u>0&&r.length>=u,i(lu,{$theme:t.theme||O,$width:x,$height:R,className:z,style:y,children:[i(Se,{$theme:t.theme||O,style:{flex:1},children:[b&&e(iu,{$theme:t.theme||O,children:i("div",{style:{position:"relative"},children:[e(hu,{children:e(Ye,{size:16})}),e(du,{$theme:t.theme||O,type:"text",placeholder:h,value:E,onChange:o=>m(o.target.value)})]})}),e(Ne,{children:Z.length===0?e(ze,{$theme:t.theme||O,children:E?"\u672A\u627E\u5230\u5339\u914D\u9879":"\u6682\u65E0\u6570\u636E"}):Z.map(o=>{const v=$(o.key);return i($e,{$theme:t.theme||O,$selected:v,children:[e(Ie,{$theme:t.theme||O,children:c?c(o):o.label}),v&&e(Le,{$theme:t.theme||O,onClick:w=>{w.stopPropagation(),N(o)},disabled:!0,children:"\u5DF2\u6DFB\u52A0"}),!v&&e(Le,{$theme:t.theme||O,onClick:w=>{w.stopPropagation(),g(o)},children:"\u6DFB\u52A0"})]},o.key)})})]}),i(Se,{$theme:t.theme||O,style:{flex:1},children:[i(ou,{$theme:t.theme||O,children:[u>0?`\u5DF2\u9009\uFF1A${r.length}/${u}\u4E2A${F}`:`\u5DF2\u9009\uFF1A${r.length}\u4E2A${F}`,e(cu,{$theme:t.theme||O,onClick:o=>{o.stopPropagation(),d([])},children:"\u6E05\u7A7A"})]}),e(Ne,{children:r.length===0?e(ze,{$theme:t.theme||O,children:"\u6682\u65E0\u5DF2\u9009\u9879"}):r.map(o=>{var w,H,V;const v=Q=>A(o.key,Q);return i($e,{$theme:t.theme||O,children:[e(Ie,{$theme:t.theme||O,children:B?B(o,v):o.label}),e(Oe,{size:14,color:((V=(H=(w=t.theme)==null?void 0:w.colors)==null?void 0:H.text)==null?void 0:V.secondary)||"#86909C",style:{cursor:"pointer"},onClick:Q=>{Q.stopPropagation(),N(o)}})]},o.key)})})]})]})});me.displayName="SearchableSelector";const be="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='20'%20height='20'%20rx='2.22222'%20fill='%23FFCC3C'/%3e%3cpath%20d='M13.3263%2012.7917H7.53763C7.33426%2012.8116%207.17923%2012.9825%207.17923%2013.1867C7.17923%2013.3909%207.33426%2013.5618%207.53763%2013.5817H13.3277C13.3828%2013.5871%2013.4384%2013.5809%2013.4909%2013.5634C13.5435%2013.546%2013.5918%2013.5178%2013.6328%2013.4806C13.6738%2013.4434%2013.7066%2013.3981%2013.729%2013.3474C13.7514%2013.2968%2013.763%2013.2421%2013.763%2013.1867C13.763%2013.1313%2013.7514%2013.0766%2013.729%2013.026C13.7066%2012.9753%2013.6738%2012.93%2013.6328%2012.8928C13.5918%2012.8556%2013.5435%2012.8274%2013.4909%2012.8099C13.4384%2012.7925%2013.3828%2012.7863%2013.3277%2012.7917H13.3263ZM9.19742%207.60418L8.84232%208.55193H9.57339L9.19742%207.60418Z'%20fill='white'/%3e%3cpath%20d='M15.3211%2014.7707V6.9692H14.4704V14.3543H6.70511C6.06668%2014.3392%205.55704%2013.8173%205.55704%2013.1788C5.55704%2012.5402%206.06668%2012.0184%206.70511%2012.0033H13.352C13.4644%2012.0075%2013.5735%2011.9648%2013.653%2011.8852C13.6923%2011.8459%2013.7231%2011.7988%2013.7434%2011.747C13.7638%2011.6952%2013.7731%2011.6398%2013.771%2011.5842V5.20102C13.7736%205.14526%2013.7646%205.08958%2013.7445%205.03752C13.7244%204.98546%2013.6936%204.93816%2013.6542%204.89865C13.6148%204.85915%2013.5675%204.82832%2013.5155%204.80812C13.4634%204.78792%2013.4077%204.7788%2013.352%204.78134H6.70511C5.60281%204.80136%204.71609%205.69369%204.70291%206.79599V13.1759C4.71609%2014.283%205.61038%2015.1773%206.71756%2015.1905H14.8893C15.0042%2015.1994%2015.1173%2015.1585%2015.1999%2015.0782C15.2407%2015.0385%2015.2727%2014.9905%2015.2936%2014.9375C15.3145%2014.8845%2015.3239%2014.8276%2015.3211%2014.7707ZM8.98782%206.78585H9.44888L10.7213%209.92562H10.2475L9.9075%209.06759H8.51871L8.19742%209.92562H7.72354L8.98782%206.78585Z'%20fill='white'/%3e%3c/svg%3e",{Item:mu}=de,pu=({url:n,token:s,role:a,eventsEmit:u,sectionData:h,defaultAnswer:F,form:b})=>{const[p,c]=_([]),[B,z]=_([]),[y,f]=_(!1),[R,x]=_(!1),j=ne(null),{fetchSensitiveLibrary:l}=he({url:n,token:s,role:a,eventsEmit:u});W(()=>{t()},[]),W(()=>{if(h&&(p==null?void 0:p.length)>0){let m=h?Array.isArray(h)?h:h.split(","):[],D=[];m.forEach(k=>{const I=(p||[]).find(Z=>Z.key===k);I&&D.push({key:I.key,label:I.label})}),z(D)}},[h,p]),W(()=>{F&&x(!0)},[F]);const t=async()=>{try{const m=await l({pageNo:1,pageSize:9999});if(m!=null&&m.records){const D=((m==null?void 0:m.records)||[]).map(k=>({key:k.id+"",label:k.name}));c(D)}}catch(m){console.error(m)}},r=(m,D)=>{switch(m){case"removeItem":const k=B.filter(I=>I.key!==D.key);z([...k]),d(k);break}},d=m=>{const D=m.map(k=>(k==null?void 0:k.key)||"").filter(k=>k).join(",");u&&u("sensitive_selected",D)},E=()=>{var D;const m=((D=j.current)==null?void 0:D.getSelectedItems())||[];z(m),f(!1),d(m)};return i("div",{style:{borderBottom:"1px solid #E5E6EB",padding:"12px 0 "},children:[i("div",{className:"flex items-center justify-between",children:[i("div",{className:"flex items-center",children:[e("img",{src:be}),e("span",{className:"font-medium ",style:{marginLeft:"10px"},children:"\u654F\u611F\u8BCD"})]}),e(se,{color:"primary",variant:"outlined",size:"small",icon:e(Fe,{size:14}),onClick:()=>f(!0),children:"\u6DFB\u52A0"})]}),e(_e,{checked:R,onChange:m=>{x(m.target.checked),m.target.checked?b.setFieldsValue({defaultAnswer:tu}):b.setFieldsValue({defaultAnswer:""})},style:{marginBottom:8,marginTop:8},children:"\u81EA\u5B9A\u4E49\u56DE\u590D"}),R&&e(mu,{label:"\u81EA\u5B9A\u4E49\u56DE\u590D\u5185\u5BB9",name:"defaultAnswer",layout:"vertical",children:e(fe.TextArea,{style:{height:"55px",resize:"none"}})}),(B==null?void 0:B.length)>0&&e(Ce,{countText:(B==null?void 0:B.length)>0?`\u5DF2\u9009\uFF1A${B==null?void 0:B.length}\u4E2A\u654F\u611F\u8BCD\u5E93`:void 0,eventsEmit:r,data:B}),e(Ee,{width:740,title:"\u9009\u62E9\u654F\u611F\u8BCD",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",open:y,onOk:E,onCancel:()=>f(!1),destroyOnHidden:!0,className:"assistant-config-resource-bind-modal",children:e(me,{ref:j,dataSource:p,value:B,searchPlaceholder:"\u641C\u7D22\u540D\u79F0...",width:"700px",height:"500px",title:"\u654F\u611F\u8BCD\u5E93",renderItem:m=>i("div",{className:"flex ",children:[e("img",{src:be,alt:"add"}),e("span",{style:{marginLeft:8,marginRight:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:m.label,children:m.label})]}),renderSelectedItem:(m,D)=>i("div",{className:"flex items-center",children:[e("img",{src:be,alt:"add"}),e("div",{style:{marginLeft:"12px"},children:e("div",{style:{fontWeight:500},children:m.label})})]})})})]})},Ae="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='20'%20height='20'%20rx='2.22222'%20fill='%2300B2F9'/%3e%3cpath%20d='M5.3125%2013.9672V13.975C5.32812%2014.6938%205.89922%2015.2734%206.61875%2015.2734H13.9062C14.3375%2015.2734%2014.6875%2014.9289%2014.6875%2014.4977V5.50703C14.6875%205.40447%2014.6673%205.30292%2014.628%205.20818C14.5887%205.11344%2014.5312%205.02736%2014.4586%204.95488C14.3861%204.8824%2014.2999%204.82492%2014.2052%204.78575C14.1104%204.74657%2014.0088%204.72646%2013.9062%204.72656H6.875C6.01172%204.72656%205.3125%205.42031%205.3125%206.28359V13.9672ZM7.5%209.24531V6.25C7.5%206.07813%207.64062%205.9375%207.8125%205.9375H9.6875C9.86016%205.9375%2010%206.07813%2010%206.25V9.24531C10%209.30716%209.98175%209.36762%209.94741%209.41906C9.91308%209.47049%209.86425%209.51058%209.80712%209.53426C9.74999%209.55793%209.68712%209.56412%209.62647%209.55204C9.56581%209.53996%209.51011%209.51016%209.46641%209.46641L8.97109%208.97109C8.94207%208.94204%208.90761%208.91899%208.86967%208.90326C8.83173%208.88754%208.79107%208.87944%208.75%208.87944C8.70893%208.87944%208.66827%208.88754%208.63033%208.90326C8.59239%208.91899%208.55793%208.94204%208.52891%208.97109L8.03359%209.46641C7.98989%209.51016%207.93418%209.53996%207.87353%209.55204C7.81288%209.56412%207.75001%209.55793%207.69288%209.53426C7.63575%209.51058%207.58692%209.47049%207.55259%209.41906C7.51825%209.36762%207.49995%209.30716%207.5%209.24531ZM6.54375%2014.2063C6.45208%2014.1156%206.40625%2014.0052%206.40625%2013.875C6.40625%2013.7458%206.45208%2013.6354%206.54375%2013.5438C6.6349%2013.4521%206.74531%2013.4062%206.875%2013.4062H13.5938V14.3438H6.875C6.74531%2014.3438%206.6349%2014.2979%206.54375%2014.2063Z'%20fill='white'/%3e%3c/svg%3e",fu=({url:n,token:s,role:a,sectionData:u,createBy:h,eventsEmit:F})=>{const[b,p]=_(),[c,B]=_([]),[z,y]=_(!1),f=ne(null),[R,x]=_(!1),[j,l]=_([]),t=ne(new Map).current,{fetchKnowledgeBase:r,getBizLabelLabels:d}=he({url:n,token:s,role:a,eventsEmit:F}),E=ne(!1);W(()=>{E.current||(h?(m(h),E.current=!0):(m(),E.current=!0))},[h]),W(()=>{if(u&&(b==null?void 0:b.length)>0){const g=u==null?void 0:u.knowledge_base_name_source,A=g&&(Array.isArray(g)?g:g.split(";"));let N=[];(A||[]).forEach($=>{const o=((u==null?void 0:u.selectedKnowledgeBase)||[]).find(w=>w.name==$),v=(b||[]).find(w=>w.knowledge_base_name_source===$);if(v){const{key:w,label:H,knowledge_base_name:V,knowledge_base_name_source:Q}=v;N.push({key:w,label:H,knowledge_base_name:V,knowledge_base_name_source:Q,tags:o==null?void 0:o.labels})}}),B(N)}},[u,b]);const m=async g=>{try{const A=await r(g);if(A){const N=(A||[]).map($=>({key:$.id,label:$.kbName,knowledge_base_name:$.primitiveName,knowledge_base_name_source:$.kbName}));p(N)}}catch(A){console.error(A)}},D=(g,A)=>{switch(g){case"removeItem":const N=c.filter(o=>o.key!==A.key);B([...N]),k(N);break;case"removeTag":const $=c.findIndex(o=>o.key==A.key);$!==-1&&(c[$]=A),B([...c]),k(c);break}},k=g=>{const A=(g||[]).map(o=>(o==null?void 0:o.knowledge_base_name)||"").filter(o=>o).join(";"),N=(g||[]).map(o=>(o==null?void 0:o.knowledge_base_name_source)||"").filter(o=>o).join(";"),$=(g||[]).filter(o=>{var v;return Array.isArray(o==null?void 0:o.tags)&&((v=o.tags)==null?void 0:v.length)>0}).map(o=>({id:o.key,name:o.label,knowledge_base_name_source:o.knowledge_base_name_source,labels:o.tags}));F&&F("knowledge_selected",{knowledge_base_name:A,knowledge_base_name_source:N,selectedKnowledgeBase:$})},I=()=>{var A;const g=((A=f.current)==null?void 0:A.getSelectedItems())||[];B(g),y(!1),k(g)},Z=async(g,A)=>{if(g){const N=t.get(A);if(N){l(N);return}if(!R)try{x(!0);const $=await d({kbNames:[A]});if(Array.isArray($)){const o=$.length?$[0].label:"",v=o?(o||"").split(",").map(w=>({label:w,value:w})):[];t.set(A,v),l(v)}x(!1)}catch($){console.error("Error fetching data:",$),x(!1)}}};return i("div",{style:{borderBottom:"1px solid #E5E6EB",padding:"12px 0 "},children:[i("div",{className:"flex items-center justify-between",children:[i("div",{className:"flex items-center",children:[e("img",{src:Ae}),e("span",{className:"font-medium ",style:{marginLeft:"10px"},children:"\u77E5\u8BC6\u5E93"})]}),e("div",{className:"flex items-center gap-2",children:e(se,{color:"primary",variant:"outlined",size:"small",icon:e(Fe,{size:14}),onClick:()=>y(!0),children:"\u6DFB\u52A0"})})]}),(c==null?void 0:c.length)>0&&e(Ce,{countText:(c==null?void 0:c.length)>0?`\u5DF2\u9009\uFF1A${c==null?void 0:c.length}\u4E2A\u77E5\u8BC6\u5E93`:void 0,eventsEmit:D,data:c}),e(Ee,{width:740,className:"assistant-config-resource-bind-modal",title:"\u9009\u62E9\u77E5\u8BC6\u5E93",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",open:z,onOk:I,onCancel:()=>y(!1),destroyOnHidden:!0,children:e(me,{ref:f,dataSource:b,value:c,searchPlaceholder:"\u641C\u7D22\u540D\u79F0...",width:"700px",height:"500px",title:"\u77E5\u8BC6\u5E93",renderItem:g=>i("div",{className:"flex ",children:[e("img",{src:Ae,alt:"add"}),e("span",{style:{marginLeft:8,marginRight:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:g.label,children:g.label})]}),renderSelectedItem:(g,A)=>i("div",{className:"flex ",children:[e("img",{src:Ae,alt:"add"}),i("div",{style:{marginLeft:"12px"},children:[e("div",{style:{marginBottom:"8px",fontWeight:500},children:g.label}),e(Y,{mode:"tags",placeholder:"\u9009\u62E9\u6807\u7B7E...",maxTagCount:1,value:g.tags||[],onChange:N=>{A(N)},style:{width:250},options:j,loading:R,onOpenChange:N=>{Z(N,g.knowledge_base_name)}})]})]})})})]})},gu=qe.memo(fu),we="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='24'%20height='24'%20rx='3.55556'%20fill='%23925BFF'/%3e%3cpath%20d='M11.9971%2011.265C15.249%2011.265%2017.8891%2010.443%2017.8891%209.423V7.95288C17.8891%206.93291%2015.2492%206.11084%2011.9971%206.11084C8.74513%206.11084%206.10504%206.93276%206.10504%207.95288V9.42285C6.10504%2010.437%208.73898%2011.265%2011.9971%2011.265Z'%20fill='white'/%3e%3cpath%20d='M11.9971%2014.577C15.249%2014.577%2017.8891%2013.7551%2017.8891%2012.7349V10.527C17.8891%2011.5469%2015.2492%2012.369%2011.9971%2012.369C8.74513%2012.369%206.10504%2011.5471%206.10504%2010.527V12.7349C6.10504%2013.749%208.73898%2014.577%2011.9971%2014.577Z'%20fill='white'/%3e%3cpath%20d='M11.9971%2015.681C8.7451%2015.681%206.11102%2014.859%206.11102%2013.839V16.0469C6.11102%2017.0609%208.74496%2017.889%2012.0031%2017.889C15.255%2017.889%2017.8951%2017.0671%2017.8951%2016.0469V13.8391C17.889%2014.859%2015.249%2015.681%2011.9971%2015.681Z'%20fill='white'/%3e%3c/svg%3e",Pe=10,Fu=({url:n,token:s,role:a,eventsEmit:u,sectionData:h,disabled:F})=>{const[b,p]=_([]),[c,B]=_([]),[z,y]=_(!1),f=ne(null),{fetchDatabases:R}=he({url:n,token:s,role:a,eventsEmit:u});W(()=>{x()},[]),W(()=>{if(h){let t=[];(h||[]).map(r=>{const d=(b||[]).find(E=>E.key===r.key);if(d){const{key:E,label:m}=d;t.push({key:E,label:m})}}),B(t)}},[h,b]);const x=async()=>{try{const t=await R();if(t){const r=(t||[]).map(d=>({key:d.primitiveName,label:d.name}));p(r)}}catch(t){console.error(t)}},j=(t,r)=>{switch(t){case"removeItem":const d=c.filter(E=>E.key!==r.key);B([...d]),u&&u("database_selected",d);break}},l=()=>{var r;const t=((r=f.current)==null?void 0:r.getSelectedItems())||[];B(t),y(!1),u&&u("database_selected",t)};return i("div",{style:{borderBottom:"1px solid #E5E6EB",padding:"12px 0 "},children:[i("div",{className:"flex items-center justify-between",children:[i("div",{className:"flex items-center",children:[e("img",{src:we}),e("span",{className:"font-medium ",style:{marginLeft:"10px"},children:"\u6570\u636E\u5E93"})]}),e("div",{className:"flex items-center gap-2",children:e(se,{color:"primary",variant:"outlined",size:"small",icon:e(Fe,{size:14}),onClick:()=>y(!0),disabled:c.length>=Pe||F,children:"\u6DFB\u52A0"})})]}),(c==null?void 0:c.length)>0&&e(Ce,{countText:(c==null?void 0:c.length)>0?`\u5DF2\u9009\uFF1A${c==null?void 0:c.length}\u4E2A\u6570\u636E\u5E93`:void 0,eventsEmit:j,data:c}),e(Ee,{width:740,title:"\u9009\u62E9\u6570\u636E\u5E93",className:"assistant-config-resource-bind-modal",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",open:z,onOk:l,onCancel:()=>y(!1),destroyOnHidden:!0,children:e(me,{ref:f,dataSource:b,value:c,searchPlaceholder:"\u641C\u7D22\u540D\u79F0...",width:"700px",height:"500px",title:"\u6570\u636E\u5E93",maxCount:Pe,renderItem:t=>i("div",{className:"flex ",children:[e("img",{src:we,alt:"add"}),e("span",{style:{marginLeft:8,marginRight:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:t.label,children:t.label})]}),renderSelectedItem:(t,r)=>i("div",{className:"flex items-center",children:[e("img",{src:we,alt:"add"}),e("div",{style:{marginLeft:"12px"},children:e("div",{style:{fontWeight:500},children:t.label})})]})})})]})},xe="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='24'%20height='24'%20rx='3.55556'%20fill='%2300C1B8'/%3e%3cpath%20d='M17.9887%2012.582C18.1207%2013.6621%2017.2267%2014.5801%2016.1526%2014.4901C15.3306%2014.4181%2014.6645%2013.7521%2014.6045%2012.924C14.5745%2012.558%2014.6645%2012.21%2014.8445%2011.9159C14.9285%2011.7779%2014.9045%2011.6039%2014.8025%2011.4899L14.3885%2011.0339C14.2805%2010.9139%2014.1005%2010.8839%2013.9565%2010.9559C13.6144%2011.1239%2013.2304%2011.2199%2012.8224%2011.2199C12.6244%2011.2199%2012.4324%2011.1959%2012.2464%2011.1539C12.0963%2011.1179%2011.9463%2011.1779%2011.8563%2011.3039L11.2803%2012.1259C11.1783%2012.276%2011.1963%2012.474%2011.3223%2012.606C11.8983%2013.188%2012.2464%2013.9921%2012.2284%2014.8741C12.1924%2016.4702%2010.9203%2017.7963%209.32417%2017.9043C7.45804%2018.0243%205.90994%2016.4942%206.00595%2014.6281C6.08995%2013.038%207.38604%2011.7599%208.97614%2011.6879C9.42017%2011.6699%209.8402%2011.7419%2010.2302%2011.8919C10.3922%2011.9519%2010.5722%2011.8979%2010.6743%2011.7599L11.1663%2011.0579C11.2743%2010.9019%2011.2503%2010.6919%2011.1123%2010.5658C10.5302%2010.0498%2010.1882%209.26976%2010.2662%208.4177C10.3742%207.18162%2011.3823%206.18556%2012.6244%206.09555C14.1245%205.98154%2015.3846%207.17562%2015.3846%208.65172C15.3846%209.20376%2015.2106%209.70779%2014.9105%2010.1278C14.8085%2010.2658%2014.8205%2010.4578%2014.9345%2010.5898L15.3786%2011.0819C15.4746%2011.1899%2015.6306%2011.2259%2015.7626%2011.1779C16.0086%2011.0939%2016.2786%2011.0639%2016.5606%2011.1119C17.3047%2011.2259%2017.8987%2011.8319%2017.9887%2012.582Z'%20fill='white'/%3e%3c/svg%3e",Eu=({url:n,token:s,role:a,eventsEmit:u,sectionData:h})=>{const[F,b]=_([]),[p,c]=_([]),[B,z]=_(!1),y=ne(null),{fetchGraphs:f}=he({url:n,token:s,role:a,eventsEmit:u});W(()=>{R()},[]),W(()=>{if(h){let t=[];(h||[]).map(r=>{const d=(F||[]).find(E=>E.key===r.index_name);if(d){const{key:E,label:m}=d;t.push({key:E,label:m})}}),c(t)}},[h,F]);const R=async()=>{try{const t=await f();if(t!=null&&t.dataList){const r=((t==null?void 0:t.dataList)||[]).map(d=>({key:d.schemaId,label:d.name}));b(r)}}catch(t){console.error(t)}},x=(t,r)=>{switch(t){case"removeItem":const d=p.filter(E=>E.key!==r.key);c([...d]),j(d);break}},j=t=>{const r=(t||[]).map(d=>({graph_name:d.label,index_name:d.key}));u&&u("graph_selected",r)},l=()=>{var r;const t=((r=y.current)==null?void 0:r.getSelectedItems())||[];c(t),z(!1),j(t)};return i("div",{style:{borderBottom:"1px solid #E5E6EB",padding:"12px 0 "},children:[i("div",{className:"flex items-center justify-between",children:[i("div",{className:"flex items-center",children:[e("img",{src:xe}),e("span",{className:"font-medium ",style:{marginLeft:"10px"},children:"\u56FE\u8C31\u5E93"})]}),e("div",{className:"flex items-center gap-2",children:e(se,{color:"primary",variant:"outlined",size:"small",icon:e(Fe,{size:14}),onClick:()=>z(!0),children:"\u6DFB\u52A0"})})]}),(p==null?void 0:p.length)>0&&e(Ce,{countText:(p==null?void 0:p.length)>0?`\u5DF2\u9009\uFF1A${p==null?void 0:p.length}\u4E2A\u56FE\u8C31`:void 0,eventsEmit:x,data:p}),e(Ee,{width:740,title:"\u9009\u62E9\u56FE\u8C31",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",className:"assistant-config-resource-bind-modal",open:B,onOk:l,destroyOnHidden:!0,onCancel:()=>z(!1),children:e(me,{ref:y,dataSource:F,value:p,searchPlaceholder:"\u641C\u7D22\u540D\u79F0...",width:"700px",height:"500px",title:"\u56FE\u8C31",renderItem:t=>i("div",{className:"flex ",children:[e("img",{src:xe,alt:"add"}),e("span",{style:{marginLeft:8,marginRight:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:t.label,children:t.label})]}),renderSelectedItem:t=>i("div",{className:"flex items-center",children:[e("img",{src:xe,alt:"add"}),e("div",{style:{marginLeft:"12px"},children:e("div",{style:{fontWeight:500},children:t.label})})]})})})]})},Cu=({value:n,onChange:s,min:a,max:u,step:h,disabled:F,sliderStyle:b,inputStyle:p,inputWidth:c=90})=>{const B=y=>{const f=Array.isArray(y)?y[0]:y;s==null||s(f)},z=y=>{s==null||s(y)};return i(Ge,{style:{width:"100%"},children:[e(Ze,{min:a,max:u,step:h,disabled:F,value:n,onChange:B,style:{width:"200px",flex:1,...b}}),e(Ue,{min:a,max:u,step:h,disabled:F,controls:!1,value:n,onChange:z,style:{width:c,...p}})]})},{Item:Bu}=de,ae=({label:n,name:s,configScale:a})=>{const u=ie(()=>a[s],[a]),h=(F,b)=>({validator(p,c){return c==null?Promise.reject("\u8BF7\u8F93\u5165\u6709\u6548\u6570\u5B57"):typeof+c!="number"||isNaN(+c)?Promise.reject("\u53EA\u80FD\u8F93\u5165\u6570\u5B57"):c<F||c>b?Promise.reject(`\u8BF7\u8F93\u5165${F}\u5230${b}\u4E4B\u95F4\u7684\u6570\u5B57`):Promise.resolve()}});return e(te,{span:12,children:e(Bu,{label:n,name:s,tooltip:u.tooltip,rules:[{required:!0,message:""},h(u.min,u.max)],children:e(Cu,{min:u.min,max:u.max,step:u.step})})})},{Item:M}=de,Du=({url:n,token:s,role:a,id:u,showDatabase:h,showGraph:F,isShare:b,disabled:p,eventsEmit:c,CustomComponents:B})=>{const{ContentLoading:z}=B,[y]=de.useForm(),[f,R]=_(),[x,j]=_(),[l,t]=_(),[r,d]=_(),[E,m]=_(!0),[D,k]=_(!1),[I,Z]=_(ue),g=ne({}),{getConfigById:A,fetchModels:N,fetchConfigItemLimit:$,checkName:o,addConversationAssistant:v,updateConversationAssistant:w}=he({url:n,token:s,role:a,eventsEmit:c});W(()=>{H()},[u]),W(()=>{u?(Array.isArray(x)&&Array.isArray(l)&&y.validateFields(["model_name","plan_model_name","recommend_model_name","rerank_model_name","multi_model_name"]),Array.isArray(r)&&y.validateFields(["multi_model_name"])):(Array.isArray(x)&&(x==null?void 0:x.length)==0&&y.validateFields(["model_name","plan_model_name","recommend_model_name"]),Array.isArray(l)&&(l==null?void 0:l.length)==0&&y.validateFields(["rerank_model_name"]),Array.isArray(r)&&(r==null?void 0:r.length)==0&&y.validateFields(["multi_model_name"]))},[l,x,r,u]);const H=async()=>{let C;if(u){E||m(!0);try{const S=await A(u);if(S){const{configJson:L,...X}=S,K=L&&JSON.parse(L),{knowledge_base_name:ee,knowledge_base_name_source:G,selectedKnowledgeBase:J,sensitiveWordIds:T,database_name:P,graph_nb_name:U}=K;C={...X,...K},g.current={knowledge_base_name:ee,knowledge_base_name_source:G,selectedKnowledgeBase:J,sensitiveWordIds:T,database_name:P,graph_nb_name:U},R(C),console.log("_configData--->",C),y.setFieldsValue(C),m(!1)}}catch{}}else m(!1);await V(C)},V=async C=>{var S,L,X;try{const[K,ee,G,J]=await Promise.allSettled([N({pageNum:1,pageSize:9999,status:1,type:1}),N({pageNum:1,pageSize:9999,status:1,type:3}),N({pageNum:1,pageSize:9999,status:1,type:4}),$()]);if(K.status==="fulfilled"&&K.value){const P=(((S=K.value)==null?void 0:S.records)||[]).map(U=>({...U,label:U.modelName,value:U.modelName}));j(P)}if(ee.status==="fulfilled"&&ee.value){const T=(((L=ee.value)==null?void 0:L.records)||[]).map(P=>({label:P.modelName||P.name,value:P.modelName||P.name}));t(T),T.length>0&&!(C!=null&&C.rerank_model_name)&&y.setFieldsValue({rerank_model_name:T[0].value})}if(G.status==="fulfilled"&&G.value){const T=(((X=G.value)==null?void 0:X.records)||[]).map(P=>({label:P.modelName||P.name,value:P.modelName||P.name}));d(T),T.length>0&&!(C!=null&&C.multi_model_name)&&y.setFieldsValue({multi_model_name:T[0].value})}if(J.status==="fulfilled"&&J.value&&J.value){const T=J.value;Object.keys(ue).forEach(P=>{if(T.hasOwnProperty(P)){const{max:U,min:je}=T[P];ue[P]={...ue[P],min:je,max:U}}}),Z(ue)}}catch(K){console.error("\u83B7\u53D6\u5217\u8868\u5931\u8D25:",K)}},Q=async(C,S)=>await o(S,u)?(Be.warning("\u540D\u79F0\u91CD\u590D\uFF01",2),Promise.reject("\u540D\u79F0\u91CD\u590D")):Promise.resolve(),le=(C,S)=>({validator(L,X){return X?Array.isArray(C)&&C.length===0||!C.find(K=>K.value==X)?Promise.reject("\u6A21\u578B\u65E0\u6CD5\u4F7F\u7528\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458"):Promise.resolve():Array.isArray(C)&&C.length===0?Promise.reject("\u6682\u65E0\u53EF\u7528\u6A21\u578B\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458"):Promise.reject(S)}}),pe=(C,S)=>{switch(console.log("++++\u52A9\u624B\u914D\u7F6E",C,S),C){case"knowledge_selected":g.current={...g.current,...S};break;case"sensitive_selected":g.current={...g.current,sensitiveWordIds:S};break;case"database_selected":g.current={...g.current,database_name:S};break;case"graph_selected":g.current={...g.current,graph_nb_name:S};break}},Te=async()=>{var S;let C={};try{k(!0);const L=await y.validateFields(),{knowledge_base_name:X,knowledge_base_name_source:K,selectedKnowledgeBase:ee,sensitiveWordIds:G,database_name:J,graph_nb_name:T}=g.current;L.thinking=((S=x.find(U=>U.modelName==L.model_name))==null?void 0:S.thinking)||!1,C={configJson:JSON.stringify({...L,knowledge_base_name:X,knowledge_base_name_source:K,selectedKnowledgeBase:ee,sensitiveWordIds:G,...h?{database_name:J}:{},...F?{graph_nb_name:T}:{}}),name:L.config_name,isDefault:L.isDefault,defaultAnswer:L.defaultAnswer,dependOnKb:L.dependOnKb,sensitiveWordIds:G},u?await w(u,C)&&(Be.success("\u66F4\u65B0\u52A9\u624B\u914D\u7F6E\u6210\u529F"),c&&c("go_back")):await v(C)&&(Be.success("\u65B0\u589E\u52A9\u624B\u914D\u7F6E\u6210\u529F"),c&&c("go_back"))}catch(L){console.error("submit error",L)}finally{k(!1)}},Re=ie(()=>{const C={};return Object.keys(ue).forEach(S=>{var L;C[S]=(L=ue[S])==null?void 0:L.default}),{...nu,...C}},[]);return i("div",{style:{height:"100%",width:"100%"},children:[i("div",{className:"flex items-center justify-between",style:{width:"100%",padding:"4px 10px 16px 10px"},children:[i("div",{className:"flex items-center",children:[e(Je,{color:"#2468F2",onClick:()=>c&&c("go_back")}),e("div",{className:"text-[16px] text-[#1D2129] bold",style:{marginLeft:20},children:u?"\u7F16\u8F91\u4F1A\u8BDD\u52A9\u624B":"\u65B0\u5EFA\u4F1A\u8BDD\u52A9\u624B"})]}),!E&&e(se,{type:"primary",onClick:()=>Te(),loading:D,disabled:p,children:"\u786E\u5B9A"})]}),E?z&&e(z,{}):e(de,{style:{padding:20,height:"calc(100vh - 150px)",backgroundColor:"#fff"},form:y,layout:"vertical",initialValues:Re,disabled:p,colon:!1,children:i(re,{gutter:24,style:{height:"100%"},children:[i(te,{span:12,style:{borderRight:"1px solid #E5E6EB",padding:"10px 32px",height:"100%",overflowY:"auto"},children:[e(M,{label:"\u52A9\u624B\u540D\u79F0",name:"config_name",validateTrigger:"onBlur",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u52A9\u624B\u540D\u79F0"},{validator:Q}],children:e(fe,{placeholder:"\u8BF7\u8F93\u5165"})}),i(re,{gutter:16,children:[e(te,{span:12,children:e(M,{label:"\u95EE\u7B54\u6A21\u578B",name:"model_name",rules:[{required:!0,message:""},le(x,"\u8BF7\u9009\u62E9\u95EE\u7B54\u6A21\u578B")],children:e(Y,{placeholder:"\u8BF7\u9009\u62E9",options:x,notFoundContent:e(ce,{})})})}),e(te,{span:12,children:e(M,{label:"\u89C4\u5212\u6A21\u578B",name:"plan_model_name",rules:[{required:!0,message:""},le(x,"\u8BF7\u9009\u62E9\u89C4\u5212\u6A21\u578B")],children:e(Y,{placeholder:"\u8BF7\u9009\u62E9",options:x,notFoundContent:e(ce,{})})})})]}),i(re,{gutter:16,children:[e(te,{span:12,children:e(M,{label:"\u4E0A\u4F20\u6587\u6863\u95EE\u7B54\u591A\u6A21\u6001\u6A21\u578B",name:"multi_model_name",rules:[{required:!0,message:""},le(r,"\u8BF7\u9009\u62E9\u4E0A\u4F20\u6587\u6863\u95EE\u7B54\u591A\u6A21\u6001\u6A21\u578B\u6A21\u578B")],children:e(Y,{placeholder:"\u8BF7\u9009\u62E9",options:r,notFoundContent:e(ce,{})})})}),e(te,{span:12,children:e(M,{label:"Rerank\u6A21\u578B",name:"rerank_model_name",rules:[{required:!0,message:""},le(l,"\u8BF7\u9009\u62E9Rerank\u6A21\u578B")],children:e(Y,{placeholder:"\u8BF7\u9009\u62E9",options:l,notFoundContent:e(ce,{})})})})]}),e(M,{label:"\u5F00\u573A\u767D",name:"prologue",children:e(fe.TextArea,{maxLength:50,showCount:!0,placeholder:"\u8BF7\u8F93\u5165\u5F00\u573A\u767D",autoSize:{minRows:2}})}),e(M,{label:"\u63D0\u793A\u8BCD",name:"system_prompt",tooltip:Qe,children:e(fe.TextArea,{showCount:!0,rows:8,maxLength:3e3,autoSize:{minRows:10},placeholder:`\u4F8B\u5982\uFF1A${uu}`})}),e(M,{name:"isDefault",valuePropName:"checked",normalize:C=>C===!0?1:0,children:e(_e,{children:"\u9009\u62E9\u4E3A\u9ED8\u8BA4\u52A9\u624B"})})]}),i(te,{span:12,style:{height:"100%",padding:"10px 32px",overflowY:"auto"},children:[i(ye,{title:"\u68C0\u7D22\u4E0E\u751F\u6210\u53C2\u6570",children:[e(M,{label:"\u95EE\u9898\u63A8\u8350\u6A21\u578B",name:"recommend_model_name",rules:[{required:!0,message:""},le(x,"\u8BF7\u9009\u62E9\u95EE\u9898\u63A8\u8350\u6A21\u578B")],children:e(Y,{placeholder:"\u8BF7\u9009\u62E9",options:x,notFoundContent:e(ce,{})})}),e(M,{label:"\u68C0\u7D22\u7B56\u7565",name:"search_policy",children:e(Y,{options:su,placeholder:"\u8BF7\u9009\u62E9"})}),i(re,{gutter:16,children:[e(ae,{label:"\u6E29\u5EA6",name:"temperature",configScale:I}),e(ae,{label:"\u591A\u6837\u6027",name:"top_p",configScale:I})]}),i(re,{gutter:16,children:[e(ae,{label:"\u53EC\u56DE\u6570",name:"top_k",configScale:I}),e(ae,{label:"\u76F8\u4F3C\u5EA6\u9608\u503C",name:"score_threshold",configScale:I})]}),i(re,{gutter:16,children:[e(ae,{label:"\u6700\u5927\u4EE4\u724C\u6570",name:"max_tokens",configScale:I}),e(ae,{label:"\u4E0A\u4E0B\u6587\u6700\u5927\u8F6E\u6570",name:"max_round",configScale:I})]})]}),i(ye,{title:"\u529F\u80FD\u5F00\u5173",children:[e(M,{label:"\u5F00\u542FFAQ\u4F18\u5148",name:"enabled_faq",valuePropName:"checked",layout:"horizontal",children:e(oe,{})}),e(M,{label:"\u542F\u7528\u56FE\u8C31\u589E\u5F3A",name:"enabled_graph",valuePropName:"checked",layout:"horizontal",children:e(oe,{})}),e(M,{label:"\u5F00\u542F\u5F3A\u4F01\u4E1A\u77E5\u8BC6\u4F9D\u8D56",name:"dependOnKb",valuePropName:"checked",layout:"horizontal",tooltip:eu,normalize:C=>C===!0?1:0,children:e(oe,{})}),e(M,{label:"\u5F00\u542F\u95EE\u9898\u6539\u5199",name:"enabled_question_rewrite",valuePropName:"checked",layout:"horizontal",children:e(oe,{})}),e(M,{label:"\u5F00\u542F\u6EAF\u6E90",name:"need_trace_source",valuePropName:"checked",layout:"horizontal",children:e(oe,{})}),e(M,{noStyle:!0,shouldUpdate:(C,S)=>C.need_trace_source!==S.need_trace_source,children:({getFieldValue:C})=>C("need_trace_source")?i(Me,{children:[e(M,{label:"\u6EAF\u6E90\u7B56\u7565",name:"trace_by_llm",layout:"horizontal",children:e(Y,{placeholder:"\u8BF7\u9009\u62E9",options:ru})}),e(M,{name:"is_download",valuePropName:"checked",layout:"horizontal",children:e(_e,{children:"\u5141\u8BB8\u4E0B\u8F7D\u6EAF\u6E90\u6587\u4EF6"})})]}):null})]}),i(ye,{title:"\u8D44\u6E90\u7ED1\u5B9A",children:[e(pu,{url:n,token:s,role:a,sectionData:f==null?void 0:f.sensitiveWordIds,eventsEmit:pe,defaultAnswer:f==null?void 0:f.defaultAnswer,form:y}),e(gu,{url:n,token:s,role:a,sectionData:{knowledge_base_name:f==null?void 0:f.knowledge_base_name,knowledge_base_name_source:f==null?void 0:f.knowledge_base_name_source,selectedKnowledgeBase:f==null?void 0:f.selectedKnowledgeBase},createBy:b?f==null?void 0:f.createBy:void 0,eventsEmit:pe}),h&&e(Fu,{url:n,token:s,role:a,disabled:p,sectionData:f==null?void 0:f.database_name,eventsEmit:pe}),F&&e(Eu,{url:n,token:s,role:a,sectionData:f==null?void 0:f.graph_nb_name,eventsEmit:pe})]})]})]})})]})};export{Du as C,Ye as S};
|