兰宝车间质量管理系统-前端
LiuHao
2023-06-06 6af68085ff6615e1ec3a5dd18c761250800d6fca
src/views/system/role/authUser.vue
@@ -58,13 +58,7 @@
        </el-table-column>
      </el-table>
      <pagination
        v-show="total > 0"
        :total="total"
        v-model:page="queryParams.pageNum"
        v-model:limit="queryParams.pageSize"
        @pagination="getList"
      />
      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
      <select-user ref="selectRef" :roleId="queryParams.roleId" @ok="handleQuery" />
    </el-card>
  </div>
@@ -73,10 +67,8 @@
<script setup name="AuthUser" lang="ts">
import { allocatedUserList, authUserCancel, authUserCancelAll } from "@/api/system/role";
import { UserQuery } from "@/api/system/user/types";
import { ComponentInternalInstance } from "vue";
import { UserVO } from "@/api/system/user/types";
import SelectUser from "./selectUser.vue";
// import { ElForm, ElSelect} from 'element-plus';
const route = useRoute();
@@ -90,8 +82,8 @@
const total = ref(0);
const userIds = ref<Array<string | number>>([]);
const queryFormRef = ref(ElForm);
const selectRef = ref(SelectUser);
const queryFormRef = ref<ElFormInstance>();
const selectRef = ref<InstanceType<typeof SelectUser>>();
const queryParams = reactive<UserQuery>({
    pageNum: 1,
@@ -121,7 +113,7 @@
}
/** 重置按钮操作 */
const resetQuery=() =>{
    queryFormRef.value.resetFields();
    queryFormRef.value?.resetFields();
    handleQuery();
}
// 多选框选中数据
@@ -137,7 +129,7 @@
const cancelAuthUser = async (row: UserVO) => {
    await proxy?.$modal.confirm('确认要取消该用户"' + row.userName + '"角色吗?');
    await authUserCancel({ userId: row.userId, roleId: queryParams.roleId });
    getList();
    await getList();
    proxy?.$modal.msgSuccess("取消授权成功");
}
/** 批量取消授权按钮操作 */
@@ -146,7 +138,7 @@
    const uIds = userIds.value.join(",");
    await proxy?.$modal.confirm("是否取消选中用户授权数据项?");
    await authUserCancelAll({ roleId: roleId, userIds: uIds });
    getList();
    await getList();
    proxy?.$modal.msgSuccess("取消授权成功");
}