fix: 网元软件多上传同开站逻辑

This commit is contained in:
TsMask
2024-05-28 15:29:45 +08:00
parent e00229e5ff
commit 22805924fb
2 changed files with 34 additions and 2 deletions

View File

@@ -65,6 +65,8 @@ type TabeStateType = {
data: object[];
/**勾选记录 */
selectedRowKeys: (string | number)[];
/**勾选单行记录 */
selectedRowOne: any;
};
/**表格状态 */
@@ -74,6 +76,8 @@ let tableState: TabeStateType = reactive({
seached: false,
data: [],
selectedRowKeys: [],
/**勾选单行记录 */
selectedRowOne: { neType: '' },
});
/**表格字段列 */
@@ -166,8 +170,17 @@ function fnTableSize({ key }: MenuInfo) {
}
/**表格多选 */
function fnTableSelectedRowKeys(keys: (string | number)[]) {
function fnTableSelectedRowKeys(
keys: (string | number)[],
selectedRows: any[]
) {
tableState.selectedRowKeys = keys;
// 勾选单个上传
if (selectedRows.length === 1) {
tableState.selectedRowOne = selectedRows[0];
} else {
tableState.selectedRowOne = { neType: '' };
}
}
/**查询列表, pageNum初始页数 */
@@ -414,6 +427,7 @@ onMounted(() => {
</a-button>
<a-button
type="primary"
:disabled="tableState.selectedRowKeys.length > 1"
@click.prevent="
() =>
(modalState.visibleByMoreFile = !modalState.visibleByMoreFile)
@@ -421,6 +435,7 @@ onMounted(() => {
>
<template #icon><UploadOutlined /></template>
{{ t('views.ne.neSoftware.uploadBatch') }}
{{ tableState.selectedRowOne.neType }}
</a-button>
<a-button
type="default"
@@ -565,6 +580,7 @@ onMounted(() => {
<!-- 新增多文件上传框 -->
<UploadMoreFile
v-model:visible="modalState.visibleByMoreFile"
:ne-type="tableState.selectedRowOne.neType"
@ok="fnModalEditOk"
@cancel="fnModalEditCancel"
></UploadMoreFile>

View File

@@ -67,6 +67,8 @@ type TabeStateType = {
data: any[];
/**勾选记录 */
selectedRowKeys: (string | number)[];
/**勾选单行记录 */
selectedRowOne: any;
};
/**表格状态 */
@@ -76,6 +78,8 @@ let tableState: TabeStateType = reactive({
seached: false,
data: [],
selectedRowKeys: [],
/**勾选单行记录 */
selectedRowOne: { neType: '' },
});
/**表格字段列 */
@@ -183,8 +187,17 @@ function fnTableSize({ key }: MenuInfo) {
}
/**表格多选 */
function fnTableSelectedRowKeys(keys: (string | number)[]) {
function fnTableSelectedRowKeys(
keys: (string | number)[],
selectedRows: any[]
) {
tableState.selectedRowKeys = keys;
// 勾选单个上传
if (selectedRows.length === 1) {
tableState.selectedRowOne = selectedRows[0];
} else {
tableState.selectedRowOne = { neType: '' };
}
}
/**查询列表, pageNum初始页数 */
@@ -487,6 +500,7 @@ onMounted(() => {
</a-button>
<a-button
type="primary"
:disabled="tableState.selectedRowKeys.length > 1"
@click.prevent="
() =>
(modalState.visibleByMoreFile = !modalState.visibleByMoreFile)
@@ -494,6 +508,7 @@ onMounted(() => {
>
<template #icon><UploadOutlined /></template>
{{ t('views.ne.neSoftware.uploadBatch') }}
{{ tableState.selectedRowOne.neType }}
</a-button>
<a-button
type="primary"
@@ -615,6 +630,7 @@ onMounted(() => {
<!-- 新增多文件上传框 -->
<UploadMoreFile
v-model:visible="modalState.visibleByMoreFile"
:ne-type="tableState.selectedRowOne.neType"
@ok="fnModalEditOk"
@cancel="fnModalEditCancel"
></UploadMoreFile>