@baishuyun/ui-business 5.0.2 → 5.0.4
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/dist/BubbleChart/AutoGridEChart-uinZMdOR.js +185 -0
- package/dist/BubbleChart/BubbleChart-CPhXmstL.js +174 -0
- package/dist/BubbleChart/index.js +7 -4
- package/dist/ConfigProvider/ConfigProvider-CISBH3A8.js +22 -0
- package/dist/ConfigProvider/configContext-B0kvcW4s.js +9 -0
- package/dist/ConfigProvider/index.js +6 -4
- package/dist/DeptsMember/Department-BYVAaPYd.js +186 -0
- package/dist/DeptsMember/DeptsMember-D_xv-Zy7.js +801 -0
- package/dist/DeptsMember/DeptsUser-CQrRRJxk.js +277 -0
- package/dist/DeptsMember/ExtraConcactPanel-Cioew3V3.js +736 -0
- package/dist/DeptsMember/Member-BIBX5jKD.js +47 -0
- package/dist/DeptsMember/OrganizationPanel-BLIXOm6z.js +235 -0
- package/dist/DeptsMember/RelationShipDepts-wcYjFbhx.js +78 -0
- package/dist/DeptsMember/RelationShipList-CRdCr4NL.js +73 -0
- package/dist/DeptsMember/TabGroup-B_VIf1lS.js +98 -0
- package/dist/DeptsMember/index.js +18 -8
- package/dist/DeptsMember/subcomponents/Entity/Department/index.js +8 -166
- package/dist/DeptsMember/subcomponents/Entity/DeptsUser/index.js +11 -267
- package/dist/DeptsMember/subcomponents/Entity/Member/index.js +8 -46
- package/dist/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipDepts/index.js +4 -13
- package/dist/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipList/index.js +4 -67
- package/dist/DeptsMember/useDeptsMemberSelector-DP5L8bhi.js +15 -0
- package/dist/DeptsMember/utils/index.js +65 -77
- package/dist/Scatterplot/Scatterplot-DTKhmdTE.js +150 -0
- package/dist/Scatterplot/index.js +7 -4
- package/dist/components/BubbleChart/AutoGridEChart.d.ts +1 -1
- package/dist/index.css +2 -1
- package/dist/index.js +164 -200
- package/dist/utils/getLegendHeight.d.ts +1 -1
- package/dist/vendors/clsx.js +14 -14
- package/dist/vendors/echarts.js +41454 -44148
- package/dist/vendors/lodash-es.js +127 -117
- package/dist/vendors/rolldown-runtime.js +11 -0
- package/dist/vendors/services/apiService.js +15 -19
- package/dist/vendors/services/corp/outsider.service.js +5 -6
- package/dist/vendors/services/data/department.service.js +5 -6
- package/dist/vendors/services/data/member.service.js +5 -9
- package/dist/vendors/services/data/member_limit.service.js +5 -5
- package/dist/vendors/services/data/outsider.service.js +5 -6
- package/dist/vendors/services/ncorp/department.service.js +5 -6
- package/dist/vendors/services/ncorp/relation.service.js +5 -5
- package/dist/vendors/simplebar-react.js +358 -396
- package/dist/vendors/useLocale.js +132 -41
- package/package.json +5 -5
- package/dist/BubbleChart/AutoGridEChart-vNNqSiqF.js +0 -212
- package/dist/BubbleChart/BubbleChart-B0AuH-ma.js +0 -236
- package/dist/ConfigProvider/ConfigProvider-CAq3dN6-.js +0 -15
- package/dist/ConfigProvider/configContext-_BAslzM-.js +0 -9
- package/dist/DeptsMember/DeptsMember-BNuoQ8y4.js +0 -865
- package/dist/DeptsMember/ExtraConcactPanel-BoSCI3s5.js +0 -738
- package/dist/DeptsMember/OrganizationPanel-ByWU1PWX.js +0 -275
- package/dist/DeptsMember/TabGroup-DZC7i-Yr.js +0 -104
- package/dist/DeptsMember/index-BRIA1uOQ.js +0 -88
- package/dist/DeptsMember/useDeptsMemberSelector-D3rvDuVf.js +0 -13
- package/dist/Scatterplot/Scatterplot-D8AUUxhA.js +0 -201
|
@@ -1,42 +1,133 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
import { t as e } from "../ConfigProvider/configContext-B0kvcW4s.js";
|
|
2
|
+
import { useCallback as t, useContext as n, useMemo as r } from "react";
|
|
3
|
+
var i = {
|
|
4
|
+
common: {
|
|
5
|
+
loading: "加载中...",
|
|
6
|
+
cancel: "取消",
|
|
7
|
+
confirm: "确认",
|
|
8
|
+
clearAll: "清空所选项",
|
|
9
|
+
viewAll: "查看全部{count}个",
|
|
10
|
+
selected: "已选 {selected}/{total}",
|
|
11
|
+
collapseAll: "收起全部",
|
|
12
|
+
noAvailable: "没有可选成员",
|
|
13
|
+
searchPlaceholder: "搜索",
|
|
14
|
+
other: "其他"
|
|
15
|
+
},
|
|
16
|
+
department: {
|
|
17
|
+
title: "部门",
|
|
18
|
+
search: "搜索部门",
|
|
19
|
+
noAvailable: "没有可选部门",
|
|
20
|
+
contact: "对接部门",
|
|
21
|
+
organizationalStructure: "组织架构",
|
|
22
|
+
currentUserDepartment: "当前用户所处部门",
|
|
23
|
+
internal: "内部组织",
|
|
24
|
+
external: "外部组织",
|
|
25
|
+
externalContactGroup: "对接人小组",
|
|
26
|
+
externalContactDepartment: "对接部门"
|
|
27
|
+
},
|
|
28
|
+
member: {
|
|
29
|
+
title: "成员",
|
|
30
|
+
search: "搜索成员",
|
|
31
|
+
contact: "对接人",
|
|
32
|
+
all: "全部成员",
|
|
33
|
+
allContact: "全部对接人",
|
|
34
|
+
internal: "内部成员",
|
|
35
|
+
external: "外部成员",
|
|
36
|
+
noAvailable: "没有可选成员",
|
|
37
|
+
relation: "成员关系",
|
|
38
|
+
relationSuperior: "上级",
|
|
39
|
+
relationSubordinate: "下级",
|
|
40
|
+
relationPeer: "同级"
|
|
41
|
+
},
|
|
42
|
+
role: {
|
|
43
|
+
title: "角色",
|
|
44
|
+
internal: "内部角色",
|
|
45
|
+
external: "互联角色"
|
|
46
|
+
},
|
|
47
|
+
position: { title: "职位" },
|
|
48
|
+
currentUser: { title: "当前用户" },
|
|
49
|
+
externalContact: {
|
|
50
|
+
title: "外部联系人",
|
|
51
|
+
defaultGroup: "默认分组",
|
|
52
|
+
customGroup: "自定义分组",
|
|
53
|
+
group: "外部联系人分组",
|
|
54
|
+
noAvailableGroup: "没有可选分组"
|
|
55
|
+
},
|
|
56
|
+
tabs: {
|
|
57
|
+
searchMember: "搜索成员",
|
|
58
|
+
searchDepartment: "搜索部门"
|
|
59
|
+
}
|
|
60
|
+
}, a = {
|
|
61
|
+
common: {
|
|
62
|
+
loading: "Loading...",
|
|
63
|
+
cancel: "Cancel",
|
|
64
|
+
confirm: "Confirm",
|
|
65
|
+
clearAll: "Clear All",
|
|
66
|
+
viewAll: "View All {count}",
|
|
67
|
+
selected: "Selected {selected}/{total}",
|
|
68
|
+
collapseAll: "Collapse All",
|
|
69
|
+
noAvailable: "No available members",
|
|
70
|
+
searchPlaceholder: "Search",
|
|
71
|
+
other: "Other"
|
|
72
|
+
},
|
|
73
|
+
department: {
|
|
74
|
+
title: "Department",
|
|
75
|
+
search: "Search Department",
|
|
76
|
+
noAvailable: "No available departments",
|
|
77
|
+
contact: "Contact Department",
|
|
78
|
+
organizationalStructure: "Organizational Structure",
|
|
79
|
+
currentUserDepartment: "Current User Department",
|
|
80
|
+
internal: "Internal Organization",
|
|
81
|
+
external: "External Organization",
|
|
82
|
+
externalContactGroup: "External Contact Group",
|
|
83
|
+
externalContactDepartment: "External Contact Department"
|
|
84
|
+
},
|
|
85
|
+
member: {
|
|
86
|
+
title: "Member",
|
|
87
|
+
search: "Search Member",
|
|
88
|
+
contact: "Contact Person",
|
|
89
|
+
allContact: "All Contact Persons",
|
|
90
|
+
all: "All Members",
|
|
91
|
+
internal: "Internal Members",
|
|
92
|
+
external: "External Members",
|
|
93
|
+
noAvailable: "No available members",
|
|
94
|
+
relation: "Member Relationship",
|
|
95
|
+
relationSuperior: "Superior",
|
|
96
|
+
relationSubordinate: "Subordinate",
|
|
97
|
+
relationPeer: "Peer"
|
|
98
|
+
},
|
|
99
|
+
role: {
|
|
100
|
+
title: "Role",
|
|
101
|
+
internal: "Internal Role",
|
|
102
|
+
external: "Interconnected Role"
|
|
103
|
+
},
|
|
104
|
+
position: { title: "Position" },
|
|
105
|
+
currentUser: { title: "Current User" },
|
|
106
|
+
externalContact: {
|
|
107
|
+
title: "External Contact",
|
|
108
|
+
defaultGroup: "Default Group",
|
|
109
|
+
customGroup: "Custom Group",
|
|
110
|
+
group: "External Contact Group",
|
|
111
|
+
noAvailableGroup: "No available groups"
|
|
112
|
+
},
|
|
113
|
+
tabs: {
|
|
114
|
+
searchMember: "Search Member",
|
|
115
|
+
searchDepartment: "Search Department"
|
|
116
|
+
}
|
|
117
|
+
}, o = (e, t, n) => {
|
|
118
|
+
let r = t.split("."), i = e;
|
|
119
|
+
try {
|
|
120
|
+
for (let e of r) i = i[e];
|
|
121
|
+
return typeof i == "string" ? n ? i.replace(/\{(\w+)\}/g, (e, t) => n[t] === void 0 ? e : String(n[t])) : i : t;
|
|
122
|
+
} catch {
|
|
123
|
+
return t;
|
|
124
|
+
}
|
|
125
|
+
}, s = () => {
|
|
126
|
+
let s = n(e), c = r(() => ({
|
|
127
|
+
"zh-CN": i,
|
|
128
|
+
"en-US": a
|
|
129
|
+
}), []), l = r(() => c[s.locale] || i, [s.locale, c]);
|
|
130
|
+
return { t: t((e, t) => o(l, e, t), [l]) };
|
|
42
131
|
};
|
|
132
|
+
//#endregion
|
|
133
|
+
export { s as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baishuyun/ui-business",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.4",
|
|
4
4
|
"description": "百数云业务组件库",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"author": "BSY Team",
|
|
40
40
|
"license": "MIT",
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@baishuyun/ui-base": ">=2.3.
|
|
42
|
+
"@baishuyun/ui-base": ">=2.3.2",
|
|
43
43
|
"ahooks": ">=3.7.0",
|
|
44
44
|
"antd": ">=5.1.2",
|
|
45
45
|
"immer": "^10.0.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@types/lodash-es": "^4.17.12",
|
|
53
53
|
"@types/react": "^18.3.1",
|
|
54
54
|
"@types/react-dom": "^18.3.0",
|
|
55
|
-
"@vitejs/plugin-react": "^
|
|
55
|
+
"@vitejs/plugin-react": "^6.0.0",
|
|
56
56
|
"ahooks": "^3.9.3",
|
|
57
57
|
"antd": "^5.27.0",
|
|
58
58
|
"glob": "^11.0.3",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"react": "18.3.1",
|
|
62
62
|
"react-dom": "18.3.1",
|
|
63
63
|
"sass": "^1.90.0",
|
|
64
|
-
"vite": "^
|
|
64
|
+
"vite": "^8.0.0",
|
|
65
65
|
"vite-plugin-dts": "^4.5.4",
|
|
66
|
-
"@baishuyun/ui-base": "2.3.
|
|
66
|
+
"@baishuyun/ui-base": "2.3.2"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"autoprefixer": "^10.4.21",
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
import { jsxs as G, jsx as A } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as P, useRef as z, useState as X, useImperativeHandle as Y, useEffect as _ } from "react";
|
|
3
|
-
import { i as $ } from "../vendors/echarts.js";
|
|
4
|
-
import { c as S } from "../vendors/clsx.js";
|
|
5
|
-
function E(e, c, l, r) {
|
|
6
|
-
let x = 0, f = 0;
|
|
7
|
-
const y = parseInt(r.fontSize) || 10, u = e.series.map((t) => t.data[0][0].toString()), d = e.series.map((t) => t.data[0][1].toString());
|
|
8
|
-
function h(t) {
|
|
9
|
-
let i = "";
|
|
10
|
-
if (t.fontSize || t.fontFamily || t.fontWeight) {
|
|
11
|
-
let n = "";
|
|
12
|
-
typeof t.fontSize == "string" && (t.fontSize.indexOf("px") !== -1 || t.fontSize.indexOf("rem") !== -1 || t.fontSize.indexOf("em") !== -1) ? n = t.fontSize : isNaN(+t.fontSize) ? n = "12px" : n = t.fontSize + "px", i = [t.fontStyle, t.fontWeight, n, t.fontFamily || "sans-serif"].join(
|
|
13
|
-
" "
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
return i && i.trim() || t.textFont || t.font;
|
|
17
|
-
}
|
|
18
|
-
function g(t, i) {
|
|
19
|
-
i.fontSize = parseInt(i.fontSize), i.fontFamily = i.fontFamily || "verdana";
|
|
20
|
-
const n = h(i), a = document.createElement("canvas").getContext("2d") || {};
|
|
21
|
-
return a.font = n, a?.measureText(t)?.width || 0;
|
|
22
|
-
}
|
|
23
|
-
function m(t, i) {
|
|
24
|
-
if (Array.isArray(t))
|
|
25
|
-
for (let n = 0, s = t.length; n < s && i.apply(t[n], [n, t[n]]) !== !1; n++) ;
|
|
26
|
-
else if (t && typeof t == "object") {
|
|
27
|
-
for (const n in t)
|
|
28
|
-
if (Object.prototype.hasOwnProperty.call(t, n) && i.apply(t[n], [n, t[n]]) === !1) break;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function L() {
|
|
32
|
-
let t = 0;
|
|
33
|
-
if (e.xAxis && e.xAxis.axisLabel) {
|
|
34
|
-
const i = e.xAxis.axisLabel.rotate;
|
|
35
|
-
if (i && i !== 0) {
|
|
36
|
-
let n = 0, s = "";
|
|
37
|
-
if (u && Array.isArray(u) && u.forEach((a) => {
|
|
38
|
-
const o = a;
|
|
39
|
-
o.length > n && (n = o.length, s = o);
|
|
40
|
-
}), n > 0) {
|
|
41
|
-
const a = g(s, e.xAxis.axisLabel), o = Math.abs(i) * Math.PI / 180;
|
|
42
|
-
t = a * Math.sin(o);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return t;
|
|
47
|
-
}
|
|
48
|
-
function w() {
|
|
49
|
-
let t = 0;
|
|
50
|
-
if (e.yAxis && e.yAxis.axisLabel) {
|
|
51
|
-
const i = e.yAxis.axisLabel.rotate;
|
|
52
|
-
if (i && i !== 0) {
|
|
53
|
-
let n = 0, s = "";
|
|
54
|
-
if (d && Array.isArray(d) && d.forEach((a) => {
|
|
55
|
-
const o = a;
|
|
56
|
-
o.length > n && (n = o.length, s = o);
|
|
57
|
-
}), n > 0) {
|
|
58
|
-
const a = g(s, e.yAxis.axisLabel);
|
|
59
|
-
if (i === 0)
|
|
60
|
-
t = a;
|
|
61
|
-
else if (i === 90)
|
|
62
|
-
t = parseInt(e.yAxis.axisLabel.fontSize) || 12;
|
|
63
|
-
else {
|
|
64
|
-
const o = Math.abs(i) * Math.PI / 180;
|
|
65
|
-
t = a * Math.cos(o);
|
|
66
|
-
}
|
|
67
|
-
t += 10;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return t;
|
|
72
|
-
}
|
|
73
|
-
function F() {
|
|
74
|
-
let t = 0;
|
|
75
|
-
const i = Array.isArray(c) ? c.length : Object.keys(c || {}).length;
|
|
76
|
-
return i > 10 ? t = 20 : i > 5 && (t = 10), t;
|
|
77
|
-
}
|
|
78
|
-
if (e.legend.type === "scroll")
|
|
79
|
-
return y + 10 + L() + w() + F();
|
|
80
|
-
m(c, (t, i) => {
|
|
81
|
-
const n = g(
|
|
82
|
-
i,
|
|
83
|
-
r || {
|
|
84
|
-
fontFamily: "verdana",
|
|
85
|
-
fontSize: 10,
|
|
86
|
-
fontStyle: "normal",
|
|
87
|
-
fontWeight: "normal"
|
|
88
|
-
}
|
|
89
|
-
);
|
|
90
|
-
f += n + 10 + 14 + 5, f > l && (x++, f = n + 10 + 14 + 5);
|
|
91
|
-
});
|
|
92
|
-
function j() {
|
|
93
|
-
let t = 0;
|
|
94
|
-
if (e.legend.show && e.legend.orient === "vertical") {
|
|
95
|
-
let i = 0;
|
|
96
|
-
m(c, (n, s) => {
|
|
97
|
-
const a = g(
|
|
98
|
-
s,
|
|
99
|
-
r || {
|
|
100
|
-
fontFamily: "verdana",
|
|
101
|
-
fontSize: 10,
|
|
102
|
-
fontStyle: "normal",
|
|
103
|
-
fontWeight: "normal"
|
|
104
|
-
}
|
|
105
|
-
) + 25;
|
|
106
|
-
i = Math.max(i, a);
|
|
107
|
-
}), (e.legend.left === "left" || e.legend.left === "right" || e.legend.right === "left" || e.legend.right === "right") && (t = i + 20);
|
|
108
|
-
}
|
|
109
|
-
return t;
|
|
110
|
-
}
|
|
111
|
-
const b = j(), H = (x + 1) * (y + 10), O = L(), W = w();
|
|
112
|
-
let R = -5, C = -5, T = -5, I = -5;
|
|
113
|
-
const M = () => {
|
|
114
|
-
let t = 20;
|
|
115
|
-
return e.xAxis.position === "bottom" && (t += O + 10), e.legend.show && (e.legend.top === "bottom" || e.legend.top === "") && (R += H, t += H), e.xAxis.title !== "" && e.xAxis.position === "bottom" && (t = t + 30), t;
|
|
116
|
-
}, k = () => {
|
|
117
|
-
let t = 20;
|
|
118
|
-
return e.xAxis.position === "top" && (t += O + 10), e.legend.show && e.legend.top === "top" && (C += H, t += H), e.xAxis.title !== "" && e.xAxis.position === "top" && (t = t + 30), t;
|
|
119
|
-
}, N = () => {
|
|
120
|
-
let t = 20;
|
|
121
|
-
return e.yAxis.position === "left" && (t += W), e.legend.show && e.legend.left === "left" && (T += b, t += b), e.yAxis.title !== "" && e.yAxis.position === "left" && (t = t + 10), t;
|
|
122
|
-
}, B = () => {
|
|
123
|
-
let t = 20 + W;
|
|
124
|
-
return e.yAxis.position === "right" && (t += 10), e.legend.show && e.legend.left === "right" && (I += b, t += b), e.yAxis.title !== "" && e.yAxis.position === "right" && (t = t + 30), t;
|
|
125
|
-
};
|
|
126
|
-
return {
|
|
127
|
-
grid: {
|
|
128
|
-
top: k(),
|
|
129
|
-
bottom: M(),
|
|
130
|
-
left: N(),
|
|
131
|
-
right: B()
|
|
132
|
-
},
|
|
133
|
-
titleBottomHeight: R,
|
|
134
|
-
titleTopHeight: C,
|
|
135
|
-
titleLeftHeight: T,
|
|
136
|
-
titleRightHeight: I
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
const v = {
|
|
140
|
-
"auto-grid-echart": "_auto-grid-echart_w04s7_1",
|
|
141
|
-
"xAxis-title": "_xAxis-title_w04s7_6",
|
|
142
|
-
"yAxis-title": "_yAxis-title_w04s7_11"
|
|
143
|
-
}, q = (e, c) => {
|
|
144
|
-
const l = z(null), r = z(null), x = z(null), [f, y] = X({}), u = e.dataList.map((h) => h.name), d = () => l.current ? (y(
|
|
145
|
-
E(
|
|
146
|
-
e.option,
|
|
147
|
-
u,
|
|
148
|
-
l.current.offsetWidth,
|
|
149
|
-
e.option.legend.textStyle
|
|
150
|
-
)
|
|
151
|
-
), {
|
|
152
|
-
...e.option,
|
|
153
|
-
grid: E(
|
|
154
|
-
e.option,
|
|
155
|
-
u,
|
|
156
|
-
l.current.offsetWidth,
|
|
157
|
-
e.option.legend.textStyle
|
|
158
|
-
).grid
|
|
159
|
-
}) : {
|
|
160
|
-
...e.option
|
|
161
|
-
};
|
|
162
|
-
return Y(c, () => ({
|
|
163
|
-
resizeEchart: () => {
|
|
164
|
-
r.current?.resize();
|
|
165
|
-
}
|
|
166
|
-
})), _(() => {
|
|
167
|
-
if (!l.current) return;
|
|
168
|
-
r.current = $(l.current);
|
|
169
|
-
const h = d();
|
|
170
|
-
r.current.setOption(h, !0), r.current.on("click", function(m) {
|
|
171
|
-
e.onChartClick && e.onChartClick(m, e.options, e.dataList);
|
|
172
|
-
});
|
|
173
|
-
const g = () => {
|
|
174
|
-
if (r.current) {
|
|
175
|
-
const m = d();
|
|
176
|
-
r.current.setOption(m, !1);
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
return setTimeout(g, 100), e.onChartReady && e.onChartReady(r.current), x.current = new ResizeObserver(() => {
|
|
180
|
-
r.current?.resize(), setTimeout(g, 50);
|
|
181
|
-
}), l.current && x.current.observe(l.current), () => {
|
|
182
|
-
x.current?.disconnect(), r.current?.dispose();
|
|
183
|
-
};
|
|
184
|
-
}, []), _(() => {
|
|
185
|
-
if (!r.current) return;
|
|
186
|
-
const h = d();
|
|
187
|
-
r.current.setOption(h, !0);
|
|
188
|
-
}, [e.option]), /* @__PURE__ */ G("div", { className: S(e.className, v["auto-grid-echart"]), children: [
|
|
189
|
-
/* @__PURE__ */ A("div", { ref: l, style: { width: "100%", height: "100%", ...e.style } }),
|
|
190
|
-
/* @__PURE__ */ A(
|
|
191
|
-
"div",
|
|
192
|
-
{
|
|
193
|
-
className: S(v["xAxis-title"]),
|
|
194
|
-
style: e.option.xAxis?.position === "bottom" ? {
|
|
195
|
-
bottom: f.titleBottomHeight + 20
|
|
196
|
-
} : e.option.xAxis?.position === "top" ? { top: f.titleTopHeight + 20 } : void 0,
|
|
197
|
-
children: /* @__PURE__ */ A("span", { children: e.option.xAxis?.title })
|
|
198
|
-
}
|
|
199
|
-
),
|
|
200
|
-
/* @__PURE__ */ A(
|
|
201
|
-
"div",
|
|
202
|
-
{
|
|
203
|
-
className: S(v["yAxis-title"]),
|
|
204
|
-
style: e.option.yAxis?.position === "left" ? { left: f.titleLeftHeight } : e.option.yAxis?.position === "right" ? { right: f.titleRightHeight + 20 } : void 0,
|
|
205
|
-
children: /* @__PURE__ */ A("span", { children: e.option.yAxis?.title })
|
|
206
|
-
}
|
|
207
|
-
)
|
|
208
|
-
] });
|
|
209
|
-
}, U = P(q);
|
|
210
|
-
export {
|
|
211
|
-
U as A
|
|
212
|
-
};
|
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
import { jsx as h } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as y, useRef as v, useImperativeHandle as m } from "react";
|
|
3
|
-
import { R as A } from "../vendors/echarts.js";
|
|
4
|
-
import { A as S } from "./AutoGridEChart-vNNqSiqF.js";
|
|
5
|
-
const w = (t, g) => {
|
|
6
|
-
const r = v(null), c = (o) => {
|
|
7
|
-
const n = {
|
|
8
|
-
index0: [],
|
|
9
|
-
// 所有系列的第一个数据(data[0])
|
|
10
|
-
index1: []
|
|
11
|
-
// 所有系列的第二个数据(data[1])
|
|
12
|
-
};
|
|
13
|
-
return o.forEach((e) => {
|
|
14
|
-
n.index0.push(e.data[0]), n.index1.push(e.data[1]);
|
|
15
|
-
}), n;
|
|
16
|
-
}, d = (o) => {
|
|
17
|
-
const n = Math.max(...o), e = Math.min(...o), i = (o.reduce((a, b) => a + b, 0) / o.length).toFixed(2);
|
|
18
|
-
return { max: n, min: e, avg: Number(i) };
|
|
19
|
-
}, x = c(t.dataList), l = d(x.index0), s = d(x.index1), f = t.options.xFields[t.options.xFields.length - 1].colors || [], u = {
|
|
20
|
-
xAxis: {
|
|
21
|
-
axisLabel: {
|
|
22
|
-
color: "#666666",
|
|
23
|
-
fontSize: 10,
|
|
24
|
-
show: !0,
|
|
25
|
-
rotate: t.options.xAxis?.label?.rotation + " " || 45
|
|
26
|
-
// 文字顺时针旋转 90°(完全竖向)
|
|
27
|
-
},
|
|
28
|
-
min: t.options.xAxis?.min || void 0,
|
|
29
|
-
// 固定X轴最小值
|
|
30
|
-
max: t.options.xAxis?.max || void 0,
|
|
31
|
-
// 固定X轴最大值
|
|
32
|
-
title: t.options.xAxis?.title?.text || "",
|
|
33
|
-
position: t.options.xAxis?.position
|
|
34
|
-
},
|
|
35
|
-
yAxis: {
|
|
36
|
-
axisLabel: {
|
|
37
|
-
color: "#666666",
|
|
38
|
-
fontSize: 10,
|
|
39
|
-
show: !0,
|
|
40
|
-
rotate: t.options.yAxis?.label?.rotation + " " || 45
|
|
41
|
-
// 文字顺时针旋转 90°(完全竖向)
|
|
42
|
-
},
|
|
43
|
-
min: t.options.yAxis?.min || void 0,
|
|
44
|
-
// 固定X轴最小值
|
|
45
|
-
max: t.options.yAxis?.max || void 0,
|
|
46
|
-
// 固定X轴最大值
|
|
47
|
-
title: t.options.yAxis?.title?.text,
|
|
48
|
-
position: t.options.yAxis?.position
|
|
49
|
-
},
|
|
50
|
-
grid: {
|
|
51
|
-
top: 20,
|
|
52
|
-
bottom: 20,
|
|
53
|
-
left: 20,
|
|
54
|
-
right: 30
|
|
55
|
-
},
|
|
56
|
-
tooltip: {
|
|
57
|
-
trigger: "item",
|
|
58
|
-
// 触发方式:axis(坐标轴触发)/ item(数据项触发)/ none(不触发)
|
|
59
|
-
axisPointer: {
|
|
60
|
-
// 坐标轴指示器(仅 trigger: 'axis' 时生效)
|
|
61
|
-
type: "shadow"
|
|
62
|
-
// 指示器类型:line(直线)/ shadow(阴影)/ cross(十字线)
|
|
63
|
-
},
|
|
64
|
-
textStyle: {
|
|
65
|
-
// 提示框文本样式
|
|
66
|
-
fontSize: 14,
|
|
67
|
-
color: "#333"
|
|
68
|
-
},
|
|
69
|
-
backgroundColor: "#fff",
|
|
70
|
-
// 背景色(支持透明)
|
|
71
|
-
borderColor: "#fff",
|
|
72
|
-
// 边框颜色
|
|
73
|
-
borderWidth: 1,
|
|
74
|
-
// 边框宽度
|
|
75
|
-
padding: 10,
|
|
76
|
-
// 内边距(上下左右)
|
|
77
|
-
borderRadius: 4,
|
|
78
|
-
// 圆角半径
|
|
79
|
-
formatter: (o) => {
|
|
80
|
-
let n = `<div>${o.seriesName}</div>`;
|
|
81
|
-
return n += `<div><span>${t.options.xFields[0].title}:</span><span>${o.value[0]}</span></div>`, n += `<div><span>${t.options.yFields[0].title}:</span><span>${o.value[1]}</span></div>`, o.componentType === "series" ? n : "";
|
|
82
|
-
},
|
|
83
|
-
triggerOn: "mousemove",
|
|
84
|
-
// 触发时机:mousemove(鼠标移动)/ click(点击)/ mousemove|click(两者)
|
|
85
|
-
showDelay: 0,
|
|
86
|
-
// 显示延迟(ms),默认0
|
|
87
|
-
hideDelay: 100,
|
|
88
|
-
// 隐藏延迟(ms),默认100
|
|
89
|
-
enterable: !1
|
|
90
|
-
// 是否允许鼠标进入提示框(默认false,防止触发其他交互)
|
|
91
|
-
},
|
|
92
|
-
legend: {
|
|
93
|
-
show: t.options.legend.enable,
|
|
94
|
-
orient: ["left", "right"].includes(t.options.legend.position) ? "vertical" : "horizontal",
|
|
95
|
-
// 纵向布局
|
|
96
|
-
left: ["left", "right"].includes(t.options.legend.position) && t.options.legend.position || "center",
|
|
97
|
-
// 居右
|
|
98
|
-
top: ["top", "bottom"].includes(t.options.legend.position) && t.options.legend.position || "middle",
|
|
99
|
-
// 垂直居中
|
|
100
|
-
// itemGap: 10, // 图例项间距 20px
|
|
101
|
-
bottom: 0,
|
|
102
|
-
padding: 10,
|
|
103
|
-
itemWidth: 12,
|
|
104
|
-
itemHeight: 12,
|
|
105
|
-
textStyle: {
|
|
106
|
-
fontStyle: "normal"
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
graphic: t.options.guideline?.map((o) => ({
|
|
110
|
-
type: "line",
|
|
111
|
-
// 类型:线
|
|
112
|
-
shape: {
|
|
113
|
-
x1: 1,
|
|
114
|
-
y1: 8,
|
|
115
|
-
// 起点(X=0,Y=50)
|
|
116
|
-
x2: 2,
|
|
117
|
-
y2: 8
|
|
118
|
-
// 终点(X=100,Y=50)→ 水平
|
|
119
|
-
},
|
|
120
|
-
style: {
|
|
121
|
-
stroke: o.color,
|
|
122
|
-
// 线条颜色
|
|
123
|
-
lineWidth: 2
|
|
124
|
-
// 线条宽度
|
|
125
|
-
}
|
|
126
|
-
})),
|
|
127
|
-
series: t.dataList.map((o, n) => ({
|
|
128
|
-
symbolSize: () => (o.data[2] || 0) >= t.options.bubbleOptions.maxSize ? t.options.bubbleOptions.maxSize : (o.data[2] || 0) <= t.options.bubbleOptions.minSize ? t.options.bubbleOptions.minSize : o.data[2] || 10,
|
|
129
|
-
//气泡大小
|
|
130
|
-
data: [o.data],
|
|
131
|
-
name: o.name,
|
|
132
|
-
markLine: {
|
|
133
|
-
// 1. 标记线整体样式
|
|
134
|
-
symbol: ["none", "none"],
|
|
135
|
-
// 起点/终点标记图形(默认有箭头,none 隐藏)
|
|
136
|
-
lineStyle: {
|
|
137
|
-
// 线的样式
|
|
138
|
-
width: 1,
|
|
139
|
-
type: "dashed"
|
|
140
|
-
// solid/dashed/dotted
|
|
141
|
-
},
|
|
142
|
-
// 2. 标记线的数据(关键)
|
|
143
|
-
data: n === 0 && t.options.guideline?.map((e) => {
|
|
144
|
-
const i = {
|
|
145
|
-
lineStyle: {
|
|
146
|
-
// 线的样式
|
|
147
|
-
color: e.color,
|
|
148
|
-
width: 1,
|
|
149
|
-
type: "dashed"
|
|
150
|
-
// solid/dashed/dotted
|
|
151
|
-
},
|
|
152
|
-
label: {
|
|
153
|
-
show: !0,
|
|
154
|
-
position: "insideEndTop",
|
|
155
|
-
// 标签位置:insideStartTop/insideEndTop/insideStartBottom/insideEndBottom
|
|
156
|
-
formatter: (a) => {
|
|
157
|
-
if (e.is_label_visible && e.is_value_visible)
|
|
158
|
-
return e.label + ":" + a.value;
|
|
159
|
-
if (e.is_label_visible)
|
|
160
|
-
return e.label;
|
|
161
|
-
if (e.is_value_visible)
|
|
162
|
-
return a.value;
|
|
163
|
-
},
|
|
164
|
-
// 格式化文本({b}名称,{c}数值)
|
|
165
|
-
fontSize: 12,
|
|
166
|
-
color: e.color,
|
|
167
|
-
distance: 5
|
|
168
|
-
// 标签与线的距离
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
return e.type === "fixed" && (e.field === t.options.xFields[0].tag && (i.xAxis = e.value || 0), e.field === t.options.yFields[0].tag && (i.yAxis = e.value || 0)), e.type === "dynamic" && (e.field === t.options.xFields[0].tag && (e.aggregate === "max" && (i.xAxis = l.max), e.aggregate === "min" && (i.xAxis = l.min), e.aggregate === "avg" && (i.xAxis = l.avg)), e.field === t.options.yFields[0].tag && (e.aggregate === "max" && (i.yAxis = s.max), e.aggregate === "min" && (i.yAxis = s.min), e.aggregate === "avg" && (i.yAxis = s.avg)), i.type = e.aggregate), i;
|
|
172
|
-
})
|
|
173
|
-
},
|
|
174
|
-
color: f.find((e) => e.title === o.name) ? f.find((e) => e.title === o.name).color : "",
|
|
175
|
-
label: {
|
|
176
|
-
show: t.options.chart_label.enable,
|
|
177
|
-
distance: 5,
|
|
178
|
-
// 与气泡的距离(避免紧贴)
|
|
179
|
-
position: "top",
|
|
180
|
-
formatter: () => `${t.options.chart_label.dimension?.enable ? o.name : ""} ${t.options.chart_label.value?.enable ? "(" + o.data[0] + "," + o.data[1] + ")" : ""}`,
|
|
181
|
-
textStyle: {
|
|
182
|
-
fontSize: 11,
|
|
183
|
-
color: "#666",
|
|
184
|
-
fontWeight: 500
|
|
185
|
-
// 加粗
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
itemStyle: {
|
|
189
|
-
borderColor: "#666",
|
|
190
|
-
// 气泡边框色
|
|
191
|
-
borderWidth: 1,
|
|
192
|
-
// 边框宽度
|
|
193
|
-
// 阴影核心配置
|
|
194
|
-
shadowColor: "rgba(0, 0, 0, 0.2)",
|
|
195
|
-
// 阴影颜色(半透明黑色,柔和不突兀)
|
|
196
|
-
shadowBlur: 10,
|
|
197
|
-
// 阴影模糊度(10 为适中值,越大越柔和)
|
|
198
|
-
shadowOffsetX: 3,
|
|
199
|
-
// 水平偏移 3px(向右)
|
|
200
|
-
shadowOffsetY: 5,
|
|
201
|
-
// 垂直偏移 3px(向下)
|
|
202
|
-
shadowOpacity: 0.8,
|
|
203
|
-
// 阴影透明度(0.8 适中,避免过暗)
|
|
204
|
-
color: new A(0.4, 0.3, 1, [
|
|
205
|
-
{
|
|
206
|
-
offset: 0,
|
|
207
|
-
color: o.color && o.color[0] || "rgb(129, 227, 238)"
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
offset: 1,
|
|
211
|
-
color: o.color && o.color[1] || "rgb(25, 183, 207)"
|
|
212
|
-
}
|
|
213
|
-
])
|
|
214
|
-
},
|
|
215
|
-
type: "scatter"
|
|
216
|
-
}))
|
|
217
|
-
};
|
|
218
|
-
return m(g, () => ({
|
|
219
|
-
resizeEchart: () => {
|
|
220
|
-
r.current.resizeEchart();
|
|
221
|
-
}
|
|
222
|
-
})), /* @__PURE__ */ h(
|
|
223
|
-
S,
|
|
224
|
-
{
|
|
225
|
-
ref: r,
|
|
226
|
-
option: u,
|
|
227
|
-
options: t.options,
|
|
228
|
-
dataList: t.dataList,
|
|
229
|
-
onChartReady: t.onChartReady,
|
|
230
|
-
onChartClick: t.onChartClick
|
|
231
|
-
}
|
|
232
|
-
);
|
|
233
|
-
}, F = y(w);
|
|
234
|
-
export {
|
|
235
|
-
F as B
|
|
236
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect as t } from "react";
|
|
3
|
-
import { C as n } from "./configContext-_BAslzM-.js";
|
|
4
|
-
import { s as f } from "../vendors/services/apiService.js";
|
|
5
|
-
const p = (o) => {
|
|
6
|
-
const { locale: i, axiosInstance: r, preFetchedNodes: e } = o;
|
|
7
|
-
return t(() => {
|
|
8
|
-
r && f({ axiosInstance: r });
|
|
9
|
-
}, [r]), t(() => {
|
|
10
|
-
e && e.length > 0 && sessionStorage.setItem("preset_bsy_dept_member", JSON.stringify(e));
|
|
11
|
-
}, [e]), /* @__PURE__ */ s(n.Provider, { value: { locale: i, axiosInstance: r, preFetchedNodes: e }, children: o.children });
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
p as C
|
|
15
|
-
};
|