@witlink/usercenter 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 +155 -0
- package/dist/404.e6ab6ba0.mjs +10 -0
- package/dist/Card.71482621.mjs +1078 -0
- package/dist/DictEx.754c617b.mjs +156 -0
- package/dist/FooterToolBar.2546fb1f.mjs +33 -0
- package/dist/RegionSelect.5272534b.mjs +71 -0
- package/dist/Standard.64ae6a8d.mjs +113 -0
- package/dist/WebClient.0ac67ce0.mjs +153 -0
- package/dist/assets/FooterToolBar.d4297046.css +1 -0
- package/dist/assets/Standard.badeec91.css +1 -0
- package/dist/assets/WebClient.2a3e464e.css +1 -0
- package/dist/assets/index.01a0fb63.css +1 -0
- package/dist/assets/index.19e5ba4c.css +1 -0
- package/dist/assets/index.2164de3b.css +1 -0
- package/dist/assets/index.269f5360.css +1 -0
- package/dist/assets/index.28bdbdc3.css +1 -0
- package/dist/assets/index.3150518d.css +1 -0
- package/dist/assets/index.3a0797c4.css +1 -0
- package/dist/assets/index.53c37fa8.css +1 -0
- package/dist/assets/index.7c8e2d8f.css +1 -0
- package/dist/assets/index.b965b94b.css +1 -0
- package/dist/assets/index.fb7724ee.css +1 -0
- package/dist/index.003313e6.mjs +69436 -0
- package/dist/index.05ef920d.mjs +1129 -0
- package/dist/index.1953dbda.mjs +498 -0
- package/dist/index.1af0e30d.mjs +10 -0
- package/dist/index.2242d1a7.mjs +125 -0
- package/dist/index.2291c8e2.mjs +125 -0
- package/dist/index.3c2af165.mjs +761 -0
- package/dist/index.919ac6b4.mjs +7431 -0
- package/dist/index.941a34c0.mjs +874 -0
- package/dist/index.96479524.mjs +754 -0
- package/dist/index.9803c44f.mjs +125 -0
- package/dist/index.a000e9cf.mjs +1445 -0
- package/dist/index.b3eb7c5d.mjs +10 -0
- package/dist/index.c9138cba.mjs +1104 -0
- package/dist/index.ceea88a4.mjs +1073 -0
- package/dist/index.da7dd593.mjs +10 -0
- package/dist/index.e271ee9d.mjs +643 -0
- package/dist/index.e7802e27.mjs +786 -0
- package/dist/index.ef2e93a1.mjs +386 -0
- package/dist/index.f701b909.mjs +142 -0
- package/dist/index.f9becca6.mjs +6 -0
- package/dist/index.fa4bb855.mjs +7645 -0
- package/dist/index.html +1 -0
- package/dist/use-dict-by-type.c90c1d31.mjs +24 -0
- package/dist/usercenter.umd.js +6237 -0
- package/package.json +26 -0
- package/version.md +2 -0
package/README.md
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
## @witlink/usercenter lib库介绍
|
|
2
|
+
> 为了提供给其他系统使用用户中心的页面,所以提供了@witlink/usercenter lib库,将打包产物发布为npm包供其他系统使用
|
|
3
|
+
|
|
4
|
+
### 如何发布npm包
|
|
5
|
+
[如何发布npm包](https://blog.csdn.net/m0_75044165/article/details/144183114)
|
|
6
|
+
|
|
7
|
+
### 如何使用@witlink/usercenter包
|
|
8
|
+
##### 1. 安装@witlink/usercenter包
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @witlink/usercenter
|
|
12
|
+
```
|
|
13
|
+
##### 2. 使用@witlink/usercenter包
|
|
14
|
+
```js
|
|
15
|
+
import {
|
|
16
|
+
changeLanguage, // 切换多语言方法
|
|
17
|
+
userCenterRouteMap, // 路由表
|
|
18
|
+
|
|
19
|
+
// 以下为组件
|
|
20
|
+
SysFunctions, // 菜单管理
|
|
21
|
+
SysLang, // 多语言
|
|
22
|
+
SysOrg, // 公司管理
|
|
23
|
+
SysOrgan, // 组织架构管理
|
|
24
|
+
SysParameter, // 系统参数
|
|
25
|
+
SysRole, // 角色管理
|
|
26
|
+
SysUser, // 用户管理
|
|
27
|
+
SysUserInfo, //个人中心
|
|
28
|
+
} from '@witlink/usercenter'
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
+ 切换多语言
|
|
32
|
+
|
|
33
|
+
```js
|
|
34
|
+
// 在应用初始化和切换多语言时调用该方法
|
|
35
|
+
type LangType = 'zh_CN' | 'en_US' | 'fr_FR'
|
|
36
|
+
changeLanguage(lang: LangType)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
+ 使用@witlink/usercenter包的组件
|
|
40
|
+
1. 通过路由表注册组件
|
|
41
|
+
|
|
42
|
+
```js
|
|
43
|
+
// userCenterRouteMap 结构如下
|
|
44
|
+
interface userCenterRouteMapType = {
|
|
45
|
+
'/sys/functions': SysFunctions,
|
|
46
|
+
'/sys/lang': SysLang,
|
|
47
|
+
'/sys/org': SysOrg,
|
|
48
|
+
'/sys/organ': SysOrgan,
|
|
49
|
+
'/sys/parameter': SysParameter,
|
|
50
|
+
'/sys/role': SysRole,
|
|
51
|
+
'/sys/user': SysUser,
|
|
52
|
+
'/sys/userinfo': SysUserInfo,
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
{
|
|
56
|
+
path: '/userinfo',
|
|
57
|
+
name: 'userinfo',
|
|
58
|
+
component: () => userCenterRouteMap['/sys/userinfo'],
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
2. 直接使用组件
|
|
63
|
+
|
|
64
|
+
```js
|
|
65
|
+
{
|
|
66
|
+
path: '/userinfo',
|
|
67
|
+
name: 'userinfo',
|
|
68
|
+
component: SysUserInfo,
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
#### 3. 修改@witlink/usercenter的组件主题
|
|
73
|
+
|
|
74
|
+
> 目前仅支持统一修改ant design vue 提供的 `SeedToken MapToken ` 的各项配置改变各页面的主题 或者 通过`:deep()` 深度修改各组件的样式
|
|
75
|
+
|
|
76
|
+
+ 目前支持的配置项如下(如有其他参数需要-联系作者):
|
|
77
|
+
```css
|
|
78
|
+
colorPrimary: var(--uc-primary-color); // #1677ff
|
|
79
|
+
colorPrimaryBorder: var(--uc-primary-border-color); // #91caff;
|
|
80
|
+
colorPrimaryBorderHover: var(--uc-primary-border-hover-color); // #69b1ff;
|
|
81
|
+
colorPrimaryText: var(--uc-primary-text-color); // #1677ff;
|
|
82
|
+
colorPrimaryTextActive: var(--uc-primary-text-active-color); // #0958d9;
|
|
83
|
+
colorPrimaryTextHover: var(--uc-primary-text-hover-color); // #4096ff;
|
|
84
|
+
borderRadius:var(--uc-border-radius); 4px;
|
|
85
|
+
colorLink: var(--uc-link-color); // #1677ff;
|
|
86
|
+
```
|
|
87
|
+
+ 如何修改各参数的值
|
|
88
|
+
|
|
89
|
+
1. 初始修改各参数值设置
|
|
90
|
+
```css
|
|
91
|
+
:root {
|
|
92
|
+
--uc-primary-color: #1677ff;
|
|
93
|
+
--uc-primary-border-color: #91caff;
|
|
94
|
+
--uc-primary-border-hover-color:#69b1ff;
|
|
95
|
+
--uc-primary-text-color: #1677ff;
|
|
96
|
+
--uc-primary-text-active-color: #0958d9;
|
|
97
|
+
--uc-primary-text-hover-color: #4096ff;
|
|
98
|
+
--uc-border-radius: 4px;
|
|
99
|
+
--uc-link-color: #1677ff;
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
2. 需要动态切换主题时
|
|
104
|
+
```js
|
|
105
|
+
// 示例 修改colorPrimary 为红色
|
|
106
|
+
|
|
107
|
+
// 1. 建议有动态切换需求时, config的token的需要与外部联动,可以将configToken 存储在store中,读取为 appStore.configToken
|
|
108
|
+
// <a-config-provider
|
|
109
|
+
// :locale="localeMap[appStore.langId]"
|
|
110
|
+
// :theme="{
|
|
111
|
+
// token: appStore.configToken,
|
|
112
|
+
// }"
|
|
113
|
+
// >
|
|
114
|
+
// <App>
|
|
115
|
+
// <Layout></Layout>
|
|
116
|
+
// </App>
|
|
117
|
+
// </a-config-provider>
|
|
118
|
+
// 2. 动态修改主题
|
|
119
|
+
|
|
120
|
+
function changeTheme() {
|
|
121
|
+
document.documentElement.style.setProperty('--uc-primary-color','red');
|
|
122
|
+
|
|
123
|
+
appStore.setConfigToken({
|
|
124
|
+
...getTokenStyle(),
|
|
125
|
+
})
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function getTokenStyle() {
|
|
129
|
+
return {
|
|
130
|
+
colorPrimary: getComputedStyle(document.documentElement).getPropertyValue(
|
|
131
|
+
`--${prefixCls}-primary-color`
|
|
132
|
+
),
|
|
133
|
+
colorPrimaryBorder: getComputedStyle(
|
|
134
|
+
document.documentElement
|
|
135
|
+
).getPropertyValue(`--${prefixCls}-primary-border-color`),
|
|
136
|
+
colorPrimaryBorderHover: getComputedStyle(
|
|
137
|
+
document.documentElement
|
|
138
|
+
).getPropertyValue(`--${prefixCls}-primary-border-hover-color`),
|
|
139
|
+
colorPrimaryText: getComputedStyle(
|
|
140
|
+
document.documentElement
|
|
141
|
+
).getPropertyValue(`--${prefixCls}-primary-text-color`),
|
|
142
|
+
colorPrimaryTextActive: getComputedStyle(
|
|
143
|
+
document.documentElement
|
|
144
|
+
).getPropertyValue(`--${prefixCls}-primary-text-active-color`),
|
|
145
|
+
colorPrimaryTextHover: getComputedStyle(
|
|
146
|
+
document.documentElement
|
|
147
|
+
).getPropertyValue(`--${prefixCls}-primary-text-hover-color`),
|
|
148
|
+
colorLink: getComputedStyle(document.documentElement).getPropertyValue(
|
|
149
|
+
`--${prefixCls}-link-color`
|
|
150
|
+
),
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
changeTheme()
|
|
155
|
+
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { openBlock as e, createElementBlock as r } from "vue";
|
|
2
|
+
import { _ as t } from "./index.003313e6.mjs";
|
|
3
|
+
const c = {};
|
|
4
|
+
function n(o, i) {
|
|
5
|
+
return e(), r("div", null, "404");
|
|
6
|
+
}
|
|
7
|
+
const s = /* @__PURE__ */ t(c, [["render", n], ["__file", "D:/inhe-code/witlink-platform-usercenter-web/witlink-platform-usercenter1/src/views/error/404.vue"]]);
|
|
8
|
+
export {
|
|
9
|
+
s as default
|
|
10
|
+
};
|