fix: bug#11233、11240、11236
This commit is contained in:
parent
f5afc16a1f
commit
f4f190fa01
|
@ -621,6 +621,14 @@
|
|||
'secure',
|
||||
]"
|
||||
:rules="Rules.secure"
|
||||
@change="
|
||||
changeSecure(
|
||||
cluster
|
||||
.configuration
|
||||
.secure,
|
||||
index,
|
||||
)
|
||||
"
|
||||
>
|
||||
<j-radio-group
|
||||
v-model:value="
|
||||
|
@ -1095,6 +1103,8 @@ import {
|
|||
start,
|
||||
} from '@/api/link/type';
|
||||
import {
|
||||
ParserConfiguration,
|
||||
Configuration,
|
||||
FormStates,
|
||||
FormStates2,
|
||||
ParserTypeOptions,
|
||||
|
@ -1243,9 +1253,19 @@ const changeHost = (
|
|||
};
|
||||
|
||||
const changeParserType = (value: string | undefined, index: number) => {
|
||||
const { parserConfiguration } =
|
||||
dynamicValidateForm.cluster[index].configuration;
|
||||
value === 'SCRIPT' ? (parserConfiguration.lang = 'javascript') : '';
|
||||
const configuration: any = dynamicValidateForm.cluster[index].configuration;
|
||||
configuration.parserConfiguration = cloneDeep(ParserConfiguration);
|
||||
value === 'SCRIPT'
|
||||
? (configuration.parserConfiguration.lang = 'javascript')
|
||||
: '';
|
||||
};
|
||||
const changeSecure = (value: string | undefined, index: number) => {
|
||||
if (!value) {
|
||||
const configuration: any =
|
||||
dynamicValidateForm.cluster[index].configuration;
|
||||
configuration.certId = undefined;
|
||||
configuration.privateKeyAlias = '';
|
||||
}
|
||||
};
|
||||
|
||||
const saveData = async () => {
|
||||
|
@ -1330,10 +1350,15 @@ const getDetail = () => {
|
|||
shareCluster.value = result.shareCluster;
|
||||
activeKey.value = ['1'];
|
||||
if (result.shareCluster) {
|
||||
dynamicValidateForm.cluster[0].configuration =
|
||||
configuration;
|
||||
dynamicValidateForm.cluster[0].configuration = {
|
||||
...cloneDeep(Configuration), //防止编辑时,表单字段不完善,导致输入/选择框新出现时找不到
|
||||
...configuration,
|
||||
};
|
||||
} else {
|
||||
dynamicValidateForm.cluster = cluster;
|
||||
dynamicValidateForm.cluster = {
|
||||
...cloneDeep(FormStates2), //同上
|
||||
...cluster,
|
||||
};
|
||||
}
|
||||
|
||||
if (dynamicValidateForm.cluster.length === 1) {
|
||||
|
|
|
@ -1,3 +1,13 @@
|
|||
export const ParserConfiguration = {
|
||||
delimited: '',
|
||||
lang: '',
|
||||
script: '',
|
||||
size: '',
|
||||
length: '4',
|
||||
offset: undefined,
|
||||
little: undefined,
|
||||
};
|
||||
|
||||
export const Configuration = {
|
||||
parserType: undefined,
|
||||
port: undefined,
|
||||
|
@ -14,15 +24,7 @@ export const Configuration = {
|
|||
certId: undefined,
|
||||
privateKeyAlias: '',
|
||||
clientId: '',
|
||||
parserConfiguration: {
|
||||
delimited: '',
|
||||
lang: '',
|
||||
script: '',
|
||||
size: '',
|
||||
length: '4',
|
||||
offset: undefined,
|
||||
little: undefined,
|
||||
},
|
||||
parserConfiguration: ParserConfiguration,
|
||||
};
|
||||
|
||||
export const FormStates = {
|
||||
|
@ -230,8 +232,7 @@ export const Rules = {
|
|||
],
|
||||
password: [
|
||||
{
|
||||
// required: true,
|
||||
required: false,
|
||||
required: true,
|
||||
message: '请输入密码',
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue