@befly-addon/admin 1.5.1 → 1.6.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 (53) hide show
  1. package/adminViews/403_1/index.vue +1 -8
  2. package/adminViews/403_1/meta.json +4 -0
  3. package/adminViews/config/dict/components/edit.vue +1 -1
  4. package/adminViews/config/dict/index.vue +1 -8
  5. package/adminViews/config/dict/meta.json +4 -0
  6. package/adminViews/config/dictType/components/edit.vue +1 -1
  7. package/adminViews/config/dictType/index.vue +1 -8
  8. package/adminViews/config/dictType/meta.json +4 -0
  9. package/adminViews/config/index.vue +0 -9
  10. package/adminViews/config/meta.json +4 -0
  11. package/adminViews/config/system/components/edit.vue +1 -1
  12. package/adminViews/config/system/index.vue +1 -8
  13. package/adminViews/config/system/meta.json +4 -0
  14. package/adminViews/index/components/addonList.vue +1 -1
  15. package/adminViews/index/components/environmentInfo.vue +1 -1
  16. package/adminViews/index/components/operationLogs.vue +1 -1
  17. package/adminViews/index/components/performanceMetrics.vue +1 -1
  18. package/adminViews/index/components/quickActions.vue +1 -1
  19. package/adminViews/index/components/serviceStatus.vue +1 -1
  20. package/adminViews/index/components/systemNotifications.vue +1 -1
  21. package/adminViews/index/components/systemOverview.vue +1 -1
  22. package/adminViews/index/components/systemResources.vue +1 -1
  23. package/adminViews/index/components/userInfo.vue +1 -1
  24. package/adminViews/index/index.vue +1 -8
  25. package/adminViews/index/meta.json +4 -0
  26. package/adminViews/log/email/index.vue +1 -8
  27. package/adminViews/log/email/meta.json +4 -0
  28. package/adminViews/log/index.vue +0 -9
  29. package/adminViews/log/login/index.vue +1 -8
  30. package/adminViews/log/login/meta.json +4 -0
  31. package/adminViews/log/meta.json +4 -0
  32. package/adminViews/log/operate/index.vue +1 -8
  33. package/adminViews/log/operate/meta.json +4 -0
  34. package/adminViews/login_1/index.vue +1 -8
  35. package/adminViews/login_1/meta.json +4 -0
  36. package/adminViews/people/admin/components/edit.vue +1 -1
  37. package/adminViews/people/admin/index.vue +1 -8
  38. package/adminViews/people/admin/meta.json +4 -0
  39. package/adminViews/people/index.vue +0 -9
  40. package/adminViews/people/meta.json +4 -0
  41. package/adminViews/permission/api/index.vue +10 -8
  42. package/adminViews/permission/api/meta.json +4 -0
  43. package/adminViews/permission/index.vue +0 -9
  44. package/adminViews/permission/menu/index.vue +1 -8
  45. package/adminViews/permission/menu/meta.json +4 -0
  46. package/adminViews/permission/meta.json +4 -0
  47. package/adminViews/permission/role/components/api.vue +97 -27
  48. package/adminViews/permission/role/components/edit.vue +1 -6
  49. package/adminViews/permission/role/components/menu.vue +1 -1
  50. package/adminViews/permission/role/index.vue +1 -8
  51. package/adminViews/permission/role/meta.json +4 -0
  52. package/package.json +2 -2
  53. package/tables/api.json +16 -1
@@ -12,17 +12,10 @@
12
12
  </div>
13
13
  </template>
14
14
 
15
- <script setup>
15
+ <script setup lang="ts">
16
16
  import { useRouter } from "vue-router";
17
17
  import { Button as TButton } from "tdesign-vue-next";
18
18
 
19
- definePage({
20
- meta: {
21
- title: "403",
22
- order: 101
23
- }
24
- });
25
-
26
19
  const router = useRouter();
27
20
 
28
21
  const $Method = {
@@ -0,0 +1,4 @@
1
+ {
2
+ "title": "403",
3
+ "order": 101
4
+ }
@@ -22,7 +22,7 @@
22
22
  </TDialog>
23
23
  </template>
24
24
 
25
- <script setup>
25
+ <script setup lang="ts">
26
26
  import { computed } from "vue";
27
27
 
28
28
  import { Dialog as TDialog, Form as TForm, FormItem as TFormItem, Input as TInput, Select as TSelect, Option as TOption, Textarea as TTextarea, InputNumber as TInputNumber, MessagePlugin } from "tdesign-vue-next";
@@ -70,7 +70,7 @@
70
70
  </div>
71
71
  </template>
72
72
 
73
- <script setup>
73
+ <script setup lang="ts">
74
74
  import { onMounted } from "vue";
75
75
 
76
76
  import { Button as TButton, Table as TTable, Input as TInput, Select as TSelect, Option as TOption, Dropdown as TDropdown, DropdownMenu as TDropdownMenu, DropdownItem as TDropdownItem, Pagination as TPagination, MessagePlugin, DialogPlugin } from "tdesign-vue-next";
@@ -85,13 +85,6 @@ import DetailPanel from "@/components/DetailPanel.vue";
85
85
  import { $Http } from "@/plugins/http";
86
86
  import { withDefaultColumns } from "../../../utils/withDefaultColumns";
87
87
 
88
- definePage({
89
- meta: {
90
- title: "字典列表",
91
- order: 2
92
- }
93
- });
94
-
95
88
  const $Data = $ref({
96
89
  tableData: [],
97
90
  typeList: [],
@@ -0,0 +1,4 @@
1
+ {
2
+ "title": "字典列表",
3
+ "order": 2
4
+ }
@@ -17,7 +17,7 @@
17
17
  </TDialog>
18
18
  </template>
19
19
 
20
- <script setup>
20
+ <script setup lang="ts">
21
21
  import { computed } from "vue";
22
22
 
23
23
  import { Dialog as TDialog, Form as TForm, FormItem as TFormItem, Input as TInput, Textarea as TTextarea, InputNumber as TInputNumber, MessagePlugin } from "tdesign-vue-next";
@@ -67,7 +67,7 @@
67
67
  </div>
68
68
  </template>
69
69
 
70
- <script setup>
70
+ <script setup lang="ts">
71
71
  import { onMounted } from "vue";
72
72
 
73
73
  import { Button as TButton, Table as TTable, Input as TInput, Dropdown as TDropdown, DropdownMenu as TDropdownMenu, DropdownItem as TDropdownItem, Pagination as TPagination, MessagePlugin, DialogPlugin } from "tdesign-vue-next";
@@ -82,13 +82,6 @@ import DetailPanel from "@/components/DetailPanel.vue";
82
82
  import { $Http } from "@/plugins/http";
83
83
  import { withDefaultColumns } from "../../../utils/withDefaultColumns";
84
84
 
85
- definePage({
86
- meta: {
87
- title: "字典类型",
88
- order: 1
89
- }
90
- });
91
-
92
85
  const $Data = $ref({
93
86
  tableData: [],
94
87
  loading: false,
@@ -0,0 +1,4 @@
1
+ {
2
+ "title": "字典类型",
3
+ "order": 1
4
+ }
@@ -1,12 +1,3 @@
1
1
  <template>
2
2
  <RouterView />
3
3
  </template>
4
-
5
- <script setup>
6
- definePage({
7
- meta: {
8
- title: "配置管理",
9
- order: 30
10
- }
11
- });
12
- </script>
@@ -0,0 +1,4 @@
1
+ {
2
+ "title": "配置管理",
3
+ "order": 30
4
+ }
@@ -44,7 +44,7 @@
44
44
  </TDialog>
45
45
  </template>
46
46
 
47
- <script setup>
47
+ <script setup lang="ts">
48
48
  import { Dialog as TDialog, Form as TForm, FormItem as TFormItem, Input as TInput, Textarea as TTextarea, InputNumber as TInputNumber, Select as TSelect, Option as TOption, RadioGroup as TRadioGroup, Radio as TRadio, Button as TButton, MessagePlugin } from "tdesign-vue-next";
49
49
  import { $Http } from "@/plugins/http";
50
50
 
@@ -81,7 +81,7 @@
81
81
  </div>
82
82
  </template>
83
83
 
84
- <script setup>
84
+ <script setup lang="ts">
85
85
  import { Button as TButton, Table as TTable, Tag as TTag, Select as TSelect, Option as TOption, Dropdown as TDropdown, DropdownMenu as TDropdownMenu, DropdownItem as TDropdownItem, Pagination as TPagination, MessagePlugin, DialogPlugin } from "tdesign-vue-next";
86
86
  import ILucidePlus from "~icons/lucide/plus";
87
87
  import ILucideRotateCw from "~icons/lucide/rotate-cw";
@@ -93,13 +93,6 @@ import DetailPanel from "@/components/DetailPanel.vue";
93
93
  import { $Http } from "@/plugins/http";
94
94
  import { withDefaultColumns } from "../../../utils/withDefaultColumns";
95
95
 
96
- definePage({
97
- meta: {
98
- title: "系统配置",
99
- order: 3
100
- }
101
- });
102
-
103
96
  // 响应式数据
104
97
  const $Data = $ref({
105
98
  tableData: [],
@@ -0,0 +1,4 @@
1
+ {
2
+ "title": "系统配置",
3
+ "order": 3
4
+ }
@@ -23,7 +23,7 @@
23
23
  </div>
24
24
  </template>
25
25
 
26
- <script setup>
26
+ <script setup lang="ts">
27
27
  import { $Http } from "@/plugins/http";
28
28
 
29
29
  // 组件内部数据
@@ -35,7 +35,7 @@
35
35
  </div>
36
36
  </template>
37
37
 
38
- <script setup>
38
+ <script setup lang="ts">
39
39
  import ILucideServer from "~icons/lucide/server";
40
40
  import { $Http } from "@/plugins/http";
41
41
 
@@ -33,7 +33,7 @@
33
33
  </div>
34
34
  </template>
35
35
 
36
- <script setup>
36
+ <script setup lang="ts">
37
37
  // 组件内部数据
38
38
  const operationLogs = $ref([
39
39
  { id: 1, userName: "管理员", action: "创建角色", module: "权限管理", ip: "192.168.1.100", status: "success", createdAt: Date.now() - 120000 },
@@ -52,7 +52,7 @@
52
52
  </div>
53
53
  </template>
54
54
 
55
- <script setup>
55
+ <script setup lang="ts">
56
56
  import ILucideActivity from "~icons/lucide/activity";
57
57
  import ILucideClock from "~icons/lucide/clock";
58
58
  import ILucideTrendingUp from "~icons/lucide/trending-up";
@@ -11,7 +11,7 @@
11
11
  </div>
12
12
  </template>
13
13
 
14
- <script setup>
14
+ <script setup lang="ts">
15
15
  import { Button as TButton } from "tdesign-vue-next";
16
16
  import ILucideRotateCw from "~icons/lucide/rotate-cw";
17
17
 
@@ -34,7 +34,7 @@
34
34
  </div>
35
35
  </template>
36
36
 
37
- <script setup>
37
+ <script setup lang="ts">
38
38
  import ILucideCheckCircle from "~icons/lucide/check-circle";
39
39
  import ILucideDatabase from "~icons/lucide/database";
40
40
  import ILucideZap from "~icons/lucide/zap";
@@ -25,7 +25,7 @@
25
25
  </div>
26
26
  </template>
27
27
 
28
- <script setup>
28
+ <script setup lang="ts">
29
29
  import { Tag as TTag } from "tdesign-vue-next";
30
30
  import ILucideBell from "~icons/lucide/bell";
31
31
  import ILucideInfo from "~icons/lucide/info";
@@ -34,7 +34,7 @@
34
34
  </div>
35
35
  </template>
36
36
 
37
- <script setup>
37
+ <script setup lang="ts">
38
38
  import ILucideInfo from "~icons/lucide/info";
39
39
  import ILucideMenu from "~icons/lucide/menu";
40
40
  import ILucideWebhook from "~icons/lucide/webhook";
@@ -38,7 +38,7 @@
38
38
  </div>
39
39
  </template>
40
40
 
41
- <script setup>
41
+ <script setup lang="ts">
42
42
  import { Progress as TProgress } from "tdesign-vue-next";
43
43
  import ILucideActivity from "~icons/lucide/activity";
44
44
  import ILucideCpu from "~icons/lucide/cpu";
@@ -38,7 +38,7 @@
38
38
  </div>
39
39
  </template>
40
40
 
41
- <script setup>
41
+ <script setup lang="ts">
42
42
  import { Button as TButton, MessagePlugin } from "tdesign-vue-next";
43
43
  import ILucideUser from "~icons/lucide/user";
44
44
  import ILucideMail from "~icons/lucide/mail";
@@ -19,19 +19,12 @@
19
19
  </div>
20
20
  </template>
21
21
 
22
- <script setup>
22
+ <script setup lang="ts">
23
23
  import SystemOverview from "./components/systemOverview.vue";
24
24
  import ServiceStatus from "./components/serviceStatus.vue";
25
25
  import SystemResources from "./components/systemResources.vue";
26
26
  import PerformanceMetrics from "./components/performanceMetrics.vue";
27
27
  import EnvironmentInfo from "./components/environmentInfo.vue";
28
-
29
- definePage({
30
- meta: {
31
- title: "首页",
32
- order: 1
33
- }
34
- });
35
28
  </script>
36
29
 
37
30
  <style scoped lang="scss">
@@ -0,0 +1,4 @@
1
+ {
2
+ "title": "首页",
3
+ "order": 1
4
+ }
@@ -83,7 +83,7 @@
83
83
  </div>
84
84
  </template>
85
85
 
86
- <script setup>
86
+ <script setup lang="ts">
87
87
  import { Button as TButton, Table as TTable, Tag as TTag, Pagination as TPagination, Dialog as TDialog, Form as TForm, FormItem as TFormItem, Input as TInput, Textarea as TTextarea, Space as TSpace, MessagePlugin } from "tdesign-vue-next";
88
88
  import ILucideRotateCw from "~icons/lucide/rotate-cw";
89
89
  import ILucideSend from "~icons/lucide/send";
@@ -92,13 +92,6 @@ import DetailPanel from "@/components/DetailPanel.vue";
92
92
  import { $Http } from "@/plugins/http";
93
93
  import { withDefaultColumns } from "../../../utils/withDefaultColumns";
94
94
 
95
- definePage({
96
- meta: {
97
- title: "邮件日志",
98
- order: 2
99
- }
100
- });
101
-
102
95
  const sendFormRef = $ref(null);
103
96
 
104
97
  // 响应式数据
@@ -0,0 +1,4 @@
1
+ {
2
+ "title": "邮件日志",
3
+ "order": 2
4
+ }
@@ -1,12 +1,3 @@
1
1
  <template>
2
2
  <RouterView />
3
3
  </template>
4
-
5
- <script setup>
6
- definePage({
7
- meta: {
8
- title: "日志管理",
9
- order: 40
10
- }
11
- });
12
- </script>
@@ -49,20 +49,13 @@
49
49
  </div>
50
50
  </template>
51
51
 
52
- <script setup>
52
+ <script setup lang="ts">
53
53
  import { Button as TButton, Table as TTable, Tag as TTag, Pagination as TPagination, MessagePlugin } from "tdesign-vue-next";
54
54
  import ILucideRotateCw from "~icons/lucide/rotate-cw";
55
55
  import DetailPanel from "@/components/DetailPanel.vue";
56
56
  import { $Http } from "@/plugins/http";
57
57
  import { withDefaultColumns } from "../../../utils/withDefaultColumns";
58
58
 
59
- definePage({
60
- meta: {
61
- title: "登录日志",
62
- order: 1
63
- }
64
- });
65
-
66
59
  // 响应式数据
67
60
  const $Data = $ref({
68
61
  tableData: [],
@@ -0,0 +1,4 @@
1
+ {
2
+ "title": "登录日志",
3
+ "order": 1
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "title": "日志管理",
3
+ "order": 40
4
+ }
@@ -69,20 +69,13 @@
69
69
  </div>
70
70
  </template>
71
71
 
72
- <script setup>
72
+ <script setup lang="ts">
73
73
  import { Button as TButton, Table as TTable, Tag as TTag, Pagination as TPagination, Select as TSelect, Option as TOption, MessagePlugin } from "tdesign-vue-next";
74
74
  import ILucideRotateCw from "~icons/lucide/rotate-cw";
75
75
  import DetailPanel from "@/components/DetailPanel.vue";
76
76
  import { $Http } from "@/plugins/http";
77
77
  import { withDefaultColumns } from "../../../utils/withDefaultColumns";
78
78
 
79
- definePage({
80
- meta: {
81
- title: "操作日志",
82
- order: 3
83
- }
84
- });
85
-
86
79
  // 响应式数据
87
80
  const $Data = $ref({
88
81
  tableData: [],
@@ -0,0 +1,4 @@
1
+ {
2
+ "title": "操作日志",
3
+ "order": 3
4
+ }
@@ -63,7 +63,7 @@
63
63
  </div>
64
64
  </template>
65
65
 
66
- <script setup>
66
+ <script setup lang="ts">
67
67
  import { useRouter } from "vue-router";
68
68
  import { Form as TForm, FormItem as TFormItem, Input as TInput, Button as TButton, Checkbox as TCheckbox, InputAdornment as TInputAdornment, Select as TSelect, Option as TOption, MessagePlugin } from "tdesign-vue-next";
69
69
  import ILucideUser from "~icons/lucide/user";
@@ -72,13 +72,6 @@ import { $Http } from "@/plugins/http";
72
72
  import { $Storage } from "@/plugins/storage";
73
73
  import { hashPassword } from "../../utils/hashPassword";
74
74
 
75
- definePage({
76
- meta: {
77
- title: "登录页",
78
- order: 100
79
- }
80
- });
81
-
82
75
  const router = useRouter();
83
76
 
84
77
  // 表单引用
@@ -0,0 +1,4 @@
1
+ {
2
+ "title": "登录页",
3
+ "order": 100
4
+ }
@@ -33,7 +33,7 @@
33
33
  </TDialog>
34
34
  </template>
35
35
 
36
- <script setup>
36
+ <script setup lang="ts">
37
37
  import {
38
38
  //
39
39
  Dialog as TDialog,
@@ -69,7 +69,7 @@
69
69
  </div>
70
70
  </template>
71
71
 
72
- <script setup>
72
+ <script setup lang="ts">
73
73
  import { Button as TButton, Table as TTable, Tag as TTag, Dropdown as TDropdown, DropdownMenu as TDropdownMenu, DropdownItem as TDropdownItem, Pagination as TPagination, MessagePlugin, DialogPlugin } from "tdesign-vue-next";
74
74
  import ILucidePlus from "~icons/lucide/plus";
75
75
  import ILucideRotateCw from "~icons/lucide/rotate-cw";
@@ -81,13 +81,6 @@ import DetailPanel from "@/components/DetailPanel.vue";
81
81
  import { $Http } from "@/plugins/http";
82
82
  import { withDefaultColumns } from "../../../utils/withDefaultColumns";
83
83
 
84
- definePage({
85
- meta: {
86
- title: "管理员",
87
- order: 1
88
- }
89
- });
90
-
91
84
  // 响应式数据
92
85
  const $Data = $ref({
93
86
  tableData: [],
@@ -0,0 +1,4 @@
1
+ {
2
+ "title": "管理员",
3
+ "order": 1
4
+ }
@@ -1,12 +1,3 @@
1
1
  <template>
2
2
  <RouterView />
3
3
  </template>
4
-
5
- <script setup>
6
- definePage({
7
- meta: {
8
- title: "人员管理",
9
- order: 10
10
- }
11
- });
12
- </script>
@@ -0,0 +1,4 @@
1
+ {
2
+ "title": "人员管理",
3
+ "order": 10
4
+ }
@@ -28,6 +28,10 @@
28
28
  <TTag v-else-if="row.method === 'DELETE'" shape="round" theme="danger" variant="light-outline">DELETE</TTag>
29
29
  <TTag v-else shape="round" variant="light-outline">{{ row.method }}</TTag>
30
30
  </template>
31
+ <template #auth="{ row }">
32
+ <TTag v-if="row.auth === 0" shape="round" theme="success" variant="light-outline">免登录</TTag>
33
+ <TTag v-else shape="round" theme="warning" variant="light-outline">需登录</TTag>
34
+ </template>
31
35
  <template #addonName="{ row }">
32
36
  <TTag v-if="row.addonName" shape="round" variant="light-outline">{{ row.addonTitle || row.addonName }}</TTag>
33
37
  <span v-else>项目</span>
@@ -44,13 +48,17 @@
44
48
  <TTag v-else-if="value === 'DELETE'" shape="round" theme="danger" variant="light-outline">DELETE</TTag>
45
49
  <TTag v-else shape="round" variant="light-outline">{{ value }}</TTag>
46
50
  </template>
51
+ <template #auth="{ value }">
52
+ <TTag v-if="value === 0" shape="round" theme="success" variant="light-outline">免登录</TTag>
53
+ <TTag v-else shape="round" theme="warning" variant="light-outline">需登录</TTag>
54
+ </template>
47
55
  </DetailPanel>
48
56
  </div>
49
57
  </div>
50
58
  </div>
51
59
  </template>
52
60
 
53
- <script setup>
61
+ <script setup lang="ts">
54
62
  import { Button as TButton, Table as TTable, Tag as TTag, Input as TInput, MessagePlugin } from "tdesign-vue-next";
55
63
  import ILucideRotateCw from "~icons/lucide/rotate-cw";
56
64
  import ILucideSearch from "~icons/lucide/search";
@@ -58,13 +66,6 @@ import DetailPanel from "@/components/DetailPanel.vue";
58
66
  import { $Http } from "@/plugins/http";
59
67
  import { withDefaultColumns } from "../../../utils/withDefaultColumns";
60
68
 
61
- definePage({
62
- meta: {
63
- title: "接口列表",
64
- order: 3
65
- }
66
- });
67
-
68
69
  // 响应式数据
69
70
  const $Data = $ref({
70
71
  tableData: [],
@@ -73,6 +74,7 @@ const $Data = $ref({
73
74
  searchKeyword: "",
74
75
  columns: withDefaultColumns([
75
76
  { colKey: "name", title: "接口名称" },
77
+ { colKey: "auth", title: "登录" },
76
78
  { colKey: "path", title: "接口路径" },
77
79
  { colKey: "method", title: "请求方法" },
78
80
  { colKey: "addonName", title: "所属组件" }
@@ -0,0 +1,4 @@
1
+ {
2
+ "title": "接口列表",
3
+ "order": 3
4
+ }
@@ -1,12 +1,3 @@
1
1
  <template>
2
2
  <RouterView />
3
3
  </template>
4
-
5
- <script setup>
6
- definePage({
7
- meta: {
8
- title: "权限设置",
9
- order: 20
10
- }
11
- });
12
- </script>
@@ -39,7 +39,7 @@
39
39
  </div>
40
40
  </template>
41
41
 
42
- <script setup>
42
+ <script setup lang="ts">
43
43
  import { Button as TButton, Table as TTable, Tag as TTag, MessagePlugin } from "tdesign-vue-next";
44
44
  import ILucideRotateCw from "~icons/lucide/rotate-cw";
45
45
  import DetailPanel from "@/components/DetailPanel.vue";
@@ -47,13 +47,6 @@ import { $Http } from "@/plugins/http";
47
47
  import { arrayToTree } from "../../../utils/arrayToTree";
48
48
  import { withDefaultColumns } from "../../../utils/withDefaultColumns";
49
49
 
50
- definePage({
51
- meta: {
52
- title: "菜单列表",
53
- order: 2
54
- }
55
- });
56
-
57
50
  // 响应式数据
58
51
  const $Data = $ref({
59
52
  tableData: [],
@@ -0,0 +1,4 @@
1
+ {
2
+ "title": "菜单列表",
3
+ "order": 2
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "title": "权限设置",
3
+ "order": 20
4
+ }
@@ -12,10 +12,10 @@
12
12
 
13
13
  <!-- 接口分组列表 -->
14
14
  <div class="api-container">
15
- <div class="api-group" v-for="group in $Data.filteredApiData" :key="group.name">
16
- <div class="group-header">{{ group.title }}</div>
17
- <div class="api-checkbox-list">
18
- <TCheckboxGroup v-model="$Data.checkedApiPaths">
15
+ <TCheckboxGroup v-model="$Data.checkedApiPaths">
16
+ <div class="api-group" v-for="group in $Data.filteredApiData" :key="group.name">
17
+ <div class="group-header">{{ group.title }}</div>
18
+ <div class="api-checkbox-list">
19
19
  <TCheckbox v-for="api in group.apis" :key="api.value" :value="api.value">
20
20
  <div class="api-checkbox-label">
21
21
  <div class="api-label-main">
@@ -23,25 +23,25 @@
23
23
  </div>
24
24
  </div>
25
25
  </TCheckbox>
26
- </TCheckboxGroup>
26
+ </div>
27
27
  </div>
28
- </div>
28
+ </TCheckboxGroup>
29
29
  </div>
30
30
  </div>
31
31
 
32
32
  <template #footer>
33
33
  <div class="dialog-footer">
34
- <t-space>
34
+ <TSpace>
35
35
  <TButton theme="default" @click="$Method.onClose">取消</TButton>
36
36
  <TButton theme="primary" :loading="$Data.submitting" @click="$Method.onSubmit">保存</TButton>
37
- </t-space>
37
+ </TSpace>
38
38
  </div>
39
39
  </template>
40
40
  </TDialog>
41
41
  </template>
42
42
 
43
- <script setup>
44
- import { Dialog as TDialog, Input as TInput, CheckboxGroup as TCheckboxGroup, Checkbox as TCheckbox, Button as TButton, MessagePlugin } from "tdesign-vue-next";
43
+ <script setup lang="ts">
44
+ import { Dialog as TDialog, Input as TInput, CheckboxGroup as TCheckboxGroup, Checkbox as TCheckbox, Button as TButton, Space as TSpace, MessagePlugin } from "tdesign-vue-next";
45
45
  import ILucideSearch from "~icons/lucide/search";
46
46
  import { $Http } from "@/plugins/http";
47
47
 
@@ -72,6 +72,27 @@ const $Method = {
72
72
  async initData() {
73
73
  $Method.onShow();
74
74
  await Promise.all([$Method.apiApiAll(), $Method.apiRoleApiDetail()]);
75
+
76
+ // auth=0(免登录)接口默认选中:与角色已有权限做并集,不覆盖。
77
+ const merged = new Set();
78
+ const current = Array.isArray($Data.checkedApiPaths) ? $Data.checkedApiPaths : [];
79
+ for (const p of current) {
80
+ merged.add(p);
81
+ }
82
+
83
+ const groups = Array.isArray($Data.apiData) ? $Data.apiData : [];
84
+ for (const group of groups) {
85
+ const apis = group && group.apis;
86
+ const list = Array.isArray(apis) ? apis : [];
87
+ for (const api of list) {
88
+ const isPublic = api && (api.auth === 0 || api.auth === "0" || api.auth === false);
89
+ if (isPublic && typeof api.value === "string" && api.value) {
90
+ merged.add(api.value);
91
+ }
92
+ }
93
+ }
94
+
95
+ $Data.checkedApiPaths = Array.from(merged);
75
96
  $Data.filteredApiData = $Data.apiData;
76
97
  },
77
98
 
@@ -93,31 +114,54 @@ const $Method = {
93
114
  try {
94
115
  const res = await $Http("/addon/admin/api/all");
95
116
 
96
- // 将接口列表按 addonTitle 分组
117
+ // 将接口列表按 parentPath 分组展示(routePath 已迁移为 path)
97
118
  const apiMap = new Map();
98
119
 
99
- res.data.lists.forEach((api) => {
100
- const addonTitle = api.addonTitle || api.addonName || "项目接口";
101
- const addonName = api.addonName || "app";
120
+ const lists = res && res.data && Array.isArray(res.data.lists) ? res.data.lists : [];
121
+ for (const api of lists) {
122
+ const apiPath = api && typeof api.path === "string" ? api.path : "";
123
+ if (!apiPath) {
124
+ continue;
125
+ }
102
126
 
103
- if (!apiMap.has(addonName)) {
104
- apiMap.set(addonName, {
105
- name: addonName,
106
- title: addonTitle,
127
+ const parentPath = api && typeof api.parentPath === "string" ? api.parentPath : "";
128
+ const groupKey = parentPath || "(未分组)";
129
+
130
+ if (!apiMap.has(groupKey)) {
131
+ apiMap.set(groupKey, {
132
+ name: groupKey,
133
+ title: groupKey,
107
134
  apis: []
108
135
  });
109
136
  }
110
137
 
111
- apiMap.get(addonName).apis.push({
112
- value: api.routePath,
113
- name: api.name || "",
114
- path: api.routePath || "",
115
- label: `${api.name || ""} ${api.routePath ? `(${api.routePath})` : ""}`.trim(),
116
- description: api.description
138
+ apiMap.get(groupKey).apis.push({
139
+ value: apiPath,
140
+ name: (api && typeof api.name === "string" ? api.name : "") || apiPath,
141
+ path: apiPath,
142
+ label: `${(api && typeof api.name === "string" ? api.name : "") || ""} ${apiPath ? `(${apiPath})` : ""}`.trim(),
143
+ description: api ? api.description : undefined,
144
+ auth: api ? api.auth : undefined,
145
+ parentPath: parentPath
146
+ });
147
+ }
148
+
149
+ const groups = Array.from(apiMap.values());
150
+ for (const group of groups) {
151
+ group.apis.sort((a, b) => {
152
+ const ap = typeof a.path === "string" ? a.path : "";
153
+ const bp = typeof b.path === "string" ? b.path : "";
154
+ return ap.localeCompare(bp);
117
155
  });
156
+ }
157
+
158
+ groups.sort((a, b) => {
159
+ const at = typeof a.title === "string" ? a.title : "";
160
+ const bt = typeof b.title === "string" ? b.title : "";
161
+ return at.localeCompare(bt);
118
162
  });
119
163
 
120
- $Data.apiData = Array.from(apiMap.values());
164
+ $Data.apiData = groups;
121
165
  } catch (error) {
122
166
  MessagePlugin.error("加载接口失败");
123
167
  }
@@ -148,7 +192,12 @@ const $Method = {
148
192
  const searchLower = $Data.searchText.toLowerCase();
149
193
  $Data.filteredApiData = $Data.apiData
150
194
  .map((group) => {
151
- const apis = group.apis.filter((api) => api.label.toLowerCase().includes(searchLower));
195
+ const apis = group.apis.filter((api) => {
196
+ const label = api && typeof api.label === "string" ? api.label : "";
197
+ const name = api && typeof api.name === "string" ? api.name : "";
198
+ const path = api && typeof api.path === "string" ? api.path : "";
199
+ return label.toLowerCase().includes(searchLower) || name.toLowerCase().includes(searchLower) || path.toLowerCase().includes(searchLower);
200
+ });
152
201
  return {
153
202
  name: group.name,
154
203
  title: group.title,
@@ -197,6 +246,12 @@ $Method.initData();
197
246
  flex: 1;
198
247
  overflow-y: auto;
199
248
 
249
+ /* CheckboxGroup 默认可能是 inline 布局,容易被内容撑开;这里强制占满容器宽度 */
250
+ :deep(.t-checkbox-group) {
251
+ display: block;
252
+ width: 100%;
253
+ }
254
+
200
255
  .api-group {
201
256
  margin-bottom: 16px;
202
257
  border: 1px solid var(--border-color);
@@ -204,7 +259,22 @@ $Method.initData();
204
259
  overflow: hidden;
205
260
 
206
261
  .api-checkbox-list {
207
- padding: 10px;
262
+ padding: 12px 16px;
263
+ display: flex;
264
+ flex-wrap: wrap;
265
+ gap: 12px;
266
+
267
+ :deep(.t-checkbox) {
268
+ margin: 0;
269
+ flex: 0 0 calc(33.333% - 8px);
270
+ min-width: 0;
271
+
272
+ .t-checkbox__label {
273
+ white-space: nowrap;
274
+ overflow: hidden;
275
+ text-overflow: ellipsis;
276
+ }
277
+ }
208
278
  }
209
279
 
210
280
  &:last-child {
@@ -29,7 +29,7 @@
29
29
  </TDialog>
30
30
  </template>
31
31
 
32
- <script setup>
32
+ <script setup lang="ts">
33
33
  import {
34
34
  //
35
35
  Dialog as TDialog,
@@ -135,8 +135,3 @@ const $Method = {
135
135
 
136
136
  $Method.initData();
137
137
  </script>
138
-
139
- <style scoped lang="scss">
140
- .comp-role-edit {
141
- }
142
- </style>
@@ -40,7 +40,7 @@
40
40
  </TDialog>
41
41
  </template>
42
42
 
43
- <script setup>
43
+ <script setup lang="ts">
44
44
  import { Dialog as TDialog, CheckboxGroup as TCheckboxGroup, Checkbox as TCheckbox, Button as TButton, Input as TInput, MessagePlugin } from "tdesign-vue-next";
45
45
  import ILucideSearch from "~icons/lucide/search";
46
46
  import { $Http } from "@/plugins/http";
@@ -88,7 +88,7 @@
88
88
  </div>
89
89
  </template>
90
90
 
91
- <script setup>
91
+ <script setup lang="ts">
92
92
  import { Button as TButton, Table as TTable, Tag as TTag, Dropdown as TDropdown, DropdownMenu as TDropdownMenu, DropdownItem as TDropdownItem, Pagination as TPagination, MessagePlugin, DialogPlugin } from "tdesign-vue-next";
93
93
  import ILucidePlus from "~icons/lucide/plus";
94
94
  import ILucideRotateCw from "~icons/lucide/rotate-cw";
@@ -104,13 +104,6 @@ import DetailPanel from "@/components/DetailPanel.vue";
104
104
  import { $Http } from "@/plugins/http";
105
105
  import { withDefaultColumns } from "../../../utils/withDefaultColumns";
106
106
 
107
- definePage({
108
- meta: {
109
- title: "角色管理",
110
- order: 1
111
- }
112
- });
113
-
114
107
  // 响应式数据
115
108
  const $Data = $ref({
116
109
  tableData: [],
@@ -0,0 +1,4 @@
1
+ {
2
+ "title": "角色管理",
3
+ "order": 1
4
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@befly-addon/admin",
3
- "version": "1.5.1",
4
- "gitHead": "dc9c3fdf5a392d7dc9761bf9b045e00ed74b1262",
3
+ "version": "1.6.0",
4
+ "gitHead": "0d60e323a83a1fc53822147de877af19cdb972c0",
5
5
  "private": false,
6
6
  "description": "Befly - 管理后台功能组件",
7
7
  "keywords": [
package/tables/api.json CHANGED
@@ -6,13 +6,28 @@
6
6
  "max": 100,
7
7
  "index": true
8
8
  },
9
- "routePath": {
9
+ "auth": {
10
+ "name": "是否需要登录",
11
+ "type": "number",
12
+ "min": 0,
13
+ "max": 1,
14
+ "default": 1,
15
+ "detail": "0=免登录,1=需登录"
16
+ },
17
+ "path": {
10
18
  "name": "接口路径",
11
19
  "type": "string",
12
20
  "min": 1,
13
21
  "max": 200,
14
22
  "index": true
15
23
  },
24
+ "parentPath": {
25
+ "name": "父级路径",
26
+ "type": "string",
27
+ "min": 1,
28
+ "max": 200,
29
+ "index": true
30
+ },
16
31
  "addonName": {
17
32
  "name": "所属插件",
18
33
  "type": "string",