@witlink/workflow 0.0.4 → 1.0.0

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,58 +1,69 @@
1
1
  ## @witlink/workflow 库介绍
2
- > 工作流模块提供一个页面级组件WfManagePage。
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, // 宿主切换多语言时调用此方法通知此模块,zh_CN、en_US、fr_FR
14
- setTimezone, // 设置时区如 Etc/GMT+8
23
+ setLang, // 宿主切换多语言时调用此方法通知此模块,zh_CN、en_US、fr_FR
15
24
  // Page组件
16
- WfManagePage, // 流程模板定义
17
- } from '@witlink/workflow'
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, // 宿主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: '#165dff',
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
- + Page组件的使用
50
+
51
+ - Page 组件的使用
52
+
44
53
  ```js
45
- import type { RouteRecordRaw } from 'vue-router'
46
- import { WfManagePage } from '@witlink/workflow'
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: 'wfManage',
50
- name: 'wfManage',
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
+ ```