szld-libs 0.0.15 → 0.0.17

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.
Files changed (118) hide show
  1. package/dist/style.css +1 -1
  2. package/dist/{index.js → szld-components.es.js} +1860 -1856
  3. package/dist/{index.umd.cjs → szld-components.umd.js} +27 -27
  4. package/es/components/AuthButton/index.d.ts +7 -0
  5. package/es/components/AuthButton/index.js +12 -0
  6. package/es/components/AuthButton/vite.svg +1 -0
  7. package/es/components/BackHeader/index.css +14 -0
  8. package/{@types → es}/components/BackHeader/index.d.ts +0 -0
  9. package/es/components/BackHeader/index.js +55 -0
  10. package/es/components/BackHeader/vite.svg +1 -0
  11. package/es/components/CreateForm/index.css +39 -0
  12. package/{@types → es}/components/CreateForm/index.d.ts +0 -0
  13. package/es/components/CreateForm/index.js +227 -0
  14. package/es/components/CreateForm/vite.svg +1 -0
  15. package/es/components/Echarts/index.css +5 -0
  16. package/{@types → es}/components/Echarts/index.d.ts +0 -0
  17. package/es/components/Echarts/index.js +65 -0
  18. package/es/components/Echarts/vite.svg +1 -0
  19. package/es/components/EditTable/index.css +9 -0
  20. package/{@types → es}/components/EditTable/index.d.ts +0 -0
  21. package/es/components/EditTable/index.js +99 -0
  22. package/es/components/EditTable/vite.svg +1 -0
  23. package/es/components/Loading/index.css +22 -0
  24. package/{@types → es}/components/Loading/index.d.ts +0 -0
  25. package/es/components/Loading/index.js +44 -0
  26. package/es/components/Loading/vite.svg +1 -0
  27. package/es/components/SearchTable/index.css +3 -0
  28. package/{@types → es}/components/SearchTable/index.d.ts +0 -0
  29. package/es/components/SearchTable/index.js +34 -0
  30. package/es/components/SearchTable/vite.svg +1 -0
  31. package/{@types → es}/components/Upload/index.d.ts +0 -0
  32. package/es/components/Upload/index.js +125 -0
  33. package/es/components/Upload/vite.svg +1 -0
  34. package/es/components/VirtualTable/index.css +18 -0
  35. package/{@types → es}/components/VirtualTable/index.d.ts +0 -0
  36. package/es/components/VirtualTable/index.js +172 -0
  37. package/es/components/VirtualTable/vite.svg +1 -0
  38. package/es/components/WorkFlowNode/index.css +110 -0
  39. package/{@types → es}/components/WorkFlowNode/index.d.ts +0 -0
  40. package/es/components/WorkFlowNode/index.js +125 -0
  41. package/es/components/WorkFlowNode/vite.svg +1 -0
  42. package/{@types → es}/components/common/403.d.ts +0 -0
  43. package/es/components/common/403.js +18 -0
  44. package/{@types → es}/components/common/404.d.ts +0 -0
  45. package/es/components/common/404.js +18 -0
  46. package/es/components/common/vite.svg +1 -0
  47. package/{@types → es}/index.d.ts +0 -0
  48. package/es/index.js +144 -0
  49. package/{@types → es}/main.d.ts +2 -1
  50. package/es/main.js +28 -0
  51. package/{@types → es}/utils/download.d.ts +0 -0
  52. package/es/utils/download.js +59 -0
  53. package/{@types → es}/utils/filetype.d.ts +0 -0
  54. package/es/utils/filetype.js +41 -0
  55. package/{@types → es}/utils/index.d.ts +0 -0
  56. package/es/utils/index.js +114 -0
  57. package/{@types → es}/utils/verify-code.d.ts +0 -0
  58. package/es/utils/verify-code.js +115 -0
  59. package/es/utils/vite.svg +1 -0
  60. package/es/vite.svg +1 -0
  61. package/lib/components/AuthButton/index.d.ts +7 -0
  62. package/lib/components/AuthButton/index.js +11 -0
  63. package/lib/components/AuthButton/vite.svg +1 -0
  64. package/lib/components/BackHeader/index.css +14 -0
  65. package/lib/components/BackHeader/index.d.ts +11 -0
  66. package/lib/components/BackHeader/index.js +54 -0
  67. package/lib/components/BackHeader/vite.svg +1 -0
  68. package/lib/components/CreateForm/index.css +39 -0
  69. package/lib/components/CreateForm/index.d.ts +48 -0
  70. package/lib/components/CreateForm/index.js +227 -0
  71. package/lib/components/CreateForm/vite.svg +1 -0
  72. package/lib/components/Echarts/index.css +5 -0
  73. package/lib/components/Echarts/index.d.ts +14 -0
  74. package/lib/components/Echarts/index.js +81 -0
  75. package/lib/components/Echarts/vite.svg +1 -0
  76. package/lib/components/EditTable/index.css +9 -0
  77. package/lib/components/EditTable/index.d.ts +17 -0
  78. package/lib/components/EditTable/index.js +98 -0
  79. package/lib/components/EditTable/vite.svg +1 -0
  80. package/lib/components/Loading/index.css +22 -0
  81. package/lib/components/Loading/index.d.ts +4 -0
  82. package/lib/components/Loading/index.js +43 -0
  83. package/lib/components/Loading/vite.svg +1 -0
  84. package/lib/components/SearchTable/index.css +3 -0
  85. package/lib/components/SearchTable/index.d.ts +16 -0
  86. package/lib/components/SearchTable/index.js +33 -0
  87. package/lib/components/SearchTable/vite.svg +1 -0
  88. package/lib/components/Upload/index.d.ts +9 -0
  89. package/lib/components/Upload/index.js +124 -0
  90. package/lib/components/Upload/vite.svg +1 -0
  91. package/lib/components/VirtualTable/index.css +18 -0
  92. package/lib/components/VirtualTable/index.d.ts +4 -0
  93. package/lib/components/VirtualTable/index.js +171 -0
  94. package/lib/components/VirtualTable/vite.svg +1 -0
  95. package/lib/components/WorkFlowNode/index.css +110 -0
  96. package/lib/components/WorkFlowNode/index.d.ts +9 -0
  97. package/lib/components/WorkFlowNode/index.js +124 -0
  98. package/lib/components/WorkFlowNode/vite.svg +1 -0
  99. package/lib/components/common/403.d.ts +3 -0
  100. package/lib/components/common/403.js +17 -0
  101. package/lib/components/common/404.d.ts +3 -0
  102. package/lib/components/common/404.js +17 -0
  103. package/lib/components/common/vite.svg +1 -0
  104. package/lib/index.d.ts +1 -0
  105. package/lib/index.js +145 -0
  106. package/lib/main.d.ts +14 -0
  107. package/lib/main.js +48 -0
  108. package/lib/utils/download.d.ts +3 -0
  109. package/lib/utils/download.js +59 -0
  110. package/lib/utils/filetype.d.ts +35 -0
  111. package/lib/utils/filetype.js +41 -0
  112. package/lib/utils/index.d.ts +12 -0
  113. package/lib/utils/index.js +114 -0
  114. package/lib/utils/verify-code.d.ts +27 -0
  115. package/lib/utils/verify-code.js +115 -0
  116. package/lib/utils/vite.svg +1 -0
  117. package/lib/vite.svg +1 -0
  118. package/package.json +10 -7
@@ -0,0 +1,34 @@
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { Table } from "antd";
3
+ import classNames from "classnames";
4
+ import CreateForm from "../CreateForm";
5
+ const search = "szld-search";
6
+ const classes = {
7
+ search
8
+ };
9
+ function SearchTable(props) {
10
+ const { tableProps = {}, searchProps } = props;
11
+ const { columns = [], ...rest } = tableProps;
12
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
13
+ searchProps && /* @__PURE__ */ jsx(CreateForm, { hiddenTitle: true, ...searchProps, items: searchProps.items }),
14
+ /* @__PURE__ */ jsx(
15
+ Table,
16
+ {
17
+ columns: columns.filter((v) => !v.hidden),
18
+ ...rest,
19
+ className: classNames(classes.table, tableProps == null ? void 0 : tableProps.className),
20
+ pagination: typeof (tableProps == null ? void 0 : tableProps.pagination) === "boolean" ? tableProps.pagination : {
21
+ hideOnSinglePage: true,
22
+ showPrevNextJumpers: true,
23
+ showQuickJumper: true,
24
+ showSizeChanger: true,
25
+ showTotal: (total) => `共 ${total} 条`,
26
+ ...tableProps == null ? void 0 : tableProps.pagination
27
+ }
28
+ }
29
+ )
30
+ ] });
31
+ }
32
+ export {
33
+ SearchTable as default
34
+ };
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
File without changes
@@ -0,0 +1,125 @@
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { Upload, Image, Button, message, Modal } from "antd";
3
+ import { PlusOutlined, UploadOutlined } from "@ant-design/icons";
4
+ import { FileSuffix } from "@/utils/filetype";
5
+ import { useState } from "react";
6
+ import { getFileSuffix, getBase64 } from "@/utils";
7
+ import ReactDOM from "react-dom";
8
+ const defaultFileType = [FileSuffix.jpeg, FileSuffix.jpg, FileSuffix.png];
9
+ const UploadFile = (props) => {
10
+ const {
11
+ maxCount = 1,
12
+ listType = "picture-card",
13
+ fileList = [],
14
+ maxSize = 2,
15
+ accept = defaultFileType.join(","),
16
+ uploadBtnName = "上传",
17
+ uploadHint = null
18
+ } = props;
19
+ const [preview, setPreview] = useState(false);
20
+ const [previewSrc, setPreviewSrc] = useState("");
21
+ const uploadButton = () => {
22
+ if (listType !== "text") {
23
+ return /* @__PURE__ */ jsxs("div", { children: [
24
+ /* @__PURE__ */ jsx(PlusOutlined, {}),
25
+ /* @__PURE__ */ jsx("div", { style: { marginTop: 8 }, children: uploadBtnName })
26
+ ] });
27
+ }
28
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
29
+ /* @__PURE__ */ jsx(Button, { icon: /* @__PURE__ */ jsx(UploadOutlined, {}), children: uploadBtnName }),
30
+ uploadHint
31
+ ] });
32
+ };
33
+ const beforeUpload = (file) => {
34
+ const acceptList = accept.split(",");
35
+ const suffix = getFileSuffix(file.name) || "";
36
+ if (!acceptList.includes(suffix)) {
37
+ message.error(`只允许上传 ${accept} 文件`);
38
+ return Upload.LIST_IGNORE;
39
+ }
40
+ const isLess = file.size / 1024 / 1024 < maxSize;
41
+ if (!isLess) {
42
+ message.error(`文件必须小于${maxSize}MB`);
43
+ return Upload.LIST_IGNORE;
44
+ }
45
+ return true;
46
+ };
47
+ const onChange = (info) => {
48
+ props.onChange && props.onChange(info);
49
+ };
50
+ const onPreview = async (file) => {
51
+ let suffix = getFileSuffix(file.name) || "";
52
+ if (!suffix) {
53
+ suffix = getFileSuffix(file.name || file.url) || "";
54
+ }
55
+ if (suffix === FileSuffix.pdf) {
56
+ return Modal.info({
57
+ title: "PDF",
58
+ width: "60%",
59
+ content: /* @__PURE__ */ jsx(
60
+ "iframe",
61
+ {
62
+ title: "PDF预览",
63
+ src: file.url || file.response.url,
64
+ frameBorder: "0",
65
+ style: { width: "100%", height: "70vh" }
66
+ }
67
+ ),
68
+ okText: "关闭"
69
+ });
70
+ }
71
+ if (!defaultFileType.includes(suffix)) {
72
+ return;
73
+ }
74
+ if (!file.url && !file.thumbUrl && !file.preview) {
75
+ file.preview = await getBase64(file.originFileObj);
76
+ }
77
+ setPreviewSrc(file.url || file.thumbUrl || file.preview);
78
+ setPreview(true);
79
+ };
80
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
81
+ /* @__PURE__ */ jsx(
82
+ Upload,
83
+ {
84
+ ...props,
85
+ onPreview,
86
+ beforeUpload,
87
+ onChange,
88
+ listType,
89
+ children: fileList.length >= maxCount ? null : uploadButton()
90
+ }
91
+ ),
92
+ /* @__PURE__ */ jsx(
93
+ ImagePreview,
94
+ {
95
+ visible: preview,
96
+ src: previewSrc,
97
+ onVisibleChange: () => {
98
+ setPreview(false);
99
+ setPreviewSrc("");
100
+ }
101
+ }
102
+ )
103
+ ] });
104
+ };
105
+ const ImagePreview = (props) => {
106
+ const { visible, src, onVisibleChange } = props;
107
+ return ReactDOM.createPortal(
108
+ /* @__PURE__ */ jsx(
109
+ Image,
110
+ {
111
+ style: { display: "none" },
112
+ src,
113
+ preview: {
114
+ visible,
115
+ src,
116
+ onVisibleChange
117
+ }
118
+ }
119
+ ),
120
+ document.body
121
+ );
122
+ };
123
+ export {
124
+ UploadFile as default
125
+ };
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,18 @@
1
+ .szld-grid .szld-cell {
2
+ padding: 0 16px;
3
+ display: flex;
4
+ align-items: center;
5
+ border-bottom: 1px solid #f0f0f0;
6
+ }
7
+ .szld-grid .szld-editBox {
8
+ width: 100%;
9
+ display: flex;
10
+ align-items: center;
11
+ padding: 4px 11px;
12
+ border: 1px solid #d9d9d9;
13
+ border-radius: 6px;
14
+ cursor: pointer;
15
+ }
16
+ .szld-grid .szld-editForm {
17
+ width: 100%;
18
+ }
@@ -0,0 +1,172 @@
1
+ import { jsx, Fragment } from "react/jsx-runtime";
2
+ import { Table, Form, Input } from "antd";
3
+ import classNames from "classnames";
4
+ import ResizeObserver from "rc-resize-observer";
5
+ import { useState, useRef, useEffect } from "react";
6
+ import { VariableSizeGrid } from "react-window";
7
+ const grid = "szld-grid";
8
+ const cell = "szld-cell";
9
+ const editBox = "szld-editBox";
10
+ const editForm = "szld-editForm";
11
+ const classes = {
12
+ grid,
13
+ cell,
14
+ editBox,
15
+ editForm
16
+ };
17
+ function VirtualTable(props) {
18
+ const { columns, scroll, onChange, ...rest } = props;
19
+ const [tableWidth, setTableWidth] = useState(0);
20
+ const widthColumnCount = columns.filter(({ width }) => !width).length;
21
+ const mergedColumns = columns.map((column) => {
22
+ if (column.width) {
23
+ return column;
24
+ }
25
+ return {
26
+ ...column,
27
+ width: Math.floor(tableWidth / widthColumnCount)
28
+ };
29
+ });
30
+ const gridRef = useRef();
31
+ const [connectObject] = useState(() => {
32
+ const obj = {};
33
+ Object.defineProperty(obj, "scrollLeft", {
34
+ get: () => {
35
+ var _a, _b;
36
+ if (gridRef.current) {
37
+ return (_b = (_a = gridRef.current) == null ? void 0 : _a.state) == null ? void 0 : _b.scrollLeft;
38
+ }
39
+ return null;
40
+ },
41
+ set: (scrollLeft) => {
42
+ if (gridRef.current) {
43
+ gridRef.current.scrollTo({ scrollLeft });
44
+ }
45
+ }
46
+ });
47
+ return obj;
48
+ });
49
+ const resetVirtualGrid = () => {
50
+ var _a;
51
+ (_a = gridRef.current) == null ? void 0 : _a.resetAfterIndices({
52
+ columnIndex: 0,
53
+ shouldForceUpdate: true
54
+ });
55
+ };
56
+ useEffect(() => resetVirtualGrid, [tableWidth]);
57
+ const renderVirtualList = (rawData, { scrollbarSize, ref, onScroll }) => {
58
+ ref.current = connectObject;
59
+ const totalHeight = rawData.length * 54;
60
+ return /* @__PURE__ */ jsx(
61
+ VariableSizeGrid,
62
+ {
63
+ ref: gridRef,
64
+ className: classes.grid,
65
+ columnCount: mergedColumns.length,
66
+ columnWidth: (index) => {
67
+ const { width } = mergedColumns[index];
68
+ return totalHeight > scroll.y && index === mergedColumns.length - 1 ? width - scrollbarSize - 1 : width;
69
+ },
70
+ height: scroll.y,
71
+ rowCount: rawData.length,
72
+ rowHeight: () => 54,
73
+ width: tableWidth,
74
+ onScroll: ({ scrollLeft }) => {
75
+ onScroll({ scrollLeft });
76
+ },
77
+ children: ({
78
+ columnIndex,
79
+ rowIndex,
80
+ style
81
+ }) => /* @__PURE__ */ jsx(
82
+ "div",
83
+ {
84
+ className: classNames(classes.cell, {
85
+ [classes.cellLast]: columnIndex === mergedColumns.length - 1
86
+ }),
87
+ style,
88
+ children: /* @__PURE__ */ jsx(
89
+ EditableCell,
90
+ {
91
+ data: rawData[rowIndex],
92
+ onChange,
93
+ column: mergedColumns[columnIndex]
94
+ }
95
+ )
96
+ }
97
+ )
98
+ }
99
+ );
100
+ };
101
+ return /* @__PURE__ */ jsx(
102
+ ResizeObserver,
103
+ {
104
+ onResize: ({ width }) => {
105
+ setTableWidth(width);
106
+ },
107
+ children: /* @__PURE__ */ jsx(
108
+ Table,
109
+ {
110
+ ...rest,
111
+ className: classes.table,
112
+ columns: mergedColumns,
113
+ scroll,
114
+ pagination: false,
115
+ components: {
116
+ body: renderVirtualList
117
+ }
118
+ }
119
+ )
120
+ }
121
+ );
122
+ }
123
+ function EditableCell(props) {
124
+ const { column, data, onChange } = props;
125
+ const [editing, setEditing] = useState(false);
126
+ const inputRef = useRef(null);
127
+ const [form] = Form.useForm();
128
+ useEffect(() => {
129
+ if (editing) {
130
+ inputRef.current.focus();
131
+ }
132
+ }, [editing]);
133
+ const save = async () => {
134
+ try {
135
+ const values = await form.validateFields();
136
+ toggleEdit();
137
+ onChange && onChange({ ...data, ...values });
138
+ } catch (errInfo) {
139
+ console.log("Save failed:", errInfo);
140
+ }
141
+ };
142
+ const toggleEdit = () => {
143
+ setEditing(!editing);
144
+ if (column.dataIndex) {
145
+ form.setFieldsValue({ [column.dataIndex]: data[column.dataIndex] });
146
+ }
147
+ };
148
+ let childNode = data[column.dataIndex];
149
+ if (column.editable) {
150
+ childNode = editing ? /* @__PURE__ */ jsx(Form, { form, className: classes.editForm, children: /* @__PURE__ */ jsx(
151
+ Form.Item,
152
+ {
153
+ style: { margin: 0 },
154
+ name: column.dataIndex,
155
+ rules: column.rules,
156
+ children: /* @__PURE__ */ jsx(
157
+ Input,
158
+ {
159
+ ref: inputRef,
160
+ onPressEnter: save,
161
+ onBlur: save,
162
+ ...column.inputProps
163
+ }
164
+ )
165
+ }
166
+ ) }) : /* @__PURE__ */ jsx("div", { className: classes.editBox, onClick: toggleEdit, children: data[column.dataIndex] });
167
+ }
168
+ return /* @__PURE__ */ jsx(Fragment, { children: childNode });
169
+ }
170
+ export {
171
+ VirtualTable as default
172
+ };
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,110 @@
1
+ .szld-main {
2
+ margin: 10px 0 0 0;
3
+ list-style: none;
4
+ }
5
+ .szld-main .szld-item {
6
+ padding-bottom: 20px;
7
+ position: relative;
8
+ margin-bottom: 4px;
9
+ }
10
+ .szld-main .szld-item:last-child .szld-tail {
11
+ display: none;
12
+ }
13
+ .szld-main .szld-item .szld-tail {
14
+ position: absolute;
15
+ left: 8px;
16
+ top: 0px;
17
+ height: 100%;
18
+ padding-top: 15px;
19
+ display: block;
20
+ box-sizing: border-box;
21
+ }
22
+ .szld-main .szld-item .szld-tail::after {
23
+ content: '';
24
+ display: inline-block;
25
+ width: 1px;
26
+ height: 100%;
27
+ background-color: #cecece;
28
+ }
29
+ .szld-main .szld-item .szld-node {
30
+ position: absolute;
31
+ border-radius: 50%;
32
+ display: flex;
33
+ align-items: center;
34
+ justify-content: center;
35
+ background-color: #1864ff;
36
+ left: 4px;
37
+ width: 9px;
38
+ height: 9px;
39
+ }
40
+ .szld-main .szld-item .szld-content {
41
+ position: relative;
42
+ padding-left: 28px;
43
+ top: -3px;
44
+ }
45
+ .szld-main .szld-item .szld-content .szld-collpase {
46
+ top: 0px;
47
+ position: relative;
48
+ display: flex;
49
+ align-items: center;
50
+ gap: 16px;
51
+ font-size: 12px;
52
+ color: #999;
53
+ }
54
+ .szld-main .szld-item .szld-content .szld-collpase span {
55
+ color: #1864ff;
56
+ }
57
+ .szld-main .szld-item .szld-content .szld-btn {
58
+ display: flex;
59
+ align-items: center;
60
+ gap: 8px;
61
+ color: #1864ff;
62
+ cursor: pointer;
63
+ font-size: 12px;
64
+ }
65
+ .szld-main .szld-item .szld-content .szld-title {
66
+ font-size: 16px;
67
+ font-weight: 400;
68
+ color: #333;
69
+ margin-bottom: 8px;
70
+ }
71
+ .szld-main .szld-item .szld-content .szld-dateWrapper {
72
+ display: flex;
73
+ align-items: center;
74
+ gap: 20px;
75
+ font-size: 14px;
76
+ color: #666;
77
+ }
78
+ .szld-main .szld-item .szld-content .szld-remark {
79
+ margin-top: 10px;
80
+ background: #ffffff;
81
+ border: 4px solid #fafafa;
82
+ border-radius: 2px;
83
+ font-size: 14px;
84
+ font-weight: 400;
85
+ color: #666;
86
+ padding: 20px;
87
+ word-break: break-all;
88
+ }
89
+ .szld-main .szld-itemActive .szld-tail {
90
+ padding-top: 17px;
91
+ }
92
+ .szld-main .szld-itemActive .szld-node {
93
+ background-color: #1864ff;
94
+ width: 12px;
95
+ height: 12px;
96
+ left: 2px;
97
+ box-shadow: 0 0 10px 2px #1864ff;
98
+ }
99
+ .szld-main .szld-itemActive .szld-content .szld-title {
100
+ color: #1864ff;
101
+ }
102
+ .szld-main .szld-itemDone .szld-tail::after {
103
+ background-color: #1864ff;
104
+ }
105
+ .szld-main .szld-itemDone .szld-node {
106
+ background-color: #1864ff;
107
+ }
108
+ .szld-main .szld-itemUnDo .szld-node {
109
+ background-color: #cecece;
110
+ }
@@ -0,0 +1,125 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Modal } from "antd";
3
+ import classNames from "classnames";
4
+ import { useState, useMemo } from "react";
5
+ import { DownOutlined, UpOutlined } from "@ant-design/icons";
6
+ const main = "szld-main";
7
+ const item = "szld-item";
8
+ const tail = "szld-tail";
9
+ const node = "szld-node";
10
+ const content = "szld-content";
11
+ const collpase = "szld-collpase";
12
+ const btn = "szld-btn";
13
+ const title = "szld-title";
14
+ const dateWrapper = "szld-dateWrapper";
15
+ const remark = "szld-remark";
16
+ const itemActive = "szld-itemActive";
17
+ const itemDone = "szld-itemDone";
18
+ const itemUnDo = "szld-itemUnDo";
19
+ const styles = {
20
+ main,
21
+ item,
22
+ tail,
23
+ node,
24
+ content,
25
+ collpase,
26
+ btn,
27
+ title,
28
+ dateWrapper,
29
+ remark,
30
+ itemActive,
31
+ itemDone,
32
+ itemUnDo
33
+ };
34
+ const WorkFlowNode = (props) => {
35
+ const { data, current } = props;
36
+ const [isExpand, setExpand] = useState(false);
37
+ const currentIndex = useMemo(() => {
38
+ if (!current || data.length === 0) {
39
+ return 0;
40
+ }
41
+ const index = data.findIndex((v) => v.PNId === current);
42
+ return index;
43
+ }, [current, data]);
44
+ const sliceCount = useMemo(() => {
45
+ if (currentIndex > 1) {
46
+ if (!isExpand) {
47
+ return currentIndex - 1;
48
+ }
49
+ return 0;
50
+ }
51
+ return 0;
52
+ }, [currentIndex, isExpand]);
53
+ const onExpand = () => {
54
+ setExpand(true);
55
+ };
56
+ return /* @__PURE__ */ jsxs("ul", { className: styles.main, children: [
57
+ currentIndex > 1 && !isExpand && /* @__PURE__ */ jsxs("li", { className: classNames(styles.item, styles.itemDone), children: [
58
+ /* @__PURE__ */ jsx("div", { className: styles.tail }),
59
+ /* @__PURE__ */ jsx("div", { className: styles.node }),
60
+ /* @__PURE__ */ jsx("div", { className: styles.content, children: /* @__PURE__ */ jsxs("div", { className: styles.collpase, children: [
61
+ /* @__PURE__ */ jsxs("div", { children: [
62
+ "已收起",
63
+ /* @__PURE__ */ jsx("span", { children: currentIndex - 1 }),
64
+ "个节点"
65
+ ] }),
66
+ /* @__PURE__ */ jsxs("a", { className: styles.btn, onClick: onExpand, children: [
67
+ "展开节点",
68
+ /* @__PURE__ */ jsx(DownOutlined, {})
69
+ ] })
70
+ ] }) })
71
+ ] }),
72
+ data.slice(sliceCount).map((item2, index) => /* @__PURE__ */ jsxs(
73
+ "li",
74
+ {
75
+ className: classNames(
76
+ styles.item,
77
+ currentIndex === index + sliceCount ? styles.itemActive : currentIndex > index + sliceCount ? styles.itemDone : styles.itemUnDo
78
+ ),
79
+ children: [
80
+ /* @__PURE__ */ jsx("div", { className: styles.tail }),
81
+ /* @__PURE__ */ jsx("div", { className: styles.node }),
82
+ /* @__PURE__ */ jsxs("div", { className: styles.content, children: [
83
+ /* @__PURE__ */ jsx("div", { className: styles.title, children: item2.PNName }),
84
+ /* @__PURE__ */ jsxs("div", { className: styles.dateWrapper, children: [
85
+ item2.PlanFinishDate && /* @__PURE__ */ jsxs("span", { children: [
86
+ "预计完成时间: ",
87
+ item2.PlanFinishDate
88
+ ] }),
89
+ item2.UpdateTime && /* @__PURE__ */ jsxs("span", { style: { color: "#333", fontWeight: "bold" }, children: [
90
+ "实际完成时间: ",
91
+ item2.UpdateTime
92
+ ] }),
93
+ isExpand && currentIndex - 1 === index && /* @__PURE__ */ jsxs("a", { className: styles.btn, onClick: () => setExpand(false), children: [
94
+ "收起节点 ",
95
+ /* @__PURE__ */ jsx(UpOutlined, {})
96
+ ] })
97
+ ] }),
98
+ item2.Remark && /* @__PURE__ */ jsx("div", { className: styles.remark, children: item2.Remark })
99
+ ] })
100
+ ]
101
+ },
102
+ item2.PNId
103
+ ))
104
+ ] });
105
+ };
106
+ const showWorkFlow = (props) => {
107
+ const { current, data, ...rest } = props;
108
+ const render = () => {
109
+ Modal.info({
110
+ icon: null,
111
+ title: "流程节点",
112
+ width: 700,
113
+ content: /* @__PURE__ */ jsx(WorkFlowNode, { current, data }),
114
+ closable: true,
115
+ footer: null,
116
+ maskClosable: true,
117
+ ...rest
118
+ });
119
+ };
120
+ render();
121
+ return null;
122
+ };
123
+ export {
124
+ showWorkFlow as default
125
+ };
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
File without changes
@@ -0,0 +1,18 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Result, Button } from "antd";
3
+ import { useNavigate } from "react-router-dom";
4
+ const NoPermissions = () => {
5
+ const navigate = useNavigate();
6
+ return /* @__PURE__ */ jsx(
7
+ Result,
8
+ {
9
+ status: "403",
10
+ title: "403",
11
+ subTitle: "对不起,您暂无权限访问此页面。",
12
+ extra: /* @__PURE__ */ jsx(Button, { type: "primary", onClick: () => navigate(-1), children: "返回上一页" })
13
+ }
14
+ );
15
+ };
16
+ export {
17
+ NoPermissions as default
18
+ };
File without changes
@@ -0,0 +1,18 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Result, Button } from "antd";
3
+ import { useNavigate } from "react-router-dom";
4
+ const NotFound = () => {
5
+ const navigate = useNavigate();
6
+ return /* @__PURE__ */ jsx(
7
+ Result,
8
+ {
9
+ status: "404",
10
+ title: "404",
11
+ subTitle: "对不起,此页面不存在。",
12
+ extra: /* @__PURE__ */ jsx(Button, { type: "primary", onClick: () => navigate("/", { replace: true }), children: "回到首页" })
13
+ }
14
+ );
15
+ };
16
+ export {
17
+ NotFound as default
18
+ };
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
File without changes