@ftlab/one-vue3 0.2.8 → 0.2.10

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/CHANGELOG.md CHANGED
@@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
9
9
 
10
- ## [v0.2.8](https://gitlab.ftlapp.cn/ftl/ftlab/one-vue3/compare/v0.2.2...v0.2.8)
10
+ ## [v0.2.10](https://gitlab.ftlapp.cn/ftl/ftlab/one-vue3/compare/v0.2.2...v0.2.10)
11
11
 
12
12
  ### Commits
13
13
 
@@ -17,6 +17,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
17
17
  - feat: menu style detail change [`93c3abb`](https://gitlab.ftlapp.cn/ftl/ftlab/one-vue3/commit/93c3abba52a689bf6e0e265e4ad2c4aad38605fd)
18
18
  - fix: fix collapse style error [`54e9525`](https://gitlab.ftlapp.cn/ftl/ftlab/one-vue3/commit/54e9525a99b216a9f7bb1b29ec578a768b49cb93)
19
19
  - fix: remove type declare [`d611d3a`](https://gitlab.ftlapp.cn/ftl/ftlab/one-vue3/commit/d611d3ab302a4426e96f1c1e4e7ae940e427c9a9)
20
+ - chore: charge ts to js [`e2feead`](https://gitlab.ftlapp.cn/ftl/ftlab/one-vue3/commit/e2feeadc54c45ddab43a8947d38cb1decc76d230)
21
+ - fix: winter time tz bug [`3f984ee`](https://gitlab.ftlapp.cn/ftl/ftlab/one-vue3/commit/3f984eebce6e6409084439fd0342bbaf883693c1)
20
22
 
21
23
  ## [v0.2.2](https://gitlab.ftlapp.cn/ftl/ftlab/one-vue3/compare/v0.2.1...v0.2.2) - 2023-12-04
22
24
 
package/components.d.ts CHANGED
@@ -11,6 +11,7 @@ declare module 'vue' {
11
11
  ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
12
12
  ElButton: typeof import('element-plus/es')['ElButton']
13
13
  ElCard: typeof import('element-plus/es')['ElCard']
14
+ ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
14
15
  ElDialog: typeof import('element-plus/es')['ElDialog']
15
16
  ElDivider: typeof import('element-plus/es')['ElDivider']
16
17
  ElDropdown: typeof import('element-plus/es')['ElDropdown']
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ftlab/one-vue3",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "description": "One for Apps based on Element UI",
5
5
  "main": "dist/ftlOne.js",
6
6
  "type": "module",
@@ -4,7 +4,7 @@ import storage from '../utils/storage';
4
4
  const userInfo = storage.getAuth();
5
5
 
6
6
  // 同步路由的or翻译为路由name
7
- function translateOrToName(arr: any[]) {
7
+ function translateOrToName(arr) {
8
8
  return arr.map((item) => {
9
9
  if (item.children && item.children.length) {
10
10
  item.children = translateOrToName(item.children);
@@ -23,12 +23,12 @@ export default defineStore('auth', {
23
23
  username: userInfo.username || '',
24
24
  owner: userInfo.owner || '',
25
25
  roles: userInfo.roles || [],
26
- menus: [] as any[],
27
- resources: [] as any[]
26
+ menus: [],
27
+ resources: []
28
28
  };
29
29
  },
30
30
  actions: {
31
- setInfo(authInfo: any) {
31
+ setInfo(authInfo) {
32
32
  if (typeof authInfo === 'object') {
33
33
  this.userInfo = authInfo;
34
34
  this.username = authInfo.username;
@@ -38,7 +38,7 @@ export default defineStore('auth', {
38
38
  storage.setToken(authInfo.token);
39
39
  }
40
40
  },
41
- setMenu(menus: any[]) {
41
+ setMenu(menus) {
42
42
  if (!menus.length) {
43
43
  // 在权限返回为空的时候给menus加一条空数据,防止下次路由进入再次空校验
44
44
  this.menus.push({});
@@ -46,7 +46,7 @@ export default defineStore('auth', {
46
46
  this.menus = translateOrToName(menus);
47
47
  }
48
48
  },
49
- setResources(resources: any[]) {
49
+ setResources(resources) {
50
50
  this.resources = translateOrToName(resources);
51
51
  },
52
52
  logout() {
@@ -8,7 +8,7 @@ export default defineStore('lang', {
8
8
  };
9
9
  },
10
10
  actions: {
11
- setLanguage(lang?: string) {
11
+ setLanguage(lang) {
12
12
  this.language = lang || 'cn';
13
13
  storage.set('language', lang);
14
14
  }
package/utils/date.ts CHANGED
@@ -83,8 +83,8 @@ const local_utc_date: dateTransform = (date, defaultStr = '') => {
83
83
 
84
84
  const local_tz_date: tzTransform = (date, tz) => {
85
85
  if (!date || !isValidDate(date)) return '';
86
- const localOffsetInMinutes = dayjs().utcOffset();
87
- const tzOffsetInMinutes = dayjs().tz(tz).utcOffset();
86
+ const localOffsetInMinutes = dayjs(date).utcOffset();
87
+ const tzOffsetInMinutes = dayjs(date).tz(tz).utcOffset();
88
88
  const offsetDifference = localOffsetInMinutes - tzOffsetInMinutes;
89
89
  return offsetDifference > 0
90
90
  ? dayjs(date).add(offsetDifference, 'minutes').toDate()
File without changes