From 2af68406788a95115dd8312c9cd20e70104cd573 Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期日, 03 十一月 2024 18:09:22 +0800
Subject: [PATCH] 添加、删除计数bug

---
 src/views/project/yw/systemManage/userMgr/UserMgr.vue |   52 ++++++++++++----------------------------------------
 1 files changed, 12 insertions(+), 40 deletions(-)

diff --git a/src/views/project/yw/systemManage/userMgr/UserMgr.vue b/src/views/project/yw/systemManage/userMgr/UserMgr.vue
index 650edc9..5da04cb 100644
--- a/src/views/project/yw/systemManage/userMgr/UserMgr.vue
+++ b/src/views/project/yw/systemManage/userMgr/UserMgr.vue
@@ -7,8 +7,7 @@
 				</el-form-item>
 
 				<el-form-item>
-					<el-button icon="ele-Refresh" @click="resetQuery">閲嶇疆 </el-button>
-					<el-button icon="ele-Plus" @click="openOptDlg()"> 娣诲姞 </el-button>
+					<el-button icon="ele-Plus" @click="openOptDlg()" type="primary"> 娣诲姞 </el-button>
 				</el-form-item>
 			</el-form>
 		</template>
@@ -23,8 +22,8 @@
 					:data="displayTableData"
 					highlight-current-row
 				>
-					<el-table-column prop="user_name" label="鐢ㄦ埛鍚�" width="120" fixed="left" show-overflow-tooltip> </el-table-column>
-					<el-table-column label="涓枃鍚�" prop="real_name" width="90" show-overflow-tooltip> </el-table-column>
+					<el-table-column prop="user_name" label="鐢ㄦ埛ID" width="120" fixed="left" show-overflow-tooltip> </el-table-column>
+					<el-table-column label="濮撳悕" prop="real_name" width="90" show-overflow-tooltip> </el-table-column>
 					<el-table-column label="鎬у埆" prop="sex" width="70" show-overflow-tooltip> </el-table-column>
 					<el-table-column label="瑙掕壊" prop="user_roles" width="250" show-overflow-tooltip>
 						<template #default="{ row }">
@@ -37,7 +36,7 @@
 
 					<el-table-column label="鎵嬫満鍙�" prop="phone" width="120" show-overflow-tooltip> </el-table-column>
 					<el-table-column label="閭欢" prop="email" width="190" show-overflow-tooltip> </el-table-column>
-
+					<el-table-column label="鍒涘缓鏃堕棿" prop="create_time" width="105" show-overflow-tooltip> </el-table-column>
 					<el-table-column prop="note" label="璇存槑" show-overflow-tooltip />
 
 					<el-table-column label="鎿嶄綔" width="180" fixed="right" show-overflow-tooltip>
@@ -53,7 +52,10 @@
 									></i>
 								</el-tooltip>
 								<el-tooltip effect="dark" content="淇敼瑙掕壊" placement="top">
-									<i class="ywifont ywicon-jiaose !text-[15px] text-blue-400 cursor-pointer font-bold" @click="openOptRoleDlg(scope.row)"></i>
+									<i
+										class="ywifont ywicon-jiaose !text-[15px] text-blue-400 cursor-pointer font-bold"
+										@click="openOptRoleDlg(scope.row)"
+									></i>
 								</el-tooltip>
 								<el-tooltip effect="dark" content="鍒犻櫎" placement="top">
 									<i class="ywifont ywicon-shanchu !text-[17px] text-red-400 cursor-pointer" @click="deleteCurrentRow(scope.row)"></i>
@@ -115,6 +117,7 @@
 		email: item.email,
 		note: item.note,
 		user_roles: item.roles,
+		create_time: item.create_time?.slice(0, 10),
 	}));
 };
 //#endregion
@@ -167,7 +170,7 @@
 };
 
 const insertOpt = (newData) => {
-	tableData.value.unshift({ ...newData });
+	tableData.value.push({ ...newData });
 };
 //#endregion
 
@@ -180,6 +183,8 @@
 		const res = await userApi.deleteUserInfoByPost({
 			user_id: row.user_id,
 		});
+		const foundIndex = tableData.value.findIndex((item) => item === row);
+		foundIndex > -1 && tableData.value.splice(foundIndex, 1);
 		ElMessage.success('鍒犻櫎鐢ㄦ埛鎴愬姛');
 	});
 };
@@ -221,39 +226,6 @@
 	}
 };
 
-//#endregion
-
-//#region ====================== 鏀瑰彉鍙戝竷鐘舵�� ======================
-// const publishStatusChange = async (published: SupervisorPublished, id, index) => {
-// 	const res = await updatePublishStatus(
-// 		{
-// 			id: id,
-// 			publish: published,
-// 		},
-// 		{
-// 			loading: false,
-// 		}
-// 	);
-// 	const origin = published === SupervisorPublished.Y ? SupervisorPublished.N : SupervisorPublished.Y;
-// 	const final = res.publish ?? origin;
-// 	if (final === origin) {
-// 		ElMessage.warning('鎿嶄綔澶辫触' + (res.fail_msg ? `锛�${res.fail_msg}` : ''));
-// 		return;
-// 	}
-
-// 	tableData.value[index].published = final;
-
-// 	published === SupervisorPublished.Y ? ElMessage.success('鍙戝竷鎴愬姛') : ElMessage.info('宸插彇娑堝彂甯�');
-// };
-//#endregion
-
-//#region ====================== 鏇存柊鍙戝竷鐘舵�� ======================
-// useUpdateData({
-// 	event: 'supervisor.publish',
-// 	updateFun({ id, published }) {
-// 		updatePublishedById(id, published);
-// 	},
-// });
 //#endregion
 
 const roleList = ref([]);

--
Gitblit v1.9.3