只在添加或修改MX和SRV类型的记录时显示优先级
This commit is contained in:
parent
6d05fa9fdf
commit
3cfab004f0
@ -213,7 +213,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="px-4 py-4 whitespace-nowrap">
|
<td class="px-4 py-4 whitespace-nowrap">
|
||||||
<!-- 优先级编辑 -->
|
<!-- 优先级编辑 -->
|
||||||
<div v-if="record.editing" class="flex items-center space-x-2">
|
<div v-if="record.editing && (record.type === 'MX' || record.type === 'SRV')" class="flex items-center space-x-2">
|
||||||
<input
|
<input
|
||||||
v-model="record.level"
|
v-model="record.level"
|
||||||
type="number"
|
type="number"
|
||||||
@ -223,7 +223,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="text-sm text-gray-500">
|
<div v-else class="text-sm text-gray-500">
|
||||||
{{ record.type === 'MX' && record.level ? record.level : '-' }}
|
{{ (record.type === 'MX' || record.type === 'SRV') && record.level ? record.level : '-' }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-4 py-4 whitespace-nowrap text-sm">
|
<td class="px-4 py-4 whitespace-nowrap text-sm">
|
||||||
@ -470,7 +470,7 @@ export default {
|
|||||||
line: '',
|
line: '',
|
||||||
value: '',
|
value: '',
|
||||||
ttl: 600,
|
ttl: 600,
|
||||||
level: 10,
|
level: null, // 默认不设置优先级
|
||||||
editing: true, // 新增记录直接进入编辑模式
|
editing: true, // 新增记录直接进入编辑模式
|
||||||
isNew: true
|
isNew: true
|
||||||
};
|
};
|
||||||
@ -500,8 +500,8 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证优先级
|
// 验证优先级 - 只在MX或SRV类型时验证
|
||||||
if (record.level < 1 || record.level > 100) {
|
if ((record.type === 'MX' || record.type === 'SRV') && (record.level < 1 || record.level > 100)) {
|
||||||
toast.error('优先级必须在1~100之间');
|
toast.error('优先级必须在1~100之间');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -518,9 +518,12 @@ export default {
|
|||||||
host: record.item,
|
host: record.item,
|
||||||
value: record.value,
|
value: record.value,
|
||||||
ttl: record.ttl,
|
ttl: record.ttl,
|
||||||
level: record.level,
|
|
||||||
line: record.line
|
line: record.line
|
||||||
};
|
};
|
||||||
|
// 只在MX或SRV类型时添加level参数
|
||||||
|
if (record.type === 'MX' || record.type === 'SRV') {
|
||||||
|
params.level = record.level;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 修改记录 - 只传递可修改的字段
|
// 修改记录 - 只传递可修改的字段
|
||||||
url = 'jcloud.api.domain_west.west_domain_modify_dns_record';
|
url = 'jcloud.api.domain_west.west_domain_modify_dns_record';
|
||||||
@ -529,9 +532,12 @@ export default {
|
|||||||
record_id: record.id,
|
record_id: record.id,
|
||||||
value: record.value,
|
value: record.value,
|
||||||
ttl: record.ttl,
|
ttl: record.ttl,
|
||||||
level: record.level,
|
|
||||||
line: record.line
|
line: record.line
|
||||||
};
|
};
|
||||||
|
// 只在MX或SRV类型时添加level参数
|
||||||
|
if (record.type === 'MX' || record.type === 'SRV') {
|
||||||
|
params.level = record.level;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const request = createResource({
|
const request = createResource({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user