fix: 角色管理调整
This commit is contained in:
@@ -305,9 +305,9 @@ function fnModalVisibleByVive(roleId: string | number) {
|
||||
Promise.all([getRole(roleId), roleMenuTreeSelect(roleId)]).then(resArr => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (resArr[0].code === 200 && resArr[0].data) {
|
||||
if (resArr[0].code === 1 && resArr[0].data) {
|
||||
modalState.from = Object.assign(modalState.from, resArr[0].data);
|
||||
if (resArr[1].code === 200 && resArr[1].data) {
|
||||
if (resArr[1].code === 1 && resArr[1].data) {
|
||||
const { menus, checkedKeys } = resArr[1].data;
|
||||
menuTree.checkedKeys = parseTreeKeys(menus, 'id');
|
||||
menuTree.expandedKeys = parseTreeNodeKeys(menus, 'id');
|
||||
@@ -343,7 +343,7 @@ function fnModalVisibleByEdit(roleId?: string | number) {
|
||||
menuTreeSelect().then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (res.code === 200 && Array.isArray(res.data)) {
|
||||
if (res.code === 1 && Array.isArray(res.data)) {
|
||||
menuTree.checkedKeys = parseTreeKeys(res.data, 'id');
|
||||
menuTree.expandedKeys = parseTreeNodeKeys(res.data, 'id');
|
||||
menuTree.treeData = res.data;
|
||||
@@ -361,9 +361,9 @@ function fnModalVisibleByEdit(roleId?: string | number) {
|
||||
Promise.all([getRole(roleId), roleMenuTreeSelect(roleId)]).then(resArr => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (resArr[0].code === 200 && resArr[0].data) {
|
||||
if (resArr[0].code === 1 && resArr[0].data) {
|
||||
modalState.from = Object.assign(modalState.from, resArr[0].data);
|
||||
if (resArr[1].code === 200 && resArr[1].data) {
|
||||
if (resArr[1].code === 1 && resArr[1].data) {
|
||||
const { menus, checkedKeys } = resArr[1].data;
|
||||
menuTree.checkedKeys = parseTreeKeys(menus, 'id');
|
||||
menuTree.expandedKeys = parseTreeNodeKeys(menus, 'id');
|
||||
@@ -396,7 +396,7 @@ function fnModalOk() {
|
||||
message.loading({ content: '请稍等...', key });
|
||||
role
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === 1) {
|
||||
message.success({
|
||||
content: `${modalState.title}成功`,
|
||||
key,
|
||||
@@ -507,7 +507,7 @@ function fnModalOkDataScope() {
|
||||
}
|
||||
dataScope(fromInfo)
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === 1) {
|
||||
message.success({
|
||||
content: `${modalState.title}成功`,
|
||||
duration: 2,
|
||||
@@ -542,9 +542,9 @@ function fnRecordDataScope(roleId: string | number) {
|
||||
// 查询角色详细同时根据角色ID查询部门树结构
|
||||
Promise.all([getRole(roleId), roleDeptTreeSelect(roleId)])
|
||||
.then(resArr => {
|
||||
if (resArr[0].code === 200 && resArr[0].data) {
|
||||
if (resArr[0].code === 1 && resArr[0].data) {
|
||||
modalState.from = Object.assign(modalState.from, resArr[0].data);
|
||||
if (resArr[1].code === 200 && resArr[1].data) {
|
||||
if (resArr[1].code === 1 && resArr[1].data) {
|
||||
const { depts, checkedKeys } = resArr[1].data;
|
||||
deptTree.checkedKeys = parseTreeKeys(depts, 'id');
|
||||
deptTree.expandedKeys = parseTreeNodeKeys(depts, 'id');
|
||||
@@ -591,7 +591,7 @@ function fnRecordStatus(row: Record<string, string>) {
|
||||
const hide = message.loading('请稍等...', 0);
|
||||
changeRoleStatus(row.roleId, row.status).then(res => {
|
||||
hide();
|
||||
if (res.code === 200) {
|
||||
if (res.code === 1) {
|
||||
message.success({
|
||||
content: `${row.roleName} ${text}成功`,
|
||||
duration: 2,
|
||||
@@ -626,7 +626,7 @@ function fnRecordDelete(roleId: string = '0') {
|
||||
const hide = message.loading('请稍等...', 0);
|
||||
delRole(roleId).then(res => {
|
||||
hide();
|
||||
if (res.code === 200) {
|
||||
if (res.code === 1) {
|
||||
message.success({
|
||||
content: `删除成功`,
|
||||
duration: 2,
|
||||
@@ -651,7 +651,7 @@ function fnExportList() {
|
||||
onOk() {
|
||||
const hide = message.loading('请稍等...', 0);
|
||||
exportRole(toRaw(queryParams)).then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === 1) {
|
||||
message.success({
|
||||
content: `已完成导出`,
|
||||
duration: 2,
|
||||
@@ -675,7 +675,7 @@ function fnGetList() {
|
||||
queryParams.beginTime = queryRangePicker.value[0];
|
||||
queryParams.endTime = queryRangePicker.value[1];
|
||||
listRole(toRaw(queryParams)).then(res => {
|
||||
if (res.code === 200 && Array.isArray(res.rows)) {
|
||||
if (res.code === 1 && Array.isArray(res.rows)) {
|
||||
// 取消勾选
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
@@ -923,7 +923,7 @@ onMounted(() => {
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip v-if="record.roleId !== '1'">
|
||||
<!-- <a-tooltip v-if="record.roleId !== '1'">
|
||||
<template #title>分配数据权限</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@@ -932,7 +932,7 @@ onMounted(() => {
|
||||
>
|
||||
<template #icon><SecurityScanOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</a-tooltip> -->
|
||||
<a-tooltip v-if="record.roleId !== '1'">
|
||||
<template #title>分配用户</template>
|
||||
<a-button
|
||||
|
||||
Reference in New Issue
Block a user