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']; const validateArr = ['title', 'addr', 'port', 'user'];
if (form.authMode === '0') { if (form.authMode === '0') {
validateArr.push('password'); validateArr.push('password');
} else { } else if (form.authMode === '1') {
validateArr.push('privateKey'); validateArr.push('privateKey');
} }
modalStateFrom modalStateFrom
.validate(validateArr) .validate(validateArr)
.then(() => { .then(() => {
modalState.confirmLoading = true; 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); const hide = message.loading(t('common.loading'), 0);
neHost neHost
.then(res => { .then(res => {

View File

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