beer-assembly-biz 1.1.3-alpha.13 → 1.1.3-alpha.15
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/ProgressModal.d.ts +7 -0
- package/ProgressModal.js +34 -0
- package/package.json +2 -2
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare type ProgressCallback = (progress: number, message?: string) => void;
|
|
3
|
+
export declare type ProgressProps = {
|
|
4
|
+
title?: ReactNode;
|
|
5
|
+
prompt?: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare const ProgressModal: (props?: ProgressProps) => [() => ProgressCallback, ReactNode];
|
package/ProgressModal.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Modal, Progress } from 'antd';
|
|
3
|
+
import { Config } from './config';
|
|
4
|
+
export const ProgressModal = (props) => {
|
|
5
|
+
const [isOpenModal, setIsOpenModal] = useState(false);
|
|
6
|
+
const [message, setMessage] = useState('');
|
|
7
|
+
const [progress, setProgress] = useState(0);
|
|
8
|
+
const handler = () => {
|
|
9
|
+
setProgress(0);
|
|
10
|
+
setMessage('');
|
|
11
|
+
setIsOpenModal(true);
|
|
12
|
+
return (progress, message) => {
|
|
13
|
+
if (progress >= 100) {
|
|
14
|
+
setIsOpenModal(false);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
setProgress(progress);
|
|
18
|
+
setMessage(message ?? '');
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
return [handler, React.createElement(React.Fragment, null,
|
|
22
|
+
React.createElement(Modal, { title: props?.title ?? '提交数据中', width: 360, maskClosable: false, closable: false, open: isOpenModal, onCancel: () => setIsOpenModal(false), footer: false, styles: {
|
|
23
|
+
body: { padding: '0' }
|
|
24
|
+
} },
|
|
25
|
+
React.createElement(Progress, { percent: progress }),
|
|
26
|
+
React.createElement("div", { style: {
|
|
27
|
+
color: Config.colors.danger,
|
|
28
|
+
marginTop: 4,
|
|
29
|
+
padding: '2px 0'
|
|
30
|
+
} }, props?.prompt ?? '处理过程中请不要刷新(关闭)浏览器'),
|
|
31
|
+
React.createElement("div", { style: {
|
|
32
|
+
color: '#888'
|
|
33
|
+
} }, (message ?? '') === '' ? '连接服务器...' : message)))];
|
|
34
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "beer-assembly-biz",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.1.3-alpha.
|
|
4
|
+
"version": "1.1.3-alpha.15",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"pub-w": "tsc && copy package.json .\\dist\\package.json && npm publish ./dist",
|
|
7
7
|
"copy": "cp -a src/rich/AIEditor.css dist/rich/AIEditor.css && cp -a src/icon dist/icon && cp -a src/images dist/images",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"react": "18.3.1",
|
|
20
20
|
"react-dom": "18.3.1",
|
|
21
21
|
"react-fast-marquee": "1.6.5",
|
|
22
|
-
"react-router-dom": "6.30.
|
|
22
|
+
"react-router-dom": "6.30.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@babel/core": "7.27.4",
|