| | |
| | | v-model="queryParams.userName"
|
| | | placeholder="请输入用户名称"
|
| | | clearable
|
| | | size="small"
|
| | | style="width: 180px"
|
| | | @keyup.enter="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | |
| | | v-model="queryParams.phonenumber"
|
| | | placeholder="请输入手机号码"
|
| | | clearable
|
| | | size="small"
|
| | | style="width: 180px"
|
| | | @keyup.enter="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" icon="Search" size="mini" @click="handleQuery">搜索</el-button>
|
| | | <el-button icon="Refresh" size="mini" @click="resetQuery">重置</el-button>
|
| | | <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
| | | <el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | | <el-row>
|
| | |
| | | </template>
|
| | |
|
| | | <script setup name="SelectUser">
|
| | | import { authUserSelectAll, unallocatedUserList } from "@/api/system/role";
|
| | | import { authUserSelectAll, unallocatedUserList } from "@/api/system/role"
|
| | |
|
| | | const props = defineProps({
|
| | | roleId: {
|
| | | type: [Number, String]
|
| | | }
|
| | | });
|
| | | })
|
| | |
|
| | | const { proxy } = getCurrentInstance();
|
| | | const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
| | | const { proxy } = getCurrentInstance()
|
| | | const { sys_normal_disable } = proxy.useDict("sys_normal_disable")
|
| | |
|
| | | const userList = ref([]);
|
| | | const visible = ref(false);
|
| | | const total = ref(0);
|
| | | const userIds = ref([]);
|
| | | const userList = ref([])
|
| | | const visible = ref(false)
|
| | | const total = ref(0)
|
| | | const userIds = ref([])
|
| | |
|
| | | const queryParams = reactive({
|
| | | pageNum: 1,
|
| | |
| | | roleId: undefined,
|
| | | userName: undefined,
|
| | | phonenumber: undefined
|
| | | });
|
| | | })
|
| | |
|
| | | // 显示弹框
|
| | | function show() {
|
| | | queryParams.roleId = props.roleId;
|
| | | getList();
|
| | | visible.value = true;
|
| | | queryParams.roleId = props.roleId
|
| | | getList()
|
| | | visible.value = true
|
| | | }
|
| | |
|
| | | /**选择行 */
|
| | | function clickRow(row) {
|
| | | proxy.$refs["refTable"].toggleRowSelection(row);
|
| | | proxy.$refs["refTable"].toggleRowSelection(row)
|
| | | }
|
| | |
|
| | | // 多选框选中数据
|
| | | function handleSelectionChange(selection) {
|
| | | userIds.value = selection.map(item => item.userId);
|
| | | userIds.value = selection.map(item => item.userId)
|
| | | }
|
| | |
|
| | | // 查询表数据
|
| | | function getList() {
|
| | | unallocatedUserList(queryParams).then(res => {
|
| | | userList.value = res.rows;
|
| | | total.value = res.total;
|
| | | });
|
| | | userList.value = res.rows
|
| | | total.value = res.total
|
| | | })
|
| | | }
|
| | |
|
| | | /** 搜索按钮操作 */
|
| | | function handleQuery() {
|
| | | queryParams.pageNum = 1;
|
| | | getList();
|
| | | queryParams.pageNum = 1
|
| | | getList()
|
| | | }
|
| | |
|
| | | /** 重置按钮操作 */
|
| | | function resetQuery() {
|
| | | proxy.resetForm("queryRef");
|
| | | handleQuery();
|
| | | proxy.resetForm("queryRef")
|
| | | handleQuery()
|
| | | }
|
| | | const emit = defineEmits(["ok"]);
|
| | |
|
| | | const emit = defineEmits(["ok"])
|
| | | /** 选择授权用户操作 */
|
| | | function handleSelectUser() {
|
| | | const roleId = queryParams.roleId;
|
| | | const uIds = userIds.value.join(",");
|
| | | const roleId = queryParams.roleId
|
| | | const uIds = userIds.value.join(",")
|
| | | if (uIds == "") {
|
| | | proxy.$modal.msgError("请选择要分配的用户");
|
| | | return;
|
| | | proxy.$modal.msgError("请选择要分配的用户")
|
| | | return
|
| | | }
|
| | | authUserSelectAll({ roleId: roleId, userIds: uIds }).then(res => {
|
| | | proxy.$modal.msgSuccess(res.msg);
|
| | | if (res.code === 200) {
|
| | | visible.value = false;
|
| | | emit("ok");
|
| | | }
|
| | | });
|
| | | proxy.$modal.msgSuccess(res.msg)
|
| | | visible.value = false
|
| | | emit("ok")
|
| | | })
|
| | | }
|
| | |
|
| | | defineExpose({
|
| | | show,
|
| | | });
|
| | | })
|
| | | </script>
|