@witlink/workflow 1.0.3 → 1.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/README.md +89 -89
- package/dist/index.css +1 -1
- package/dist/index.js +8 -8
- package/dist/index.umd.cjs +3 -3
- package/package.json +56 -56
package/README.md
CHANGED
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
## @witlink/workflow 库介绍
|
|
2
|
-
|
|
3
|
-
> 工作流模块提供一个页面级组件 WfManagePage。
|
|
4
|
-
|
|
5
|
-
- localStorage 需要存储一些必要的信息
|
|
6
|
-
- locale 语言标志 zh_CN en_US fr_FR
|
|
7
|
-
- Access-Token 登录令牌
|
|
8
|
-
- userInfo 用户信息
|
|
9
|
-
- menuInfo 菜单信息
|
|
10
|
-
|
|
11
|
-
### 如何使用@witlink/workflow
|
|
12
|
-
|
|
13
|
-
##### 1. 安装@witlink/workflow
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install @witlink/workflow
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
##### 2. 使用@witlink/workflow
|
|
20
|
-
|
|
21
|
-
```js
|
|
22
|
-
import WitlinkWorkflow, {
|
|
23
|
-
setLang, // 宿主切换多语言时调用此方法通知此模块,zh_CN、en_US、fr_FR
|
|
24
|
-
// Page组件
|
|
25
|
-
WfManagePage, // 流程模板定义
|
|
26
|
-
} from "@witlink/workflow";
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
- 初始化
|
|
30
|
-
|
|
31
|
-
```js
|
|
32
|
-
import WitlinkWorkflow from "@witlink/workflow";
|
|
33
|
-
|
|
34
|
-
const app = createApp(App);
|
|
35
|
-
app.use(WitlinkWorkflow, {
|
|
36
|
-
i18n, // 宿主i18n对象
|
|
37
|
-
pinia, // 宿主pinia对象
|
|
38
|
-
theme: {
|
|
39
|
-
colorPrimary: "#165dff",
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
- 切换多语言
|
|
45
|
-
|
|
46
|
-
```js
|
|
47
|
-
import { setLang } from "@witlink/workflow";
|
|
48
|
-
setLang(lang);
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
- Page 组件的使用
|
|
52
|
-
|
|
53
|
-
```js
|
|
54
|
-
import type { RouteRecordRaw } from "vue-router";
|
|
55
|
-
import { WfManagePage } from "@witlink/workflow";
|
|
56
|
-
export const wfRoutes: RouteRecordRaw[] = [
|
|
57
|
-
{
|
|
58
|
-
path: "wfManage",
|
|
59
|
-
name: "wfManage",
|
|
60
|
-
component: WfManagePage,
|
|
61
|
-
},
|
|
62
|
-
];
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
- 接口转发配置
|
|
66
|
-
|
|
67
|
-
```js
|
|
68
|
-
// 在开发环境
|
|
69
|
-
// vite.config.ts中
|
|
70
|
-
server: {
|
|
71
|
-
proxy: {
|
|
72
|
-
'/
|
|
73
|
-
target: '当前系统的接口代理地址', //目标url
|
|
74
|
-
changeOrigin: true, //支持跨域
|
|
75
|
-
secure: false, // 跳过 HTTPS 证书检查
|
|
76
|
-
rewrite: (path) =>
|
|
77
|
-
path.replace(new RegExp("^" + '/
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
# 配置nginx转发
|
|
85
|
-
location /
|
|
86
|
-
proxy_pass https://ip:port/; # 注意结尾的斜杠
|
|
87
|
-
# 请求 /
|
|
88
|
-
}
|
|
89
|
-
```
|
|
1
|
+
## @witlink/workflow 库介绍
|
|
2
|
+
|
|
3
|
+
> 工作流模块提供一个页面级组件 WfManagePage。
|
|
4
|
+
|
|
5
|
+
- localStorage 需要存储一些必要的信息
|
|
6
|
+
- locale 语言标志 zh_CN en_US fr_FR
|
|
7
|
+
- Access-Token 登录令牌
|
|
8
|
+
- userInfo 用户信息
|
|
9
|
+
- menuInfo 菜单信息
|
|
10
|
+
|
|
11
|
+
### 如何使用@witlink/workflow
|
|
12
|
+
|
|
13
|
+
##### 1. 安装@witlink/workflow
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @witlink/workflow
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
##### 2. 使用@witlink/workflow
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
import WitlinkWorkflow, {
|
|
23
|
+
setLang, // 宿主切换多语言时调用此方法通知此模块,zh_CN、en_US、fr_FR
|
|
24
|
+
// Page组件
|
|
25
|
+
WfManagePage, // 流程模板定义
|
|
26
|
+
} from "@witlink/workflow";
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- 初始化
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
import WitlinkWorkflow from "@witlink/workflow";
|
|
33
|
+
|
|
34
|
+
const app = createApp(App);
|
|
35
|
+
app.use(WitlinkWorkflow, {
|
|
36
|
+
i18n, // 宿主i18n对象
|
|
37
|
+
pinia, // 宿主pinia对象
|
|
38
|
+
theme: {
|
|
39
|
+
colorPrimary: "#165dff",
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
- 切换多语言
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
import { setLang } from "@witlink/workflow";
|
|
48
|
+
setLang(lang);
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
- Page 组件的使用
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
import type { RouteRecordRaw } from "vue-router";
|
|
55
|
+
import { WfManagePage } from "@witlink/workflow";
|
|
56
|
+
export const wfRoutes: RouteRecordRaw[] = [
|
|
57
|
+
{
|
|
58
|
+
path: "wfManage",
|
|
59
|
+
name: "wfManage",
|
|
60
|
+
component: WfManagePage,
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
- 接口转发配置
|
|
66
|
+
|
|
67
|
+
```js
|
|
68
|
+
// 在开发环境
|
|
69
|
+
// vite.config.ts中
|
|
70
|
+
server: {
|
|
71
|
+
proxy: {
|
|
72
|
+
'/cisapi': {
|
|
73
|
+
target: '当前系统的接口代理地址', //目标url
|
|
74
|
+
changeOrigin: true, //支持跨域
|
|
75
|
+
secure: false, // 跳过 HTTPS 证书检查
|
|
76
|
+
rewrite: (path) =>
|
|
77
|
+
path.replace(new RegExp("^" + '/cisapi'), ""),
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# 配置nginx转发
|
|
85
|
+
location /cisapi/ {
|
|
86
|
+
proxy_pass https://ip:port/; # 注意结尾的斜杠
|
|
87
|
+
# 请求 /cisapi/user 会被转发到 http://ip:port/user
|
|
88
|
+
}
|
|
89
|
+
```
|