fix: 网元主机信息编辑表单不验证免密类型, 主机列表的查询类型参数

This commit is contained in:
TsMask
2025-05-16 17:52:10 +08:00
parent 39d63dea42
commit 6a8936a9ba
2 changed files with 28 additions and 11 deletions

View File

@@ -142,14 +142,14 @@ function fnModalOk() {
const validateArr = ['title', 'addr', 'port', 'user'];
if (form.authMode === '0') {
validateArr.push('password');
} else {
} else if (form.authMode === '1') {
validateArr.push('privateKey');
}
modalStateFrom
.validate(validateArr)
.then(() => {
modalState.confirmLoading = true;
const neHost = form.id > 0 ? updateNeHost(form) : addNeHost(form);
const neHost = form.id ? updateNeHost(form) : addNeHost(form);
const hide = message.loading(t('common.loading'), 0);
neHost
.then(res => {

View File

@@ -289,15 +289,32 @@ onMounted(() => {
<!-- 插槽-卡片右侧 -->
<template #extra>
<a-auto-complete
v-model:value="queryParams.title"
:options="neListStore.getNeSelectOtions"
allow-clear
size="small"
:placeholder="t('common.inputPlease')"
@change="fnGetList(1)"
style="width: 180px"
/>
<a-space :size="8" align="center" direction="horizontal">
<a-form layout="inline">
<a-form-item :label="t('views.ne.neHost.hostType')" name="hostType">
<a-select
v-model:value="queryParams.hostType"
:options="dict.neHostType"
allow-clear
size="small"
:placeholder="t('common.selectPlease')"
@change="fnGetList(1)"
style="width: 100px"
/>
</a-form-item>
<a-form-item :label="t('views.ne.neHost.title')" name="title">
<a-auto-complete
v-model:value="queryParams.title"
:options="neListStore.getNeSelectOtions"
allow-clear
size="small"
:placeholder="t('common.inputPlease')"
@change="fnGetList(1)"
style="width: 180px"
/>
</a-form-item>
</a-form>
</a-space>
</template>
<!-- 表格列表 -->