@vft/business 0.0.12 → 0.0.13

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/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@vft/business",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "main": "./src/index.ts",
5
5
  "module": "./src/index.ts",
6
6
  "peerDependencies": {
7
7
  "lodash": "latest",
8
8
  "jsencrypt": "latest",
9
- "@vft/utils": "0.0.57"
9
+ "@vft/utils": "0.0.58"
10
10
  },
11
11
  "scripts": {
12
12
  "pub": "tsx ../scripts/build/src/publish.ts --pkg business"
@@ -9,3 +9,4 @@ const list = import.meta.glob(
9
9
  export const NAVIGATION_URLS = getList(list) as UrlListProps[];
10
10
 
11
11
  export * from './utils';
12
+ export * from './types';
@@ -8,6 +8,7 @@ export interface UrlListProps {
8
8
  export type TITLE_PATH_TYPE = {
9
9
  path: string;
10
10
  title: string;
11
+ icon?: string;
11
12
  category?: string;
12
13
  roles?: string[];
13
14
  };
@@ -1,14 +1,17 @@
1
1
  import { arrSort, cloneDeep, getModulesDefaultContent } from '@vft/utils';
2
2
  import { NAVIGATION_URLS } from './index';
3
- import type { All_URL_LIST_TYPE, TITLE_PATH_TYPE, UrlListProps } from './types';
3
+ import type { All_URL_LIST_TYPE, TITLE_PATH_TYPE } from './types';
4
4
 
5
- export function addPathTitle(list: TITLE_PATH_TYPE[]) {
5
+ export function addPathTitle(list: string[]) {
6
6
  const _list: TITLE_PATH_TYPE[] = [];
7
7
  if (list?.length) {
8
8
  for (const item of list) {
9
9
  const infos = { title: item[0]!, path: item[1]! };
10
10
  if (item[2]) {
11
- Object.assign(infos, { roles: item[2] });
11
+ Object.assign(infos, { icon: item[2] });
12
+ }
13
+ if (item[3]) {
14
+ Object.assign(infos, { roles: item[3] });
12
15
  }
13
16
  _list.push(infos);
14
17
  }
@@ -16,8 +19,10 @@ export function addPathTitle(list: TITLE_PATH_TYPE[]) {
16
19
  return _list;
17
20
  }
18
21
 
19
- export function getList(list) {
20
- const _list = getModulesDefaultContent(list) as UrlListProps[];
22
+ type ModulesDefaultType = Record<string, { default: Record<string, any> }>;
23
+
24
+ export function getList(list: ModulesDefaultType) {
25
+ const _list = getModulesDefaultContent(list) as any[];
21
26
 
22
27
  _list.forEach(item => {
23
28
  item.list = addPathTitle(item.list);
@@ -1,9 +1,25 @@
1
1
  const list = [
2
- ['vue官方中文地址', 'https://cn.vuejs.org/guide/introduction.html'],
3
- ['vue-route官方中文地址', 'https://router.vuejs.org/zh/introduction.html'],
4
- ['vueuse中文地址', 'http://www.vueusejs.com/functions.html'],
5
- ['vueuse官方地址', 'https://vueuse.org/functions.html'],
6
- ['pinia官方地址', 'https://pinia.vuejs.org/introduction.html'],
2
+ [
3
+ 'vue官方中文地址',
4
+ 'https://cn.vuejs.org/guide/introduction.html',
5
+ 'ico-logos:vue',
6
+ ],
7
+ [
8
+ 'vue-route官方中文地址',
9
+ 'https://router.vuejs.org/zh/introduction.html',
10
+ 'ico-logos:vue',
11
+ ],
12
+ [
13
+ 'vueuse中文地址',
14
+ 'http://www.vueusejs.com/functions.html',
15
+ 'ico-logos:vueuse',
16
+ ],
17
+ ['vueuse官方地址', 'https://vueuse.org/functions.html', 'ico-logos:vueuse'],
18
+ [
19
+ 'pinia官方地址',
20
+ 'https://pinia.vuejs.org/introduction.html',
21
+ 'ico-logos:pinia',
22
+ ],
7
23
  ['Vue SFC Playground', 'https://sfc.vuejs.org'],
8
24
  ['Vue Use Playground', 'https://play.vueuse.org/'],
9
25
  [