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