feat: 网元授权文件支持勾选指定网元类型替换

This commit is contained in:
TsMask
2024-04-29 18:17:45 +08:00
parent dd5604c8b7
commit 2d7fe5a73b
2 changed files with 130 additions and 45 deletions

View File

@@ -60,6 +60,8 @@ type StateType = {
selectedRowKeys: (string | number)[];
/**授权文件上传 */
visibleByLicenseFile: boolean;
/**授权文件上传勾选指定到网元授权列表 */
neLicenseList: any[];
/**确定按钮 loading */
confirmLoading: boolean;
};
@@ -70,6 +72,7 @@ let state: StateType = reactive({
data: [],
selectedRowKeys: [],
visibleByLicenseFile: false,
neLicenseList: [],
confirmLoading: false,
});
@@ -88,6 +91,21 @@ function fnModalCancel() {
state.visibleByLicenseFile = false;
}
/**对话框弹出打开执行函数 */
function fnModalOpen() {
if (state.selectedRowKeys.length > 0) {
// 勾选的网元数据的网元类型
let neTypeArr = state.data.filter(item =>
state.selectedRowKeys.includes(item.id)
);
state.neLicenseList = neTypeArr;
}else{
state.neLicenseList = []
}
state.visibleByLicenseFile = !state.visibleByLicenseFile;
}
/**勾选刷新网元状态 */
function fnRecordState() {
Modal.confirm({
@@ -236,6 +254,7 @@ onMounted(() => {
<!-- 授权文件上传框 -->
<UploadLicenseFile
v-model:visible="state.visibleByLicenseFile"
:licenseList="state.neLicenseList"
@ok="fnModalOk"
@cancel="fnModalCancel"
></UploadLicenseFile>
@@ -244,12 +263,7 @@ onMounted(() => {
<a-space direction="horizontal" :size="18">
<a-button @click="fnStepPrev()"> 上一步 </a-button>
<a-button
type="primary"
@click.prevent="
() => (state.visibleByLicenseFile = !state.visibleByLicenseFile)
"
>
<a-button type="primary" @click.prevent="fnModalOpen">
<template #icon><UploadOutlined /></template>
Upload License
</a-button>