系统管理/部门管理角色管理用户管理
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import { AxiosPromise } from 'axios';
|
import { AxiosPromise } from 'axios';
|
||||||
import {DeptForm, DeptQuery, DeptTreeVO, DeptVO} from './types';
|
import { DeptForm, DeptQuery, DeptTreeVO, DeptVO } from './types';
|
||||||
|
|
||||||
// 查询部门列表
|
// 查询部门列表
|
||||||
export const listDept = (query?: DeptQuery) => {
|
export const listDept = (query?: DeptQuery) => {
|
||||||
@ -11,6 +11,13 @@ export const listDept = (query?: DeptQuery) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getDeptList = () => {
|
||||||
|
return request({
|
||||||
|
url: '/project/project/listNoDept',
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过deptIds查询部门
|
* 通过deptIds查询部门
|
||||||
* @param deptIds
|
* @param deptIds
|
||||||
|
@ -5,6 +5,8 @@ export interface DeptQuery extends PageQuery {
|
|||||||
deptName?: string;
|
deptName?: string;
|
||||||
deptCategory?: string;
|
deptCategory?: string;
|
||||||
status?: number;
|
status?: number;
|
||||||
|
isSubset?: string;
|
||||||
|
isShow?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -16,6 +18,7 @@ export interface DeptVO extends BaseEntity {
|
|||||||
parentId: number | string;
|
parentId: number | string;
|
||||||
children: DeptVO[];
|
children: DeptVO[];
|
||||||
deptId: number | string;
|
deptId: number | string;
|
||||||
|
projectList: any[];
|
||||||
deptName: string;
|
deptName: string;
|
||||||
deptCategory: string;
|
deptCategory: string;
|
||||||
orderNum: number;
|
orderNum: number;
|
||||||
@ -48,10 +51,13 @@ export interface DeptForm {
|
|||||||
parentId?: number | string;
|
parentId?: number | string;
|
||||||
children?: DeptForm[];
|
children?: DeptForm[];
|
||||||
deptId?: number | string;
|
deptId?: number | string;
|
||||||
|
projectId?: number | string;
|
||||||
deptName?: string;
|
deptName?: string;
|
||||||
deptCategory?: string;
|
deptCategory?: string;
|
||||||
orderNum?: number;
|
orderNum?: number;
|
||||||
leader?: string;
|
leader?: string;
|
||||||
|
isSubset?: string;
|
||||||
|
isShow?: string;
|
||||||
phone?: string;
|
phone?: string;
|
||||||
email?: string;
|
email?: string;
|
||||||
status?: string;
|
status?: string;
|
||||||
|
@ -56,3 +56,14 @@ export function delPost(postId: string | number | (string | number)[]) {
|
|||||||
method: 'delete'
|
method: 'delete'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取岗位选择框列表
|
||||||
|
export function getRoleList(deptId?: number | string): AxiosPromise<any[]> {
|
||||||
|
return request({
|
||||||
|
url: '/system/role/listNoPage',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
deptId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -6,7 +6,8 @@ export interface DeptTreeOption {
|
|||||||
label: string;
|
label: string;
|
||||||
parentId: string;
|
parentId: string;
|
||||||
weight: number;
|
weight: number;
|
||||||
children?: DeptTreeOption[];
|
children: DeptTreeOption[];
|
||||||
|
disabled: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RoleDeptTree {
|
export interface RoleDeptTree {
|
||||||
@ -34,6 +35,7 @@ export interface RoleVO extends BaseEntity {
|
|||||||
export interface RoleQuery extends PageQuery {
|
export interface RoleQuery extends PageQuery {
|
||||||
roleName: string;
|
roleName: string;
|
||||||
roleKey: string;
|
roleKey: string;
|
||||||
|
deptId: string;
|
||||||
status: string;
|
status: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,7 +48,9 @@ export interface RoleForm {
|
|||||||
deptCheckStrictly: boolean;
|
deptCheckStrictly: boolean;
|
||||||
remark: string;
|
remark: string;
|
||||||
dataScope?: string;
|
dataScope?: string;
|
||||||
|
isSpecial: string;
|
||||||
roleId: string | undefined;
|
roleId: string | undefined;
|
||||||
menuIds: Array<string | number>;
|
menuIds: Array<string | number>;
|
||||||
deptIds: Array<string | number>;
|
deptIds: Array<string | number>;
|
||||||
|
deptId?: string;
|
||||||
}
|
}
|
||||||
|
@ -202,10 +202,11 @@ export const listUserByDeptId = (deptId: string | number): AxiosPromise<UserVO[]
|
|||||||
/**
|
/**
|
||||||
* 查询部门下拉树结构
|
* 查询部门下拉树结构
|
||||||
*/
|
*/
|
||||||
export const deptTreeSelect = (): AxiosPromise<DeptTreeVO[]> => {
|
export const deptTreeSelect = (data?: { isShow: string }): AxiosPromise<DeptTreeVO[]> => {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user/deptTree',
|
url: '/system/user/deptTree',
|
||||||
method: 'get'
|
method: 'get',
|
||||||
|
params: data
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ export interface FlowDefinitionQuery extends PageQuery {
|
|||||||
flowName?: string;
|
flowName?: string;
|
||||||
category: string | number;
|
category: string | number;
|
||||||
isPublish?: number;
|
isPublish?: number;
|
||||||
|
projectId: string | number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FlowDefinitionVo {
|
export interface FlowDefinitionVo {
|
||||||
@ -23,6 +24,7 @@ export interface FlowDefinitionForm {
|
|||||||
flowCode: string;
|
flowCode: string;
|
||||||
category: string;
|
category: string;
|
||||||
formPath: string;
|
formPath: string;
|
||||||
|
projectId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface definitionXmlVO {
|
export interface definitionXmlVO {
|
||||||
|
@ -2,9 +2,11 @@ import { RouterJumpVo } from '@/api/workflow/workflowCommon/types';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
routerJump(routerJumpVo: RouterJumpVo, proxy) {
|
routerJump(routerJumpVo: RouterJumpVo, proxy) {
|
||||||
|
console.log(routerJumpVo.formPath);
|
||||||
proxy.$tab.closePage(proxy.$route);
|
proxy.$tab.closePage(proxy.$route);
|
||||||
|
|
||||||
proxy.$router.push({
|
proxy.$router.push({
|
||||||
path: routerJumpVo.formPath,
|
path: routerJumpVo.formPath ? '/' + routerJumpVo.formPath : routerJumpVo.formPath,
|
||||||
query: {
|
query: {
|
||||||
id: routerJumpVo.businessId,
|
id: routerJumpVo.businessId,
|
||||||
type: routerJumpVo.type,
|
type: routerJumpVo.type,
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
<el-tooltip content="修改" placement="top">
|
<el-tooltip content="修改" placement="top">
|
||||||
<el-button v-hasPermi="['system:dept:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)" />
|
<el-button v-hasPermi="['system:dept:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip content="新增" placement="top">
|
<el-tooltip content="新增" placement="top" v-if="scope.row.isSubset != '0'">
|
||||||
<el-button v-hasPermi="['system:dept:add']" link type="primary" icon="Plus" @click="handleAdd(scope.row)" />
|
<el-button v-hasPermi="['system:dept:add']" link type="primary" icon="Plus" @click="handleAdd(scope.row)" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip content="删除" placement="top">
|
<el-tooltip content="删除" placement="top">
|
||||||
@ -75,7 +75,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-dialog v-model="dialog.visible" :title="dialog.title" destroy-on-close append-to-body width="600px">
|
<el-dialog v-model="dialog.visible" :title="dialog.title" destroy-on-close append-to-body width="600px">
|
||||||
<el-form ref="deptFormRef" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="deptFormRef" :model="form" :rules="rules" label-width="110px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col v-if="form.parentId !== 0" :span="24">
|
<el-col v-if="form.parentId !== 0" :span="24">
|
||||||
<el-form-item label="上级部门" prop="parentId">
|
<el-form-item label="上级部门" prop="parentId">
|
||||||
@ -128,6 +128,21 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="是否拥有子级">
|
||||||
|
<el-radio-group v-model="form.isSubset" @change="handleChangeisSubset">
|
||||||
|
<el-radio value="1">是</el-radio>
|
||||||
|
<el-radio value="0">否</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12" v-if="form.isSubset == '0'">
|
||||||
|
<el-form-item label="所属项目" prop="projectId">
|
||||||
|
<el-select v-model="form.projectId" placeholder="请选择所属项目">
|
||||||
|
<el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
@ -141,7 +156,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="Dept" lang="ts">
|
<script setup name="Dept" lang="ts">
|
||||||
import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from '@/api/system/dept';
|
import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild, getDeptList } from '@/api/system/dept';
|
||||||
import { DeptForm, DeptQuery, DeptVO } from '@/api/system/dept/types';
|
import { DeptForm, DeptQuery, DeptVO } from '@/api/system/dept/types';
|
||||||
import { UserVO } from '@/api/system/user/types';
|
import { UserVO } from '@/api/system/user/types';
|
||||||
import { listUserByDeptId } from '@/api/system/user';
|
import { listUserByDeptId } from '@/api/system/user';
|
||||||
@ -166,7 +181,7 @@ const dialog = reactive<DialogOption>({
|
|||||||
visible: false,
|
visible: false,
|
||||||
title: ''
|
title: ''
|
||||||
});
|
});
|
||||||
|
const projectList = ref([]);
|
||||||
const deptTableRef = ref<ElTableInstance>();
|
const deptTableRef = ref<ElTableInstance>();
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
const deptFormRef = ref<ElFormInstance>();
|
const deptFormRef = ref<ElFormInstance>();
|
||||||
@ -180,6 +195,9 @@ const initFormData: DeptForm = {
|
|||||||
leader: undefined,
|
leader: undefined,
|
||||||
phone: undefined,
|
phone: undefined,
|
||||||
email: undefined,
|
email: undefined,
|
||||||
|
isShow: undefined,
|
||||||
|
isSubset: undefined,
|
||||||
|
projectId: undefined,
|
||||||
status: '0'
|
status: '0'
|
||||||
};
|
};
|
||||||
const initData: PageData<DeptForm, DeptQuery> = {
|
const initData: PageData<DeptForm, DeptQuery> = {
|
||||||
@ -190,7 +208,8 @@ const initData: PageData<DeptForm, DeptQuery> = {
|
|||||||
deptName: undefined,
|
deptName: undefined,
|
||||||
deptCategory: undefined,
|
deptCategory: undefined,
|
||||||
status: undefined,
|
status: undefined,
|
||||||
isShow:1
|
isShow: undefined,
|
||||||
|
isSubset: undefined
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
parentId: [{ required: true, message: '上级部门不能为空', trigger: 'blur' }],
|
parentId: [{ required: true, message: '上级部门不能为空', trigger: 'blur' }],
|
||||||
@ -231,6 +250,7 @@ const cancel = () => {
|
|||||||
/** 表单重置 */
|
/** 表单重置 */
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
form.value = { ...initFormData };
|
form.value = { ...initFormData };
|
||||||
|
projectList.value = [];
|
||||||
deptFormRef.value?.resetFields();
|
deptFormRef.value?.resetFields();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -241,9 +261,17 @@ const handleQuery = () => {
|
|||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
const resetQuery = () => {
|
const resetQuery = () => {
|
||||||
queryFormRef.value?.resetFields();
|
queryFormRef.value?.resetFields();
|
||||||
|
projectList.value = [];
|
||||||
handleQuery();
|
handleQuery();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleChangeisSubset = async (value: string) => {
|
||||||
|
if (value == '0' && (!projectList.value || !projectList.value.length)) {
|
||||||
|
const res = await getDeptList();
|
||||||
|
projectList.value = res.data;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/** 展开/折叠操作 */
|
/** 展开/折叠操作 */
|
||||||
const handleToggleExpandAll = () => {
|
const handleToggleExpandAll = () => {
|
||||||
isExpandAll.value = !isExpandAll.value;
|
isExpandAll.value = !isExpandAll.value;
|
||||||
@ -279,6 +307,7 @@ const handleUpdate = async (row: DeptVO) => {
|
|||||||
getDeptAllUser(row.deptId);
|
getDeptAllUser(row.deptId);
|
||||||
const res = await getDept(row.deptId);
|
const res = await getDept(row.deptId);
|
||||||
form.value = res.data;
|
form.value = res.data;
|
||||||
|
projectList.value = res.data.projectList;
|
||||||
const response = await listDeptExcludeChild(row.deptId);
|
const response = await listDeptExcludeChild(row.deptId);
|
||||||
const data = proxy?.handleTree<DeptOptionsType>(response.data, 'deptId');
|
const data = proxy?.handleTree<DeptOptionsType>(response.data, 'deptId');
|
||||||
if (data) {
|
if (data) {
|
||||||
|
@ -35,72 +35,110 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
<el-row :gutter="20">
|
||||||
<el-card shadow="hover">
|
<!-- 部门树 -->
|
||||||
<template #header>
|
<el-col :lg="4" :xs="24" style="">
|
||||||
<el-row :gutter="10">
|
<el-card shadow="hover">
|
||||||
<el-col :span="1.5">
|
<el-input v-model="deptName" placeholder="请输入部门名称" prefix-icon="Search" clearable />
|
||||||
<el-button v-hasPermi="['system:role:add']" type="primary" plain icon="Plus" @click="handleAdd()">新增</el-button>
|
<el-tree
|
||||||
</el-col>
|
ref="deptTreeRef"
|
||||||
<el-col :span="1.5">
|
class="mt-2"
|
||||||
<el-button v-hasPermi="['system:role:edit']" type="success" plain :disabled="single" icon="Edit" @click="handleUpdate()">修改</el-button>
|
node-key="id"
|
||||||
</el-col>
|
:data="deptOptions"
|
||||||
<el-col :span="1.5">
|
:props="{ label: 'label', children: 'children' }"
|
||||||
<el-button v-hasPermi="['system:role:delete']" type="danger" plain :disabled="ids.length === 0" @click="handleDelete()">删除</el-button>
|
:expand-on-click-node="false"
|
||||||
</el-col>
|
:filter-node-method="filterNode"
|
||||||
<el-col :span="1.5">
|
highlight-current
|
||||||
<el-button v-hasPermi="['system:role:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
default-expand-all
|
||||||
</el-col>
|
@node-click="handleNodeClick"
|
||||||
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
|
/>
|
||||||
</el-row>
|
</el-card>
|
||||||
</template>
|
</el-col>
|
||||||
|
<el-col :lg="20" :xs="24">
|
||||||
<el-table ref="roleTableRef" v-loading="loading" :data="roleList" @selection-change="handleSelectionChange">
|
<el-card shadow="hover">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<template #header>
|
||||||
<el-table-column v-if="false" label="角色编号" prop="roleId" width="120" />
|
<el-row :gutter="10">
|
||||||
<el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" />
|
<el-col :span="1.5">
|
||||||
<el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="200" />
|
<el-button v-hasPermi="['system:role:add']" type="primary" plain icon="Plus" @click="handleAdd()">新增</el-button>
|
||||||
<el-table-column label="显示顺序" prop="roleSort" width="100" />
|
</el-col>
|
||||||
<el-table-column label="状态" align="center" width="100">
|
<el-col :span="1.5">
|
||||||
<template #default="scope">
|
<el-button v-hasPermi="['system:role:edit']" type="success" plain :disabled="single" icon="Edit" @click="handleUpdate()"
|
||||||
<el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
|
>修改</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button v-hasPermi="['system:role:delete']" type="danger" plain :disabled="ids.length === 0" @click="handleDelete()"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button v-hasPermi="['system:role:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime">
|
|
||||||
<template #default="scope">
|
|
||||||
<span>{{ proxy.parseTime(scope.row.createTime) }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column fixed="right" label="操作" width="180">
|
<el-table ref="roleTableRef" v-loading="loading" :data="roleList" @selection-change="handleSelectionChange">
|
||||||
<template #default="scope">
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-tooltip v-if="scope.row.roleId !== 1" content="修改" placement="top">
|
<el-table-column v-if="false" label="角色编号" prop="roleId" width="120" />
|
||||||
<el-button v-hasPermi="['system:role:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button>
|
<el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" />
|
||||||
</el-tooltip>
|
<el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="200" />
|
||||||
<el-tooltip v-if="scope.row.roleId !== 1" content="删除" placement="top">
|
<el-table-column label="显示顺序" prop="roleSort" width="100" />
|
||||||
<el-button v-hasPermi="['system:role:remove']" link type="primary" icon="Delete" @click="handleDelete(scope.row)"></el-button>
|
<el-table-column label="状态" align="center" width="100">
|
||||||
</el-tooltip>
|
<template #default="scope">
|
||||||
<el-tooltip v-if="scope.row.roleId !== 1" content="数据权限" placement="top">
|
<el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
|
||||||
<el-button v-hasPermi="['system:role:edit']" link type="primary" icon="CircleCheck" @click="handleDataScope(scope.row)"></el-button>
|
</template>
|
||||||
</el-tooltip>
|
</el-table-column>
|
||||||
<el-tooltip v-if="scope.row.roleId !== 1" content="分配用户" placement="top">
|
<el-table-column label="创建时间" align="center" prop="createTime">
|
||||||
<el-button v-hasPermi="['system:role:edit']" link type="primary" icon="User" @click="handleAuthUser(scope.row)"></el-button>
|
<template #default="scope">
|
||||||
</el-tooltip>
|
<span>{{ proxy.parseTime(scope.row.createTime) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
<el-table-column fixed="right" label="操作" width="180">
|
||||||
v-if="total > 0"
|
<template #default="scope">
|
||||||
v-model:total="total"
|
<el-tooltip v-if="scope.row.roleId !== 1" content="修改" placement="top">
|
||||||
v-model:page="queryParams.pageNum"
|
<el-button v-hasPermi="['system:role:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button>
|
||||||
v-model:limit="queryParams.pageSize"
|
</el-tooltip>
|
||||||
@pagination="getList"
|
<el-tooltip v-if="scope.row.roleId !== 1" content="删除" placement="top">
|
||||||
/>
|
<el-button v-hasPermi="['system:role:remove']" link type="primary" icon="Delete" @click="handleDelete(scope.row)"></el-button>
|
||||||
</el-card>
|
</el-tooltip>
|
||||||
|
<el-tooltip v-if="scope.row.roleId !== 1" content="数据权限" placement="top">
|
||||||
|
<el-button v-hasPermi="['system:role:edit']" link type="primary" icon="CircleCheck" @click="handleDataScope(scope.row)"></el-button>
|
||||||
|
</el-tooltip>
|
||||||
|
<el-tooltip v-if="scope.row.roleId !== 1" content="分配用户" placement="top">
|
||||||
|
<el-button v-hasPermi="['system:role:edit']" link type="primary" icon="User" @click="handleAuthUser(scope.row)"></el-button>
|
||||||
|
</el-tooltip>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-if="total > 0"
|
||||||
|
v-model:total="total"
|
||||||
|
v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
<el-dialog v-model="dialog.visible" :title="dialog.title" width="500px" append-to-body>
|
<el-dialog v-model="dialog.visible" :title="dialog.title" width="500px" append-to-body>
|
||||||
<el-form ref="roleFormRef" :model="form" :rules="rules" label-width="100px">
|
<el-form ref="roleFormRef" :model="form" :rules="rules" label-width="110px">
|
||||||
|
<el-form-item label="所属部门" prop="deptId">
|
||||||
|
<el-cascader
|
||||||
|
:options="deptOptions"
|
||||||
|
v-model="form.deptId"
|
||||||
|
placeholder="请选择所属部门"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
:show-all-levels="false"
|
||||||
|
:props="{ value: 'id', emitPath: false, checkStrictly: true }"
|
||||||
|
@change=""
|
||||||
|
>
|
||||||
|
</el-cascader>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="角色名称" prop="roleName">
|
<el-form-item label="角色名称" prop="roleName">
|
||||||
<el-input v-model="form.roleName" placeholder="请输入角色名称" />
|
<el-input v-model="form.roleName" placeholder="请输入角色名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -124,7 +162,7 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="菜单权限">
|
<el-form-item label="菜单权限">
|
||||||
<el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox>
|
<el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand(Boolean($event), 'menu')">展开/折叠</el-checkbox>
|
||||||
<el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox>
|
<el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox>
|
||||||
<el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')">父子联动</el-checkbox>
|
<el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')">父子联动</el-checkbox>
|
||||||
<el-tree
|
<el-tree
|
||||||
@ -138,6 +176,9 @@
|
|||||||
:props="{ label: 'label', children: 'children' }"
|
:props="{ label: 'label', children: 'children' }"
|
||||||
></el-tree>
|
></el-tree>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="是否为特殊角色">
|
||||||
|
<el-switch v-model="form.isSpecial" active-value="1" inactive-value="0" active-text="是" inactive-text="否"> </el-switch>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="备注">
|
<el-form-item label="备注">
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -165,7 +206,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="form.dataScope === '2'" label="数据权限">
|
<el-form-item v-show="form.dataScope === '2'" label="数据权限">
|
||||||
<el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">展开/折叠</el-checkbox>
|
<el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand(Boolean($event), 'dept')">展开/折叠</el-checkbox>
|
||||||
<el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">全选/全不选</el-checkbox>
|
<el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">全选/全不选</el-checkbox>
|
||||||
<el-checkbox v-model="form.deptCheckStrictly" @change="handleCheckedTreeConnect($event, 'dept')">父子联动</el-checkbox>
|
<el-checkbox v-model="form.deptCheckStrictly" @change="handleCheckedTreeConnect($event, 'dept')">父子联动</el-checkbox>
|
||||||
<el-tree
|
<el-tree
|
||||||
@ -196,6 +237,8 @@ import { addRole, changeRoleStatus, dataScope, delRole, getRole, listRole, updat
|
|||||||
import { roleMenuTreeselect, treeselect as menuTreeselect } from '@/api/system/menu/index';
|
import { roleMenuTreeselect, treeselect as menuTreeselect } from '@/api/system/menu/index';
|
||||||
import { RoleVO, RoleForm, RoleQuery, DeptTreeOption } from '@/api/system/role/types';
|
import { RoleVO, RoleForm, RoleQuery, DeptTreeOption } from '@/api/system/role/types';
|
||||||
import { MenuTreeOption, RoleMenuTree } from '@/api/system/menu/types';
|
import { MenuTreeOption, RoleMenuTree } from '@/api/system/menu/types';
|
||||||
|
import api, { uploadCertList } from '@/api/system/user';
|
||||||
|
import { DeptTreeVO, DeptVO } from '@/api/system/dept/types';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
@ -214,8 +257,11 @@ const menuExpand = ref(false);
|
|||||||
const menuNodeAll = ref(false);
|
const menuNodeAll = ref(false);
|
||||||
const deptExpand = ref(true);
|
const deptExpand = ref(true);
|
||||||
const deptNodeAll = ref(false);
|
const deptNodeAll = ref(false);
|
||||||
const deptOptions = ref<DeptTreeOption[]>([]);
|
const deptOptions = ref<DeptTreeVO[]>([]);
|
||||||
|
const enabledDeptOptions = ref<DeptTreeVO[]>([]);
|
||||||
|
|
||||||
const openDataScope = ref(false);
|
const openDataScope = ref(false);
|
||||||
|
const deptName = ref('');
|
||||||
|
|
||||||
/** 数据范围选项*/
|
/** 数据范围选项*/
|
||||||
const dataScopeOptions = ref([
|
const dataScopeOptions = ref([
|
||||||
@ -232,6 +278,7 @@ const roleFormRef = ref<ElFormInstance>();
|
|||||||
const dataScopeRef = ref<ElFormInstance>();
|
const dataScopeRef = ref<ElFormInstance>();
|
||||||
const menuRef = ref<ElTreeInstance>();
|
const menuRef = ref<ElTreeInstance>();
|
||||||
const deptRef = ref<ElTreeInstance>();
|
const deptRef = ref<ElTreeInstance>();
|
||||||
|
const deptTreeRef = ref<ElTreeInstance>();
|
||||||
|
|
||||||
const initForm: RoleForm = {
|
const initForm: RoleForm = {
|
||||||
roleId: undefined,
|
roleId: undefined,
|
||||||
@ -244,6 +291,8 @@ const initForm: RoleForm = {
|
|||||||
remark: '',
|
remark: '',
|
||||||
dataScope: '1',
|
dataScope: '1',
|
||||||
menuIds: [],
|
menuIds: [],
|
||||||
|
deptId: '',
|
||||||
|
isSpecial: null,
|
||||||
deptIds: []
|
deptIds: []
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -254,6 +303,7 @@ const data = reactive<PageData<RoleForm, RoleQuery>>({
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
roleName: '',
|
roleName: '',
|
||||||
roleKey: '',
|
roleKey: '',
|
||||||
|
deptId: '',
|
||||||
status: ''
|
status: ''
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
@ -269,6 +319,18 @@ const dialog = reactive<DialogOption>({
|
|||||||
title: ''
|
title: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/** 通过条件过滤节点 */
|
||||||
|
const filterNode = (value: string, data: any) => {
|
||||||
|
if (!value) return true;
|
||||||
|
return data.label.indexOf(value) !== -1;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 节点单击事件 */
|
||||||
|
const handleNodeClick = (data: DeptVO) => {
|
||||||
|
queryParams.value.deptId = data.id as string;
|
||||||
|
handleQuery();
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询角色列表
|
* 查询角色列表
|
||||||
*/
|
*/
|
||||||
@ -293,6 +355,9 @@ const handleQuery = () => {
|
|||||||
const resetQuery = () => {
|
const resetQuery = () => {
|
||||||
dateRange.value = ['', ''];
|
dateRange.value = ['', ''];
|
||||||
queryFormRef.value?.resetFields();
|
queryFormRef.value?.resetFields();
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
queryParams.value.deptId = undefined;
|
||||||
|
deptTreeRef.value?.setCurrentKey(undefined);
|
||||||
handleQuery();
|
handleQuery();
|
||||||
};
|
};
|
||||||
/**删除按钮操作 */
|
/**删除按钮操作 */
|
||||||
@ -496,8 +561,28 @@ const cancelDataScope = () => {
|
|||||||
form.value = { ...initForm };
|
form.value = { ...initForm };
|
||||||
openDataScope.value = false;
|
openDataScope.value = false;
|
||||||
};
|
};
|
||||||
|
/** 查询部门下拉树结构 */
|
||||||
|
const getDeptTree = async () => {
|
||||||
|
const res = await api.deptTreeSelect({ isShow: '1' });
|
||||||
|
deptOptions.value = res.data;
|
||||||
|
enabledDeptOptions.value = filterDisabledDept(res.data);
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 过滤禁用的部门 */
|
||||||
|
const filterDisabledDept = (deptList: DeptTreeVO[]) => {
|
||||||
|
return deptList.filter((dept) => {
|
||||||
|
if (dept.disabled) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (dept.children && dept.children.length) {
|
||||||
|
dept.children = filterDisabledDept(dept.children);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
getDeptTree(); // 初始化部门数据
|
||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<!-- 部门树 -->
|
<!-- 部门树 -->
|
||||||
<el-col :lg="4" :xs="24" style="">
|
<el-col :lg="4" :xs="24" style="">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<el-input v-model="deptName" placeholder="请输入部门名称1" prefix-icon="Search" clearable />
|
<el-input v-model="deptName" placeholder="请输入部门名称" prefix-icon="Search" clearable />
|
||||||
<el-tree
|
<el-tree
|
||||||
ref="deptTreeRef"
|
ref="deptTreeRef"
|
||||||
class="mt-2"
|
class="mt-2"
|
||||||
@ -317,7 +317,7 @@ import { RoleVO } from '@/api/system/role/types';
|
|||||||
import { PostVO } from '@/api/system/post/types';
|
import { PostVO } from '@/api/system/post/types';
|
||||||
import { globalHeaders } from '@/utils/request';
|
import { globalHeaders } from '@/utils/request';
|
||||||
import { to } from 'await-to-js';
|
import { to } from 'await-to-js';
|
||||||
import { optionselect } from '@/api/system/post';
|
import { getRoleList, optionselect } from '@/api/system/post';
|
||||||
import ShuttleFrame from '../../project/projectRelevancy/component/ShuttleFrame.vue';
|
import ShuttleFrame from '../../project/projectRelevancy/component/ShuttleFrame.vue';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@ -469,7 +469,7 @@ const getList = async () => {
|
|||||||
|
|
||||||
/** 查询部门下拉树结构 */
|
/** 查询部门下拉树结构 */
|
||||||
const getDeptTree = async () => {
|
const getDeptTree = async () => {
|
||||||
const res = await api.deptTreeSelect();
|
const res = await api.deptTreeSelect({ isShow: '1' });
|
||||||
deptOptions.value = res.data;
|
deptOptions.value = res.data;
|
||||||
enabledDeptOptions.value = filterDisabledDept(res.data);
|
enabledDeptOptions.value = filterDisabledDept(res.data);
|
||||||
};
|
};
|
||||||
@ -623,7 +623,6 @@ const handleAdd = async () => {
|
|||||||
dialog.visible = true;
|
dialog.visible = true;
|
||||||
dialog.title = '新增用户';
|
dialog.title = '新增用户';
|
||||||
postOptions.value = data.posts;
|
postOptions.value = data.posts;
|
||||||
roleOptions.value = data.roles;
|
|
||||||
form.value.password = initPassword.value.toString();
|
form.value.password = initPassword.value.toString();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -638,7 +637,7 @@ const handleUpdate = async (row?: UserForm) => {
|
|||||||
postOptions.value = data.posts;
|
postOptions.value = data.posts;
|
||||||
roleOptions.value = data.roles;
|
roleOptions.value = data.roles;
|
||||||
form.value.postIds = data.postIds;
|
form.value.postIds = data.postIds;
|
||||||
form.value.roleIds = data.roleIds;
|
form.value.roleIds = data.user.roleIds;
|
||||||
form.value.password = '';
|
form.value.password = '';
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -682,8 +681,11 @@ onMounted(() => {
|
|||||||
|
|
||||||
async function handleDeptChange(value: number | string) {
|
async function handleDeptChange(value: number | string) {
|
||||||
const response = await optionselect(value);
|
const response = await optionselect(value);
|
||||||
|
const roleList = await getRoleList(value);
|
||||||
|
roleOptions.value = roleList.data;
|
||||||
postOptions.value = response.data;
|
postOptions.value = response.data;
|
||||||
form.value.postIds = [];
|
form.value.postIds = [];
|
||||||
|
form.value.roleIds = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
const shuttleVisible = ref(false);
|
const shuttleVisible = ref(false);
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
<el-tree-select
|
<el-tree-select
|
||||||
v-model="form.parentId"
|
v-model="form.parentId"
|
||||||
:data="categoryOptions"
|
:data="categoryOptions"
|
||||||
:props="{ value: 'categoryId', label: 'categoryName', children: 'children' } as any"
|
:props="{ value: 'categoryId', label: 'categoryName', children: 'children' }"
|
||||||
value-key="categoryId"
|
value-key="categoryId"
|
||||||
placeholder="请选择上级分类"
|
placeholder="请选择上级分类"
|
||||||
check-strictly
|
check-strictly
|
||||||
|
@ -529,4 +529,17 @@ const handleCopyDef = async (row: FlowDefinitionVo) => {
|
|||||||
const handleExportDef = () => {
|
const handleExportDef = () => {
|
||||||
proxy?.download(`/workflow/definition/exportDef/${ids.value[0]}`, {}, `${flowCodeList.value[0]}.json`);
|
proxy?.download(`/workflow/definition/exportDef/${ids.value[0]}`, {}, `${flowCodeList.value[0]}.json`);
|
||||||
};
|
};
|
||||||
|
//监听项目id刷新数据
|
||||||
|
const listeningProject = watch(
|
||||||
|
() => currentProject.value.id,
|
||||||
|
(nid, oid) => {
|
||||||
|
queryParams.value.projectId = nid;
|
||||||
|
form.value.projectId = nid;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
listeningProject();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
class="mt-2"
|
class="mt-2"
|
||||||
node-key="id"
|
node-key="id"
|
||||||
:data="categoryOptions"
|
:data="categoryOptions"
|
||||||
:props="{ label: 'label', children: 'children' } as any"
|
:props="{ label: 'label', children: 'children' }"
|
||||||
:expand-on-click-node="false"
|
:expand-on-click-node="false"
|
||||||
:filter-node-method="filterNode"
|
:filter-node-method="filterNode"
|
||||||
highlight-current
|
highlight-current
|
||||||
|
Reference in New Issue
Block a user