fix: 网元授权许可证状态统一刷新功能
This commit is contained in:
@@ -624,8 +624,8 @@ export default {
|
|||||||
change: "Change License",
|
change: "Change License",
|
||||||
reload: "Refresh Info",
|
reload: "Refresh Info",
|
||||||
reloadTip: "Confirmed to refresh license information?",
|
reloadTip: "Confirmed to refresh license information?",
|
||||||
reloadBatch: "Batch Refresh Info",
|
reloadBatch: "Refresh License Status",
|
||||||
reloadBatchTip: "Do you do an information refresh on checked records?",
|
reloadBatchTip: "Do you perform a license status information refresh for the current list of NE?",
|
||||||
updateTtile: "Update License",
|
updateTtile: "Update License",
|
||||||
downCodeTop: "Confirmed to save the license activation code to a file?",
|
downCodeTop: "Confirmed to save the license activation code to a file?",
|
||||||
activationRequestCode: "License Activation Code",
|
activationRequestCode: "License Activation Code",
|
||||||
|
|||||||
@@ -624,8 +624,8 @@ export default {
|
|||||||
change: "变更许可证",
|
change: "变更许可证",
|
||||||
reload: "刷新信息",
|
reload: "刷新信息",
|
||||||
reloadTip: "确认要刷新许可证信息吗?",
|
reloadTip: "确认要刷新许可证信息吗?",
|
||||||
reloadBatch: "批量信息刷新",
|
reloadBatch: "刷新许可证状态",
|
||||||
reloadBatchTip: "对勾选的记录进行信息刷新吗?",
|
reloadBatchTip: "对当前列表网元进行许可证状态信息刷新吗?",
|
||||||
updateTtile: "更新许可证",
|
updateTtile: "更新许可证",
|
||||||
downCodeTop: "确认要将许可激活码保存到文件吗?",
|
downCodeTop: "确认要将许可激活码保存到文件吗?",
|
||||||
activationRequestCode: "许可激活码",
|
activationRequestCode: "许可激活码",
|
||||||
|
|||||||
@@ -54,21 +54,15 @@ type TabeStateType = {
|
|||||||
loading: boolean;
|
loading: boolean;
|
||||||
/**紧凑型 */
|
/**紧凑型 */
|
||||||
size: SizeType;
|
size: SizeType;
|
||||||
/**搜索栏 */
|
|
||||||
seached: boolean;
|
|
||||||
/**记录数据 */
|
/**记录数据 */
|
||||||
data: any[];
|
data: any[];
|
||||||
/**勾选记录 */
|
|
||||||
selectedRowKeys: (string | number)[];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**表格状态 */
|
/**表格状态 */
|
||||||
let tableState: TabeStateType = reactive({
|
let tableState: TabeStateType = reactive({
|
||||||
loading: false,
|
loading: false,
|
||||||
size: 'middle',
|
size: 'middle',
|
||||||
seached: false,
|
|
||||||
data: [],
|
data: [],
|
||||||
selectedRowKeys: [],
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**表格字段列 */
|
/**表格字段列 */
|
||||||
@@ -182,11 +176,6 @@ function fnTableSize({ key }: MenuInfo) {
|
|||||||
tableState.size = key as SizeType;
|
tableState.size = key as SizeType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**表格多选 */
|
|
||||||
function fnTableSelectedRowKeys(keys: (string | number)[]) {
|
|
||||||
tableState.selectedRowKeys = keys;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**查询列表, pageNum初始页数 */
|
/**查询列表, pageNum初始页数 */
|
||||||
function fnGetList(pageNum?: number) {
|
function fnGetList(pageNum?: number) {
|
||||||
if (tableState.loading) return;
|
if (tableState.loading) return;
|
||||||
@@ -197,8 +186,16 @@ function fnGetList(pageNum?: number) {
|
|||||||
listNeLicense(toRaw(queryParams)).then(res => {
|
listNeLicense(toRaw(queryParams)).then(res => {
|
||||||
if (res.code === RESULT_CODE_SUCCESS) {
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
const { total, rows } = res.data;
|
const { total, rows } = res.data;
|
||||||
tablePagination.total = total;
|
let totalV = total;
|
||||||
tableState.data = rows.filter((s: any) => s.neType !== 'OMC');
|
let rowsV = rows.filter((s: any) => {
|
||||||
|
if (s.neType !== 'OMC') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
totalV -= 1;
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
tableState.data = rowsV;
|
||||||
|
tablePagination.total = totalV;
|
||||||
if (
|
if (
|
||||||
tablePagination.total <=
|
tablePagination.total <=
|
||||||
(queryParams.pageNum - 1) * tablePagination.pageSize &&
|
(queryParams.pageNum - 1) * tablePagination.pageSize &&
|
||||||
@@ -310,8 +307,8 @@ function fnRecordState(row: Record<string, any>) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**刷新网元授权状态 勾选 */
|
/**刷新网元授权状态 重载 */
|
||||||
function fnRecordStateBatch() {
|
function fnRecordStateReload() {
|
||||||
if (modalState.confirmLoading) return;
|
if (modalState.confirmLoading) return;
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: t('common.tipTitle'),
|
title: t('common.tipTitle'),
|
||||||
@@ -319,12 +316,7 @@ function fnRecordStateBatch() {
|
|||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
modalState.confirmLoading = true;
|
modalState.confirmLoading = true;
|
||||||
const hide = message.loading(t('common.loading'), 0);
|
const hide = message.loading(t('common.loading'), 0);
|
||||||
// 勾选的网元数据
|
for (const row of tableState.data) {
|
||||||
const selectRows = tableState.data.filter(item =>
|
|
||||||
tableState.selectedRowKeys.includes(item.id)
|
|
||||||
);
|
|
||||||
|
|
||||||
for (const row of selectRows) {
|
|
||||||
if (row.neType.toUpperCase() === 'OMC') {
|
if (row.neType.toUpperCase() === 'OMC') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -336,7 +328,6 @@ function fnRecordStateBatch() {
|
|||||||
} else {
|
} else {
|
||||||
row.status = '0';
|
row.status = '0';
|
||||||
}
|
}
|
||||||
tableState.selectedRowKeys = [];
|
|
||||||
}
|
}
|
||||||
message.success(t('common.operateOk'), 3);
|
message.success(t('common.operateOk'), 3);
|
||||||
hide();
|
hide();
|
||||||
@@ -361,7 +352,6 @@ onMounted(() => {
|
|||||||
<template>
|
<template>
|
||||||
<PageContainer>
|
<PageContainer>
|
||||||
<a-card
|
<a-card
|
||||||
v-show="tableState.seached"
|
|
||||||
:bordered="false"
|
:bordered="false"
|
||||||
:body-style="{ marginBottom: '24px', paddingBottom: 0 }"
|
:body-style="{ marginBottom: '24px', paddingBottom: 0 }"
|
||||||
>
|
>
|
||||||
@@ -423,9 +413,8 @@ onMounted(() => {
|
|||||||
<a-space :size="8" align="center">
|
<a-space :size="8" align="center">
|
||||||
<a-button
|
<a-button
|
||||||
type="default"
|
type="default"
|
||||||
:disabled="tableState.selectedRowKeys.length <= 0"
|
|
||||||
:loading="modalState.confirmLoading"
|
:loading="modalState.confirmLoading"
|
||||||
@click.prevent="fnRecordStateBatch()"
|
@click.prevent="fnRecordStateReload()"
|
||||||
>
|
>
|
||||||
<template #icon><SyncOutlined /></template>
|
<template #icon><SyncOutlined /></template>
|
||||||
{{ t('views.ne.neLicense.reloadBatch') }}
|
{{ t('views.ne.neLicense.reloadBatch') }}
|
||||||
@@ -436,21 +425,6 @@ onMounted(() => {
|
|||||||
<!-- 插槽-卡片右侧 -->
|
<!-- 插槽-卡片右侧 -->
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<a-space :size="8" align="center">
|
<a-space :size="8" align="center">
|
||||||
<a-tooltip>
|
|
||||||
<template #title>{{ t('common.searchBarText') }}</template>
|
|
||||||
<a-switch
|
|
||||||
v-model:checked="tableState.seached"
|
|
||||||
:checked-children="t('common.switch.show')"
|
|
||||||
:un-checked-children="t('common.switch.hide')"
|
|
||||||
size="small"
|
|
||||||
/>
|
|
||||||
</a-tooltip>
|
|
||||||
<a-tooltip>
|
|
||||||
<template #title>{{ t('common.reloadText') }}</template>
|
|
||||||
<a-button type="text" @click.prevent="fnGetList()">
|
|
||||||
<template #icon><ReloadOutlined /></template>
|
|
||||||
</a-button>
|
|
||||||
</a-tooltip>
|
|
||||||
<a-tooltip placement="topRight">
|
<a-tooltip placement="topRight">
|
||||||
<template #title>{{ t('common.sizeText') }}</template>
|
<template #title>{{ t('common.sizeText') }}</template>
|
||||||
<a-dropdown placement="bottomRight" trigger="click">
|
<a-dropdown placement="bottomRight" trigger="click">
|
||||||
@@ -489,12 +463,6 @@ onMounted(() => {
|
|||||||
:pagination="tablePagination"
|
:pagination="tablePagination"
|
||||||
:scroll="{ x: tableColumns.length * 140 }"
|
:scroll="{ x: tableColumns.length * 140 }"
|
||||||
@resizeColumn="(w:number, col:any) => (col.width = w)"
|
@resizeColumn="(w:number, col:any) => (col.width = w)"
|
||||||
:row-selection="{
|
|
||||||
type: 'checkbox',
|
|
||||||
columnWidth: '48px',
|
|
||||||
selectedRowKeys: tableState.selectedRowKeys,
|
|
||||||
onChange: fnTableSelectedRowKeys,
|
|
||||||
}"
|
|
||||||
>
|
>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'status'">
|
<template v-if="column.key === 'status'">
|
||||||
|
|||||||
Reference in New Issue
Block a user