feat:取消成功网元排列,仅保留显示失败网元
This commit is contained in:
@@ -245,8 +245,9 @@ async function fnModalOk() {
|
||||
message.warning(`${t('views.ne.neInfo.quickOam.success')} ${successCount} ,${t('views.ne.neInfo.quickOam.default')} ${failCount} `, 5);
|
||||
}
|
||||
|
||||
emit('ok');
|
||||
fnModalCancel();
|
||||
// 不自动关闭弹窗,让用户查看结果
|
||||
// emit('ok');
|
||||
// fnModalCancel();
|
||||
} catch (error: any) {
|
||||
message.error(t('common.errorFields', { num: error.errorFields?.length || 0 }), 3);
|
||||
} finally {
|
||||
@@ -271,6 +272,13 @@ function fnModalCancel() {
|
||||
emit('update:open', false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动关闭弹窗(用于操作完成后)
|
||||
*/
|
||||
function fnModalClose() {
|
||||
fnModalCancel();
|
||||
}
|
||||
|
||||
/**监听是否显示,初始数据 */
|
||||
watch(
|
||||
() => props.open,
|
||||
@@ -365,12 +373,12 @@ watch(
|
||||
{{ modalState.progress.current }} / {{ modalState.progress.total }}
|
||||
</span>
|
||||
</div>
|
||||
<!-- <Progress-->
|
||||
<!-- :percent="Math.round((modalState.progress.current / modalState.progress.total) * 100)"-->
|
||||
<!-- :status="modalState.progress.current === modalState.progress.total ? 'success' : 'active'"-->
|
||||
<!-- :show-info="false"-->
|
||||
<!-- style="overflow: hidden;"-->
|
||||
<!-- />-->
|
||||
<!-- <Progress-->
|
||||
<!-- :percent="Math.round((modalState.progress.current / modalState.progress.total) * 100)"-->
|
||||
<!-- :status="modalState.progress.current === modalState.progress.total ? 'success' : 'active'"-->
|
||||
<!-- :show-info="false"-->
|
||||
<!-- style="overflow: hidden;"-->
|
||||
<!-- />-->
|
||||
<div style="width: 100%; overflow: hidden;">
|
||||
<Progress
|
||||
:percent="Math.round((modalState.progress.current / modalState.progress.total) * 100)"
|
||||
@@ -385,32 +393,36 @@ watch(
|
||||
<div v-if="modalState.results.length > 0" style="margin-top: 20px;">
|
||||
<a-divider>{{ t('views.ne.neInfo.quickOam.result') }}</a-divider>
|
||||
<div style="max-height: 200px; overflow-y: auto;">
|
||||
<!-- 只显示失败的网元 -->
|
||||
<div
|
||||
v-for="(result, index) in modalState.results"
|
||||
v-for="(result, index) in modalState.results.filter(r => !r.success)"
|
||||
:key="index"
|
||||
style="margin-bottom: 8px; padding: 8px; border-radius: 4px;"
|
||||
:style="{
|
||||
backgroundColor: result.success ? '#f6ffed' : '#fff2f0',
|
||||
border: `1px solid ${result.success ? '#b7eb8f' : '#ffccc7'}`,
|
||||
backgroundColor: '#fff2f0',
|
||||
border: '1px solid #ffccc7',
|
||||
}"
|
||||
>
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<span>
|
||||
<CheckCircleOutlined
|
||||
v-if="result.success"
|
||||
:style="{ color: '#52c41a', marginRight: '8px' }"
|
||||
/>
|
||||
<CloseCircleOutlined
|
||||
v-else
|
||||
:style="{ color: '#ff4d4f', marginRight: '8px' }"
|
||||
/>
|
||||
{{ result.neType }}-{{ result.neId }} ({{ result.neName }})
|
||||
</span>
|
||||
<span :style="{ color: result.success ? '#52c41a' : '#ff4d4f', fontSize: '12px' }">
|
||||
<span :style="{ color: '#ff4d4f', fontSize: '12px' }">
|
||||
{{ result.message }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 如果没有失败的网元,显示提示信息 -->
|
||||
<div
|
||||
v-if="modalState.results.filter(r => !r.success).length === 0"
|
||||
style="text-align: center; padding: 20px; color: #52c41a;"
|
||||
>
|
||||
<CheckCircleOutlined :style="{ marginRight: '8px' }" />
|
||||
所有网元配置成功!
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ProModal>
|
||||
|
||||
Reference in New Issue
Block a user