增加权限限制
This commit is contained in:
@@ -65,7 +65,12 @@ function fnChangeLocale(e: any) {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<a-space :size="12" align="center">
|
<a-space :size="12" align="center">
|
||||||
<a-button type="text" style="color: inherit" @click="fnClickAlarm">
|
<a-button
|
||||||
|
type="text"
|
||||||
|
style="color: inherit"
|
||||||
|
@click="fnClickAlarm"
|
||||||
|
v-roles:has="['administrator']"
|
||||||
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<a-badge
|
<a-badge
|
||||||
:count="useAlarmStore().activeAlarmTotal"
|
:count="useAlarmStore().activeAlarmTotal"
|
||||||
@@ -89,7 +94,12 @@ function fnChangeLocale(e: any) {
|
|||||||
|
|
||||||
<a-tooltip placement="bottom">
|
<a-tooltip placement="bottom">
|
||||||
<template #title>{{ t('loayouts.rightContent.helpDoc') }}</template>
|
<template #title>{{ t('loayouts.rightContent.helpDoc') }}</template>
|
||||||
<a-button type="text" style="color: inherit" @click="fnClickHelpDoc()">
|
<a-button
|
||||||
|
type="text"
|
||||||
|
style="color: inherit"
|
||||||
|
@click="fnClickHelpDoc()"
|
||||||
|
v-roles:has="['administrator']"
|
||||||
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<QuestionCircleOutlined />
|
<QuestionCircleOutlined />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ import useNeInfoStore from '@/store/modules/neinfo';
|
|||||||
import useI18n from '@/hooks/useI18n';
|
import useI18n from '@/hooks/useI18n';
|
||||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||||
import saveAs from 'file-saver';
|
import saveAs from 'file-saver';
|
||||||
|
import useUserStore from '@/store/modules/user';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
/**网元参数 */
|
/**网元参数 */
|
||||||
@@ -34,6 +36,8 @@ let queryParams = reactive({
|
|||||||
neId: undefined,
|
neId: undefined,
|
||||||
/**移动编号 */
|
/**移动编号 */
|
||||||
imsi: '',
|
imsi: '',
|
||||||
|
/**租户名 */
|
||||||
|
tenantName: '',
|
||||||
/**移动号 */
|
/**移动号 */
|
||||||
msisdn: '',
|
msisdn: '',
|
||||||
/**排序字段 */
|
/**排序字段 */
|
||||||
@@ -51,6 +55,7 @@ function fnQueryReset() {
|
|||||||
queryParams = Object.assign(queryParams, {
|
queryParams = Object.assign(queryParams, {
|
||||||
imsi: '',
|
imsi: '',
|
||||||
msisdn: '',
|
msisdn: '',
|
||||||
|
tenantName: '',
|
||||||
sortField: 'imsi',
|
sortField: 'imsi',
|
||||||
sortOrder: 'asc',
|
sortOrder: 'asc',
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@@ -147,6 +152,13 @@ let tableColumns: ColumnsType = [
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: 'Tenant Name',
|
||||||
|
dataIndex: 'tenantName',
|
||||||
|
align: 'center',
|
||||||
|
key: 'tenantName',
|
||||||
|
width: 150,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: 'Subscribed Data',
|
title: 'Subscribed Data',
|
||||||
dataIndex: 'smData',
|
dataIndex: 'smData',
|
||||||
@@ -156,6 +168,7 @@ let tableColumns: ColumnsType = [
|
|||||||
minWidth: 150,
|
minWidth: 150,
|
||||||
maxWidth: 500,
|
maxWidth: 500,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: t('common.operate'),
|
title: t('common.operate'),
|
||||||
key: 'imsi',
|
key: 'imsi',
|
||||||
@@ -1055,7 +1068,14 @@ function fnGetList(pageNum?: number) {
|
|||||||
queryParams.pageNum = pageNum;
|
queryParams.pageNum = pageNum;
|
||||||
tablePagination.current = pageNum;
|
tablePagination.current = pageNum;
|
||||||
}
|
}
|
||||||
listSub(toRaw(queryParams)).then(res => {
|
|
||||||
|
const selectFrom = Object.assign({}, toRaw(queryParams));
|
||||||
|
//权限为租户时 需带租户名称
|
||||||
|
if (useUserStore().roles.includes('tenant')) {
|
||||||
|
selectFrom.tenantName = useUserStore().userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
listSub(selectFrom).then(res => {
|
||||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||||
// 取消勾选
|
// 取消勾选
|
||||||
if (tableState.selectedRowKeys.length > 0) {
|
if (tableState.selectedRowKeys.length > 0) {
|
||||||
@@ -1195,6 +1215,15 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
console.log(useUserStore().roles);
|
||||||
|
if (useUserStore().roles.includes('tenant')) {
|
||||||
|
const operateColumnIndex = tableColumns.findIndex(
|
||||||
|
column => column.key === 'tenantName'
|
||||||
|
);
|
||||||
|
if (operateColumnIndex !== -1) {
|
||||||
|
tableColumns.splice(operateColumnIndex, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
// 获取列表数据
|
// 获取列表数据
|
||||||
fnGetList();
|
fnGetList();
|
||||||
});
|
});
|
||||||
@@ -1211,7 +1240,7 @@ onMounted(() => {
|
|||||||
<!-- 表格搜索栏 -->
|
<!-- 表格搜索栏 -->
|
||||||
<a-form :model="queryParams" name="queryParams" layout="horizontal">
|
<a-form :model="queryParams" name="queryParams" layout="horizontal">
|
||||||
<a-row :gutter="16">
|
<a-row :gutter="16">
|
||||||
<a-col :lg="6" :md="12" :xs="24">
|
<a-col :lg="6" :md="12" :xs="24" v-roles:has="['administrator']">
|
||||||
<a-form-item :label="t('views.neUser.sub.neType')" name="neId ">
|
<a-form-item :label="t('views.neUser.sub.neType')" name="neId ">
|
||||||
<a-select
|
<a-select
|
||||||
v-model:value="queryParams.neId"
|
v-model:value="queryParams.neId"
|
||||||
@@ -1249,6 +1278,20 @@ onMounted(() => {
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|
||||||
|
<a-row :gutter="16" v-roles:has="['administrator']">
|
||||||
|
<a-col :lg="6" :md="12" :xs="24">
|
||||||
|
<a-form-item
|
||||||
|
:label="t('views.neUser.sub.tenantName')"
|
||||||
|
name="tenantName "
|
||||||
|
>
|
||||||
|
<a-input
|
||||||
|
v-model:value="queryParams.tenantName"
|
||||||
|
allow-clear
|
||||||
|
></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
@@ -1256,14 +1299,22 @@ onMounted(() => {
|
|||||||
<!-- 插槽-卡片左侧侧 -->
|
<!-- 插槽-卡片左侧侧 -->
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="button-container">
|
<div class="button-container">
|
||||||
<a-button type="primary" @click.prevent="fnModalVisibleByEdit()">
|
<a-button
|
||||||
|
type="primary"
|
||||||
|
@click.prevent="fnModalVisibleByEdit()"
|
||||||
|
v-perms:has="['neUser:subs:add']"
|
||||||
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<PlusOutlined />
|
<PlusOutlined />
|
||||||
</template>
|
</template>
|
||||||
{{ t('common.addText') }}
|
{{ t('common.addText') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
|
|
||||||
<a-button type="primary" @click.prevent="fnModalVisibleByBatch(1)">
|
<a-button
|
||||||
|
type="primary"
|
||||||
|
@click.prevent="fnModalVisibleByBatch(1)"
|
||||||
|
v-perms:has="['neUser:subs:batchAdd']"
|
||||||
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<PlusOutlined />
|
<PlusOutlined />
|
||||||
</template>
|
</template>
|
||||||
@@ -1276,6 +1327,7 @@ onMounted(() => {
|
|||||||
:disabled="tableState.selectedRowKeys.length <= 0"
|
:disabled="tableState.selectedRowKeys.length <= 0"
|
||||||
:loading="modalState.loadDataLoading"
|
:loading="modalState.loadDataLoading"
|
||||||
@click.prevent="fnRecordDelete('0')"
|
@click.prevent="fnRecordDelete('0')"
|
||||||
|
v-perms:has="['neUser:subs:checkDel']"
|
||||||
>
|
>
|
||||||
<template #icon><DeleteOutlined /></template>
|
<template #icon><DeleteOutlined /></template>
|
||||||
{{ t('views.neUser.sub.checkDel') }}
|
{{ t('views.neUser.sub.checkDel') }}
|
||||||
@@ -1286,6 +1338,7 @@ onMounted(() => {
|
|||||||
danger
|
danger
|
||||||
ghost
|
ghost
|
||||||
@click.prevent="fnModalVisibleByBatch(0)"
|
@click.prevent="fnModalVisibleByBatch(0)"
|
||||||
|
v-perms:has="['neUser:subs:batchDel']"
|
||||||
>
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<DeleteOutlined />
|
<DeleteOutlined />
|
||||||
@@ -1305,6 +1358,7 @@ onMounted(() => {
|
|||||||
danger
|
danger
|
||||||
:disabled="modalState.loadDataLoading"
|
:disabled="modalState.loadDataLoading"
|
||||||
:loading="modalState.loadDataLoading"
|
:loading="modalState.loadDataLoading"
|
||||||
|
v-perms:has="['neUser:subs:load']"
|
||||||
>
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<SyncOutlined />
|
<SyncOutlined />
|
||||||
@@ -1313,7 +1367,11 @@ onMounted(() => {
|
|||||||
</a-button>
|
</a-button>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
|
|
||||||
<a-button type="dashed" @click.prevent="fnModalUploadImportOpen">
|
<a-button
|
||||||
|
type="dashed"
|
||||||
|
@click.prevent="fnModalUploadImportOpen"
|
||||||
|
v-perms:has="['neUser:subs:import']"
|
||||||
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<ImportOutlined />
|
<ImportOutlined />
|
||||||
</template>
|
</template>
|
||||||
@@ -1330,7 +1388,7 @@ onMounted(() => {
|
|||||||
cancel-text="CSV"
|
cancel-text="CSV"
|
||||||
@cancel="fnExportList('csv')"
|
@cancel="fnExportList('csv')"
|
||||||
>
|
>
|
||||||
<a-button type="dashed">
|
<a-button type="dashed" v-perms:has="['neUser:subs:export']">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<ExportOutlined />
|
<ExportOutlined />
|
||||||
</template>
|
</template>
|
||||||
@@ -1352,6 +1410,7 @@ onMounted(() => {
|
|||||||
<a-button
|
<a-button
|
||||||
type="default"
|
type="default"
|
||||||
:disabled="tableState.selectedRowKeys.length <= 0"
|
:disabled="tableState.selectedRowKeys.length <= 0"
|
||||||
|
v-perms:has="['neUser:subs:checkExport']"
|
||||||
>
|
>
|
||||||
<template #icon><ExportOutlined /></template>
|
<template #icon><ExportOutlined /></template>
|
||||||
{{ t('views.neUser.sub.checkExport') }}
|
{{ t('views.neUser.sub.checkExport') }}
|
||||||
@@ -1430,7 +1489,7 @@ onMounted(() => {
|
|||||||
>
|
>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'imsi'">
|
<template v-if="column.key === 'imsi'">
|
||||||
<a-space :size="8" align="center">
|
<a-space :size="8" align="center" v-roles:has="['administrator']">
|
||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
<template #title>{{ t('common.editText') }}</template>
|
<template #title>{{ t('common.editText') }}</template>
|
||||||
<a-button
|
<a-button
|
||||||
|
|||||||
Reference in New Issue
Block a user