-
+
+
+
+
+
+ -->
+
-
-
-
+
+
+
+
+
+
+
+
+
+ 共享配置
+ 独立配置
+
+
-
-
-
-
-
+
+
-
+
-
-
+
+
+
@@ -854,7 +991,7 @@
-
+
+
-
+
+
+
+
+
+
+
@@ -1081,29 +2071,26 @@ import {
InfoCircleOutlined,
} from '@ant-design/icons-vue';
// import { update, save } from '@/api/link/accessConfig';
-import { FormStates, VisibleData, ParserTypeOptions, isVisible } from '../data';
-interface Form2 {
- clusterNodeId: string;
- port: string;
- host: string;
- publicPort: string;
- publicHost: string;
- id: number;
-}
-// interface FormState {
-// name: string;
-// type: undefined;
-// shareCluster: boolean;
-// configuration: {
-// port: string;
-// host: string;
-// publicPort: string;
-// publicHost: string;
-// };
-// secure: boolean;
-// certId: string;
-// privateKeyAlias: string;
-// parserType: string;
+import {
+ FormStates,
+ FormStates2,
+ DefaultFormStates,
+ VisibleData,
+ ParserTypeOptions,
+ isVisible,
+ Validator,
+ LengthOptions,
+ LittleOptions,
+} from '../data';
+import type { Form2 } from '../type';
+
+// interface Form2 {
+// clusterNodeId: string;
+// port: string;
+// host: string;
+// publicPort: string;
+// publicHost: string;
+// id: number;
// }
const props = defineProps({
@@ -1121,7 +2108,7 @@ const route = useRoute();
const view = route.query.view as string;
const id = route.params.id as string;
-const activeKey: any = ref([]);
+const activeKey: any = ref([1]);
const clientHeight = document.body.clientHeight;
const formRef1 = ref
();
@@ -1147,11 +2134,14 @@ const sipListIndex: any = ref([]);
const clustersList = ref([]);
const typeOption = ref([]);
-const dynamicValidateForm = reactive<{ cluster: Form2[] }>({
- cluster: [],
-});
+let dynamicValidateForm = reactive({ ...DefaultFormStates });
+// const dynamicValidateForm = reactive<{ cluster: Form2[] }>({
+// ...FormStates,
+// cluster: [{ ...FormStates2, id: 1 }],
+// });
+console.log(221, dynamicValidateForm);
-const removeCluster = (item: Form2) => {
+const removeCluster = (item) => {
let index = dynamicValidateForm.cluster.indexOf(item);
if (index !== -1) {
dynamicValidateForm.cluster.splice(index, 1);
@@ -1161,11 +2151,7 @@ const removeCluster = (item: Form2) => {
const addCluster = () => {
const id = Date.now();
dynamicValidateForm.cluster.push({
- clusterNodeId: '',
- port: '',
- host: '',
- publicPort: '',
- publicHost: '',
+ ...FormStates2,
id,
});
activeKey.value = [...activeKey.value, id.toString()];
@@ -1176,8 +2162,8 @@ const filterOption = (input: string, option: any) => {
};
const handleChangeForm2Sip = (index: number) => {
- dynamicValidateForm.cluster[index].port = '';
- const value = dynamicValidateForm.cluster[index].host;
+ dynamicValidateForm.cluster.configuration.port = undefined;
+ const value = dynamicValidateForm.cluster.configuration.host;
sipListIndex.value[index] = sipListConst
.find((i: any) => i.host === value)
?.portList.map((i: any) => {
@@ -1293,12 +2279,18 @@ onMounted(() => {
if (id !== ':id') {
formState.value = props.data.configuration;
- formData.value = {
- name: props.data.name,
- description: props.data?.description || '',
- };
+ // formData.value = {
+ // name: props.data.name,
+ // description: props.data?.description || '',
+ // };
}
});
+
+const shareCluster = ref(true);
+const changeShareCluster = (value: boolean) => {
+ shareCluster.value = value;
+ dynamicValidateForm.cluster = [{ ...FormStates2, id: 1 }];
+};