@befly-addon/admin 1.0.28 → 1.0.30

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@befly-addon/admin",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "description": "Befly - 管理后台功能组件",
5
5
  "type": "module",
6
6
  "private": false,
@@ -19,7 +19,6 @@
19
19
  "tables/",
20
20
  "views/",
21
21
  "utils/",
22
- "types/",
23
22
  "addon.config.json",
24
23
  "README.md",
25
24
  "package.json",
@@ -40,7 +39,7 @@
40
39
  "url": "https://github.com/chenbimo/befly.git",
41
40
  "directory": "packages/addon-admin"
42
41
  },
43
- "gitHead": "62797bf96f317ff0e666db73b4edac4435a6ed35",
42
+ "gitHead": "178b2045d0a76ba734ec623b7e478b3024a58e6d",
44
43
  "dependencies": {
45
44
  "befly": "3.8.12"
46
45
  }
@@ -1,15 +1,22 @@
1
- import type { RouteRecordRaw } from 'vue-router';
2
- import type { LayoutConfig } from '../types/layout';
1
+ /**
2
+ * 布局配置接口
3
+ * @typedef {Object} LayoutConfig
4
+ * @property {string} path - 路径
5
+ * @property {string} layoutName - 布局名称
6
+ * @property {import('vue-router').Component} component - 组件
7
+ * @property {LayoutConfig[]} [children] - 子配置
8
+ * @property {Record<string, any>} [meta] - 元信息
9
+ */
3
10
 
4
11
  /**
5
12
  * 自定义布局处理函数
6
13
  * 根据文件名后缀判断使用哪个布局
7
- * @param routes - 原始路由配置
8
- * @param inheritLayout - 继承的布局名称(来自父级目录)
9
- * @returns 处理后的布局配置(不包含实际的布局组件导入)
14
+ * @param {import('vue-router').RouteRecordRaw[]} routes - 原始路由配置
15
+ * @param {string} inheritLayout - 继承的布局名称(来自父级目录)
16
+ * @returns {LayoutConfig[]} 处理后的布局配置(不包含实际的布局组件导入)
10
17
  */
11
- export function Layouts(routes: RouteRecordRaw[], inheritLayout = ''): LayoutConfig[] {
12
- const result: LayoutConfig[] = [];
18
+ export function Layouts(routes, inheritLayout = '') {
19
+ const result = [];
13
20
 
14
21
  for (const route of routes) {
15
22
  const currentPath = route.path || '';
@@ -45,7 +52,7 @@ export function Layouts(routes: RouteRecordRaw[], inheritLayout = ''): LayoutCon
45
52
  const layoutName = match ? match[1] : currentLayout || 'default';
46
53
 
47
54
  // 计算清理后的路径
48
- let cleanPath: string;
55
+ let cleanPath;
49
56
  if (lastPart === 'index' || (lastPart.startsWith('index_') && match)) {
50
57
  // index 或 index_数字 → 改为空路径(由父级路径表示)
51
58
  cleanPath = '';
@@ -61,7 +68,7 @@ export function Layouts(routes: RouteRecordRaw[], inheritLayout = ''): LayoutCon
61
68
  result.push({
62
69
  path: cleanPath,
63
70
  layoutName: layoutName,
64
- component: route.component!,
71
+ component: route.component,
65
72
  meta: route.meta
66
73
  });
67
74
  }
@@ -11,7 +11,7 @@ export function scanBeflyAddonViews() {
11
11
  // 使用绝对路径:基于项目根目录(process.cwd())
12
12
  const projectRoot = process.cwd();
13
13
  const addonBasePath = join(projectRoot, 'node_modules', '@befly-addon');
14
- const routesFolders: Array<{ src: string; path: string }> = [];
14
+ const routesFolders = [];
15
15
 
16
16
  if (!existsSync(addonBasePath)) {
17
17
  return routesFolders;
@@ -34,7 +34,6 @@
34
34
  </template>
35
35
 
36
36
  <script setup>
37
- import { $ref, $shallowRef } from 'vue-macros/macros';
38
37
  import { Button as TinyButton, DialogBox as TinyDialogBox, Form as TinyForm, FormItem as TinyFormItem, Input as TinyInput, Radio as TinyRadio, RadioGroup as TinyRadioGroup, Modal } from '@opentiny/vue';
39
38
  import { $Http } from '@/plugins/http';
40
39
 
@@ -16,7 +16,6 @@
16
16
  </template>
17
17
 
18
18
  <script setup>
19
- import { $ref } from 'vue-macros/macros';
20
19
  import { Button as TinyButton, DialogBox as TinyDialogBox, Select as TinySelect, Tag as TinyTag, Modal } from '@opentiny/vue';
21
20
  import { $Http } from '@/plugins/http';
22
21
 
@@ -78,7 +78,6 @@
78
78
  </template>
79
79
 
80
80
  <script setup>
81
- import { $ref } from 'vue-macros/macros';
82
81
  import { Button as TinyButton, Grid as TinyGrid, GridColumn as TinyGridColumn, Tag as TinyTag, Dropdown as TinyDropdown, DropdownMenu as TinyDropdownMenu, DropdownItem as TinyDropdownItem, Pager as TinyPager, Modal } from '@opentiny/vue';
83
82
  import IconLucidePlus from '~icons/lucide/plus';
84
83
  import IconLucideRotateCw from '~icons/lucide/rotate-cw';
@@ -34,7 +34,6 @@
34
34
  </template>
35
35
 
36
36
  <script setup>
37
- import { $ref, $shallowRef } from 'vue-macros/macros';
38
37
  import { watch } from 'vue';
39
38
  import { Button as TinyButton, DialogBox as TinyDialogBox, Form as TinyForm, FormItem as TinyFormItem, Input as TinyInput, Numeric as TinyNumeric, Radio as TinyRadio, RadioGroup as TinyRadioGroup, Modal } from '@opentiny/vue';
40
39
  import { $Http } from '@/plugins/http';
@@ -65,7 +65,6 @@
65
65
  </template>
66
66
 
67
67
  <script setup>
68
- import { $ref } from 'vue-macros/macros';
69
68
  import { Button as TinyButton, Grid as TinyGrid, GridColumn as TinyGridColumn, Tag as TinyTag, Dropdown as TinyDropdown, DropdownMenu as TinyDropdownMenu, DropdownItem as TinyDropdownItem, Pager as TinyPager, Modal } from '@opentiny/vue';
70
69
  import IconLucidePlus from '~icons/lucide/plus';
71
70
  import IconLucideRotateCw from '~icons/lucide/rotate-cw';
@@ -24,7 +24,6 @@
24
24
  </template>
25
25
 
26
26
  <script setup>
27
- import { $ref } from 'vue-macros/macros';
28
27
  import IconLucideBox from '~icons/lucide/box';
29
28
  import { Tag as TinyTag } from '@opentiny/vue';
30
29
  import IconLucidePackage from '~icons/lucide/package';
@@ -36,7 +36,6 @@
36
36
  </template>
37
37
 
38
38
  <script setup>
39
- import { $ref } from 'vue-macros/macros';
40
39
  import IconLucideServer from '~icons/lucide/server';
41
40
  import { $Http } from '@/plugins/http';
42
41
 
@@ -34,7 +34,6 @@
34
34
  </template>
35
35
 
36
36
  <script setup>
37
- import { $ref } from 'vue-macros/macros';
38
37
  import { Tag as TinyTag } from '@opentiny/vue';
39
38
  import IconLucideFileText from '~icons/lucide/file-text';
40
39
 
@@ -53,7 +53,6 @@
53
53
  </template>
54
54
 
55
55
  <script setup>
56
- import { $ref } from 'vue-macros/macros';
57
56
  import IconLucideActivity from '~icons/lucide/activity';
58
57
  import IconLucideTrendingUp from '~icons/lucide/trending-up';
59
58
  import IconLucideAlertCircle from '~icons/lucide/alert-circle';
@@ -35,7 +35,6 @@
35
35
  </template>
36
36
 
37
37
  <script setup>
38
- import { $ref } from 'vue-macros/macros';
39
38
  import IconLucideCheckCircle from '~icons/lucide/check-circle';
40
39
  import IconLucideZap from '~icons/lucide/zap';
41
40
  import IconLucideCloud from '~icons/lucide/cloud';
@@ -26,7 +26,6 @@
26
26
  </template>
27
27
 
28
28
  <script setup>
29
- import { $ref } from 'vue-macros/macros';
30
29
  import IconLucideBell from '~icons/lucide/bell';
31
30
  import IconLucideCheckCircle from '~icons/lucide/check-circle';
32
31
  import IconLucideAlertTriangle from '~icons/lucide/alert-triangle';
@@ -39,7 +39,6 @@
39
39
  </template>
40
40
 
41
41
  <script setup>
42
- import { $ref } from 'vue-macros/macros';
43
42
  import IconLucideWebhook from '~icons/lucide/webhook';
44
43
  import IconLucideUsers from '~icons/lucide/users';
45
44
  import IconLucideUser from '~icons/lucide/user';
@@ -39,7 +39,6 @@
39
39
  </template>
40
40
 
41
41
  <script setup>
42
- import { $ref } from 'vue-macros/macros';
43
42
  import IconLucideDisc from '~icons/lucide/disc';
44
43
  import { Progress as TinyProgress } from '@opentiny/vue';
45
44
  import IconLucideCpu from '~icons/lucide/cpu';
@@ -37,7 +37,6 @@
37
37
  </template>
38
38
 
39
39
  <script setup>
40
- import { $ref } from 'vue-macros/macros';
41
40
  import IconLucidePhone from '~icons/lucide/phone';
42
41
  import IconLucideClock from '~icons/lucide/clock';
43
42
  import { Button as TinyButton } from '@opentiny/vue';
@@ -24,8 +24,7 @@
24
24
  </TinyForm>
25
25
  </template>
26
26
 
27
- <script setup lang="ts">
28
- import { $ref, $shallowRef } from 'vue-macros/macros';
27
+ <script setup>
29
28
  import { useRouter, useRoute } from 'vue-router';
30
29
  import { Button as TinyButton, Form as TinyForm, FormItem as TinyFormItem, Input as TinyInput, Modal } from '@opentiny/vue';
31
30
  import IconLucideUser from '~icons/lucide/user';
@@ -37,7 +37,6 @@
37
37
  </template>
38
38
 
39
39
  <script setup>
40
- import { $ref, $shallowRef } from 'vue-macros/macros';
41
40
  import { Button as TinyButton, Form as TinyForm, FormItem as TinyFormItem, Input as TinyInput } from '@opentiny/vue';
42
41
  import IconLucideUser from '~icons/lucide/user';
43
42
  import IconLucideMail from '~icons/lucide/mail';
@@ -26,7 +26,6 @@
26
26
  </template>
27
27
 
28
28
  <script setup>
29
- import { $ref } from 'vue-macros/macros';
30
29
  import WelcomePanel from './components/welcomePanel.vue';
31
30
  import EmailLoginForm from './components/emailLoginForm.vue';
32
31
  import RegisterForm from './components/registerForm.vue';
@@ -28,7 +28,6 @@
28
28
  </template>
29
29
 
30
30
  <script setup>
31
- import { $ref, $shallowRef } from 'vue-macros/macros';
32
31
  import { watch } from 'vue';
33
32
  import { Button as TinyButton, DialogBox as TinyDialogBox, Form as TinyForm, FormItem as TinyFormItem, Input as TinyInput, Numeric as TinyNumeric, Radio as TinyRadio, RadioGroup as TinyRadioGroup, Modal } from '@opentiny/vue';
34
33
  import { $Http } from '@/plugins/http';
@@ -68,7 +68,6 @@
68
68
  </template>
69
69
 
70
70
  <script setup>
71
- import { $ref } from 'vue-macros/macros';
72
71
  import { Button as TinyButton, Grid as TinyGrid, GridColumn as TinyGridColumn, Tag as TinyTag, Dropdown as TinyDropdown, DropdownMenu as TinyDropdownMenu, DropdownItem as TinyDropdownItem, Pager as TinyPager, Modal } from '@opentiny/vue';
73
72
  import IconLucidePlus from '~icons/lucide/plus';
74
73
  import IconLucideRotateCw from '~icons/lucide/rotate-cw';
@@ -33,7 +33,6 @@
33
33
  </template>
34
34
 
35
35
  <script setup>
36
- import { $ref } from 'vue-macros/macros';
37
36
  import { Button as TinyButton, DialogBox as TinyDialogBox, Search as TinySearch, Checkbox as TinyCheckbox, CheckboxGroup as TinyCheckboxGroup, Modal } from '@opentiny/vue';
38
37
  import { $Http } from '@/plugins/http';
39
38
 
@@ -30,7 +30,6 @@
30
30
  </template>
31
31
 
32
32
  <script setup>
33
- import { $ref, $shallowRef } from 'vue-macros/macros';
34
33
  import { Button as TinyButton, DialogBox as TinyDialogBox, Form as TinyForm, FormItem as TinyFormItem, Input as TinyInput, Numeric as TinyNumeric, Radio as TinyRadio, RadioGroup as TinyRadioGroup, Modal } from '@opentiny/vue';
35
34
  import { $Http } from '@/plugins/http';
36
35
 
@@ -11,7 +11,6 @@
11
11
  </template>
12
12
 
13
13
  <script setup>
14
- import { $ref, $shallowRef } from 'vue-macros/macros';
15
14
  import { nextTick } from 'vue';
16
15
  import { Button as TinyButton, DialogBox as TinyDialogBox, Tree as TinyTree, Modal } from '@opentiny/vue';
17
16
 
@@ -77,7 +77,6 @@
77
77
  </template>
78
78
 
79
79
  <script setup>
80
- import { $ref } from 'vue-macros/macros';
81
80
  import { Button as TinyButton, Grid as TinyGrid, GridColumn as TinyGridColumn, Tag as TinyTag, Dropdown as TinyDropdown, DropdownMenu as TinyDropdownMenu, DropdownItem as TinyDropdownItem, Pager as TinyPager, Modal } from '@opentiny/vue';
82
81
  import IconLucidePlus from '~icons/lucide/plus';
83
82
  import IconLucideRotateCw from '~icons/lucide/rotate-cw';
@@ -74,7 +74,6 @@
74
74
  </template>
75
75
 
76
76
  <script setup>
77
- import { $ref } from 'vue-macros/macros';
78
77
  import { Tag as TinyTag, Modal } from '@opentiny/vue';
79
78
  import IconLucidePlus from '~icons/lucide/plus';
80
79
  import IconLucideSearch from '~icons/lucide/search';
package/types/layout.ts DELETED
@@ -1,12 +0,0 @@
1
- import type { RouteRecordRaw, Component } from 'vue-router';
2
-
3
- /**
4
- * 布局配置接口
5
- */
6
- export interface LayoutConfig {
7
- path: string;
8
- layoutName: string;
9
- component: Component;
10
- children?: LayoutConfig[];
11
- meta?: Record<string, any>;
12
- }