update 修改代码缩进格式

This commit is contained in:
LiuHao
2023-06-06 22:27:31 +08:00
parent 6af68085ff
commit dbfe263681
22 changed files with 1507 additions and 1498 deletions

View File

@ -50,9 +50,9 @@ import { UserQuery } from '@/api/system/user/types';
const props = defineProps({
roleId: {
type: [Number, String]
}
roleId: {
type: [Number, String]
}
})
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@ -64,68 +64,68 @@ const total = ref(0);
const userIds = ref<Array<string | number>>([]);
const queryParams = reactive<UserQuery>({
pageNum: 1,
pageSize: 10,
roleId: undefined,
userName: undefined,
phonenumber: undefined
pageNum: 1,
pageSize: 10,
roleId: undefined,
userName: undefined,
phonenumber: undefined
})
const tableRef = ref<ElTableInstance>();
const queryFormRef = ref<ElFormInstance>();
const show = () => {
queryParams.roleId = props.roleId;
getList();
visible.value = true;
queryParams.roleId = props.roleId;
getList();
visible.value = true;
}
/**
* 选择行
*/
const clickRow = (row: any) => {
// ele的bug
tableRef.value?.toggleRowSelection(row);
// ele的bug
tableRef.value?.toggleRowSelection(row);
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: UserVO[]) => {
userIds.value = selection.map((item: UserVO) => item.userId);
userIds.value = selection.map((item: UserVO) => item.userId);
}
/** 查询数据 */
const getList = async () => {
const res = await unallocatedUserList(queryParams);
userList.value = res.rows;
total.value = res.total;
const res = await unallocatedUserList(queryParams);
userList.value = res.rows;
total.value = res.total;
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNum = 1;
getList();
queryParams.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
getList();
queryFormRef.value?.resetFields();
getList();
}
const emit = defineEmits(["ok"]);
/**选择授权用户操作 */
const handleSelectUser = async () => {
const roleId = queryParams.roleId;
const ids = userIds.value.join(',');
if (ids == "") {
proxy?.$modal.msgError('请选择要分配的用户');
return;
}
await authUserSelectAll({ roleId, userIds: ids });
proxy?.$modal.msgSuccess('分配成功');
emit('ok');
visible.value = false;
const roleId = queryParams.roleId;
const ids = userIds.value.join(',');
if (ids == "") {
proxy?.$modal.msgError('请选择要分配的用户');
return;
}
await authUserSelectAll({ roleId, userIds: ids });
proxy?.$modal.msgSuccess('分配成功');
emit('ok');
visible.value = false;
}
// 暴露
defineExpose({
show,
show,
});
</script>