From fe631515b71782a10a750874f6d4582fe027cd22 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 03 十一月 2025 09:32:49 +0800
Subject: [PATCH] 公司-所有的表格添加斑马纹
---
src/views/system/role/authUser.vue | 79 ++++++++++++++++++++-------------------
1 files changed, 41 insertions(+), 38 deletions(-)
diff --git a/src/views/system/role/authUser.vue b/src/views/system/role/authUser.vue
index 49bbd04..86243db 100644
--- a/src/views/system/role/authUser.vue
+++ b/src/views/system/role/authUser.vue
@@ -57,7 +57,7 @@
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
- <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
+ <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange" stripe>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="鐢ㄦ埛鍚嶇О" prop="userName" :show-overflow-tooltip="true" />
<el-table-column label="鐢ㄦ埛鏄电О" prop="nickName" :show-overflow-tooltip="true" />
@@ -92,19 +92,20 @@
</template>
<script setup name="AuthUser">
-import selectUser from "./selectUser";
-import { allocatedUserList, authUserCancel, authUserCancelAll } from "@/api/system/role";
+import selectUser from "./selectUser"
+import { allocatedUserList, authUserCancel, authUserCancelAll } from "@/api/system/role"
+import {onMounted} from "vue";
-const route = useRoute();
-const { proxy } = getCurrentInstance();
-const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
+const route = useRoute()
+const { proxy } = getCurrentInstance()
+const { sys_normal_disable } = proxy.useDict("sys_normal_disable")
-const userList = ref([]);
-const loading = ref(true);
-const showSearch = ref(true);
-const multiple = ref(true);
-const total = ref(0);
-const userIds = ref([]);
+const userList = ref([])
+const loading = ref(true)
+const showSearch = ref(true)
+const multiple = ref(true)
+const total = ref(0)
+const userIds = ref([])
const queryParams = reactive({
pageNum: 1,
@@ -112,68 +113,70 @@
roleId: route.params.roleId,
userName: undefined,
phonenumber: undefined,
-});
+})
/** 鏌ヨ鎺堟潈鐢ㄦ埛鍒楄〃 */
function getList() {
- loading.value = true;
+ loading.value = true
allocatedUserList(queryParams).then(response => {
- userList.value = response.rows;
- total.value = response.total;
- loading.value = false;
- });
+ userList.value = response.rows
+ total.value = response.total
+ loading.value = false
+ })
}
/** 杩斿洖鎸夐挳 */
function handleClose() {
- const obj = { path: "/system/role" };
- proxy.$tab.closeOpenPage(obj);
+ const obj = { path: "/system/role" }
+ proxy.$tab.closeOpenPage(obj)
}
/** 鎼滅储鎸夐挳鎿嶄綔 */
function handleQuery() {
- queryParams.pageNum = 1;
- getList();
+ queryParams.pageNum = 1
+ getList()
}
/** 閲嶇疆鎸夐挳鎿嶄綔 */
function resetQuery() {
- proxy.resetForm("queryRef");
- handleQuery();
+ proxy.resetForm("queryRef")
+ handleQuery()
}
/** 澶氶�夋閫変腑鏁版嵁 */
function handleSelectionChange(selection) {
- userIds.value = selection.map(item => item.userId);
- multiple.value = !selection.length;
+ userIds.value = selection.map(item => item.userId)
+ multiple.value = !selection.length
}
/** 鎵撳紑鎺堟潈鐢ㄦ埛琛ㄥ脊绐� */
function openSelectUser() {
- proxy.$refs["selectRef"].show();
+ proxy.$refs["selectRef"].show()
}
/** 鍙栨秷鎺堟潈鎸夐挳鎿嶄綔 */
function cancelAuthUser(row) {
proxy.$modal.confirm('纭瑕佸彇娑堣鐢ㄦ埛"' + row.userName + '"瑙掕壊鍚楋紵').then(function () {
- return authUserCancel({ userId: row.userId, roleId: queryParams.roleId });
+ return authUserCancel({ userId: row.userId, roleId: queryParams.roleId })
}).then(() => {
- getList();
- proxy.$modal.msgSuccess("鍙栨秷鎺堟潈鎴愬姛");
- }).catch(() => {});
+ getList()
+ proxy.$modal.msgSuccess("鍙栨秷鎺堟潈鎴愬姛")
+ }).catch(() => {})
}
/** 鎵归噺鍙栨秷鎺堟潈鎸夐挳鎿嶄綔 */
function cancelAuthUserAll(row) {
- const roleId = queryParams.roleId;
- const uIds = userIds.value.join(",");
+ const roleId = queryParams.roleId
+ const uIds = userIds.value.join(",")
proxy.$modal.confirm("鏄惁鍙栨秷閫変腑鐢ㄦ埛鎺堟潈鏁版嵁椤�?").then(function () {
- return authUserCancelAll({ roleId: roleId, userIds: uIds });
+ return authUserCancelAll({ roleId: roleId, userIds: uIds })
}).then(() => {
- getList();
- proxy.$modal.msgSuccess("鍙栨秷鎺堟潈鎴愬姛");
- }).catch(() => {});
+ getList()
+ proxy.$modal.msgSuccess("鍙栨秷鎺堟潈鎴愬姛")
+ }).catch(() => {})
}
-getList();
+onMounted(() => {
+ getList();
+});
</script>
--
Gitblit v1.9.3