befly-admin 3.4.29 → 3.4.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-admin",
3
- "version": "3.4.29",
3
+ "version": "3.4.30",
4
4
  "description": "Befly Admin - 基于 Vue3 + OpenTiny Vue 的后台管理系统",
5
5
  "type": "module",
6
6
  "private": false,
@@ -29,39 +29,13 @@
29
29
  "sync:admin": "bunx befly sync:admin"
30
30
  },
31
31
  "dependencies": {
32
- "@opentiny/vue-button": "~3.27.0",
33
- "@opentiny/vue-checkbox": "~3.27.0",
34
- "@opentiny/vue-checkbox-group": "~3.27.0",
35
- "@opentiny/vue-dialog-box": "~3.27.0",
36
- "@opentiny/vue-dropdown": "~3.27.0",
37
- "@opentiny/vue-dropdown-item": "~3.27.0",
38
- "@opentiny/vue-dropdown-menu": "~3.27.0",
39
- "@opentiny/vue-form": "~3.27.0",
40
- "@opentiny/vue-form-item": "~3.27.0",
41
- "@opentiny/vue-grid": "~3.27.0",
42
- "@opentiny/vue-grid-column": "~3.27.0",
43
- "@opentiny/vue-icon": "~3.27.0",
44
- "@opentiny/vue-input": "~3.27.0",
45
- "@opentiny/vue-loading": "~3.27.0",
46
- "@opentiny/vue-message": "~3.27.0",
47
- "@opentiny/vue-modal": "~3.27.0",
48
- "@opentiny/vue-notify": "~3.27.0",
49
- "@opentiny/vue-numeric": "~3.27.0",
50
- "@opentiny/vue-pager": "~3.27.0",
51
- "@opentiny/vue-progress": "~3.27.0",
52
- "@opentiny/vue-radio": "~3.27.0",
53
- "@opentiny/vue-radio-group": "~3.27.0",
54
- "@opentiny/vue-search": "~3.27.0",
55
- "@opentiny/vue-select": "~3.27.0",
56
- "@opentiny/vue-tag": "~3.27.0",
57
- "@opentiny/vue-tree": "~3.27.0",
58
32
  "axios": "^1.13.2",
59
33
  "pinia": "^3.0.4",
60
34
  "vue": "^3.5.22",
61
35
  "vue-router": "^4.6.3"
62
36
  },
63
37
  "devDependencies": {
64
- "@befly-addon/admin": "1.0.31",
38
+ "@befly-addon/admin": "1.0.32",
65
39
  "@iconify-json/lucide": "^1.2.72",
66
40
  "@unocss/preset-attributify": "^66.5.6",
67
41
  "@unocss/preset-uno": "^66.5.6",
@@ -82,5 +56,5 @@
82
56
  "node": ">=24.0.0",
83
57
  "pnpm": ">=10.0.0"
84
58
  },
85
- "gitHead": "f279b3e03931a8f13ac1c559e545d18052ce2b87"
59
+ "gitHead": "7f8bd9dc5342e59953997d58e6abf6ca2469b211"
86
60
  }
@@ -122,13 +122,13 @@ const $Method = {
122
122
 
123
123
  // 处理退出登录
124
124
  handleLogout() {
125
- Modal.confirm({
126
- message: '确定要退出登录吗?',
127
- title: '确认',
125
+ DialogPlugin.confirm({
126
+ body: '确定要退出登录吗?',
127
+ header: '确认',
128
128
  onConfirm: () => {
129
129
  $Storage.local.remove('token');
130
130
  router.push('/internal/login');
131
- Message.success('退出成功');
131
+ MessagePlugin.success('退出成功');
132
132
  }
133
133
  });
134
134
  }
package/src/main.js CHANGED
@@ -1,5 +1,8 @@
1
1
  import App from './App.vue';
2
2
 
3
+ // 引入 TDesign 样式
4
+ import 'tdesign-vue-next/es/style/index.css';
5
+
3
6
  // 引入 UnoCSS 样式
4
7
  import 'virtual:uno.css';
5
8
 
@@ -1,5 +1,5 @@
1
1
  import axios from 'axios';
2
- import Modal from '@opentiny/vue-modal';
2
+ import { MessagePlugin } from 'tdesign-vue-next';
3
3
  import { $Storage } from './storage';
4
4
 
5
5
  /**
@@ -49,17 +49,14 @@ request.interceptors.response.use(
49
49
 
50
50
  // 如果code不是0,说明业务失败
51
51
  if (res.code !== 0) {
52
- Modal.message({
53
- message: res.msg || '请求失败',
54
- status: 'error'
55
- });
52
+ MessagePlugin.error(res.msg || '请求失败');
56
53
  return Promise.reject(res.data);
57
54
  }
58
55
 
59
56
  return res;
60
57
  },
61
58
  (error) => {
62
- Modal.message({ message: '网络连接失败', status: 'error' });
59
+ MessagePlugin.error('网络连接失败');
63
60
  return Promise.reject(error);
64
61
  }
65
62
  );
@@ -9,12 +9,9 @@ declare global {
9
9
  const $Config: typeof import('../config/index.js').$Config
10
10
  const $Http: typeof import('../plugins/http.js').$Http
11
11
  const $Storage: typeof import('../plugins/storage.js').$Storage
12
+ const DialogPlugin: typeof import('tdesign-vue-next').DialogPlugin
12
13
  const EffectScope: typeof import('vue').EffectScope
13
- const Loading: typeof import('@opentiny/vue-loading').default
14
- const Message: typeof import('@opentiny/vue-message').default
15
- const MessageBox: typeof import('@opentiny/vue-modal').default
16
- const Modal: typeof import('@opentiny/vue-modal').default
17
- const Notify: typeof import('@opentiny/vue-notify').default
14
+ const MessagePlugin: typeof import('tdesign-vue-next').MessagePlugin
18
15
  const acceptHMRUpdate: typeof import('pinia').acceptHMRUpdate
19
16
  const arrayToTree: typeof import('../utils/index.js').arrayToTree
20
17
  const computed: typeof import('vue').computed
@@ -23,7 +20,6 @@ declare global {
23
20
  const customRef: typeof import('vue').customRef
24
21
  const defineAsyncComponent: typeof import('vue').defineAsyncComponent
25
22
  const defineComponent: typeof import('vue').defineComponent
26
- const definePage: typeof import('unplugin-vue-router/runtime').definePage
27
23
  const defineStore: typeof import('pinia').defineStore
28
24
  const effectScope: typeof import('vue').effectScope
29
25
  const getActivePinia: typeof import('pinia').getActivePinia
@@ -108,11 +104,7 @@ declare module 'vue' {
108
104
  readonly $Http: UnwrapRef<typeof import('../plugins/http.js')['$Http']>
109
105
  readonly $Storage: UnwrapRef<typeof import('../plugins/storage.js')['$Storage']>
110
106
  readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
111
- readonly Loading: UnwrapRef<typeof import('@opentiny/vue-loading')['default']>
112
- readonly Message: UnwrapRef<typeof import('@opentiny/vue-message')['default']>
113
- readonly MessageBox: UnwrapRef<typeof import('@opentiny/vue-modal')['default']>
114
- readonly Modal: UnwrapRef<typeof import('@opentiny/vue-modal')['default']>
115
- readonly Notify: UnwrapRef<typeof import('@opentiny/vue-notify')['default']>
107
+ readonly MessagePlugin: UnwrapRef<typeof import('tdesign-vue-next')['MessagePlugin']>
116
108
  readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
117
109
  readonly arrayToTree: UnwrapRef<typeof import('../utils/index.js')['arrayToTree']>
118
110
  readonly computed: UnwrapRef<typeof import('vue')['computed']>
@@ -16,5 +16,24 @@ declare module 'vue' {
16
16
  'ILucide:home': typeof import('~icons/lucide/home')['default']
17
17
  RouterLink: typeof import('vue-router')['RouterLink']
18
18
  RouterView: typeof import('vue-router')['RouterView']
19
+ TButton: typeof import('tdesign-vue-next')['Button']
20
+ TDialog: typeof import('tdesign-vue-next')['Dialog']
21
+ TDivider: typeof import('tdesign-vue-next')['Divider']
22
+ TDropdown: typeof import('tdesign-vue-next')['Dropdown']
23
+ TDropdownItem: typeof import('tdesign-vue-next')['DropdownItem']
24
+ TDropdownMenu: typeof import('tdesign-vue-next')['DropdownMenu']
25
+ TForm: typeof import('tdesign-vue-next')['Form']
26
+ TFormItem: typeof import('tdesign-vue-next')['FormItem']
27
+ TInput: typeof import('tdesign-vue-next')['Input']
28
+ TInputNumber: typeof import('tdesign-vue-next')['InputNumber']
29
+ TLink: typeof import('tdesign-vue-next')['Link']
30
+ TPagination: typeof import('tdesign-vue-next')['Pagination']
31
+ TRadio: typeof import('tdesign-vue-next')['Radio']
32
+ TRadioGroup: typeof import('tdesign-vue-next')['RadioGroup']
33
+ TSelect: typeof import('tdesign-vue-next')['Select']
34
+ TSpace: typeof import('tdesign-vue-next')['Space']
35
+ TTable: typeof import('tdesign-vue-next')['Table']
36
+ TTag: typeof import('tdesign-vue-next')['Tag']
37
+ TTree: typeof import('tdesign-vue-next')['Tree']
19
38
  }
20
39
  }
@@ -31,7 +31,7 @@ const $Method = {
31
31
  async handleLogin() {
32
32
  // 模拟登录
33
33
  $Storage.local.set('token', 'mock-token-123');
34
- Modal.message({ message: '登录成功', status: 'success' });
34
+ MessagePlugin.success('登录成功');
35
35
  router.push('/');
36
36
  }
37
37
  };
@@ -12,13 +12,10 @@
12
12
  </template>
13
13
 
14
14
  <script setup>
15
- // 无需导入,已自动导入:Modal, Message, Notify, MessageBox, Loading
15
+ // 无需导入,已自动导入:MessagePlugin, DialogPlugin, NotificationPlugin, LoadingPlugin
16
16
 
17
17
  const testModal = () => {
18
- Modal.message({
19
- message: '这是一个成功提示',
20
- status: 'success'
21
- });
18
+ MessagePlugin.success('这是一个成功提示');
22
19
  };
23
20
 
24
21
  const testMessage = () => {
package/vite.config.js CHANGED
@@ -5,6 +5,7 @@ import { VueRouterAutoImports } from 'unplugin-vue-router';
5
5
  import VueDevTools from 'vite-plugin-vue-devtools';
6
6
  import AutoImport from 'unplugin-auto-import/vite';
7
7
  import Components from 'unplugin-vue-components/vite';
8
+ import { TDesignResolver } from 'unplugin-vue-components/resolvers';
8
9
  import Icons from 'unplugin-icons/vite';
9
10
  import IconsResolver from 'unplugin-icons/resolver';
10
11
  import ReactivityTransform from '@vue-macros/reactivity-transform/vite';
@@ -47,19 +48,11 @@ export default defineConfig({
47
48
 
48
49
  // API 自动导入
49
50
  AutoImport({
50
- imports: [
51
- 'vue',
52
- 'pinia',
53
- VueRouterAutoImports,
54
- {
55
- '@opentiny/vue-modal': [
56
- ['default', 'Modal'],
57
- ['default', 'MessageBox']
58
- ],
59
- '@opentiny/vue-notify': [['default', 'Notify']],
60
- '@opentiny/vue-message': [['default', 'Message']],
61
- '@opentiny/vue-loading': [['default', 'Loading']]
62
- }
51
+ imports: ['vue', 'pinia', VueRouterAutoImports],
52
+ resolvers: [
53
+ TDesignResolver({
54
+ library: 'vue-next'
55
+ })
63
56
  ],
64
57
  dts: 'src/types/auto-imports.d.ts',
65
58
  dirs: ['src/utils', 'src/plugins', 'src/config'],
@@ -68,7 +61,12 @@ export default defineConfig({
68
61
 
69
62
  // 组件自动导入
70
63
  Components({
71
- resolvers: [IconsResolver({})],
64
+ resolvers: [
65
+ TDesignResolver({
66
+ library: 'vue-next'
67
+ }),
68
+ IconsResolver({})
69
+ ],
72
70
  dirs: ['src/components'],
73
71
  deep: true,
74
72
  dts: 'src/types/components.d.ts'
@@ -77,7 +75,7 @@ export default defineConfig({
77
75
  // 图标
78
76
  Icons({
79
77
  compiler: 'vue3',
80
- autoInstall: true,
78
+ autoInstall: false,
81
79
  defaultClass: 'icon-befly',
82
80
  defaultStyle: 'margin-right: 8px; vertical-align: middle;'
83
81
  })
@@ -208,6 +206,15 @@ export default defineConfig({
208
206
 
209
207
  // 优化配置
210
208
  optimizeDeps: {
211
- include: ['vue', 'vue-router', 'pinia', 'axios', 'vue-macros/macros']
209
+ include: [
210
+ // Vue 核心框架
211
+ 'vue',
212
+ 'vue-router',
213
+ 'pinia',
214
+ 'axios',
215
+ 'vue-macros/macros',
216
+ // TDesign Vue Next(按需加载,无需预配置)
217
+ 'tdesign-vue-next'
218
+ ]
212
219
  }
213
220
  });