zmdms-webui 0.0.4 → 0.0.5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # zmdms-webui
2
2
 
3
- 基于antd4.24.8版本二开组件库,通过rollup打包。
3
+ 基于 antd4.24.8 版本二开组件库,通过 rollup 打包。
4
4
 
5
5
  # 使用国际化
6
6
 
@@ -9,7 +9,7 @@
9
9
  ```
10
10
  // 引入获取语言配置的hook
11
11
  import useLocale from '../config/useLocale';
12
-
12
+
13
13
  const localeConfig = useLocale(); // 能获取到配置在config/i18n下的语言配置相关信息
14
14
  ```
15
15
 
@@ -18,7 +18,7 @@
18
18
  ```
19
19
  因为我们组件是基于antd的做的二次开发,由于antd的国际化配置是通过ConfigProvider这个context.provider。但是并没有暴露给用户获取。所以需要额外定义一个切换的context供组件获取
20
20
  import { ConfigProvider, ZtxkContext } from 'ztxk-webui'
21
-
21
+
22
22
  <ConfigProvider locale={locale}>
23
23
  <ZtxkContext.Provider value={ztxkConfig}>
24
24
  <App />
@@ -30,7 +30,7 @@
30
30
 
31
31
  # 注意事项
32
32
 
33
- 1. 需要覆盖下webpack5下的限制
33
+ 1. 需要覆盖下 webpack5 下的限制
34
34
 
35
35
  ```
36
36
  启用后,你若在 .mjs 文件或其他 .js 文件中导入模块,并且它们最近的 package.json 中包含 "type" 字段,其值为 "module"时,你应为此文件提供扩展名,否则 webpack 会提示 Module not found 的错误且编译失败。并且 webpack 不会解析 resolve.mainFiles 中定义的文件目录,你必须自己指定文件名。
@@ -49,10 +49,10 @@
49
49
  };
50
50
  ```
51
51
 
52
- 2. 开发时 添加less支持 (less-loader 需要用10.2.0以下的版本)
52
+ 2. 开发时 添加 less 支持 (less-loader 需要用 10.2.0 以下的版本)
53
53
 
54
54
  ```
55
-
55
+ // 进入 react-scripts/config/webpack.config.js
56
56
  {
57
57
  test: /\.(less)$/,
58
58
  exclude: /\.module\.(less)$/,
@@ -84,21 +84,31 @@
84
84
  sideEffects: true,
85
85
  },
86
86
  ```
87
-
88
- 3. 本地link需要注意事项
87
+
88
+ 3. 本地 link 需要注意事项
89
89
 
90
90
  ```
91
91
  Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
92
92
  1. You might have mismatching versions of React and the renderer (such as React DOM)
93
93
  2. You might be breaking the Rules of Hooks
94
94
  3. You might have more than one copy of React in the same app
95
- See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
96
-
95
+ See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
96
+
97
97
  需要切换到ui库下面,将react link到开发项目的node modules下
98
-
98
+
99
99
  cd zmdms-webui
100
100
  npm link ..\zmdms-webmain\node_modules\react
101
101
  ```
102
102
 
103
-
103
+ - 使用 link 后报如下错误,可能是 lock 文件中 有 file:引用本地文件导致的错误
104
+ 删除对应的引用即可
105
+
106
+ ````
107
+ ode:events:491
108
+ throw er; // Unhandled 'error' event
109
+ ^
104
110
 
111
+ Error: EISDIR: illegal operation on a directory, read
112
+ Emitted 'error' event on ReadStream instance at:
113
+ ```
114
+ ````
@@ -8,6 +8,7 @@ interface IProps {
8
8
  loginLogo?: string;
9
9
  loginBg?: string;
10
10
  onFinishHandle?: (values: any) => void;
11
+ loading?: boolean;
11
12
  }
12
13
  declare const Login: React__default.FC<IProps>;
13
14
 
@@ -7,7 +7,7 @@ import Button from '../button/button.js';
7
7
 
8
8
  var Item = Form.Item;
9
9
  var Login = function (props) {
10
- var loginLogo = props.loginLogo, loginBg = props.loginBg, onFinishHandle = props.onFinishHandle;
10
+ var loginLogo = props.loginLogo, loginBg = props.loginBg, onFinishHandle = props.onFinishHandle, loading = props.loading;
11
11
  var form = Form.useForm()[0];
12
12
  var onFinish = function (values) {
13
13
  // 内部处理
@@ -23,7 +23,7 @@ var Login = function (props) {
23
23
  required: true,
24
24
  message: "请输入您的密码",
25
25
  },
26
- ] }, { children: jsx(MemoInput.Password, { size: "large", prefix: jsx(IconFont, { type: "icon-mima", style: { fontSize: "14px", color: "rgba(0,0,0,.65)" } }) }) })), jsx(Item, { children: jsx(Button, __assign({ htmlType: "submit", block: true, className: "form__item--button" }, { children: "\u767B\u5F55" })) }), jsxs("div", __assign({ className: "form__item--remember" }, { children: [jsx(Item, __assign({ name: "remember", valuePropName: "checked" }, { children: jsx(Checkbox, { children: "\u8BB0\u4F4F\u5BC6\u7801" }) })), jsx("div", __assign({ className: "form__item--remember-forget" }, { children: "\u5FD8\u8BB0\u5BC6\u7801" }))] }))] })) })));
26
+ ] }, { children: jsx(MemoInput.Password, { size: "large", prefix: jsx(IconFont, { type: "icon-mima", style: { fontSize: "14px", color: "rgba(0,0,0,.65)" } }) }) })), jsx(Item, { children: jsx(Button, __assign({ htmlType: "submit", block: true, className: "form__item--button", loading: loading }, { children: "\u767B\u5F55" })) }), jsxs("div", __assign({ className: "form__item--remember" }, { children: [jsx(Item, __assign({ name: "remember", valuePropName: "checked" }, { children: jsx(Checkbox, { children: "\u8BB0\u4F4F\u5BC6\u7801" }) })), jsx("div", __assign({ className: "form__item--remember-forget" }, { children: "\u5FD8\u8BB0\u5BC6\u7801" }))] }))] })) })));
27
27
  };
28
28
  Login.displayName = "ZTXK_WEBUI_Login";
29
29