@befly-addon/admin 1.5.0 → 1.5.2

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 (54) 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 +2 -9
  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 +12 -10
  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 +23 -2
  48. package/adminViews/permission/role/components/edit.vue +1 -1
  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/apis/api/list.ts +1 -1
  53. package/package.json +2 -2
  54. package/tables/api.json +8 -0
@@ -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,21 +63,14 @@
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";
70
70
  import ILucideLock from "~icons/lucide/lock";
71
71
  import { $Http } from "@/plugins/http";
72
72
  import { $Storage } from "@/plugins/storage";
73
- import { hashPassword } from "../../../utils/hashPassword";
74
-
75
- definePage({
76
- meta: {
77
- title: "登录页",
78
- order: 100
79
- }
80
- });
73
+ import { hashPassword } from "../../utils/hashPassword";
81
74
 
82
75
  const router = useRouter();
83
76
 
@@ -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,7 +74,8 @@ const $Data = $ref({
73
74
  searchKeyword: "",
74
75
  columns: withDefaultColumns([
75
76
  { colKey: "name", title: "接口名称" },
76
- { colKey: "path", title: "接口路径" },
77
+ { colKey: "auth", title: "登录" },
78
+ { colKey: "routePath", title: "接口路径" },
77
79
  { colKey: "method", title: "请求方法" },
78
80
  { colKey: "addonName", title: "所属组件" }
79
81
  ]),
@@ -123,7 +125,7 @@ const $Method = {
123
125
  return;
124
126
  }
125
127
  const keyword = $Data.searchKeyword.toLowerCase();
126
- $Data.tableData = $Data.allData.filter((item) => item.name?.toLowerCase().includes(keyword) || item.path?.toLowerCase().includes(keyword));
128
+ $Data.tableData = $Data.allData.filter((item) => item.name?.toLowerCase().includes(keyword) || item.routePath?.toLowerCase().includes(keyword));
127
129
  },
128
130
 
129
131
  // 高亮行变化
@@ -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
+ }
@@ -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, Input as TInput, CheckboxGroup as TCheckboxGroup, Checkbox as TCheckbox, Button as TButton, MessagePlugin } from "tdesign-vue-next";
45
45
  import ILucideSearch from "~icons/lucide/search";
46
46
  import { $Http } from "@/plugins/http";
@@ -72,6 +72,26 @@ 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
+ if (api && api.auth === 0 && typeof api.value === "string" && api.value) {
89
+ merged.add(api.value);
90
+ }
91
+ }
92
+ }
93
+
94
+ $Data.checkedApiPaths = Array.from(merged);
75
95
  $Data.filteredApiData = $Data.apiData;
76
96
  },
77
97
 
@@ -113,7 +133,8 @@ const $Method = {
113
133
  name: api.name || "",
114
134
  path: api.routePath || "",
115
135
  label: `${api.name || ""} ${api.routePath ? `(${api.routePath})` : ""}`.trim(),
116
- description: api.description
136
+ description: api.description,
137
+ auth: api.auth
117
138
  });
118
139
  });
119
140
 
@@ -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,
@@ -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/apis/api/list.ts CHANGED
@@ -11,7 +11,7 @@ export default {
11
11
  const result = await befly.db.getList({
12
12
  table: "addon_admin_api",
13
13
  where: {
14
- $or: ctx.body.keyword ? [{ name$like: `%${ctx.body.keyword}%` }, { path$like: `%${ctx.body.keyword}%` }] : undefined
14
+ $or: ctx.body.keyword ? [{ name$like: `%${ctx.body.keyword}%` }, { routePath$like: `%${ctx.body.keyword}%` }] : undefined
15
15
  },
16
16
  orderBy: ["id#ASC"],
17
17
  page: ctx.body.page,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@befly-addon/admin",
3
- "version": "1.5.0",
4
- "gitHead": "340c00e4dd05b62d89d25c01922c27cb35bd99af",
3
+ "version": "1.5.2",
4
+ "gitHead": "990c7108a9a791b9816c447309ec586d08b96ab4",
5
5
  "private": false,
6
6
  "description": "Befly - 管理后台功能组件",
7
7
  "keywords": [
package/tables/api.json CHANGED
@@ -6,6 +6,14 @@
6
6
  "max": 100,
7
7
  "index": true
8
8
  },
9
+ "auth": {
10
+ "name": "是否需要登录",
11
+ "type": "number",
12
+ "min": 0,
13
+ "max": 1,
14
+ "default": 1,
15
+ "detail": "0=免登录,1=需登录"
16
+ },
9
17
  "routePath": {
10
18
  "name": "接口路径",
11
19
  "type": "string",