@witlink/workflow 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 +36 -25
- package/dist/index.d.ts +1 -11
- package/dist/index.js +1715 -1727
- package/dist/index.umd.cjs +20 -20
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,58 +1,69 @@
|
|
|
1
1
|
## @witlink/workflow 库介绍
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
> 工作流模块提供一个页面级组件 WfManagePage。
|
|
4
|
+
|
|
5
|
+
- localStorage 需要存储一些必要的信息
|
|
6
|
+
- locale 语言标志 zh_CN en_US fr_FR
|
|
7
|
+
- Access-Token 登录令牌
|
|
8
|
+
- userInfo 用户信息
|
|
9
|
+
- menuInfo 菜单信息
|
|
3
10
|
|
|
4
11
|
### 如何使用@witlink/workflow
|
|
12
|
+
|
|
5
13
|
##### 1. 安装@witlink/workflow
|
|
6
14
|
|
|
7
15
|
```bash
|
|
8
16
|
npm install @witlink/workflow
|
|
9
17
|
```
|
|
18
|
+
|
|
10
19
|
##### 2. 使用@witlink/workflow
|
|
20
|
+
|
|
11
21
|
```js
|
|
12
22
|
import WitlinkWorkflow, {
|
|
13
|
-
setLang,
|
|
14
|
-
setTimezone, // 设置时区如 Etc/GMT+8
|
|
23
|
+
setLang, // 宿主切换多语言时调用此方法通知此模块,zh_CN、en_US、fr_FR
|
|
15
24
|
// Page组件
|
|
16
|
-
WfManagePage,
|
|
17
|
-
} from
|
|
25
|
+
WfManagePage, // 流程模板定义
|
|
26
|
+
} from "@witlink/workflow";
|
|
18
27
|
```
|
|
19
28
|
|
|
20
|
-
|
|
29
|
+
- 初始化
|
|
21
30
|
|
|
22
31
|
```js
|
|
23
|
-
import WitlinkWorkflow from "@witlink/workflow"
|
|
32
|
+
import WitlinkWorkflow from "@witlink/workflow";
|
|
24
33
|
|
|
25
|
-
const app = createApp(App)
|
|
34
|
+
const app = createApp(App);
|
|
26
35
|
app.use(WitlinkWorkflow, {
|
|
27
|
-
i18n,
|
|
36
|
+
i18n, // 宿主i18n对象
|
|
28
37
|
pinia, // 宿主pinia对象
|
|
29
|
-
tokenKey: 'pro__Access-Token', // localStorage中存储token的key
|
|
30
|
-
timezone: 'Etc/GMT+8', // 时区
|
|
31
38
|
theme: {
|
|
32
|
-
colorPrimary:
|
|
39
|
+
colorPrimary: "#165dff",
|
|
33
40
|
},
|
|
34
|
-
})
|
|
41
|
+
});
|
|
35
42
|
```
|
|
36
43
|
|
|
37
|
-
|
|
44
|
+
- 切换多语言
|
|
38
45
|
|
|
39
46
|
```js
|
|
40
|
-
import { setLang } from "@witlink/workflow"
|
|
41
|
-
setLang(lang)
|
|
47
|
+
import { setLang } from "@witlink/workflow";
|
|
48
|
+
setLang(lang);
|
|
42
49
|
```
|
|
43
|
-
|
|
50
|
+
|
|
51
|
+
- Page 组件的使用
|
|
52
|
+
|
|
44
53
|
```js
|
|
45
|
-
import type { RouteRecordRaw } from
|
|
46
|
-
import { WfManagePage } from
|
|
47
|
-
export const wfRoutes: RouteRecordRaw[]= [
|
|
54
|
+
import type { RouteRecordRaw } from "vue-router";
|
|
55
|
+
import { WfManagePage } from "@witlink/workflow";
|
|
56
|
+
export const wfRoutes: RouteRecordRaw[] = [
|
|
48
57
|
{
|
|
49
|
-
path:
|
|
50
|
-
name:
|
|
58
|
+
path: "wfManage",
|
|
59
|
+
name: "wfManage",
|
|
51
60
|
component: WfManagePage,
|
|
52
61
|
},
|
|
53
|
-
]
|
|
62
|
+
];
|
|
54
63
|
```
|
|
55
|
-
|
|
64
|
+
|
|
65
|
+
- 接口转发配置
|
|
66
|
+
|
|
56
67
|
```js
|
|
57
68
|
// 在开发环境
|
|
58
69
|
// vite.config.ts中
|
|
@@ -75,4 +86,4 @@ location /wfapi/ {
|
|
|
75
86
|
proxy_pass https://ip:port/; # 注意结尾的斜杠
|
|
76
87
|
# 请求 /wfapi/user 会被转发到 http://ip:port/user
|
|
77
88
|
}
|
|
78
|
-
```
|
|
89
|
+
```
|
package/dist/index.d.ts
CHANGED
|
@@ -11,9 +11,7 @@ export default _default;
|
|
|
11
11
|
|
|
12
12
|
declare function install(app: App, options: WorkflowOptions): void;
|
|
13
13
|
|
|
14
|
-
export declare function
|
|
15
|
-
|
|
16
|
-
export declare function setTimezone(timezone: string): void;
|
|
14
|
+
export declare function setWorkflowLang(lang: string): void;
|
|
17
15
|
|
|
18
16
|
export declare const WfManagePage: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
19
17
|
|
|
@@ -26,14 +24,6 @@ export declare interface WorkflowOptions {
|
|
|
26
24
|
* 宿主pinia对象
|
|
27
25
|
*/
|
|
28
26
|
pinia?: any;
|
|
29
|
-
/**
|
|
30
|
-
* 默认pro__Access-Token
|
|
31
|
-
*/
|
|
32
|
-
tokenKey?: string;
|
|
33
|
-
/**
|
|
34
|
-
* 默认Etc/GMT+8
|
|
35
|
-
*/
|
|
36
|
-
timezone?: string;
|
|
37
27
|
theme?: {
|
|
38
28
|
colorPrimary: string;
|
|
39
29
|
} & Record<string, string>;
|