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
package/views/login_1/index.vue
CHANGED
|
@@ -74,13 +74,14 @@
|
|
|
74
74
|
</template>
|
|
75
75
|
|
|
76
76
|
<script setup>
|
|
77
|
+
import { hashPassword } from "befly-admin-ui/utils/hashPassword";
|
|
78
|
+
import { LockOnIcon, UserIcon } from "tdesign-icons-vue-next";
|
|
79
|
+
import { Form as TForm, FormItem as TFormItem, Input as TInput, Button as TButton, Checkbox as TCheckbox, InputAdornment as TInputAdornment, Select as TSelect, Option as TOption, MessagePlugin } from "tdesign-vue-next";
|
|
77
80
|
import { reactive } from "vue";
|
|
78
81
|
import { useRouter } from "vue-router";
|
|
79
|
-
|
|
80
|
-
import { LockOnIcon, UserIcon } from "tdesign-icons-vue-next";
|
|
81
|
-
import { hashPassword } from "befly-admin-ui/utils/hashPassword";
|
|
82
|
-
import { $Http } from "@/plugins/http.js";
|
|
82
|
+
|
|
83
83
|
import { $Config } from "@/plugins/config.js";
|
|
84
|
+
import { $Http } from "@/plugins/http.js";
|
|
84
85
|
import { $Store } from "@/plugins/store.js";
|
|
85
86
|
|
|
86
87
|
const router = useRouter();
|
|
@@ -108,7 +109,7 @@ const $Data = reactive({
|
|
|
108
109
|
});
|
|
109
110
|
|
|
110
111
|
const $Method = {
|
|
111
|
-
async
|
|
112
|
+
apiLogin: async function () {
|
|
112
113
|
try {
|
|
113
114
|
if ($From.formRef === null) {
|
|
114
115
|
MessagePlugin.error("表单未就绪");
|
|
@@ -25,8 +25,9 @@
|
|
|
25
25
|
</template>
|
|
26
26
|
|
|
27
27
|
<script setup>
|
|
28
|
-
import
|
|
29
|
-
|
|
28
|
+
import PageDialog from "befly-admin-ui/components/pageDialog.vue";
|
|
29
|
+
import { fieldClear } from "befly-admin-ui/utils/fieldClear";
|
|
30
|
+
import { hashPassword } from "befly-admin-ui/utils/hashPassword";
|
|
30
31
|
import {
|
|
31
32
|
//
|
|
32
33
|
Form as TForm,
|
|
@@ -37,10 +38,9 @@ import {
|
|
|
37
38
|
Radio as TRadio,
|
|
38
39
|
MessagePlugin
|
|
39
40
|
} from "tdesign-vue-next";
|
|
40
|
-
import
|
|
41
|
+
import { computed, reactive } from "vue";
|
|
42
|
+
|
|
41
43
|
import { $Http } from "@/plugins/http.js";
|
|
42
|
-
import { fieldClear } from "befly-admin-ui/utils/fieldClear";
|
|
43
|
-
import { hashPassword } from "befly-admin-ui/utils/hashPassword";
|
|
44
44
|
|
|
45
45
|
const $Prop = defineProps({
|
|
46
46
|
modelValue: {
|
|
@@ -64,7 +64,7 @@ const $Const = {
|
|
|
64
64
|
add: "添加管理员",
|
|
65
65
|
upd: "编辑管理员"
|
|
66
66
|
},
|
|
67
|
-
createDefaultFormData() {
|
|
67
|
+
createDefaultFormData: function () {
|
|
68
68
|
return {
|
|
69
69
|
id: null,
|
|
70
70
|
username: "",
|
|
@@ -115,10 +115,10 @@ const $Data = reactive({
|
|
|
115
115
|
});
|
|
116
116
|
|
|
117
117
|
const $Method = {
|
|
118
|
-
resetFormData() {
|
|
118
|
+
resetFormData: function () {
|
|
119
119
|
Object.assign($Data.formData, $Const.createDefaultFormData());
|
|
120
120
|
},
|
|
121
|
-
assignFormData(rowData) {
|
|
121
|
+
assignFormData: function (rowData) {
|
|
122
122
|
Object.assign($Data.formData, $Const.createDefaultFormData(), {
|
|
123
123
|
id: rowData.id ?? null,
|
|
124
124
|
username: rowData.username || "",
|
|
@@ -127,7 +127,7 @@ const $Method = {
|
|
|
127
127
|
state: typeof rowData.state === "number" ? rowData.state : 1
|
|
128
128
|
});
|
|
129
129
|
},
|
|
130
|
-
async
|
|
130
|
+
apiRoleLists: async function () {
|
|
131
131
|
try {
|
|
132
132
|
const result = await $Http("/core/role/all", {}, [""]);
|
|
133
133
|
const roleList = Array.isArray(result.data?.lists) ? result.data.lists : [];
|
|
@@ -141,10 +141,10 @@ const $Method = {
|
|
|
141
141
|
MessagePlugin.error(error.msg || error.message || "加载角色列表失败");
|
|
142
142
|
}
|
|
143
143
|
},
|
|
144
|
-
buildSubmitData() {
|
|
144
|
+
buildSubmitData: function () {
|
|
145
145
|
return $Computed.isAdd ? fieldClear($Data.formData, { omitKeys: ["id", "state"] }) : fieldClear($Data.formData, { omitKeys: ["password"] });
|
|
146
146
|
},
|
|
147
|
-
async
|
|
147
|
+
initData: async function () {
|
|
148
148
|
await $Method.apiRoleLists();
|
|
149
149
|
if ($Computed.isUpdate && $Prop.rowData.id) {
|
|
150
150
|
$Method.assignFormData($Prop.rowData);
|
|
@@ -153,7 +153,7 @@ const $Method = {
|
|
|
153
153
|
|
|
154
154
|
$Method.resetFormData();
|
|
155
155
|
},
|
|
156
|
-
async
|
|
156
|
+
onSubmit: async function (context) {
|
|
157
157
|
try {
|
|
158
158
|
const form = $From.formRef;
|
|
159
159
|
if (!form) {
|
|
@@ -40,12 +40,13 @@
|
|
|
40
40
|
</template>
|
|
41
41
|
|
|
42
42
|
<script setup>
|
|
43
|
-
import { reactive } from "vue";
|
|
44
|
-
import { Button as TButton, Dropdown as TDropdown, DropdownItem as TDropdownItem, DropdownMenu as TDropdownMenu, Tag as TTag } from "tdesign-vue-next";
|
|
45
|
-
import { AddIcon, ChevronDownIcon, DeleteIcon, EditIcon } from "tdesign-icons-vue-next";
|
|
46
|
-
import EditDialog from "./components/edit.vue";
|
|
47
43
|
import PageTableDetail from "befly-admin-ui/components/pageTableDetail.vue";
|
|
48
44
|
import { withDefaultColumns } from "befly-admin-ui/utils/withDefaultColumns";
|
|
45
|
+
import { AddIcon, ChevronDownIcon, DeleteIcon, EditIcon } from "tdesign-icons-vue-next";
|
|
46
|
+
import { Button as TButton, Dropdown as TDropdown, DropdownItem as TDropdownItem, DropdownMenu as TDropdownMenu, Tag as TTag } from "tdesign-vue-next";
|
|
47
|
+
import { reactive } from "vue";
|
|
48
|
+
|
|
49
|
+
import EditDialog from "./components/edit.vue";
|
|
49
50
|
|
|
50
51
|
// 响应式数据
|
|
51
52
|
const $Data = reactive({
|
|
@@ -77,20 +78,20 @@ const $Data = reactive({
|
|
|
77
78
|
});
|
|
78
79
|
|
|
79
80
|
const $Method = {
|
|
80
|
-
onAdd() {
|
|
81
|
+
onAdd: function () {
|
|
81
82
|
$Method.onAction("add", {});
|
|
82
83
|
},
|
|
83
|
-
onDialogSuccess(reload) {
|
|
84
|
+
onDialogSuccess: function (reload) {
|
|
84
85
|
reload({ keepSelection: true });
|
|
85
86
|
},
|
|
86
|
-
onAction(command, rowData) {
|
|
87
|
+
onAction: function (command, rowData) {
|
|
87
88
|
$Data.actionType = command;
|
|
88
89
|
$Data.rowData = rowData;
|
|
89
90
|
if (command === "add" || command === "upd") {
|
|
90
91
|
$Data.editVisible = true;
|
|
91
92
|
}
|
|
92
93
|
},
|
|
93
|
-
onDropdownAction(data, rowData, deleteRow) {
|
|
94
|
+
onDropdownAction: function (data, rowData, deleteRow) {
|
|
94
95
|
const record = data;
|
|
95
96
|
const rawValue = record && record["value"] ? record["value"] : "";
|
|
96
97
|
const cmd = rawValue ? String(rawValue) : "";
|
|
@@ -52,12 +52,13 @@
|
|
|
52
52
|
</template>
|
|
53
53
|
|
|
54
54
|
<script setup>
|
|
55
|
-
import { reactive } from "vue";
|
|
56
|
-
import { Table as TTable, Tag as TTag, Input as TInput, MessagePlugin } from "tdesign-vue-next";
|
|
57
|
-
import { SearchIcon } from "tdesign-icons-vue-next";
|
|
58
55
|
import DetailPanel from "befly-admin-ui/components/detailPanel.vue";
|
|
59
|
-
import { $Http } from "@/plugins/http.js";
|
|
60
56
|
import { withDefaultColumns } from "befly-admin-ui/utils/withDefaultColumns";
|
|
57
|
+
import { SearchIcon } from "tdesign-icons-vue-next";
|
|
58
|
+
import { Table as TTable, Tag as TTag, Input as TInput, MessagePlugin } from "tdesign-vue-next";
|
|
59
|
+
import { reactive } from "vue";
|
|
60
|
+
|
|
61
|
+
import { $Http } from "@/plugins/http.js";
|
|
61
62
|
|
|
62
63
|
// 响应式数据
|
|
63
64
|
const $Data = reactive({
|
|
@@ -77,10 +78,10 @@ const $Data = reactive({
|
|
|
77
78
|
});
|
|
78
79
|
|
|
79
80
|
const $Method = {
|
|
80
|
-
async
|
|
81
|
+
initData: async function () {
|
|
81
82
|
await $Method.loadApiAll();
|
|
82
83
|
},
|
|
83
|
-
async
|
|
84
|
+
loadApiAll: async function () {
|
|
84
85
|
$Data.loading = true;
|
|
85
86
|
try {
|
|
86
87
|
const res = await $Http("/core/api/all", {}, [""]);
|
|
@@ -101,7 +102,7 @@ const $Method = {
|
|
|
101
102
|
$Data.loading = false;
|
|
102
103
|
}
|
|
103
104
|
},
|
|
104
|
-
handleSearch() {
|
|
105
|
+
handleSearch: function () {
|
|
105
106
|
if (!$Data.searchKeyword) {
|
|
106
107
|
$Data.tableData = $Data.allData;
|
|
107
108
|
return;
|
|
@@ -109,7 +110,7 @@ const $Method = {
|
|
|
109
110
|
const keyword = String($Data.searchKeyword).toLowerCase();
|
|
110
111
|
$Data.tableData = $Data.allData.filter((item) => item.name?.toLowerCase().includes(keyword) || item.path?.toLowerCase().includes(keyword));
|
|
111
112
|
},
|
|
112
|
-
onActiveChange(value, context) {
|
|
113
|
+
onActiveChange: function (value, context) {
|
|
113
114
|
if (value.length === 0 && $Data.activeRowKeys.length > 0) {
|
|
114
115
|
return;
|
|
115
116
|
}
|
|
@@ -29,12 +29,13 @@
|
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
31
|
<script setup>
|
|
32
|
-
import { reactive } from "vue";
|
|
33
|
-
import { Table as TTable, Tag as TTag, MessagePlugin } from "tdesign-vue-next";
|
|
34
32
|
import DetailPanel from "befly-admin-ui/components/detailPanel.vue";
|
|
35
|
-
import { $Http } from "@/plugins/http.js";
|
|
36
33
|
import { arrayToTree } from "befly-admin-ui/utils/arrayToTree";
|
|
37
34
|
import { withDefaultColumns } from "befly-admin-ui/utils/withDefaultColumns";
|
|
35
|
+
import { Table as TTable, Tag as TTag, MessagePlugin } from "tdesign-vue-next";
|
|
36
|
+
import { reactive } from "vue";
|
|
37
|
+
|
|
38
|
+
import { $Http } from "@/plugins/http.js";
|
|
38
39
|
|
|
39
40
|
// 响应式数据
|
|
40
41
|
const $Data = reactive({
|
|
@@ -52,10 +53,10 @@ const $Data = reactive({
|
|
|
52
53
|
});
|
|
53
54
|
|
|
54
55
|
const $Method = {
|
|
55
|
-
async
|
|
56
|
+
initData: async function () {
|
|
56
57
|
await $Method.apiMenuList();
|
|
57
58
|
},
|
|
58
|
-
async
|
|
59
|
+
apiMenuList: async function () {
|
|
59
60
|
$Data.loading = true;
|
|
60
61
|
try {
|
|
61
62
|
const res = await $Http("/core/menu/all", {}, [""]);
|
|
@@ -78,7 +79,7 @@ const $Method = {
|
|
|
78
79
|
$Data.loading = false;
|
|
79
80
|
}
|
|
80
81
|
},
|
|
81
|
-
onActiveChange(value, context) {
|
|
82
|
+
onActiveChange: function (value, context) {
|
|
82
83
|
if (value.length === 0 && $Data.activeRowKeys.length > 0) {
|
|
83
84
|
return;
|
|
84
85
|
}
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
</template>
|
|
33
33
|
|
|
34
34
|
<script setup>
|
|
35
|
+
import PageDialog from "befly-admin-ui/components/pageDialog.vue";
|
|
36
|
+
import { SearchIcon } from "tdesign-icons-vue-next";
|
|
37
|
+
import { Input as TInput, CheckboxGroup as TCheckboxGroup, Checkbox as TCheckbox, MessagePlugin } from "tdesign-vue-next";
|
|
35
38
|
import { computed, reactive } from "vue";
|
|
36
39
|
|
|
37
|
-
import { Input as TInput, CheckboxGroup as TCheckboxGroup, Checkbox as TCheckbox, MessagePlugin } from "tdesign-vue-next";
|
|
38
|
-
import { SearchIcon } from "tdesign-icons-vue-next";
|
|
39
|
-
import PageDialog from "befly-admin-ui/components/pageDialog.vue";
|
|
40
40
|
import { $Http } from "@/plugins/http.js";
|
|
41
41
|
|
|
42
42
|
const $Prop = defineProps({
|
|
@@ -70,7 +70,7 @@ const $Computed = reactive({
|
|
|
70
70
|
});
|
|
71
71
|
|
|
72
72
|
const $Method = {
|
|
73
|
-
async
|
|
73
|
+
initData: async function () {
|
|
74
74
|
await Promise.all([$Method.apiApiAll(), $Method.apiRoleApiDetail()]);
|
|
75
75
|
|
|
76
76
|
const merged = new Set();
|
|
@@ -99,7 +99,7 @@ const $Method = {
|
|
|
99
99
|
$Data.checkedApiPaths = Array.from(merged);
|
|
100
100
|
$Data.filteredApiData = $Data.apiData;
|
|
101
101
|
},
|
|
102
|
-
async
|
|
102
|
+
apiApiAll: async function () {
|
|
103
103
|
try {
|
|
104
104
|
const res = await $Http("/core/api/all", {}, [""]);
|
|
105
105
|
|
|
@@ -156,7 +156,7 @@ const $Method = {
|
|
|
156
156
|
MessagePlugin.error(error.msg || error.message || "加载接口失败");
|
|
157
157
|
}
|
|
158
158
|
},
|
|
159
|
-
async
|
|
159
|
+
apiRoleApiDetail: async function () {
|
|
160
160
|
if (!$Prop.rowData.id) return;
|
|
161
161
|
|
|
162
162
|
try {
|
|
@@ -175,7 +175,7 @@ const $Method = {
|
|
|
175
175
|
MessagePlugin.error(error.msg || error.message || "加载数据失败");
|
|
176
176
|
}
|
|
177
177
|
},
|
|
178
|
-
onSearch() {
|
|
178
|
+
onSearch: function () {
|
|
179
179
|
if (!$Data.searchText) {
|
|
180
180
|
$Data.filteredApiData = $Data.apiData;
|
|
181
181
|
return;
|
|
@@ -201,7 +201,7 @@ const $Method = {
|
|
|
201
201
|
})
|
|
202
202
|
.filter((group) => group.apis.length > 0);
|
|
203
203
|
},
|
|
204
|
-
async
|
|
204
|
+
onSubmit: async function (context) {
|
|
205
205
|
try {
|
|
206
206
|
$Data.submitting = true;
|
|
207
207
|
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
</template>
|
|
37
37
|
|
|
38
38
|
<script setup>
|
|
39
|
-
import
|
|
40
|
-
|
|
39
|
+
import PageDialog from "befly-admin-ui/components/pageDialog.vue";
|
|
40
|
+
import { fieldClear } from "befly-admin-ui/utils/fieldClear";
|
|
41
41
|
import {
|
|
42
42
|
//
|
|
43
43
|
Form as TForm,
|
|
@@ -48,9 +48,9 @@ import {
|
|
|
48
48
|
Radio as TRadio,
|
|
49
49
|
MessagePlugin
|
|
50
50
|
} from "tdesign-vue-next";
|
|
51
|
-
import
|
|
51
|
+
import { computed, reactive, ref } from "vue";
|
|
52
|
+
|
|
52
53
|
import { $Http } from "@/plugins/http.js";
|
|
53
|
-
import { fieldClear } from "befly-admin-ui/utils/fieldClear";
|
|
54
54
|
|
|
55
55
|
const $Prop = defineProps({
|
|
56
56
|
modelValue: {
|
|
@@ -70,7 +70,7 @@ const $Prop = defineProps({
|
|
|
70
70
|
const $Emit = defineEmits(["update:modelValue", "success"]);
|
|
71
71
|
|
|
72
72
|
const $Const = {
|
|
73
|
-
createDefaultFormData() {
|
|
73
|
+
createDefaultFormData: function () {
|
|
74
74
|
return {
|
|
75
75
|
id: 0,
|
|
76
76
|
name: "",
|
|
@@ -110,10 +110,10 @@ const $Computed = reactive({
|
|
|
110
110
|
});
|
|
111
111
|
|
|
112
112
|
const $Method = {
|
|
113
|
-
resetFormData() {
|
|
113
|
+
resetFormData: function () {
|
|
114
114
|
Object.assign($Data.formData, $Const.createDefaultFormData());
|
|
115
115
|
},
|
|
116
|
-
initData() {
|
|
116
|
+
initData: function () {
|
|
117
117
|
if ($Prop.actionType === "upd" && $Prop.rowData.id) {
|
|
118
118
|
Object.assign($Data.formData, $Const.createDefaultFormData(), $Prop.rowData);
|
|
119
119
|
return;
|
|
@@ -121,7 +121,7 @@ const $Method = {
|
|
|
121
121
|
|
|
122
122
|
$Method.resetFormData();
|
|
123
123
|
},
|
|
124
|
-
async
|
|
124
|
+
onSubmit: async function (context) {
|
|
125
125
|
try {
|
|
126
126
|
const form = $From.formRef;
|
|
127
127
|
if (!form) {
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
</template>
|
|
34
34
|
|
|
35
35
|
<script setup>
|
|
36
|
+
import PageDialog from "befly-admin-ui/components/pageDialog.vue";
|
|
37
|
+
import { arrayToTree } from "befly-admin-ui/utils/arrayToTree";
|
|
38
|
+
import { SearchIcon } from "tdesign-icons-vue-next";
|
|
39
|
+
import { CheckboxGroup as TCheckboxGroup, Checkbox as TCheckbox, Input as TInput, MessagePlugin } from "tdesign-vue-next";
|
|
36
40
|
import { computed, reactive } from "vue";
|
|
37
41
|
|
|
38
|
-
import { CheckboxGroup as TCheckboxGroup, Checkbox as TCheckbox, Input as TInput, MessagePlugin } from "tdesign-vue-next";
|
|
39
|
-
import { SearchIcon } from "tdesign-icons-vue-next";
|
|
40
|
-
import PageDialog from "befly-admin-ui/components/pageDialog.vue";
|
|
41
42
|
import { $Http } from "@/plugins/http.js";
|
|
42
|
-
import { arrayToTree } from "befly-admin-ui/utils/arrayToTree";
|
|
43
43
|
|
|
44
44
|
const $Prop = defineProps({
|
|
45
45
|
modelValue: {
|
|
@@ -72,11 +72,11 @@ const $Computed = reactive({
|
|
|
72
72
|
});
|
|
73
73
|
|
|
74
74
|
const $Method = {
|
|
75
|
-
async
|
|
75
|
+
initData: async function () {
|
|
76
76
|
await Promise.all([$Method.apiMenuAll(), $Method.apiRoleMenuDetail()]);
|
|
77
77
|
$Data.filteredMenuGroups = $Data.menuGroups;
|
|
78
78
|
},
|
|
79
|
-
async
|
|
79
|
+
apiMenuAll: async function () {
|
|
80
80
|
try {
|
|
81
81
|
const res = await $Http("/core/menu/all", {}, [""]);
|
|
82
82
|
const lists = Array.isArray(res?.data?.lists) ? res.data.lists : [];
|
|
@@ -126,7 +126,7 @@ const $Method = {
|
|
|
126
126
|
MessagePlugin.error(error.msg || error.message || "加载菜单失败");
|
|
127
127
|
}
|
|
128
128
|
},
|
|
129
|
-
async
|
|
129
|
+
apiRoleMenuDetail: async function () {
|
|
130
130
|
if (!$Prop.rowData.id) return;
|
|
131
131
|
|
|
132
132
|
try {
|
|
@@ -143,7 +143,7 @@ const $Method = {
|
|
|
143
143
|
MessagePlugin.error(error.msg || error.message || "加载数据失败");
|
|
144
144
|
}
|
|
145
145
|
},
|
|
146
|
-
onSearch() {
|
|
146
|
+
onSearch: function () {
|
|
147
147
|
const kw = typeof $Data.searchText === "string" ? $Data.searchText.trim().toLowerCase() : "";
|
|
148
148
|
if (kw.length === 0) {
|
|
149
149
|
$Data.filteredMenuGroups = $Data.menuGroups;
|
|
@@ -168,7 +168,7 @@ const $Method = {
|
|
|
168
168
|
})
|
|
169
169
|
.filter((group) => group.menus.length > 0);
|
|
170
170
|
},
|
|
171
|
-
async
|
|
171
|
+
onSubmit: async function (context) {
|
|
172
172
|
try {
|
|
173
173
|
$Data.submitting = true;
|
|
174
174
|
|
|
@@ -63,14 +63,15 @@
|
|
|
63
63
|
</template>
|
|
64
64
|
|
|
65
65
|
<script setup>
|
|
66
|
-
import
|
|
67
|
-
import {
|
|
66
|
+
import PageTableDetail from "befly-admin-ui/components/pageTableDetail.vue";
|
|
67
|
+
import { withDefaultColumns } from "befly-admin-ui/utils/withDefaultColumns";
|
|
68
68
|
import { AddIcon, ChevronDownIcon, CodeIcon, DeleteIcon, EditIcon, SettingIcon } from "tdesign-icons-vue-next";
|
|
69
|
+
import { Button as TButton, Dropdown as TDropdown, DropdownItem as TDropdownItem, DropdownMenu as TDropdownMenu, Tag as TTag } from "tdesign-vue-next";
|
|
70
|
+
import { reactive } from "vue";
|
|
71
|
+
|
|
72
|
+
import ApiDialog from "./components/api.vue";
|
|
69
73
|
import EditDialog from "./components/edit.vue";
|
|
70
74
|
import MenuDialog from "./components/menu.vue";
|
|
71
|
-
import ApiDialog from "./components/api.vue";
|
|
72
|
-
import PageTableDetail from "befly-admin-ui/components/pageTableDetail.vue";
|
|
73
|
-
import { withDefaultColumns } from "befly-admin-ui/utils/withDefaultColumns";
|
|
74
75
|
|
|
75
76
|
// 响应式数据
|
|
76
77
|
const $Data = reactive({
|
|
@@ -110,17 +111,17 @@ const $Data = reactive({
|
|
|
110
111
|
});
|
|
111
112
|
|
|
112
113
|
const $Method = {
|
|
113
|
-
onAdd() {
|
|
114
|
+
onAdd: function () {
|
|
114
115
|
$Method.onAction("add", {});
|
|
115
116
|
},
|
|
116
|
-
onDialogSuccess(reload) {
|
|
117
|
+
onDialogSuccess: function (reload) {
|
|
117
118
|
reload({ keepSelection: true });
|
|
118
119
|
},
|
|
119
|
-
getPathCount(value) {
|
|
120
|
+
getPathCount: function (value) {
|
|
120
121
|
if (!Array.isArray(value)) return 0;
|
|
121
122
|
return value.filter((path) => typeof path === "string" && path.trim().length > 0).length;
|
|
122
123
|
},
|
|
123
|
-
onAction(command, rowData) {
|
|
124
|
+
onAction: function (command, rowData) {
|
|
124
125
|
$Data.actionType = command;
|
|
125
126
|
|
|
126
127
|
if (command === "add") {
|
|
@@ -143,7 +144,7 @@ const $Method = {
|
|
|
143
144
|
$Data.apiVisible = true;
|
|
144
145
|
}
|
|
145
146
|
},
|
|
146
|
-
onDropdownAction(data, rowData, deleteRow) {
|
|
147
|
+
onDropdownAction: function (data, rowData, deleteRow) {
|
|
147
148
|
const record = data;
|
|
148
149
|
const rawValue = record && record["value"] ? record["value"] : "";
|
|
149
150
|
const cmd = rawValue ? String(rawValue) : "";
|
|
@@ -76,13 +76,13 @@
|
|
|
76
76
|
</template>
|
|
77
77
|
|
|
78
78
|
<script setup>
|
|
79
|
-
import { reactive } from "vue";
|
|
80
|
-
import { Button as TButton, Image as TImage, Input as TInput, MessagePlugin, Tag as TTag, Upload as TUpload } from "tdesign-vue-next";
|
|
81
|
-
import { SearchIcon, UploadIcon } from "tdesign-icons-vue-next";
|
|
82
|
-
|
|
83
79
|
import DetailPanel from "befly-admin-ui/components/detailPanel.vue";
|
|
84
80
|
import PageTableDetail from "befly-admin-ui/components/pageTableDetail.vue";
|
|
85
81
|
import { withDefaultColumns } from "befly-admin-ui/utils/withDefaultColumns";
|
|
82
|
+
import { SearchIcon, UploadIcon } from "tdesign-icons-vue-next";
|
|
83
|
+
import { Button as TButton, Image as TImage, Input as TInput, MessagePlugin, Tag as TTag, Upload as TUpload } from "tdesign-vue-next";
|
|
84
|
+
import { reactive } from "vue";
|
|
85
|
+
|
|
86
86
|
import { $Config } from "@/plugins/config.js";
|
|
87
87
|
import { $Store } from "@/plugins/store.js";
|
|
88
88
|
|
|
@@ -93,10 +93,10 @@ const $Const = {
|
|
|
93
93
|
};
|
|
94
94
|
|
|
95
95
|
const $Method = {
|
|
96
|
-
handleSearch(reload) {
|
|
96
|
+
handleSearch: function (reload) {
|
|
97
97
|
reload({ keepSelection: false, resetPage: true });
|
|
98
98
|
},
|
|
99
|
-
async
|
|
99
|
+
copyUrl: async function (url) {
|
|
100
100
|
try {
|
|
101
101
|
await navigator.clipboard.writeText(url);
|
|
102
102
|
MessagePlugin.success("图片链接已复制");
|
|
@@ -104,7 +104,7 @@ const $Method = {
|
|
|
104
104
|
MessagePlugin.error(error?.message || "复制失败");
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
|
-
formatFileSize(fileSize) {
|
|
107
|
+
formatFileSize: function (fileSize) {
|
|
108
108
|
if (!Number.isFinite(fileSize) || fileSize <= 0) {
|
|
109
109
|
return "0 B";
|
|
110
110
|
}
|
|
@@ -119,14 +119,14 @@ const $Method = {
|
|
|
119
119
|
|
|
120
120
|
return `${(fileSize / 1024 / 1024).toFixed(1)} MB`;
|
|
121
121
|
},
|
|
122
|
-
formatFileExt(fileExt) {
|
|
122
|
+
formatFileExt: function (fileExt) {
|
|
123
123
|
if (typeof fileExt !== "string" || fileExt.length === 0) {
|
|
124
124
|
return "未知格式";
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
return fileExt.replace(/^\./, "").toUpperCase();
|
|
128
128
|
},
|
|
129
|
-
formatDateTime(value) {
|
|
129
|
+
formatDateTime: function (value) {
|
|
130
130
|
if (!value) {
|
|
131
131
|
return "-";
|
|
132
132
|
}
|
|
@@ -144,7 +144,7 @@ const $Method = {
|
|
|
144
144
|
const seconds = String(date.getSeconds()).padStart(2, "0");
|
|
145
145
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
146
146
|
},
|
|
147
|
-
onUploadSuccess(res, reload) {
|
|
147
|
+
onUploadSuccess: function (res, reload) {
|
|
148
148
|
if (res.response?.code !== 0 || res.response?.data?.isImage !== 1) {
|
|
149
149
|
MessagePlugin.error(res.response?.msg || "上传失败");
|
|
150
150
|
return;
|