优化代码

This commit is contained in:
RuoYi
2024-06-28 17:01:39 +08:00
parent 49d0fc0bdc
commit 6666ce5526
26 changed files with 253 additions and 8 deletions

View File

@@ -7,7 +7,7 @@
v-model="queryParams.userName"
placeholder="请输入用户名称"
clearable
style="width: 200px"
style="width: 180px"
@keyup.enter="handleQuery"
/>
</el-form-item>
@@ -16,7 +16,7 @@
v-model="queryParams.phonenumber"
placeholder="请输入手机号码"
clearable
style="width: 200px"
style="width: 180px"
@keyup.enter="handleQuery"
/>
</el-form-item>
@@ -91,14 +91,17 @@ function show() {
getList();
visible.value = true;
}
/**选择行 */
function clickRow(row) {
proxy.$refs["refTable"].toggleRowSelection(row);
}
// 多选框选中数据
function handleSelectionChange(selection) {
userIds.value = selection.map(item => item.userId);
}
// 查询表数据
function getList() {
unallocatedUserList(queryParams).then(res => {
@@ -106,16 +109,19 @@ function getList() {
total.value = res.total;
});
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.pageNum = 1;
getList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
const emit = defineEmits(["ok"]);
/** 选择授权用户操作 */
function handleSelectUser() {
@@ -127,10 +133,8 @@ function handleSelectUser() {
}
authUserSelectAll({ roleId: roleId, userIds: uIds }).then(res => {
proxy.$modal.msgSuccess(res.msg);
if (res.code === 200) {
visible.value = false;
emit("ok");
}
visible.value = false;
emit("ok");
});
}