beer-assembly-biz 1.1.3-alpha.2 → 1.1.3-alpha.20

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/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.2",
4
+ "version": "1.1.3-alpha.20",
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",
@@ -10,40 +10,43 @@
10
10
  "dependencies": {
11
11
  "@ant-design/icons": "5.5.2",
12
12
  "@ant-design/pro-components": "2.8.4",
13
- "@emotion/css": "^11.11.2",
14
- "aieditor": "^1.3.6",
13
+ "@emotion/css": "11.13.5",
14
+ "aieditor": "1.3.8",
15
15
  "antd": "5.23.2",
16
- "beer-network": "1.2.1",
17
- "dayjs": "^1.11.13",
18
- "react": "^18.2.0",
19
- "react-dom": "^18.2.0",
20
- "react-router-dom": "^6.15.0"
16
+ "beer-assembly-plus": "1.1.2-alpha.8",
17
+ "beer-network": "1.2.3",
18
+ "dayjs": "1.11.13",
19
+ "react": "18.3.1",
20
+ "react-dom": "18.3.1",
21
+ "react-fast-marquee": "1.6.5",
22
+ "react-router-dom": "6.30.1"
21
23
  },
22
24
  "devDependencies": {
23
- "@babel/core": "^7.16.0",
24
- "@svgr/webpack": "^5.5.0",
25
- "@types/lodash": "^4.17.16",
26
- "@types/node": "^16.18.101",
27
- "@types/react": "^18.3.3",
28
- "@types/react-dom": "^18.3.0",
29
- "@types/webpack": "^5.28.5",
30
- "@typescript-eslint/eslint-plugin": "^8.26.1",
31
- "@typescript-eslint/parser": "^8.26.1",
32
- "babel-loader": "^8.2.3",
33
- "babel-plugin-named-asset-import": "^0.3.8",
34
- "babel-preset-react-app": "^10.0.1",
35
- "customize-cra": "^1.0.0",
36
- "dotenv": "^16.4.7",
37
- "eslint": "^8.3.0",
38
- "eslint-config-airbnb": "^19.0.4",
39
- "eslint-config-airbnb-base": "^15.0.0",
40
- "eslint-plugin-import": "^2.29.1",
41
- "eslint-plugin-react": "^7.37.4",
42
- "less": "^4.2.2",
43
- "less-loader": "^12.2.0",
44
- "react-app-rewired": "^2.2.1",
45
- "react-scripts": "^5.0.1",
46
- "serve": "^14.2.4",
47
- "typescript": "^5.7.3"
25
+ "@babel/core": "7.27.4",
26
+ "@svgr/webpack": "5.5.0",
27
+ "@types/node": "16.18.126",
28
+ "@types/react": "18.3.23",
29
+ "@types/react-dom": "18.3.7",
30
+ "@types/webpack": "5.28.5",
31
+ "@typescript-eslint/eslint-plugin": "8.35.0",
32
+ "@typescript-eslint/parser": "8.35.0",
33
+ "babel-loader": "8.4.1",
34
+ "babel-plugin-named-asset-import": "0.3.8",
35
+ "babel-preset-react-app": "10.1.0",
36
+ "customize-cra": "1.0.0",
37
+ "dotenv": "16.5.0",
38
+ "eslint": "8.57.1",
39
+ "eslint-config-airbnb": "19.0.4",
40
+ "eslint-config-airbnb-base": "15.0.0",
41
+ "eslint-plugin-import": "2.32.0",
42
+ "eslint-plugin-react": "7.37.5",
43
+ "less": "4.3.0",
44
+ "less-loader": "12.3.0",
45
+ "react-app-rewired": "2.2.1",
46
+ "react-scripts": "5.0.1",
47
+ "serve": "14.2.4",
48
+ "typescript": "5.8.3",
49
+ "webpack": "5.99.9",
50
+ "webpack-cli": "5.1.4"
48
51
  }
49
52
  }
package/promises.d.ts CHANGED
@@ -45,5 +45,11 @@ export declare class ArrayUtils {
45
45
  * 后退导航工具类.
46
46
  */
47
47
  export declare class NavigateUtils {
48
- static useBack(): () => void;
48
+ /**
49
+ * 功能性后退页面.
50
+ * <li>页面依赖浏览器堆栈非常不可靠的,因此在实际操作中是前进页面</li>
51
+ * <li><b>默认是</b>根据当前 <b>路径参数</b> 以及 <b>分页规则</b> 后退到根路径</li>
52
+ * @param param 路径参数 (数值类型:如果是则根据数值后退 字符串:根据指定路径后退).
53
+ */
54
+ static useBack(param?: string | number): (value?: string | number) => void;
49
55
  }
package/promises.js CHANGED
@@ -21,9 +21,7 @@ export class Promises {
21
21
  * 异步任务管理工具.
22
22
  */
23
23
  export class Async {
24
- constructor() {
25
- this.isRun = false;
26
- }
24
+ isRun = false;
27
25
  /**
28
26
  * 同时只有一个函数能运行.
29
27
  * @param func
@@ -118,23 +116,36 @@ export class ArrayUtils {
118
116
  * 后退导航工具类.
119
117
  */
120
118
  export class NavigateUtils {
121
- static useBack() {
119
+ /**
120
+ * 功能性后退页面.
121
+ * <li>页面依赖浏览器堆栈非常不可靠的,因此在实际操作中是前进页面</li>
122
+ * <li><b>默认是</b>根据当前 <b>路径参数</b> 以及 <b>分页规则</b> 后退到根路径</li>
123
+ * @param param 路径参数 (数值类型:如果是则根据数值后退 字符串:根据指定路径后退).
124
+ */
125
+ static useBack(param) {
122
126
  const location = useLocation();
123
127
  const navigate = useNavigate();
124
- return () => {
128
+ const getPath = () => {
125
129
  let partition = pathPartition.find(path => {
126
130
  return location.pathname.toUpperCase()
127
131
  .indexOf(`/${path}/`) > -1;
128
132
  });
129
133
  // 无法确认是否是子页面 则后退一步
130
134
  if (partition === undefined) {
131
- navigate(-1);
132
- return;
135
+ return undefined;
133
136
  }
134
137
  // 如果确认是子页面 则前进路由
135
138
  partition = partition.toLowerCase();
136
- const path = location.pathname.split(`/${partition}/`)[0];
137
- navigate(path);
139
+ return location.pathname.split(`/${partition}/`)[0];
140
+ };
141
+ return (value) => {
142
+ const to = value ?? param ?? getPath() ?? -1;
143
+ if (typeof to === 'string') {
144
+ navigate(to);
145
+ }
146
+ else {
147
+ navigate(to);
148
+ }
138
149
  };
139
150
  }
140
151
  }