fix: 租户管理表格操作去掉按钮权限
This commit is contained in:
@@ -325,7 +325,7 @@ function fnGetList(parentId?: any, tableFlag?: any, pageNum?: number) {
|
||||
tablePagination.total = res.total;
|
||||
if (
|
||||
tablePagination.total <=
|
||||
(queryParams.pageNum - 1) * tablePagination.pageSize &&
|
||||
(queryParams.pageNum - 1) * tablePagination.pageSize &&
|
||||
queryParams.pageNum !== 1
|
||||
) {
|
||||
tableState.loading = false;
|
||||
@@ -774,57 +774,34 @@ onMounted(() => {
|
||||
<template>
|
||||
<PageContainer>
|
||||
<a-row :gutter="16">
|
||||
<a-col
|
||||
:lg="5"
|
||||
:md="5"
|
||||
:xs="24"
|
||||
style="margin-bottom: 24px"
|
||||
v-show="collapsible"
|
||||
>
|
||||
<a-col :lg="5" :md="5" :xs="24" style="margin-bottom: 24px" v-show="collapsible">
|
||||
<!-- Tenant List -->
|
||||
<a-card size="small" :bordered="false" title="Tenant List">
|
||||
<template #extra>
|
||||
<a-button size="small" @click.prevent="fnModalVisibleByEdit()">
|
||||
<template #icon><PlusOutlined /></template>
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
{{ t('common.addText') }}
|
||||
</a-button></template
|
||||
>
|
||||
</a-button></template>
|
||||
|
||||
<a-form layout="vertical" autocomplete="off">
|
||||
<a-form-item name="tenantTree">
|
||||
<a-tree :tree-data="state.tenantTreeData" @select="fnSelectNode">
|
||||
<!-- treeKey is tenantId -->
|
||||
|
||||
<template
|
||||
#title="{ key: treeKey, title, status }"
|
||||
style="width: 170px"
|
||||
>
|
||||
<template #title="{ key: treeKey, title, status }" style="width: 170px">
|
||||
<div style="display: flex; align-items: center">
|
||||
<span
|
||||
:style="
|
||||
status == 1 ? { color: 'green' } : { color: 'red' }
|
||||
"
|
||||
class="treeNode"
|
||||
>{{ title }}</span
|
||||
>
|
||||
<span :style="status == 1 ? { color: 'green' } : { color: 'red' }
|
||||
" class="treeNode">{{ title }}</span>
|
||||
<!-- 占位符,推动后面的按钮到最右边 -->
|
||||
<div style="flex: 1"></div>
|
||||
|
||||
<span>
|
||||
<EditOutlined
|
||||
:style="
|
||||
status == 1 ? { color: 'green' } : { color: 'red' }
|
||||
"
|
||||
class="iconMyStyle"
|
||||
@click.stop="fnModalVisibleByEdit(treeKey)"
|
||||
/>
|
||||
<DeleteOutlined
|
||||
:style="
|
||||
status == 1 ? { color: 'green' } : { color: 'red' }
|
||||
"
|
||||
class="iconMyStyle"
|
||||
@click.stop="fnRecordDelete(treeKey, title)"
|
||||
/>
|
||||
<EditOutlined :style="status == 1 ? { color: 'green' } : { color: 'red' }
|
||||
" class="iconMyStyle" @click.stop="fnModalVisibleByEdit(treeKey)" />
|
||||
<DeleteOutlined :style="status == 1 ? { color: 'green' } : { color: 'red' }
|
||||
" class="iconMyStyle" @click.stop="fnRecordDelete(treeKey, title)" />
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
@@ -835,11 +812,7 @@ onMounted(() => {
|
||||
</a-col>
|
||||
|
||||
<a-col :lg="collapsible ? 19 : 24" :md="collapsible ? 19 : 24" :xs="24">
|
||||
<a-card
|
||||
size="small"
|
||||
:bordered="false"
|
||||
:body-style="{ maxHeight: '650px', 'overflow-y': 'auto' }"
|
||||
>
|
||||
<a-card size="small" :bordered="false" :body-style="{ maxHeight: '650px', 'overflow-y': 'auto' }">
|
||||
<!-- 左侧区域 -->
|
||||
<template #title>
|
||||
<a-button type="text" @click.prevent="changeCollapsible()">
|
||||
@@ -848,7 +821,7 @@ onMounted(() => {
|
||||
</template>
|
||||
</a-button>
|
||||
<a-typography-text v-if="state.selectedName">
|
||||
{{ state.selectedName + '-Tenancy Asset ' }}
|
||||
{{ state.selectedName + '-Tenancy Asset ' }}
|
||||
</a-typography-text>
|
||||
<a-typography-text type="danger" v-else>
|
||||
{{ t('views.system.tenant.treeSelectTip') }}
|
||||
@@ -864,12 +837,10 @@ onMounted(() => {
|
||||
? 'Add Tenancy Asset'
|
||||
: 'Please Select Tenant'
|
||||
}}</template>
|
||||
<a-button
|
||||
size="small"
|
||||
@click.prevent="fnModalVisibleByType()"
|
||||
:disabled="!modalState.typeButton"
|
||||
>
|
||||
<template #icon> <PlusOutlined /> </template>
|
||||
<a-button size="small" @click.prevent="fnModalVisibleByType()" :disabled="!modalState.typeButton">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
{{ t('common.addText') }}
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
@@ -879,13 +850,9 @@ onMounted(() => {
|
||||
? t('common.reloadText')
|
||||
: 'Please Select Tenant'
|
||||
}}</template>
|
||||
<a-button
|
||||
type="default"
|
||||
size="small"
|
||||
:disabled="!modalState.typeButton"
|
||||
<a-button type="default" size="small" :disabled="!modalState.typeButton"
|
||||
:title="modalState.typeButton ? '' : 'Please Select Tenant'"
|
||||
@click.prevent="fnGetList(state.selectedNode, 'table')"
|
||||
>
|
||||
@click.prevent="fnGetList(state.selectedNode, 'table')">
|
||||
<template #icon>
|
||||
<ReloadOutlined />
|
||||
</template>
|
||||
@@ -895,52 +862,35 @@ onMounted(() => {
|
||||
</template>
|
||||
|
||||
<!-- 租户类型表格 -->
|
||||
<a-table
|
||||
class="table"
|
||||
row-key="id"
|
||||
:columns="tableColumns"
|
||||
:loading="tableState.loading"
|
||||
:data-source="tableState.data"
|
||||
:pagination="tablePagination"
|
||||
:size="tableState.size"
|
||||
:scroll="{ x: 1000, y: 400 }"
|
||||
>
|
||||
<a-table class="table" row-key="id" :columns="tableColumns" :loading="tableState.loading"
|
||||
:data-source="tableState.data" :pagination="tablePagination" :size="tableState.size"
|
||||
:scroll="{ x: 1000, y: 400 }">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'status'">
|
||||
<DictTag
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="record.status"
|
||||
/>
|
||||
<DictTag :options="dict.sysNormalDisable" :value="record.status" />
|
||||
</template>
|
||||
|
||||
<template v-if="column.key === 'tenancyType'">
|
||||
<DictTag
|
||||
:options="dict.sysTenancyType"
|
||||
:value="record.tenancyType"
|
||||
/>
|
||||
<DictTag :options="dict.sysTenancyType" :value="record.tenancyType" />
|
||||
</template>
|
||||
|
||||
<template v-if="column.key === 'tenantId'">
|
||||
<a-space :size="8" align="center">
|
||||
<a-tooltip>
|
||||
<template #title>{{ t('common.editText') }}</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnModalVisibleByType(record.tenantId)"
|
||||
v-perms:has="['system:dept:edit']"
|
||||
>
|
||||
<template #icon><FormOutlined /></template>
|
||||
<a-button type="link" @click.prevent="fnModalVisibleByType(record.tenantId)">
|
||||
<template #icon>
|
||||
<FormOutlined />
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
|
||||
<a-tooltip v-if="record.parentId !== '0'">
|
||||
<template #title>{{ t('common.deleteText') }}</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnTypeRecordDelete(record)"
|
||||
v-perms:has="['system:dept:remove']"
|
||||
>
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
<a-button type="link" @click.prevent="fnTypeRecordDelete(record)">
|
||||
<template #icon>
|
||||
<DeleteOutlined />
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
@@ -952,45 +902,19 @@ onMounted(() => {
|
||||
</a-row>
|
||||
|
||||
<!-- Tenant--新增修改框 -->
|
||||
<a-modal
|
||||
width="800px"
|
||||
:keyboard="false"
|
||||
:mask-closable="false"
|
||||
:open="modalState.visibleByEdit"
|
||||
:title="modalState.title"
|
||||
@ok="fnModalOk"
|
||||
@cancel="fnModalCancel"
|
||||
:confirm-loading="modalState.confirmLoading"
|
||||
>
|
||||
<a-form
|
||||
name="modalStateFrom"
|
||||
layout="horizontal"
|
||||
:label-col="{ span: 8 }"
|
||||
:labelWrap="true"
|
||||
>
|
||||
<a-form-item
|
||||
:label="t('views.system.tenant.className')"
|
||||
name="tenantName"
|
||||
v-bind="modalStateFrom.validateInfos.tenantName"
|
||||
:label-col="{ span: 4 }"
|
||||
:labelWrap="true"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="modalState.from.tenantName"
|
||||
allow-clear
|
||||
:maxlength="18"
|
||||
>
|
||||
<a-modal width="800px" :keyboard="false" :mask-closable="false" :open="modalState.visibleByEdit"
|
||||
:title="modalState.title" @ok="fnModalOk" @cancel="fnModalCancel" :confirm-loading="modalState.confirmLoading">
|
||||
<a-form name="modalStateFrom" layout="horizontal" :label-col="{ span: 8 }" :labelWrap="true">
|
||||
<a-form-item :label="t('views.system.tenant.className')" name="tenantName"
|
||||
v-bind="modalStateFrom.validateInfos.tenantName" :label-col="{ span: 4 }" :labelWrap="true">
|
||||
<a-input v-model:value="modalState.from.tenantName" allow-clear :maxlength="18">
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.system.tenant.status')" name="status">
|
||||
<a-select
|
||||
v-model:value="modalState.from.status"
|
||||
default-value="0"
|
||||
:options="dict.sysNormalDisable"
|
||||
>
|
||||
<a-select v-model:value="modalState.from.status" default-value="0" :options="dict.sysNormalDisable">
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -999,122 +923,60 @@ onMounted(() => {
|
||||
</a-modal>
|
||||
|
||||
<!-- Tenant Type--新增修改框 -->
|
||||
<a-modal
|
||||
width="800px"
|
||||
:keyboard="false"
|
||||
:mask-closable="false"
|
||||
:open="modalState.visibleByType"
|
||||
:title="modalState.typeTitle"
|
||||
@ok="fnModalTypeOk"
|
||||
@cancel="fnModalCancel"
|
||||
:confirm-loading="modalState.confirmLoading"
|
||||
>
|
||||
<a-form
|
||||
name="modalStateTypeFrom"
|
||||
layout="horizontal"
|
||||
:label-col="{ span: 8 }"
|
||||
:labelWrap="true"
|
||||
>
|
||||
<a-modal width="800px" :keyboard="false" :mask-closable="false" :open="modalState.visibleByType"
|
||||
:title="modalState.typeTitle" @ok="fnModalTypeOk" @cancel="fnModalCancel"
|
||||
:confirm-loading="modalState.confirmLoading">
|
||||
<a-form name="modalStateTypeFrom" layout="horizontal" :label-col="{ span: 8 }" :labelWrap="true">
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="24" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.tenant.type')"
|
||||
name="type"
|
||||
:labelWrap="true"
|
||||
v-bind="modalStateTypeFrom.validateInfos.tenancyType"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="modalState.typeFrom.tenancyType"
|
||||
:options="dict.sysTenancyType"
|
||||
@change="fnTypeChange"
|
||||
>
|
||||
<a-form-item :label="t('views.system.tenant.type')" name="type" :labelWrap="true"
|
||||
v-bind="modalStateTypeFrom.validateInfos.tenancyType">
|
||||
<a-select v-model:value="modalState.typeFrom.tenancyType" :options="dict.sysTenancyType"
|
||||
@change="fnTypeChange">
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :lg="24" :md="24" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.tenant.key')"
|
||||
name="key"
|
||||
:extra="keyTip"
|
||||
:label-col="{ span: 4 }"
|
||||
v-bind="modalStateTypeFrom.validateInfos.tenancyKey"
|
||||
v-show="modalState.typeFrom.tenancyType == 'IMSI'"
|
||||
>
|
||||
<a-form-item :label="t('views.system.tenant.key')" name="key" :extra="keyTip" :label-col="{ span: 4 }"
|
||||
v-bind="modalStateTypeFrom.validateInfos.tenancyKey" v-show="modalState.typeFrom.tenancyType == 'IMSI'">
|
||||
<!-- <a-input
|
||||
v-model:value="modalState.typeFrom.tenancyKey"
|
||||
allow-clear
|
||||
></a-input> -->
|
||||
<a-select
|
||||
v-model:value="modalState.typeFrom.imsiMatch"
|
||||
:options="[
|
||||
{ label: t('views.neUser.sub.fuzzyMatch'), value: 'fuzzy' },
|
||||
{ label: t('views.neUser.sub.prefixMatch'), value: 'prefix' },
|
||||
{ label: t('views.neUser.sub.fullMatch'), value: 'full' },
|
||||
{ label: t('views.neUser.sub.suffixMatch'), value: 'suffix' },
|
||||
]"
|
||||
style="width: 20%"
|
||||
>
|
||||
<a-select v-model:value="modalState.typeFrom.imsiMatch" :options="[
|
||||
{ label: t('views.neUser.sub.fuzzyMatch'), value: 'fuzzy' },
|
||||
{ label: t('views.neUser.sub.prefixMatch'), value: 'prefix' },
|
||||
{ label: t('views.neUser.sub.fullMatch'), value: 'full' },
|
||||
{ label: t('views.neUser.sub.suffixMatch'), value: 'suffix' },
|
||||
]" style="width: 20%">
|
||||
</a-select>
|
||||
|
||||
<a-input
|
||||
v-model:value="modalState.typeFrom.tenancyKey"
|
||||
allow-clear
|
||||
style="width: 80%"
|
||||
></a-input>
|
||||
<a-input v-model:value="modalState.typeFrom.tenancyKey" allow-clear style="width: 80%"></a-input>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item
|
||||
:label="t('views.system.tenant.key')"
|
||||
name="key"
|
||||
:extra="keyTip"
|
||||
:label-col="{ span: 4 }"
|
||||
v-bind="modalStateTypeFrom.validateInfos.tenancyKey"
|
||||
v-show="modalState.typeFrom.tenancyType == 'UPF'"
|
||||
>
|
||||
<a-auto-complete
|
||||
v-model:value="modalState.typeFrom.tenancyKey"
|
||||
allow-clear
|
||||
:options="dict.allRmUid"
|
||||
/>
|
||||
<a-form-item :label="t('views.system.tenant.key')" name="key" :extra="keyTip" :label-col="{ span: 4 }"
|
||||
v-bind="modalStateTypeFrom.validateInfos.tenancyKey" v-show="modalState.typeFrom.tenancyType == 'UPF'">
|
||||
<a-auto-complete v-model:value="modalState.typeFrom.tenancyKey" allow-clear :options="dict.allRmUid" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item
|
||||
:label="t('views.system.tenant.key')"
|
||||
name="radioType"
|
||||
:label-col="{ span: 4 }"
|
||||
:extra="keyTip"
|
||||
v-bind="modalStateTypeFrom.validateInfos.radioType"
|
||||
v-show="modalState.typeFrom.tenancyType == 'RADIO'"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="modalState.typeFrom.radioType"
|
||||
:options="[
|
||||
{ label: '4G', value: '4G' },
|
||||
{ label: '5G', value: '5G' },
|
||||
]"
|
||||
@change="fnRadioIdChange"
|
||||
style="width: 20%"
|
||||
>
|
||||
<a-form-item :label="t('views.system.tenant.key')" name="radioType" :label-col="{ span: 4 }" :extra="keyTip"
|
||||
v-bind="modalStateTypeFrom.validateInfos.radioType" v-show="modalState.typeFrom.tenancyType == 'RADIO'">
|
||||
<a-select v-model:value="modalState.typeFrom.radioType" :options="[
|
||||
{ label: '4G', value: '4G' },
|
||||
{ label: '5G', value: '5G' },
|
||||
]" @change="fnRadioIdChange" style="width: 20%">
|
||||
</a-select>
|
||||
|
||||
<a-auto-complete
|
||||
v-model:value="modalState.typeFrom.radioId"
|
||||
:options="dict.allRadio"
|
||||
style="width: 20%"
|
||||
allow-clear
|
||||
/>
|
||||
<a-auto-complete v-model:value="modalState.typeFrom.radioId" :options="dict.allRadio" style="width: 20%"
|
||||
allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.system.tenant.status')" name="status">
|
||||
<a-select
|
||||
v-model:value="modalState.typeFrom.status"
|
||||
default-value="0"
|
||||
:options="dict.sysNormalDisable"
|
||||
>
|
||||
<a-select v-model:value="modalState.typeFrom.status" default-value="0" :options="dict.sysNormalDisable">
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -1131,12 +993,19 @@ onMounted(() => {
|
||||
|
||||
.treeNode {
|
||||
display: inline-block;
|
||||
width: 130px; /* 设置你想要的宽度 */
|
||||
overflow: hidden; /* 超出部分隐藏 */
|
||||
text-overflow: ellipsis; /* 超出部分显示省略号 */
|
||||
line-height: 30px; /* 设置行高,使文本垂直居中 */
|
||||
vertical-align: middle; /* 垂直居中 */
|
||||
white-space: nowrap; /* 不换行 */
|
||||
font-size: 16px; /* 设置字体大小 */
|
||||
width: 130px;
|
||||
/* 设置你想要的宽度 */
|
||||
overflow: hidden;
|
||||
/* 超出部分隐藏 */
|
||||
text-overflow: ellipsis;
|
||||
/* 超出部分显示省略号 */
|
||||
line-height: 30px;
|
||||
/* 设置行高,使文本垂直居中 */
|
||||
vertical-align: middle;
|
||||
/* 垂直居中 */
|
||||
white-space: nowrap;
|
||||
/* 不换行 */
|
||||
font-size: 16px;
|
||||
/* 设置字体大小 */
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user