befly-admin-ui 1.10.8 → 1.10.10
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/components/detailPanel.vue +3 -2
- package/components/pageDialog.vue +14 -15
- package/components/pageTableDetail.vue +20 -18
- package/layouts/default.vue +17 -17
- package/package.json +2 -2
- package/utils/arrayToTree.js +14 -13
- package/views/config/dict/components/edit.vue +6 -6
- package/views/config/dict/index.vue +13 -12
- package/views/config/dictType/components/edit.vue +6 -6
- package/views/config/dictType/index.vue +10 -9
- package/views/config/system/components/edit.vue +7 -7
- package/views/config/system/index.vue +10 -9
- package/views/index/components/addonList.vue +4 -3
- package/views/index/components/environmentInfo.vue +3 -2
- package/views/index/components/operationLogs.vue +3 -3
- package/views/index/components/performanceMetrics.vue +3 -2
- package/views/index/components/quickActions.vue +1 -1
- package/views/index/components/serviceStatus.vue +4 -3
- package/views/index/components/systemNotifications.vue +3 -3
- package/views/index/components/systemOverview.vue +17 -17
- package/views/index/components/systemResources.vue +3 -2
- package/views/index/components/userInfo.vue +6 -5
- package/views/index/index.vue +3 -3
- package/views/log/email/index.vue +12 -11
- package/views/log/error/index.vue +12 -12
- package/views/log/login/index.vue +3 -3
- package/views/log/operate/index.vue +5 -5
- package/views/login_1/index.vue +6 -5
- package/views/people/admin/components/edit.vue +12 -12
- package/views/people/admin/index.vue +9 -8
- package/views/permission/api/index.vue +9 -8
- package/views/permission/menu/index.vue +7 -6
- package/views/permission/role/components/api.vue +8 -8
- package/views/permission/role/components/edit.vue +8 -8
- package/views/permission/role/components/menu.vue +9 -9
- package/views/permission/role/index.vue +11 -10
- package/views/resource/gallery/index.vue +10 -10
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
</template>
|
|
52
52
|
|
|
53
53
|
<script setup>
|
|
54
|
+
import PageDialog from "befly-admin-ui/components/pageDialog.vue";
|
|
55
|
+
import { Form as TForm, FormItem as TFormItem, Input as TInput, Textarea as TTextarea, InputNumber as TInputNumber, Select as TSelect, Option as TOption, RadioGroup as TRadioGroup, Radio as TRadio, MessagePlugin } from "tdesign-vue-next";
|
|
54
56
|
import { computed, reactive } from "vue";
|
|
55
57
|
|
|
56
|
-
import { Form as TForm, FormItem as TFormItem, Input as TInput, Textarea as TTextarea, InputNumber as TInputNumber, Select as TSelect, Option as TOption, RadioGroup as TRadioGroup, Radio as TRadio, MessagePlugin } from "tdesign-vue-next";
|
|
57
|
-
import PageDialog from "befly-admin-ui/components/pageDialog.vue";
|
|
58
58
|
import { $Http } from "@/plugins/http.js";
|
|
59
59
|
|
|
60
60
|
const $Prop = defineProps({
|
|
@@ -75,7 +75,7 @@ const $Prop = defineProps({
|
|
|
75
75
|
const $Emit = defineEmits(["update:modelValue", "success"]);
|
|
76
76
|
|
|
77
77
|
const $Const = {
|
|
78
|
-
createDefaultFormData() {
|
|
78
|
+
createDefaultFormData: function () {
|
|
79
79
|
return {
|
|
80
80
|
id: 0,
|
|
81
81
|
name: "",
|
|
@@ -121,14 +121,14 @@ const $Computed = reactive({
|
|
|
121
121
|
});
|
|
122
122
|
|
|
123
123
|
const $Method = {
|
|
124
|
-
resetFormData() {
|
|
124
|
+
resetFormData: function () {
|
|
125
125
|
Object.assign($Data.formData, $Const.createDefaultFormData());
|
|
126
126
|
$Data.isSystem = false;
|
|
127
127
|
},
|
|
128
|
-
initData() {
|
|
128
|
+
initData: function () {
|
|
129
129
|
$Method.onShow();
|
|
130
130
|
},
|
|
131
|
-
onShow() {
|
|
131
|
+
onShow: function () {
|
|
132
132
|
if ($Prop.actionType === "upd" && $Prop.rowData) {
|
|
133
133
|
const row = $Prop.rowData;
|
|
134
134
|
$Data.formData.id = row["id"] || 0;
|
|
@@ -146,7 +146,7 @@ const $Method = {
|
|
|
146
146
|
|
|
147
147
|
$Method.resetFormData();
|
|
148
148
|
},
|
|
149
|
-
async
|
|
149
|
+
onSubmit: async function (context) {
|
|
150
150
|
const form = $From.formRef;
|
|
151
151
|
if (!form) {
|
|
152
152
|
MessagePlugin.warning("表单未就绪");
|
|
@@ -67,13 +67,14 @@
|
|
|
67
67
|
</template>
|
|
68
68
|
|
|
69
69
|
<script setup>
|
|
70
|
-
import { reactive } from "vue";
|
|
71
|
-
import { Button as TButton, Dropdown as TDropdown, DropdownItem as TDropdownItem, DropdownMenu as TDropdownMenu, Option as TOption, Select as TSelect, Tag as TTag } from "tdesign-vue-next";
|
|
72
|
-
import { AddIcon, ChevronDownIcon, DeleteIcon, EditIcon } from "tdesign-icons-vue-next";
|
|
73
|
-
import EditDialog from "./components/edit.vue";
|
|
74
70
|
import DetailPanel from "befly-admin-ui/components/detailPanel.vue";
|
|
75
71
|
import PageTableDetail from "befly-admin-ui/components/pageTableDetail.vue";
|
|
76
72
|
import { withDefaultColumns } from "befly-admin-ui/utils/withDefaultColumns";
|
|
73
|
+
import { AddIcon, ChevronDownIcon, DeleteIcon, EditIcon } from "tdesign-icons-vue-next";
|
|
74
|
+
import { Button as TButton, Dropdown as TDropdown, DropdownItem as TDropdownItem, DropdownMenu as TDropdownMenu, Option as TOption, Select as TSelect, Tag as TTag } from "tdesign-vue-next";
|
|
75
|
+
import { reactive } from "vue";
|
|
76
|
+
|
|
77
|
+
import EditDialog from "./components/edit.vue";
|
|
77
78
|
|
|
78
79
|
// 响应式数据
|
|
79
80
|
const $Data = reactive({
|
|
@@ -125,16 +126,16 @@ const $Data = reactive({
|
|
|
125
126
|
});
|
|
126
127
|
|
|
127
128
|
const $Method = {
|
|
128
|
-
onAdd() {
|
|
129
|
+
onAdd: function () {
|
|
129
130
|
$Method.onAction("add", {});
|
|
130
131
|
},
|
|
131
|
-
handleFilter(reload) {
|
|
132
|
+
handleFilter: function (reload) {
|
|
132
133
|
reload({ keepSelection: false, resetPage: true });
|
|
133
134
|
},
|
|
134
|
-
onDialogSuccess(reload) {
|
|
135
|
+
onDialogSuccess: function (reload) {
|
|
135
136
|
reload({ keepSelection: true });
|
|
136
137
|
},
|
|
137
|
-
onAction(command, rowData) {
|
|
138
|
+
onAction: function (command, rowData) {
|
|
138
139
|
$Data.actionType = command;
|
|
139
140
|
if (command === "add") {
|
|
140
141
|
$Data.rowData = {};
|
|
@@ -146,7 +147,7 @@ const $Method = {
|
|
|
146
147
|
$Data.editVisible = true;
|
|
147
148
|
}
|
|
148
149
|
},
|
|
149
|
-
onDropdownAction(data, rowData, deleteRow) {
|
|
150
|
+
onDropdownAction: function (data, rowData, deleteRow) {
|
|
150
151
|
const record = data;
|
|
151
152
|
const rawValue = record && record["value"] ? record["value"] : "";
|
|
152
153
|
const cmd = rawValue ? String(rawValue) : "";
|
|
@@ -24,9 +24,10 @@
|
|
|
24
24
|
</template>
|
|
25
25
|
|
|
26
26
|
<script setup>
|
|
27
|
-
import { reactive } from "vue";
|
|
28
|
-
import { Tag as TTag } from "tdesign-vue-next";
|
|
29
27
|
import { MenuIcon, SystemStorageIcon } from "tdesign-icons-vue-next";
|
|
28
|
+
import { Tag as TTag } from "tdesign-vue-next";
|
|
29
|
+
import { reactive } from "vue";
|
|
30
|
+
|
|
30
31
|
import { $Http } from "@/plugins/http.js";
|
|
31
32
|
|
|
32
33
|
// 组件内部数据
|
|
@@ -35,7 +36,7 @@ const $Data = reactive({
|
|
|
35
36
|
});
|
|
36
37
|
|
|
37
38
|
const $Method = {
|
|
38
|
-
async
|
|
39
|
+
fetchData: async function () {
|
|
39
40
|
try {
|
|
40
41
|
const res = await $Http("/core/dashboard/addonList", {}, [""]);
|
|
41
42
|
$Data.addonList.splice(0, $Data.addonList.length, ...res.data);
|
|
@@ -36,8 +36,9 @@
|
|
|
36
36
|
</template>
|
|
37
37
|
|
|
38
38
|
<script setup>
|
|
39
|
-
import { reactive } from "vue";
|
|
40
39
|
import { ServerIcon } from "tdesign-icons-vue-next";
|
|
40
|
+
import { reactive } from "vue";
|
|
41
|
+
|
|
41
42
|
import { $Http } from "@/plugins/http.js";
|
|
42
43
|
|
|
43
44
|
// 组件内部数据
|
|
@@ -53,7 +54,7 @@ const $Data = reactive({
|
|
|
53
54
|
});
|
|
54
55
|
|
|
55
56
|
const $Method = {
|
|
56
|
-
async
|
|
57
|
+
fetchData: async function () {
|
|
57
58
|
try {
|
|
58
59
|
const res = await $Http("/core/dashboard/environmentInfo", {}, [""]);
|
|
59
60
|
Object.assign($Data.environmentInfo, res.data);
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
36
|
<script setup>
|
|
37
|
-
import { reactive } from "vue";
|
|
38
|
-
import { Tag as TTag } from "tdesign-vue-next";
|
|
39
37
|
import { CodeIcon } from "tdesign-icons-vue-next";
|
|
38
|
+
import { Tag as TTag } from "tdesign-vue-next";
|
|
39
|
+
import { reactive } from "vue";
|
|
40
40
|
|
|
41
41
|
// 组件内部数据
|
|
42
42
|
const $Const = {
|
|
@@ -50,7 +50,7 @@ const $Const = {
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
const $Method = {
|
|
53
|
-
formatTime(timestamp) {
|
|
53
|
+
formatTime: function (timestamp) {
|
|
54
54
|
const date = new Date(timestamp);
|
|
55
55
|
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
56
56
|
const day = String(date.getDate()).padStart(2, "0");
|
|
@@ -41,8 +41,9 @@
|
|
|
41
41
|
</template>
|
|
42
42
|
|
|
43
43
|
<script setup>
|
|
44
|
-
import { reactive } from "vue";
|
|
45
44
|
import { ChartIcon, ErrorTriangleIcon } from "tdesign-icons-vue-next";
|
|
45
|
+
import { reactive } from "vue";
|
|
46
|
+
|
|
46
47
|
import { $Http } from "@/plugins/http.js";
|
|
47
48
|
|
|
48
49
|
// 组件内部数据
|
|
@@ -57,7 +58,7 @@ const $Data = reactive({
|
|
|
57
58
|
});
|
|
58
59
|
|
|
59
60
|
const $Method = {
|
|
60
|
-
async
|
|
61
|
+
fetchData: async function () {
|
|
61
62
|
try {
|
|
62
63
|
const res = await $Http("/core/dashboard/performanceMetrics", {}, [""]);
|
|
63
64
|
Object.assign($Data.performanceMetrics, res.data);
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
14
|
<script setup>
|
|
15
|
-
import { Button as TButton } from "tdesign-vue-next";
|
|
16
15
|
import { RefreshIcon } from "tdesign-icons-vue-next";
|
|
16
|
+
import { Button as TButton } from "tdesign-vue-next";
|
|
17
17
|
|
|
18
18
|
const handleClearCache = () => {
|
|
19
19
|
// TODO: 接入刷新缓存接口
|
|
@@ -21,8 +21,9 @@
|
|
|
21
21
|
</template>
|
|
22
22
|
|
|
23
23
|
<script setup>
|
|
24
|
-
import { reactive } from "vue";
|
|
25
24
|
import { CheckCircleIcon } from "tdesign-icons-vue-next";
|
|
25
|
+
import { reactive } from "vue";
|
|
26
|
+
|
|
26
27
|
import { $Http } from "@/plugins/http.js";
|
|
27
28
|
|
|
28
29
|
// 组件内部数据
|
|
@@ -39,7 +40,7 @@ const $Const = {
|
|
|
39
40
|
};
|
|
40
41
|
|
|
41
42
|
const $Method = {
|
|
42
|
-
async
|
|
43
|
+
fetchData: async function () {
|
|
43
44
|
try {
|
|
44
45
|
const res = await $Http("/core/dashboard/serviceStatus", {}, [""]);
|
|
45
46
|
const nextServices = Array.isArray(res.data?.services) ? res.data.services.filter((service) => service?.name !== "OSS存储") : [];
|
|
@@ -48,7 +49,7 @@ const $Method = {
|
|
|
48
49
|
// 静默失败:不阻断页面展示
|
|
49
50
|
}
|
|
50
51
|
},
|
|
51
|
-
getStatusText(status) {
|
|
52
|
+
getStatusText: function (status) {
|
|
52
53
|
return $Const.statusTextMap[status] || status;
|
|
53
54
|
}
|
|
54
55
|
};
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
</template>
|
|
27
27
|
|
|
28
28
|
<script setup>
|
|
29
|
-
import { reactive } from "vue";
|
|
30
|
-
import { Tag as TTag } from "tdesign-vue-next";
|
|
31
29
|
import { CheckCircleIcon, CloseCircleIcon, ErrorTriangleIcon, InfoCircleIcon, NotificationIcon } from "tdesign-icons-vue-next";
|
|
30
|
+
import { Tag as TTag } from "tdesign-vue-next";
|
|
31
|
+
import { reactive } from "vue";
|
|
32
32
|
|
|
33
33
|
// 组件内部数据
|
|
34
34
|
const $Const = {
|
|
@@ -41,7 +41,7 @@ const $Const = {
|
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
const $Method = {
|
|
44
|
-
formatTime(timestamp) {
|
|
44
|
+
formatTime: function (timestamp) {
|
|
45
45
|
const date = new Date(timestamp);
|
|
46
46
|
const now = Date.now();
|
|
47
47
|
const diff = now - timestamp;
|
|
@@ -190,9 +190,9 @@
|
|
|
190
190
|
</template>
|
|
191
191
|
|
|
192
192
|
<script setup>
|
|
193
|
-
import { computed, reactive } from "vue";
|
|
194
|
-
import { Option as TOption, Select as TSelect } from "tdesign-vue-next";
|
|
195
193
|
import { InfoCircleIcon, TrendingUpIcon } from "tdesign-icons-vue-next";
|
|
194
|
+
import { Option as TOption, Select as TSelect } from "tdesign-vue-next";
|
|
195
|
+
import { computed, reactive } from "vue";
|
|
196
196
|
|
|
197
197
|
import { $Config } from "@/plugins/config.js";
|
|
198
198
|
import { $Http } from "@/plugins/http.js";
|
|
@@ -235,7 +235,7 @@ const $Data = reactive({
|
|
|
235
235
|
});
|
|
236
236
|
|
|
237
237
|
const $Method = {
|
|
238
|
-
buildFallbackProduct() {
|
|
238
|
+
buildFallbackProduct: function () {
|
|
239
239
|
const days = $Method.sortTrendList($Data.realtimeStats.days, "reportDate");
|
|
240
240
|
|
|
241
241
|
return {
|
|
@@ -252,7 +252,7 @@ const $Method = {
|
|
|
252
252
|
totalUv: $Method.sumTrendField(days, "uv")
|
|
253
253
|
};
|
|
254
254
|
},
|
|
255
|
-
getReportDateNumber(timestamp) {
|
|
255
|
+
getReportDateNumber: function (timestamp) {
|
|
256
256
|
return Number(
|
|
257
257
|
new Intl.DateTimeFormat("en-CA", {
|
|
258
258
|
year: "numeric",
|
|
@@ -263,7 +263,7 @@ const $Method = {
|
|
|
263
263
|
.replace(/[^0-9]/g, "")
|
|
264
264
|
);
|
|
265
265
|
},
|
|
266
|
-
buildRecentReportDateList(limit) {
|
|
266
|
+
buildRecentReportDateList: function (limit) {
|
|
267
267
|
const list = [];
|
|
268
268
|
|
|
269
269
|
for (let i = limit - 1; i >= 0; i--) {
|
|
@@ -272,7 +272,7 @@ const $Method = {
|
|
|
272
272
|
|
|
273
273
|
return list;
|
|
274
274
|
},
|
|
275
|
-
buildFilledTrendDays(list, limit) {
|
|
275
|
+
buildFilledTrendDays: function (list, limit) {
|
|
276
276
|
const dateList = $Method.buildRecentReportDateList(limit);
|
|
277
277
|
const dataMap = new Map();
|
|
278
278
|
|
|
@@ -294,7 +294,7 @@ const $Method = {
|
|
|
294
294
|
);
|
|
295
295
|
});
|
|
296
296
|
},
|
|
297
|
-
sumTrendRange(list) {
|
|
297
|
+
sumTrendRange: function (list) {
|
|
298
298
|
let pv = 0;
|
|
299
299
|
let uv = 0;
|
|
300
300
|
|
|
@@ -308,7 +308,7 @@ const $Method = {
|
|
|
308
308
|
uv: uv
|
|
309
309
|
};
|
|
310
310
|
},
|
|
311
|
-
ensureSelectedProduct() {
|
|
311
|
+
ensureSelectedProduct: function () {
|
|
312
312
|
const list = $Computed.productOptions;
|
|
313
313
|
|
|
314
314
|
if (list.length === 0) {
|
|
@@ -323,10 +323,10 @@ const $Method = {
|
|
|
323
323
|
const currentProduct = list.find((item) => item.productName === $Data.productInfo.productName);
|
|
324
324
|
$Data.productState.selectedKey = currentProduct?.key || "all-products";
|
|
325
325
|
},
|
|
326
|
-
selectProduct(productKey) {
|
|
326
|
+
selectProduct: function (productKey) {
|
|
327
327
|
$Data.productState.selectedKey = String(productKey || "");
|
|
328
328
|
},
|
|
329
|
-
sumTrendField(list, field) {
|
|
329
|
+
sumTrendField: function (list, field) {
|
|
330
330
|
let total = 0;
|
|
331
331
|
|
|
332
332
|
for (const item of list) {
|
|
@@ -335,13 +335,13 @@ const $Method = {
|
|
|
335
335
|
|
|
336
336
|
return total;
|
|
337
337
|
},
|
|
338
|
-
sortTrendList(list, keyField) {
|
|
338
|
+
sortTrendList: function (list, keyField) {
|
|
339
339
|
const result = Array.isArray(list) ? list.slice() : [];
|
|
340
340
|
|
|
341
341
|
result.sort((a, b) => Number(a?.[keyField] || 0) - Number(b?.[keyField] || 0));
|
|
342
342
|
return result;
|
|
343
343
|
},
|
|
344
|
-
buildTrendPreview(list, maxCount) {
|
|
344
|
+
buildTrendPreview: function (list, maxCount) {
|
|
345
345
|
if (list.length <= maxCount) {
|
|
346
346
|
return list;
|
|
347
347
|
}
|
|
@@ -362,7 +362,7 @@ const $Method = {
|
|
|
362
362
|
|
|
363
363
|
return preview;
|
|
364
364
|
},
|
|
365
|
-
buildTrendBars(list, maxValue) {
|
|
365
|
+
buildTrendBars: function (list, maxValue) {
|
|
366
366
|
const result = [];
|
|
367
367
|
|
|
368
368
|
for (const item of list) {
|
|
@@ -380,7 +380,7 @@ const $Method = {
|
|
|
380
380
|
|
|
381
381
|
return result;
|
|
382
382
|
},
|
|
383
|
-
getTrendMax(list) {
|
|
383
|
+
getTrendMax: function (list) {
|
|
384
384
|
let max = 0;
|
|
385
385
|
|
|
386
386
|
for (const item of list) {
|
|
@@ -398,7 +398,7 @@ const $Method = {
|
|
|
398
398
|
|
|
399
399
|
return max > 0 ? max : 1;
|
|
400
400
|
},
|
|
401
|
-
formatDeviceType(deviceType) {
|
|
401
|
+
formatDeviceType: function (deviceType) {
|
|
402
402
|
if (deviceType === "desktop") {
|
|
403
403
|
return "桌面端";
|
|
404
404
|
}
|
|
@@ -425,7 +425,7 @@ const $Method = {
|
|
|
425
425
|
|
|
426
426
|
return String(deviceType || "Unknown");
|
|
427
427
|
},
|
|
428
|
-
formatReportDate(reportDate) {
|
|
428
|
+
formatReportDate: function (reportDate) {
|
|
429
429
|
const text = String(reportDate || "");
|
|
430
430
|
|
|
431
431
|
if (text.length !== 8) {
|
|
@@ -434,7 +434,7 @@ const $Method = {
|
|
|
434
434
|
|
|
435
435
|
return `${text.slice(4, 6)}-${text.slice(6, 8)}`;
|
|
436
436
|
},
|
|
437
|
-
async
|
|
437
|
+
fetchData: async function () {
|
|
438
438
|
try {
|
|
439
439
|
const [overviewRes, onlineStatsRes, infoStatsRes, errorStatsRes] = await Promise.all([$Http("/core/dashboard/systemOverview", {}, [""]), $Http("/core/tongJi/onlineStats", {}, [""]), $Http("/core/tongJi/infoStats", {}, [""]), $Http("/core/tongJi/errorStats", {}, [""])]);
|
|
440
440
|
|
|
@@ -33,8 +33,9 @@
|
|
|
33
33
|
</template>
|
|
34
34
|
|
|
35
35
|
<script setup>
|
|
36
|
-
import { reactive } from "vue";
|
|
37
36
|
import { ChartIcon } from "tdesign-icons-vue-next";
|
|
37
|
+
import { reactive } from "vue";
|
|
38
|
+
|
|
38
39
|
import { $Http } from "@/plugins/http.js";
|
|
39
40
|
|
|
40
41
|
// 组件内部数据
|
|
@@ -47,7 +48,7 @@ const $Data = reactive({
|
|
|
47
48
|
});
|
|
48
49
|
|
|
49
50
|
const $Method = {
|
|
50
|
-
async
|
|
51
|
+
fetchData: async function () {
|
|
51
52
|
try {
|
|
52
53
|
const res = await $Http("/core/dashboard/systemResources", {}, [""]);
|
|
53
54
|
Object.assign($Data.systemResources, res.data);
|
|
@@ -39,9 +39,10 @@
|
|
|
39
39
|
</template>
|
|
40
40
|
|
|
41
41
|
<script setup>
|
|
42
|
-
import { reactive } from "vue";
|
|
43
|
-
import { Button as TButton, MessagePlugin } from "tdesign-vue-next";
|
|
44
42
|
import { CallIcon, MailIcon, RefreshIcon, TimeIcon, UserIcon } from "tdesign-icons-vue-next";
|
|
43
|
+
import { Button as TButton, MessagePlugin } from "tdesign-vue-next";
|
|
44
|
+
import { reactive } from "vue";
|
|
45
|
+
|
|
45
46
|
import { $Http } from "@/plugins/http.js";
|
|
46
47
|
|
|
47
48
|
// 响应式数据
|
|
@@ -51,7 +52,7 @@ const $Data = reactive({
|
|
|
51
52
|
});
|
|
52
53
|
|
|
53
54
|
const $Method = {
|
|
54
|
-
async
|
|
55
|
+
fetchData: async function () {
|
|
55
56
|
try {
|
|
56
57
|
const res = await $Http("/core/admin/detail", {}, [""]);
|
|
57
58
|
Object.assign($Data.userInfo, res.data);
|
|
@@ -59,7 +60,7 @@ const $Method = {
|
|
|
59
60
|
MessagePlugin.error(error.msg || error.message || "获取用户信息失败");
|
|
60
61
|
}
|
|
61
62
|
},
|
|
62
|
-
async
|
|
63
|
+
handleRefreshCache: async function () {
|
|
63
64
|
try {
|
|
64
65
|
$Data.refreshing = true;
|
|
65
66
|
const result = await $Http("/core/admin/cacheRefresh");
|
|
@@ -86,7 +87,7 @@ const $Method = {
|
|
|
86
87
|
$Data.refreshing = false;
|
|
87
88
|
}
|
|
88
89
|
},
|
|
89
|
-
formatTime(timestamp) {
|
|
90
|
+
formatTime: function (timestamp) {
|
|
90
91
|
if (!timestamp) return "";
|
|
91
92
|
const date = new Date(Number(timestamp));
|
|
92
93
|
const now = new Date();
|
package/views/index/index.vue
CHANGED
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
22
|
<script setup>
|
|
23
|
-
import
|
|
23
|
+
import EnvironmentInfo from "./components/environmentInfo.vue";
|
|
24
|
+
import PerformanceMetrics from "./components/performanceMetrics.vue";
|
|
24
25
|
import ServiceStatus from "./components/serviceStatus.vue";
|
|
26
|
+
import SystemOverview from "./components/systemOverview.vue";
|
|
25
27
|
import SystemResources from "./components/systemResources.vue";
|
|
26
|
-
import PerformanceMetrics from "./components/performanceMetrics.vue";
|
|
27
|
-
import EnvironmentInfo from "./components/environmentInfo.vue";
|
|
28
28
|
</script>
|
|
29
29
|
|
|
30
30
|
<style scoped lang="scss">
|
|
@@ -70,17 +70,18 @@
|
|
|
70
70
|
</template>
|
|
71
71
|
|
|
72
72
|
<script setup>
|
|
73
|
-
import { reactive } from "vue";
|
|
74
|
-
import { Button as TButton, Form as TForm, FormItem as TFormItem, Input as TInput, MessagePlugin, Tag as TTag, Textarea as TTextarea } from "tdesign-vue-next";
|
|
75
|
-
import { CheckCircleIcon, SendIcon } from "tdesign-icons-vue-next";
|
|
76
|
-
import PageDialog from "befly-admin-ui/components/pageDialog.vue";
|
|
77
73
|
import DetailPanel from "befly-admin-ui/components/detailPanel.vue";
|
|
78
|
-
import
|
|
74
|
+
import PageDialog from "befly-admin-ui/components/pageDialog.vue";
|
|
79
75
|
import PageTableDetail from "befly-admin-ui/components/pageTableDetail.vue";
|
|
80
76
|
import { withDefaultColumns } from "befly-admin-ui/utils/withDefaultColumns";
|
|
77
|
+
import { CheckCircleIcon, SendIcon } from "tdesign-icons-vue-next";
|
|
78
|
+
import { Button as TButton, Form as TForm, FormItem as TFormItem, Input as TInput, MessagePlugin, Tag as TTag, Textarea as TTextarea } from "tdesign-vue-next";
|
|
79
|
+
import { reactive } from "vue";
|
|
80
|
+
|
|
81
|
+
import { $Http } from "@/plugins/http.js";
|
|
81
82
|
|
|
82
83
|
const $Const = {
|
|
83
|
-
createSendForm() {
|
|
84
|
+
createSendForm: function () {
|
|
84
85
|
return {
|
|
85
86
|
to: "",
|
|
86
87
|
cc: "",
|
|
@@ -126,14 +127,14 @@ const $Data = reactive({
|
|
|
126
127
|
});
|
|
127
128
|
|
|
128
129
|
const $Method = {
|
|
129
|
-
onCancelSend() {
|
|
130
|
+
onCancelSend: function () {
|
|
130
131
|
$Data.sendDialogVisible = false;
|
|
131
132
|
},
|
|
132
|
-
openSendDialog() {
|
|
133
|
+
openSendDialog: function () {
|
|
133
134
|
$Data.sendForm = $Const.createSendForm();
|
|
134
135
|
$Data.sendDialogVisible = true;
|
|
135
136
|
},
|
|
136
|
-
async
|
|
137
|
+
onSend: async function (reload, context) {
|
|
137
138
|
const form = $From.sendFormRef;
|
|
138
139
|
if (!form) {
|
|
139
140
|
MessagePlugin.warning("表单未就绪");
|
|
@@ -168,7 +169,7 @@ const $Method = {
|
|
|
168
169
|
$Data.sending = false;
|
|
169
170
|
}
|
|
170
171
|
},
|
|
171
|
-
async
|
|
172
|
+
onVerify: async function () {
|
|
172
173
|
try {
|
|
173
174
|
await $Http("/core/email/verify");
|
|
174
175
|
MessagePlugin.success("邮件服务配置正常");
|
|
@@ -176,7 +177,7 @@ const $Method = {
|
|
|
176
177
|
MessagePlugin.error(error.msg || error.message || "验证失败");
|
|
177
178
|
}
|
|
178
179
|
},
|
|
179
|
-
formatTime(timestamp) {
|
|
180
|
+
formatTime: function (timestamp) {
|
|
180
181
|
if (!timestamp) return "-";
|
|
181
182
|
const date = new Date(timestamp);
|
|
182
183
|
const year = date.getFullYear();
|
|
@@ -91,12 +91,12 @@
|
|
|
91
91
|
</template>
|
|
92
92
|
|
|
93
93
|
<script setup>
|
|
94
|
-
import { reactive } from "vue";
|
|
95
|
-
import { Button as TButton, Input as TInput, MessagePlugin, Option as TOption, Select as TSelect, Tag as TTag } from "tdesign-vue-next";
|
|
96
|
-
import { SearchIcon } from "tdesign-icons-vue-next";
|
|
97
94
|
import DetailPanel from "befly-admin-ui/components/detailPanel.vue";
|
|
98
95
|
import PageTableDetail from "befly-admin-ui/components/pageTableDetail.vue";
|
|
99
96
|
import { withDefaultColumns } from "befly-admin-ui/utils/withDefaultColumns";
|
|
97
|
+
import { SearchIcon } from "tdesign-icons-vue-next";
|
|
98
|
+
import { Button as TButton, Input as TInput, MessagePlugin, Option as TOption, Select as TSelect, Tag as TTag } from "tdesign-vue-next";
|
|
99
|
+
import { reactive } from "vue";
|
|
100
100
|
|
|
101
101
|
const $Data = reactive({
|
|
102
102
|
columns: withDefaultColumns([
|
|
@@ -170,13 +170,13 @@ const $Data = reactive({
|
|
|
170
170
|
});
|
|
171
171
|
|
|
172
172
|
const $Method = {
|
|
173
|
-
handleFilter(reload) {
|
|
173
|
+
handleFilter: function (reload) {
|
|
174
174
|
reload({ keepSelection: false, resetPage: true });
|
|
175
175
|
},
|
|
176
|
-
isDetailExpanded(id) {
|
|
176
|
+
isDetailExpanded: function (id) {
|
|
177
177
|
return Number($Data.detailExpandedId) === Number(id || 0);
|
|
178
178
|
},
|
|
179
|
-
toggleDetailExpand(id) {
|
|
179
|
+
toggleDetailExpand: function (id) {
|
|
180
180
|
const nextId = Number(id || 0);
|
|
181
181
|
|
|
182
182
|
if (Number($Data.detailExpandedId) === nextId) {
|
|
@@ -186,7 +186,7 @@ const $Method = {
|
|
|
186
186
|
|
|
187
187
|
$Data.detailExpandedId = nextId;
|
|
188
188
|
},
|
|
189
|
-
async
|
|
189
|
+
handleCopyDetail: async function (value) {
|
|
190
190
|
const text = $Method.formatDetail(value);
|
|
191
191
|
if (text === "-") {
|
|
192
192
|
MessagePlugin.warning("暂无可复制的错误详情");
|
|
@@ -200,7 +200,7 @@ const $Method = {
|
|
|
200
200
|
MessagePlugin.error("复制失败,请检查浏览器剪贴板权限");
|
|
201
201
|
}
|
|
202
202
|
},
|
|
203
|
-
getErrorTheme(errorType) {
|
|
203
|
+
getErrorTheme: function (errorType) {
|
|
204
204
|
if (errorType === "vue") {
|
|
205
205
|
return "danger";
|
|
206
206
|
}
|
|
@@ -215,7 +215,7 @@ const $Method = {
|
|
|
215
215
|
|
|
216
216
|
return "default";
|
|
217
217
|
},
|
|
218
|
-
formatErrorType(errorType) {
|
|
218
|
+
formatErrorType: function (errorType) {
|
|
219
219
|
if (errorType === "vue") {
|
|
220
220
|
return "Vue";
|
|
221
221
|
}
|
|
@@ -230,7 +230,7 @@ const $Method = {
|
|
|
230
230
|
|
|
231
231
|
return errorType || "Unknown";
|
|
232
232
|
},
|
|
233
|
-
formatDeviceType(deviceType) {
|
|
233
|
+
formatDeviceType: function (deviceType) {
|
|
234
234
|
if (deviceType === "desktop") {
|
|
235
235
|
return "桌面端";
|
|
236
236
|
}
|
|
@@ -249,7 +249,7 @@ const $Method = {
|
|
|
249
249
|
|
|
250
250
|
return deviceType || "Unknown";
|
|
251
251
|
},
|
|
252
|
-
formatTime(timestamp) {
|
|
252
|
+
formatTime: function (timestamp) {
|
|
253
253
|
const value = Number(timestamp || 0);
|
|
254
254
|
|
|
255
255
|
if (!value) {
|
|
@@ -270,7 +270,7 @@ const $Method = {
|
|
|
270
270
|
const seconds = String(date.getSeconds()).padStart(2, "0");
|
|
271
271
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
272
272
|
},
|
|
273
|
-
formatDetail(value) {
|
|
273
|
+
formatDetail: function (value) {
|
|
274
274
|
if (!value) {
|
|
275
275
|
return "-";
|
|
276
276
|
}
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
</template>
|
|
32
32
|
|
|
33
33
|
<script setup>
|
|
34
|
-
import { reactive } from "vue";
|
|
35
|
-
import { Tag as TTag } from "tdesign-vue-next";
|
|
36
34
|
import DetailPanel from "befly-admin-ui/components/detailPanel.vue";
|
|
37
35
|
import PageTableDetail from "befly-admin-ui/components/pageTableDetail.vue";
|
|
38
36
|
import { withDefaultColumns } from "befly-admin-ui/utils/withDefaultColumns";
|
|
37
|
+
import { Tag as TTag } from "tdesign-vue-next";
|
|
38
|
+
import { reactive } from "vue";
|
|
39
39
|
|
|
40
40
|
// 响应式数据
|
|
41
41
|
const $Data = reactive({
|
|
@@ -66,7 +66,7 @@ const $Data = reactive({
|
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
const $Method = {
|
|
69
|
-
formatTime(timestamp) {
|
|
69
|
+
formatTime: function (timestamp) {
|
|
70
70
|
if (!timestamp) return "-";
|
|
71
71
|
const date = new Date(timestamp);
|
|
72
72
|
const year = date.getFullYear();
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
</template>
|
|
55
55
|
|
|
56
56
|
<script setup>
|
|
57
|
-
import { reactive } from "vue";
|
|
58
|
-
import { Option as TOption, Select as TSelect, Tag as TTag } from "tdesign-vue-next";
|
|
59
57
|
import DetailPanel from "befly-admin-ui/components/detailPanel.vue";
|
|
60
58
|
import PageTableDetail from "befly-admin-ui/components/pageTableDetail.vue";
|
|
61
59
|
import { withDefaultColumns } from "befly-admin-ui/utils/withDefaultColumns";
|
|
60
|
+
import { Option as TOption, Select as TSelect, Tag as TTag } from "tdesign-vue-next";
|
|
61
|
+
import { reactive } from "vue";
|
|
62
62
|
|
|
63
63
|
// 响应式数据
|
|
64
64
|
const $Data = reactive({
|
|
@@ -115,10 +115,10 @@ const $Data = reactive({
|
|
|
115
115
|
});
|
|
116
116
|
|
|
117
117
|
const $Method = {
|
|
118
|
-
handleFilter(reload) {
|
|
118
|
+
handleFilter: function (reload) {
|
|
119
119
|
reload({ keepSelection: false, resetPage: true });
|
|
120
120
|
},
|
|
121
|
-
formatTime(timestamp) {
|
|
121
|
+
formatTime: function (timestamp) {
|
|
122
122
|
if (!timestamp) return "-";
|
|
123
123
|
const date = new Date(timestamp);
|
|
124
124
|
const year = date.getFullYear();
|
|
@@ -129,7 +129,7 @@ const $Method = {
|
|
|
129
129
|
const seconds = String(date.getSeconds()).padStart(2, "0");
|
|
130
130
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
131
131
|
},
|
|
132
|
-
formatJson(value) {
|
|
132
|
+
formatJson: function (value) {
|
|
133
133
|
if (!value) return "-";
|
|
134
134
|
try {
|
|
135
135
|
const obj = typeof value === "string" ? JSON.parse(value) : value;
|