只在添加或修改MX和SRV类型的记录时显示优先级

This commit is contained in:
jingrow 2025-08-04 23:10:53 +08:00
parent 6d05fa9fdf
commit 3cfab004f0

View File

@ -213,7 +213,7 @@
</td>
<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
v-model="record.level"
type="number"
@ -223,7 +223,7 @@
/>
</div>
<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>
</td>
<td class="px-4 py-4 whitespace-nowrap text-sm">
@ -470,7 +470,7 @@ export default {
line: '',
value: '',
ttl: 600,
level: 10,
level: null, //
editing: true, //
isNew: true
};
@ -500,8 +500,8 @@ export default {
return;
}
//
if (record.level < 1 || record.level > 100) {
// - MXSRV
if ((record.type === 'MX' || record.type === 'SRV') && (record.level < 1 || record.level > 100)) {
toast.error('优先级必须在1~100之间');
return;
}
@ -518,9 +518,12 @@ export default {
host: record.item,
value: record.value,
ttl: record.ttl,
level: record.level,
line: record.line
};
// MXSRVlevel
if (record.type === 'MX' || record.type === 'SRV') {
params.level = record.level;
}
} else {
// -
url = 'jcloud.api.domain_west.west_domain_modify_dns_record';
@ -529,9 +532,12 @@ export default {
record_id: record.id,
value: record.value,
ttl: record.ttl,
level: record.level,
line: record.line
};
// MXSRVlevel
if (record.type === 'MX' || record.type === 'SRV') {
params.level = record.level;
}
}
const request = createResource({