xto-fronted 0.2.6 → 0.2.7

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 (107) hide show
  1. package/.env.development +4 -0
  2. package/.env.production +4 -0
  3. package/README.md +94 -196
  4. package/dist/{components/Layout/TopMenu.vue.d.ts → App.vue.d.ts} +1 -1
  5. package/dist/api/auth.d.ts +8 -10
  6. package/dist/api/system.d.ts +11 -12
  7. package/dist/api/user.d.ts +12 -3
  8. package/dist/components/Layout/Footer.vue.d.ts +1 -1
  9. package/dist/components/Layout/Header.vue.d.ts +3 -14
  10. package/dist/components/Layout/Sidebar.vue.d.ts +1 -1
  11. package/dist/components/Layout/Tabs.vue.d.ts +1 -1
  12. package/dist/components/Layout/index.vue.d.ts +1 -1
  13. package/dist/composables/useAuth.d.ts +4 -19
  14. package/dist/directives/permission.d.ts +0 -1
  15. package/dist/index-CWRs4WMN.js +372 -0
  16. package/dist/index-CpxpXTQX.js +1462 -0
  17. package/dist/index-Cu3Z2-PY.js +345 -0
  18. package/dist/index-DPEVEyik.js +475 -0
  19. package/dist/index-DYnXaqYf.js +142 -0
  20. package/dist/index.d.ts +12 -25
  21. package/dist/index.es.js +76 -1521
  22. package/dist/index.umd.js +1 -20
  23. package/dist/main.d.ts +0 -1
  24. package/dist/router/dynamicRoutes.d.ts +33 -17
  25. package/dist/router/index.d.ts +4 -26
  26. package/dist/router/layoutRoute.d.ts +18 -0
  27. package/dist/router/staticRoutes.d.ts +2 -18
  28. package/dist/setup.d.ts +17 -0
  29. package/dist/stores/app.d.ts +15 -9
  30. package/dist/stores/auth.d.ts +48 -62
  31. package/dist/stores/index.d.ts +3 -1
  32. package/dist/stores/menu.d.ts +29 -47
  33. package/dist/stores/user.d.ts +84 -64
  34. package/dist/style.css +1 -1
  35. package/dist/utils/auth.d.ts +10 -10
  36. package/dist/utils/permission.d.ts +10 -1
  37. package/dist/utils/request.d.ts +7 -23
  38. package/dist/{components/Layout/Breadcrumb.vue.d.ts → views/dashboard/index.vue.d.ts} +1 -1
  39. package/dist/{components/Error → views/error}/403.vue.d.ts +1 -1
  40. package/dist/{components/Error → views/error}/404.vue.d.ts +1 -1
  41. package/dist/views/login/index.vue.d.ts +4 -0
  42. package/dist/views/system/menu/index.vue.d.ts +4 -0
  43. package/dist/views/system/role/index.vue.d.ts +4 -0
  44. package/dist/views/system/user/index.vue.d.ts +4 -0
  45. package/dist/vite.svg +9 -9
  46. package/index.html +13 -0
  47. package/package.json +27 -31
  48. package/public/vite.svg +10 -0
  49. package/src/App.vue +20 -0
  50. package/src/api/auth.ts +26 -0
  51. package/src/api/system.ts +65 -0
  52. package/src/api/user.ts +46 -0
  53. package/src/assets/styles/_dark.scss +407 -0
  54. package/src/assets/styles/_reset.scss +126 -0
  55. package/src/assets/styles/_root.scss +140 -0
  56. package/src/assets/styles/_transition.scss +119 -0
  57. package/src/assets/styles/_variables.scss +45 -0
  58. package/src/assets/styles/index.scss +187 -0
  59. package/src/components/Layout/Footer.vue +17 -0
  60. package/src/components/Layout/Header.vue +390 -0
  61. package/src/components/Layout/Sidebar.vue +297 -0
  62. package/src/components/Layout/Tabs.vue +134 -0
  63. package/src/components/Layout/index.vue +62 -0
  64. package/src/composables/useAuth.ts +45 -0
  65. package/src/composables/useForm.ts +79 -0
  66. package/src/composables/useTable.ts +97 -0
  67. package/src/directives/permission.ts +38 -0
  68. package/src/enums/index.ts +63 -0
  69. package/src/env.d.ts +17 -0
  70. package/src/index.ts +48 -0
  71. package/src/main.ts +34 -0
  72. package/src/router/dynamicRoutes.ts +163 -0
  73. package/src/router/index.ts +81 -0
  74. package/src/router/layoutRoute.ts +45 -0
  75. package/src/router/staticRoutes.ts +43 -0
  76. package/src/setup.ts +54 -0
  77. package/src/stores/app.ts +163 -0
  78. package/src/stores/auth.ts +66 -0
  79. package/src/stores/index.ts +15 -0
  80. package/src/stores/menu.ts +80 -0
  81. package/src/stores/user.ts +73 -0
  82. package/src/style.css +11 -0
  83. package/src/types/api.d.ts +84 -0
  84. package/src/types/global.d.ts +45 -0
  85. package/src/types/router.d.ts +48 -0
  86. package/src/types/xto.d.ts +149 -0
  87. package/src/utils/auth.ts +62 -0
  88. package/src/utils/permission.ts +42 -0
  89. package/src/utils/request.ts +124 -0
  90. package/src/utils/storage.ts +63 -0
  91. package/src/views/dashboard/index.vue +284 -0
  92. package/src/views/error/403.vue +57 -0
  93. package/src/views/error/404.vue +57 -0
  94. package/src/views/login/index.vue +248 -0
  95. package/src/views/system/menu/index.vue +381 -0
  96. package/src/views/system/role/index.vue +304 -0
  97. package/src/views/system/user/index.vue +327 -0
  98. package/tsconfig.json +26 -0
  99. package/tsconfig.node.json +11 -0
  100. package/vite.config.ts +140 -0
  101. package/dist/api/menu.d.ts +0 -4
  102. package/dist/components/Login/index.vue.d.ts +0 -25
  103. package/dist/components/SettingDrawer/index.vue.d.ts +0 -19
  104. package/dist/composables/index.d.ts +0 -8
  105. package/dist/composables/useApp.d.ts +0 -65
  106. package/dist/composables/useMenu.d.ts +0 -34
  107. package/dist/config/index.d.ts +0 -31
@@ -0,0 +1,119 @@
1
+ // ==============================================
2
+ // Transitions - 过渡动画
3
+ // ==============================================
4
+
5
+ // 淡入淡出
6
+ .fade-enter-active,
7
+ .fade-leave-active {
8
+ transition: opacity var(--transition-duration);
9
+ }
10
+
11
+ .fade-enter-from,
12
+ .fade-leave-to {
13
+ opacity: 0;
14
+ }
15
+
16
+ // 淡入淡出 + 缩放
17
+ .fade-scale-enter-active,
18
+ .fade-scale-leave-active {
19
+ transition: all var(--transition-duration);
20
+ }
21
+
22
+ .fade-scale-enter-from,
23
+ .fade-scale-leave-to {
24
+ opacity: 0;
25
+ transform: scale(0.9);
26
+ }
27
+
28
+ // 淡入淡出 + 滑动
29
+ .fade-transform-enter-active,
30
+ .fade-transform-leave-active {
31
+ transition: all var(--transition-duration-fast);
32
+ }
33
+
34
+ .fade-transform-enter-from {
35
+ opacity: 0;
36
+ transform: translateX(-10px);
37
+ }
38
+
39
+ .fade-transform-leave-to {
40
+ opacity: 0;
41
+ transform: translateX(10px);
42
+ }
43
+
44
+ // 向下滑入
45
+ .slide-down-enter-active,
46
+ .slide-down-leave-active {
47
+ transition: all var(--transition-duration);
48
+ }
49
+
50
+ .slide-down-enter-from,
51
+ .slide-down-leave-to {
52
+ opacity: 0;
53
+ transform: translateY(-20px);
54
+ }
55
+
56
+ // 向上滑入
57
+ .slide-up-enter-active,
58
+ .slide-up-leave-active {
59
+ transition: all var(--transition-duration);
60
+ }
61
+
62
+ .slide-up-enter-from,
63
+ .slide-up-leave-to {
64
+ opacity: 0;
65
+ transform: translateY(20px);
66
+ }
67
+
68
+ // 向左滑入
69
+ .slide-left-enter-active,
70
+ .slide-left-leave-active {
71
+ transition: all var(--transition-duration);
72
+ }
73
+
74
+ .slide-left-enter-from,
75
+ .slide-left-leave-to {
76
+ opacity: 0;
77
+ transform: translateX(20px);
78
+ }
79
+
80
+ // 向右滑入
81
+ .slide-right-enter-active,
82
+ .slide-right-leave-active {
83
+ transition: all var(--transition-duration);
84
+ }
85
+
86
+ .slide-right-enter-from,
87
+ .slide-right-leave-to {
88
+ opacity: 0;
89
+ transform: translateX(-20px);
90
+ }
91
+
92
+ // 缩放
93
+ .zoom-enter-active,
94
+ .zoom-leave-active {
95
+ transition: all var(--transition-duration);
96
+ }
97
+
98
+ .zoom-enter-from,
99
+ .zoom-leave-to {
100
+ opacity: 0;
101
+ transform: scale(0.5);
102
+ }
103
+
104
+ // 列表动画
105
+ .list-enter-active,
106
+ .list-leave-active {
107
+ transition: all var(--transition-duration);
108
+ }
109
+
110
+ .list-enter-from,
111
+ .list-leave-to {
112
+ opacity: 0;
113
+ transform: translateY(30px);
114
+ }
115
+
116
+ // 侧边栏折叠动画
117
+ .collapse-transition {
118
+ transition: width var(--transition-duration), padding var(--transition-duration);
119
+ }
@@ -0,0 +1,45 @@
1
+ // ==============================================
2
+ // SCSS Variables - 用于样式计算
3
+ // ==============================================
4
+
5
+ // 主题色
6
+ $color-primary: #409eff;
7
+ $color-success: #67c23a;
8
+ $color-warning: #e6a23c;
9
+ $color-danger: #f56c6c;
10
+ $color-info: #909399;
11
+
12
+ // 文字颜色
13
+ $color-text-primary: #303133;
14
+ $color-text-regular: #606266;
15
+ $color-text-secondary: #909399;
16
+
17
+ // 边框颜色
18
+ $color-border: #dcdfe6;
19
+ $color-border-light: #e4e7ed;
20
+ $color-border-lighter: #ebeef5;
21
+
22
+ // 背景颜色
23
+ $bg-color: #ffffff;
24
+ $bg-color-page: #f2f3f5;
25
+
26
+ // 字体
27
+ $font-size-base: 14px;
28
+ $font-size-small: 12px;
29
+
30
+ // 圆角
31
+ $border-radius-base: 4px;
32
+ $border-radius-large: 8px;
33
+
34
+ // 间距
35
+ $spacing-xs: 4px;
36
+ $spacing-sm: 8px;
37
+ $spacing-md: 16px;
38
+ $spacing-lg: 24px;
39
+
40
+ // 布局
41
+ $sidebar-width: 210px;
42
+ $sidebar-collapsed-width: 64px;
43
+ $header-height: 50px;
44
+ $tabs-height: 40px;
45
+ $footer-height: 30px;
@@ -0,0 +1,187 @@
1
+ // ==============================================
2
+ // 全局样式入口
3
+ // ==============================================
4
+
5
+ // CSS 变量(根选择器)
6
+ @use 'root';
7
+
8
+ // Reset
9
+ @use 'reset';
10
+
11
+ // Transitions
12
+ @use 'transition';
13
+
14
+ // Dark Theme Override
15
+ @use 'dark';
16
+
17
+ // ==============================================
18
+ // 全局通用样式
19
+ // ==============================================
20
+
21
+ // 文字截断
22
+ .text-ellipsis {
23
+ overflow: hidden;
24
+ text-overflow: ellipsis;
25
+ white-space: nowrap;
26
+ }
27
+
28
+ // 多行截断
29
+ .text-ellipsis-2 {
30
+ display: -webkit-box;
31
+ -webkit-line-clamp: 2;
32
+ -webkit-box-orient: vertical;
33
+ overflow: hidden;
34
+ }
35
+
36
+ // Flex 布局
37
+ .flex {
38
+ display: flex;
39
+ }
40
+
41
+ .flex-center {
42
+ display: flex;
43
+ align-items: center;
44
+ justify-content: center;
45
+ }
46
+
47
+ .flex-between {
48
+ display: flex;
49
+ align-items: center;
50
+ justify-content: space-between;
51
+ }
52
+
53
+ .flex-wrap {
54
+ flex-wrap: wrap;
55
+ }
56
+
57
+ .flex-1 {
58
+ flex: 1;
59
+ }
60
+
61
+ // 文字对齐
62
+ .text-left {
63
+ text-align: left;
64
+ }
65
+
66
+ .text-center {
67
+ text-align: center;
68
+ }
69
+
70
+ .text-right {
71
+ text-align: right;
72
+ }
73
+
74
+ // 颜色
75
+ .text-primary {
76
+ color: var(--color-primary);
77
+ }
78
+
79
+ .text-success {
80
+ color: var(--color-success);
81
+ }
82
+
83
+ .text-warning {
84
+ color: var(--color-warning);
85
+ }
86
+
87
+ .text-danger {
88
+ color: var(--color-danger);
89
+ }
90
+
91
+ .text-info {
92
+ color: var(--color-info);
93
+ }
94
+
95
+ // 背景
96
+ .bg-primary {
97
+ background-color: var(--color-primary);
98
+ }
99
+
100
+ .bg-success {
101
+ background-color: var(--color-success);
102
+ }
103
+
104
+ .bg-warning {
105
+ background-color: var(--color-warning);
106
+ }
107
+
108
+ .bg-danger {
109
+ background-color: var(--color-danger);
110
+ }
111
+
112
+ // 间距
113
+ .mt-10 {
114
+ margin-top: 10px;
115
+ }
116
+
117
+ .mt-20 {
118
+ margin-top: 20px;
119
+ }
120
+
121
+ .mb-10 {
122
+ margin-bottom: 10px;
123
+ }
124
+
125
+ .mb-20 {
126
+ margin-bottom: 20px;
127
+ }
128
+
129
+ .ml-10 {
130
+ margin-left: 10px;
131
+ }
132
+
133
+ .mr-10 {
134
+ margin-right: 10px;
135
+ }
136
+
137
+ .p-10 {
138
+ padding: 10px;
139
+ }
140
+
141
+ .p-20 {
142
+ padding: 20px;
143
+ }
144
+
145
+ // 卡片容器
146
+ .card {
147
+ background-color: var(--bg-color);
148
+ border-radius: var(--border-radius-base);
149
+ box-shadow: var(--box-shadow-light);
150
+ padding: var(--spacing-md);
151
+ }
152
+
153
+ // 页面容器
154
+ .page-container {
155
+ padding: var(--spacing-md);
156
+ min-height: 100%;
157
+ }
158
+
159
+ // 搜索栏
160
+ .search-bar {
161
+ display: flex;
162
+ flex-wrap: wrap;
163
+ gap: var(--spacing-sm);
164
+ margin-bottom: var(--spacing-md);
165
+ }
166
+
167
+ // 工具栏
168
+ .toolbar {
169
+ display: flex;
170
+ align-items: center;
171
+ justify-content: space-between;
172
+ margin-bottom: var(--spacing-md);
173
+ }
174
+
175
+ // 表格容器
176
+ .table-container {
177
+ background-color: var(--bg-color);
178
+ border-radius: var(--border-radius-base);
179
+ padding: var(--spacing-md);
180
+ }
181
+
182
+ // 分页容器
183
+ .pagination-container {
184
+ display: flex;
185
+ justify-content: flex-end;
186
+ margin-top: var(--spacing-md);
187
+ }
@@ -0,0 +1,17 @@
1
+ <script setup lang="ts">
2
+ </script>
3
+
4
+ <template>
5
+ <div class="footer">
6
+ <span>Copyright © 2024 Xto Demo. All Rights Reserved.</span>
7
+ </div>
8
+ </template>
9
+
10
+ <style lang="scss" scoped>
11
+ .footer {
12
+ width: 100%;
13
+ text-align: center;
14
+ font-size: 12px;
15
+ color: var(--color-text-secondary);
16
+ }
17
+ </style>