fix: bug#11010、11021、11029、11031、11032 修复通道管理部分bug

This commit is contained in:
jackhoo_98 2023-03-27 21:59:12 +08:00
parent 7b17adc477
commit c366f4a2cc
3 changed files with 11 additions and 7 deletions

View File

@ -195,7 +195,7 @@ import {
import { FormValidate, FormState } from '../data';
import type { FormInstance } from 'ant-design-vue';
import type { FormDataType } from '../type.d';
import { isArray } from 'lodash-es';
import { cloneDeep, isArray } from 'lodash-es';
const props = defineProps({
data: {
@ -217,7 +217,7 @@ const Options = ref({
'security-policies': [],
});
const formData = ref<FormDataType>(FormState);
const formData = ref<FormDataType>(cloneDeep(FormState));
const handleOk = async () => {
const params = await formRef.value?.validate();
@ -238,11 +238,12 @@ const handleCancel = () => {
const changeAuthType = (value: Array<string>) => {
formData.value.configuration.authType = value[0];
};
const isAuthType = computed(() => {
const { authType } = formData.value.configuration;
return isArray(authType)
? authType[0] === 'username'
: authType === 'username';
? authType[0] === 'username' && formData.value.provider === 'OPC_UA'
: authType === 'username' && formData.value.provider === 'OPC_UA';
});
const isSecurityMode = computed(() => {
const { securityMode } = formData.value.configuration;

View File

@ -9,10 +9,10 @@ export const FormState: FormDataType = {
host: '',
port: '502',
endpoint: '',
securityPolicy: undefined,
securityPolicy: 'None',
securityMode: undefined,
certificate: undefined,
authType: undefined,
authType: 'username',
username: '',
password: '',
},

View File

@ -198,6 +198,9 @@ const columns = [
dataIndex: 'description',
key: 'description',
ellipsis: true,
search: {
type: 'string',
},
},
{
title: '操作',
@ -254,7 +257,7 @@ const getActions = (
state === 'enabled' ? '请先禁用该组件,再删除。' : '删除',
},
popConfirm: {
title: '确认删除?',
title: '该操作将会删除下属采集器与点位,确定删除?',
onConfirm: async () => {
const res = await remove(data.id);
if (res.success) {