@yqg/permission 1.2.0 → 1.3.0-alpha.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.
Files changed (45) hide show
  1. package/README.md +50 -38
  2. package/dist/apply-modal-CpmDDWWV.js +12865 -0
  3. package/dist/category-selector-BQ0-kg3o.js +1275 -0
  4. package/dist/index-D_0ZQip-.js +2972 -0
  5. package/dist/index-wLkVeDMW.js +5040 -0
  6. package/dist/index.js +2 -2
  7. package/dist/permission-item-Df_aagL1.js +1266 -0
  8. package/dist/{yqg-permission-Bxzu3bMl.js → yqg-permission-BjVCs5lN.js} +3483 -3538
  9. package/dist/yqg-permission.umd.js +250 -0
  10. package/package.json +13 -3
  11. package/plugins/alioss.ts +237 -0
  12. package/src/App.vue +7 -8
  13. package/src/assets/category.png +0 -0
  14. package/src/axios/index.ts +6 -1
  15. package/src/components/apply-modal.vue +254 -157
  16. package/src/components/category-selector.vue +130 -0
  17. package/src/components/permission-item.vue +230 -0
  18. package/src/components/success-modal.vue +4 -4
  19. package/src/components/yqg-permission.vue +23 -110
  20. package/src/hooks/useAttributesCache.ts +21 -0
  21. package/src/hooks/useCategory.ts +21 -0
  22. package/src/hooks/useDragable.ts +9 -10
  23. package/src/hooks/useFormat.ts +50 -0
  24. package/src/hooks/useStatus.ts +82 -0
  25. package/src/i18n/zh-CH.ts +9 -2
  26. package/src/main.ts +2 -0
  27. package/src/typings/index.d.ts +40 -7
  28. package/src/utils/index.ts +9 -0
  29. package/src/yqg-permission/index.ts +13 -1
  30. package/vite.config.ts +18 -2
  31. package/dist/apply-modal-BBqMmKS2.js +0 -8742
  32. package/dist/checkbox-item-CFWhXmMU.js +0 -4991
  33. package/dist/index-BAGvIeoy.js +0 -6164
  34. package/dist/index.umd.cjs +0 -259
  35. package/dist_/345/211/257/346/234/254/apply-modal-Bgd3UWf-.js +0 -8739
  36. package/dist_/345/211/257/346/234/254/card.png +0 -0
  37. package/dist_/345/211/257/346/234/254/checkbox-item-DiIgFuBE.js +0 -4988
  38. package/dist_/345/211/257/346/234/254/dialog.png +0 -0
  39. package/dist_/345/211/257/346/234/254/image.png +0 -0
  40. package/dist_/345/211/257/346/234/254/index-CUS1Jydp.js +0 -6164
  41. package/dist_/345/211/257/346/234/254/index.js +0 -5
  42. package/dist_/345/211/257/346/234/254/index.umd.cjs +0 -259
  43. package/dist_/345/211/257/346/234/254/yqg-permission-ChMRXqi6.js +0 -14944
  44. package/src/assets/apply.png +0 -0
  45. package/src/components/checkbox-item.vue +0 -201
package/README.md CHANGED
@@ -6,21 +6,20 @@
6
6
  ![默认组件](./public/card.png)
7
7
  ![申请弹窗](./public/dialog.png)
8
8
 
9
-
10
9
  ### [Demo URL](https://crane-test.yangqianguan.com/role)
11
10
 
12
11
  ### [接入文档](https://wiki.fintopia.tech/pages/viewpage.action?pageId=117280979)
13
12
 
14
13
  ## Table of Contents
15
14
 
16
- - [Installation](#installation)
17
- - [Install with npm](#install-with-npm)
18
- - [Use inline script directly](#use-inline-script-directly)
19
- - [Usage](#usage)
20
- - [Config](#config)
21
- - [FAQ](#FAQ)
22
- - [Browser Support](#browser-support)
23
- - [Acknowledgement](#acknowledgement)
15
+ - [Installation](#installation)
16
+ - [Install with npm](#install-with-npm)
17
+ - [Use inline script directly](#use-inline-script-directly)
18
+ - [Usage](#usage)
19
+ - [Config](#config)
20
+ - [FAQ](#FAQ)
21
+ - [Browser Support](#browser-support)
22
+ - [Acknowledgement](#acknowledgement)
24
23
 
25
24
  ### Installation
26
25
 
@@ -42,25 +41,25 @@ $ yarn add @yqg/permission
42
41
  $ pnpm install @yqg/permission
43
42
  ```
44
43
 
45
-
46
44
  ### Usage
47
45
 
48
- step1: 在入口文件(main.js/index.js/app.ts/)引入@yag/permission,并调用start方法注册。
46
+ 方式一
47
+
48
+ step1: 在入口文件(main.js/index.js/app.ts/)引入@yag/permission,并调用 start 方法注册。
49
49
  [See example](./src/main.ts)
50
50
 
51
51
  ```js
52
- import yqgPermission from './yqg-permission';
52
+ import yqgPermission from "./yqg-permission";
53
53
  yqgPermission.start();
54
54
  //支持定义组件标签名,默认为‘<yqg-permission></yqg-permission>’
55
- yqgPermission.start({tagName: 'my-element'});
56
-
55
+ yqgPermission.start({ tagName: "my-element" });
57
56
  ```
58
57
 
59
58
  step2: 像原生标签一样进行使用
60
59
  [See example](./src/App.ts)
61
60
 
62
61
  ```js
63
- <yqg-permission
62
+ <yqg-permission
64
63
  workNumber="05184"
65
64
  businessCode="PPDL"
66
65
  :permissions="['permissionCode1, permissionCode2']"
@@ -71,31 +70,41 @@ step2: 像原生标签一样进行使用
71
70
  </yqg-permission>
72
71
 
73
72
  ```
73
+
74
+ 方式二
75
+
76
+ ````html
77
+ <!-- 测试环境 -->
78
+ script src="https://static-ali-test.yangqianguan.com/cdn/yqg-feedback-sdk/1.2.1/feedback-sdk.umd.js"></script>`
79
+
80
+ <!-- 生产环境 -->
81
+ <script async src="https://static-ali.yangqianguan.com/cdn/yqg-feedback-sdk/1.2.1/feedback-sdk.umd.js" />
82
+
74
83
  ### 配置说明
75
84
 
76
85
  支持自定义标签:yqgPermission.start({tagName: 'my-element'});
77
86
 
78
87
  ### yqg-permission 组件参数说明
79
88
 
80
- | 参数项 | 是否必传 | 说明 | 类型 | 默认值 |
81
- | -------------- | -------- | ------------------ | ------------------ | -------- |
82
- | `work-number` | | 当前登陆人工号 | string | '' |
83
- | `business-code` | | 系统的权限code | string | '' |
84
- | `permissions` | | 当前页面下所有权限点 | string[]或string | [] |
85
- | `color` | | 主题色(同antd) | string | #1677ff |
86
- | `locale` | | 当前语言类型(同i18n) | string | zn-CH |
87
- | `success` | | 申请成功时回调函数(vue)| Function | ()=> {} |
88
- | `type` | | 组件类型 | string | default |
89
- | `top` | | 当组件type=“dragElement”时生效| string | 100px |
90
-
89
+ | 参数项 | 是否必传 | 说明 | 类型 | 默认值 |
90
+ | --------------- | ---------------- | ------------------------------- | ----------------- | ------- |
91
+ | `work-number` | | 当前登陆人工号 | string | '' |
92
+ | `business-code` | | 系统的权限 code | string | '' |
93
+ | `permissions` | | 当前页面下所有权限点 | string[]或 string | [] |
94
+ | `color` | | 主题色(同 antd) | string | #1677ff |
95
+ | `locale` | | 当前语言类型(同 i18n) | string | zn-CH |
96
+ | `success` | | 申请成功时回调函数(vue) | Function | ()=> {} |
97
+ | `type` | | 组件类型 | string | default |
98
+ | `top` | | 当组件 type=“dragElement”时生效 | string | 100px |
91
99
 
92
100
  ### type 参数说明
93
101
 
94
102
  type = "default": 默认展示图+按钮组件,点击可弹出弹窗
95
103
  type = "dragElement": 展示‘申请权限’文案,点击可弹出弹窗
96
- type = "custom": 支持自定义组件,以slot的方式添加自定义组件,点击自定义组件可弹出弹窗,例如:
104
+ type = "custom": 支持自定义组件,以 slot 的方式添加自定义组件,点击自定义组件可弹出弹窗,例如:
105
+
97
106
  ```js
98
- <yqg-permission
107
+ <yqg-permission
99
108
  workNumber="05184"
100
109
  businessCode="PPDL"
101
110
  :permissions="['permissionCode1, permissionCode2']"
@@ -107,23 +116,26 @@ type = "custom": 支持自定义组件,以slot的方式添加自定义组件
107
116
  <div>自定义按钮</div>
108
117
  </yqg-permission>
109
118
 
110
- ```
111
-
119
+ ````
112
120
 
113
121
  ### Browser Support
114
122
 
115
- 因为该npm包底层使用webComponent中customElements.define,所以仅支持customElements.define的浏览器
123
+ 因为该 npm 包底层使用 webComponent customElements.define,所以仅支持 customElements.define 的浏览器
116
124
  ![浏览器customElements支持现状](./public/image.png)
117
125
 
118
126
  ### NPM scripts
119
127
 
120
- - `pnpm install`: 安装依赖
121
- - `pnpm dev`: 启动项目
122
- - `pnpm build`: 编译项目
123
- - `npm publish`: 发布项目
128
+ - `pnpm install`: 安装依赖
129
+ - `pnpm dev`: 启动项目
130
+ - `pnpm build`: 编译项目
131
+ - `npm publish`: 发布项目
132
+ - `pnpm demo:build`: 构建,并上传 umd 到测试 CDN
133
+ - `pnpm prod:build`: 构建,并上传 umd 到生产 CDN
134
+
135
+ ### todo
124
136
 
125
- ### todo
126
- todo:优化项 react中成功回调、多语言
137
+ todo:优化项 react 中成功回调、多语言
127
138
 
128
139
  ### 问题反馈
129
- -------
140
+
141
+ ---