befly-admin-ui 1.10.0 → 1.10.2

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 (34) hide show
  1. package/components/detailPanel.vue +52 -54
  2. package/components/pageDialog.vue +131 -117
  3. package/components/pageTableDetail.vue +381 -398
  4. package/layouts/default.vue +212 -215
  5. package/package.json +2 -2
  6. package/views/config/dict/components/edit.vue +83 -60
  7. package/views/config/dict/index.vue +53 -68
  8. package/views/config/dictType/components/edit.vue +81 -57
  9. package/views/config/dictType/index.vue +39 -51
  10. package/views/config/system/components/edit.vue +97 -86
  11. package/views/config/system/index.vue +37 -51
  12. package/views/index/components/addonList.vue +14 -11
  13. package/views/index/components/environmentInfo.vue +25 -22
  14. package/views/index/components/operationLogs.vue +20 -16
  15. package/views/index/components/performanceMetrics.vue +24 -21
  16. package/views/index/components/serviceStatus.vue +26 -22
  17. package/views/index/components/systemNotifications.vue +24 -19
  18. package/views/index/components/systemOverview.vue +368 -385
  19. package/views/index/components/systemResources.vue +22 -19
  20. package/views/index/components/userInfo.vue +56 -56
  21. package/views/log/email/index.vue +99 -100
  22. package/views/log/error/index.vue +112 -130
  23. package/views/log/login/index.vue +17 -28
  24. package/views/log/operate/index.vue +33 -46
  25. package/views/login_1/index.vue +50 -32
  26. package/views/people/admin/components/edit.vue +1 -1
  27. package/views/people/admin/index.vue +28 -29
  28. package/views/permission/api/index.vue +46 -58
  29. package/views/permission/menu/index.vue +46 -52
  30. package/views/permission/role/components/api.vue +143 -144
  31. package/views/permission/role/components/edit.vue +74 -52
  32. package/views/permission/role/components/menu.vue +119 -121
  33. package/views/permission/role/index.vue +49 -63
  34. package/views/resource/gallery/index.vue +78 -88
@@ -1,6 +1,15 @@
1
1
  <template>
2
- <PageDialog v-model="visible" :title="actionType === 'add' ? '添加字典项' : '编辑字典项'" @confirm="handleSubmit">
3
- <TForm :data="$Data.formData" :rules="$Data.rules" label-width="100px" ref="formRef">
2
+ <PageDialog v-model="$Computed.visible" :title="$Computed.dialogTitle" @confirm="$Method.handleSubmit">
3
+ <TForm
4
+ :data="$Data.formData"
5
+ :rules="$Const.formRules"
6
+ label-width="100px"
7
+ :ref="
8
+ (value) => {
9
+ $From.formRef = value;
10
+ }
11
+ "
12
+ >
4
13
  <TFormItem label="字典类型" name="typeCode">
5
14
  <TSelect v-model="$Data.formData.typeCode" placeholder="请选择字典类型" filterable>
6
15
  <TOption v-for="item in typeList" :key="item.code" :value="item.code" :label="item.name" />
@@ -23,13 +32,13 @@
23
32
  </template>
24
33
 
25
34
  <script setup>
26
- import { computed, reactive, ref } from "vue";
35
+ import { computed, reactive } from "vue";
27
36
 
28
37
  import { Form as TForm, FormItem as TFormItem, Input as TInput, Select as TSelect, Option as TOption, Textarea as TTextarea, InputNumber as TInputNumber, MessagePlugin } from "tdesign-vue-next";
29
38
  import PageDialog from "befly-admin-ui/components/pageDialog.vue";
30
- import { $Http } from "@/plugins/http";
39
+ import { $Http } from "@/plugins/http.js";
31
40
 
32
- const props = defineProps({
41
+ const $Prop = defineProps({
33
42
  modelValue: Boolean,
34
43
  actionType: String,
35
44
  rowData: Object,
@@ -38,72 +47,86 @@ const props = defineProps({
38
47
 
39
48
  const $Emit = defineEmits(["update:modelValue", "success"]);
40
49
 
41
- const visible = computed({
42
- get: () => props.modelValue,
43
- set: (val) => $Emit("update:modelValue", val)
44
- });
45
-
46
- const formRef = ref(null);
47
-
48
- const $Data = reactive({
49
- formData: {
50
- typeCode: "",
51
- key: "",
52
- label: "",
53
- sort: 0,
54
- remark: ""
50
+ const $Const = {
51
+ createDefaultFormData() {
52
+ return {
53
+ typeCode: "",
54
+ key: "",
55
+ label: "",
56
+ sort: 0,
57
+ remark: ""
58
+ };
55
59
  },
56
- rules: {
60
+ formRules: {
57
61
  typeCode: [{ required: true, message: "请选择字典类型" }],
58
62
  key: [{ required: true, message: "请输入键值" }],
59
63
  label: [{ required: true, message: "请输入标签" }]
60
64
  }
65
+ };
66
+
67
+ const $From = {
68
+ formRef: null
69
+ };
70
+
71
+ const $Data = reactive({
72
+ formData: $Const.createDefaultFormData()
61
73
  });
62
74
 
63
- async function handleSubmit() {
64
- try {
65
- const form = formRef.value;
66
- if (!form) {
67
- MessagePlugin.warning("表单未就绪");
75
+ const $Computed = reactive({
76
+ visible: computed({
77
+ get: () => $Prop.modelValue,
78
+ set: (value) => $Emit("update:modelValue", value)
79
+ }),
80
+ dialogTitle: computed(() => ($Prop.actionType === "add" ? "添加字典项" : "编辑字典项"))
81
+ });
82
+
83
+ const $Method = {
84
+ resetFormData() {
85
+ Object.assign($Data.formData, $Const.createDefaultFormData());
86
+ },
87
+ initData() {
88
+ if ($Prop.actionType === "upd" && $Prop.rowData) {
89
+ $Data.formData.typeCode = $Prop.rowData.typeCode || "";
90
+ $Data.formData.key = $Prop.rowData.key || "";
91
+ $Data.formData.label = $Prop.rowData.label || "";
92
+ $Data.formData.sort = $Prop.rowData.sort || 0;
93
+ $Data.formData.remark = $Prop.rowData.remark || "";
68
94
  return;
69
95
  }
70
96
 
71
- const valid = await form.validate();
72
- if (valid !== true) return;
73
- const apiUrl = props.actionType === "add" ? "/core/dict/insert" : "/core/dict/update";
74
- const params = {
75
- typeCode: $Data.formData.typeCode,
76
- key: $Data.formData.key,
77
- label: $Data.formData.label,
78
- sort: $Data.formData.sort,
79
- remark: $Data.formData.remark
80
- };
81
- if (props.actionType === "upd" && props.rowData) {
82
- const row = props.rowData;
83
- params["id"] = row["id"];
84
- }
97
+ $Method.resetFormData();
98
+ },
99
+ async handleSubmit() {
100
+ try {
101
+ const form = $From.formRef;
102
+ if (!form) {
103
+ MessagePlugin.warning("表单未就绪");
104
+ return;
105
+ }
85
106
 
86
- await $Http(apiUrl, params);
87
- MessagePlugin.success(props.actionType === "add" ? "添加成功" : "更新成功");
88
- visible.value = false;
89
- $Emit("success");
90
- } catch (error) {
91
- MessagePlugin.error(error.msg || error.message || "操作失败");
107
+ const valid = await form.validate();
108
+ if (valid !== true) return;
109
+ const apiUrl = $Prop.actionType === "add" ? "/core/dict/insert" : "/core/dict/update";
110
+ const params = {
111
+ typeCode: $Data.formData.typeCode,
112
+ key: $Data.formData.key,
113
+ label: $Data.formData.label,
114
+ sort: $Data.formData.sort,
115
+ remark: $Data.formData.remark
116
+ };
117
+ if ($Prop.actionType === "upd" && $Prop.rowData) {
118
+ params["id"] = $Prop.rowData.id;
119
+ }
120
+
121
+ await $Http(apiUrl, params);
122
+ MessagePlugin.success($Prop.actionType === "add" ? "添加成功" : "更新成功");
123
+ $Computed.visible = false;
124
+ $Emit("success");
125
+ } catch (error) {
126
+ MessagePlugin.error(error.msg || error.message || "操作失败");
127
+ }
92
128
  }
93
- }
129
+ };
94
130
 
95
- // 该组件由父组件 v-if 控制挂载/卸载,因此无需 watch:创建时初始化一次即可
96
- if (props.actionType === "upd" && props.rowData) {
97
- $Data.formData.typeCode = props.rowData.typeCode || "";
98
- $Data.formData.key = props.rowData.key || "";
99
- $Data.formData.label = props.rowData.label || "";
100
- $Data.formData.sort = props.rowData.sort || 0;
101
- $Data.formData.remark = props.rowData.remark || "";
102
- } else {
103
- $Data.formData.typeCode = "";
104
- $Data.formData.key = "";
105
- $Data.formData.label = "";
106
- $Data.formData.sort = 0;
107
- $Data.formData.remark = "";
108
- }
131
+ $Method.initData();
109
132
  </script>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <PageTableDetail class="page-dict page-table" :columns="$Data.columns" :endpoints="$Data.endpoints">
3
3
  <template #toolLeft>
4
- <TButton theme="primary" @click="onAdd">
4
+ <TButton theme="primary" @click="$Method.onAdd">
5
5
  <template #icon>
6
6
  <AddIcon />
7
7
  </template>
@@ -9,23 +9,18 @@
9
9
  </template>
10
10
 
11
11
  <template #toolRight="scope">
12
- <TSelect v-model="$Data.searchTypeCode" placeholder="请选择字典类型" clearable filterable @change="handleSearch(scope.reload)">
12
+ <TSelect v-model="$Data.searchTypeCode" placeholder="请选择字典类型" clearable filterable @change="$Method.handleSearch(scope.reload)">
13
13
  <TOption v-for="item in $Data.typeList" :key="item.code" :value="item.code" :label="item.name" />
14
14
  </TSelect>
15
- <TInput v-model="$Data.searchKeyword" placeholder="搜索键/标签" clearable @enter="handleSearch(scope.reload)" @clear="handleSearch(scope.reload)">
15
+ <TInput v-model="$Data.searchKeyword" placeholder="搜索键/标签" clearable @enter="$Method.handleSearch(scope.reload)" @clear="$Method.handleSearch(scope.reload)">
16
16
  <template #suffix-icon>
17
17
  <SearchIcon />
18
18
  </template>
19
19
  </TInput>
20
- <TButton shape="circle" @click="handleRefresh(scope.reload)">
21
- <template #icon>
22
- <RefreshIcon />
23
- </template>
24
- </TButton>
25
20
  </template>
26
21
 
27
22
  <template #operation="{ row, deleteRow }">
28
- <TDropdown trigger="click" placement="bottom-right" @click="onDropdownAction($event, row, deleteRow)">
23
+ <TDropdown trigger="click" placement="bottom-right" @click="$Method.onDropdownAction($event, row, deleteRow)">
29
24
  <TButton theme="primary" size="small">
30
25
  操作
31
26
  <template #suffix><ChevronDownIcon /></template>
@@ -44,7 +39,7 @@
44
39
  </template>
45
40
 
46
41
  <template #dialogs="scope">
47
- <EditDialog v-if="$Data.editVisible" v-model="$Data.editVisible" :action-type="$Data.actionType" :row-data="$Data.rowData" :type-list="$Data.typeList" @success="onDialogSuccess(scope.reload)" />
42
+ <EditDialog v-if="$Data.editVisible" v-model="$Data.editVisible" :action-type="$Data.actionType" :row-data="$Data.rowData" :type-list="$Data.typeList" @success="$Method.onDialogSuccess(scope.reload)" />
48
43
  </template>
49
44
  </PageTableDetail>
50
45
  </template>
@@ -53,9 +48,9 @@
53
48
  import { onMounted, reactive } from "vue";
54
49
 
55
50
  import { Button as TButton, Dropdown as TDropdown, DropdownItem as TDropdownItem, DropdownMenu as TDropdownMenu, Input as TInput, Option as TOption, Select as TSelect, MessagePlugin } from "tdesign-vue-next";
56
- import { AddIcon, ChevronDownIcon, DeleteIcon, EditIcon, RefreshIcon, SearchIcon } from "tdesign-icons-vue-next";
51
+ import { AddIcon, ChevronDownIcon, DeleteIcon, EditIcon, SearchIcon } from "tdesign-icons-vue-next";
57
52
  import EditDialog from "./components/edit.vue";
58
- import { $Http } from "@/plugins/http";
53
+ import { $Http } from "@/plugins/http.js";
59
54
  import PageTableDetail from "befly-admin-ui/components/pageTableDetail.vue";
60
55
  import { withDefaultColumns } from "befly-admin-ui/utils/withDefaultColumns";
61
56
 
@@ -74,7 +69,7 @@ const $Data = reactive({
74
69
  ]),
75
70
  endpoints: {
76
71
  list: {
77
- path: "/core/dict/list",
72
+ path: "/core/dict/select",
78
73
  dropValues: [""],
79
74
  buildData: () => {
80
75
  return {
@@ -101,65 +96,55 @@ const $Data = reactive({
101
96
  rowData: {}
102
97
  });
103
98
 
104
- function onAdd() {
105
- onAction("add", {});
106
- }
107
-
108
- function onDialogSuccess(reload) {
109
- reload({ keepSelection: true });
110
- }
111
-
112
- async function initData() {
113
- await apiDictTypeAll();
114
- }
115
-
116
- async function apiDictTypeAll() {
117
- try {
118
- const res = await $Http("/core/dictType/all", {}, [""]);
119
- $Data.typeList = res.data.lists || [];
120
- } catch (error) {
121
- MessagePlugin.error(error.msg || error.message || "加载数据失败");
122
- }
123
- }
124
-
125
- function handleSearch(reload) {
126
- reload({ keepSelection: false, resetPage: true });
127
- }
128
-
129
- function handleRefresh(reload) {
130
- $Data.searchTypeCode = "";
131
- $Data.searchKeyword = "";
132
- reload({ keepSelection: false, resetPage: true });
133
- }
134
-
135
- function onAction(type, row) {
136
- if (type === "add") {
137
- $Data.actionType = "add";
138
- $Data.rowData = {};
139
- $Data.editVisible = true;
140
- return;
141
- }
142
-
143
- if (type === "upd") {
144
- $Data.actionType = "upd";
145
- $Data.rowData = Object.assign({}, row);
146
- $Data.editVisible = true;
147
- }
148
- }
99
+ const $Method = {
100
+ onAdd() {
101
+ $Method.onAction("add", {});
102
+ },
103
+ onDialogSuccess(reload) {
104
+ reload({ keepSelection: true });
105
+ },
106
+ async initData() {
107
+ await $Method.apiDictTypeAll();
108
+ },
109
+ async apiDictTypeAll() {
110
+ try {
111
+ const res = await $Http("/core/dictType/all", {}, [""]);
112
+ $Data.typeList = res.data.lists || [];
113
+ } catch (error) {
114
+ MessagePlugin.error(error.msg || error.message || "加载数据失败");
115
+ }
116
+ },
117
+ handleSearch(reload) {
118
+ reload({ keepSelection: false, resetPage: true });
119
+ },
120
+ onAction(type, row) {
121
+ if (type === "add") {
122
+ $Data.actionType = "add";
123
+ $Data.rowData = {};
124
+ $Data.editVisible = true;
125
+ return;
126
+ }
149
127
 
150
- function onDropdownAction(data, row, deleteRow) {
151
- const record = data;
152
- const rawValue = record && record["value"] ? record["value"] : "";
153
- const cmd = rawValue ? String(rawValue) : "";
154
- if (cmd === "del") {
155
- deleteRow(row);
156
- return;
128
+ if (type === "upd") {
129
+ $Data.actionType = "upd";
130
+ $Data.rowData = Object.assign({}, row);
131
+ $Data.editVisible = true;
132
+ }
133
+ },
134
+ onDropdownAction(data, row, deleteRow) {
135
+ const record = data;
136
+ const rawValue = record && record["value"] ? record["value"] : "";
137
+ const cmd = rawValue ? String(rawValue) : "";
138
+ if (cmd === "del") {
139
+ deleteRow(row);
140
+ return;
141
+ }
142
+ $Method.onAction(cmd, row);
157
143
  }
158
- onAction(cmd, row);
159
- }
144
+ };
160
145
 
161
146
  onMounted(() => {
162
- initData();
147
+ $Method.initData();
163
148
  });
164
149
  </script>
165
150
 
@@ -1,6 +1,15 @@
1
1
  <template>
2
- <PageDialog v-model="visible" :title="actionType === 'add' ? '添加字典类型' : '编辑字典类型'" @confirm="handleSubmit">
3
- <TForm :data="$Data.formData" :rules="$Data.rules" label-width="100px" ref="formRef">
2
+ <PageDialog v-model="$Computed.visible" :title="$Computed.dialogTitle" @confirm="$Method.handleSubmit">
3
+ <TForm
4
+ :data="$Data.formData"
5
+ :rules="$Const.formRules"
6
+ label-width="100px"
7
+ :ref="
8
+ (value) => {
9
+ $From.formRef = value;
10
+ }
11
+ "
12
+ >
4
13
  <TFormItem label="类型代码" name="code">
5
14
  <TInput v-model="$Data.formData.code" placeholder="请输入类型代码(英文/数字/下划线)" :disabled="actionType === 'upd'" />
6
15
  </TFormItem>
@@ -18,13 +27,13 @@
18
27
  </template>
19
28
 
20
29
  <script setup>
21
- import { computed, reactive, ref } from "vue";
30
+ import { computed, reactive } from "vue";
22
31
 
23
32
  import { Form as TForm, FormItem as TFormItem, Input as TInput, Textarea as TTextarea, InputNumber as TInputNumber, MessagePlugin } from "tdesign-vue-next";
24
33
  import PageDialog from "befly-admin-ui/components/pageDialog.vue";
25
- import { $Http } from "@/plugins/http";
34
+ import { $Http } from "@/plugins/http.js";
26
35
 
27
- const props = defineProps({
36
+ const $Prop = defineProps({
28
37
  modelValue: Boolean,
29
38
  actionType: String,
30
39
  rowData: Object
@@ -32,68 +41,83 @@ const props = defineProps({
32
41
 
33
42
  const $Emit = defineEmits(["update:modelValue", "success"]);
34
43
 
35
- const visible = computed({
36
- get: () => props.modelValue,
37
- set: (val) => $Emit("update:modelValue", val)
38
- });
39
-
40
- const formRef = ref(null);
41
-
42
- const $Data = reactive({
43
- formData: {
44
- code: "",
45
- name: "",
46
- description: "",
47
- sort: 0
44
+ const $Const = {
45
+ createDefaultFormData() {
46
+ return {
47
+ code: "",
48
+ name: "",
49
+ description: "",
50
+ sort: 0
51
+ };
48
52
  },
49
- rules: {
53
+ formRules: {
50
54
  code: [{ required: true, message: "请输入类型代码" }],
51
55
  name: [{ required: true, message: "请输入类型名称" }]
52
56
  }
57
+ };
58
+
59
+ const $From = {
60
+ formRef: null
61
+ };
62
+
63
+ const $Data = reactive({
64
+ formData: $Const.createDefaultFormData()
53
65
  });
54
66
 
55
- async function handleSubmit() {
56
- const form = formRef.value;
57
- if (!form) {
58
- MessagePlugin.warning("表单未就绪");
59
- return;
60
- }
67
+ const $Computed = reactive({
68
+ visible: computed({
69
+ get: () => $Prop.modelValue,
70
+ set: (value) => $Emit("update:modelValue", value)
71
+ }),
72
+ dialogTitle: computed(() => ($Prop.actionType === "add" ? "添加字典类型" : "编辑字典类型"))
73
+ });
61
74
 
62
- const valid = await form.validate();
63
- if (valid !== true) return;
75
+ const $Method = {
76
+ resetFormData() {
77
+ Object.assign($Data.formData, $Const.createDefaultFormData());
78
+ },
79
+ initData() {
80
+ if ($Prop.actionType === "upd" && $Prop.rowData) {
81
+ $Data.formData.code = $Prop.rowData.code || "";
82
+ $Data.formData.name = $Prop.rowData.name || "";
83
+ $Data.formData.description = $Prop.rowData.description || "";
84
+ $Data.formData.sort = $Prop.rowData.sort || 0;
85
+ return;
86
+ }
64
87
 
65
- try {
66
- const apiUrl = props.actionType === "add" ? "/core/dictType/insert" : "/core/dictType/update";
67
- const params = {
68
- code: $Data.formData.code,
69
- name: $Data.formData.name,
70
- description: $Data.formData.description,
71
- sort: $Data.formData.sort
72
- };
73
- if (props.actionType === "upd" && props.rowData) {
74
- const row = props.rowData;
75
- params["id"] = row["id"];
88
+ $Method.resetFormData();
89
+ },
90
+ async handleSubmit() {
91
+ const form = $From.formRef;
92
+ if (!form) {
93
+ MessagePlugin.warning("表单未就绪");
94
+ return;
76
95
  }
77
96
 
78
- await $Http(apiUrl, params);
79
- MessagePlugin.success(props.actionType === "add" ? "添加成功" : "更新成功");
80
- visible.value = false;
81
- $Emit("success");
82
- } catch (error) {
83
- MessagePlugin.error(error.msg || error.message || "操作失败");
97
+ const valid = await form.validate();
98
+ if (valid !== true) return;
99
+
100
+ try {
101
+ const apiUrl = $Prop.actionType === "add" ? "/core/dictType/insert" : "/core/dictType/update";
102
+ const params = {
103
+ code: $Data.formData.code,
104
+ name: $Data.formData.name,
105
+ description: $Data.formData.description,
106
+ sort: $Data.formData.sort
107
+ };
108
+ if ($Prop.actionType === "upd" && $Prop.rowData) {
109
+ params["id"] = $Prop.rowData.id;
110
+ }
111
+
112
+ await $Http(apiUrl, params);
113
+ MessagePlugin.success($Prop.actionType === "add" ? "添加成功" : "更新成功");
114
+ $Computed.visible = false;
115
+ $Emit("success");
116
+ } catch (error) {
117
+ MessagePlugin.error(error.msg || error.message || "操作失败");
118
+ }
84
119
  }
85
- }
120
+ };
86
121
 
87
- // 该组件由父组件 v-if 控制挂载/卸载,因此无需 watch:创建时初始化一次即可
88
- if (props.actionType === "upd" && props.rowData) {
89
- $Data.formData.code = props.rowData.code || "";
90
- $Data.formData.name = props.rowData.name || "";
91
- $Data.formData.description = props.rowData.description || "";
92
- $Data.formData.sort = props.rowData.sort || 0;
93
- } else {
94
- $Data.formData.code = "";
95
- $Data.formData.name = "";
96
- $Data.formData.description = "";
97
- $Data.formData.sort = 0;
98
- }
122
+ $Method.initData();
99
123
  </script>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <PageTableDetail class="page-dict-type page-table" :columns="$Data.columns" :endpoints="$Data.endpoints">
3
3
  <template #toolLeft>
4
- <TButton theme="primary" @click="onAdd">
4
+ <TButton theme="primary" @click="$Method.onAdd">
5
5
  <template #icon>
6
6
  <AddIcon />
7
7
  </template>
@@ -9,20 +9,15 @@
9
9
  </template>
10
10
 
11
11
  <template #toolRight="scope">
12
- <TInput v-model="$Data.searchKeyword" placeholder="搜索类型名称" clearable @enter="handleSearch(scope.reload)" @clear="handleSearch(scope.reload)">
12
+ <TInput v-model="$Data.searchKeyword" placeholder="搜索类型名称" clearable @enter="$Method.handleSearch(scope.reload)" @clear="$Method.handleSearch(scope.reload)">
13
13
  <template #suffix-icon>
14
14
  <SearchIcon />
15
15
  </template>
16
16
  </TInput>
17
- <TButton shape="circle" @click="handleRefresh(scope.reload)">
18
- <template #icon>
19
- <RefreshIcon />
20
- </template>
21
- </TButton>
22
17
  </template>
23
18
 
24
19
  <template #operation="{ row, deleteRow }">
25
- <TDropdown trigger="click" placement="bottom-right" @click="onDropdownAction($event, row, deleteRow)">
20
+ <TDropdown trigger="click" placement="bottom-right" @click="$Method.onDropdownAction($event, row, deleteRow)">
26
21
  <TButton theme="primary" size="small">
27
22
  操作
28
23
  <template #suffix><ChevronDownIcon /></template>
@@ -41,7 +36,7 @@
41
36
  </template>
42
37
 
43
38
  <template #dialogs="scope">
44
- <EditDialog v-if="$Data.editVisible" v-model="$Data.editVisible" :action-type="$Data.actionType" :row-data="$Data.rowData" @success="onDialogSuccess(scope.reload)" />
39
+ <EditDialog v-if="$Data.editVisible" v-model="$Data.editVisible" :action-type="$Data.actionType" :row-data="$Data.rowData" @success="$Method.onDialogSuccess(scope.reload)" />
45
40
  </template>
46
41
  </PageTableDetail>
47
42
  </template>
@@ -49,7 +44,7 @@
49
44
  <script setup>
50
45
  import { reactive } from "vue";
51
46
  import { Button as TButton, Dropdown as TDropdown, DropdownItem as TDropdownItem, DropdownMenu as TDropdownMenu, Input as TInput } from "tdesign-vue-next";
52
- import { AddIcon, ChevronDownIcon, DeleteIcon, EditIcon, RefreshIcon, SearchIcon } from "tdesign-icons-vue-next";
47
+ import { AddIcon, ChevronDownIcon, DeleteIcon, EditIcon, SearchIcon } from "tdesign-icons-vue-next";
53
48
  import EditDialog from "./components/edit.vue";
54
49
  import PageTableDetail from "befly-admin-ui/components/pageTableDetail.vue";
55
50
  import { withDefaultColumns } from "befly-admin-ui/utils/withDefaultColumns";
@@ -65,7 +60,7 @@ const $Data = reactive({
65
60
  ]),
66
61
  endpoints: {
67
62
  list: {
68
- path: "/core/dictType/list",
63
+ path: "/core/dictType/select",
69
64
  dropValues: [0, ""],
70
65
  dropKeyValue: {
71
66
  keyword: [""]
@@ -94,48 +89,41 @@ const $Data = reactive({
94
89
  rowData: {}
95
90
  });
96
91
 
97
- function onAdd() {
98
- onAction("add", {});
99
- }
100
-
101
- function onDialogSuccess(reload) {
102
- reload({ keepSelection: true });
103
- }
104
-
105
- function handleSearch(reload) {
106
- reload({ keepSelection: false, resetPage: true });
107
- }
108
-
109
- function handleRefresh(reload) {
110
- $Data.searchKeyword = "";
111
- reload({ keepSelection: false, resetPage: true });
112
- }
113
-
114
- function onAction(type, row) {
115
- if (type === "add") {
116
- $Data.actionType = "add";
117
- $Data.rowData = {};
118
- $Data.editVisible = true;
119
- return;
120
- }
121
-
122
- if (type === "upd") {
123
- $Data.actionType = "upd";
124
- $Data.rowData = Object.assign({}, row);
125
- $Data.editVisible = true;
126
- }
127
- }
92
+ const $Method = {
93
+ onAdd() {
94
+ $Method.onAction("add", {});
95
+ },
96
+ onDialogSuccess(reload) {
97
+ reload({ keepSelection: true });
98
+ },
99
+ handleSearch(reload) {
100
+ reload({ keepSelection: false, resetPage: true });
101
+ },
102
+ onAction(type, row) {
103
+ if (type === "add") {
104
+ $Data.actionType = "add";
105
+ $Data.rowData = {};
106
+ $Data.editVisible = true;
107
+ return;
108
+ }
128
109
 
129
- function onDropdownAction(data, row, deleteRow) {
130
- const record = data;
131
- const rawValue = record && record["value"] ? record["value"] : "";
132
- const cmd = rawValue ? String(rawValue) : "";
133
- if (cmd === "del") {
134
- deleteRow(row);
135
- return;
110
+ if (type === "upd") {
111
+ $Data.actionType = "upd";
112
+ $Data.rowData = Object.assign({}, row);
113
+ $Data.editVisible = true;
114
+ }
115
+ },
116
+ onDropdownAction(data, row, deleteRow) {
117
+ const record = data;
118
+ const rawValue = record && record["value"] ? record["value"] : "";
119
+ const cmd = rawValue ? String(rawValue) : "";
120
+ if (cmd === "del") {
121
+ deleteRow(row);
122
+ return;
123
+ }
124
+ $Method.onAction(cmd, row);
136
125
  }
137
- onAction(cmd, row);
138
- }
126
+ };
139
127
  </script>
140
128
 
141
129
  <style scoped lang="scss">