vue3-admin-gpt 1.0.0

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 (118) hide show
  1. package/.env.development +14 -0
  2. package/.env.production +14 -0
  3. package/LICENSE +21 -0
  4. package/README.en.md +106 -0
  5. package/README.md +104 -0
  6. package/build-zip.cjs +53 -0
  7. package/cli.js +110 -0
  8. package/jsconfig.json +9 -0
  9. package/package.json +92 -0
  10. package/public/index.html +20 -0
  11. package/public/robots.txt +2 -0
  12. package/rspack.config.js +282 -0
  13. package/rspack.js +162 -0
  14. package/src/App.vue +9 -0
  15. package/src/api/icon.js +9 -0
  16. package/src/api/router.js +9 -0
  17. package/src/api/table.js +25 -0
  18. package/src/api/tree.js +9 -0
  19. package/src/api/user.js +34 -0
  20. package/src/assets/error_images/401.png +0 -0
  21. package/src/assets/error_images/404.png +0 -0
  22. package/src/assets/error_images/cloud.png +0 -0
  23. package/src/assets/login_images/background.jpg +0 -0
  24. package/src/assets/logo.png +0 -0
  25. package/src/assets/qr_logo/lqr_logo.png +0 -0
  26. package/src/assets/vuejs-fill.svg +4 -0
  27. package/src/components/VabPageHeader/index.vue +133 -0
  28. package/src/config/index.js +7 -0
  29. package/src/config/net.config.js +20 -0
  30. package/src/config/permission.js +136 -0
  31. package/src/config/setting.config.js +62 -0
  32. package/src/config/settings.js +6 -0
  33. package/src/config/theme.config.js +14 -0
  34. package/src/layouts/EmptyLayout.vue +3 -0
  35. package/src/layouts/components/VabAppMain/index.vue +109 -0
  36. package/src/layouts/components/VabAvatar/index.vue +255 -0
  37. package/src/layouts/components/VabBreadcrumb/index.vue +61 -0
  38. package/src/layouts/components/VabFullScreen/index.vue +61 -0
  39. package/src/layouts/components/VabLogo/index.vue +94 -0
  40. package/src/layouts/components/VabNav/index.vue +176 -0
  41. package/src/layouts/components/VabSide/components/VabMenuItem.vue +80 -0
  42. package/src/layouts/components/VabSide/components/VabSideItem.vue +100 -0
  43. package/src/layouts/components/VabSide/components/VabSubmenu.vue +56 -0
  44. package/src/layouts/components/VabSide/index.vue +123 -0
  45. package/src/layouts/components/VabTabs/index.vue +500 -0
  46. package/src/layouts/components/VabTheme/index.vue +603 -0
  47. package/src/layouts/components/VabTop/index.vue +286 -0
  48. package/src/layouts/export.js +29 -0
  49. package/src/layouts/index.vue +339 -0
  50. package/src/main.js +40 -0
  51. package/src/plugins/echarts.js +4 -0
  52. package/src/plugins/index.js +44 -0
  53. package/src/plugins/support.js +16 -0
  54. package/src/router/index.js +400 -0
  55. package/src/store/index.js +26 -0
  56. package/src/store/modules/errorLog.js +27 -0
  57. package/src/store/modules/routes.js +60 -0
  58. package/src/store/modules/settings.js +73 -0
  59. package/src/store/modules/table.js +22 -0
  60. package/src/store/modules/tabsBar.js +109 -0
  61. package/src/store/modules/user.js +131 -0
  62. package/src/styles/element-variables.scss +13 -0
  63. package/src/styles/loading.scss +345 -0
  64. package/src/styles/nav-icons.scss +52 -0
  65. package/src/styles/normalize.scss +353 -0
  66. package/src/styles/spinner/dots.css +68 -0
  67. package/src/styles/spinner/gauge.css +104 -0
  68. package/src/styles/spinner/inner-circles.css +51 -0
  69. package/src/styles/spinner/plus.css +341 -0
  70. package/src/styles/themes/default.scss +1 -0
  71. package/src/styles/transition.scss +18 -0
  72. package/src/styles/vab.scss +476 -0
  73. package/src/styles/variables.scss +69 -0
  74. package/src/utils/accessToken.js +56 -0
  75. package/src/utils/eventBus.js +8 -0
  76. package/src/utils/handleRoutes.js +100 -0
  77. package/src/utils/index.js +231 -0
  78. package/src/utils/message.js +67 -0
  79. package/src/utils/pageTitle.js +11 -0
  80. package/src/utils/password.js +43 -0
  81. package/src/utils/permission.js +19 -0
  82. package/src/utils/request.js +187 -0
  83. package/src/utils/static.js +81 -0
  84. package/src/utils/vab.js +218 -0
  85. package/src/utils/validate.js +48 -0
  86. package/src/views/401.vue +302 -0
  87. package/src/views/404.vue +302 -0
  88. package/src/views/demo/index.vue +591 -0
  89. package/src/views/index/index.vue +1489 -0
  90. package/src/views/login/index.vue +456 -0
  91. package/src/views/register/index.vue +524 -0
  92. package/src/views/vab/calendar.vue +488 -0
  93. package/src/views/vab/campaign.vue +1006 -0
  94. package/src/views/vab/chart.vue +189 -0
  95. package/src/views/vab/customer.vue +666 -0
  96. package/src/views/vab/editor.vue +84 -0
  97. package/src/views/vab/form.vue +151 -0
  98. package/src/views/vab/help.vue +390 -0
  99. package/src/views/vab/icon.vue +113 -0
  100. package/src/views/vab/knowledge.vue +820 -0
  101. package/src/views/vab/nested/menu1/menu2/menu3.vue +29 -0
  102. package/src/views/vab/nested/menu1/menu2.vue +33 -0
  103. package/src/views/vab/nested/menu1.vue +33 -0
  104. package/src/views/vab/nested.vue +97 -0
  105. package/src/views/vab/notification.vue +416 -0
  106. package/src/views/vab/order.vue +507 -0
  107. package/src/views/vab/permissions.vue +214 -0
  108. package/src/views/vab/product.vue +724 -0
  109. package/src/views/vab/project.vue +559 -0
  110. package/src/views/vab/settings.vue +319 -0
  111. package/src/views/vab/statistics.vue +431 -0
  112. package/src/views/vab/table.vue +110 -0
  113. package/src/views/vab/task.vue +613 -0
  114. package/src/views/vab/team.vue +662 -0
  115. package/src/views/vab/tree.vue +44 -0
  116. package/src/views/vab/upload.vue +180 -0
  117. package/src/views/vab/vue3Demo/index.vue +103 -0
  118. package/src/views/vab/workflow.vue +863 -0
@@ -0,0 +1,507 @@
1
+ <template>
2
+ <div class="order-container">
3
+ <el-card shadow="never">
4
+ <template #header>
5
+ <div class="card-header">
6
+ <span>订单管理</span>
7
+ <div class="header-actions">
8
+ <el-input
9
+ v-model="searchText"
10
+ placeholder="搜索订单..."
11
+ clearable
12
+ style="width: 200px; margin-right: 10px"
13
+ >
14
+ <template #prefix>
15
+ <el-icon><Search /></el-icon>
16
+ </template>
17
+ </el-input>
18
+ <el-select
19
+ v-model="filterStatus"
20
+ placeholder="状态筛选"
21
+ style="width: 120px; margin-right: 10px"
22
+ >
23
+ <el-option label="全部" value=""></el-option>
24
+ <el-option label="待付款" value="pending"></el-option>
25
+ <el-option label="待发货" value="paid"></el-option>
26
+ <el-option label="已发货" value="shipped"></el-option>
27
+ <el-option label="已完成" value="completed"></el-option>
28
+ <el-option label="已取消" value="cancelled"></el-option>
29
+ </el-select>
30
+ <el-button type="primary" @click="exportOrders">导出订单</el-button>
31
+ </div>
32
+ </div>
33
+ </template>
34
+
35
+ <el-table
36
+ :data="filteredOrders"
37
+ style="width: 100%"
38
+ row-key="id"
39
+ v-loading="loading"
40
+ >
41
+ <el-table-column prop="id" label="订单号" width="180" />
42
+ <el-table-column prop="customer" label="客户" width="120" />
43
+ <el-table-column prop="products" label="商品" min-width="250">
44
+ <template #default="{ row }">
45
+ <div
46
+ v-for="product in row.products"
47
+ :key="product.id"
48
+ class="order-product"
49
+ >
50
+ <el-image
51
+ :src="product.image"
52
+ fit="cover"
53
+ style="width: 40px; height: 40px; border-radius: 4px; margin-right: 10px"
54
+ />
55
+ <div class="product-info">
56
+ <div>{{ product.name }}</div>
57
+ <div class="product-meta">
58
+ <span>¥{{ product.price }} × {{ product.quantity }}</span>
59
+ </div>
60
+ </div>
61
+ </div>
62
+ </template>
63
+ </el-table-column>
64
+ <el-table-column prop="totalAmount" label="订单金额" width="120">
65
+ <template #default="{ row }">
66
+ ¥{{ row.totalAmount.toLocaleString() }}
67
+ </template>
68
+ </el-table-column>
69
+ <el-table-column label="状态" width="100">
70
+ <template #default="{ row }">
71
+ <el-tag :type="getStatusType(row.status)">
72
+ {{ getStatusText(row.status) }}
73
+ </el-tag>
74
+ </template>
75
+ </el-table-column>
76
+ <el-table-column prop="createTime" label="下单时间" width="180" />
77
+ <el-table-column label="操作" width="200">
78
+ <template #default="{ row }">
79
+ <el-button type="text" @click="viewOrder(row)">查看</el-button>
80
+ <el-button
81
+ v-if="row.status === 'paid'"
82
+ type="text"
83
+ @click="shipOrder(row)"
84
+ >
85
+ 发货
86
+ </el-button>
87
+ <el-button
88
+ v-if="row.status === 'pending'"
89
+ type="text"
90
+ @click="cancelOrder(row)"
91
+ >
92
+ 取消
93
+ </el-button>
94
+ </template>
95
+ </el-table-column>
96
+ </el-table>
97
+
98
+ <div class="pagination-container">
99
+ <el-pagination
100
+ v-model:current-page="currentPage"
101
+ v-model:page-size="pageSize"
102
+ :page-sizes="[10, 20, 50, 100]"
103
+ :total="totalOrders"
104
+ layout="total, sizes, prev, pager, next, jumper"
105
+ @size-change="handleSizeChange"
106
+ @current-change="handleCurrentChange"
107
+ />
108
+ </div>
109
+ </el-card>
110
+
111
+ <!-- 订单详情对话框 -->
112
+ <el-dialog
113
+ v-model="detailDialogVisible"
114
+ title="订单详情"
115
+ width="800px"
116
+ >
117
+ <el-row :gutter="20">
118
+ <el-col :span="16">
119
+ <el-descriptions :column="1" border>
120
+ <el-descriptions-item label="订单号">{{ detailOrder.id }}</el-descriptions-item>
121
+ <el-descriptions-item label="客户">{{ detailOrder.customer }}</el-descriptions-item>
122
+ <el-descriptions-item label="联系电话">{{ detailOrder.phone }}</el-descriptions-item>
123
+ <el-descriptions-item label="收货地址">{{ detailOrder.address }}</el-descriptions-item>
124
+ <el-descriptions-item label="订单状态">
125
+ <el-tag :type="getStatusType(detailOrder.status)">
126
+ {{ getStatusText(detailOrder.status) }}
127
+ </el-tag>
128
+ </el-descriptions-item>
129
+ <el-descriptions-item label="下单时间">{{ detailOrder.createTime }}</el-descriptions-item>
130
+ <el-descriptions-item label="支付时间">{{ detailOrder.payTime }}</el-descriptions-item>
131
+ <el-descriptions-item label="发货时间">{{ detailOrder.shipTime }}</el-descriptions-item>
132
+ </el-descriptions>
133
+ </el-col>
134
+ <el-col :span="8">
135
+ <div class="order-amount">
136
+ <div class="amount-label">订单总额</div>
137
+ <div class="amount-value">¥{{ detailOrder.totalAmount?.toLocaleString() }}</div>
138
+ </div>
139
+ </el-col>
140
+ </el-row>
141
+
142
+ <el-divider>商品信息</el-divider>
143
+
144
+ <el-table :data="detailOrder.products" style="width: 100%">
145
+ <el-table-column label="商品" min-width="200">
146
+ <template #default="{ row }">
147
+ <div class="product-cell">
148
+ <el-image
149
+ :src="row.image"
150
+ fit="cover"
151
+ style="width: 60px; height: 60px; border-radius: 4px; margin-right: 10px"
152
+ />
153
+ <div>
154
+ <div>{{ row.name }}</div>
155
+ <div class="product-spec">{{ row.spec }}</div>
156
+ </div>
157
+ </div>
158
+ </template>
159
+ </el-table-column>
160
+ <el-table-column prop="price" label="单价" width="100">
161
+ <template #default="{ row }">
162
+ ¥{{ row.price }}
163
+ </template>
164
+ </el-table-column>
165
+ <el-table-column prop="quantity" label="数量" width="80" />
166
+ <el-table-column prop="subtotal" label="小计" width="100">
167
+ <template #default="{ row }">
168
+ ¥{{ row.subtotal }}
169
+ </template>
170
+ </el-table-column>
171
+ </el-table>
172
+
173
+ <el-divider>物流信息</el-divider>
174
+
175
+ <el-steps :active="getLogisticsStep(detailOrder.status)" finish-status="success" simple>
176
+ <el-step title="已下单" :description="detailOrder.createTime" />
177
+ <el-step title="已付款" :description="detailOrder.payTime" />
178
+ <el-step title="已发货" :description="detailOrder.shipTime" />
179
+ <el-step title="已完成" />
180
+ </el-steps>
181
+
182
+ <template #footer>
183
+ <span class="dialog-footer">
184
+ <el-button @click="detailDialogVisible = false">关闭</el-button>
185
+ <el-button
186
+ v-if="detailOrder.status === 'paid'"
187
+ type="primary"
188
+ @click="shipOrder(detailOrder)"
189
+ >
190
+ 立即发货
191
+ </el-button>
192
+ </span>
193
+ </template>
194
+ </el-dialog>
195
+ </div>
196
+ </template>
197
+
198
+ <script>
199
+ import { Search } from "@element-plus/icons-vue";
200
+
201
+ export default {
202
+ name: "Order",
203
+ components: {
204
+ Search
205
+ },
206
+ data() {
207
+ return {
208
+ searchText: "",
209
+ filterStatus: "",
210
+ currentPage: 1,
211
+ pageSize: 10,
212
+ totalOrders: 0,
213
+ loading: false,
214
+ detailDialogVisible: false,
215
+ orders: [
216
+ {
217
+ id: "SO202305001",
218
+ customer: "张三",
219
+ phone: "13800138001",
220
+ address: "北京市朝阳区某某大厦101室",
221
+ totalAmount: 15998,
222
+ status: "shipped",
223
+ createTime: "2023-05-01 14:30:00",
224
+ payTime: "2023-05-01 14:35:00",
225
+ shipTime: "2023-05-02 09:15:00",
226
+ products: [
227
+ {
228
+ id: 1,
229
+ name: "iPhone 14 Pro",
230
+ spec: "128GB 深空黑",
231
+ price: 7999,
232
+ quantity: 2,
233
+ subtotal: 15998,
234
+ image: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
235
+ }
236
+ ]
237
+ },
238
+ {
239
+ id: "SO202305002",
240
+ customer: "李四",
241
+ phone: "13800138002",
242
+ address: "上海市浦东新区某某路1001号",
243
+ totalAmount: 7999,
244
+ status: "paid",
245
+ createTime: "2023-05-03 10:15:00",
246
+ payTime: "2023-05-03 10:20:00",
247
+ products: [
248
+ {
249
+ id: 1,
250
+ name: "iPhone 14 Pro",
251
+ spec: "128GB 银色",
252
+ price: 7999,
253
+ quantity: 1,
254
+ subtotal: 7999,
255
+ image: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
256
+ }
257
+ ]
258
+ },
259
+ {
260
+ id: "SO202305003",
261
+ customer: "王五",
262
+ phone: "13800138003",
263
+ address: "广州市天河区某某广场201室",
264
+ totalAmount: 2999,
265
+ status: "pending",
266
+ createTime: "2023-05-05 16:45:00",
267
+ products: [
268
+ {
269
+ id: 5,
270
+ name: "Apple Watch Series 8",
271
+ spec: "45mm GPS版",
272
+ price: 2999,
273
+ quantity: 1,
274
+ subtotal: 2999,
275
+ image: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
276
+ }
277
+ ]
278
+ },
279
+ {
280
+ id: "SO202304015",
281
+ customer: "赵六",
282
+ phone: "13800138004",
283
+ address: "深圳市南山区科技园南路1001号",
284
+ totalAmount: 1899,
285
+ status: "completed",
286
+ createTime: "2023-04-15 10:15:00",
287
+ payTime: "2023-04-15 10:20:00",
288
+ shipTime: "2023-04-16 14:30:00",
289
+ completeTime: "2023-04-20 16:45:00",
290
+ products: [
291
+ {
292
+ id: 3,
293
+ name: "AirPods Pro",
294
+ spec: "第二代",
295
+ price: 1899,
296
+ quantity: 1,
297
+ subtotal: 1899,
298
+ image: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
299
+ }
300
+ ]
301
+ },
302
+ {
303
+ id: "SO202304010",
304
+ customer: "孙七",
305
+ phone: "13800138005",
306
+ address: "杭州市西湖区某某路501室",
307
+ totalAmount: 4399,
308
+ status: "cancelled",
309
+ createTime: "2023-04-10 09:30:00",
310
+ cancelTime: "2023-04-10 10:15:00",
311
+ products: [
312
+ {
313
+ id: 4,
314
+ name: "iPad Air",
315
+ spec: "64GB 深空灰",
316
+ price: 4399,
317
+ quantity: 1,
318
+ subtotal: 4399,
319
+ image: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
320
+ }
321
+ ]
322
+ }
323
+ ],
324
+ detailOrder: {}
325
+ };
326
+ },
327
+ computed: {
328
+ filteredOrders() {
329
+ let result = this.orders;
330
+
331
+ // 搜索过滤
332
+ if (this.searchText) {
333
+ result = result.filter(order =>
334
+ order.id.toLowerCase().includes(this.searchText.toLowerCase()) ||
335
+ order.customer.toLowerCase().includes(this.searchText.toLowerCase())
336
+ );
337
+ }
338
+
339
+ // 状态过滤
340
+ if (this.filterStatus) {
341
+ result = result.filter(order => order.status === this.filterStatus);
342
+ }
343
+
344
+ // 分页处理
345
+ const start = (this.currentPage - 1) * this.pageSize;
346
+ const end = start + this.pageSize;
347
+ return result.slice(start, end);
348
+ }
349
+ },
350
+ methods: {
351
+ handleSizeChange(val) {
352
+ this.pageSize = val;
353
+ this.currentPage = 1;
354
+ },
355
+ handleCurrentChange(val) {
356
+ this.currentPage = val;
357
+ },
358
+ getStatusText(status) {
359
+ const statusMap = {
360
+ "pending": "待付款",
361
+ "paid": "待发货",
362
+ "shipped": "已发货",
363
+ "completed": "已完成",
364
+ "cancelled": "已取消"
365
+ };
366
+ return statusMap[status] || status;
367
+ },
368
+ getStatusType(status) {
369
+ const typeMap = {
370
+ "pending": "info",
371
+ "paid": "warning",
372
+ "shipped": "",
373
+ "completed": "success",
374
+ "cancelled": "danger"
375
+ };
376
+ return typeMap[status] || "info";
377
+ },
378
+ getLogisticsStep(status) {
379
+ const stepMap = {
380
+ "pending": 0,
381
+ "paid": 1,
382
+ "shipped": 2,
383
+ "completed": 3,
384
+ "cancelled": 0
385
+ };
386
+ return stepMap[status] || 0;
387
+ },
388
+ viewOrder(order) {
389
+ this.detailOrder = { ...order };
390
+ this.detailDialogVisible = true;
391
+ },
392
+ shipOrder(order) {
393
+ this.$confirm(`确定要为订单${order.id}发货吗?`, "提示", {
394
+ confirmButtonText: "确定",
395
+ cancelButtonText: "取消",
396
+ type: "warning"
397
+ }).then(() => {
398
+ const index = this.orders.findIndex(o => o.id === order.id);
399
+ if (index !== -1) {
400
+ this.orders[index].status = "shipped";
401
+ this.orders[index].shipTime = new Date().toLocaleString();
402
+ this.$message.success("订单已发货");
403
+
404
+ // 如果在详情对话框中操作,更新详情订单状态
405
+ if (this.detailOrder.id === order.id) {
406
+ this.detailOrder.status = "shipped";
407
+ this.detailOrder.shipTime = this.orders[index].shipTime;
408
+ }
409
+ }
410
+ }).catch(() => {
411
+ this.$message.info("已取消操作");
412
+ });
413
+ },
414
+ cancelOrder(order) {
415
+ this.$confirm(`确定要取消订单${order.id}吗?`, "提示", {
416
+ confirmButtonText: "确定",
417
+ cancelButtonText: "取消",
418
+ type: "warning"
419
+ }).then(() => {
420
+ const index = this.orders.findIndex(o => o.id === order.id);
421
+ if (index !== -1) {
422
+ this.orders[index].status = "cancelled";
423
+ this.orders[index].cancelTime = new Date().toLocaleString();
424
+ this.$message.success("订单已取消");
425
+
426
+ // 如果在详情对话框中操作,更新详情订单状态
427
+ if (this.detailOrder.id === order.id) {
428
+ this.detailOrder.status = "cancelled";
429
+ this.detailOrder.cancelTime = this.orders[index].cancelTime;
430
+ }
431
+ }
432
+ }).catch(() => {
433
+ this.$message.info("已取消操作");
434
+ });
435
+ },
436
+ exportOrders() {
437
+ this.$message.success("订单导出成功");
438
+ }
439
+ }
440
+ };
441
+ </script>
442
+
443
+ <style lang="scss" scoped>
444
+ .order-container {
445
+ padding: 20px;
446
+
447
+ .card-header {
448
+ display: flex;
449
+ justify-content: space-between;
450
+ align-items: center;
451
+ font-weight: bold;
452
+ }
453
+
454
+ .order-product {
455
+ display: flex;
456
+ align-items: center;
457
+ margin-bottom: 10px;
458
+
459
+ &:last-child {
460
+ margin-bottom: 0;
461
+ }
462
+
463
+ .product-info {
464
+ .product-meta {
465
+ font-size: 12px;
466
+ color: #999;
467
+ margin-top: 3px;
468
+ }
469
+ }
470
+ }
471
+
472
+ .order-amount {
473
+ text-align: center;
474
+ padding: 20px;
475
+ background-color: #f5f7fa;
476
+ border-radius: 4px;
477
+
478
+ .amount-label {
479
+ font-size: 14px;
480
+ color: #666;
481
+ margin-bottom: 10px;
482
+ }
483
+
484
+ .amount-value {
485
+ font-size: 24px;
486
+ font-weight: bold;
487
+ color: #fa541c;
488
+ }
489
+ }
490
+
491
+ .product-cell {
492
+ display: flex;
493
+ align-items: center;
494
+
495
+ .product-spec {
496
+ font-size: 12px;
497
+ color: #999;
498
+ margin-top: 3px;
499
+ }
500
+ }
501
+
502
+ .pagination-container {
503
+ margin-top: 20px;
504
+ text-align: right;
505
+ }
506
+ }
507
+ </style>