|
@@ -3,7 +3,6 @@ import { useColumns } from "./columns";
|
|
|
import { httpList, httpStatus } from "/@/api/interest/account";
|
|
|
import { reactive, ref, onMounted } from "vue";
|
|
|
import { type FormInstance } from "element-plus";
|
|
|
-import { ElMessage } from "element-plus";
|
|
|
import { TableProBar } from "/@/components/ReTable";
|
|
|
import { type PaginationProps } from "@pureadmin/table";
|
|
|
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
|
|
@@ -12,6 +11,7 @@ import { statusList } from "/@/utils/status";
|
|
|
import menuType from "./types";
|
|
|
import addEdit from "./addEdit.vue";
|
|
|
import resetPassword from "./resetPassword.vue";
|
|
|
+import { responseHandle } from "/@/utils/responseHandle";
|
|
|
const { logout } = useNav();
|
|
|
defineOptions({
|
|
|
name: "Account"
|
|
@@ -62,13 +62,12 @@ const handleStatus = async row => {
|
|
|
id,
|
|
|
status: status + "" === "1" ? "0" : "1"
|
|
|
});
|
|
|
- if (code === 0) {
|
|
|
- onSearch();
|
|
|
- } else if (code > 100 && code < 140) {
|
|
|
- logout();
|
|
|
- } else {
|
|
|
- ElMessage.error(message);
|
|
|
- }
|
|
|
+ responseHandle({
|
|
|
+ code,
|
|
|
+ message,
|
|
|
+ logout,
|
|
|
+ handler: () => onSearch()
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
async function handleCurrentChange(val: number) {
|
|
@@ -89,17 +88,18 @@ function handleSelectionChange(val) {
|
|
|
async function onSearch() {
|
|
|
loading.value = true;
|
|
|
const { code, data, message } = await httpList(form);
|
|
|
- if (code === 0) {
|
|
|
- const { list, count } = data;
|
|
|
- dataList.value = list ?? [];
|
|
|
- pagination.total = count ?? 0;
|
|
|
- pagination.pageSize = form.size;
|
|
|
- pagination.currentPage = form.page;
|
|
|
- } else if (code > 100 && code < 140) {
|
|
|
- logout();
|
|
|
- } else {
|
|
|
- ElMessage.error(message);
|
|
|
- }
|
|
|
+ responseHandle({
|
|
|
+ code,
|
|
|
+ message,
|
|
|
+ logout,
|
|
|
+ handler: () => {
|
|
|
+ const { list, count } = data;
|
|
|
+ dataList.value = list ?? [];
|
|
|
+ pagination.total = count ?? 0;
|
|
|
+ pagination.pageSize = form.size;
|
|
|
+ pagination.currentPage = form.page;
|
|
|
+ }
|
|
|
+ });
|
|
|
loading.value = false;
|
|
|
}
|
|
|
async function resetSearch() {
|
|
@@ -115,18 +115,14 @@ function editItem(id, type, item) {
|
|
|
}
|
|
|
showModel.value = true;
|
|
|
}
|
|
|
-const submitRefresh = e => {
|
|
|
+const submitRefresh = () => {
|
|
|
showModel.value = false;
|
|
|
- console.log("弹窗关闭!");
|
|
|
- console.log(e);
|
|
|
onSearch();
|
|
|
};
|
|
|
const submitCancel = () => {
|
|
|
- console.log("弹窗关闭!");
|
|
|
showModel.value = false;
|
|
|
};
|
|
|
const resetCancel = () => {
|
|
|
- console.log("修改密码弹窗关闭!");
|
|
|
passwordModel.value = false;
|
|
|
};
|
|
|
|