系统管理-权限和角色的相关修改
This commit is contained in:
parent
978232ed5e
commit
ae5c25b8ea
@ -57,6 +57,14 @@ export function getRole (queryParams:any) {
|
||||
params: queryParams
|
||||
});
|
||||
}
|
||||
//获取角色
|
||||
export function listGroupedByTenant (queryParams:any) {
|
||||
return request({
|
||||
url: '/system/role/listGroupedByTenant',
|
||||
method: 'POST',
|
||||
data: queryParams
|
||||
});
|
||||
}
|
||||
//新建用户
|
||||
export function addUsers (queryParams:any,roleids:any) {
|
||||
return request({
|
||||
|
||||
@ -19,7 +19,18 @@ service.interceptors.request.use(
|
||||
`Expected 'config' and 'config.headers' not to be undefined`
|
||||
);
|
||||
}
|
||||
const menuPaths = [
|
||||
'/system/menu/getMenuButtonTree',
|
||||
'/system/menu/addMenu',
|
||||
'/system/menu/updateById',
|
||||
'/system/menu/deleteById',
|
||||
'/system/menu/changeMenuOrder',
|
||||
'/system/menu/uploadIcon',
|
||||
'/system/menu/deleteIcon'
|
||||
];
|
||||
if (!menuPaths.some(p => config.url.includes(p))) {
|
||||
config.headers.tenant_id = '2';
|
||||
}
|
||||
if (
|
||||
config.url.includes('/dec-lygk-base-server') ||
|
||||
config.url.includes('/wmp-env-server') ||
|
||||
|
||||
@ -34,8 +34,8 @@ const menuInfoRef = ref();
|
||||
const btnInfoRef = ref();
|
||||
const loading = ref(false);
|
||||
//定义tabbar
|
||||
const systemcode = ref('2');
|
||||
const activeIndex = ref('2');
|
||||
const systemcode = ref('1');
|
||||
const activeIndex = ref('1');
|
||||
function handleSelect(key: string) {
|
||||
if (key == '1') {
|
||||
systemcode.value = '1';
|
||||
@ -585,9 +585,9 @@ onMounted(() => {
|
||||
mode="horizontal"
|
||||
@select="handleSelect"
|
||||
>
|
||||
<!-- <el-menu-item index="1">全过程数据管理子系统</el-menu-item> -->
|
||||
<el-menu-item index="1">水电水利建设项目全过程环境管理信息平台</el-menu-item>
|
||||
<el-menu-item index="2">全过程数据管理子系统</el-menu-item>
|
||||
<!-- <el-menu-item index="4">填报管理子系统</el-menu-item> -->
|
||||
<el-menu-item index="4">填报管理子系统</el-menu-item>
|
||||
</el-menu>
|
||||
<div
|
||||
style="
|
||||
@ -679,7 +679,7 @@ onMounted(() => {
|
||||
align="center"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.systemcode == '1'">全过程数据管理子系统</span>
|
||||
<span v-if="scope.row.systemcode == '1'">水电水利建设项目全过程环境管理信息平台</span>
|
||||
<span v-else-if="scope.row.systemcode == '2'">全过程数据管理子系统</span>
|
||||
<span v-else>填报管理子系统</span>
|
||||
</template>
|
||||
|
||||
@ -247,6 +247,7 @@ function handleClose() {
|
||||
:before-close="handleClose"
|
||||
top="30px"
|
||||
draggable
|
||||
style="pointer-events: all;"
|
||||
:destroy-on-close="false"
|
||||
>
|
||||
<el-table
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "review",
|
||||
name: 'review'
|
||||
};
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, nextTick, watch } from "vue";
|
||||
import { ref, onMounted, nextTick, watch } from 'vue';
|
||||
import {
|
||||
queryPendingAuditUsers,
|
||||
deltableData,
|
||||
getRole,
|
||||
listGroupedByTenant,
|
||||
addUsers,
|
||||
updataUser,
|
||||
setpass,
|
||||
@ -17,20 +17,20 @@ import {
|
||||
getFishtree,
|
||||
saveFishqvan,
|
||||
getuserdata,
|
||||
auditUser,
|
||||
} from "@/api/user";
|
||||
import { getDictItemsByCode } from "@/api/dict";
|
||||
import { ElMessageBox, ElMessage } from "element-plus";
|
||||
import Page from "@/components/Pagination/page.vue";
|
||||
import { Search } from "@element-plus/icons-vue";
|
||||
auditUser
|
||||
} from '@/api/user';
|
||||
import { getDictItemsByCode } from '@/api/dict';
|
||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||
import Page from '@/components/Pagination/page.vue';
|
||||
import { Search } from '@element-plus/icons-vue';
|
||||
// 表格加载
|
||||
const loading = ref(false);
|
||||
// 搜索框
|
||||
const queryParams = ref({
|
||||
current: 1,
|
||||
size: 10,
|
||||
querystr: "",
|
||||
regStatus: "",
|
||||
querystr: '',
|
||||
regStatus: ''
|
||||
});
|
||||
//分页 总条数
|
||||
const total = ref();
|
||||
@ -39,25 +39,25 @@ const infoForm = ref();
|
||||
|
||||
//新建
|
||||
const dialogVisible = ref(false);
|
||||
const title = ref("");
|
||||
const title = ref('');
|
||||
function addClick() {
|
||||
title.value = "新增用户";
|
||||
title.value = '新增用户';
|
||||
dialogVisible.value = true;
|
||||
info.value = {
|
||||
id: "",
|
||||
username: "",
|
||||
nickname: "",
|
||||
email: "",
|
||||
phone: "",
|
||||
belongingUnit: "",
|
||||
roleinfo: [],
|
||||
id: '',
|
||||
username: '',
|
||||
nickname: '',
|
||||
email: '',
|
||||
phone: '',
|
||||
belongingUnit: '',
|
||||
roleinfo: []
|
||||
};
|
||||
getrole();
|
||||
}
|
||||
//用户列表
|
||||
const multipleSelection = ref([]);
|
||||
const tableData = ref([]);
|
||||
const orgId = ref("");
|
||||
const orgId = ref('');
|
||||
//获取用户列表信息
|
||||
function getdata() {
|
||||
const params = {
|
||||
@ -65,11 +65,11 @@ function getdata() {
|
||||
size: queryParams.value.size,
|
||||
// orgid: orgId.value,
|
||||
name: queryParams.value.querystr,
|
||||
regStatus: queryParams.value.regStatus,
|
||||
regStatus: queryParams.value.regStatus
|
||||
};
|
||||
loading.value = true;
|
||||
queryPendingAuditUsers(params)
|
||||
.then((res) => {
|
||||
.then(res => {
|
||||
total.value = res.data.total;
|
||||
tableData.value = res.data.records;
|
||||
queryParams.value.size = res.data.size;
|
||||
@ -83,13 +83,13 @@ function getdata() {
|
||||
|
||||
//新建用户弹窗
|
||||
const info = ref({
|
||||
id: "",
|
||||
username: "",
|
||||
nickname: "",
|
||||
email: "",
|
||||
phone: "",
|
||||
belongingUnit: "",
|
||||
roleinfo: [] as any[],
|
||||
id: '',
|
||||
username: '',
|
||||
nickname: '',
|
||||
email: '',
|
||||
phone: '',
|
||||
belongingUnit: '',
|
||||
roleinfo: [] as any[]
|
||||
});
|
||||
//修改-用户
|
||||
function editdepartment(row: any) {
|
||||
@ -103,7 +103,7 @@ function editdepartment(row: any) {
|
||||
info.value = JSON.parse(JSON.stringify(row));
|
||||
info.value.roleinfo = selectID;
|
||||
rolesdata.value = row.roles;
|
||||
title.value = "修改用户";
|
||||
title.value = '修改用户';
|
||||
dialogVisible.value = true;
|
||||
getrole();
|
||||
}
|
||||
@ -120,15 +120,15 @@ function confirmClick(formEl: any) {
|
||||
nickname: info.value.nickname,
|
||||
email: info.value.email,
|
||||
phone: info.value.phone,
|
||||
belongingUnit: info.value.belongingUnit,
|
||||
belongingUnit: info.value.belongingUnit
|
||||
};
|
||||
const roleids = String(info.value.roleinfo);
|
||||
updataUser(params, roleids).then(() => {
|
||||
getdata();
|
||||
dialogVisible.value = false;
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "修改成功",
|
||||
type: 'success',
|
||||
message: '修改成功'
|
||||
});
|
||||
});
|
||||
} else {
|
||||
@ -138,15 +138,15 @@ function confirmClick(formEl: any) {
|
||||
email: info.value.email,
|
||||
phone: info.value.phone,
|
||||
belongingUnit: info.value.belongingUnit,
|
||||
orgid: orgId.value,
|
||||
orgid: orgId.value
|
||||
};
|
||||
const roleids = info.value.roleinfo;
|
||||
addUsers(params, roleids).then((res) => {
|
||||
addUsers(params, roleids).then(res => {
|
||||
getdata();
|
||||
dialogVisible.value = false;
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: res.data.msg,
|
||||
type: 'success',
|
||||
message: res.data.msg
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -155,8 +155,8 @@ function confirmClick(formEl: any) {
|
||||
}
|
||||
//用户弹窗规则定义
|
||||
const moderules = ref({
|
||||
username: [{ required: true, message: "请输入用户账号", trigger: "blur" }],
|
||||
nickname: [{ required: true, message: "请输入用户名称", trigger: "blur" }],
|
||||
username: [{ required: true, message: '请输入用户账号', trigger: 'blur' }],
|
||||
nickname: [{ required: true, message: '请输入用户名称', trigger: 'blur' }]
|
||||
});
|
||||
|
||||
//弹窗关闭
|
||||
@ -166,17 +166,17 @@ function handleClose() {
|
||||
}
|
||||
|
||||
//重置密码
|
||||
const userid = ref("");
|
||||
const userid = ref('');
|
||||
const resultPawss = ref(false);
|
||||
const msgText = ref("");
|
||||
const msgText = ref('');
|
||||
function setpassword(row: any) {
|
||||
ElMessageBox.confirm("确定要重置此账号密码吗?", "重置密码", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
ElMessageBox.confirm('确定要重置此账号密码吗?', '重置密码', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const params = {
|
||||
id: userid.value,
|
||||
id: userid.value
|
||||
};
|
||||
setpass(params).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
@ -196,7 +196,7 @@ function closeResult() {
|
||||
}
|
||||
//过去设施权限维护
|
||||
const fishway = ref(false);
|
||||
const userId = ref("");
|
||||
const userId = ref('');
|
||||
// 回显的权限ID数组
|
||||
const fishhui = ref<any[]>([]);
|
||||
const fishTreeDialog = ref(false);
|
||||
@ -207,7 +207,7 @@ const isFishDataLoaded = ref(false);
|
||||
async function openFishway(row: any) {
|
||||
fishway.value = true;
|
||||
userId.value = row.id;
|
||||
treeInput.value = "";
|
||||
treeInput.value = '';
|
||||
// 重置状态
|
||||
fishhui.value = [];
|
||||
tableDatafish.value = [];
|
||||
@ -218,7 +218,7 @@ async function openFishway(row: any) {
|
||||
await Promise.all([
|
||||
getFishTree(), // 获取树形数据
|
||||
getuserdata({ userId: userId.value }).then((res: any) => {
|
||||
console.log("用户权限数据:", res);
|
||||
console.log('用户权限数据:', res);
|
||||
if (res.code == 0) {
|
||||
res.data.forEach((item: any) => {
|
||||
fishhui.value.push(item.orgId);
|
||||
@ -231,19 +231,19 @@ async function openFishway(row: any) {
|
||||
userId: item.userId,
|
||||
parentId: item.parentId,
|
||||
orgLevel: item.orgLevel,
|
||||
permissionType: item.permissionType,
|
||||
permissionType: item.permissionType
|
||||
});
|
||||
});
|
||||
}
|
||||
}),
|
||||
})
|
||||
]);
|
||||
|
||||
// 两个请求都完成后,标记数据已加载
|
||||
isFishDataLoaded.value = true;
|
||||
console.log("所有数据加载完成,准备回显");
|
||||
console.log('所有数据加载完成,准备回显');
|
||||
} catch (error) {
|
||||
console.error("加载数据失败:", error);
|
||||
ElMessage.error("加载数据失败,请重试");
|
||||
console.error('加载数据失败:', error);
|
||||
ElMessage.error('加载数据失败,请重试');
|
||||
}
|
||||
}
|
||||
|
||||
@ -251,9 +251,9 @@ async function openFishway(row: any) {
|
||||
watch([fishway, isFishDataLoaded], ([newFishway, newDataLoaded]) => {
|
||||
if (newFishway && newDataLoaded) {
|
||||
// 确保两个数据都已加载完成后再执行回显
|
||||
console.log("开始回显, fishTreeRef:", fishTreeRef.value);
|
||||
console.log("回显ID:", fishhui.value);
|
||||
console.log("树数据:", fishData.value);
|
||||
console.log('开始回显, fishTreeRef:', fishTreeRef.value);
|
||||
console.log('回显ID:', fishhui.value);
|
||||
console.log('树数据:', fishData.value);
|
||||
|
||||
// 使用 nextTick 确保 DOM 已更新
|
||||
nextTick(() => {
|
||||
@ -270,7 +270,7 @@ watch([fishway, isFishDataLoaded], ([newFishway, newDataLoaded]) => {
|
||||
fishhui.value,
|
||||
fishData.value
|
||||
);
|
||||
console.log("需要展开的父节点codes:", parentCodesToExpand);
|
||||
console.log('需要展开的父节点codes:', parentCodesToExpand);
|
||||
|
||||
// 控制展开/折叠状态
|
||||
setTreeExpandState(parentCodesToExpand);
|
||||
@ -278,8 +278,8 @@ watch([fishway, isFishDataLoaded], ([newFishway, newDataLoaded]) => {
|
||||
// 验证回显结果
|
||||
const checkedKeys = fishTreeRef.value.getCheckedKeys();
|
||||
const halfCheckedKeys = fishTreeRef.value.getHalfCheckedKeys();
|
||||
console.log("回显完成 - 全选节点:", checkedKeys);
|
||||
console.log("回显完成 - 半选节点:", halfCheckedKeys);
|
||||
console.log('回显完成 - 全选节点:', checkedKeys);
|
||||
console.log('回显完成 - 半选节点:', halfCheckedKeys);
|
||||
|
||||
// 同步表格数据
|
||||
fishTableData.value = tableDatafish.value;
|
||||
@ -294,7 +294,7 @@ watch([fishway, isFishDataLoaded], ([newFishway, newDataLoaded]) => {
|
||||
});
|
||||
} else if (!newFishway) {
|
||||
// 关闭时清空回显数据
|
||||
console.log("关闭对话框,清理数据");
|
||||
console.log('关闭对话框,清理数据');
|
||||
fishhui.value = [];
|
||||
isFishDataLoaded.value = false;
|
||||
// 清除tree选中状态
|
||||
@ -314,12 +314,12 @@ function fishHandleClose() {
|
||||
fishData.value = [];
|
||||
}
|
||||
//获取过鱼设施权限
|
||||
const treeInput = ref("");
|
||||
const treeInput = ref('');
|
||||
const fishProps = {
|
||||
children: "children",
|
||||
label: "name",
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
};
|
||||
watch(treeInput, (val) => {
|
||||
watch(treeInput, val => {
|
||||
fishTreeRef.value!.filter(val);
|
||||
});
|
||||
function filterNode(value: string, data: any) {
|
||||
@ -364,13 +364,16 @@ function getAllChildrenIds(node: any): number[] {
|
||||
}
|
||||
|
||||
// 过鱼设施权限维护 - 检查父节点下所有子节点是否都被选中
|
||||
function areAllChildrenChecked(parentNode: any, checkedKeysArray: any[]): boolean {
|
||||
function areAllChildrenChecked(
|
||||
parentNode: any,
|
||||
checkedKeysArray: any[]
|
||||
): boolean {
|
||||
const allChildrenIds = getAllChildrenIds(parentNode);
|
||||
if (allChildrenIds.length === 0) {
|
||||
return false;
|
||||
}
|
||||
// 检查所有子节点ID是否都在已选中的keys中
|
||||
return allChildrenIds.every((code) => checkedKeysArray.includes(code));
|
||||
return allChildrenIds.every(code => checkedKeysArray.includes(code));
|
||||
}
|
||||
|
||||
// 过鱼设施权限维护 - 检查节点是否被其他父节点包含
|
||||
@ -394,7 +397,10 @@ function isNodeContainedByOtherParent(
|
||||
}
|
||||
|
||||
// 统一处理选中IDs的过滤逻辑:如果父节点的所有子节点都被选中,只保留父节点ID
|
||||
function filterSelectedIds(checkedKeysArray: number[], allCheckedNodes: any[]): number[] {
|
||||
function filterSelectedIds(
|
||||
checkedKeysArray: number[],
|
||||
allCheckedNodes: any[]
|
||||
): number[] {
|
||||
const resultIds: number[] = [];
|
||||
const fullySelectedParentIds: number[] = [];
|
||||
const filteredNodeIds = new Set<number>();
|
||||
@ -405,7 +411,7 @@ function filterSelectedIds(checkedKeysArray: number[], allCheckedNodes: any[]):
|
||||
if (areAllChildrenChecked(node, checkedKeysArray)) {
|
||||
fullySelectedParentIds.push(node.code);
|
||||
const childrenIds = getAllChildrenIds(node);
|
||||
childrenIds.forEach((childId) => {
|
||||
childrenIds.forEach(childId => {
|
||||
filteredNodeIds.add(childId);
|
||||
});
|
||||
}
|
||||
@ -414,9 +420,13 @@ function filterSelectedIds(checkedKeysArray: number[], allCheckedNodes: any[]):
|
||||
|
||||
// 第二阶段:添加结果
|
||||
// 1. 先添加所有"全选"的父节点(但要排除被其他父节点包含的)
|
||||
fullySelectedParentIds.forEach((parentId) => {
|
||||
fullySelectedParentIds.forEach(parentId => {
|
||||
if (
|
||||
!isNodeContainedByOtherParent(parentId, fullySelectedParentIds, allCheckedNodes)
|
||||
!isNodeContainedByOtherParent(
|
||||
parentId,
|
||||
fullySelectedParentIds,
|
||||
allCheckedNodes
|
||||
)
|
||||
) {
|
||||
resultIds.push(parentId);
|
||||
}
|
||||
@ -426,14 +436,18 @@ function filterSelectedIds(checkedKeysArray: number[], allCheckedNodes: any[]):
|
||||
allCheckedNodes.forEach((node: any) => {
|
||||
if (!filteredNodeIds.has(node.code) && !resultIds.includes(node.code)) {
|
||||
if (
|
||||
!isNodeContainedByOtherParent(node.code, fullySelectedParentIds, allCheckedNodes)
|
||||
!isNodeContainedByOtherParent(
|
||||
node.code,
|
||||
fullySelectedParentIds,
|
||||
allCheckedNodes
|
||||
)
|
||||
) {
|
||||
resultIds.push(node.code);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
console.log("过滤后的IDs:", resultIds);
|
||||
console.log('过滤后的IDs:', resultIds);
|
||||
return resultIds;
|
||||
}
|
||||
|
||||
@ -491,7 +505,7 @@ function handleFishCheckChange(checkedNode: any, checkedInfo: any) {
|
||||
// 使用统一的过滤逻辑处理IDs
|
||||
const resultIds = filterSelectedIds(checkedKeysArray, allCheckedNodes);
|
||||
|
||||
console.log("最终获取的IDs:", resultIds);
|
||||
console.log('最终获取的IDs:', resultIds);
|
||||
|
||||
// 更新表格数据
|
||||
getFishTableData(resultIds);
|
||||
@ -519,7 +533,7 @@ function getFishTableData(ids: any[]) {
|
||||
userId: userId.value,
|
||||
parentId: node.parentId,
|
||||
orgLevel: node.orgLevel,
|
||||
permissionType: "READ", // 默认选择读权限
|
||||
permissionType: 'READ' // 默认选择读权限
|
||||
});
|
||||
}
|
||||
|
||||
@ -537,16 +551,16 @@ function getFishTableData(ids: any[]) {
|
||||
const tableids: any = ref([]);
|
||||
//选中的过鱼权限
|
||||
function fishDataHandleSelectionChange(val: any) {
|
||||
console.log("选中的行数据:", val);
|
||||
console.log('选中的行数据:', val);
|
||||
fishTableSelection.value = val;
|
||||
}
|
||||
|
||||
//移除权限
|
||||
function delFishTable() {
|
||||
ElMessageBox.confirm("确定移除选中权限吗?", "删除提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
ElMessageBox.confirm('确定移除选中权限吗?', '删除提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
// 获取选中的ID数组
|
||||
@ -579,8 +593,8 @@ function delFishTable() {
|
||||
}
|
||||
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "删除成功",
|
||||
type: 'success',
|
||||
message: '删除成功'
|
||||
});
|
||||
|
||||
// 清空选中状态
|
||||
@ -622,34 +636,36 @@ function fishSure() {
|
||||
parentId: item.parentId,
|
||||
orgLevel: item.orgLevel,
|
||||
path: item.path,
|
||||
permissionType: item.permissionType,
|
||||
permissionType: item.permissionType
|
||||
});
|
||||
});
|
||||
saveFishqvan({ userId: userId.value, dataScopeList: params }).then((res: any) => {
|
||||
console.log(res);
|
||||
if (res.code == 0) {
|
||||
ElMessage({
|
||||
message: "保存成功",
|
||||
type: "success",
|
||||
});
|
||||
fishHandleClose();
|
||||
saveFishqvan({ userId: userId.value, dataScopeList: params }).then(
|
||||
(res: any) => {
|
||||
console.log(res);
|
||||
if (res.code == 0) {
|
||||
ElMessage({
|
||||
message: '保存成功',
|
||||
type: 'success'
|
||||
});
|
||||
fishHandleClose();
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
}
|
||||
//删除用户
|
||||
function delclick(row: any) {
|
||||
ElMessageBox.confirm("确定删除此用户吗?", "删除提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
ElMessageBox.confirm('确定删除此用户吗?', '删除提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const params = {
|
||||
id: row.id,
|
||||
id: row.id
|
||||
};
|
||||
deltableData(params).then(() => {
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "删除成功",
|
||||
type: 'success',
|
||||
message: '删除成功'
|
||||
});
|
||||
getdata();
|
||||
});
|
||||
@ -658,9 +674,9 @@ function delclick(row: any) {
|
||||
//获取角色
|
||||
function getrole() {
|
||||
const params = {
|
||||
rolename: "",
|
||||
rolename: ''
|
||||
};
|
||||
getRole(params).then((res) => {
|
||||
listGroupedByTenant(params).then(res => {
|
||||
rolesdata.value = res;
|
||||
});
|
||||
}
|
||||
@ -676,18 +692,18 @@ function delchoice() {
|
||||
ids.value.forEach((item: any) => {
|
||||
choice.push(item.id);
|
||||
});
|
||||
ElMessageBox.confirm("确定删除此用户吗?", "删除提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
ElMessageBox.confirm('确定删除此用户吗?', '删除提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const params = {
|
||||
id: String(choice),
|
||||
id: String(choice)
|
||||
};
|
||||
delChoise(params).then(() => {
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "删除成功",
|
||||
type: 'success',
|
||||
message: '删除成功'
|
||||
});
|
||||
getdata();
|
||||
});
|
||||
@ -700,14 +716,32 @@ function dateFormat(row: any) {
|
||||
var date = new Date(daterc);
|
||||
var year = date.getFullYear();
|
||||
var month =
|
||||
date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
|
||||
date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
|
||||
var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
|
||||
var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
|
||||
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
|
||||
var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
|
||||
date.getMonth() + 1 < 10
|
||||
? '0' + (date.getMonth() + 1)
|
||||
: date.getMonth() + 1;
|
||||
date.getMonth() + 1 < 10
|
||||
? '0' + (date.getMonth() + 1)
|
||||
: date.getMonth() + 1;
|
||||
var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
|
||||
var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours();
|
||||
var minutes =
|
||||
date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
|
||||
var seconds =
|
||||
date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
|
||||
// 拼接
|
||||
return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
|
||||
return (
|
||||
year +
|
||||
'-' +
|
||||
month +
|
||||
'-' +
|
||||
day +
|
||||
' ' +
|
||||
hours +
|
||||
':' +
|
||||
minutes +
|
||||
':' +
|
||||
seconds
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -715,11 +749,11 @@ function dateFormat(row: any) {
|
||||
//分类名字
|
||||
function getName(arr: any[], type: any): string {
|
||||
if (!arr || !Array.isArray(arr) || type === undefined || type === null) {
|
||||
return "";
|
||||
return '';
|
||||
}
|
||||
const items = arr.find((item: any) => item?.itemCode == type);
|
||||
console.log(items);
|
||||
return items?.dictName || "";
|
||||
return items?.dictName || '';
|
||||
}
|
||||
|
||||
// 获取审核状态对应的Tag颜色类型
|
||||
@ -730,60 +764,60 @@ function getRegStatusColor(type: any): string {
|
||||
type === undefined ||
|
||||
type === null
|
||||
) {
|
||||
return "info";
|
||||
return 'info';
|
||||
}
|
||||
const items = regStatusArr.value.find((item: any) => item?.itemCode == type);
|
||||
const color = items?.custom1 || "info";
|
||||
const color = items?.custom1 || 'info';
|
||||
|
||||
// 映射字典custom1到Element Plus Tag类型
|
||||
const colorMap: Record<string, string> = {
|
||||
blue: "primary", // 待审核 - 蓝色
|
||||
green: "success", // 已通过 - 绿色
|
||||
red: "danger", // 已驳回 - 红色
|
||||
blue: 'primary', // 待审核 - 蓝色
|
||||
green: 'success', // 已通过 - 绿色
|
||||
red: 'danger' // 已驳回 - 红色
|
||||
};
|
||||
|
||||
return colorMap[color] || "info";
|
||||
return colorMap[color] || 'info';
|
||||
}
|
||||
|
||||
// ==================== 审批相关功能 ====================
|
||||
// 审批对话框显示状态
|
||||
const auditDialogVisible = ref(false);
|
||||
// 审批类型:1-通过,2-驳回
|
||||
const auditType = ref("");
|
||||
const auditType = ref('');
|
||||
// 当前审批的用户ID
|
||||
const currentAuditUserId = ref("");
|
||||
const currentAuditUserId = ref('');
|
||||
// 审批意见表单
|
||||
const auditForm = ref({
|
||||
commentInfo: "",
|
||||
commentInfo: ''
|
||||
});
|
||||
// 审批意见表单引用
|
||||
const auditFormRef = ref();
|
||||
|
||||
// 审批意见表单验证规则
|
||||
const auditRules = ref({
|
||||
commentInfo: [{ required: true, message: "请输入审批意见", trigger: "blur" }],
|
||||
commentInfo: [{ required: true, message: '请输入审批意见', trigger: 'blur' }]
|
||||
});
|
||||
|
||||
// 打开审批通过对话框
|
||||
function handleAuditPass(row: any) {
|
||||
currentAuditUserId.value = row.id;
|
||||
auditType.value = "APPROVED";
|
||||
auditForm.value.commentInfo = "";
|
||||
auditType.value = 'APPROVED';
|
||||
auditForm.value.commentInfo = '';
|
||||
auditDialogVisible.value = true;
|
||||
}
|
||||
|
||||
// 打开审批驳回对话框
|
||||
function handleAuditReject(row: any) {
|
||||
currentAuditUserId.value = row.id;
|
||||
auditType.value = "REJECTED";
|
||||
auditForm.value.commentInfo = "";
|
||||
auditType.value = 'REJECTED';
|
||||
auditForm.value.commentInfo = '';
|
||||
auditDialogVisible.value = true;
|
||||
}
|
||||
|
||||
// 关闭审批对话框
|
||||
function handleAuditClose() {
|
||||
auditDialogVisible.value = false;
|
||||
auditForm.value.commentInfo = "";
|
||||
auditForm.value.commentInfo = '';
|
||||
if (auditFormRef.value) {
|
||||
auditFormRef.value.resetFields();
|
||||
}
|
||||
@ -796,22 +830,23 @@ function submitAudit(formEl: any) {
|
||||
const params = {
|
||||
userId: currentAuditUserId.value,
|
||||
regStatus: auditType.value,
|
||||
commentInfo: auditForm.value.commentInfo,
|
||||
commentInfo: auditForm.value.commentInfo
|
||||
};
|
||||
|
||||
auditUser(params)
|
||||
.then(() => {
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: auditType.value === "APPROVED" ? "审批通过成功" : "审批驳回成功",
|
||||
type: 'success',
|
||||
message:
|
||||
auditType.value === 'APPROVED' ? '审批通过成功' : '审批驳回成功'
|
||||
});
|
||||
handleAuditClose();
|
||||
getdata(); // 刷新列表
|
||||
})
|
||||
.catch(() => {
|
||||
ElMessage({
|
||||
type: "error",
|
||||
message: "审批操作失败,请重试",
|
||||
type: 'error',
|
||||
message: '审批操作失败,请重试'
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -825,10 +860,10 @@ onMounted(() => {
|
||||
const dictData = ref([]);
|
||||
const regStatusArr = ref([]);
|
||||
function getdictdata() {
|
||||
getDictItemsByCode({ dictCode: "resourceType" }).then((res) => {
|
||||
getDictItemsByCode({ dictCode: 'resourceType' }).then(res => {
|
||||
dictData.value = res.data;
|
||||
});
|
||||
getDictItemsByCode({ dictCode: "approvalStatus" }).then((res) => {
|
||||
getDictItemsByCode({ dictCode: 'approvalStatus' }).then(res => {
|
||||
regStatusArr.value = res.data;
|
||||
});
|
||||
}
|
||||
@ -836,18 +871,18 @@ const vMove = {
|
||||
mounted(el: any) {
|
||||
el.onmousedown = function (e: any) {
|
||||
var init = e.clientX;
|
||||
var parent: any = document.getElementById("silderLeft");
|
||||
var parent: any = document.getElementById('silderLeft');
|
||||
const initWidth: any = parent.offsetWidth;
|
||||
document.onmousemove = function (e) {
|
||||
var end = e.clientX;
|
||||
var newWidth = end - init + initWidth;
|
||||
parent.style.width = newWidth + "px";
|
||||
parent.style.width = newWidth + 'px';
|
||||
};
|
||||
document.onmouseup = function () {
|
||||
document.onmousemove = document.onmouseup = null;
|
||||
};
|
||||
};
|
||||
},
|
||||
}
|
||||
};
|
||||
// 递归获取树形数据中所有节点的code
|
||||
function getAllNodeCodes(nodes: any[]): number[] {
|
||||
@ -864,11 +899,11 @@ function getAllNodeCodes(nodes: any[]): number[] {
|
||||
// 全选:选中树中所有节点
|
||||
function handleSelectAll() {
|
||||
if (!fishTreeRef.value || !fishData.value || fishData.value.length === 0) {
|
||||
ElMessage.warning("暂无数据可全选");
|
||||
ElMessage.warning('暂无数据可全选');
|
||||
return;
|
||||
}
|
||||
const allCodes = getAllNodeCodes(fishData.value);
|
||||
console.log("全选 - 所有节点codes:", allCodes);
|
||||
console.log('全选 - 所有节点codes:', allCodes);
|
||||
fishTreeRef.value.setCheckedKeys(allCodes, true);
|
||||
|
||||
// 手动更新表格数据(使用统一过滤逻辑)
|
||||
@ -882,16 +917,16 @@ function handleSelectAll() {
|
||||
|
||||
getFishTableData(filteredIds);
|
||||
tableids.value = filteredIds;
|
||||
console.log("全选 - 表格数据已更新,过滤后IDs:", filteredIds);
|
||||
console.log('全选 - 表格数据已更新,过滤后IDs:', filteredIds);
|
||||
}, 100);
|
||||
|
||||
ElMessage.success("已全选所有节点");
|
||||
ElMessage.success('已全选所有节点');
|
||||
}
|
||||
|
||||
// 反选:反转当前选中状态
|
||||
function handleInvertSelection() {
|
||||
if (!fishTreeRef.value || !fishData.value || fishData.value.length === 0) {
|
||||
ElMessage.warning("暂无数据可操作");
|
||||
ElMessage.warning('暂无数据可操作');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -900,19 +935,23 @@ function handleInvertSelection() {
|
||||
// 获取当前半选的节点keys(父节点部分子节点被选中)
|
||||
const halfCheckedKeys = fishTreeRef.value.getHalfCheckedKeys();
|
||||
|
||||
console.log("反选前 - 已选中codes:", checkedKeys);
|
||||
console.log("反选前 - 半选codes:", halfCheckedKeys);
|
||||
console.log('反选前 - 已选中codes:', checkedKeys);
|
||||
console.log('反选前 - 半选codes:', halfCheckedKeys);
|
||||
|
||||
// 合并完全选中和半选的节点,这些是需要取消选中的
|
||||
const currentSelectedKeys = [...new Set([...checkedKeys, ...halfCheckedKeys])];
|
||||
console.log("反选前 - 当前有效选中状态:", currentSelectedKeys);
|
||||
const currentSelectedKeys = [
|
||||
...new Set([...checkedKeys, ...halfCheckedKeys])
|
||||
];
|
||||
console.log('反选前 - 当前有效选中状态:', currentSelectedKeys);
|
||||
|
||||
// 获取所有节点codes
|
||||
const allCodes = getAllNodeCodes(fishData.value);
|
||||
|
||||
// 计算需要选中的节点:所有节点 - 当前有效选中状态
|
||||
const invertedCodes = allCodes.filter((code) => !currentSelectedKeys.includes(code));
|
||||
console.log("反选后 - 新的选中codes:", invertedCodes);
|
||||
const invertedCodes = allCodes.filter(
|
||||
code => !currentSelectedKeys.includes(code)
|
||||
);
|
||||
console.log('反选后 - 新的选中codes:', invertedCodes);
|
||||
|
||||
// 先清空所有选中状态,避免级联影响
|
||||
fishTreeRef.value.setCheckedKeys([], false);
|
||||
@ -932,11 +971,11 @@ function handleInvertSelection() {
|
||||
|
||||
getFishTableData(filteredIds);
|
||||
tableids.value = filteredIds;
|
||||
console.log("反选 - 表格数据已更新,过滤后IDs:", filteredIds);
|
||||
console.log('反选 - 表格数据已更新,过滤后IDs:', filteredIds);
|
||||
}, 100);
|
||||
}, 50);
|
||||
|
||||
ElMessage.success("已反选操作");
|
||||
ElMessage.success('已反选操作');
|
||||
}
|
||||
|
||||
// 取消选中:清空所有选中状态
|
||||
@ -944,17 +983,17 @@ function handleClearSelection() {
|
||||
if (!fishTreeRef.value) {
|
||||
return;
|
||||
}
|
||||
console.log("取消选中 - 清空所有选中");
|
||||
console.log('取消选中 - 清空所有选中');
|
||||
fishTreeRef.value.setCheckedKeys([], true);
|
||||
|
||||
// 手动清空表格数据
|
||||
setTimeout(() => {
|
||||
getFishTableData([]);
|
||||
tableids.value = [];
|
||||
console.log("取消选中 - 表格数据已清空");
|
||||
console.log('取消选中 - 表格数据已清空');
|
||||
}, 100);
|
||||
|
||||
ElMessage.success("已取消所有选中");
|
||||
ElMessage.success('已取消所有选中');
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -994,7 +1033,10 @@ function handleClearSelection() {
|
||||
:value="item.itemCode"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button type="primary" style="margin-left: 10px" @click="getdata"
|
||||
<el-button
|
||||
type="primary"
|
||||
style="margin-left: 10px"
|
||||
@click="getdata"
|
||||
>搜索</el-button
|
||||
>
|
||||
</div>
|
||||
@ -1022,7 +1064,7 @@ function handleClearSelection() {
|
||||
:header-cell-style="{
|
||||
background: 'rgb(250 250 250)',
|
||||
color: ' #383838',
|
||||
height: '50px',
|
||||
height: '50px'
|
||||
}"
|
||||
>
|
||||
<!-- <el-table-column type="selection" width="50" align="center" /> -->
|
||||
@ -1040,8 +1082,8 @@ function handleClearSelection() {
|
||||
>
|
||||
<span>
|
||||
{{
|
||||
scope.row.basinNames.split(",").slice(0, 6).join(",") +
|
||||
(scope.row.basinNames.split(",").length > 6 ? "..." : "")
|
||||
scope.row.basinNames.split(',').slice(0, 6).join(',') +
|
||||
(scope.row.basinNames.split(',').length > 6 ? '...' : '')
|
||||
}}
|
||||
</span>
|
||||
</el-tooltip>
|
||||
@ -1060,17 +1102,25 @@ function handleClearSelection() {
|
||||
>
|
||||
<span>
|
||||
{{
|
||||
scope.row.stationNames.split(",").slice(0, 6).join(",") +
|
||||
(scope.row.stationNames.split(",").length > 6 ? "..." : "")
|
||||
scope.row.stationNames.split(',').slice(0, 6).join(',') +
|
||||
(scope.row.stationNames.split(',').length > 6 ? '...' : '')
|
||||
}}
|
||||
</span>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="nickname" label="用户姓名" width="140"></el-table-column>
|
||||
<el-table-column
|
||||
prop="nickname"
|
||||
label="用户姓名"
|
||||
width="140"
|
||||
></el-table-column>
|
||||
<!-- <el-table-column prop="avatar" label="头像"></el-table-column> -->
|
||||
<!-- <el-table-column prop="email" label="邮箱"></el-table-column> -->
|
||||
<el-table-column prop="phone" label="手机号" width="160"></el-table-column>
|
||||
<el-table-column
|
||||
prop="phone"
|
||||
label="手机号"
|
||||
width="160"
|
||||
></el-table-column>
|
||||
<el-table-column prop="username" label="登录账号"></el-table-column>
|
||||
<!-- <el-table-column prop="custom1" label="登录账号"></el-table-column> -->
|
||||
<!-- <el-table-column prop="rolename" label="所属角色" >
|
||||
@ -1079,7 +1129,12 @@ function handleClearSelection() {
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="regStatus" label="审核状态" width="90" align="center">
|
||||
<el-table-column
|
||||
prop="regStatus"
|
||||
label="审核状态"
|
||||
width="90"
|
||||
align="center"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-tag :type="getRegStatusColor(scope.row.regStatus)" size="small">
|
||||
{{ getName(regStatusArr, scope.row.regStatus) }}
|
||||
@ -1166,7 +1221,12 @@ function handleClearSelection() {
|
||||
width="620px"
|
||||
draggable
|
||||
>
|
||||
<el-form ref="infoForm" :model="info" :rules="moderules" label-width="90px">
|
||||
<el-form
|
||||
ref="infoForm"
|
||||
:model="info"
|
||||
:rules="moderules"
|
||||
label-width="90px"
|
||||
>
|
||||
<el-form-item label="用户姓名" prop="nickname">
|
||||
<el-input
|
||||
v-model="info.nickname"
|
||||
@ -1203,13 +1263,25 @@ function handleClearSelection() {
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属角色">
|
||||
<el-select v-model="info.roleinfo" placeholder=" " style="width: 100%" multiple>
|
||||
<el-option
|
||||
v-for="item in rolesdata"
|
||||
:key="item.id"
|
||||
:label="item.rolename"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-select
|
||||
v-model="info.roleinfo"
|
||||
placeholder=" "
|
||||
style="width: 100%"
|
||||
multiple
|
||||
filterable
|
||||
>
|
||||
<el-option-group
|
||||
v-for="group in rolesdata"
|
||||
:key="group.tenantName"
|
||||
:label="group.tenantName"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in group.roles"
|
||||
:key="item.id"
|
||||
:label="item.rolename"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-option-group>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -1223,7 +1295,9 @@ function handleClearSelection() {
|
||||
"
|
||||
>
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
<el-button type="primary" @click="confirmClick(infoForm)">保存</el-button>
|
||||
<el-button type="primary" @click="confirmClick(infoForm)"
|
||||
>保存</el-button
|
||||
>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!-- 过鱼设施权限维护 -->
|
||||
@ -1256,9 +1330,15 @@ function handleClearSelection() {
|
||||
</template>
|
||||
</el-input>
|
||||
<div class="button_div">
|
||||
<el-button type="primary" @click="handleSelectAll">全选</el-button>
|
||||
<el-button type="primary" @click="handleInvertSelection">反选</el-button>
|
||||
<el-button type="primary" @click="handleClearSelection">取消选中</el-button>
|
||||
<el-button type="primary" @click="handleSelectAll"
|
||||
>全选</el-button
|
||||
>
|
||||
<el-button type="primary" @click="handleInvertSelection"
|
||||
>反选</el-button
|
||||
>
|
||||
<el-button type="primary" @click="handleClearSelection"
|
||||
>取消选中</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1298,13 +1378,23 @@ function handleClearSelection() {
|
||||
:header-cell-style="{
|
||||
background: 'rgb(250 250 250)',
|
||||
color: ' #383838',
|
||||
height: '50px',
|
||||
height: '50px'
|
||||
}"
|
||||
>
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column type="index" label="序号" width="70" align="center" />
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
width="70"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column prop="name" label="名称"></el-table-column>
|
||||
<el-table-column prop="type" label="类型" width="200" align="center">
|
||||
<el-table-column
|
||||
prop="type"
|
||||
label="类型"
|
||||
width="200"
|
||||
align="center"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span>{{ getName(dictData, scope.row.type) }}</span>
|
||||
</template>
|
||||
@ -1365,7 +1455,9 @@ function handleClearSelection() {
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="handleAuditClose">取消</el-button>
|
||||
<el-button type="primary" @click="submitAudit(auditFormRef)">确定</el-button>
|
||||
<el-button type="primary" @click="submitAudit(auditFormRef)"
|
||||
>确定</el-button
|
||||
>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@ -1378,7 +1470,9 @@ function handleClearSelection() {
|
||||
append-to-body
|
||||
:before-close="closeResult"
|
||||
>
|
||||
已将密码重置为:<span style="color: #409eff; font-size: 16px">{{ msgText }}</span>
|
||||
已将密码重置为:<span style="color: #409eff; font-size: 16px">{{
|
||||
msgText
|
||||
}}</span>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="closeResult">取消</el-button>
|
||||
@ -1526,4 +1620,7 @@ function handleClearSelection() {
|
||||
.el-message-box {
|
||||
width: 300px !important;
|
||||
}
|
||||
:deep(.el-select-group__title){
|
||||
font-size: 16px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -18,6 +18,7 @@ import {
|
||||
setOrgscope,
|
||||
postOrgscope
|
||||
} from '@/api/role';
|
||||
import { getDictItemsByCode } from '@/api/dict';
|
||||
//定义表格数据
|
||||
const tableData: any = ref([]);
|
||||
const multipleSelection = ref([]);
|
||||
@ -29,7 +30,7 @@ const loading = ref(false);
|
||||
function gettableData() {
|
||||
let params = {
|
||||
rolename: input.value,
|
||||
tenantId: '2'
|
||||
tenantId:tenValue.value,
|
||||
};
|
||||
loading.value = true;
|
||||
listRolePages(params)
|
||||
@ -117,7 +118,7 @@ function confirmClick(formEl: any) {
|
||||
rolename: info.value.rolename,
|
||||
level: info.value.level,
|
||||
description: info.value.description,
|
||||
tenantId:'2'
|
||||
tenantId:tenValue.value
|
||||
};
|
||||
addDept(params).then(() => {
|
||||
gettableData();
|
||||
@ -129,7 +130,7 @@ function confirmClick(formEl: any) {
|
||||
level: info.value.level,
|
||||
description: info.value.description,
|
||||
id: info.value.id,
|
||||
tenantId:'2'
|
||||
tenantId:tenValue.value
|
||||
};
|
||||
renewDept(params).then(() => {
|
||||
gettableData();
|
||||
@ -278,7 +279,7 @@ function assignment(row: any) {
|
||||
accessVisible.value = true;
|
||||
const params = {
|
||||
roleId: rowid.value,
|
||||
tenantId: '2'
|
||||
tenantId:tenValue.value
|
||||
};
|
||||
permissionAssignmentGrouped(params).then((res: any) => {
|
||||
accessdata.value = res[0]?.menus || [];
|
||||
@ -368,9 +369,13 @@ function dateFormat(row: any) {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
let tenValue = ref('1')
|
||||
let tenOption = ref([])
|
||||
onMounted(() => {
|
||||
gettableData();
|
||||
getDictItemsByCode({ dictCode: 'PLATFORM_TENANT' }).then(res => {
|
||||
tenOption.value = res.data;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -394,6 +399,15 @@ onMounted(() => {
|
||||
style="width: 200px"
|
||||
clearable
|
||||
/>
|
||||
<el-select v-model="tenValue" placeholder=" " style="width: 320px;margin-left: 10px">
|
||||
<el-option
|
||||
v-for="item in tenOption"
|
||||
:key="item.itemCode"
|
||||
:label="item.dictName"
|
||||
:value="item.itemCode"
|
||||
/>
|
||||
<!-- PLATFORM_TENANT -->
|
||||
</el-select>
|
||||
<el-button
|
||||
type="primary"
|
||||
style="margin-left: 10px"
|
||||
|
||||
@ -11,7 +11,7 @@ import {
|
||||
gettableData,
|
||||
DataStatus,
|
||||
deltableData,
|
||||
getRole,
|
||||
listGroupedByTenant,
|
||||
addUsers,
|
||||
updataUser,
|
||||
setpass,
|
||||
@ -786,7 +786,7 @@ function getrole() {
|
||||
const params = {
|
||||
rolename: ''
|
||||
};
|
||||
getRole(params).then(res => {
|
||||
listGroupedByTenant(params).then(res => {
|
||||
rolesdata.value = res;
|
||||
});
|
||||
}
|
||||
@ -1250,19 +1250,27 @@ function handleClearSelection() {
|
||||
placeholder="请输入登录账号"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="所属角色">
|
||||
<el-select
|
||||
v-model="info.roleinfo"
|
||||
placeholder=" "
|
||||
placeholder=" "
|
||||
style="width: 100%"
|
||||
multiple
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in rolesdata"
|
||||
:key="item.id"
|
||||
:label="item.rolename"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-option-group
|
||||
v-for="group in rolesdata"
|
||||
:key="group.tenantName"
|
||||
:label="group.tenantName"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in group.roles"
|
||||
:key="item.id"
|
||||
:label="item.rolename"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-option-group>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -1565,4 +1573,7 @@ function handleClearSelection() {
|
||||
.el-message-box {
|
||||
width: 300px !important;
|
||||
}
|
||||
:deep(.el-select-group__title){
|
||||
font-size: 16px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -57,6 +57,14 @@ export function getRole (queryParams:any) {
|
||||
params: queryParams
|
||||
});
|
||||
}
|
||||
//获取角色
|
||||
export function listGroupedByTenant (queryParams:any) {
|
||||
return request({
|
||||
url: '/system/role/listGroupedByTenant',
|
||||
method: 'POST',
|
||||
data: queryParams
|
||||
});
|
||||
}
|
||||
//新建用户
|
||||
export function addUsers (queryParams:any,roleids:any) {
|
||||
return request({
|
||||
|
||||
@ -19,7 +19,18 @@ service.interceptors.request.use(
|
||||
`Expected 'config' and 'config.headers' not to be undefined`
|
||||
);
|
||||
}
|
||||
config.headers.tenant_id = '4';
|
||||
const menuPaths = [
|
||||
'/system/menu/getMenuButtonTree',
|
||||
'/system/menu/addMenu',
|
||||
'/system/menu/updateById',
|
||||
'/system/menu/deleteById',
|
||||
'/system/menu/changeMenuOrder',
|
||||
'/system/menu/uploadIcon',
|
||||
'/system/menu/deleteIcon'
|
||||
];
|
||||
if (!menuPaths.some(p => config.url.includes(p))) {
|
||||
config.headers.tenant_id = '4';
|
||||
}
|
||||
const user = useUserStoreHook();
|
||||
if (user.Token) {
|
||||
config.headers.token = getToken();
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { ElForm, ElMessageBox, ElMessage } from "element-plus";
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { ElForm, ElMessageBox, ElMessage } from 'element-plus';
|
||||
import {
|
||||
getdata,
|
||||
addmenu,
|
||||
@ -8,20 +8,20 @@ import {
|
||||
deltmenu,
|
||||
moveOrderno,
|
||||
uploadIcon,
|
||||
moveIcon,
|
||||
} from "@/api/menu";
|
||||
import Sortable from "sortablejs";
|
||||
moveIcon
|
||||
} from '@/api/menu';
|
||||
import Sortable from 'sortablejs';
|
||||
//定义表格数据
|
||||
const url = import.meta.env.VITE_APP_BASE_API;
|
||||
const tableData: any = ref([]);
|
||||
function gteTabledata() {
|
||||
const params = {
|
||||
systemcode: systemcode.value,
|
||||
name: "",
|
||||
name: ''
|
||||
};
|
||||
loading.value = true;
|
||||
getdata(params)
|
||||
.then((res) => {
|
||||
.then(res => {
|
||||
tableData.value = res;
|
||||
loading.value = false;
|
||||
})
|
||||
@ -34,56 +34,54 @@ const menuInfoRef = ref();
|
||||
const btnInfoRef = ref();
|
||||
const loading = ref(false);
|
||||
//定义tabbar
|
||||
const systemcode = ref("4");
|
||||
const activeIndex = ref("4");
|
||||
const systemcode = ref('1');
|
||||
const activeIndex = ref('1');
|
||||
function handleSelect(key: string) {
|
||||
if (key == "1") {
|
||||
systemcode.value = "1";
|
||||
} else if (key == "2") {
|
||||
systemcode.value = "2";
|
||||
} else if (key == "3") {
|
||||
systemcode.value = "3";
|
||||
} else if (key == "4") {
|
||||
systemcode.value = "4";
|
||||
if (key == '1') {
|
||||
systemcode.value = '1';
|
||||
} else if (key == '2') {
|
||||
systemcode.value = '2';
|
||||
} else if (key == '4') {
|
||||
systemcode.value = '4';
|
||||
}
|
||||
gteTabledata();
|
||||
}
|
||||
//定义搜索框文本
|
||||
const menuname = ref("");
|
||||
const menuname = ref('');
|
||||
//点击搜索
|
||||
function search() {
|
||||
menuname.value = menuname.value.replace(/\s+/g, "");
|
||||
menuname.value = menuname.value.replace(/\s+/g, '');
|
||||
let params = {
|
||||
systemcode: systemcode.value,
|
||||
name: menuname.value,
|
||||
isdisplay: "",
|
||||
isdisplay: ''
|
||||
};
|
||||
getdata(params).then((res) => {
|
||||
getdata(params).then(res => {
|
||||
tableData.value = res;
|
||||
});
|
||||
}
|
||||
//目录添加
|
||||
const title = ref("");
|
||||
const title = ref('');
|
||||
const expertInfo: any = ref({
|
||||
name: "",
|
||||
type: "0",
|
||||
opturl: "",
|
||||
permission: "",
|
||||
name: '',
|
||||
type: '0',
|
||||
opturl: '',
|
||||
permission: '',
|
||||
isdisplay: true,
|
||||
systemcode: "",
|
||||
icon: "",
|
||||
code: "",
|
||||
systemcode: '',
|
||||
icon: '',
|
||||
code: ''
|
||||
});
|
||||
const dialogVisible = ref(false);
|
||||
function addClick() {
|
||||
title.value = "新增目录";
|
||||
title.value = '新增目录';
|
||||
const orgnamemage = ref({
|
||||
name: "",
|
||||
type: "3",
|
||||
opturl: "",
|
||||
permission: "",
|
||||
name: '',
|
||||
type: '3',
|
||||
opturl: '',
|
||||
permission: '',
|
||||
orderno: 1,
|
||||
isdisplay: "1",
|
||||
isdisplay: '1'
|
||||
});
|
||||
expertInfo.value = orgnamemage.value;
|
||||
dialogVisible.value = true;
|
||||
@ -99,35 +97,37 @@ function handleClose() {
|
||||
}
|
||||
//表格规则定义
|
||||
const rules = ref({
|
||||
name: [{ required: true, message: "请输入目录名称", trigger: "blur" }],
|
||||
opturl: [{ required: true, message: "请输入操作URL", trigger: "blur" }],
|
||||
permission: [{ required: true, message: "请输入目录权限标识", trigger: "blur" }],
|
||||
name: [{ required: true, message: '请输入目录名称', trigger: 'blur' }],
|
||||
opturl: [{ required: true, message: '请输入操作URL', trigger: 'blur' }],
|
||||
permission: [
|
||||
{ required: true, message: '请输入目录权限标识', trigger: 'blur' }
|
||||
]
|
||||
});
|
||||
//添加子目录
|
||||
const parentID = ref("");
|
||||
const parentID = ref('');
|
||||
function addchilder(row: any) {
|
||||
title.value = "新增子目录";
|
||||
title.value = '新增子目录';
|
||||
|
||||
const orgnamemage = ref({
|
||||
name: "",
|
||||
type: "3",
|
||||
opturl: "",
|
||||
permission: "",
|
||||
name: '',
|
||||
type: '3',
|
||||
opturl: '',
|
||||
permission: '',
|
||||
orderno: 1,
|
||||
isdisplay: "1",
|
||||
isdisplay: '1'
|
||||
});
|
||||
parentID.value = row.id;
|
||||
expertInfo.value = orgnamemage.value;
|
||||
dialogVisible.value = true;
|
||||
iconall.value = "";
|
||||
iconall.value = '';
|
||||
getid.value = row.id;
|
||||
}
|
||||
//新增目录-确认按钮
|
||||
function expertsubmit() {
|
||||
if (expertInfo.value.name == "") {
|
||||
if (expertInfo.value.name == '') {
|
||||
ElMessage({
|
||||
message: "请填写目录名称",
|
||||
type: "error",
|
||||
message: '请填写目录名称',
|
||||
type: 'error'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@ -135,116 +135,120 @@ function expertsubmit() {
|
||||
let params = {
|
||||
name: expertInfo.value.name,
|
||||
systemcode: systemcode.value,
|
||||
type: "0",
|
||||
parentid: "0",
|
||||
type: '0',
|
||||
parentid: '0',
|
||||
id: expertInfo.value.id,
|
||||
icon: iconall.value,
|
||||
opturl: expertInfo.value.opturl,
|
||||
isdisplay: expertInfo.value.isdisplay,
|
||||
isdisplay: expertInfo.value.isdisplay
|
||||
};
|
||||
editmenu(params).then(() => {
|
||||
gteTabledata();
|
||||
dialogVisible.value = false;
|
||||
ElMessage({
|
||||
message: "修改成功",
|
||||
type: "success",
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
});
|
||||
});
|
||||
} else if (title.value == "新增子目录") {
|
||||
} else if (title.value == '新增子目录') {
|
||||
let params = {
|
||||
name: expertInfo.value.name,
|
||||
systemcode: systemcode.value,
|
||||
type: "0",
|
||||
type: '0',
|
||||
opturl: expertInfo.value.opturl,
|
||||
isdisplay: expertInfo.value.isdisplay,
|
||||
parentid: parentID.value,
|
||||
icon: iconall.value,
|
||||
icon: iconall.value
|
||||
};
|
||||
addmenu(params).then(() => {
|
||||
gteTabledata();
|
||||
dialogVisible.value = false;
|
||||
ElMessage({
|
||||
message: "新建成功",
|
||||
type: "success",
|
||||
message: '新建成功',
|
||||
type: 'success'
|
||||
});
|
||||
});
|
||||
} else {
|
||||
let params = {
|
||||
name: expertInfo.value.name,
|
||||
systemcode: systemcode.value,
|
||||
type: "0",
|
||||
type: '0',
|
||||
opturl: expertInfo.value.opturl,
|
||||
isdisplay: expertInfo.value.isdisplay,
|
||||
parentid: "0",
|
||||
parentid: '0',
|
||||
id: expertInfo.value.id,
|
||||
icon: iconall.value,
|
||||
icon: iconall.value
|
||||
};
|
||||
addmenu(params).then(() => {
|
||||
gteTabledata();
|
||||
dialogVisible.value = false;
|
||||
ElMessage({
|
||||
message: "新建成功",
|
||||
type: "success",
|
||||
message: '新建成功',
|
||||
type: 'success'
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
//菜单目录
|
||||
const menurules = ref({
|
||||
name: [{ required: true, message: "请输入菜单名称", trigger: "blur" }],
|
||||
opturl: [{ required: true, message: "请输入操作URL", trigger: "blur" }],
|
||||
permission: [{ required: true, message: "请输入菜单权限标识", trigger: "blur" }],
|
||||
name: [{ required: true, message: '请输入菜单名称', trigger: 'blur' }],
|
||||
opturl: [{ required: true, message: '请输入操作URL', trigger: 'blur' }],
|
||||
permission: [
|
||||
{ required: true, message: '请输入菜单权限标识', trigger: 'blur' }
|
||||
]
|
||||
});
|
||||
const menuVisible = ref(false);
|
||||
const menutitle = ref("");
|
||||
const menutitle = ref('');
|
||||
//定义按钮弹窗数据
|
||||
const btnInfo: any = ref({
|
||||
name: " ",
|
||||
orderno: " ",
|
||||
islink: " ",
|
||||
opturl: " ",
|
||||
permission: " ",
|
||||
isdisplay: " ",
|
||||
icon: "",
|
||||
name: ' ',
|
||||
orderno: ' ',
|
||||
islink: ' ',
|
||||
opturl: ' ',
|
||||
permission: ' ',
|
||||
isdisplay: ' ',
|
||||
icon: ''
|
||||
});
|
||||
const btnVisible = ref(false);
|
||||
const btnrules = ref({
|
||||
name: [{ required: true, message: "请输入按钮名称", trigger: "blur" }],
|
||||
permission: [{ required: true, message: "请输入按钮权限标识", trigger: "blur" }],
|
||||
name: [{ required: true, message: '请输入按钮名称', trigger: 'blur' }],
|
||||
permission: [
|
||||
{ required: true, message: '请输入按钮权限标识', trigger: 'blur' }
|
||||
]
|
||||
});
|
||||
//定义菜单弹窗数据
|
||||
const menuInfo: any = ref({
|
||||
name: "",
|
||||
orderno: "",
|
||||
islink: "",
|
||||
opturl: "",
|
||||
permission: "",
|
||||
isdisplay: "",
|
||||
icon: "",
|
||||
name: '',
|
||||
orderno: '',
|
||||
islink: '',
|
||||
opturl: '',
|
||||
permission: '',
|
||||
isdisplay: '',
|
||||
icon: ''
|
||||
});
|
||||
//修改目录
|
||||
const btntitle = ref("");
|
||||
const getid = ref("");
|
||||
const allId = ref("");
|
||||
const btntitle = ref('');
|
||||
const getid = ref('');
|
||||
const allId = ref('');
|
||||
function handleEdit(row: any) {
|
||||
iconall.value = row.icon;
|
||||
const Row = JSON.parse(JSON.stringify(row));
|
||||
getid.value = row.id;
|
||||
btnparentid.value = row.parentid;
|
||||
if (row.type == "2") {
|
||||
btntitle.value = "修改按钮";
|
||||
if (row.type == '2') {
|
||||
btntitle.value = '修改按钮';
|
||||
let newInfo = ref({});
|
||||
newInfo.value = Row;
|
||||
btnInfo.value = newInfo.value;
|
||||
btnVisible.value = true;
|
||||
} else if (row.type == "1") {
|
||||
menutitle.value = "修改菜单";
|
||||
} else if (row.type == '1') {
|
||||
menutitle.value = '修改菜单';
|
||||
let newInfo = ref({});
|
||||
newInfo.value = Row;
|
||||
menuInfo.value = newInfo.value;
|
||||
menuVisible.value = true;
|
||||
} else {
|
||||
title.value = "修改目录";
|
||||
title.value = '修改目录';
|
||||
let newInfo = ref({});
|
||||
newInfo.value = Row;
|
||||
expertInfo.value = newInfo.value;
|
||||
@ -252,39 +256,39 @@ function handleEdit(row: any) {
|
||||
}
|
||||
}
|
||||
//新增菜单
|
||||
const btnparentid = ref("");
|
||||
const btnparentid = ref('');
|
||||
function menuclick(row: any) {
|
||||
if (row.id == undefined) {
|
||||
btnparentid.value = "0";
|
||||
btnparentid.value = '0';
|
||||
} else {
|
||||
btnparentid.value = row.id;
|
||||
}
|
||||
menutitle.value = "添加菜单";
|
||||
menutitle.value = '添加菜单';
|
||||
(menuInfo.value = {
|
||||
name: "",
|
||||
type: "1",
|
||||
islink: "0",
|
||||
opturl: "",
|
||||
permission: "",
|
||||
name: '',
|
||||
type: '1',
|
||||
islink: '0',
|
||||
opturl: '',
|
||||
permission: '',
|
||||
orderno: 1,
|
||||
isdisplay: "1",
|
||||
isdisplay: '1'
|
||||
}),
|
||||
(menuVisible.value = true);
|
||||
iconall.value = "";
|
||||
iconall.value = '';
|
||||
getid.value = row.id;
|
||||
}
|
||||
//添加按钮
|
||||
function btnclick(row: any) {
|
||||
getid.value = row.id;
|
||||
btntitle.value = "添加按钮";
|
||||
btntitle.value = '添加按钮';
|
||||
(btnInfo.value = {
|
||||
name: "",
|
||||
type: "2",
|
||||
islink: "0",
|
||||
opturl: "",
|
||||
permission: "",
|
||||
name: '',
|
||||
type: '2',
|
||||
islink: '0',
|
||||
opturl: '',
|
||||
permission: '',
|
||||
orderno: 1,
|
||||
isdisplay: "1",
|
||||
isdisplay: '1'
|
||||
}),
|
||||
(btnVisible.value = true);
|
||||
btnparentid.value = row.id;
|
||||
@ -292,36 +296,36 @@ function btnclick(row: any) {
|
||||
//删除
|
||||
function handleDelete(row: any) {
|
||||
const message = ref();
|
||||
if (row.type == "0") {
|
||||
message.value = "确定删除此目录及此目录下的所有菜单吗?";
|
||||
} else if (row.type == "1") {
|
||||
message.value = "确定删除此菜单及此菜单下的所有按钮吗?";
|
||||
} else if (row.type == "2") {
|
||||
message.value = "确定删除此按钮吗?";
|
||||
if (row.type == '0') {
|
||||
message.value = '确定删除此目录及此目录下的所有菜单吗?';
|
||||
} else if (row.type == '1') {
|
||||
message.value = '确定删除此菜单及此菜单下的所有按钮吗?';
|
||||
} else if (row.type == '2') {
|
||||
message.value = '确定删除此按钮吗?';
|
||||
}
|
||||
ElMessageBox.confirm(message.value, "删除提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
ElMessageBox.confirm(message.value, '删除提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const params = {
|
||||
id: row.id,
|
||||
id: row.id
|
||||
};
|
||||
deltmenu(params).then(() => {
|
||||
gteTabledata();
|
||||
ElMessage({
|
||||
message: "删除成功",
|
||||
type: "success",
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
//菜单目录-确定
|
||||
function menusubmit() {
|
||||
if (menuInfo.value.name == "") {
|
||||
if (menuInfo.value.name == '') {
|
||||
ElMessage({
|
||||
message: "请填写菜单名称",
|
||||
type: "error",
|
||||
message: '请填写菜单名称',
|
||||
type: 'error'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@ -329,41 +333,41 @@ function menusubmit() {
|
||||
let params = {
|
||||
name: menuInfo.value.name,
|
||||
systemcode: systemcode.value,
|
||||
type: "1",
|
||||
type: '1',
|
||||
opturl: menuInfo.value.opturl,
|
||||
permission: menuInfo.value.permission,
|
||||
islink: menuInfo.value.islink,
|
||||
isdisplay: menuInfo.value.isdisplay,
|
||||
// parentid: '',
|
||||
id: getid.value,
|
||||
icon: iconall.value,
|
||||
icon: iconall.value
|
||||
};
|
||||
editmenu(params).then(() => {
|
||||
gteTabledata();
|
||||
menuVisible.value = false;
|
||||
ElMessage({
|
||||
message: "修改成功",
|
||||
type: "success",
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
});
|
||||
});
|
||||
} else {
|
||||
let params = {
|
||||
name: menuInfo.value.name,
|
||||
systemcode: systemcode.value,
|
||||
type: "1",
|
||||
type: '1',
|
||||
opturl: menuInfo.value.opturl,
|
||||
islink: menuInfo.value.islink,
|
||||
isdisplay: menuInfo.value.isdisplay,
|
||||
parentid: btnparentid.value,
|
||||
id: expertInfo.value.id,
|
||||
icon: iconall.value,
|
||||
icon: iconall.value
|
||||
};
|
||||
addmenu(params).then(() => {
|
||||
gteTabledata();
|
||||
menuVisible.value = false;
|
||||
ElMessage({
|
||||
message: "新建成功",
|
||||
type: "success",
|
||||
message: '新建成功',
|
||||
type: 'success'
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -371,10 +375,10 @@ function menusubmit() {
|
||||
//按钮目录-确定
|
||||
|
||||
function btnsubmit() {
|
||||
if (btnInfo.value.name == "" || btnInfo.value.permission == "") {
|
||||
if (btnInfo.value.name == '' || btnInfo.value.permission == '') {
|
||||
ElMessage({
|
||||
message: "请填写按钮名称和权限标识",
|
||||
type: "error",
|
||||
message: '请填写按钮名称和权限标识',
|
||||
type: 'error'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@ -383,19 +387,19 @@ function btnsubmit() {
|
||||
code: btnInfo.value.code,
|
||||
name: btnInfo.value.name,
|
||||
systemcode: systemcode.value,
|
||||
type: "2",
|
||||
type: '2',
|
||||
opturl: btnInfo.value.opturl,
|
||||
permission: btnInfo.value.permission,
|
||||
islink: btnInfo.value.islink,
|
||||
// isdisplay: btnInfo.value.isdisplay,
|
||||
id: getid.value,
|
||||
id: getid.value
|
||||
};
|
||||
editmenu(params).then(() => {
|
||||
gteTabledata();
|
||||
dialogVisible.value = false;
|
||||
ElMessage({
|
||||
message: "修改成功",
|
||||
type: "success",
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
});
|
||||
btnVisible.value = false;
|
||||
});
|
||||
@ -403,19 +407,19 @@ function btnsubmit() {
|
||||
let params = {
|
||||
name: btnInfo.value.name,
|
||||
systemcode: systemcode.value,
|
||||
type: "2",
|
||||
type: '2',
|
||||
opturl: btnInfo.value.opturl,
|
||||
permission: btnInfo.value.permission,
|
||||
islink: btnInfo.value.islink,
|
||||
isdisplay: btnInfo.value.isdisplay,
|
||||
parentid: btnparentid.value,
|
||||
parentid: btnparentid.value
|
||||
};
|
||||
addmenu(params).then(() => {
|
||||
gteTabledata();
|
||||
dialogVisible.value = false;
|
||||
ElMessage({
|
||||
message: "新建成功",
|
||||
type: "success",
|
||||
message: '新建成功',
|
||||
type: 'success'
|
||||
});
|
||||
btnVisible.value = false;
|
||||
});
|
||||
@ -427,70 +431,88 @@ function dateFormat(row: any) {
|
||||
var date = new Date(daterc);
|
||||
var year = date.getFullYear();
|
||||
var month =
|
||||
date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
|
||||
date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
|
||||
var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
|
||||
var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
|
||||
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
|
||||
var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
|
||||
date.getMonth() + 1 < 10
|
||||
? '0' + (date.getMonth() + 1)
|
||||
: date.getMonth() + 1;
|
||||
date.getMonth() + 1 < 10
|
||||
? '0' + (date.getMonth() + 1)
|
||||
: date.getMonth() + 1;
|
||||
var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
|
||||
var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours();
|
||||
var minutes =
|
||||
date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
|
||||
var seconds =
|
||||
date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
|
||||
// 拼接
|
||||
return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
|
||||
return (
|
||||
year +
|
||||
'-' +
|
||||
month +
|
||||
'-' +
|
||||
day +
|
||||
' ' +
|
||||
hours +
|
||||
':' +
|
||||
minutes +
|
||||
':' +
|
||||
seconds
|
||||
);
|
||||
}
|
||||
}
|
||||
//上传图标
|
||||
function fileClick(val: any) {
|
||||
allId.value = val;
|
||||
const avatar = document.getElementById("avatar");
|
||||
const avatar = document.getElementById('avatar');
|
||||
avatar?.click();
|
||||
}
|
||||
const iconall = ref("");
|
||||
const iconall = ref('');
|
||||
function changeFile(e: any) {
|
||||
const files = new FormData();
|
||||
files.append("icon", e.target.files[0]);
|
||||
files.append("menuId", allId.value);
|
||||
files.append('icon', e.target.files[0]);
|
||||
files.append('menuId', allId.value);
|
||||
uploadIcon(files)
|
||||
.then((res) => {
|
||||
.then(res => {
|
||||
iconall.value = res.data;
|
||||
gteTabledata();
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "上传成功",
|
||||
type: 'success',
|
||||
message: '上传成功'
|
||||
});
|
||||
// location.reload()
|
||||
var file: any = document.getElementById("avatar");
|
||||
file.value = "";
|
||||
var file: any = document.getElementById('avatar');
|
||||
file.value = '';
|
||||
})
|
||||
.catch(() => {
|
||||
ElMessage({
|
||||
type: "error",
|
||||
message: "上传失败",
|
||||
type: 'error',
|
||||
message: '上传失败'
|
||||
});
|
||||
var file: any = document.getElementById("avatar");
|
||||
file.value = "";
|
||||
var file: any = document.getElementById('avatar');
|
||||
file.value = '';
|
||||
});
|
||||
}
|
||||
//图标删除事件
|
||||
function delectIcon(id: any) {
|
||||
ElMessageBox.confirm("确定删除此图标吗?", "删除提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
ElMessageBox.confirm('确定删除此图标吗?', '删除提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const params = {
|
||||
id: id,
|
||||
id: id
|
||||
};
|
||||
moveIcon(params).then(() => {
|
||||
iconall.value = "";
|
||||
iconall.value = '';
|
||||
gteTabledata();
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "删除成功",
|
||||
type: 'success',
|
||||
message: '删除成功'
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
// Icon选择器显示状态
|
||||
function treeToTile(treeData: any, childKey = "children") {
|
||||
function treeToTile(treeData: any, childKey = 'children') {
|
||||
const arr = [] as any[];
|
||||
const expanded = (data: any) => {
|
||||
if (data && data.length > 0) {
|
||||
@ -507,9 +529,11 @@ function treeToTile(treeData: any, childKey = "children") {
|
||||
}
|
||||
const activeRows: any = ref([]);
|
||||
function rowDrop() {
|
||||
const tbody = document.querySelector(".draggable .el-table__body-wrapper tbody");
|
||||
const tbody = document.querySelector(
|
||||
'.draggable .el-table__body-wrapper tbody'
|
||||
);
|
||||
Sortable.create(tbody, {
|
||||
draggable: ".draggable .el-table__row",
|
||||
draggable: '.draggable .el-table__row',
|
||||
onMove: () => {
|
||||
activeRows.value = treeToTile(tableData.value); // 把树形的结构转为列表再进行拖拽
|
||||
},
|
||||
@ -519,8 +543,8 @@ function rowDrop() {
|
||||
|
||||
if (oldRow.type != newRow.type) {
|
||||
ElMessage({
|
||||
message: "拖拽同级目录排序",
|
||||
type: "warning",
|
||||
message: '拖拽同级目录排序',
|
||||
type: 'warning'
|
||||
});
|
||||
tableData.value = [];
|
||||
gteTabledata();
|
||||
@ -528,22 +552,22 @@ function rowDrop() {
|
||||
}
|
||||
const params = {
|
||||
fromId: oldRow.id,
|
||||
toId: newRow.id,
|
||||
toId: newRow.id
|
||||
};
|
||||
moveOrderno(params).then((res: any) => {
|
||||
if (res.code == 1) {
|
||||
tableData.value = [];
|
||||
gteTabledata();
|
||||
ElMessage({
|
||||
type: "error",
|
||||
message: "修改失败",
|
||||
type: 'error',
|
||||
message: '修改失败'
|
||||
});
|
||||
} else {
|
||||
tableData.value = [];
|
||||
gteTabledata();
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
});
|
||||
}
|
||||
onMounted(() => {
|
||||
@ -561,10 +585,9 @@ onMounted(() => {
|
||||
mode="horizontal"
|
||||
@select="handleSelect"
|
||||
>
|
||||
<!-- <el-menu-item index="1">Web端</el-menu-item>
|
||||
<el-menu-item index="2">手机App</el-menu-item>
|
||||
<el-menu-item index="3">Pad端</el-menu-item> -->
|
||||
<el-menu-item index="4">数据填报</el-menu-item>
|
||||
<el-menu-item index="1">水电水利建设项目全过程环境管理信息平台</el-menu-item>
|
||||
<el-menu-item index="2">全过程数据管理子系统</el-menu-item>
|
||||
<el-menu-item index="4">填报管理子系统</el-menu-item>
|
||||
</el-menu>
|
||||
<div
|
||||
style="
|
||||
@ -615,10 +638,15 @@ onMounted(() => {
|
||||
:header-cell-style="{
|
||||
background: 'rgb(250 250 250)',
|
||||
color: '#383838',
|
||||
height: '50px',
|
||||
height: '50px'
|
||||
}"
|
||||
>
|
||||
<el-table-column label="菜单标题" width="250" prop="name" show-overflow-tooltip>
|
||||
<el-table-column
|
||||
label="菜单标题"
|
||||
width="250"
|
||||
prop="name"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="scope">
|
||||
<div style="position: absolute; left: 15px">
|
||||
<img src="@/assets/MenuIcon/lbcz_td.png" alt="" />
|
||||
@ -626,7 +654,12 @@ onMounted(() => {
|
||||
<div style="margin-left: 20px">{{ scope.row.name }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="菜单类型" width="100" align="center" prop="type">
|
||||
<el-table-column
|
||||
label="菜单类型"
|
||||
width="100"
|
||||
align="center"
|
||||
prop="type"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.type == '2'">按钮</span>
|
||||
<span v-else-if="scope.row.type == '1'">菜单</span>
|
||||
@ -639,12 +672,16 @@ onMounted(() => {
|
||||
width="100"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="系统类型" width="120" prop="systemcode" align="center">
|
||||
<el-table-column
|
||||
label="系统类型"
|
||||
width="170"
|
||||
prop="systemcode"
|
||||
align="center"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.systemcode == '1'">Web端</span>
|
||||
<span v-else-if="scope.row.systemcode == '2'">手机App</span>
|
||||
<span v-else-if="scope.row.systemcode == '3'">Pad端</span>
|
||||
<span v-else-if="scope.row.systemcode == '4'">数据填报</span>
|
||||
<span v-if="scope.row.systemcode == '1'">水电水利建设项目全过程环境管理信息平台</span>
|
||||
<span v-else-if="scope.row.systemcode == '2'">全过程数据管理子系统</span>
|
||||
<span v-else>填报管理子系统</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="图标" width="100" prop="icon" align="center">
|
||||
@ -706,15 +743,21 @@ onMounted(() => {
|
||||
@change="changeFile"
|
||||
/>
|
||||
</div>
|
||||
<img :src="url + '/menu/' + scope.row.icon" alt="">
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column label="是否外链" width="100" prop="islink" align="center">
|
||||
<el-table-column
|
||||
label="是否外链"
|
||||
width="100"
|
||||
prop="islink"
|
||||
align="center"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.islink == '1'">是</span>
|
||||
<span v-else>否</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作URL"
|
||||
min-width="100"
|
||||
@ -732,7 +775,12 @@ onMounted(() => {
|
||||
prop="permission"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="是否显示" width="100" prop="isdisplay" align="center">
|
||||
<el-table-column
|
||||
label="是否显示"
|
||||
width="100"
|
||||
prop="isdisplay"
|
||||
align="center"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.isdisplay == '1'">是</span>
|
||||
<span v-else>否</span>
|
||||
@ -743,7 +791,11 @@ onMounted(() => {
|
||||
label="最近修改者"
|
||||
width="120"
|
||||
></el-table-column>
|
||||
<el-table-column prop="lastmodifydate" label="最近修改日期" width="170">
|
||||
<el-table-column
|
||||
prop="lastmodifydate"
|
||||
label="最近修改日期"
|
||||
width="170"
|
||||
>
|
||||
<template #default="scope">
|
||||
{{ dateFormat(scope.row.lastmodifydate) }}
|
||||
</template>
|
||||
@ -866,7 +918,12 @@ onMounted(() => {
|
||||
width="620px"
|
||||
class="dialogClass"
|
||||
>
|
||||
<el-form ref="expertInfoRef" :model="expertInfo" :rules="rules" label-width="90px">
|
||||
<el-form
|
||||
ref="expertInfoRef"
|
||||
:model="expertInfo"
|
||||
:rules="rules"
|
||||
label-width="90px"
|
||||
>
|
||||
<el-form-item label="目录编号" prop="name">
|
||||
<el-input
|
||||
v-model="expertInfo.code"
|
||||
@ -913,7 +970,12 @@ onMounted(() => {
|
||||
width="620px"
|
||||
class="dialogClass"
|
||||
>
|
||||
<el-form ref="menuInfoRef" :model="menuInfo" :rules="menurules" label-width="90px">
|
||||
<el-form
|
||||
ref="menuInfoRef"
|
||||
:model="menuInfo"
|
||||
:rules="menurules"
|
||||
label-width="90px"
|
||||
>
|
||||
<el-form-item label="菜单编号">
|
||||
<el-input
|
||||
v-model="menuInfo.code"
|
||||
@ -923,15 +985,19 @@ onMounted(() => {
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单名称" prop="name">
|
||||
<el-input v-model="menuInfo.name" placeholder="" style="width: 100%"></el-input>
|
||||
<el-input
|
||||
v-model="menuInfo.name"
|
||||
placeholder=""
|
||||
style="width: 100%"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="是否外链" prop="islink">
|
||||
<el-form-item label="是否外链" prop="islink">
|
||||
<el-radio-group v-model="menuInfo.islink">
|
||||
<el-radio label="1">是</el-radio>
|
||||
<el-radio label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="操作URL" prop="opturl">
|
||||
<el-input
|
||||
v-model="menuInfo.opturl"
|
||||
@ -970,7 +1036,12 @@ onMounted(() => {
|
||||
class="dialogClass"
|
||||
draggable
|
||||
>
|
||||
<el-form ref="btnInfoRef" :model="btnInfo" :rules="btnrules" label-width="90px">
|
||||
<el-form
|
||||
ref="btnInfoRef"
|
||||
:model="btnInfo"
|
||||
:rules="btnrules"
|
||||
label-width="90px"
|
||||
>
|
||||
<el-form-item label="按钮编号">
|
||||
<el-input
|
||||
v-model="btnInfo.code"
|
||||
@ -980,7 +1051,11 @@ onMounted(() => {
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="按钮名称" prop="name">
|
||||
<el-input v-model="btnInfo.name" placeholder="" style="width: 100%"></el-input>
|
||||
<el-input
|
||||
v-model="btnInfo.name"
|
||||
placeholder=""
|
||||
style="width: 100%"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="权限标识" prop="permission">
|
||||
<el-input
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "record",
|
||||
name: 'record'
|
||||
};
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { getLogList, exportExcel } from "@/api/record";
|
||||
import { downloadFile } from "@/utils/index";
|
||||
import Page from "@/components/Pagination/page.vue";
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { getLogList, exportExcel } from '@/api/record';
|
||||
import { downloadFile } from '@/utils/index';
|
||||
import Page from '@/components/Pagination/page.vue';
|
||||
// import { VueDevToolsTimelineColors } from "@intlify/vue-devtools";
|
||||
|
||||
//定义表格数据
|
||||
@ -18,7 +18,7 @@ const tableData: any = ref([]);
|
||||
const queryParams = ref({
|
||||
current: 1,
|
||||
size: 20,
|
||||
opttype: "",
|
||||
opttype: ''
|
||||
});
|
||||
// 日期查询
|
||||
const operationTime: any = ref();
|
||||
@ -26,12 +26,12 @@ const operationTime: any = ref();
|
||||
const total = ref(0);
|
||||
// 日志类型
|
||||
const type: any = ref([
|
||||
{ name: "登录(login)", value: "00" },
|
||||
{ name: "添加(insert)", value: "01" },
|
||||
{ name: "修改(update)", value: "02" },
|
||||
{ name: "删除(delete)", value: "03" },
|
||||
{ name: "查询(select)", value: "04" },
|
||||
{ name: "其他(other)", value: "05" },
|
||||
{ name: '登录(login)', value: '00' },
|
||||
{ name: '添加(insert)', value: '01' },
|
||||
{ name: '修改(update)', value: '02' },
|
||||
{ name: '删除(delete)', value: '03' },
|
||||
{ name: '查询(select)', value: '04' },
|
||||
{ name: '其他(other)', value: '05' }
|
||||
]);
|
||||
// 表格加载
|
||||
const loading = ref(false);
|
||||
@ -43,8 +43,8 @@ function init() {
|
||||
optType: queryParams.value.opttype,
|
||||
current: queryParams.value.current,
|
||||
size: queryParams.value.size,
|
||||
startDate: "",
|
||||
endDate: "",
|
||||
startDate: '',
|
||||
endDate: ''
|
||||
};
|
||||
if (operationTime.value != null) {
|
||||
params.startDate = operationTime.value[0];
|
||||
@ -71,14 +71,32 @@ function dateFormat(row: any) {
|
||||
var date = new Date(daterc);
|
||||
var year = date.getFullYear();
|
||||
var month =
|
||||
date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
|
||||
date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
|
||||
var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
|
||||
var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
|
||||
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
|
||||
var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
|
||||
date.getMonth() + 1 < 10
|
||||
? '0' + (date.getMonth() + 1)
|
||||
: date.getMonth() + 1;
|
||||
date.getMonth() + 1 < 10
|
||||
? '0' + (date.getMonth() + 1)
|
||||
: date.getMonth() + 1;
|
||||
var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
|
||||
var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours();
|
||||
var minutes =
|
||||
date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
|
||||
var seconds =
|
||||
date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
|
||||
// 拼接
|
||||
return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
|
||||
return (
|
||||
year +
|
||||
'-' +
|
||||
month +
|
||||
'-' +
|
||||
day +
|
||||
' ' +
|
||||
hours +
|
||||
':' +
|
||||
minutes +
|
||||
':' +
|
||||
seconds
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,15 +106,15 @@ function leadingOut() {
|
||||
optType: queryParams.value.opttype,
|
||||
current: queryParams.value.current,
|
||||
size: queryParams.value.size,
|
||||
startDate: "",
|
||||
endDate: "",
|
||||
startDate: '',
|
||||
endDate: ''
|
||||
};
|
||||
if (operationTime.value != null) {
|
||||
params.startDate = operationTime.value[0];
|
||||
params.endDate = operationTime.value[1];
|
||||
}
|
||||
exportExcel(params).then((response: any) => {
|
||||
downloadFile(response, "日志", "xlsx");
|
||||
downloadFile(response, '日志', 'xlsx');
|
||||
});
|
||||
}
|
||||
//分页
|
||||
@ -158,7 +176,9 @@ function handleClose() {
|
||||
@change="init"
|
||||
/>
|
||||
</div>
|
||||
<el-button type="primary" style="margin-left: 10px" @click="init">搜索</el-button>
|
||||
<el-button type="primary" style="margin-left: 10px" @click="init"
|
||||
>搜索</el-button
|
||||
>
|
||||
<div
|
||||
style="
|
||||
width: 100%;
|
||||
@ -190,17 +210,37 @@ function handleClose() {
|
||||
width="70"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column prop="usercode" label="操作账户" width="100"></el-table-column>
|
||||
<el-table-column prop="username" label="用户姓名" width="180"></el-table-column>
|
||||
<el-table-column prop="requestip" label="IP地址" width="140"></el-table-column>
|
||||
<el-table-column prop="browser" label="浏览器" width="130"></el-table-column>
|
||||
<el-table-column
|
||||
prop="usercode"
|
||||
label="操作账户"
|
||||
width="100"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="username"
|
||||
label="用户姓名"
|
||||
width="180"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="requestip"
|
||||
label="IP地址"
|
||||
width="140"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="browser"
|
||||
label="浏览器"
|
||||
width="130"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="opttype"
|
||||
label="日志类型"
|
||||
width="130"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column prop="module" label="模块名称" width="170"></el-table-column>
|
||||
<el-table-column
|
||||
prop="module"
|
||||
label="模块名称"
|
||||
width="170"
|
||||
></el-table-column>
|
||||
<el-table-column prop="description" label="日志描述" min-width="100">
|
||||
<template #default="scope">
|
||||
<div
|
||||
@ -248,6 +288,7 @@ function handleClose() {
|
||||
top="30px"
|
||||
draggable
|
||||
:destroy-on-close="false"
|
||||
style="pointer-events: all"
|
||||
>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
@ -262,8 +303,16 @@ function handleClose() {
|
||||
width="70"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column prop="username" label="用户姓名" width="110"></el-table-column>
|
||||
<el-table-column prop="module" label="模块名称" width="120"></el-table-column>
|
||||
<el-table-column
|
||||
prop="username"
|
||||
label="用户姓名"
|
||||
width="110"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="module"
|
||||
label="模块名称"
|
||||
width="120"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="description"
|
||||
label="日志描述"
|
||||
|
||||
@ -9,7 +9,7 @@ import { ref, onMounted, nextTick, watch } from "vue";
|
||||
import {
|
||||
queryPendingAuditUsers,
|
||||
deltableData,
|
||||
getRole,
|
||||
listGroupedByTenant,
|
||||
addUsers,
|
||||
updataUser,
|
||||
setpass,
|
||||
@ -660,7 +660,7 @@ function getrole() {
|
||||
const params = {
|
||||
rolename: "",
|
||||
};
|
||||
getRole(params).then((res) => {
|
||||
listGroupedByTenant(params).then((res) => {
|
||||
rolesdata.value = res;
|
||||
});
|
||||
}
|
||||
@ -1202,14 +1202,26 @@ function handleClearSelection() {
|
||||
placeholder="请输入登录账号"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属角色">
|
||||
<el-select v-model="info.roleinfo" placeholder=" " style="width: 100%" multiple>
|
||||
<el-option
|
||||
v-for="item in rolesdata"
|
||||
:key="item.id"
|
||||
:label="item.rolename"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-form-item label="所属角色">
|
||||
<el-select
|
||||
v-model="info.roleinfo"
|
||||
placeholder=" "
|
||||
style="width: 100%"
|
||||
multiple
|
||||
filterable
|
||||
>
|
||||
<el-option-group
|
||||
v-for="group in rolesdata"
|
||||
:key="group.tenantName"
|
||||
:label="group.tenantName"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in group.roles"
|
||||
:key="item.id"
|
||||
:label="item.rolename"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-option-group>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -1526,4 +1538,7 @@ function handleClearSelection() {
|
||||
.el-message-box {
|
||||
width: 300px !important;
|
||||
}
|
||||
:deep(.el-select-group__title){
|
||||
font-size: 16px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -18,6 +18,7 @@ import {
|
||||
setOrgscope,
|
||||
postOrgscope
|
||||
} from '@/api/role';
|
||||
import { getDictItemsByCode } from '@/api/dict';
|
||||
//定义表格数据
|
||||
const tableData: any = ref([]);
|
||||
const multipleSelection = ref([]);
|
||||
@ -29,7 +30,7 @@ const loading = ref(false);
|
||||
function gettableData() {
|
||||
let params = {
|
||||
rolename: input.value,
|
||||
tenantId: '4'
|
||||
tenantId:tenValue.value,
|
||||
};
|
||||
loading.value = true;
|
||||
listRolePages(params)
|
||||
@ -117,7 +118,7 @@ function confirmClick(formEl: any) {
|
||||
rolename: info.value.rolename,
|
||||
level: info.value.level,
|
||||
description: info.value.description,
|
||||
tenantId: '4'
|
||||
tenantId:tenValue.value
|
||||
};
|
||||
addDept(params).then(() => {
|
||||
gettableData();
|
||||
@ -129,7 +130,7 @@ function confirmClick(formEl: any) {
|
||||
level: info.value.level,
|
||||
description: info.value.description,
|
||||
id: info.value.id,
|
||||
tenantId: '4'
|
||||
tenantId:tenValue.value
|
||||
};
|
||||
renewDept(params).then(() => {
|
||||
gettableData();
|
||||
@ -278,7 +279,7 @@ function assignment(row: any) {
|
||||
accessVisible.value = true;
|
||||
const params = {
|
||||
roleId: rowid.value,
|
||||
tenantId: '4'
|
||||
tenantId:tenValue.value
|
||||
};
|
||||
permissionAssignmentGrouped(params).then((res: any) => {
|
||||
accessdata.value = res[0]?.menus || [];
|
||||
@ -368,9 +369,13 @@ function dateFormat(row: any) {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
let tenValue = ref('1')
|
||||
let tenOption = ref([])
|
||||
onMounted(() => {
|
||||
gettableData();
|
||||
getDictItemsByCode({ dictCode: 'PLATFORM_TENANT' }).then(res => {
|
||||
tenOption.value = res.data;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -394,6 +399,15 @@ onMounted(() => {
|
||||
style="width: 200px"
|
||||
clearable
|
||||
/>
|
||||
<el-select v-model="tenValue" placeholder=" " style="width: 320px;margin-left: 10px">
|
||||
<el-option
|
||||
v-for="item in tenOption"
|
||||
:key="item.itemCode"
|
||||
:label="item.dictName"
|
||||
:value="item.itemCode"
|
||||
/>
|
||||
<!-- PLATFORM_TENANT -->
|
||||
</el-select>
|
||||
<el-button
|
||||
type="primary"
|
||||
style="margin-left: 10px"
|
||||
|
||||
@ -11,7 +11,7 @@ import {
|
||||
gettableData,
|
||||
DataStatus,
|
||||
deltableData,
|
||||
getRole,
|
||||
listGroupedByTenant,
|
||||
addUsers,
|
||||
updataUser,
|
||||
setpass,
|
||||
@ -786,7 +786,7 @@ function getrole() {
|
||||
const params = {
|
||||
rolename: ''
|
||||
};
|
||||
getRole(params).then(res => {
|
||||
listGroupedByTenant(params).then(res => {
|
||||
rolesdata.value = res;
|
||||
});
|
||||
}
|
||||
@ -1250,19 +1250,26 @@ function handleClearSelection() {
|
||||
placeholder="请输入登录账号"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属角色">
|
||||
<el-form-item label="所属角色">
|
||||
<el-select
|
||||
v-model="info.roleinfo"
|
||||
placeholder=" "
|
||||
placeholder=" "
|
||||
style="width: 100%"
|
||||
multiple
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in rolesdata"
|
||||
:key="item.id"
|
||||
:label="item.rolename"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-option-group
|
||||
v-for="group in rolesdata"
|
||||
:key="group.tenantName"
|
||||
:label="group.tenantName"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in group.roles"
|
||||
:key="item.id"
|
||||
:label="item.rolename"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-option-group>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -1565,4 +1572,7 @@ function handleClearSelection() {
|
||||
.el-message-box {
|
||||
width: 300px !important;
|
||||
}
|
||||
:deep(.el-select-group__title){
|
||||
font-size: 16px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -57,6 +57,14 @@ export function getRole (queryParams:any) {
|
||||
params: queryParams
|
||||
});
|
||||
}
|
||||
//获取角色
|
||||
export function listGroupedByTenant (queryParams:any) {
|
||||
return request({
|
||||
url: '/system/role/listGroupedByTenant',
|
||||
method: 'POST',
|
||||
data: queryParams
|
||||
});
|
||||
}
|
||||
//新建用户
|
||||
export function addUsers (queryParams:any,roleids:any) {
|
||||
return request({
|
||||
|
||||
@ -287,20 +287,18 @@ const handleResize = () => {
|
||||
|
||||
const init = async () => {
|
||||
if (loading.value) return; // 防止重复请求
|
||||
|
||||
loading.value = true;
|
||||
|
||||
try {
|
||||
const params = {
|
||||
filter: {
|
||||
logic: 'and',
|
||||
filters: [
|
||||
{
|
||||
select.value.value != 'all' ? {
|
||||
field: 'baseId',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: select.value.value
|
||||
},
|
||||
}:null,
|
||||
{
|
||||
field: 'tm',
|
||||
operator: 'gte',
|
||||
@ -313,7 +311,7 @@ const init = async () => {
|
||||
dataType: 'date',
|
||||
value: paramsOne.tm[0]
|
||||
}
|
||||
]
|
||||
].filter(Boolean)
|
||||
},
|
||||
sort: [{ field: 'sort', dir: 'asc' }]
|
||||
};
|
||||
@ -376,6 +374,7 @@ const init = async () => {
|
||||
};
|
||||
//监听子组件的数据变化
|
||||
const handlePanelChange1 = data => {
|
||||
|
||||
console.log('当前所有控件状态:', data);
|
||||
if (data.moreSelect) {
|
||||
select.value.value = data.moreSelect;
|
||||
@ -431,7 +430,7 @@ watch(
|
||||
newVal => {
|
||||
// if (newVal.baseId) {
|
||||
select.value.value = newVal.wbsCode;
|
||||
init();
|
||||
// init();
|
||||
// }
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
@ -455,7 +454,7 @@ watch(
|
||||
// 页面加载时执行的逻辑
|
||||
onMounted(() => {
|
||||
// 延迟初始化,确保 DOM 渲染完成
|
||||
init();
|
||||
// init();
|
||||
window.addEventListener('resize', handleResize);
|
||||
});
|
||||
|
||||
|
||||
@ -248,6 +248,7 @@ function handleClose() {
|
||||
top="30px"
|
||||
draggable
|
||||
:destroy-on-close="false"
|
||||
style="pointer-events: all;"
|
||||
>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "review",
|
||||
name: 'review'
|
||||
};
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, nextTick, watch } from "vue";
|
||||
import { ref, onMounted, nextTick, watch } from 'vue';
|
||||
import {
|
||||
queryPendingAuditUsers,
|
||||
deltableData,
|
||||
getRole,
|
||||
listGroupedByTenant,
|
||||
addUsers,
|
||||
updataUser,
|
||||
setpass,
|
||||
@ -17,20 +17,20 @@ import {
|
||||
getFishtree,
|
||||
saveFishqvan,
|
||||
getuserdata,
|
||||
auditUser,
|
||||
} from "@/api/user";
|
||||
import { getDictItemsByCode } from "@/api/dict";
|
||||
import { ElMessageBox, ElMessage } from "element-plus";
|
||||
import Page from "@/components/Pagination/page.vue";
|
||||
import { Search } from "@element-plus/icons-vue";
|
||||
auditUser
|
||||
} from '@/api/user';
|
||||
import { getDictItemsByCode } from '@/api/dict';
|
||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||
import Page from '@/components/Pagination/page.vue';
|
||||
import { Search } from '@element-plus/icons-vue';
|
||||
// 表格加载
|
||||
const loading = ref(false);
|
||||
// 搜索框
|
||||
const queryParams = ref({
|
||||
current: 1,
|
||||
size: 10,
|
||||
querystr: "",
|
||||
regStatus: "",
|
||||
querystr: '',
|
||||
regStatus: ''
|
||||
});
|
||||
//分页 总条数
|
||||
const total = ref();
|
||||
@ -39,25 +39,25 @@ const infoForm = ref();
|
||||
|
||||
//新建
|
||||
const dialogVisible = ref(false);
|
||||
const title = ref("");
|
||||
const title = ref('');
|
||||
function addClick() {
|
||||
title.value = "新增用户";
|
||||
title.value = '新增用户';
|
||||
dialogVisible.value = true;
|
||||
info.value = {
|
||||
id: "",
|
||||
username: "",
|
||||
nickname: "",
|
||||
email: "",
|
||||
phone: "",
|
||||
belongingUnit: "",
|
||||
roleinfo: [],
|
||||
id: '',
|
||||
username: '',
|
||||
nickname: '',
|
||||
email: '',
|
||||
phone: '',
|
||||
belongingUnit: '',
|
||||
roleinfo: []
|
||||
};
|
||||
getrole();
|
||||
}
|
||||
//用户列表
|
||||
const multipleSelection = ref([]);
|
||||
const tableData = ref([]);
|
||||
const orgId = ref("");
|
||||
const orgId = ref('');
|
||||
//获取用户列表信息
|
||||
function getdata() {
|
||||
const params = {
|
||||
@ -65,11 +65,11 @@ function getdata() {
|
||||
size: queryParams.value.size,
|
||||
// orgid: orgId.value,
|
||||
name: queryParams.value.querystr,
|
||||
regStatus: queryParams.value.regStatus,
|
||||
regStatus: queryParams.value.regStatus
|
||||
};
|
||||
loading.value = true;
|
||||
queryPendingAuditUsers(params)
|
||||
.then((res) => {
|
||||
.then(res => {
|
||||
total.value = res.data.total;
|
||||
tableData.value = res.data.records;
|
||||
queryParams.value.size = res.data.size;
|
||||
@ -83,13 +83,13 @@ function getdata() {
|
||||
|
||||
//新建用户弹窗
|
||||
const info = ref({
|
||||
id: "",
|
||||
username: "",
|
||||
nickname: "",
|
||||
email: "",
|
||||
phone: "",
|
||||
belongingUnit: "",
|
||||
roleinfo: [] as any[],
|
||||
id: '',
|
||||
username: '',
|
||||
nickname: '',
|
||||
email: '',
|
||||
phone: '',
|
||||
belongingUnit: '',
|
||||
roleinfo: [] as any[]
|
||||
});
|
||||
//修改-用户
|
||||
function editdepartment(row: any) {
|
||||
@ -103,7 +103,7 @@ function editdepartment(row: any) {
|
||||
info.value = JSON.parse(JSON.stringify(row));
|
||||
info.value.roleinfo = selectID;
|
||||
rolesdata.value = row.roles;
|
||||
title.value = "修改用户";
|
||||
title.value = '修改用户';
|
||||
dialogVisible.value = true;
|
||||
getrole();
|
||||
}
|
||||
@ -120,15 +120,15 @@ function confirmClick(formEl: any) {
|
||||
nickname: info.value.nickname,
|
||||
email: info.value.email,
|
||||
phone: info.value.phone,
|
||||
belongingUnit: info.value.belongingUnit,
|
||||
belongingUnit: info.value.belongingUnit
|
||||
};
|
||||
const roleids = String(info.value.roleinfo);
|
||||
updataUser(params, roleids).then(() => {
|
||||
getdata();
|
||||
dialogVisible.value = false;
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "修改成功",
|
||||
type: 'success',
|
||||
message: '修改成功'
|
||||
});
|
||||
});
|
||||
} else {
|
||||
@ -138,15 +138,15 @@ function confirmClick(formEl: any) {
|
||||
email: info.value.email,
|
||||
phone: info.value.phone,
|
||||
belongingUnit: info.value.belongingUnit,
|
||||
orgid: orgId.value,
|
||||
orgid: orgId.value
|
||||
};
|
||||
const roleids = info.value.roleinfo;
|
||||
addUsers(params, roleids).then((res) => {
|
||||
addUsers(params, roleids).then(res => {
|
||||
getdata();
|
||||
dialogVisible.value = false;
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: res.data.msg,
|
||||
type: 'success',
|
||||
message: res.data.msg
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -155,8 +155,8 @@ function confirmClick(formEl: any) {
|
||||
}
|
||||
//用户弹窗规则定义
|
||||
const moderules = ref({
|
||||
username: [{ required: true, message: "请输入用户账号", trigger: "blur" }],
|
||||
nickname: [{ required: true, message: "请输入用户名称", trigger: "blur" }],
|
||||
username: [{ required: true, message: '请输入用户账号', trigger: 'blur' }],
|
||||
nickname: [{ required: true, message: '请输入用户名称', trigger: 'blur' }]
|
||||
});
|
||||
|
||||
//弹窗关闭
|
||||
@ -166,17 +166,17 @@ function handleClose() {
|
||||
}
|
||||
|
||||
//重置密码
|
||||
const userid = ref("");
|
||||
const userid = ref('');
|
||||
const resultPawss = ref(false);
|
||||
const msgText = ref("");
|
||||
const msgText = ref('');
|
||||
function setpassword(row: any) {
|
||||
ElMessageBox.confirm("确定要重置此账号密码吗?", "重置密码", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
ElMessageBox.confirm('确定要重置此账号密码吗?', '重置密码', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const params = {
|
||||
id: userid.value,
|
||||
id: userid.value
|
||||
};
|
||||
setpass(params).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
@ -196,7 +196,7 @@ function closeResult() {
|
||||
}
|
||||
//过去设施权限维护
|
||||
const fishway = ref(false);
|
||||
const userId = ref("");
|
||||
const userId = ref('');
|
||||
// 回显的权限ID数组
|
||||
const fishhui = ref<any[]>([]);
|
||||
const fishTreeDialog = ref(false);
|
||||
@ -207,7 +207,7 @@ const isFishDataLoaded = ref(false);
|
||||
async function openFishway(row: any) {
|
||||
fishway.value = true;
|
||||
userId.value = row.id;
|
||||
treeInput.value = "";
|
||||
treeInput.value = '';
|
||||
// 重置状态
|
||||
fishhui.value = [];
|
||||
tableDatafish.value = [];
|
||||
@ -218,7 +218,7 @@ async function openFishway(row: any) {
|
||||
await Promise.all([
|
||||
getFishTree(), // 获取树形数据
|
||||
getuserdata({ userId: userId.value }).then((res: any) => {
|
||||
console.log("用户权限数据:", res);
|
||||
console.log('用户权限数据:', res);
|
||||
if (res.code == 0) {
|
||||
res.data.forEach((item: any) => {
|
||||
fishhui.value.push(item.orgId);
|
||||
@ -231,19 +231,19 @@ async function openFishway(row: any) {
|
||||
userId: item.userId,
|
||||
parentId: item.parentId,
|
||||
orgLevel: item.orgLevel,
|
||||
permissionType: item.permissionType,
|
||||
permissionType: item.permissionType
|
||||
});
|
||||
});
|
||||
}
|
||||
}),
|
||||
})
|
||||
]);
|
||||
|
||||
// 两个请求都完成后,标记数据已加载
|
||||
isFishDataLoaded.value = true;
|
||||
console.log("所有数据加载完成,准备回显");
|
||||
console.log('所有数据加载完成,准备回显');
|
||||
} catch (error) {
|
||||
console.error("加载数据失败:", error);
|
||||
ElMessage.error("加载数据失败,请重试");
|
||||
console.error('加载数据失败:', error);
|
||||
ElMessage.error('加载数据失败,请重试');
|
||||
}
|
||||
}
|
||||
|
||||
@ -251,9 +251,9 @@ async function openFishway(row: any) {
|
||||
watch([fishway, isFishDataLoaded], ([newFishway, newDataLoaded]) => {
|
||||
if (newFishway && newDataLoaded) {
|
||||
// 确保两个数据都已加载完成后再执行回显
|
||||
console.log("开始回显, fishTreeRef:", fishTreeRef.value);
|
||||
console.log("回显ID:", fishhui.value);
|
||||
console.log("树数据:", fishData.value);
|
||||
console.log('开始回显, fishTreeRef:', fishTreeRef.value);
|
||||
console.log('回显ID:', fishhui.value);
|
||||
console.log('树数据:', fishData.value);
|
||||
|
||||
// 使用 nextTick 确保 DOM 已更新
|
||||
nextTick(() => {
|
||||
@ -270,7 +270,7 @@ watch([fishway, isFishDataLoaded], ([newFishway, newDataLoaded]) => {
|
||||
fishhui.value,
|
||||
fishData.value
|
||||
);
|
||||
console.log("需要展开的父节点codes:", parentCodesToExpand);
|
||||
console.log('需要展开的父节点codes:', parentCodesToExpand);
|
||||
|
||||
// 控制展开/折叠状态
|
||||
setTreeExpandState(parentCodesToExpand);
|
||||
@ -278,8 +278,8 @@ watch([fishway, isFishDataLoaded], ([newFishway, newDataLoaded]) => {
|
||||
// 验证回显结果
|
||||
const checkedKeys = fishTreeRef.value.getCheckedKeys();
|
||||
const halfCheckedKeys = fishTreeRef.value.getHalfCheckedKeys();
|
||||
console.log("回显完成 - 全选节点:", checkedKeys);
|
||||
console.log("回显完成 - 半选节点:", halfCheckedKeys);
|
||||
console.log('回显完成 - 全选节点:', checkedKeys);
|
||||
console.log('回显完成 - 半选节点:', halfCheckedKeys);
|
||||
|
||||
// 同步表格数据
|
||||
fishTableData.value = tableDatafish.value;
|
||||
@ -294,7 +294,7 @@ watch([fishway, isFishDataLoaded], ([newFishway, newDataLoaded]) => {
|
||||
});
|
||||
} else if (!newFishway) {
|
||||
// 关闭时清空回显数据
|
||||
console.log("关闭对话框,清理数据");
|
||||
console.log('关闭对话框,清理数据');
|
||||
fishhui.value = [];
|
||||
isFishDataLoaded.value = false;
|
||||
// 清除tree选中状态
|
||||
@ -314,12 +314,12 @@ function fishHandleClose() {
|
||||
fishData.value = [];
|
||||
}
|
||||
//获取过鱼设施权限
|
||||
const treeInput = ref("");
|
||||
const treeInput = ref('');
|
||||
const fishProps = {
|
||||
children: "children",
|
||||
label: "name",
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
};
|
||||
watch(treeInput, (val) => {
|
||||
watch(treeInput, val => {
|
||||
fishTreeRef.value!.filter(val);
|
||||
});
|
||||
function filterNode(value: string, data: any) {
|
||||
@ -364,13 +364,16 @@ function getAllChildrenIds(node: any): number[] {
|
||||
}
|
||||
|
||||
// 过鱼设施权限维护 - 检查父节点下所有子节点是否都被选中
|
||||
function areAllChildrenChecked(parentNode: any, checkedKeysArray: any[]): boolean {
|
||||
function areAllChildrenChecked(
|
||||
parentNode: any,
|
||||
checkedKeysArray: any[]
|
||||
): boolean {
|
||||
const allChildrenIds = getAllChildrenIds(parentNode);
|
||||
if (allChildrenIds.length === 0) {
|
||||
return false;
|
||||
}
|
||||
// 检查所有子节点ID是否都在已选中的keys中
|
||||
return allChildrenIds.every((code) => checkedKeysArray.includes(code));
|
||||
return allChildrenIds.every(code => checkedKeysArray.includes(code));
|
||||
}
|
||||
|
||||
// 过鱼设施权限维护 - 检查节点是否被其他父节点包含
|
||||
@ -394,7 +397,10 @@ function isNodeContainedByOtherParent(
|
||||
}
|
||||
|
||||
// 统一处理选中IDs的过滤逻辑:如果父节点的所有子节点都被选中,只保留父节点ID
|
||||
function filterSelectedIds(checkedKeysArray: number[], allCheckedNodes: any[]): number[] {
|
||||
function filterSelectedIds(
|
||||
checkedKeysArray: number[],
|
||||
allCheckedNodes: any[]
|
||||
): number[] {
|
||||
const resultIds: number[] = [];
|
||||
const fullySelectedParentIds: number[] = [];
|
||||
const filteredNodeIds = new Set<number>();
|
||||
@ -405,7 +411,7 @@ function filterSelectedIds(checkedKeysArray: number[], allCheckedNodes: any[]):
|
||||
if (areAllChildrenChecked(node, checkedKeysArray)) {
|
||||
fullySelectedParentIds.push(node.code);
|
||||
const childrenIds = getAllChildrenIds(node);
|
||||
childrenIds.forEach((childId) => {
|
||||
childrenIds.forEach(childId => {
|
||||
filteredNodeIds.add(childId);
|
||||
});
|
||||
}
|
||||
@ -414,9 +420,13 @@ function filterSelectedIds(checkedKeysArray: number[], allCheckedNodes: any[]):
|
||||
|
||||
// 第二阶段:添加结果
|
||||
// 1. 先添加所有"全选"的父节点(但要排除被其他父节点包含的)
|
||||
fullySelectedParentIds.forEach((parentId) => {
|
||||
fullySelectedParentIds.forEach(parentId => {
|
||||
if (
|
||||
!isNodeContainedByOtherParent(parentId, fullySelectedParentIds, allCheckedNodes)
|
||||
!isNodeContainedByOtherParent(
|
||||
parentId,
|
||||
fullySelectedParentIds,
|
||||
allCheckedNodes
|
||||
)
|
||||
) {
|
||||
resultIds.push(parentId);
|
||||
}
|
||||
@ -426,14 +436,18 @@ function filterSelectedIds(checkedKeysArray: number[], allCheckedNodes: any[]):
|
||||
allCheckedNodes.forEach((node: any) => {
|
||||
if (!filteredNodeIds.has(node.code) && !resultIds.includes(node.code)) {
|
||||
if (
|
||||
!isNodeContainedByOtherParent(node.code, fullySelectedParentIds, allCheckedNodes)
|
||||
!isNodeContainedByOtherParent(
|
||||
node.code,
|
||||
fullySelectedParentIds,
|
||||
allCheckedNodes
|
||||
)
|
||||
) {
|
||||
resultIds.push(node.code);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
console.log("过滤后的IDs:", resultIds);
|
||||
console.log('过滤后的IDs:', resultIds);
|
||||
return resultIds;
|
||||
}
|
||||
|
||||
@ -491,7 +505,7 @@ function handleFishCheckChange(checkedNode: any, checkedInfo: any) {
|
||||
// 使用统一的过滤逻辑处理IDs
|
||||
const resultIds = filterSelectedIds(checkedKeysArray, allCheckedNodes);
|
||||
|
||||
console.log("最终获取的IDs:", resultIds);
|
||||
console.log('最终获取的IDs:', resultIds);
|
||||
|
||||
// 更新表格数据
|
||||
getFishTableData(resultIds);
|
||||
@ -519,7 +533,7 @@ function getFishTableData(ids: any[]) {
|
||||
userId: userId.value,
|
||||
parentId: node.parentId,
|
||||
orgLevel: node.orgLevel,
|
||||
permissionType: "READ", // 默认选择读权限
|
||||
permissionType: 'READ' // 默认选择读权限
|
||||
});
|
||||
}
|
||||
|
||||
@ -537,16 +551,16 @@ function getFishTableData(ids: any[]) {
|
||||
const tableids: any = ref([]);
|
||||
//选中的过鱼权限
|
||||
function fishDataHandleSelectionChange(val: any) {
|
||||
console.log("选中的行数据:", val);
|
||||
console.log('选中的行数据:', val);
|
||||
fishTableSelection.value = val;
|
||||
}
|
||||
|
||||
//移除权限
|
||||
function delFishTable() {
|
||||
ElMessageBox.confirm("确定移除选中权限吗?", "删除提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
ElMessageBox.confirm('确定移除选中权限吗?', '删除提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
// 获取选中的ID数组
|
||||
@ -579,8 +593,8 @@ function delFishTable() {
|
||||
}
|
||||
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "删除成功",
|
||||
type: 'success',
|
||||
message: '删除成功'
|
||||
});
|
||||
|
||||
// 清空选中状态
|
||||
@ -622,34 +636,36 @@ function fishSure() {
|
||||
parentId: item.parentId,
|
||||
orgLevel: item.orgLevel,
|
||||
path: item.path,
|
||||
permissionType: item.permissionType,
|
||||
permissionType: item.permissionType
|
||||
});
|
||||
});
|
||||
saveFishqvan({ userId: userId.value, dataScopeList: params }).then((res: any) => {
|
||||
console.log(res);
|
||||
if (res.code == 0) {
|
||||
ElMessage({
|
||||
message: "保存成功",
|
||||
type: "success",
|
||||
});
|
||||
fishHandleClose();
|
||||
saveFishqvan({ userId: userId.value, dataScopeList: params }).then(
|
||||
(res: any) => {
|
||||
console.log(res);
|
||||
if (res.code == 0) {
|
||||
ElMessage({
|
||||
message: '保存成功',
|
||||
type: 'success'
|
||||
});
|
||||
fishHandleClose();
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
}
|
||||
//删除用户
|
||||
function delclick(row: any) {
|
||||
ElMessageBox.confirm("确定删除此用户吗?", "删除提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
ElMessageBox.confirm('确定删除此用户吗?', '删除提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const params = {
|
||||
id: row.id,
|
||||
id: row.id
|
||||
};
|
||||
deltableData(params).then(() => {
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "删除成功",
|
||||
type: 'success',
|
||||
message: '删除成功'
|
||||
});
|
||||
getdata();
|
||||
});
|
||||
@ -658,9 +674,9 @@ function delclick(row: any) {
|
||||
//获取角色
|
||||
function getrole() {
|
||||
const params = {
|
||||
rolename: "",
|
||||
rolename: ''
|
||||
};
|
||||
getRole(params).then((res) => {
|
||||
listGroupedByTenant(params).then(res => {
|
||||
rolesdata.value = res;
|
||||
});
|
||||
}
|
||||
@ -676,18 +692,18 @@ function delchoice() {
|
||||
ids.value.forEach((item: any) => {
|
||||
choice.push(item.id);
|
||||
});
|
||||
ElMessageBox.confirm("确定删除此用户吗?", "删除提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
ElMessageBox.confirm('确定删除此用户吗?', '删除提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const params = {
|
||||
id: String(choice),
|
||||
id: String(choice)
|
||||
};
|
||||
delChoise(params).then(() => {
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "删除成功",
|
||||
type: 'success',
|
||||
message: '删除成功'
|
||||
});
|
||||
getdata();
|
||||
});
|
||||
@ -700,14 +716,32 @@ function dateFormat(row: any) {
|
||||
var date = new Date(daterc);
|
||||
var year = date.getFullYear();
|
||||
var month =
|
||||
date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
|
||||
date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
|
||||
var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
|
||||
var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
|
||||
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
|
||||
var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
|
||||
date.getMonth() + 1 < 10
|
||||
? '0' + (date.getMonth() + 1)
|
||||
: date.getMonth() + 1;
|
||||
date.getMonth() + 1 < 10
|
||||
? '0' + (date.getMonth() + 1)
|
||||
: date.getMonth() + 1;
|
||||
var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
|
||||
var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours();
|
||||
var minutes =
|
||||
date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
|
||||
var seconds =
|
||||
date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
|
||||
// 拼接
|
||||
return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
|
||||
return (
|
||||
year +
|
||||
'-' +
|
||||
month +
|
||||
'-' +
|
||||
day +
|
||||
' ' +
|
||||
hours +
|
||||
':' +
|
||||
minutes +
|
||||
':' +
|
||||
seconds
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -715,11 +749,11 @@ function dateFormat(row: any) {
|
||||
//分类名字
|
||||
function getName(arr: any[], type: any): string {
|
||||
if (!arr || !Array.isArray(arr) || type === undefined || type === null) {
|
||||
return "";
|
||||
return '';
|
||||
}
|
||||
const items = arr.find((item: any) => item?.itemCode == type);
|
||||
console.log(items);
|
||||
return items?.dictName || "";
|
||||
return items?.dictName || '';
|
||||
}
|
||||
|
||||
// 获取审核状态对应的Tag颜色类型
|
||||
@ -730,60 +764,60 @@ function getRegStatusColor(type: any): string {
|
||||
type === undefined ||
|
||||
type === null
|
||||
) {
|
||||
return "info";
|
||||
return 'info';
|
||||
}
|
||||
const items = regStatusArr.value.find((item: any) => item?.itemCode == type);
|
||||
const color = items?.custom1 || "info";
|
||||
const color = items?.custom1 || 'info';
|
||||
|
||||
// 映射字典custom1到Element Plus Tag类型
|
||||
const colorMap: Record<string, string> = {
|
||||
blue: "primary", // 待审核 - 蓝色
|
||||
green: "success", // 已通过 - 绿色
|
||||
red: "danger", // 已驳回 - 红色
|
||||
blue: 'primary', // 待审核 - 蓝色
|
||||
green: 'success', // 已通过 - 绿色
|
||||
red: 'danger' // 已驳回 - 红色
|
||||
};
|
||||
|
||||
return colorMap[color] || "info";
|
||||
return colorMap[color] || 'info';
|
||||
}
|
||||
|
||||
// ==================== 审批相关功能 ====================
|
||||
// 审批对话框显示状态
|
||||
const auditDialogVisible = ref(false);
|
||||
// 审批类型:1-通过,2-驳回
|
||||
const auditType = ref("");
|
||||
const auditType = ref('');
|
||||
// 当前审批的用户ID
|
||||
const currentAuditUserId = ref("");
|
||||
const currentAuditUserId = ref('');
|
||||
// 审批意见表单
|
||||
const auditForm = ref({
|
||||
commentInfo: "",
|
||||
commentInfo: ''
|
||||
});
|
||||
// 审批意见表单引用
|
||||
const auditFormRef = ref();
|
||||
|
||||
// 审批意见表单验证规则
|
||||
const auditRules = ref({
|
||||
commentInfo: [{ required: true, message: "请输入审批意见", trigger: "blur" }],
|
||||
commentInfo: [{ required: true, message: '请输入审批意见', trigger: 'blur' }]
|
||||
});
|
||||
|
||||
// 打开审批通过对话框
|
||||
function handleAuditPass(row: any) {
|
||||
currentAuditUserId.value = row.id;
|
||||
auditType.value = "APPROVED";
|
||||
auditForm.value.commentInfo = "";
|
||||
auditType.value = 'APPROVED';
|
||||
auditForm.value.commentInfo = '';
|
||||
auditDialogVisible.value = true;
|
||||
}
|
||||
|
||||
// 打开审批驳回对话框
|
||||
function handleAuditReject(row: any) {
|
||||
currentAuditUserId.value = row.id;
|
||||
auditType.value = "REJECTED";
|
||||
auditForm.value.commentInfo = "";
|
||||
auditType.value = 'REJECTED';
|
||||
auditForm.value.commentInfo = '';
|
||||
auditDialogVisible.value = true;
|
||||
}
|
||||
|
||||
// 关闭审批对话框
|
||||
function handleAuditClose() {
|
||||
auditDialogVisible.value = false;
|
||||
auditForm.value.commentInfo = "";
|
||||
auditForm.value.commentInfo = '';
|
||||
if (auditFormRef.value) {
|
||||
auditFormRef.value.resetFields();
|
||||
}
|
||||
@ -796,22 +830,23 @@ function submitAudit(formEl: any) {
|
||||
const params = {
|
||||
userId: currentAuditUserId.value,
|
||||
regStatus: auditType.value,
|
||||
commentInfo: auditForm.value.commentInfo,
|
||||
commentInfo: auditForm.value.commentInfo
|
||||
};
|
||||
|
||||
auditUser(params)
|
||||
.then(() => {
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: auditType.value === "APPROVED" ? "审批通过成功" : "审批驳回成功",
|
||||
type: 'success',
|
||||
message:
|
||||
auditType.value === 'APPROVED' ? '审批通过成功' : '审批驳回成功'
|
||||
});
|
||||
handleAuditClose();
|
||||
getdata(); // 刷新列表
|
||||
})
|
||||
.catch(() => {
|
||||
ElMessage({
|
||||
type: "error",
|
||||
message: "审批操作失败,请重试",
|
||||
type: 'error',
|
||||
message: '审批操作失败,请重试'
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -825,10 +860,10 @@ onMounted(() => {
|
||||
const dictData = ref([]);
|
||||
const regStatusArr = ref([]);
|
||||
function getdictdata() {
|
||||
getDictItemsByCode({ dictCode: "resourceType" }).then((res) => {
|
||||
getDictItemsByCode({ dictCode: 'resourceType' }).then(res => {
|
||||
dictData.value = res.data;
|
||||
});
|
||||
getDictItemsByCode({ dictCode: "approvalStatus" }).then((res) => {
|
||||
getDictItemsByCode({ dictCode: 'approvalStatus' }).then(res => {
|
||||
regStatusArr.value = res.data;
|
||||
});
|
||||
}
|
||||
@ -836,18 +871,18 @@ const vMove = {
|
||||
mounted(el: any) {
|
||||
el.onmousedown = function (e: any) {
|
||||
var init = e.clientX;
|
||||
var parent: any = document.getElementById("silderLeft");
|
||||
var parent: any = document.getElementById('silderLeft');
|
||||
const initWidth: any = parent.offsetWidth;
|
||||
document.onmousemove = function (e) {
|
||||
var end = e.clientX;
|
||||
var newWidth = end - init + initWidth;
|
||||
parent.style.width = newWidth + "px";
|
||||
parent.style.width = newWidth + 'px';
|
||||
};
|
||||
document.onmouseup = function () {
|
||||
document.onmousemove = document.onmouseup = null;
|
||||
};
|
||||
};
|
||||
},
|
||||
}
|
||||
};
|
||||
// 递归获取树形数据中所有节点的code
|
||||
function getAllNodeCodes(nodes: any[]): number[] {
|
||||
@ -864,11 +899,11 @@ function getAllNodeCodes(nodes: any[]): number[] {
|
||||
// 全选:选中树中所有节点
|
||||
function handleSelectAll() {
|
||||
if (!fishTreeRef.value || !fishData.value || fishData.value.length === 0) {
|
||||
ElMessage.warning("暂无数据可全选");
|
||||
ElMessage.warning('暂无数据可全选');
|
||||
return;
|
||||
}
|
||||
const allCodes = getAllNodeCodes(fishData.value);
|
||||
console.log("全选 - 所有节点codes:", allCodes);
|
||||
console.log('全选 - 所有节点codes:', allCodes);
|
||||
fishTreeRef.value.setCheckedKeys(allCodes, true);
|
||||
|
||||
// 手动更新表格数据(使用统一过滤逻辑)
|
||||
@ -882,16 +917,16 @@ function handleSelectAll() {
|
||||
|
||||
getFishTableData(filteredIds);
|
||||
tableids.value = filteredIds;
|
||||
console.log("全选 - 表格数据已更新,过滤后IDs:", filteredIds);
|
||||
console.log('全选 - 表格数据已更新,过滤后IDs:', filteredIds);
|
||||
}, 100);
|
||||
|
||||
ElMessage.success("已全选所有节点");
|
||||
ElMessage.success('已全选所有节点');
|
||||
}
|
||||
|
||||
// 反选:反转当前选中状态
|
||||
function handleInvertSelection() {
|
||||
if (!fishTreeRef.value || !fishData.value || fishData.value.length === 0) {
|
||||
ElMessage.warning("暂无数据可操作");
|
||||
ElMessage.warning('暂无数据可操作');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -900,19 +935,23 @@ function handleInvertSelection() {
|
||||
// 获取当前半选的节点keys(父节点部分子节点被选中)
|
||||
const halfCheckedKeys = fishTreeRef.value.getHalfCheckedKeys();
|
||||
|
||||
console.log("反选前 - 已选中codes:", checkedKeys);
|
||||
console.log("反选前 - 半选codes:", halfCheckedKeys);
|
||||
console.log('反选前 - 已选中codes:', checkedKeys);
|
||||
console.log('反选前 - 半选codes:', halfCheckedKeys);
|
||||
|
||||
// 合并完全选中和半选的节点,这些是需要取消选中的
|
||||
const currentSelectedKeys = [...new Set([...checkedKeys, ...halfCheckedKeys])];
|
||||
console.log("反选前 - 当前有效选中状态:", currentSelectedKeys);
|
||||
const currentSelectedKeys = [
|
||||
...new Set([...checkedKeys, ...halfCheckedKeys])
|
||||
];
|
||||
console.log('反选前 - 当前有效选中状态:', currentSelectedKeys);
|
||||
|
||||
// 获取所有节点codes
|
||||
const allCodes = getAllNodeCodes(fishData.value);
|
||||
|
||||
// 计算需要选中的节点:所有节点 - 当前有效选中状态
|
||||
const invertedCodes = allCodes.filter((code) => !currentSelectedKeys.includes(code));
|
||||
console.log("反选后 - 新的选中codes:", invertedCodes);
|
||||
const invertedCodes = allCodes.filter(
|
||||
code => !currentSelectedKeys.includes(code)
|
||||
);
|
||||
console.log('反选后 - 新的选中codes:', invertedCodes);
|
||||
|
||||
// 先清空所有选中状态,避免级联影响
|
||||
fishTreeRef.value.setCheckedKeys([], false);
|
||||
@ -932,11 +971,11 @@ function handleInvertSelection() {
|
||||
|
||||
getFishTableData(filteredIds);
|
||||
tableids.value = filteredIds;
|
||||
console.log("反选 - 表格数据已更新,过滤后IDs:", filteredIds);
|
||||
console.log('反选 - 表格数据已更新,过滤后IDs:', filteredIds);
|
||||
}, 100);
|
||||
}, 50);
|
||||
|
||||
ElMessage.success("已反选操作");
|
||||
ElMessage.success('已反选操作');
|
||||
}
|
||||
|
||||
// 取消选中:清空所有选中状态
|
||||
@ -944,17 +983,17 @@ function handleClearSelection() {
|
||||
if (!fishTreeRef.value) {
|
||||
return;
|
||||
}
|
||||
console.log("取消选中 - 清空所有选中");
|
||||
console.log('取消选中 - 清空所有选中');
|
||||
fishTreeRef.value.setCheckedKeys([], true);
|
||||
|
||||
// 手动清空表格数据
|
||||
setTimeout(() => {
|
||||
getFishTableData([]);
|
||||
tableids.value = [];
|
||||
console.log("取消选中 - 表格数据已清空");
|
||||
console.log('取消选中 - 表格数据已清空');
|
||||
}, 100);
|
||||
|
||||
ElMessage.success("已取消所有选中");
|
||||
ElMessage.success('已取消所有选中');
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -994,7 +1033,10 @@ function handleClearSelection() {
|
||||
:value="item.itemCode"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button type="primary" style="margin-left: 10px" @click="getdata"
|
||||
<el-button
|
||||
type="primary"
|
||||
style="margin-left: 10px"
|
||||
@click="getdata"
|
||||
>搜索</el-button
|
||||
>
|
||||
</div>
|
||||
@ -1022,7 +1064,7 @@ function handleClearSelection() {
|
||||
:header-cell-style="{
|
||||
background: 'rgb(250 250 250)',
|
||||
color: ' #383838',
|
||||
height: '50px',
|
||||
height: '50px'
|
||||
}"
|
||||
>
|
||||
<!-- <el-table-column type="selection" width="50" align="center" /> -->
|
||||
@ -1040,8 +1082,8 @@ function handleClearSelection() {
|
||||
>
|
||||
<span>
|
||||
{{
|
||||
scope.row.basinNames.split(",").slice(0, 6).join(",") +
|
||||
(scope.row.basinNames.split(",").length > 6 ? "..." : "")
|
||||
scope.row.basinNames.split(',').slice(0, 6).join(',') +
|
||||
(scope.row.basinNames.split(',').length > 6 ? '...' : '')
|
||||
}}
|
||||
</span>
|
||||
</el-tooltip>
|
||||
@ -1060,17 +1102,25 @@ function handleClearSelection() {
|
||||
>
|
||||
<span>
|
||||
{{
|
||||
scope.row.stationNames.split(",").slice(0, 6).join(",") +
|
||||
(scope.row.stationNames.split(",").length > 6 ? "..." : "")
|
||||
scope.row.stationNames.split(',').slice(0, 6).join(',') +
|
||||
(scope.row.stationNames.split(',').length > 6 ? '...' : '')
|
||||
}}
|
||||
</span>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="nickname" label="用户姓名" width="140"></el-table-column>
|
||||
<el-table-column
|
||||
prop="nickname"
|
||||
label="用户姓名"
|
||||
width="140"
|
||||
></el-table-column>
|
||||
<!-- <el-table-column prop="avatar" label="头像"></el-table-column> -->
|
||||
<!-- <el-table-column prop="email" label="邮箱"></el-table-column> -->
|
||||
<el-table-column prop="phone" label="手机号" width="160"></el-table-column>
|
||||
<el-table-column
|
||||
prop="phone"
|
||||
label="手机号"
|
||||
width="160"
|
||||
></el-table-column>
|
||||
<el-table-column prop="username" label="登录账号"></el-table-column>
|
||||
<!-- <el-table-column prop="custom1" label="登录账号"></el-table-column> -->
|
||||
<!-- <el-table-column prop="rolename" label="所属角色" >
|
||||
@ -1079,7 +1129,12 @@ function handleClearSelection() {
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="regStatus" label="审核状态" width="90" align="center">
|
||||
<el-table-column
|
||||
prop="regStatus"
|
||||
label="审核状态"
|
||||
width="90"
|
||||
align="center"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-tag :type="getRegStatusColor(scope.row.regStatus)" size="small">
|
||||
{{ getName(regStatusArr, scope.row.regStatus) }}
|
||||
@ -1166,7 +1221,12 @@ function handleClearSelection() {
|
||||
width="620px"
|
||||
draggable
|
||||
>
|
||||
<el-form ref="infoForm" :model="info" :rules="moderules" label-width="90px">
|
||||
<el-form
|
||||
ref="infoForm"
|
||||
:model="info"
|
||||
:rules="moderules"
|
||||
label-width="90px"
|
||||
>
|
||||
<el-form-item label="用户姓名" prop="nickname">
|
||||
<el-input
|
||||
v-model="info.nickname"
|
||||
@ -1203,13 +1263,25 @@ function handleClearSelection() {
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属角色">
|
||||
<el-select v-model="info.roleinfo" placeholder=" " style="width: 100%" multiple>
|
||||
<el-option
|
||||
v-for="item in rolesdata"
|
||||
:key="item.id"
|
||||
:label="item.rolename"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-select
|
||||
v-model="info.roleinfo"
|
||||
placeholder=" "
|
||||
style="width: 100%"
|
||||
filterable
|
||||
multiple
|
||||
>
|
||||
<el-option-group
|
||||
v-for="group in rolesdata"
|
||||
:key="group.tenantName"
|
||||
:label="group.tenantName"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in group.roles"
|
||||
:key="item.id"
|
||||
:label="item.rolename"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-option-group>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -1223,7 +1295,9 @@ function handleClearSelection() {
|
||||
"
|
||||
>
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
<el-button type="primary" @click="confirmClick(infoForm)">保存</el-button>
|
||||
<el-button type="primary" @click="confirmClick(infoForm)"
|
||||
>保存</el-button
|
||||
>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!-- 过鱼设施权限维护 -->
|
||||
@ -1256,9 +1330,15 @@ function handleClearSelection() {
|
||||
</template>
|
||||
</el-input>
|
||||
<div class="button_div">
|
||||
<el-button type="primary" @click="handleSelectAll">全选</el-button>
|
||||
<el-button type="primary" @click="handleInvertSelection">反选</el-button>
|
||||
<el-button type="primary" @click="handleClearSelection">取消选中</el-button>
|
||||
<el-button type="primary" @click="handleSelectAll"
|
||||
>全选</el-button
|
||||
>
|
||||
<el-button type="primary" @click="handleInvertSelection"
|
||||
>反选</el-button
|
||||
>
|
||||
<el-button type="primary" @click="handleClearSelection"
|
||||
>取消选中</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1298,13 +1378,23 @@ function handleClearSelection() {
|
||||
:header-cell-style="{
|
||||
background: 'rgb(250 250 250)',
|
||||
color: ' #383838',
|
||||
height: '50px',
|
||||
height: '50px'
|
||||
}"
|
||||
>
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column type="index" label="序号" width="70" align="center" />
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
width="70"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column prop="name" label="名称"></el-table-column>
|
||||
<el-table-column prop="type" label="类型" width="200" align="center">
|
||||
<el-table-column
|
||||
prop="type"
|
||||
label="类型"
|
||||
width="200"
|
||||
align="center"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span>{{ getName(dictData, scope.row.type) }}</span>
|
||||
</template>
|
||||
@ -1365,7 +1455,9 @@ function handleClearSelection() {
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="handleAuditClose">取消</el-button>
|
||||
<el-button type="primary" @click="submitAudit(auditFormRef)">确定</el-button>
|
||||
<el-button type="primary" @click="submitAudit(auditFormRef)"
|
||||
>确定</el-button
|
||||
>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@ -1378,7 +1470,9 @@ function handleClearSelection() {
|
||||
append-to-body
|
||||
:before-close="closeResult"
|
||||
>
|
||||
已将密码重置为:<span style="color: #409eff; font-size: 16px">{{ msgText }}</span>
|
||||
已将密码重置为:<span style="color: #409eff; font-size: 16px">{{
|
||||
msgText
|
||||
}}</span>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="closeResult">取消</el-button>
|
||||
@ -1526,4 +1620,7 @@ function handleClearSelection() {
|
||||
.el-message-box {
|
||||
width: 300px !important;
|
||||
}
|
||||
:deep(.el-select-group__title){
|
||||
font-size: 16px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -11,7 +11,7 @@ import {
|
||||
gettableData,
|
||||
DataStatus,
|
||||
deltableData,
|
||||
getRole,
|
||||
listGroupedByTenant,
|
||||
addUsers,
|
||||
updataUser,
|
||||
setpass,
|
||||
@ -786,7 +786,8 @@ function getrole() {
|
||||
const params = {
|
||||
rolename: ''
|
||||
};
|
||||
getRole(params).then(res => {
|
||||
listGroupedByTenant(params).then(res => {
|
||||
// debugger
|
||||
rolesdata.value = res;
|
||||
});
|
||||
}
|
||||
@ -1250,19 +1251,27 @@ function handleClearSelection() {
|
||||
placeholder="请输入登录账号"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="所属角色">
|
||||
<el-select
|
||||
v-model="info.roleinfo"
|
||||
placeholder=" "
|
||||
placeholder=" "
|
||||
style="width: 100%"
|
||||
filterable
|
||||
multiple
|
||||
>
|
||||
<el-option
|
||||
v-for="item in rolesdata"
|
||||
:key="item.id"
|
||||
:label="item.rolename"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-option-group
|
||||
v-for="group in rolesdata"
|
||||
:key="group.tenantName"
|
||||
:label="group.tenantName"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in group.roles"
|
||||
:key="item.id"
|
||||
:label="item.rolename"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-option-group>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -1565,4 +1574,7 @@ function handleClearSelection() {
|
||||
.el-message-box {
|
||||
width: 300px !important;
|
||||
}
|
||||
:deep(.el-select-group__title){
|
||||
font-size: 16px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user