fix: bug#16382、16381、16384
This commit is contained in:
parent
37868fd908
commit
291b65ba19
|
@ -210,6 +210,7 @@ import { PropertiesModal, FunctionModal, EventModal, TagsModal } from './DetailM
|
||||||
import { Modal } from 'jetlinks-ui-components'
|
import { Modal } from 'jetlinks-ui-components'
|
||||||
import {EventEmitter} from "@/utils/utils";
|
import {EventEmitter} from "@/utils/utils";
|
||||||
import {watch} from "vue";
|
import {watch} from "vue";
|
||||||
|
import {cloneDeep} from "lodash";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
target: {
|
target: {
|
||||||
|
@ -361,7 +362,7 @@ const handleAddClick = async (_data?: any, index?: number) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const copyItem = (record: any, index: number) => {
|
const copyItem = (record: any, index: number) => {
|
||||||
const copyData = omit(record, ['_uuid', '_sortIndex'])
|
const copyData = cloneDeep(omit(record, ['_uuid', '_sortIndex']))
|
||||||
copyData.id = `copy_${copyData.id}`.slice(0,64)
|
copyData.id = `copy_${copyData.id}`.slice(0,64)
|
||||||
handleAddClick(copyData, index)
|
handleAddClick(copyData, index)
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,6 +151,14 @@
|
||||||
/^([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$/,
|
/^([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$/,
|
||||||
message: '请输入正确的IP地址',
|
message: '请输入正确的IP地址',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
max: 65535,
|
||||||
|
message: '请输入1~65535之间的正整数'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
min: 1,
|
||||||
|
message: '请输入1~65535之间的正整数'
|
||||||
|
},
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<j-input-number
|
<j-input-number
|
||||||
|
@ -185,6 +193,7 @@
|
||||||
"
|
"
|
||||||
:min="1"
|
:min="1"
|
||||||
:max="65535"
|
:max="65535"
|
||||||
|
:precision="0"
|
||||||
/>
|
/>
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
</j-col>
|
</j-col>
|
||||||
|
@ -238,7 +247,6 @@
|
||||||
v-model:value="
|
v-model:value="
|
||||||
cluster.clusterNodeId
|
cluster.clusterNodeId
|
||||||
"
|
"
|
||||||
:options="clustersList"
|
|
||||||
placeholder="请选择节点名称"
|
placeholder="请选择节点名称"
|
||||||
allowClear
|
allowClear
|
||||||
show-search
|
show-search
|
||||||
|
@ -246,6 +254,9 @@
|
||||||
filterOption
|
filterOption
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
<j-select-option v-for="i in getClusterNodeIds(cluster.clusterNodeId)" :value="i.value">
|
||||||
|
{{ i.label}}
|
||||||
|
</j-select-option>
|
||||||
</j-select>
|
</j-select>
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
</j-col>
|
</j-col>
|
||||||
|
@ -309,16 +320,20 @@
|
||||||
<div class="form-label"></div>
|
<div class="form-label"></div>
|
||||||
<j-select
|
<j-select
|
||||||
v-model:value="cluster.port"
|
v-model:value="cluster.port"
|
||||||
:options="
|
|
||||||
sipListIndex[index]
|
|
||||||
"
|
|
||||||
placeholder="请选择端口"
|
placeholder="请选择端口"
|
||||||
allowClear
|
allowClear
|
||||||
show-search
|
show-search
|
||||||
:filter-option="
|
:filter-option="
|
||||||
filterOption
|
filterOption
|
||||||
"
|
"
|
||||||
/>
|
>
|
||||||
|
<j-select-option
|
||||||
|
v-for="i in getSipListOption(sipListIndex[index], cluster.port)"
|
||||||
|
:value="i.value"
|
||||||
|
>
|
||||||
|
{{ i.label }}
|
||||||
|
</j-select-option>
|
||||||
|
</j-select>
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
</j-col>
|
</j-col>
|
||||||
<j-col :span="4">
|
<j-col :span="4">
|
||||||
|
@ -389,6 +404,7 @@
|
||||||
"
|
"
|
||||||
:min="1"
|
:min="1"
|
||||||
:max="65535"
|
:max="65535"
|
||||||
|
:precision="0"
|
||||||
/>
|
/>
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
</j-col>
|
</j-col>
|
||||||
|
@ -450,23 +466,26 @@
|
||||||
</div>
|
</div>
|
||||||
</j-col>
|
</j-col>
|
||||||
<j-col :span="12">
|
<j-col :span="12">
|
||||||
<div class="doc" style="height: 400px">
|
<div style="height: 400px">
|
||||||
<h1>接入方式</h1>
|
<title-component data="配置概览" />
|
||||||
<p>
|
<j-descriptions :column="1" :labelStyle="{ width: '80px'}">
|
||||||
{{ provider.name }}
|
<j-descriptions-item label="接入方式">{{ provider.name }}</j-descriptions-item>
|
||||||
</p>
|
<j-descriptions-item>
|
||||||
<p>
|
<span style="color: #a3a3a3">{{ provider.description }}</span>
|
||||||
{{ provider.description }}
|
</j-descriptions-item>
|
||||||
</p>
|
<j-descriptions-item label="SIP 域">{{ formState.domain }}</j-descriptions-item>
|
||||||
<h1>消息协议</h1>
|
<j-descriptions-item label="SIP ID">{{ formState.sipId }}</j-descriptions-item>
|
||||||
<p>
|
<j-descriptions-item>
|
||||||
{{
|
<!-- 共享配置 -->
|
||||||
provider?.id === 'fixed-media'
|
<template v-if="formState.shareCluster">
|
||||||
? 'URL'
|
<a-badge :text="`${formState.hostPort.publicHost}:${formState.hostPort.publicPort}`" status="processing" />
|
||||||
: 'SIP'
|
</template>
|
||||||
}}
|
<template v-else>
|
||||||
</p>
|
<a-badge v-for="i in dynamicValidateForm.cluster" :text="`${i.publicHost}:${i.publicPort}`" status="processing" />
|
||||||
</div>
|
</template>
|
||||||
|
</j-descriptions-item>
|
||||||
|
</j-descriptions>
|
||||||
|
</div>
|
||||||
</j-col>
|
</j-col>
|
||||||
</j-row>
|
</j-row>
|
||||||
</div>
|
</div>
|
||||||
|
@ -667,8 +686,9 @@ const saveData = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const next = async () => {
|
const next = async () => {
|
||||||
|
|
||||||
let data1: any = await formRef1.value?.validate();
|
let data1: any = await formRef1.value?.validate();
|
||||||
if (!isNumber(data1.hostPort.port)) {
|
if (data1.hostPort?.port && !isNumber(data1.hostPort.port) && data1.shareCluster) {
|
||||||
data1.hostPort.port = JSON.parse(data1.hostPort.port).port;
|
data1.hostPort.port = JSON.parse(data1.hostPort.port).port;
|
||||||
}
|
}
|
||||||
if (!data1?.shareCluster) {
|
if (!data1?.shareCluster) {
|
||||||
|
@ -721,6 +741,16 @@ const develop = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getClusterNodeIds = (id?: string) => {
|
||||||
|
const keys = dynamicValidateForm?.cluster?.map?.(item => item.clusterNodeId) || []
|
||||||
|
return clustersList.value.filter(item => item.value === id || !keys.includes(item.value) )
|
||||||
|
}
|
||||||
|
|
||||||
|
const getSipListOption = (list: any[], id: string) => {
|
||||||
|
const keys = dynamicValidateForm?.cluster?.map?.(item => item.port) || []
|
||||||
|
return (list || []).filter(item => item.value === id || !keys.includes(item.value) )
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getResourcesCurrent().then((resp) => {
|
getResourcesCurrent().then((resp) => {
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
|
|
|
@ -3837,8 +3837,8 @@ jetlinks-ui-components@^1.0.23:
|
||||||
|
|
||||||
jetlinks-ui-components@^1.0.24:
|
jetlinks-ui-components@^1.0.24:
|
||||||
version "1.0.24"
|
version "1.0.24"
|
||||||
resolved "http://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.24.tgz#0bd3caf482367d46974244558519dfa7919baf1f"
|
resolved "http://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.24.tgz#a1262b3a735a01cd1fd9801406d16291b5070367"
|
||||||
integrity sha512-bXJZUWU27kDpnvhR+zKtUZQjrq+S130abBD2D37PnbHeUtT8g/i1CRV8Qnp1SMzk7aRDH9glVSjbzIQxem3YMQ==
|
integrity sha512-P4aolPQb1/wq4edN0AZ6WSavVAvQ+KEOEFzAarL/0dy6Oz3tTVemZmtgu20TsGbrNnEe/LheMu0QpvmkOq+3dg==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@vueuse/core" "^9.12.0"
|
"@vueuse/core" "^9.12.0"
|
||||||
"@vueuse/router" "^9.13.0"
|
"@vueuse/router" "^9.13.0"
|
||||||
|
|
Loading…
Reference in New Issue