补充
This commit is contained in:
@@ -903,6 +903,8 @@ export default {
|
|||||||
imsiMode:'IMSI Matching Mode',
|
imsiMode:'IMSI Matching Mode',
|
||||||
fuzzyMatch:'Fuzzy Match',
|
fuzzyMatch:'Fuzzy Match',
|
||||||
prefixMatch:'Prefix Match',
|
prefixMatch:'Prefix Match',
|
||||||
|
fullMatch:'Full Match',
|
||||||
|
suffixMatch:'Suffix Match',
|
||||||
},
|
},
|
||||||
pcf: {
|
pcf: {
|
||||||
neType: 'PCF Object',
|
neType: 'PCF Object',
|
||||||
@@ -1829,6 +1831,7 @@ export default {
|
|||||||
imsiTip:'Please fill in the SIM card number or number range, \'%\' represents the number wildcard, for example: 111000%',
|
imsiTip:'Please fill in the SIM card number or number range, \'%\' represents the number wildcard, for example: 111000%',
|
||||||
radioTip:'Please select from the drop-down list of radio type and radio ID',
|
radioTip:'Please select from the drop-down list of radio type and radio ID',
|
||||||
defaultTip:'Please select from the drop-down list of Tenancy Asset, and then fill the Asset Key',
|
defaultTip:'Please select from the drop-down list of Tenancy Asset, and then fill the Asset Key',
|
||||||
|
patternTip:'The Asset Key cannot contain special characters',
|
||||||
},
|
},
|
||||||
post:{
|
post:{
|
||||||
positionInfo:'Position Information',
|
positionInfo:'Position Information',
|
||||||
|
|||||||
@@ -903,6 +903,8 @@ export default {
|
|||||||
imsiMode:'IMSI匹配模式',
|
imsiMode:'IMSI匹配模式',
|
||||||
fuzzyMatch:'模糊匹配',
|
fuzzyMatch:'模糊匹配',
|
||||||
prefixMatch:'前缀匹配',
|
prefixMatch:'前缀匹配',
|
||||||
|
fullMatch:'全匹配',
|
||||||
|
suffixMatch:'后缀匹配',
|
||||||
},
|
},
|
||||||
pcf: {
|
pcf: {
|
||||||
neType: 'PCF网元对象',
|
neType: 'PCF网元对象',
|
||||||
@@ -1829,6 +1831,7 @@ export default {
|
|||||||
imsiTip:'请填入SIM卡号码或者号段, \'%\'表示号码通配符, 例如: 460001%',
|
imsiTip:'请填入SIM卡号码或者号段, \'%\'表示号码通配符, 例如: 460001%',
|
||||||
radioTip:'请从下拉列表选择基站类型和基站ID',
|
radioTip:'请从下拉列表选择基站类型和基站ID',
|
||||||
defaultTip:'请选择租赁资产类别, 然后填写资产标识',
|
defaultTip:'请选择租赁资产类别, 然后填写资产标识',
|
||||||
|
patternTip:'租赁标识不能包含特殊字符',
|
||||||
},
|
},
|
||||||
post:{
|
post:{
|
||||||
positionInfo:'岗位信息',
|
positionInfo:'岗位信息',
|
||||||
|
|||||||
@@ -228,6 +228,7 @@ 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') },
|
||||||
],
|
],
|
||||||
radioType: [
|
radioType: [
|
||||||
{
|
{
|
||||||
@@ -492,12 +493,20 @@ function fnModalVisibleByType(
|
|||||||
modalState.typeFrom.tenancyType == 'IMSI' &&
|
modalState.typeFrom.tenancyType == 'IMSI' &&
|
||||||
modalState.typeFrom.tenancyKey
|
modalState.typeFrom.tenancyKey
|
||||||
) {
|
) {
|
||||||
|
let tenancyKey: any = modalState.typeFrom.tenancyKey.trim(); // 去除首尾空格
|
||||||
const prefixRule: RegExp = /%$/; // 前缀匹配正则
|
const prefixRule: RegExp = /%$/; // 前缀匹配正则
|
||||||
const fuzzyRule: RegExp = /^%.+%$/; // 模糊匹配正则
|
const fuzzyRule: RegExp = /^%.+%$/; // 模糊匹配正则
|
||||||
if (fuzzyRule.test(modalState.typeFrom.tenancyKey)) {
|
const suffixRule: RegExp = /^%[^%]+$/; // 后缀匹配正则
|
||||||
|
const fullRule: RegExp = /^[^%]*$/; // 全部匹配正则
|
||||||
|
|
||||||
|
if (fuzzyRule.test(tenancyKey)) {
|
||||||
modalState.typeFrom.imsiMatch = 'fuzzy';
|
modalState.typeFrom.imsiMatch = 'fuzzy';
|
||||||
} else if (prefixRule.test(modalState.typeFrom.tenancyKey)) {
|
} else if (prefixRule.test(tenancyKey)) {
|
||||||
modalState.typeFrom.imsiMatch = 'prefix';
|
modalState.typeFrom.imsiMatch = 'prefix';
|
||||||
|
} else if (suffixRule.test(tenancyKey)) {
|
||||||
|
modalState.typeFrom.imsiMatch = 'suffix';
|
||||||
|
} else if (fullRule.test(tenancyKey)) {
|
||||||
|
modalState.typeFrom.imsiMatch = 'full';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 去除百分号
|
// 去除百分号
|
||||||
@@ -539,19 +548,21 @@ function fnModalTypeOk() {
|
|||||||
validateName.push('tenancyKey');
|
validateName.push('tenancyKey');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (from.tenancyType === 'IMSI') {
|
const imsiMatchRule: any = {
|
||||||
const imsiMatchRule: any = {
|
prefix: from.tenancyKey ? `${from.tenancyKey}%` : '',
|
||||||
prefix: from.tenancyKey ? `${from.tenancyKey}%` : '',
|
fuzzy: from.tenancyKey ? `%${from.tenancyKey}%` : '',
|
||||||
fuzzy: from.tenancyKey ? `%${from.tenancyKey}%` : '',
|
full: from.tenancyKey ? from.tenancyKey : '',
|
||||||
};
|
suffix: from.tenancyKey ? `%${from.tenancyKey}` : '',
|
||||||
from.tenancyKey = imsiMatchRule[modalState.typeFrom.imsiMatch];
|
};
|
||||||
}
|
|
||||||
|
|
||||||
modalStateTypeFrom
|
modalStateTypeFrom
|
||||||
.validate(validateName)
|
.validate(validateName)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
modalState.confirmLoading = true;
|
modalState.confirmLoading = true;
|
||||||
from.parentId = state.selectedNode;
|
from.parentId = state.selectedNode;
|
||||||
|
if (from.tenancyType === 'IMSI') {
|
||||||
|
from.tenancyKey = imsiMatchRule[modalState.typeFrom.imsiMatch];
|
||||||
|
}
|
||||||
const tenant = from.tenantId ? updateTenant(from) : addTenant(from);
|
const tenant = from.tenantId ? updateTenant(from) : addTenant(from);
|
||||||
const hide = message.loading(t('common.loading'), 0);
|
const hide = message.loading(t('common.loading'), 0);
|
||||||
tenant
|
tenant
|
||||||
@@ -640,6 +651,17 @@ function fnTypeChange(value: any) {
|
|||||||
keyTip.value = tipMapping[value];
|
keyTip.value = tipMapping[value];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleInputChange(value: any) {
|
||||||
|
console.log('value', value);
|
||||||
|
// 去掉百分号
|
||||||
|
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[]>([]);
|
||||||
let neCascaderOptions = ref<Record<string, any>[]>([]);
|
let neCascaderOptions = ref<Record<string, any>[]>([]);
|
||||||
@@ -1014,6 +1036,8 @@ onMounted(() => {
|
|||||||
:options="[
|
:options="[
|
||||||
{ label: t('views.neUser.sub.fuzzyMatch'), value: 'fuzzy' },
|
{ label: t('views.neUser.sub.fuzzyMatch'), value: 'fuzzy' },
|
||||||
{ label: t('views.neUser.sub.prefixMatch'), value: 'prefix' },
|
{ label: t('views.neUser.sub.prefixMatch'), value: 'prefix' },
|
||||||
|
{ label: t('views.neUser.sub.fullMatch'), value: 'full' },
|
||||||
|
{ label: t('views.neUser.sub.suffixMatch'), value: 'suffix' },
|
||||||
]"
|
]"
|
||||||
style="width: 20%"
|
style="width: 20%"
|
||||||
>
|
>
|
||||||
@@ -1023,6 +1047,7 @@ 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>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user