去除多余校验
This commit is contained in:
@@ -228,7 +228,10 @@ const modalStateTypeFrom = Form.useForm(
|
||||
max: 50,
|
||||
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: [
|
||||
{
|
||||
@@ -581,6 +584,9 @@ function fnModalTypeOk() {
|
||||
content: `${res.msg}`,
|
||||
duration: 2,
|
||||
});
|
||||
// 去除百分号
|
||||
modalState.typeFrom.tenancyKey =
|
||||
modalState.typeFrom.tenancyKey.replace(/%/g, '');
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -651,16 +657,7 @@ function fnTypeChange(value: any) {
|
||||
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[]>([]);
|
||||
@@ -1047,7 +1044,6 @@ onMounted(() => {
|
||||
v-model:value="modalState.typeFrom.tenancyKey"
|
||||
allow-clear
|
||||
style="width: 80%"
|
||||
@change="handleInputChange"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user