@befly-addon/admin 1.0.21 → 1.0.23

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.
@@ -5,10 +5,16 @@
5
5
  import { Yes, No } from 'befly';
6
6
 
7
7
  export default {
8
- name: '保存管理员角色',
8
+ name: '管理员角色保存',
9
9
  fields: {
10
- adminId: '@id',
11
- roleCode: '角色编码|string|2|50|null|1|^[a-zA-Z0-9_]+$'
10
+ adminId: Fields._id,
11
+ roleCode: {
12
+ name: '角色编码',
13
+ type: 'string',
14
+ min: 2,
15
+ max: 50,
16
+ regexp: '^[a-zA-Z0-9_]+$'
17
+ }
12
18
  },
13
19
  handler: async (befly, ctx) => {
14
20
  // 查询角色是否存在(使用 roleCode 而非 roleId)
@@ -9,7 +9,12 @@ export default {
9
9
  name: '管理员登录',
10
10
  auth: false,
11
11
  fields: {
12
- account: '账号|string|3|100|null|1|null',
12
+ account: {
13
+ name: '账号',
14
+ type: 'string',
15
+ min: 3,
16
+ max: 100
17
+ },
13
18
  password: adminTable.password
14
19
  },
15
20
  required: ['account', 'password'],
package/apis/role/save.ts CHANGED
@@ -5,9 +5,15 @@
5
5
  import { Yes, No } from 'befly';
6
6
 
7
7
  export default {
8
- name: '保存用户角色',
8
+ name: '角色保存',
9
9
  fields: {
10
- roleCode: '角色编码|string|2|50|null|1|^[a-zA-Z0-9_]+$'
10
+ roleCode: {
11
+ name: '角色编码',
12
+ type: 'string',
13
+ min: 2,
14
+ max: 50,
15
+ regexp: '^[a-zA-Z0-9_]+$'
16
+ }
11
17
  },
12
18
  handler: async (befly, ctx) => {
13
19
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@befly-addon/admin",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "Befly - 管理后台功能组件",
5
5
  "type": "module",
6
6
  "private": false,
@@ -39,7 +39,7 @@
39
39
  "url": "https://github.com/chenbimo/befly.git",
40
40
  "directory": "packages/addon-admin"
41
41
  },
42
- "gitHead": "78e963d8659b9f517058145b6baf2678e13eabe5",
42
+ "gitHead": "96c390d5872dac4db5c8b8d24f75afc0d4f1e34f",
43
43
  "dependencies": {
44
44
  "befly": "3.8.11"
45
45
  }
@@ -37,6 +37,7 @@
37
37
  import { shallowRef } from 'vue';
38
38
  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
39
  import { Modal } from '@opentiny/vue';
40
+ import { $Http } from '@/plugins/http';
40
41
 
41
42
  const $Prop = defineProps({
42
43
  modelValue: {
@@ -19,6 +19,7 @@
19
19
  import { shallowRef } from 'vue';
20
20
  import { Button as TinyButton, DialogBox as TinyDialogBox, Select as TinySelect, Tag as TinyTag, Modal } from '@opentiny/vue';
21
21
  import { Modal } from '@opentiny/vue';
22
+ import { $Http } from '@/plugins/http';
22
23
 
23
24
  const $Prop = defineProps({
24
25
  modelValue: {
@@ -87,6 +87,7 @@ import IconLucideTrash2 from '~icons/lucide/trash-2';
87
87
 
88
88
  import EditDialog from './components/edit.vue';
89
89
  import RoleDialog from './components/role.vue';
90
+ import { $Http } from '@/plugins/http';
90
91
 
91
92
  // 响应式数据
92
93
  const $Data = $ref({
@@ -37,6 +37,7 @@
37
37
  import { watch, shallowRef } from 'vue';
38
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';
39
39
  import { Modal } from '@opentiny/vue';
40
+ import { $Http } from '@/plugins/http';
40
41
 
41
42
  const $Prop = defineProps({
42
43
  modelValue: {
@@ -72,6 +72,7 @@ import IconLucidePencil from '~icons/lucide/pencil';
72
72
  import IconLucideTrash2 from '~icons/lucide/trash-2';
73
73
 
74
74
  import EditDialog from './components/edit.vue';
75
+ import { $Http } from '@/plugins/http';
75
76
 
76
77
  import EditDialog from './components/edit.vue';
77
78
 
@@ -27,6 +27,7 @@
27
27
  import IconLucideBox from '~icons/lucide/box';
28
28
  import { Tag as TinyTag } from '@opentiny/vue';
29
29
  import IconLucidePackage from '~icons/lucide/package';
30
+ import { $Http } from '@/plugins/http';
30
31
 
31
32
  // 组件内部数据
32
33
  const addonList = $ref([]);
@@ -37,6 +37,7 @@
37
37
 
38
38
  <script setup>
39
39
  import IconLucideServer from '~icons/lucide/server';
40
+ import { $Http } from '@/plugins/http';
40
41
 
41
42
  // 组件内部数据
42
43
  const environmentInfo = $ref({
@@ -58,6 +58,7 @@ import IconLucideTrendingUp from '~icons/lucide/trending-up';
58
58
  import IconLucideAlertCircle from '~icons/lucide/alert-circle';
59
59
  import IconLucideClock from '~icons/lucide/clock';
60
60
  import IconLucideAlertTriangle from '~icons/lucide/alert-triangle';
61
+ import { $Http } from '@/plugins/http';
61
62
 
62
63
  // 组件内部数据
63
64
  const performanceMetrics = $ref({
@@ -46,6 +46,7 @@ import IconLucideAlertCircle from '~icons/lucide/alert-circle';
46
46
  import IconLucideDatabase from '~icons/lucide/database';
47
47
  import IconLucideMail from '~icons/lucide/mail';
48
48
  import IconLucideHardDrive from '~icons/lucide/hard-drive';
49
+ import { $Http } from '@/plugins/http';
49
50
 
50
51
  // 组件内部数据
51
52
  const services = $ref([]);
@@ -44,6 +44,7 @@ import IconLucideUsers from '~icons/lucide/users';
44
44
  import IconLucideUser from '~icons/lucide/user';
45
45
  import IconLucideMenu from '~icons/lucide/menu';
46
46
  import IconLucideInfo from '~icons/lucide/info';
47
+ import { $Http } from '@/plugins/http';
47
48
 
48
49
  // 组件内部数据
49
50
  const permissionStats = $ref({
@@ -44,6 +44,7 @@ import { Progress as TinyProgress } from '@opentiny/vue';
44
44
  import IconLucideCpu from '~icons/lucide/cpu';
45
45
  import IconLucideHardDrive from '~icons/lucide/hard-drive';
46
46
  import IconLucideActivity from '~icons/lucide/activity';
47
+ import { $Http } from '@/plugins/http';
47
48
 
48
49
  // 组件内部数据
49
50
  const systemResources = $ref({
@@ -43,6 +43,7 @@ import { Button as TinyButton } from '@opentiny/vue';
43
43
  import IconLucideUser from '~icons/lucide/user';
44
44
  import IconLucideMail from '~icons/lucide/mail';
45
45
  import IconLucideRotateCw from '~icons/lucide/rotate-cw';
46
+ import { $Http } from '@/plugins/http';
46
47
 
47
48
  // 响应式数据
48
49
  const $Data = $ref({
@@ -30,6 +30,8 @@ import { useRouter, useRoute } from 'vue-router';
30
30
  import { Button as TinyButton, Form as TinyForm, FormItem as TinyFormItem, Input as TinyInput, Modal } from '@opentiny/vue';
31
31
  import IconLucideUser from '~icons/lucide/user';
32
32
  import IconLucideLock from '~icons/lucide/lock';
33
+ import { $Http } from '@/plugins/http';
34
+ import { $Storage } from '@/plugins/storage';
33
35
 
34
36
  const router = useRouter();
35
37
 
@@ -43,6 +43,7 @@ import IconLucideUser from '~icons/lucide/user';
43
43
  import IconLucideMail from '~icons/lucide/mail';
44
44
  import IconLucideLock from '~icons/lucide/lock';
45
45
  import IconLucideSmile from '~icons/lucide/smile';
46
+ import { $Http } from '@/plugins/http';
46
47
 
47
48
  const emit = defineEmits(['success']);
48
49
 
@@ -30,6 +30,7 @@
30
30
  <script setup>
31
31
  import { watch, shallowRef } from 'vue';
32
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';
33
+ import { $Http } from '@/plugins/http';
33
34
 
34
35
  const $Prop = defineProps({
35
36
  modelValue: {
@@ -76,6 +76,7 @@ import IconLucidePencil from '~icons/lucide/pencil';
76
76
  import IconLucideTrash2 from '~icons/lucide/trash-2';
77
77
 
78
78
  import EditDialog from './components/edit.vue';
79
+ import { $Http } from '@/plugins/http';
79
80
 
80
81
  // 响应式数据
81
82
  const $Data = $ref({
@@ -34,6 +34,7 @@
34
34
 
35
35
  <script setup>
36
36
  import { Button as TinyButton, DialogBox as TinyDialogBox, Search as TinySearch, Checkbox as TinyCheckbox, CheckboxGroup as TinyCheckboxGroup, Modal } from '@opentiny/vue';
37
+ import { $Http } from '@/plugins/http';
37
38
 
38
39
  const $Prop = defineProps({
39
40
  modelValue: {
@@ -32,6 +32,7 @@
32
32
  <script setup>
33
33
  import { shallowRef } from 'vue';
34
34
  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
+ import { $Http } from '@/plugins/http';
35
36
 
36
37
  const $Prop = defineProps({
37
38
  modelValue: {
@@ -15,6 +15,7 @@ import { nextTick, shallowRef } from 'vue';
15
15
  import { Button as TinyButton, DialogBox as TinyDialogBox, Tree as TinyTree, Modal } from '@opentiny/vue';
16
16
 
17
17
  import { arrayToTree } from '@/utils';
18
+ import { $Http } from '@/plugins/http';
18
19
 
19
20
  const $Prop = defineProps({
20
21
  modelValue: {
@@ -87,6 +87,7 @@ import IconLucideTrash2 from '~icons/lucide/trash-2';
87
87
  import EditDialog from './components/edit.vue';
88
88
  import MenuDialog from './components/menu.vue';
89
89
  import ApiDialog from './components/api.vue';
90
+ import { $Http } from '@/plugins/http';
90
91
 
91
92
  // 响应式数据
92
93
  const $Data = $ref({
@@ -78,6 +78,7 @@ import { Tag as TinyTag, Modal } from '@opentiny/vue';
78
78
  import IconLucidePlus from '~icons/lucide/plus';
79
79
  import IconLucideSearch from '~icons/lucide/search';
80
80
  import IconLucideRotateCw from '~icons/lucide/rotate-cw';
81
+ import { $Http } from '@/plugins/http';
81
82
 
82
83
  // 响应式数据
83
84
  const $Data = $ref({