This commit is contained in:
TsMask
2025-09-25 15:30:32 +08:00
3 changed files with 33 additions and 19 deletions

View File

@@ -600,6 +600,7 @@ export default {
result:'Result', result:'Result',
success:'Success', success:'Success',
default:'Default', default:'Default',
allsuccess:'All NE have been configured successfully!',
}, },
quickUpload: { quickUpload: {
title: 'Quick License Upload', title: 'Quick License Upload',

View File

@@ -600,6 +600,7 @@ export default {
result:'操作结果', result:'操作结果',
success:'成功', success:'成功',
default:'失败', default:'失败',
allsuccess:'所有网元配置成功!',
}, },
quickUpload: { quickUpload: {
title: '快速许可证上传', title: '快速许可证上传',

View File

@@ -245,8 +245,9 @@ async function fnModalOk() {
message.warning(`${t('views.ne.neInfo.quickOam.success')} ${successCount} ${t('views.ne.neInfo.quickOam.default')} ${failCount} `, 5); 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) { } catch (error: any) {
message.error(t('common.errorFields', { num: error.errorFields?.length || 0 }), 3); message.error(t('common.errorFields', { num: error.errorFields?.length || 0 }), 3);
} finally { } finally {
@@ -271,6 +272,13 @@ function fnModalCancel() {
emit('update:open', false); emit('update:open', false);
} }
/**
* 手动关闭弹窗(用于操作完成后)
*/
function fnModalClose() {
fnModalCancel();
}
/**监听是否显示,初始数据 */ /**监听是否显示,初始数据 */
watch( watch(
() => props.open, () => props.open,
@@ -365,12 +373,12 @@ watch(
{{ modalState.progress.current }} / {{ modalState.progress.total }} {{ modalState.progress.current }} / {{ modalState.progress.total }}
</span> </span>
</div> </div>
<!-- <Progress--> <!-- <Progress-->
<!-- :percent="Math.round((modalState.progress.current / modalState.progress.total) * 100)"--> <!-- :percent="Math.round((modalState.progress.current / modalState.progress.total) * 100)"-->
<!-- :status="modalState.progress.current === modalState.progress.total ? 'success' : 'active'"--> <!-- :status="modalState.progress.current === modalState.progress.total ? 'success' : 'active'"-->
<!-- :show-info="false"--> <!-- :show-info="false"-->
<!-- style="overflow: hidden;"--> <!-- style="overflow: hidden;"-->
<!-- />--> <!-- />-->
<div style="width: 100%; overflow: hidden;"> <div style="width: 100%; overflow: hidden;">
<Progress <Progress
:percent="Math.round((modalState.progress.current / modalState.progress.total) * 100)" :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;"> <div v-if="modalState.results.length > 0" style="margin-top: 20px;">
<a-divider>{{ t('views.ne.neInfo.quickOam.result') }}</a-divider> <a-divider>{{ t('views.ne.neInfo.quickOam.result') }}</a-divider>
<div style="max-height: 200px; overflow-y: auto;"> <div style="max-height: 200px; overflow-y: auto;">
<!-- 只显示失败的网元 -->
<div <div
v-for="(result, index) in modalState.results" v-for="(result, index) in modalState.results.filter(r => !r.success)"
:key="index" :key="index"
style="margin-bottom: 8px; padding: 8px; border-radius: 4px;" style="margin-bottom: 8px; padding: 8px; border-radius: 4px;"
:style="{ :style="{
backgroundColor: result.success ? '#f6ffed' : '#fff2f0', backgroundColor: '#fff2f0',
border: `1px solid ${result.success ? '#b7eb8f' : '#ffccc7'}`, border: '1px solid #ffccc7',
}" }"
> >
<div style="display: flex; justify-content: space-between; align-items: center;"> <div style="display: flex; justify-content: space-between; align-items: center;">
<span> <span>
<CheckCircleOutlined
v-if="result.success"
:style="{ color: '#52c41a', marginRight: '8px' }"
/>
<CloseCircleOutlined <CloseCircleOutlined
v-else
:style="{ color: '#ff4d4f', marginRight: '8px' }" :style="{ color: '#ff4d4f', marginRight: '8px' }"
/> />
{{ result.neType }}-{{ result.neId }} ({{ result.neName }}) {{ result.neType }}-{{ result.neId }} ({{ result.neName }})
</span> </span>
<span :style="{ color: result.success ? '#52c41a' : '#ff4d4f', fontSize: '12px' }"> <span :style="{ color: '#ff4d4f', fontSize: '12px' }">
{{ result.message }} {{ result.message }}
</span> </span>
</div> </div>
</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' }" />
{{ t('views.ne.neInfo.quickOam.allsuccess') }}
</div>
</div> </div>
</div> </div>
</ProModal> </ProModal>