From c28020b703bc595a26e42c650250f2d97e3f8bf0 Mon Sep 17 00:00:00 2001
From: wanggang <76527413@qq.com>
Date: Fri, 18 Aug 2023 15:58:10 +0800
Subject: [PATCH] update
---
.../wwwroot/components/list/index.js | 34 +++++++++++++++
.../wwwroot/router/base-data.js | 2 +-
.../wwwroot/views/base-data/role.js | 19 +-------
.../wwwroot/views/base-data/user.js | 43 +++++--------------
.../wwwroot/views/settle/_check.js | 41 ++++++++++--------
5 files changed, 71 insertions(+), 68 deletions(-)
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
index 56fa4244..b6c7a003 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
@@ -812,6 +812,39 @@ export default {
}
return postData;
}
+ const action = async (method, confirMmessage = "确认操作吗?", successMessage = "操作成功", reload = true) => {
+ try {
+ await ElMessageBox.confirm(confirMmessage, "提示", {
+ type: "warning",
+ });
+ tableLoading.value = true;
+ let result = null;
+ if (method.constructor.name == "AsyncFunction") {
+ result = await method();
+ } else {
+ result = method();
+ }
+ if (!result.errors) {
+ await ElMessage({
+ type: "info",
+ message: successMessage,
+ });
+ if (reload) {
+ pageModel.pageIndex = 1;
+ await load();
+ }
+ }
+ } catch (error) {
+ if (error === "cancel") {
+ ElMessage({
+ type: "info",
+ message: "操作取消",
+ });
+ }
+ } finally {
+ tableLoading.value = false;
+ }
+ };
onMounted(async () => {
if (route.meta.children?.length) {
for (const item of route.meta.children) {
@@ -833,6 +866,7 @@ export default {
});
return {
load,
+ action,
config,
queryModel,
buildQuery,
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/base-data.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/base-data.js
index 9113a338..bf68968d 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/base-data.js
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/base-data.js
@@ -11,7 +11,7 @@ export default [
createButton("create", "title=新建&isTop=true"),
createButton("update", "title=编辑"),
createButton("delete", "title=删除&disabled=o=>o.userName==='admin'"),
- createButton("%s/reset-password", "title=重置密码&method=PUT"),
+ createButton("reset-password", "title=重置密码&method=PUT"),
],
},
{
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/role.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/role.js
index dc0ca43c..38225c35 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/role.js
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/role.js
@@ -1,17 +1,2 @@
-import AppList from "../../components/list/index.js";
-import html from "html";
-import useConfig from "../../models/base-data/role.js";
-
-export default {
- components: { AppList },
- template: html`