|
@@ -6,13 +6,16 @@ import dayjs, { Dayjs } from 'dayjs';
|
|
|
import ConfirmModal from '@/components/ConfirmModal.vue';
|
|
|
import OrganizationalStructure from '@/components/OrganizationalStructure.vue';
|
|
|
import { useRequest } from '@/hooks/request';
|
|
|
+import { useUserInfoStore } from '@/stores/user-info';
|
|
|
import { t } from '@/i18n';
|
|
|
import { addAccount, batchDeleteAccount, getFindRolesByOrgIds, getUserPageList, updateAccount } from '@/api';
|
|
|
+import { OperatePermission } from '@/utils/permission-type';
|
|
|
|
|
|
import type { FormInstance, Rule } from 'ant-design-vue/es/form';
|
|
|
import type { Key } from 'ant-design-vue/es/table/interface';
|
|
|
import type { AccountForm, CharacterPageItem, UserPageItem, UserPageParams } from '@/types';
|
|
|
|
|
|
+const { booleanPermission } = useUserInfoStore();
|
|
|
const modalComponentRef = useTemplateRef('modalComponent');
|
|
|
const { handleRequest } = useRequest();
|
|
|
const accountKeys = ref<Key[]>([]);
|
|
@@ -250,13 +253,22 @@ const getUserList = () => {
|
|
|
<AFlex justify="space-between" class="account-header">
|
|
|
<div class="text-top">{{ t('userManage.accountManagement') }}</div>
|
|
|
<div>
|
|
|
- <AButton class="icon-button default-button" @click="addDelete">
|
|
|
+ <AButton
|
|
|
+ v-if="booleanPermission(OperatePermission.删除账户)"
|
|
|
+ class="icon-button default-button"
|
|
|
+ @click="addDelete"
|
|
|
+ >
|
|
|
<AFlex align="center">
|
|
|
<SvgIcon name="delete" />
|
|
|
<span>{{ t('common.delete') }}</span>
|
|
|
</AFlex>
|
|
|
</AButton>
|
|
|
- <AButton type="primary" class="icon-button button-monitoring" @click="addOpenAccount">
|
|
|
+ <AButton
|
|
|
+ v-if="booleanPermission(OperatePermission.新增账户)"
|
|
|
+ type="primary"
|
|
|
+ class="icon-button button-monitoring"
|
|
|
+ @click="addOpenAccount"
|
|
|
+ >
|
|
|
<AFlex align="center">
|
|
|
<SvgIcon name="plus" />
|
|
|
<span> {{ t('common.add') }} </span>
|
|
@@ -316,11 +328,15 @@ const getUserList = () => {
|
|
|
<AButton class="default-button margin-left" @click="addReset"> {{ t('common.reset') }} </AButton>
|
|
|
</AFlex>
|
|
|
<ATable
|
|
|
- :row-selection="{
|
|
|
- type: 'checkbox',
|
|
|
- selectedRowKeys: accountKeys,
|
|
|
- onChange: accountChange,
|
|
|
- }"
|
|
|
+ :row-selection="
|
|
|
+ booleanPermission(OperatePermission.删除账户)
|
|
|
+ ? {
|
|
|
+ type: 'checkbox',
|
|
|
+ selectedRowKeys: accountKeys,
|
|
|
+ onChange: accountChange,
|
|
|
+ }
|
|
|
+ : undefined
|
|
|
+ "
|
|
|
row-key="id"
|
|
|
:columns="accountColumns"
|
|
|
:data-source="accountList"
|
|
@@ -328,7 +344,8 @@ const getUserList = () => {
|
|
|
>
|
|
|
<template #bodyCell="{ column, record }">
|
|
|
<template v-if="column.key === 'mobile'">
|
|
|
- <div @click="addCheck(record as UserPageItem)" class="mobile-phone">{{ record.mobile }}</div>
|
|
|
+ <div v-if="!booleanPermission(OperatePermission.编辑账户)">{{ record.mobile }}</div>
|
|
|
+ <div v-else @click="addCheck(record as UserPageItem)" class="mobile-phone">{{ record.mobile }}</div>
|
|
|
</template>
|
|
|
<template v-if="column.key === 'enabled'">
|
|
|
<div v-if="record.enabled == 1" class="tag-style success">{{ t('common.activating') }}</div>
|