fix: 页面字段/接口调整
This commit is contained in:
@@ -17,8 +17,8 @@ import {
|
||||
listRole,
|
||||
updateRole,
|
||||
} from '@/api/system/role';
|
||||
import { roleMenuTreeSelect, menuTreeSelect } from '@/api/system/menu';
|
||||
import { roleDeptTreeSelect } from '@/api/system/dept';
|
||||
import { menuTreeSelectRole, menuTreeSelect } from '@/api/system/menu';
|
||||
import { deptTreeRole } from '@/api/system/dept';
|
||||
import { saveAs } from 'file-saver';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
@@ -56,7 +56,7 @@ let queryParams = reactive({
|
||||
/**角色键值 */
|
||||
roleKey: '',
|
||||
/**角色状态 */
|
||||
status: undefined,
|
||||
statusFlag: undefined,
|
||||
/**记录开始时间 */
|
||||
beginTime: '',
|
||||
/**记录结束时间 */
|
||||
@@ -72,7 +72,7 @@ function fnQueryReset() {
|
||||
queryParams = Object.assign(queryParams, {
|
||||
roleName: '',
|
||||
roleKey: '',
|
||||
status: undefined,
|
||||
statusFlag: undefined,
|
||||
beginTime: '',
|
||||
endTime: '',
|
||||
pageNum: 1,
|
||||
@@ -135,8 +135,8 @@ let tableColumns: ColumnsType = [
|
||||
},
|
||||
{
|
||||
title: t('views.system.role.roleStatus'),
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
dataIndex: 'statusFlag',
|
||||
key: 'statusFlag',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
},
|
||||
@@ -258,7 +258,7 @@ let modalState: ModalStateType = reactive({
|
||||
roleName: '',
|
||||
roleKey: '',
|
||||
roleSort: 0,
|
||||
status: '0',
|
||||
statusFlag: '0',
|
||||
menuIds: [],
|
||||
deptIds: [],
|
||||
remark: '',
|
||||
@@ -320,7 +320,7 @@ function fnModalVisibleByVive(roleId: string | number) {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
modalState.confirmLoading = true;
|
||||
// 查询角色详细同时根据角色ID查询菜单下拉树结构
|
||||
Promise.all([getRole(roleId), roleMenuTreeSelect(roleId)]).then(resArr => {
|
||||
Promise.all([getRole(roleId), menuTreeSelectRole(roleId)]).then(resArr => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (resArr[0].code === RESULT_CODE_SUCCESS && resArr[0].data) {
|
||||
@@ -366,7 +366,7 @@ function fnModalVisibleByEdit(roleId?: string | number) {
|
||||
menuTreeSelect().then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
menuTree.checkedKeys = parseTreeKeys(res.data, 'id');
|
||||
menuTree.expandedKeys = parseTreeNodeKeys(res.data, 'id');
|
||||
menuTree.treeData = res.data;
|
||||
@@ -382,7 +382,7 @@ function fnModalVisibleByEdit(roleId?: string | number) {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
modalState.confirmLoading = true;
|
||||
// 查询角色详细同时根据角色ID查询菜单下拉树结构
|
||||
Promise.all([getRole(roleId), roleMenuTreeSelect(roleId)]).then(resArr => {
|
||||
Promise.all([getRole(roleId), menuTreeSelectRole(roleId)]).then(resArr => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (resArr[0].code === RESULT_CODE_SUCCESS && resArr[0].data) {
|
||||
@@ -570,7 +570,7 @@ function fnRecordDataScope(roleId: string | number) {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
modalState.confirmLoading = true;
|
||||
// 查询角色详细同时根据角色ID查询部门树结构
|
||||
Promise.all([getRole(roleId), roleDeptTreeSelect(roleId)])
|
||||
Promise.all([getRole(roleId), deptTreeRole(roleId)])
|
||||
.then(resArr => {
|
||||
if (resArr[0].code === RESULT_CODE_SUCCESS && resArr[0].data) {
|
||||
modalState.from = Object.assign(modalState.from, resArr[0].data);
|
||||
@@ -619,7 +619,7 @@ function fnRecordAuthUser(row: Record<string, string>) {
|
||||
*/
|
||||
function fnRecordStatus(row: Record<string, string>) {
|
||||
const text =
|
||||
row.status === '1'
|
||||
row.statusFlag === '1'
|
||||
? t('views.system.role.open')
|
||||
: t('views.system.role.close');
|
||||
Modal.confirm({
|
||||
@@ -630,7 +630,7 @@ function fnRecordStatus(row: Record<string, string>) {
|
||||
}),
|
||||
onOk() {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
changeRoleStatus(row.roleId, row.status).then(res => {
|
||||
changeRoleStatus(row.roleId, row.statusFlag).then(res => {
|
||||
hide();
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
@@ -650,7 +650,7 @@ function fnRecordStatus(row: Record<string, string>) {
|
||||
});
|
||||
},
|
||||
onCancel() {
|
||||
row.status = row.status === '1' ? '0' : '1';
|
||||
row.statusFlag = row.statusFlag === '1' ? '0' : '1';
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -732,13 +732,14 @@ function fnGetList(pageNum?: number) {
|
||||
queryParams.beginTime = queryRangePicker.value[0];
|
||||
queryParams.endTime = queryRangePicker.value[1];
|
||||
listRole(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
// 取消勾选
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
}
|
||||
tablePagination.total = res.total;
|
||||
tableState.data = res.rows;
|
||||
const { total, rows } = res.data;
|
||||
tablePagination.total = total;
|
||||
tableState.data = rows;
|
||||
if (
|
||||
tablePagination.total <=
|
||||
(queryParams.pageNum - 1) * tablePagination.pageSize &&
|
||||
@@ -796,10 +797,10 @@ onMounted(() => {
|
||||
<a-col :lg="4" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.role.roleStatus')"
|
||||
name="status"
|
||||
name="statusFlag"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="queryParams.status"
|
||||
v-model:value="queryParams.statusFlag"
|
||||
allow-clear
|
||||
:options="dict.sysNormalDisable"
|
||||
>
|
||||
@@ -935,14 +936,14 @@ onMounted(() => {
|
||||
}"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'status'">
|
||||
<template v-if="column.key === 'statusFlag'">
|
||||
<a-switch
|
||||
v-if="
|
||||
dict.sysNormalDisable.length > 0 &&
|
||||
record.roleId !== '1' &&
|
||||
record.roleId !== 1 &&
|
||||
hasPermissions(['system:role:edit'])
|
||||
"
|
||||
v-model:checked="record.status"
|
||||
v-model:checked="record.statusFlag"
|
||||
checked-value="1"
|
||||
:checked-children="dict.sysNormalDisable[0].label"
|
||||
un-checked-value="0"
|
||||
@@ -953,7 +954,7 @@ onMounted(() => {
|
||||
<DictTag
|
||||
v-else
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="record.status"
|
||||
:value="record.statusFlag"
|
||||
/>
|
||||
</template>
|
||||
<template v-if="column.key === 'roleId'">
|
||||
@@ -968,7 +969,7 @@ onMounted(() => {
|
||||
<template #icon><ProfileOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip v-if="record.roleId !== '1'">
|
||||
<a-tooltip v-if="record.roleId !== 1">
|
||||
<template #title>{{ t('common.editText') }}</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@@ -978,7 +979,7 @@ onMounted(() => {
|
||||
<template #icon><FormOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip v-if="record.roleId !== '1'">
|
||||
<a-tooltip v-if="record.roleId !== 1">
|
||||
<template #title>{{ t('common.deleteText') }}</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@@ -988,7 +989,7 @@ onMounted(() => {
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="topRight" v-if="record.roleId !== '1'">
|
||||
<a-tooltip placement="topRight" v-if="record.roleId !== 1">
|
||||
<template #title>{{
|
||||
t('views.system.role.distribute')
|
||||
}}</template>
|
||||
@@ -1000,7 +1001,7 @@ onMounted(() => {
|
||||
<template #icon><SecurityScanOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="topRight" v-if="record.roleId !== '1'">
|
||||
<a-tooltip placement="topRight" v-if="record.roleId !== 1">
|
||||
<template #title>{{
|
||||
t('views.system.role.distributeUser')
|
||||
}}</template>
|
||||
@@ -1057,11 +1058,11 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.role.roleStatus')"
|
||||
name="status"
|
||||
name="statusFlag"
|
||||
>
|
||||
<DictTag
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="modalState.from.status"
|
||||
:value="modalState.from.statusFlag"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -1157,10 +1158,10 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.role.roleStatus')"
|
||||
name="status"
|
||||
name="statusFlag"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="modalState.from.status"
|
||||
v-model:value="modalState.from.statusFlag"
|
||||
default-value="0"
|
||||
:options="dict.sysNormalDisable"
|
||||
>
|
||||
@@ -1315,11 +1316,11 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.role.roleStatus')"
|
||||
name="status"
|
||||
name="statusFlag"
|
||||
>
|
||||
<DictTag
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="modalState.from.status"
|
||||
:value="modalState.from.statusFlag"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
Reference in New Issue
Block a user