@gientech/modual 2.2.37 → 2.2.39
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/assets/AntdIcon-BRbA9Wz8.js +64 -0
- package/assets/client-BNiIqwJU.js +1 -0
- package/assets/i18n-BMTusWgX.js +1 -0
- package/assets/i18n-Bx_oVLZ8.js +1 -0
- package/assets/i18n-CI8qtN-y.js +1 -0
- package/assets/i18n-hDWZB2OY.js +1 -0
- package/assets/index-Ck0T7V1d.js +203 -0
- package/assets/style6.css +1 -1
- package/assets/style7.css +1 -1
- package/assets/style8.css +1 -1
- package/assets/style9.css +1 -0
- package/assistantConfig.js +157 -1
- package/chat.js +256 -1
- package/chatCompare.js +333 -1
- package/databaseId.js +4 -4
- package/index.js +1 -1
- package/modelManage.js +2 -2
- package/oprecords.js +282 -1
- package/package.json +1 -1
- package/sensitive.js +30 -30
- package/sensitiveWords.js +1 -1
- package/streamFilesReader.js +1 -1
- package/assets/client-ssOiFoWz.js +0 -1
- package/assets/index-BrQsYGxa.js +0 -535
- package/assets/index-CVBBj_Pf.js +0 -157
- package/assets/index-DpW3BaUc.js +0 -344
- package/assets/style-CL0GZLiJ.js +0 -269
- /package/assets/{GientechStreamReader-_ih9ja1B.js → index-_ih9ja1B.js} +0 -0
package/package.json
CHANGED
package/sensitive.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as w,jsx as s,Fragment as we}from"react/jsx-runtime";import{useState as $,useRef as he,useEffect as be,useCallback as I,useMemo as ee}from"react";import F from"styled-components";import{message as b,Input as ce,Modal as de,Dropdown as Fe,Upload as ke,Form as le}from"antd";import{Xviwer as Ce}from"@mxmweb/xviewer";import{defaultTheme as ue,Button as P,useTheme as Se,deepMergeTheme as ge,DashboardContainer as _e}from"@mxmweb/zui";import Ie from"axios";import{u as te,i as J,S as $e}from"./assets/i18n-BMTusWgX.js";import{a as yt,g as vt}from"./assets/i18n-BMTusWgX.js";import{C as Le}from"./assets/circle-plus-RlDPoPkb.js";import{c as xe}from"./assets/createLucideIcon-Bj5DlX2s.js";import{S as ye}from"./assets/search-CEuIa9-_.js";import{X as De}from"./assets/x-CdZQbi--.js";import{P as ve}from"./assets/plus-B679mjyt.js";/* empty css *//**
|
|
2
2
|
* @license lucide-react v0.456.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const Ae=xe("FileUp",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);/**
|
|
7
7
|
* @license lucide-react v0.456.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const he=De("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),$e=["10014"],Me=({url:e,token:i,role:F,getMessage:f})=>{const c=(t,o)=>f?f(t):o,r=_e.create({baseURL:e,timeout:1e6});return r.interceptors.request.use(t=>{let o=i;if(!o&&!["user/login","user/kaptcha","user/regist"].some(p=>t.url.includes(p))){window.location.pathname="/login";return}return t.headers.Authorization=o||"",t.headers.userName=F==="\u672A\u767B\u5F55\u7528\u6237"?"":F,t}),r.interceptors.response.use(t=>{const o=["user/kaptcha"],l=t.data;if(o.some(g=>t.config.url&&t.config.url.includes(g))||l.size&&l.type)return l;const{success:p,errorMsg:E,errorCode:M}=l;return $e.includes(M)||p?l:(b.error(E||c("server.requestError","\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5")),!1)},t=>{var o,l,p,E,M,g,y,N,R,q;t.message!=="canceled"&&((((l=(o=t==null?void 0:t.response)==null?void 0:o.data)==null?void 0:l.errorCode)==="30013"||((E=(p=t==null?void 0:t.response)==null?void 0:p.data)==null?void 0:E.errorCode)==="30023")&&b.error((((M=t==null?void 0:t.response)==null?void 0:M.data)||{}).errorMsg||c("server.requestError","\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5")),((g=t==null?void 0:t.response)==null?void 0:g.status)===401&&(console.log("Error url:",(y=t==null?void 0:t.request)==null?void 0:y.responseURL),b.error((((N=t==null?void 0:t.response)==null?void 0:N.data)||{}).errorMsg||c("server.noPermission","\u6CA1\u6709\u8DB3\u591F\u6743\u9650"))),console.log("Error occurs",t),(((R=t==null?void 0:t.response)==null?void 0:R.data)||{}).errorMsg!="\u672A\u8BBE\u7F6E\u9ED8\u8BA4\u914D\u7F6E\uFF01"&&b.error((((q=t==null?void 0:t.response)==null?void 0:q.data)||{}).errorMsg||c("server.requestError","\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5")))}),{getLibraryList:async t=>{try{const o=await r.get(`/sensitive/library?${new URLSearchParams(t).toString()}`),{success:l,data:p}=o;return l?p:!1}catch(o){return console.log("e",o),!1}},createLibrary:async t=>{try{const o=await r.post("/sensitive/library",t),{success:l,data:p}=o;return l?p:!1}catch(o){return console.log("e",o),!1}},deleteLibrary:async t=>{try{const o=await r.delete(`/sensitive/library/${t}`),{success:l,data:p}=o;return l?p:!1}catch(o){return console.log("e",o),!1}},updateLibrary:async(t,o)=>{try{const l=await r.put(`/sensitive/library/${t}`,o),{success:p,data:E}=l;return p?E:!1}catch(l){return console.log("e",l),!1}},downloadTemplate:async t=>{try{const o=await r.get("/sensitive/word/downloadTemplate",{params:{fileType:t},responseType:"blob"});return o&&typeof o.size=="number"?o:!1}catch(o){return console.log("e",o),!1}},importWords:async(t,o)=>{try{const l=new FormData;l.append("file",o);const p=await r.put(`/sensitive/word/${t}/import`,l);return p&&p.success!==!1?p:!1}catch(l){return console.log("e",l),!1}},getWords:async t=>{try{const o=await r.get(`/sensitive/library/${t}`),{success:l,data:p}=o;return l?p:!1}catch(o){return console.log("e",o),!1}},getLibraryData:async t=>{try{const o=await r.get(`/sensitive/library/${t}`),{success:l,data:p}=o;return l?p:!1}catch(o){return console.log("e",o),!1}}}},te={toolbar:{searchPlaceholder:"\u8BF7\u8F93\u5165\u5185\u5BB9"},tagCell:{viewAllTitle:"\u5171 {{total}} \u4E2A\uFF0C\u5F53\u524D\u4EC5\u5C55\u793A\u524D {{max}} \u4E2A",viewAllLink:"\u2026\u67E5\u770B\u5168\u90E8\uFF08+{{count}}\uFF09"},table:{label:"\u654F\u611F\u8BCD\u914D\u7F6E",viewLabel:"\u654F\u611F\u8BCD\u5E93\u5217\u8868",columns:{name:"\u540D\u79F0",sensitiveWords:"\u654F\u611F\u8BCD",createDate:"\u521B\u5EFA\u65E5\u671F",count:"\u6570\u91CF",actions:"\u64CD\u4F5C"},toolbar:{create:"\u65B0\u5EFA\u654F\u611F\u8BCD\u5E93",searchPlaceholder:"\u8BF7\u8F93\u5165\u5185\u5BB9"},actionEdit:"\u7F16\u8F91",actionDelete:"\u5220\u9664"},dashboard:{title:"\u654F\u611F\u8BCD\u5E93\u7BA1\u7406"},deleteConfirm:{title:"\u786E\u8BA4\u5220\u9664\u654F\u611F\u8BCD\u5E93\uFF1F",content:"\u5220\u9664\u540E\uFF0C\u8BE5\u654F\u611F\u8BCD\u5E93\u5C06\u65E0\u6CD5\u6062\u590D",okText:"\u5220\u9664",cancelText:"\u53D6\u6D88"},createModal:{title:"\u65B0\u5EFA\u654F\u611F\u8BCD\u5E93",cancel:"\u53D6\u6D88",confirm:"\u786E\u8BA4",nameRequired:"\u8BF7\u8F93\u5165\u654F\u611F\u8BCD\u5E93\u540D\u79F0!",namePlaceholder:"\u8BF7\u8F93\u5165"},message:{saveSuccess:"\u4FDD\u5B58\u6210\u529F",createSuccess:"\u65B0\u589E\u654F\u611F\u8BCD\u6210\u529F!",deleteSuccess:"\u5220\u9664\u6210\u529F",downloadTemplateFail:"\u6A21\u677F\u4E0B\u8F7D\u5931\u8D25",importSuccess:"\u5BFC\u5165\u6210\u529F",importFail:"\u5BFC\u5165\u5931\u8D25"},downloadTemplateFilename:"\u654F\u611F\u8BCD\u6A21\u677F",editor:{maxLengthHint:"\u654F\u611F\u8BCD\u6700\u591A\u53EF\u8F93\u5165{{max}}\u4E2A\u5B57\u7B26",maxLengthWarning:"\u654F\u611F\u8BCD\u6700\u591A\u53EF\u8F93\u5165{{max}}\u4E2A\u5B57\u7B26",duplicateWarning:"\u5DF2\u5B58\u5728\u76F8\u540C\u654F\u611F\u8BCD",configTemplateHint:"\u8BF7\u914D\u7F6E\u6A21\u677F\u4E0B\u8F7D\u5730\u5740",selectFileWarning:"\u8BF7\u5148\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6",importFailRetry:"\u5BFC\u5165\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5",importCountSuccess:"\u5DF2\u5BFC\u5165 {{count}} \u4E2A\u654F\u611F\u8BCD",parseFail:"\u6587\u4EF6\u89E3\u6790\u5931\u8D25\uFF0C\u8BF7\u786E\u4FDD\u4E3A csv \u6216 txt \u683C\u5F0F",readFileFail:"\u6587\u4EF6\u8BFB\u53D6\u5931\u8D25",searchPlaceholder:"\u8BF7\u8F93\u5165\u654F\u611F\u8BCD\u641C\u7D22",inputPlaceholder:"\u8BF7\u8F93\u5165",add:"\u6DFB\u52A0",import:"\u5BFC\u5165",cancel:"\u53D6\u6D88",save:"\u4FDD\u5B58",confirm:"\u786E\u8BA4",downloadTemplate:"\u4E0B\u8F7D\u6A21\u677F",uploadModalTitle:"\u4E0A\u4F20\u6587\u4EF6",uploadModalHint:"\u5148\u4E0B\u8F7D\u6A21\u677F\u540E\u4E0A\u4F20",uploadDragText:"\u70B9\u51FB\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u5904\u4E0A\u4F20",uploadDragHint:"\u652F\u6301\u5355\u6B21\u4E0A\u4F20\uFF0C\u652F\u6301 csv\u3001txt \u683C\u5F0F\u3002",formatCsv:"csv",formatTxt:"txt"},server:{requestError:"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",noPermission:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650"}},Pe={toolbar:{searchPlaceholder:"Enter keyword"},tagCell:{viewAllTitle:"{{total}} total, showing first {{max}}",viewAllLink:"\u2026View all (+{{count}})"},table:{label:"Sensitive words",viewLabel:"Sensitive word libraries",columns:{name:"Name",sensitiveWords:"Sensitive words",createDate:"Created",count:"Count",actions:"Actions"},toolbar:{create:"New library",searchPlaceholder:"Enter keyword"},actionEdit:"Edit",actionDelete:"Delete"},dashboard:{title:"Sensitive word libraries"},deleteConfirm:{title:"Delete this library?",content:"This library cannot be recovered after deletion.",okText:"Delete",cancelText:"Cancel"},createModal:{title:"New sensitive word library",cancel:"Cancel",confirm:"Confirm",nameRequired:"Please enter the library name.",namePlaceholder:"Enter name"},message:{saveSuccess:"Saved",createSuccess:"Library created.",deleteSuccess:"Deleted",downloadTemplateFail:"Template download failed",importSuccess:"Import succeeded",importFail:"Import failed"},downloadTemplateFilename:"sensitive-words-template",editor:{maxLengthHint:"Max {{max}} characters per word",maxLengthWarning:"Max {{max}} characters per word",duplicateWarning:"Duplicate word",configTemplateHint:"Please configure template download URL",selectFileWarning:"Please select a file first",importFailRetry:"Import failed, please retry",importCountSuccess:"Imported {{count}} words",parseFail:"Parse failed. Use csv or txt format.",readFileFail:"File read failed",searchPlaceholder:"Search sensitive words",inputPlaceholder:"Enter",add:"Add",import:"Import",cancel:"Cancel",save:"Save",confirm:"Confirm",downloadTemplate:"Download template",uploadModalTitle:"Upload file",uploadModalHint:"Download template first, then upload",uploadDragText:"Click or drag file here to upload",uploadDragHint:"Single file. csv or txt.",formatCsv:"csv",formatTxt:"txt"},server:{requestError:"Request failed, please try again.",noPermission:"Insufficient permission"}},ze={toolbar:{searchPlaceholder:"\u30AD\u30FC\u30EF\u30FC\u30C9\u3092\u5165\u529B"},tagCell:{viewAllTitle:"\u5168{{total}}\u4EF6\u3001\u5148\u982D{{max}}\u4EF6\u3092\u8868\u793A",viewAllLink:"\u2026\u3059\u3079\u3066\u8868\u793A\uFF08+{{count}}\uFF09"},table:{label:"\u30BB\u30F3\u30B7\u30C6\u30A3\u30D6\u30EF\u30FC\u30C9",viewLabel:"\u30BB\u30F3\u30B7\u30C6\u30A3\u30D6\u30EF\u30FC\u30C9\u30E9\u30A4\u30D6\u30E9\u30EA",columns:{name:"\u540D\u524D",sensitiveWords:"\u30BB\u30F3\u30B7\u30C6\u30A3\u30D6\u30EF\u30FC\u30C9",createDate:"\u4F5C\u6210\u65E5",count:"\u4EF6\u6570",actions:"\u64CD\u4F5C"},toolbar:{create:"\u65B0\u898F\u30E9\u30A4\u30D6\u30E9\u30EA",searchPlaceholder:"\u30AD\u30FC\u30EF\u30FC\u30C9\u3092\u5165\u529B"},actionEdit:"\u7DE8\u96C6",actionDelete:"\u524A\u9664"},dashboard:{title:"\u30BB\u30F3\u30B7\u30C6\u30A3\u30D6\u30EF\u30FC\u30C9\u7BA1\u7406"},deleteConfirm:{title:"\u3053\u306E\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F",content:"\u524A\u9664\u3059\u308B\u3068\u5FA9\u5143\u3067\u304D\u307E\u305B\u3093\u3002",okText:"\u524A\u9664",cancelText:"\u30AD\u30E3\u30F3\u30BB\u30EB"},createModal:{title:"\u65B0\u898F\u30BB\u30F3\u30B7\u30C6\u30A3\u30D6\u30EF\u30FC\u30C9\u30E9\u30A4\u30D6\u30E9\u30EA",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",confirm:"\u78BA\u8A8D",nameRequired:"\u30E9\u30A4\u30D6\u30E9\u30EA\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",namePlaceholder:"\u5165\u529B"},message:{saveSuccess:"\u4FDD\u5B58\u3057\u307E\u3057\u305F",createSuccess:"\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u4F5C\u6210\u3057\u307E\u3057\u305F\u3002",deleteSuccess:"\u524A\u9664\u3057\u307E\u3057\u305F",downloadTemplateFail:"\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306E\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F",importSuccess:"\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u307E\u3057\u305F",importFail:"\u30A4\u30F3\u30DD\u30FC\u30C8\u306B\u5931\u6557\u3057\u307E\u3057\u305F"},downloadTemplateFilename:"\u30BB\u30F3\u30B7\u30C6\u30A3\u30D6\u30EF\u30FC\u30C9\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8",editor:{maxLengthHint:"1\u8A9E\u3042\u305F\u308A{{max}}\u6587\u5B57\u307E\u3067",maxLengthWarning:"1\u8A9E\u3042\u305F\u308A{{max}}\u6587\u5B57\u307E\u3067",duplicateWarning:"\u540C\u3058\u8A9E\u304C\u65E2\u306B\u3042\u308A\u307E\u3059",configTemplateHint:"\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9URL\u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",selectFileWarning:"\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",importFailRetry:"\u30A4\u30F3\u30DD\u30FC\u30C8\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",importCountSuccess:"{{count}}\u8A9E\u3092\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u307E\u3057\u305F",parseFail:"\u89E3\u6790\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002csv \u307E\u305F\u306F txt \u5F62\u5F0F\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",readFileFail:"\u30D5\u30A1\u30A4\u30EB\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",searchPlaceholder:"\u30BB\u30F3\u30B7\u30C6\u30A3\u30D6\u30EF\u30FC\u30C9\u3092\u691C\u7D22",inputPlaceholder:"\u5165\u529B",add:"\u8FFD\u52A0",import:"\u30A4\u30F3\u30DD\u30FC\u30C8",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",save:"\u4FDD\u5B58",confirm:"\u78BA\u8A8D",downloadTemplate:"\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9",uploadModalTitle:"\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",uploadModalHint:"\u5148\u306B\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3057\u3066\u304B\u3089\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",uploadDragText:"\u30AF\u30EA\u30C3\u30AF\u307E\u305F\u306F\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",uploadDragHint:"1\u30D5\u30A1\u30A4\u30EB\u3002csv \u307E\u305F\u306F txt\u3002",formatCsv:"csv",formatTxt:"txt"},server:{requestError:"\u30EA\u30AF\u30A8\u30B9\u30C8\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u3057\u3070\u3089\u304F\u3057\u3066\u304B\u3089\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002",noPermission:"\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093"}},Ne={zh:te,en:Pe,ja:ze};function We(e){return Ne[e]??te}function J(e,i){return e.replace(/\{\{(\w+)\}\}/g,(F,f)=>String(i[f]??""))}const ve=ue.createContext({locale:"zh",messages:te,getMessage:e=>{const i=e.split(".");let F=te;for(const f of i)F=F==null?void 0:F[f];return typeof F=="string"?F:e}});function ae(){return ue.useContext(ve)}function He({locale:e,messages:i,children:F}){const f=ue.useMemo(()=>{const c=We(e),r=i?{...c,...i}:c;return{locale:e,messages:r,getMessage:u=>{const A=u.split(".");let D=r;for(const I of A)D=D==null?void 0:D[I];return typeof D=="string"?D:u}}},[e,i]);return ue.createElement(ve.Provider,{value:f},F)}const{Dragger:Ue}=Ae,j=16,Re=v.div.attrs({className:"sensitive-edit-page"})`
|
|
11
|
+
*/const me=xe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Te=["10014"],Me=({url:e,token:d,role:x,getMessage:y})=>{const c=(a,i)=>y?y(a):i,r=Ie.create({baseURL:e,timeout:1e6});return r.interceptors.request.use(a=>{let i=d;if(!i&&!["user/login","user/kaptcha","user/regist"].some(p=>a.url.includes(p))){window.location.pathname="/login";return}return a.headers.Authorization=i||"",a.headers.userName=x==="\u672A\u767B\u5F55\u7528\u6237"?"":x,a}),r.interceptors.response.use(a=>{const i=["user/kaptcha"],l=a.data;if(i.some(g=>a.config.url&&a.config.url.includes(g))||l.size&&l.type)return l;const{success:p,errorMsg:k,errorCode:B}=l;return Te.includes(B)||p?l:(b.error(k||c("server.requestError","\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5")),!1)},a=>{var i,l,p,k,B,g,S,W,E,V;a.message!=="canceled"&&((((l=(i=a==null?void 0:a.response)==null?void 0:i.data)==null?void 0:l.errorCode)==="30013"||((k=(p=a==null?void 0:a.response)==null?void 0:p.data)==null?void 0:k.errorCode)==="30023")&&b.error((((B=a==null?void 0:a.response)==null?void 0:B.data)||{}).errorMsg||c("server.requestError","\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5")),((g=a==null?void 0:a.response)==null?void 0:g.status)===401&&(console.log("Error url:",(S=a==null?void 0:a.request)==null?void 0:S.responseURL),b.error((((W=a==null?void 0:a.response)==null?void 0:W.data)||{}).errorMsg||c("server.noPermission","\u6CA1\u6709\u8DB3\u591F\u6743\u9650"))),console.log("Error occurs",a),(((E=a==null?void 0:a.response)==null?void 0:E.data)||{}).errorMsg!="\u672A\u8BBE\u7F6E\u9ED8\u8BA4\u914D\u7F6E\uFF01"&&b.error((((V=a==null?void 0:a.response)==null?void 0:V.data)||{}).errorMsg||c("server.requestError","\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5")))}),{getLibraryList:async a=>{try{const i=await r.get(`/sensitive/library?${new URLSearchParams(a).toString()}`),{success:l,data:p}=i;return l?p:!1}catch(i){return console.log("e",i),!1}},createLibrary:async a=>{try{const i=await r.post("/sensitive/library",a),{success:l,data:p}=i;return l?p:!1}catch(i){return console.log("e",i),!1}},deleteLibrary:async a=>{try{const i=await r.delete(`/sensitive/library/${a}`),{success:l,data:p}=i;return l?p:!1}catch(i){return console.log("e",i),!1}},updateLibrary:async(a,i)=>{try{const l=await r.put(`/sensitive/library/${a}`,i),{success:p,data:k}=l;return p?k:!1}catch(l){return console.log("e",l),!1}},downloadTemplate:async a=>{try{const i=await r.get("/sensitive/word/downloadTemplate",{params:{fileType:a},responseType:"blob"});return i&&typeof i.size=="number"?i:!1}catch(i){return console.log("e",i),!1}},importWords:async(a,i)=>{try{const l=new FormData;l.append("file",i);const p=await r.put(`/sensitive/word/${a}/import`,l);return p&&p.success!==!1?p:!1}catch(l){return console.log("e",l),!1}},getWords:async a=>{try{const i=await r.get(`/sensitive/library/${a}`),{success:l,data:p}=i;return l?p:!1}catch(i){return console.log("e",i),!1}},getLibraryData:async a=>{try{const i=await r.get(`/sensitive/library/${a}`),{success:l,data:p}=i;return l?p:!1}catch(i){return console.log("e",i),!1}}}},{Dragger:Be}=ke,R=16,ze=F.div.attrs({className:"sensitive-edit-page"})`
|
|
12
12
|
display: flex;
|
|
13
13
|
flex-direction: column;
|
|
14
14
|
width: 100%;
|
|
15
15
|
height: 100%;
|
|
16
|
-
background: ${({theme:e})=>{var
|
|
17
|
-
`,
|
|
16
|
+
background: ${({theme:e})=>{var d;return((d=e==null?void 0:e.colors)==null?void 0:d.background)??"#FFFFFF"}};
|
|
17
|
+
`,Ne=F.div.attrs({className:"sensitive-edit-toolbar"})`
|
|
18
18
|
flex-shrink: 0;
|
|
19
19
|
display: flex;
|
|
20
20
|
align-items: center;
|
|
@@ -22,27 +22,27 @@ import{jsxs as B,jsx as s,Fragment as Ee}from"react/jsx-runtime";import ue,{useS
|
|
|
22
22
|
flex-wrap: wrap;
|
|
23
23
|
padding: 12px 20px;
|
|
24
24
|
|
|
25
|
-
`,
|
|
25
|
+
`,Pe=F.div.attrs({className:"sensitive-edit-content-box"})`
|
|
26
26
|
flex: 1;
|
|
27
27
|
min-height: 0;
|
|
28
28
|
overflow: auto;
|
|
29
|
-
border: 1px solid ${({theme:e})=>{var
|
|
30
|
-
background: ${({theme:e})=>{var
|
|
29
|
+
border: 1px solid ${({theme:e})=>{var d;return((d=e==null?void 0:e.colors)==null?void 0:d.border)??"#E5E7EB"}};
|
|
30
|
+
background: ${({theme:e})=>{var d;return((d=e==null?void 0:e.colors)==null?void 0:d.listBackground)??"#f5f5f5"}};
|
|
31
31
|
border-radius: 8px;
|
|
32
32
|
padding: 16px;
|
|
33
33
|
margin: 0 20px;
|
|
34
|
-
`,
|
|
34
|
+
`,We=F.div.attrs({className:"sensitive-edit-tag-list"})`
|
|
35
35
|
display: flex;
|
|
36
36
|
flex-wrap: wrap;
|
|
37
37
|
gap: 12px;
|
|
38
38
|
min-height: 30px;
|
|
39
|
-
`,
|
|
39
|
+
`,q=28,Ue=F.span.attrs({className:"sensitive-edit-tag"})`
|
|
40
40
|
box-sizing: border-box;
|
|
41
41
|
display: inline-flex;
|
|
42
42
|
align-items: center;
|
|
43
43
|
gap: 6px;
|
|
44
|
-
height: ${
|
|
45
|
-
min-height: ${
|
|
44
|
+
height: ${q}px;
|
|
45
|
+
min-height: ${q}px;
|
|
46
46
|
color: ${e=>e.$color};
|
|
47
47
|
background: ${e=>e.$bg};
|
|
48
48
|
border: ${e=>e.$border==="none"?"none":`1px solid ${e.$border}`};
|
|
@@ -62,13 +62,13 @@ import{jsxs as B,jsx as s,Fragment as Ee}from"react/jsx-runtime";import ue,{useS
|
|
|
62
62
|
opacity: 1;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
`,
|
|
65
|
+
`,je=F.span.attrs({className:"sensitive-edit-add-trigger"})`
|
|
66
66
|
box-sizing: border-box;
|
|
67
67
|
display: inline-flex;
|
|
68
68
|
align-items: center;
|
|
69
69
|
gap: 6px;
|
|
70
|
-
height: ${
|
|
71
|
-
min-height: ${
|
|
70
|
+
height: ${q}px;
|
|
71
|
+
min-height: ${q}px;
|
|
72
72
|
padding: 0 12px;
|
|
73
73
|
border: 1px dashed ${e=>e.$color};
|
|
74
74
|
border-radius: 4px;
|
|
@@ -84,13 +84,13 @@ import{jsxs as B,jsx as s,Fragment as Ee}from"react/jsx-runtime";import ue,{useS
|
|
|
84
84
|
border-style: solid;
|
|
85
85
|
opacity: 0.9;
|
|
86
86
|
}
|
|
87
|
-
`,
|
|
87
|
+
`,He=F.span.attrs({className:"sensitive-edit-add-input-wrap"})`
|
|
88
88
|
box-sizing: border-box;
|
|
89
89
|
display: inline-flex;
|
|
90
90
|
align-items: center;
|
|
91
91
|
|
|
92
|
-
height: ${
|
|
93
|
-
min-height: ${
|
|
92
|
+
height: ${q}px;
|
|
93
|
+
min-height: ${q}px;
|
|
94
94
|
padding: 0 8px 0 12px;
|
|
95
95
|
border: 1px solid ${e=>e.$focused?e.$color:"#E5E7EB"};
|
|
96
96
|
border-radius: 4px;
|
|
@@ -111,25 +111,25 @@ import{jsxs as B,jsx as s,Fragment as Ee}from"react/jsx-runtime";import ue,{useS
|
|
|
111
111
|
.sensitive-edit-add-input::placeholder {
|
|
112
112
|
color: #9ca3af;
|
|
113
113
|
}
|
|
114
|
-
`,
|
|
114
|
+
`,Ee=F.div.attrs({className:"sensitive-edit-footer"})`
|
|
115
115
|
flex-shrink: 0;
|
|
116
116
|
display: flex;
|
|
117
117
|
justify-content: flex-end;
|
|
118
118
|
gap: 10px;
|
|
119
119
|
padding: 16px 20px;
|
|
120
120
|
|
|
121
|
-
`,
|
|
121
|
+
`,Ve=F.div.attrs({className:"sensitive-upload-modal-alert"})`
|
|
122
122
|
display: flex;
|
|
123
123
|
align-items: center;
|
|
124
124
|
justify-content: space-between;
|
|
125
125
|
gap: 12px;
|
|
126
126
|
padding: 4px 14px;
|
|
127
127
|
margin-bottom: 16px;
|
|
128
|
-
background: ${({theme:e})=>{var
|
|
128
|
+
background: ${({theme:e})=>{var d;return((d=e==null?void 0:e.colors)==null?void 0:d.tagBackground)??"#eff6ff"}};
|
|
129
129
|
border-radius: 6px;
|
|
130
130
|
font-size: 14px;
|
|
131
|
-
color: ${({theme:e})=>{var
|
|
132
|
-
`,
|
|
131
|
+
color: ${({theme:e})=>{var d;return((d=e==null?void 0:e.colors)==null?void 0:d.text)??"#1f2937"}};
|
|
132
|
+
`,Re=F.div.attrs({className:"sensitive-upload-modal-dragger-wrap"})`
|
|
133
133
|
.ant-upload-drag {
|
|
134
134
|
border-radius: 8px;
|
|
135
135
|
border: 1px dashed #d1d5db;
|
|
@@ -139,25 +139,25 @@ import{jsxs as B,jsx as s,Fragment as Ee}from"react/jsx-runtime";import ue,{useS
|
|
|
139
139
|
border-color: #1d70f5;
|
|
140
140
|
background: #f0f7ff;
|
|
141
141
|
}
|
|
142
|
-
`,
|
|
142
|
+
`,qe=({words:e,onWordsChange:d,onSave:x,onCancel:y,styles:c,onDownloadTemplate:r,onImportFile:T})=>{var G;const{messages:t}=te(),[L,M]=$(""),[N,C]=$(!1),[v,D]=$(""),a=he(null),[i,l]=$(!1),[p,k]=$([]),[B,g]=$(!1),S=((G=c==null?void 0:c.theme)==null?void 0:G.colors)||ue.colors||{},W=S.tagColor??"#1d70f5",E=S.tagAddColor??"#1d70f5",V=S.tagBackground??"#ebf6ff",ae="none";be(()=>{N&&(D(""),setTimeout(()=>{var o;return(o=a.current)==null?void 0:o.focus()},0))},[N]);const O=I(()=>{const o=v.trim();if(o){if(o.length>R){b.warning(J(t.editor.maxLengthWarning,{max:String(R)}));return}if(e.includes(o)){b.warning(t.editor.duplicateWarning);return}d([...e,o])}D(""),C(!1)},[v,e,d,t]),Y=I(o=>{d(e.filter(h=>h!==o))},[e,d]),ne=ee(()=>{const o=L.trim().toLowerCase();return o?e.filter(h=>h.toLowerCase().includes(o)):e},[e,L]),ie=I(()=>{k([]),l(!0)},[]),oe=I(o=>{r?r(o):b.info(t.editor.configTemplateHint)},[r,t]),re={items:[{key:"csv",label:t.editor.formatCsv},{key:"txt",label:t.editor.formatTxt}],onClick:({key:o})=>oe(o)},U=I(o=>{const h=o.replace(/\r\n/g,`
|
|
143
143
|
`).replace(/\r/g,`
|
|
144
|
-
`).split(/[\n,\t]/).map(
|
|
144
|
+
`).split(/[\n,\t]/).map(A=>A.trim()).filter(Boolean),j=new Set,z=[];for(const A of h){const H=A.length>R?A.slice(0,R):A;j.has(H)||(j.add(H),z.push(H))}return z},[]),K=I(async()=>{var j;const o=(j=p[0])==null?void 0:j.originFileObj;if(!o){b.warning(t.editor.selectFileWarning);return}if(T){g(!0);try{await T(o),l(!1),k([])}catch{b.error(t.editor.importFailRetry)}finally{g(!1)}return}const h=new FileReader;h.onload=()=>{try{const z=h.result||"",A=U(z),H=Array.from(new Set([...e,...A]));d(H),b.success(J(t.editor.importCountSuccess,{count:String(A.length)})),l(!1),k([])}catch{b.error(t.editor.parseFail)}},h.onerror=()=>b.error(t.editor.readFileFail),h.readAsText(o,"UTF-8")},[p,e,d,U,T,t]),Z=I(()=>{l(!1),k([])},[]);return w(ze,{theme:c==null?void 0:c.theme,children:[w(Ne,{theme:c==null?void 0:c.theme,children:[s(P,{mode:"primary",label:t.editor.import,icon:s(Le,{size:16}),onClick:ie,styles:c}),w("span",{style:{display:"flex",alignItems:"center",gap:6,color:S.textSecondary??"#6b7280",fontSize:12},children:[s(me,{size:14}),J(t.editor.maxLengthHint,{max:String(R)})]}),s("div",{style:{flex:1,marginLeft:"auto",minWidth:200,maxWidth:320,display:"flex",alignItems:"center",gap:8},children:s(ce,{placeholder:t.editor.searchPlaceholder,value:L,allowClear:!0,onChange:o=>M(o.target.value),suffix:s(ye,{size:16,style:{color:"#9ca3af"}}),style:{flex:1}})})]}),s(Pe,{theme:c==null?void 0:c.theme,children:w(We,{children:[ne.map(o=>w(Ue,{$color:W,$bg:V,$border:ae,children:[o,s("span",{className:"sensitive-edit-tag-remove",onClick:()=>Y(o),role:"button",tabIndex:0,onKeyDown:h=>h.key==="Enter"&&Y(o),children:s(De,{size:14})})]},o)),N?s(He,{$focused:!0,$color:W,children:s("input",{ref:a,type:"text",className:"sensitive-edit-add-input",placeholder:t.editor.inputPlaceholder,value:v,onChange:o=>D(o.target.value),onBlur:O,onKeyDown:o=>{o.key==="Enter"&&O(),o.key==="Escape"&&(D(""),C(!1))},maxLength:R})}):w(je,{$color:E,onClick:()=>C(!0),role:"button",tabIndex:0,onKeyDown:o=>o.key==="Enter"&&C(!0),children:[s(ve,{size:14}),t.editor.add]})]})}),w(Ee,{theme:c==null?void 0:c.theme,children:[s(P,{mode:"default",label:t.editor.cancel,onClick:y,styles:c,style:{width:76}}),s(P,{mode:"primary",label:t.editor.save,onClick:x,styles:c,style:{width:76}})]}),w(de,{title:t.editor.uploadModalTitle,open:i,onCancel:Z,footer:w("div",{style:{display:"flex",justifyContent:"flex-end",gap:20},children:[s(P,{mode:"default",label:t.editor.cancel,onClick:Z,styles:c,disabled:B,style:{width:76}}),s(P,{mode:"primary",label:t.editor.confirm,onClick:K,styles:c,disabled:B,style:{width:76}})]}),destroyOnClose:!0,width:650,children:[w(Ve,{theme:c==null?void 0:c.theme,children:[w("span",{style:{display:"flex",alignItems:"center",gap:8},children:[s(me,{size:18,style:{color:"#1d70f5",flexShrink:0}}),t.editor.uploadModalHint]}),s(Fe,{menu:re,trigger:["click"],children:s("div",{style:{display:"inline-block"},children:s(P,{mode:"default",label:t.editor.downloadTemplate,styles:c})})})]}),s(Re,{children:w(Be,{accept:".csv,.txt",maxCount:1,fileList:p,beforeUpload:()=>!1,onChange:({fileList:o})=>k(o.slice(-1)),showUploadList:{showPreviewIcon:!1},children:[s("p",{className:"ant-upload-drag-icon",style:{marginBottom:8},children:s(Ae,{size:48,style:{color:"#1d70f5"}})}),s("p",{className:"ant-upload-text",children:t.editor.uploadDragText}),s("p",{className:"ant-upload-hint",children:t.editor.uploadDragHint})]})})]})]})},{confirm:Oe}=de,Ke={pageNo:1,pageSize:999},Ge=F.div.attrs({className:"sensitive-modal-footer"})`
|
|
145
145
|
width: 100%;
|
|
146
146
|
display: flex;
|
|
147
147
|
flex-direction: row;
|
|
148
148
|
justify-content: flex-end;
|
|
149
149
|
gap: 10px;
|
|
150
|
-
`,
|
|
150
|
+
`,Xe=F.div.attrs({className:"sensitive-toolbar-search-wrap"})`
|
|
151
151
|
display: flex;
|
|
152
152
|
align-items: center;
|
|
153
153
|
min-width: 220px;
|
|
154
|
-
`,
|
|
154
|
+
`,Je=({onAction:e})=>{const[d,x]=$(""),{messages:y}=te(),c=I(()=>{const r=d.trim();e("search",{keyword:r})},[d,e]);return s(Xe,{children:s(ce,{placeholder:y.toolbar.searchPlaceholder,allowClear:!0,value:d,onChange:r=>x(r.target.value),onPressEnter:c,suffix:s(ye,{size:16,style:{color:"#9ca3af"}})})})},Ye=F.div.attrs({className:"sensitive-tag-cell-wrap"})`
|
|
155
155
|
display: flex;
|
|
156
156
|
flex-wrap: wrap;
|
|
157
157
|
gap: 12px;
|
|
158
158
|
min-width: 200px;
|
|
159
159
|
max-width: 100%;
|
|
160
|
-
`,
|
|
160
|
+
`,Ze=F.span.attrs({className:"sensitive-tag-item"})`
|
|
161
161
|
box-sizing: border-box;
|
|
162
162
|
display: inline-block;
|
|
163
163
|
color: ${e=>e.$color};
|
|
@@ -170,7 +170,7 @@ import{jsxs as B,jsx as s,Fragment as Ee}from"react/jsx-runtime";import ue,{useS
|
|
|
170
170
|
white-space: nowrap;
|
|
171
171
|
flex-shrink: 0;
|
|
172
172
|
font-family: PingFangSC, 微软雅黑, Helvetic, sans-serif;
|
|
173
|
-
`,Q=8,
|
|
173
|
+
`,Q=8,Qe=F.span.attrs({className:"sensitive-tag-more"})`
|
|
174
174
|
display: inline-block;
|
|
175
175
|
color: ${e=>e.$color};
|
|
176
176
|
font-size: 12px;
|
|
@@ -182,4 +182,4 @@ import{jsxs as B,jsx as s,Fragment as Ee}from"react/jsx-runtime";import ue,{useS
|
|
|
182
182
|
&:hover {
|
|
183
183
|
text-decoration: underline;
|
|
184
184
|
}
|
|
185
|
-
`;function
|
|
185
|
+
`;function et({value:e,theme:d,onViewAll:x,row:y}){var i;const{messages:c}=te(),r=(d==null?void 0:d.colors)||ue.colors||{},T=r.tagColor??"#1d70f5",t=r.tagBackground??"#ebf6ff",L=Array.isArray(e)?e:[];if(L.length===0)return null;const M=((i=((y==null?void 0:y.data)||[]).find(l=>l.columnId==="count"))==null?void 0:i.value)||0,N=L.slice(0,Q),C=M>Q,v=C?M-Q:0,D=J(c.tagCell.viewAllTitle,{total:String(M),max:String(Q)}),a=J(c.tagCell.viewAllLink,{count:String(v)});return w(Ye,{children:[N.map((l,p)=>s(Ze,{$color:T,$bg:t,$border:"none",children:l},p)),C&&s(Qe,{$color:T,title:D,onClick:()=>x==null?void 0:x(),children:a})]})}const tt=({url:e,token:d,role:x,server:y,styles:c,eventsEmit:r,CustomComponents:T})=>{const{messages:t,locale:L,getMessage:M}=te(),[N,C]=$({container:"ready",content:"ready"}),v=he(null),[D,a]=$(),[i]=le.useForm(),[l,p]=$(!1),[k,B]=$(""),[g,S]=$({active:!1,libraryId:null,libraryName:"",words:[]}),W=ee(()=>y||Me({url:e,token:d,role:x,getMessage:M}),[y,e,d,x,M]),{getLibraryList:E,deleteLibrary:V,createLibrary:ae,updateLibrary:O,downloadTemplate:Y,importWords:ne,getWords:ie,getLibraryData:oe}=W,re=I(u=>{const n=(u==null?void 0:u.data)??[],m=n.find(se=>se.columnId==="name"),f=n.find(se=>se.columnId==="sensitiveWords"),_=(m==null?void 0:m.value)??"",X=Array.isArray(f==null?void 0:f.value)?[...f.value]:[];return{name:_,words:X}},[]),U=I(async u=>{const{id:n,name:m,words:f}=await oe(u.id);S({active:!0,libraryId:n,libraryName:m,words:f})},[re]),K=I(()=>{S({active:!1,libraryId:null,libraryName:"",words:[]}),h(),r==null||r("sensitive_edit_closed",{})},[r]),Z=I(async()=>{if(g.libraryId)try{await O(g.libraryId,{name:g.libraryName,words:g.words})&&(b.success(t.message.saveSuccess),K(),C(n=>({...n,content:"loading"})),h())}catch(u){console.error("[SensitiveView] \u4FDD\u5B58\u654F\u611F\u8BCD\u5931\u8D25:",u)}},[g.libraryId,g.words,O,K]),G=Se(),o=ee(()=>ge(ge({theme:ue,mode:"light"},G||{}),c||{}),[G,c]);be(()=>{C(u=>({...u,content:"loading"})),h()},[]);const h=async u=>{try{const n={...Ke},m=u??k;m&&(n.name=m);const f=await E(n);if(f){const _=j(f.records);a(_||[]),C(X=>({...X,content:"ready"}))}}catch(n){console.log("[SensitiveView] getSensitiveList error:",n)}};function j(u){return(u||[]).map(n=>({id:n.id,data:[{columnId:"name",value:n.name,type:"label"},{columnId:"sensitiveWords",value:n.words,type:"customized"},{columnId:"createDate",value:n.gmtCreate,type:"date"},{columnId:"count",value:n.count,type:"text"},{columnId:"actions",value:"edit",label:t.table.actionEdit,type:"action"},{columnId:"actions",value:"delete",label:t.table.actionDelete,type:"action"}]}))}const z=L==="zh"?"zh-CN":L==="ja"?"ja-JP":"en-US",A=ee(()=>({label:t.table.label,model:null,defaultActiveId:"sensitive-table",views:[{id:"sensitive-table",label:t.table.viewLabel,type:"table",viewBehavior:"pagination",allowMultiSelect:!1,viewPageSize:10,paginationLocale:L,columns:[{title:t.table.columns.name,id:"name",type:"label"},{title:t.table.columns.sensitiveWords,id:"sensitiveWords",type:"customized",component:et,componentProps:({value:u,row:n})=>({value:u,theme:o==null?void 0:o.theme,row:n,onViewAll:n?()=>U(n):void 0}),fallback:null},{title:t.table.columns.createDate,id:"createDate",type:"date"},{title:t.table.columns.count,id:"count",type:"text"},{title:t.table.columns.actions,id:"actions",type:"action"}],toolbar:[{type:"button",key:"create",label:t.table.toolbar.create,btnType:"primary",icon:s(ve,{size:16})},{type:"customized",key:"search",label:t.table.toolbar.searchPlaceholder,position:"right",component:Je}]}]}),[o,U,t]),H=async()=>{try{const u=await i.validateFields();if(!u)return;const n=await ae({...u,words:[]});if(n&&(v!=null&&v.current)){console.log("+++++",new Date().toLocaleString(z,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).replace(/\//g,"-"));const m={id:n,data:[{columnId:"name",value:u.name,type:"label"},{columnId:"sensitiveWords",value:[],type:"customized"},{columnId:"createDate",value:new Date().toLocaleString(z,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).replace(/\//g,"-"),type:"date"},{columnId:"count",value:0,type:"text"},{columnId:"actions",value:"edit",label:t.table.actionEdit,type:"action"},{columnId:"actions",value:"delete",label:t.table.actionDelete,type:"action"}]};b.success(t.message.createSuccess),pe("table_action_edit",{id:n},()=>{}),r==null||r("sensitive_library_created",{id:n,name:u.name})}}catch(u){console.error("[SensitiveView] \u65B0\u589E\u654F\u611F\u8BCD\u5931\u8D25:",u)}finally{p(!1),i.resetFields()}};function pe(u,n,m){switch(console.log("name",u),u){case"toolbar_create":p(!0),r==null||r("sensitive_toolbar_create",n);break;case"table_action_edit":{const f=n==null?void 0:n.id,_=f&&Array.isArray(D)?D.find(X=>X.id===f):n!=null&&n.data?n:null;_&&_.data?U(_):n!=null&&n.id&&U(n),r==null||r("sensitive_table_action_edit",n);break}case"table_action_delete":{Oe({title:t.deleteConfirm.title,content:t.deleteConfirm.content,okText:t.deleteConfirm.okText,cancelText:t.deleteConfirm.cancelText,async onOk(){var f;try{await V(n.id)&&(v!=null&&v.current)&&((f=v.current.appFn)==null||f.removeItem(n.id),b.success(t.message.deleteSuccess),h(),r==null||r("sensitive_table_action_delete",n))}catch(_){console.error("[SensitiveView] \u5220\u9664\u654F\u611F\u8BCD\u5E93\u5931\u8D25",_)}}});break}case"toolbar_search_search":{const f=(n==null?void 0:n.keyword)||"";B(f),C(_=>({..._,content:"loading"})),h(f),r==null||r("sensitive_toolbar_search",n);break}default:r==null||r("sensitive_"+u,n);break}}const fe=()=>{p(!1),i.resetFields()};return s(_e,{styles:o,children:g.active?s(qe,{libraryName:g.libraryName,words:g.words,onWordsChange:u=>S(n=>({...n,words:u})),onSave:Z,onCancel:K,styles:o,onDownloadTemplate:async u=>{const n=await Y(u);if(!n){b.error(t.message.downloadTemplateFail);return}const m=URL.createObjectURL(n),f=document.createElement("a");f.href=m,f.download=`${t.downloadTemplateFilename}.${u}`,f.click(),URL.revokeObjectURL(m)},onImportFile:async u=>{if(!g.libraryId)return;const n=await ne(g.libraryId,u);if(n&&n.success!==!1){b.success(t.message.importSuccess);const m=await ie(g.libraryId);(m==null?void 0:m.words)!=null&&S(f=>({...f,words:m==null?void 0:m.words}))}else throw b.error((n==null?void 0:n.errorMsg)||t.message.importFail),new Error("import failed")}}):w(we,{children:[s(Ce,{dataSource:D,ref:v,eventsEmit:pe,status:N,styles:o,CustomComponents:{...T},...A}),s(de,{title:t.createModal.title,open:l,width:650,destroyOnClose:!0,onCancel:fe,footer:w(Ge,{theme:o==null?void 0:o.theme,children:[s(P,{mode:"default",label:t.createModal.cancel,onClick:fe}),s(P,{mode:"primary",label:t.createModal.confirm,onClick:H})]}),children:s(le,{form:i,children:s(le.Item,{label:null,name:"name",rules:[{required:!0,message:t.createModal.nameRequired}],children:s(ce,{placeholder:t.createModal.namePlaceholder})})})})]})})},ht=e=>{const{locale:d="zh",messages:x,...y}=e;return s($e,{locale:d,messages:x,children:s(tt,{...y})})};export{yt as SensitiveI18nContext,$e as SensitiveI18nProvider,ht as default,vt as getSensitiveMessages,J as interpolate,te as useSensitiveI18n};
|
package/sensitiveWords.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"react/jsx-runtime";import"react";import"styled-components";import"antd";import"@mxmweb/xviewer";import"@mxmweb/zui";import{
|
|
1
|
+
import"react/jsx-runtime";import"react";import"styled-components";import"antd";import"@mxmweb/xviewer";import"@mxmweb/zui";import{default as x}from"./sensitive.js";import{a as d,S as l,g as C,i as M,u as P}from"./assets/i18n-BMTusWgX.js";/* empty css */import"./assets/plus-B679mjyt.js";import"./assets/search-CEuIa9-_.js";import"axios";import"./assets/circle-plus-RlDPoPkb.js";import"./assets/createLucideIcon-Bj5DlX2s.js";import"./assets/x-CdZQbi--.js";export{d as SensitiveI18nContext,l as SensitiveI18nProvider,x as default,C as getSensitiveMessages,M as interpolate,P as useSensitiveI18n};
|
package/streamFilesReader.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as f}from"./assets/
|
|
1
|
+
import{G as f}from"./assets/index-_ih9ja1B.js";import{registerPDFWorker as x}from"@mxmweb/fviewer";import"react/jsx-runtime";import"react";import"styled-components";import"axios";import"./assets/createLucideIcon-Bj5DlX2s.js";import"./assets/x-CdZQbi--.js";export{f as GientechStreamReader,x as registerPDFWorker};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as l}from"./index-DpW3BaUc.js";import u from"react-dom";function s(e,i){for(var n=0;n<i.length;n++){const t=i[n];if(typeof t!="string"&&!Array.isArray(t)){for(const r in t)if(r!=="default"&&!(r in e)){const a=Object.getOwnPropertyDescriptor(t,r);a&&Object.defineProperty(e,r,a.get?a:{enumerable:!0,get:()=>t[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var o={},c;function p(){if(c)return o;c=1;var e=u;return o.createRoot=e.createRoot,o.hydrateRoot=e.hydrateRoot,o}var f=p();const d=l(f),y=s({__proto__:null,default:d},[f]);export{y as c};
|