@gientech/modual 2.2.28 → 2.2.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +761 -761
- package/assets/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/dayjs.min-9C0uSO6x.js +1 -0
- package/assets/defaultWeLogo.svg +14 -14
- package/assets/graph.svg +4 -4
- package/assets/iconAi.svg +9 -9
- package/assets/index-C3NkyTp6.js +535 -0
- package/assets/knowledge.svg +4 -4
- package/assets/mysql.svg +14 -14
- package/assets/sensitive.svg +5 -5
- package/assets/style-CQZIirQ8.js +332 -0
- package/assets/style6.css +1 -1
- package/chat.js +1 -1
- package/chatCompare.js +1 -1
- package/database.js +2 -2
- package/index.js +1 -1
- package/oprecords.d.ts +70 -0
- package/oprecords.js +22 -0
- package/package.json +12 -7
- package/worker/pdf.worker.min.js +21 -21
- package/assets/index-B2xoLI6Z.js +0 -535
- package/assets/style-BT6ZbzMF.js +0 -332
package/oprecords.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{jsx as r,jsxs as g,Fragment as J}from"react/jsx-runtime";import x,{useState as E,useMemo as C,useEffect as Q}from"react";import b from"styled-components";import{DatePicker as V,Card as m,Input as X,Spin as Z,Row as I,Col as y,Statistic as v,Table as M}from"antd";import{d as q}from"./assets/dayjs.min-9C0uSO6x.js";import{DashboardContainer as ee}from"@mxmweb/zui";import te from"axios";const A={dashboard:{title:"\u7528\u6237\u64CD\u4F5C\u8BB0\u5F55",description:"\u4ECE\u63A5\u53E3\u805A\u5408\u7EDF\u8BA1\u7528\u6237\u64CD\u4F5C\u884C\u4E3A\uFF08\u6309\u5929+\u64CD\u4F5C\u540D\uFF09"},toolbar:{keywordPlaceholder:"\u6309\u64CD\u4F5C\u540D\u79F0\u8FC7\u6EE4",dataSourceLabel:"\u6570\u636E\u6765\u6E90"},stats:{totalCount:"\u603B\u64CD\u4F5C\u6B21\u6570",totalFailCount:"\u5931\u8D25\u6B21\u6570",groupRows:"\u805A\u5408\u6761\u76EE\u6570",suffixTimes:"\u6B21",suffixRows:"\u6761"},sections:{dailyTotal:"\u6BCF\u65E5\u5408\u8BA1\uFF08\u8FC7\u6EE4\u540E\uFF09",opTop:"\u64CD\u4F5C Top 20\uFF08\u8FC7\u6EE4\u540E\uFF09",detailTable:"\u6309\u5929 + \u64CD\u4F5C\u540D\u660E\u7EC6"},table:{date:"\u65E5\u671F",opName:"\u64CD\u4F5C\u540D\u79F0",count:"\u6B21\u6570",dailyCount:"\u5408\u8BA1\u6B21\u6570"},error:{requestFailed:"\u83B7\u53D6\u64CD\u4F5C\u8BB0\u5F55\u5931\u8D25",networkError:"\u7F51\u7EDC\u9519\u8BEF"},server:{requestError:"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",noPermission:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",notLoggedIn:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"}},ue={dashboard:{title:"User operations",description:"Aggregated user operations (by day + action)"},toolbar:{keywordPlaceholder:"Filter by action name",dataSourceLabel:"Data source"},stats:{totalCount:"Total",totalFailCount:"Failed",groupRows:"Grouped rows",suffixTimes:"times",suffixRows:"rows"},sections:{dailyTotal:"Daily total (filtered)",opTop:"Top actions (filtered)",detailTable:"Daily + action detail"},table:{date:"Date",opName:"Action",count:"Count",dailyCount:"Daily total"},error:{requestFailed:"Failed to fetch user operations",networkError:"Network error"},server:{requestError:"Request failed, please try again later",noPermission:"No permission",notLoggedIn:"Not logged in or token expired"}},re={dashboard:{title:"\u30E6\u30FC\u30B6\u30FC\u64CD\u4F5C",description:"\u30E6\u30FC\u30B6\u30FC\u64CD\u4F5C\u3092\u96C6\u8A08\uFF08\u65E5\u6642 + \u64CD\u4F5C\u540D\uFF09"},toolbar:{keywordPlaceholder:"\u64CD\u4F5C\u540D\u3067\u30D5\u30A3\u30EB\u30BF",dataSourceLabel:"\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9"},stats:{totalCount:"\u5408\u8A08",totalFailCount:"\u5931\u6557",groupRows:"\u96C6\u8A08\u884C\u6570",suffixTimes:"\u56DE",suffixRows:"\u884C"},sections:{dailyTotal:"\u65E5\u5225\u5408\u8A08\uFF08\u30D5\u30A3\u30EB\u30BF\u5F8C\uFF09",opTop:"Top \u64CD\u4F5C\uFF08\u30D5\u30A3\u30EB\u30BF\u5F8C\uFF09",detailTable:"\u65E5\u4ED8 + \u64CD\u4F5C\u540D\u306E\u8A73\u7D30"},table:{date:"\u65E5\u4ED8",opName:"\u64CD\u4F5C\u540D",count:"\u56DE\u6570",dailyCount:"\u5408\u8A08\u56DE\u6570"},error:{requestFailed:"\u30E6\u30FC\u30B6\u30FC\u64CD\u4F5C\u306E\u53D6\u5F97\u306B\u5931\u6557\u3057\u307E\u3057\u305F",networkError:"\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u30A8\u30E9\u30FC"},server:{requestError:"\u30EA\u30AF\u30A8\u30B9\u30C8\u306B\u5931\u6557\u3057\u307E\u3057\u305F",noPermission:"\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093",notLoggedIn:"\u672A\u30ED\u30B0\u30A4\u30F3\u3001\u307E\u305F\u306F\u30C8\u30FC\u30AF\u30F3\u304C\u671F\u9650\u5207\u308C\u3067\u3059"}},oe={zh:A,en:ue,ja:re};function ae(i,l){const c=oe[i]??A;return l?{...c,...l}:c}function P(i,l){const c=l.split(".");let n=i;for(const d of c)n=n==null?void 0:n[d];return typeof n=="string"?n:l}const N=x.createContext({locale:"zh",messages:A,getMessage:i=>P(A,i)});function se(){return x.useContext(N)}function ne({locale:i,messages:l,children:c}){const n=x.useMemo(()=>{const d=ae(i,l);return{locale:i,messages:d,getMessage:t=>P(d,t)}},[i,l]);return x.createElement(N.Provider,{value:n},c)}function le({url:i,token:l,role:c,eventsEmit:n,getMessage:d}){const t=(a,s)=>d?d(a):s,h=te.create({baseURL:i,timeout:15e3});return h.interceptors.request.use(a=>{const s=l;return s?(a.headers.Authorization=s||"",a.headers.userName=c==="\u672A\u767B\u5F55\u7528\u6237"?"":c,a):(n&&n("request:error_auth",{errorMsg:t("server.notLoggedIn","\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"),redirect:"/login"}),Promise.reject(new Error(t("server.notLoggedIn","\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"))))}),h.interceptors.response.use(a=>{const s=a.data;if(s&&typeof s=="object"&&"success"in s){if(s.success)return s;if(n)return n("request:error_business",{errorCode:s.errorCode,errorMsg:s.errorMsg||t("server.requestError","\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5"),response:s}),s}return s},a=>{var s;if((a==null?void 0:a.message)==="canceled")return Promise.reject(a);if(n){let w="request:error_network",D={errorMsg:t("server.requestError","\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25"),error:a};((s=a==null?void 0:a.response)==null?void 0:s.status)===401&&(w="request:error_auth",D={errorMsg:t("server.noPermission","\u6CA1\u6709\u8DB3\u591F\u6743\u9650"),error:a,redirect:"/login"}),n(w,D)}return Promise.reject(a)}),{getUserOperate:async a=>await h.get("/auth/userOperate/getUserOperate",{params:a})}}const{RangePicker:ie}=V;function ce(i){const{url:l="http://127.0.0.1:2230",token:c,role:n,eventsEmit:d}=i,{getMessage:t}=se(),h=b.div.attrs({className:"oprecords-wrapper"})`
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
min-height: 0;
|
|
5
|
+
`,S=b.div.attrs({className:"oprecords-toolbar"})`
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: space-between;
|
|
9
|
+
gap: 12px;
|
|
10
|
+
flex-wrap: wrap;
|
|
11
|
+
margin-bottom: 12px;
|
|
12
|
+
`,a=b.div.attrs({className:"oprecords-toolbar-left"})`
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
gap: 12px;
|
|
16
|
+
flex-wrap: wrap;
|
|
17
|
+
`,s=b.div.attrs({className:"oprecords-toolbar-right"})`
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: 12px;
|
|
21
|
+
flex-wrap: wrap;
|
|
22
|
+
`,[w,D]=E(!1),[z,k]=E(null),[F,T]=E(null),[B,L]=E(()=>[q("2026-01-04"),q("2026-03-28")]),[R,j]=E(""),O=C(()=>le({url:l,token:c,role:n,eventsEmit:d,getMessage:t}),[l,c,n,d,t]);Q(()=>{let e=!1;return(async()=>{try{D(!0),k(null);const u=await O.getUserOperate({start:B[0].format("YYYY-MM-DD"),end:B[1].format("YYYY-MM-DD")});if(e)return;if(!(u!=null&&u.success)||!(u!=null&&u.data)){T(null),k((u==null?void 0:u.errorMsg)||t("error.requestFailed"));return}T(u.data)}catch(u){if(e)return;T(null),k((u==null?void 0:u.message)||t("error.networkError"))}finally{e||D(!1)}})(),()=>{e=!0}},[O,B,t]);const f=C(()=>{const e=(F==null?void 0:F.operateGroupDetail)??[],o=R.trim();return o?e.filter(u=>{var p;return(p=u.name)==null?void 0:p.includes(o)}):e},[F,R]),_=(F==null?void 0:F.totalCount)??0,Y=(F==null?void 0:F.totalFailCount)??0,U=C(()=>{const e=new Map;for(const o of f)e.set(o.date,(e.get(o.date)||0)+(o.count||0));return Array.from(e.entries()).map(([o,u])=>({date:o,value:u,key:o})).sort((o,u)=>o.date.localeCompare(u.date))},[f]),$=C(()=>{const e=new Map;for(const u of f){const p=u.name||"\u672A\u77E5\u64CD\u4F5C";e.set(p,(e.get(p)||0)+(u.count||0))}return Array.from(e.entries()).map(([u,p])=>({name:u,value:p,key:u})).sort((u,p)=>p.value-u.value).slice(0,20)},[f]),G=C(()=>[{title:t("table.date"),dataIndex:"date",key:"date",width:140,sorter:(e,o)=>e.date.localeCompare(o.date),defaultSortOrder:"descend"},{title:t("table.opName"),dataIndex:"name",key:"name",ellipsis:!0},{title:t("table.count"),dataIndex:"count",key:"count",width:120,align:"right",sorter:(e,o)=>(e.count||0)-(o.count||0)}],[t]),K=C(()=>f.map((e,o)=>({...e,key:`${e.date}-${e.name}-${o}`})),[f]),W=C(()=>[{title:t("table.date"),dataIndex:"date",key:"date",width:140,sorter:(e,o)=>e.date.localeCompare(o.date)},{title:t("table.dailyCount"),dataIndex:"value",key:"value",align:"right",sorter:(e,o)=>e.value-o.value}],[t]),H=C(()=>[{title:t("table.opName"),dataIndex:"name",key:"name",ellipsis:!0},{title:t("table.count"),dataIndex:"value",key:"value",width:120,align:"right",sorter:(e,o)=>e.value-o.value}],[t]);return r(ee,{title:t("dashboard.title"),description:t("dashboard.description"),children:r(h,{children:g(m,{children:[g(S,{children:[g(a,{children:[r(ie,{value:B,allowClear:!1,onChange:e=>{e&&e[0]&&e[1]&&L([e[0],e[1]])}}),r(X,{value:R,onChange:e=>j(e.target.value),placeholder:t("toolbar.keywordPlaceholder"),style:{width:240},allowClear:!0})]}),r(s,{children:g("div",{style:{color:"#64748b",fontSize:12},children:[t("toolbar.dataSourceLabel"),"\uFF1A",r("span",{style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},children:`${l}/auth/userOperate/getUserOperate`})]})})]}),w?r("div",{style:{padding:24,display:"flex",justifyContent:"center"},children:r(Z,{})}):z?r("div",{style:{padding:16,color:"#cf1322"},children:z}):g(J,{children:[g(I,{gutter:12,style:{marginBottom:12},children:[r(y,{xs:24,md:8,children:r(m,{children:r(v,{title:t("stats.totalCount"),value:_,suffix:t("stats.suffixTimes")})})}),r(y,{xs:24,md:8,children:r(m,{children:r(v,{title:t("stats.totalFailCount"),value:Y,suffix:t("stats.suffixTimes")})})}),r(y,{xs:24,md:8,children:r(m,{children:r(v,{title:t("stats.groupRows"),value:f.length,suffix:t("stats.suffixRows")})})})]}),g(I,{gutter:12,style:{marginBottom:12},children:[r(y,{xs:24,lg:12,children:r(m,{title:t("sections.dailyTotal"),size:"small",children:r(M,{columns:W,dataSource:U,size:"small",pagination:{pageSize:8,showSizeChanger:!1}})})}),r(y,{xs:24,lg:12,children:r(m,{title:t("sections.opTop"),size:"small",children:r(M,{columns:H,dataSource:$,size:"small",pagination:{pageSize:8,showSizeChanger:!1}})})})]}),r(m,{title:t("sections.detailTable"),size:"small",children:r(M,{columns:G,dataSource:K,size:"middle",pagination:{pageSize:20,showSizeChanger:!0}})})]})]})})})}function he({locale:i="zh",messages:l,...c}){return r(ne,{locale:i,messages:l,children:r(ce,{...c})})}export{he as default};
|
package/package.json
CHANGED
|
@@ -3,15 +3,11 @@
|
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"style": "assets/style.css",
|
|
5
5
|
"private": false,
|
|
6
|
-
"version": "2.2.
|
|
6
|
+
"version": "2.2.30",
|
|
7
7
|
"author": "hanfeng_Zhang",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "index.js",
|
|
10
10
|
"types": "index.d.ts",
|
|
11
|
-
"scripts": {
|
|
12
|
-
"test": "yarn link",
|
|
13
|
-
"disconnect": "yarn unlink"
|
|
14
|
-
},
|
|
15
11
|
"peerDependencies": {
|
|
16
12
|
"@mxmweb/aichat": "^1.8.0",
|
|
17
13
|
"@mxmweb/fviewer": "^1.5.3",
|
|
@@ -79,16 +75,25 @@
|
|
|
79
75
|
"import": "./sensitiveWords.js",
|
|
80
76
|
"default": "./sensitiveWords.js"
|
|
81
77
|
},
|
|
78
|
+
"./oprecords": {
|
|
79
|
+
"types": "./oprecords.d.ts",
|
|
80
|
+
"import": "./oprecords.js",
|
|
81
|
+
"default": "./oprecords.js"
|
|
82
|
+
},
|
|
82
83
|
"./style.css": "./assets/style.css",
|
|
83
84
|
"./assets/style.css": "./assets/style.css"
|
|
84
85
|
},
|
|
85
86
|
"dependencies": {
|
|
86
87
|
"@mxmweb/aichat": "2.1.6 ",
|
|
87
88
|
"@mxmweb/fviewer": "1.5.7",
|
|
88
|
-
"@mxmweb/rtext": "1.6.
|
|
89
|
+
"@mxmweb/rtext": "1.6.23",
|
|
89
90
|
"@mxmweb/xviewer": "1.4.10",
|
|
90
91
|
"@mxmweb/zui": "1.3.18",
|
|
91
92
|
"antd": "^5.18.0",
|
|
92
93
|
"axios": "^1.7.2"
|
|
94
|
+
},
|
|
95
|
+
"scripts": {
|
|
96
|
+
"test": "yarn link",
|
|
97
|
+
"disconnect": "yarn unlink"
|
|
93
98
|
}
|
|
94
|
-
}
|
|
99
|
+
}
|