去除多余校验

This commit is contained in:
lai
2024-07-23 11:14:17 +08:00
parent 83ec17343a
commit 3089f8911e

View File

@@ -228,7 +228,10 @@ const modalStateTypeFrom = Form.useForm(
max: 50, max: 50,
message: t('views.system.tenant.key') + t('common.unableNull'), message: t('views.system.tenant.key') + t('common.unableNull'),
}, },
{ pattern: /^[a-zA-Z0-9]+$/, message: t('views.system.tenant.patternTip') }, {
pattern: /^[a-zA-Z0-9]+$/,
message: t('views.system.tenant.patternTip'),
},
], ],
radioType: [ radioType: [
{ {
@@ -581,6 +584,9 @@ function fnModalTypeOk() {
content: `${res.msg}`, content: `${res.msg}`,
duration: 2, duration: 2,
}); });
// 去除百分号
modalState.typeFrom.tenancyKey =
modalState.typeFrom.tenancyKey.replace(/%/g, '');
} }
}) })
.finally(() => { .finally(() => {
@@ -651,16 +657,7 @@ function fnTypeChange(value: any) {
keyTip.value = tipMapping[value]; keyTip.value = tipMapping[value];
} }
//限制不给输入百分号
function handleInputChange(value: any) {
// 去掉百分号
const filteredValue = value.data.replace('%', '');
console.log('filteredValue', filteredValue);
if (filteredValue) modalState.typeFrom.tenancyKey += filteredValue;
// 更新数据模型
//modalState.typeFrom.tenancyKey = filteredValue;
}
//为后续批量请求使用 //为后续批量请求使用
let promises = ref<any[]>([]); let promises = ref<any[]>([]);
@@ -1047,7 +1044,6 @@ onMounted(() => {
v-model:value="modalState.typeFrom.tenancyKey" v-model:value="modalState.typeFrom.tenancyKey"
allow-clear allow-clear
style="width: 80%" style="width: 80%"
@change="handleInputChange"
></a-input> ></a-input>
</a-form-item> </a-form-item>