xto-fronted 0.4.71 → 0.4.73

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 (97) hide show
  1. package/dist/assets/404-CrBiLyvr.js +1 -0
  2. package/dist/assets/404-Cw_4ZCL6.css +1 -0
  3. package/dist/assets/_plugin-vue_export-helper-DlAUqK2U.js +1 -0
  4. package/dist/assets/index-9XqWtCGs.js +1 -0
  5. package/dist/assets/index-BBGKF0l-.js +1 -0
  6. package/dist/assets/index-BRR97dc6.js +1 -0
  7. package/dist/assets/index-BlRslYYI.css +1 -0
  8. package/dist/assets/index-BudArKxR.css +1 -0
  9. package/dist/assets/index-CFhWBbxk.css +1 -0
  10. package/dist/assets/index-CRJFI4iz.js +2 -0
  11. package/dist/assets/index-CmknWHK0.js +1 -0
  12. package/dist/assets/index-D7epoF1g.js +1 -0
  13. package/dist/assets/index-D9XBi20Y.css +1 -0
  14. package/dist/assets/index-DkkuYBgT.css +1 -0
  15. package/dist/assets/index-O9wpAB3Q.js +1 -0
  16. package/dist/assets/index-_aYxnqzF.css +1 -0
  17. package/dist/assets/index-rfC7s9zA.js +1 -0
  18. package/dist/assets/index-vfvEFrCH.css +1 -0
  19. package/dist/assets/vendor-42ANG6Sg.js +6 -0
  20. package/dist/assets/vue-vendor-D8SAgT8u.js +29 -0
  21. package/dist/assets/xto-base-BD3OH0V6.js +1 -0
  22. package/dist/assets/xto-base-CojW9IFO.css +1 -0
  23. package/dist/assets/xto-business--V1F5Gwb.css +1 -0
  24. package/dist/assets/xto-core-Boim7B0B.js +1 -0
  25. package/dist/assets/xto-data-CnAQAQH2.css +1 -0
  26. package/dist/assets/xto-data-DuG2QJrr.js +1 -0
  27. package/dist/assets/xto-feedback-C-ESp-Y1.css +1 -0
  28. package/dist/assets/xto-feedback-XZPSQcJN.js +1 -0
  29. package/dist/assets/xto-form-BmTGLIm_.js +1 -0
  30. package/dist/assets/xto-form-CrsyAjyr.css +1 -0
  31. package/dist/assets/xto-layout-D1stVnJI.css +1 -0
  32. package/dist/assets/xto-navigation-BRzSCpAw.css +1 -0
  33. package/dist/assets/xto-navigation-nPmjRi-J.js +1 -0
  34. package/dist/index.html +28 -0
  35. package/package.json +90 -87
  36. package/src/App.vue +30 -1
  37. package/src/assets/styles/_root.scss +141 -97
  38. package/src/assets/styles/_variables.scss +44 -19
  39. package/src/assets/styles/index.scss +267 -42
  40. package/src/components/Layout/Sidebar.vue +29 -10
  41. package/src/views/dashboard/index.vue +417 -155
  42. package/src/views/error/403.vue +251 -56
  43. package/src/views/error/404.vue +253 -56
  44. package/src/views/login/index.vue +586 -194
  45. package/src/views/system/menu/index.vue +403 -94
  46. package/src/views/system/role/index.vue +348 -69
  47. package/src/views/system/user/index.vue +402 -73
  48. package/dist/App.vue.d.ts +0 -2
  49. package/dist/api/auth.d.ts +0 -8
  50. package/dist/api/system.d.ts +0 -16
  51. package/dist/api/user.d.ts +0 -13
  52. package/dist/components/Layout/Footer.vue.d.ts +0 -2
  53. package/dist/components/Layout/Header.vue.d.ts +0 -5
  54. package/dist/components/Layout/MixTopMenu.vue.d.ts +0 -5
  55. package/dist/components/Layout/Sidebar.vue.d.ts +0 -11
  56. package/dist/components/Layout/SidebarMenuItem.vue.d.ts +0 -5
  57. package/dist/components/Layout/Tabs.vue.d.ts +0 -2
  58. package/dist/components/Layout/TopMenu.vue.d.ts +0 -5
  59. package/dist/components/Layout/index.vue.d.ts +0 -2
  60. package/dist/composables/useApp.d.ts +0 -29
  61. package/dist/composables/useAuth.d.ts +0 -6
  62. package/dist/composables/useForm.d.ts +0 -20
  63. package/dist/composables/useTable.d.ts +0 -29
  64. package/dist/directives/permission.d.ts +0 -4
  65. package/dist/enums/index.d.ts +0 -32
  66. package/dist/index-BgbSp2mz.js +0 -372
  67. package/dist/index-By874kXD.js +0 -142
  68. package/dist/index-COz0Cbj7.js +0 -345
  69. package/dist/index-CgbSCzIp.js +0 -3159
  70. package/dist/index-CzOd0mGb.js +0 -475
  71. package/dist/index.d.ts +0 -54
  72. package/dist/index.es.js +0 -91
  73. package/dist/index.umd.js +0 -1
  74. package/dist/main.d.ts +0 -0
  75. package/dist/router/dynamicRoutes.d.ts +0 -30
  76. package/dist/router/guards.d.ts +0 -17
  77. package/dist/router/index.d.ts +0 -6
  78. package/dist/router/layoutRoute.d.ts +0 -18
  79. package/dist/router/staticRoutes.d.ts +0 -2
  80. package/dist/stores/app.d.ts +0 -93
  81. package/dist/stores/auth.d.ts +0 -41
  82. package/dist/stores/index.d.ts +0 -9
  83. package/dist/stores/menu.d.ts +0 -77
  84. package/dist/stores/user.d.ts +0 -92
  85. package/dist/style.css +0 -1
  86. package/dist/utils/auth.d.ts +0 -27
  87. package/dist/utils/config.d.ts +0 -30
  88. package/dist/utils/permission.d.ts +0 -18
  89. package/dist/utils/request.d.ts +0 -24
  90. package/dist/utils/storage.d.ts +0 -24
  91. package/dist/views/dashboard/index.vue.d.ts +0 -2
  92. package/dist/views/error/403.vue.d.ts +0 -2
  93. package/dist/views/error/404.vue.d.ts +0 -2
  94. package/dist/views/login/index.vue.d.ts +0 -4
  95. package/dist/views/system/menu/index.vue.d.ts +0 -4
  96. package/dist/views/system/role/index.vue.d.ts +0 -4
  97. package/dist/views/system/user/index.vue.d.ts +0 -4
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { ref, reactive, computed, onMounted } from 'vue'
3
3
  import { Form, FormItem, Input, Select, Switch } from '@xto/form'
4
- import { Tag, Card, Pagination } from '@xto/data'
4
+ import { Tag, Pagination } from '@xto/data'
5
5
  import { Modal, Message, Popconfirm } from '@xto/feedback'
6
6
  import { Space, Button } from '@xto/base'
7
7
  import { Status, StatusOptions } from '@/enums'
@@ -132,6 +132,11 @@ const handleSubmit = async () => {
132
132
  }
133
133
  }
134
134
 
135
+ // 状态切换
136
+ const handleStatusChange = (row: Role) => {
137
+ Message.success(`已${row.status === Status.ENABLED ? '启用' : '禁用'}角色 ${row.name}`)
138
+ }
139
+
135
140
  onMounted(() => {
136
141
  getRoleList()
137
142
  })
@@ -140,8 +145,8 @@ onMounted(() => {
140
145
  <template>
141
146
  <div class="role-page">
142
147
  <!-- 搜索栏 -->
143
- <Card class="search-card">
144
- <Form :model="searchForm" inline>
148
+ <div class="search-section">
149
+ <Form :model="searchForm" inline class="search-form">
145
150
  <FormItem label="关键词">
146
151
  <Input
147
152
  v-model="searchForm.keyword"
@@ -160,64 +165,145 @@ onMounted(() => {
160
165
  </FormItem>
161
166
  <FormItem>
162
167
  <Space>
163
- <Button type="primary" @click="handleSearch">搜索</Button>
164
- <Button @click="handleReset">重置</Button>
168
+ <Button type="primary" @click="handleSearch">
169
+ <template #icon>
170
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
171
+ <circle cx="11" cy="11" r="8"/>
172
+ <path d="M21 21l-4.35-4.35"/>
173
+ </svg>
174
+ </template>
175
+ 搜索
176
+ </Button>
177
+ <Button @click="handleReset">
178
+ <template #icon>
179
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
180
+ <path d="M3 12a9 9 0 109-9 9.75 9.75 0 00-6.74 2.74L3 8"/>
181
+ <path d="M3 3v5h5"/>
182
+ </svg>
183
+ </template>
184
+ 重置
185
+ </Button>
165
186
  </Space>
166
187
  </FormItem>
167
188
  </Form>
168
- </Card>
189
+ </div>
169
190
 
170
191
  <!-- 表格 -->
171
- <Card class="table-card">
192
+ <div class="table-section">
172
193
  <!-- 工具栏 -->
173
- <div class="toolbar">
174
- <Button type="primary" @click="handleAdd">新增角色</Button>
194
+ <div class="table-toolbar">
195
+ <div class="toolbar-left">
196
+ <Button type="primary" @click="handleAdd">
197
+ <template #icon>
198
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
199
+ <line x1="12" y1="5" x2="12" y2="19"/>
200
+ <line x1="5" y1="12" x2="19" y2="12"/>
201
+ </svg>
202
+ </template>
203
+ 新增角色
204
+ </Button>
205
+ </div>
206
+ <div class="toolbar-right">
207
+ <span class="table-count">共 {{ total }} 条数据</span>
208
+ </div>
175
209
  </div>
176
210
 
177
211
  <!-- 表格 -->
178
- <table class="data-table">
179
- <thead>
180
- <tr>
181
- <th>ID</th>
182
- <th>角色名称</th>
183
- <th>角色编码</th>
184
- <th>描述</th>
185
- <th>状态</th>
186
- <th>创建时间</th>
187
- <th>操作</th>
188
- </tr>
189
- </thead>
190
- <tbody>
191
- <tr v-if="loading">
192
- <td colspan="7" class="loading-cell">加载中...</td>
193
- </tr>
194
- <tr v-else-if="roleList.length === 0">
195
- <td colspan="7" class="empty-cell">暂无数据</td>
196
- </tr>
197
- <tr v-else v-for="row in roleList" :key="row.id">
198
- <td>{{ row.id }}</td>
199
- <td>{{ row.name }}</td>
200
- <td>
201
- <Tag type="primary" size="small">{{ row.code }}</Tag>
202
- </td>
203
- <td>{{ row.description }}</td>
204
- <td>
205
- <Tag :type="row.status === Status.ENABLED ? 'success' : 'danger'" size="small">
206
- {{ row.status === Status.ENABLED ? '启用' : '禁用' }}
207
- </Tag>
208
- </td>
209
- <td>{{ row.createTime }}</td>
210
- <td>
211
- <Space>
212
- <Button type="primary" link size="small" @click="handleEdit(row)">编辑</Button>
213
- <Popconfirm title="确定删除该角色吗?" @confirm="handleDelete(row.id)">
214
- <Button type="danger" link size="small">删除</Button>
215
- </Popconfirm>
216
- </Space>
217
- </td>
218
- </tr>
219
- </tbody>
220
- </table>
212
+ <div class="table-wrapper">
213
+ <table class="data-table">
214
+ <thead>
215
+ <tr>
216
+ <th class="col-id">ID</th>
217
+ <th class="col-name">角色名称</th>
218
+ <th class="col-code">角色编码</th>
219
+ <th class="col-desc">描述</th>
220
+ <th class="col-status">状态</th>
221
+ <th class="col-time">创建时间</th>
222
+ <th class="col-actions">操作</th>
223
+ </tr>
224
+ </thead>
225
+ <tbody>
226
+ <tr v-if="loading">
227
+ <td colspan="7" class="loading-cell">
228
+ <div class="loading-content">
229
+ <div class="loading-spinner"></div>
230
+ <span>加载中...</span>
231
+ </div>
232
+ </td>
233
+ </tr>
234
+ <tr v-else-if="roleList.length === 0">
235
+ <td colspan="7" class="empty-cell">
236
+ <div class="empty-content">
237
+ <svg viewBox="0 0 64 41" fill="none">
238
+ <g transform="translate(0 1)">
239
+ <ellipse fill="#f5f5f5" cx="32" cy="33" rx="32" ry="7"/>
240
+ <g stroke="var(--color-text-placeholder)" stroke-width="2">
241
+ <path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"/>
242
+ <path d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35H11.95C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" fill="var(--color-fill)"/>
243
+ </g>
244
+ </g>
245
+ </svg>
246
+ <span>暂无数据</span>
247
+ </div>
248
+ </td>
249
+ </tr>
250
+ <tr v-else v-for="row in roleList" :key="row.id" class="data-row">
251
+ <td class="col-id">
252
+ <span class="id-badge">{{ row.id }}</span>
253
+ </td>
254
+ <td class="col-name">
255
+ <span class="role-name">{{ row.name }}</span>
256
+ </td>
257
+ <td class="col-code">
258
+ <Tag type="primary" size="small">{{ row.code }}</Tag>
259
+ </td>
260
+ <td class="col-desc">
261
+ <span class="desc-text">{{ row.description }}</span>
262
+ </td>
263
+ <td class="col-status">
264
+ <div class="status-switch">
265
+ <Switch
266
+ :model-value="row.status === Status.ENABLED"
267
+ @update:model-value="row.status = $event ? Status.ENABLED : Status.DISABLED; handleStatusChange(row)"
268
+ />
269
+ <span class="status-text" :class="{ enabled: row.status === Status.ENABLED }">
270
+ {{ row.status === Status.ENABLED ? '已启用' : '已禁用' }}
271
+ </span>
272
+ </div>
273
+ </td>
274
+ <td class="col-time">
275
+ <span class="time-text">{{ row.createTime }}</span>
276
+ </td>
277
+ <td class="col-actions">
278
+ <Space class="action-buttons">
279
+ <Button type="primary" link size="small" @click="handleEdit(row)">
280
+ <template #icon>
281
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
282
+ <path d="M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"/>
283
+ <path d="M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"/>
284
+ </svg>
285
+ </template>
286
+ 编辑
287
+ </Button>
288
+ <Popconfirm title="确定删除该角色吗?" @confirm="handleDelete(row.id)">
289
+ <Button type="danger" link size="small">
290
+ <template #icon>
291
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
292
+ <polyline points="3,6 5,6 21,6"/>
293
+ <path d="M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"/>
294
+ <line x1="10" y1="11" x2="10" y2="17"/>
295
+ <line x1="14" y1="11" x2="14" y2="17"/>
296
+ </svg>
297
+ </template>
298
+ 删除
299
+ </Button>
300
+ </Popconfirm>
301
+ </Space>
302
+ </td>
303
+ </tr>
304
+ </tbody>
305
+ </table>
306
+ </div>
221
307
 
222
308
  <!-- 分页 -->
223
309
  <div class="pagination-wrapper">
@@ -231,11 +317,11 @@ onMounted(() => {
231
317
  @size-change="getRoleList"
232
318
  />
233
319
  </div>
234
- </Card>
320
+ </div>
235
321
 
236
322
  <!-- 编辑弹窗 -->
237
- <Modal v-model="modalVisible" :title="modalTitle" width="500px">
238
- <Form ref="formRef" :model="formData" :rules="rules" label-width="80px">
323
+ <Modal v-model="modalVisible" :title="modalTitle" width="520px" class="role-modal">
324
+ <Form ref="formRef" :model="formData" :rules="rules" label-width="80px" class="role-form">
239
325
  <FormItem label="角色名称" prop="name">
240
326
  <Input v-model="formData.name" placeholder="请输入角色名称" />
241
327
  </FormItem>
@@ -246,7 +332,10 @@ onMounted(() => {
246
332
  <Input v-model="formData.description" placeholder="请输入描述" />
247
333
  </FormItem>
248
334
  <FormItem label="状态">
249
- <Switch v-model="formData.status" :active-value="Status.ENABLED" :inactive-value="Status.DISABLED" />
335
+ <div class="status-field">
336
+ <Switch v-model="formData.status" :active-value="Status.ENABLED" :inactive-value="Status.DISABLED" />
337
+ <span class="status-label">{{ formData.status === Status.ENABLED ? '启用' : '禁用' }}</span>
338
+ </div>
250
339
  </FormItem>
251
340
  </Form>
252
341
  <template #footer>
@@ -261,44 +350,234 @@ onMounted(() => {
261
350
 
262
351
  <style lang="scss" scoped>
263
352
  .role-page {
264
- padding: 20px;
353
+ padding: 24px;
354
+ background: var(--bg-color-page);
355
+ min-height: 100%;
356
+ }
357
+
358
+ // 搜索区域
359
+ .search-section {
360
+ background: var(--bg-color);
361
+ border-radius: var(--border-radius-large);
362
+ padding: 20px 24px;
363
+ margin-bottom: 16px;
364
+ box-shadow: var(--box-shadow-card);
265
365
 
266
- .search-card {
267
- margin-bottom: 20px;
366
+ .search-form {
367
+ display: flex;
368
+ flex-wrap: wrap;
369
+ gap: 16px;
370
+
371
+ :deep(.x-form-item) {
372
+ margin-bottom: 0;
373
+ }
374
+
375
+ :deep(.x-input),
376
+ :deep(.x-select) {
377
+ width: 200px;
378
+ }
268
379
  }
380
+ }
269
381
 
270
- .toolbar {
271
- margin-bottom: 15px;
382
+ // 表格区域
383
+ .table-section {
384
+ background: var(--bg-color);
385
+ border-radius: var(--border-radius-large);
386
+ box-shadow: var(--box-shadow-card);
387
+ overflow: hidden;
388
+ }
389
+
390
+ .table-toolbar {
391
+ display: flex;
392
+ justify-content: space-between;
393
+ align-items: center;
394
+ padding: 16px 24px;
395
+ border-bottom: 1px solid var(--color-border-lighter);
396
+
397
+ .toolbar-left {
398
+ display: flex;
399
+ gap: 12px;
272
400
  }
401
+
402
+ .table-count {
403
+ font-size: 14px;
404
+ color: var(--color-text-secondary);
405
+ }
406
+ }
407
+
408
+ .table-wrapper {
409
+ overflow-x: auto;
273
410
  }
274
411
 
412
+ // 表格样式
275
413
  .data-table {
276
414
  width: 100%;
277
415
  border-collapse: collapse;
278
416
 
279
417
  th, td {
280
- padding: 12px;
418
+ padding: 14px 16px;
281
419
  text-align: left;
282
420
  border-bottom: 1px solid var(--color-border-lighter);
283
421
  }
284
422
 
285
423
  th {
424
+ font-size: 14px;
286
425
  font-weight: 500;
287
- color: var(--color-text-regular);
288
- background-color: var(--color-fill-light);
426
+ color: var(--color-text-secondary);
427
+ background: var(--color-fill-light);
428
+ white-space: nowrap;
429
+ }
430
+
431
+ .data-row {
432
+ transition: background-color 0.2s;
433
+
434
+ &:hover {
435
+ background: var(--color-primary-light-6);
436
+ }
437
+ }
438
+
439
+ td {
440
+ vertical-align: middle;
289
441
  }
290
442
 
291
443
  .loading-cell,
292
444
  .empty-cell {
293
- text-align: center;
294
- color: var(--color-text-secondary);
295
- padding: 40px;
445
+ padding: 60px 20px;
446
+ }
447
+
448
+ .loading-content,
449
+ .empty-content {
450
+ display: flex;
451
+ flex-direction: column;
452
+ align-items: center;
453
+ gap: 16px;
454
+ color: var(--color-text-placeholder);
455
+
456
+ svg {
457
+ width: 64px;
458
+ height: 41px;
459
+ }
460
+ }
461
+
462
+ .loading-spinner {
463
+ width: 32px;
464
+ height: 32px;
465
+ border: 3px solid var(--color-border-lighter);
466
+ border-top-color: var(--color-primary);
467
+ border-radius: 50%;
468
+ animation: spin 0.8s linear infinite;
469
+ }
470
+ }
471
+
472
+ @keyframes spin {
473
+ to { transform: rotate(360deg); }
474
+ }
475
+
476
+ // 列样式
477
+ .col-id {
478
+ width: 80px;
479
+ }
480
+
481
+ .id-badge {
482
+ display: inline-block;
483
+ min-width: 32px;
484
+ padding: 4px 10px;
485
+ background: var(--color-fill);
486
+ border-radius: 12px;
487
+ font-size: 12px;
488
+ font-weight: 500;
489
+ color: var(--color-text-secondary);
490
+ text-align: center;
491
+ }
492
+
493
+ .col-name {
494
+ min-width: 120px;
495
+ }
496
+
497
+ .role-name {
498
+ font-size: 14px;
499
+ font-weight: 500;
500
+ color: var(--color-text-primary);
501
+ }
502
+
503
+ .col-code {
504
+ min-width: 100px;
505
+ }
506
+
507
+ .col-desc {
508
+ min-width: 150px;
509
+ }
510
+
511
+ .desc-text {
512
+ font-size: 14px;
513
+ color: var(--color-text-secondary);
514
+ }
515
+
516
+ .col-status {
517
+ min-width: 120px;
518
+ }
519
+
520
+ .status-switch {
521
+ display: flex;
522
+ align-items: center;
523
+ gap: 8px;
524
+ }
525
+
526
+ .status-text {
527
+ font-size: 13px;
528
+ color: var(--color-text-secondary);
529
+
530
+ &.enabled {
531
+ color: var(--color-success);
296
532
  }
297
533
  }
298
534
 
535
+ .col-time {
536
+ min-width: 160px;
537
+ }
538
+
539
+ .time-text {
540
+ font-size: 13px;
541
+ color: var(--color-text-secondary);
542
+ }
543
+
544
+ .col-actions {
545
+ min-width: 140px;
546
+ }
547
+
548
+ .action-buttons {
549
+ :deep(.x-button) {
550
+ padding: 4px 8px;
551
+
552
+ svg {
553
+ width: 14px;
554
+ height: 14px;
555
+ margin-right: 4px;
556
+ }
557
+ }
558
+ }
559
+
560
+ // 分页
299
561
  .pagination-wrapper {
300
562
  display: flex;
301
563
  justify-content: flex-end;
302
- margin-top: 20px;
564
+ padding: 16px 24px;
565
+ border-top: 1px solid var(--color-border-lighter);
566
+ }
567
+
568
+ // 弹窗表单
569
+ .role-form {
570
+ padding: 16px 0;
571
+
572
+ .status-field {
573
+ display: flex;
574
+ align-items: center;
575
+ gap: 12px;
576
+ }
577
+
578
+ .status-label {
579
+ font-size: 14px;
580
+ color: var(--color-text-secondary);
581
+ }
303
582
  }
304
- </style>
583
+ </style>