新增IMSI填写方式
This commit is contained in:
@@ -185,10 +185,11 @@ let modalState: ModalStateType = reactive({
|
|||||||
parentName: null,
|
parentName: null,
|
||||||
phone: '',
|
phone: '',
|
||||||
tenancyKey: '',
|
tenancyKey: '',
|
||||||
tenancyType: '',
|
tenancyType: 'IMSI',
|
||||||
status: '0',
|
status: '0',
|
||||||
radioType: '5G',
|
radioType: '5G',
|
||||||
radioId: '',
|
radioId: '',
|
||||||
|
imsiMatch: 'fuzzy',
|
||||||
},
|
},
|
||||||
confirmLoading: false,
|
confirmLoading: false,
|
||||||
});
|
});
|
||||||
@@ -460,7 +461,10 @@ function fnModalVisibleByType(
|
|||||||
modalState.typeTitle = t('common.addText') + t('views.system.tenant.type');
|
modalState.typeTitle = t('common.addText') + t('views.system.tenant.type');
|
||||||
modalState.visibleByType = true;
|
modalState.visibleByType = true;
|
||||||
keyTip.value = '';
|
keyTip.value = '';
|
||||||
|
fnTypeChange('IMSI');
|
||||||
} else {
|
} else {
|
||||||
|
// 定义规则
|
||||||
|
|
||||||
//修改
|
//修改
|
||||||
if (modalState.confirmLoading) return;
|
if (modalState.confirmLoading) return;
|
||||||
const hide = message.loading(t('common.loading'), 0);
|
const hide = message.loading(t('common.loading'), 0);
|
||||||
@@ -469,9 +473,10 @@ function fnModalVisibleByType(
|
|||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||||
modalState.typeFrom = Object.assign(modalState.typeFrom, res.data);
|
modalState.typeFrom = Object.assign(modalState.typeFrom, res.data);
|
||||||
|
|
||||||
//动态表单
|
//动态表单
|
||||||
fnTypeChange(modalState.typeFrom.tenancyType);
|
fnTypeChange(modalState.typeFrom.tenancyType);
|
||||||
|
//对RADIO 特殊处理
|
||||||
if (
|
if (
|
||||||
modalState.typeFrom.tenancyType == 'RADIO' &&
|
modalState.typeFrom.tenancyType == 'RADIO' &&
|
||||||
modalState.typeFrom.tenancyKey
|
modalState.typeFrom.tenancyKey
|
||||||
@@ -482,6 +487,24 @@ function fnModalVisibleByType(
|
|||||||
modalState.typeFrom.tenancyKey.split('_')[1];
|
modalState.typeFrom.tenancyKey.split('_')[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//对IMSI 特殊处理
|
||||||
|
if (
|
||||||
|
modalState.typeFrom.tenancyType == 'IMSI' &&
|
||||||
|
modalState.typeFrom.tenancyKey
|
||||||
|
) {
|
||||||
|
const prefixRule: RegExp = /%$/; // 前缀匹配正则
|
||||||
|
const fuzzyRule: RegExp = /^%.+%$/; // 模糊匹配正则
|
||||||
|
if (fuzzyRule.test(modalState.typeFrom.tenancyKey)) {
|
||||||
|
modalState.typeFrom.imsiMatch = 'fuzzy';
|
||||||
|
} else if (prefixRule.test(modalState.typeFrom.tenancyKey)) {
|
||||||
|
modalState.typeFrom.imsiMatch = 'prefix';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 去除百分号
|
||||||
|
modalState.typeFrom.tenancyKey =
|
||||||
|
modalState.typeFrom.tenancyKey.replace(/%/g, '');
|
||||||
|
}
|
||||||
|
|
||||||
modalState.typeTitle =
|
modalState.typeTitle =
|
||||||
t('common.editText') + t('views.system.tenant.type');
|
t('common.editText') + t('views.system.tenant.type');
|
||||||
modalState.visibleByType = true;
|
modalState.visibleByType = true;
|
||||||
@@ -515,6 +538,15 @@ function fnModalTypeOk() {
|
|||||||
} else {
|
} else {
|
||||||
validateName.push('tenancyKey');
|
validateName.push('tenancyKey');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (from.tenancyType === 'IMSI') {
|
||||||
|
const imsiMatchRule: any = {
|
||||||
|
prefix: from.tenancyKey ? `${from.tenancyKey}%` : '',
|
||||||
|
fuzzy: from.tenancyKey ? `%${from.tenancyKey}%` : '',
|
||||||
|
};
|
||||||
|
from.tenancyKey = imsiMatchRule[modalState.typeFrom.imsiMatch];
|
||||||
|
}
|
||||||
|
|
||||||
modalStateTypeFrom
|
modalStateTypeFrom
|
||||||
.validate(validateName)
|
.validate(validateName)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@@ -971,14 +1003,26 @@ onMounted(() => {
|
|||||||
:extra="keyTip"
|
:extra="keyTip"
|
||||||
:label-col="{ span: 4 }"
|
:label-col="{ span: 4 }"
|
||||||
v-bind="modalStateTypeFrom.validateInfos.tenancyKey"
|
v-bind="modalStateTypeFrom.validateInfos.tenancyKey"
|
||||||
v-show="
|
v-show="modalState.typeFrom.tenancyType == 'IMSI'"
|
||||||
modalState.typeFrom.tenancyType == 'IMSI' ||
|
|
||||||
!modalState.typeFrom.tenancyType
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
|
<!-- <a-input
|
||||||
|
v-model:value="modalState.typeFrom.tenancyKey"
|
||||||
|
allow-clear
|
||||||
|
></a-input> -->
|
||||||
|
<a-select
|
||||||
|
v-model:value="modalState.typeFrom.imsiMatch"
|
||||||
|
:options="[
|
||||||
|
{ label: t('views.neUser.sub.fuzzyMatch'), value: 'fuzzy' },
|
||||||
|
{ label: t('views.neUser.sub.prefixMatch'), value: 'prefix' },
|
||||||
|
]"
|
||||||
|
style="width: 20%"
|
||||||
|
>
|
||||||
|
</a-select>
|
||||||
|
|
||||||
<a-input
|
<a-input
|
||||||
v-model:value="modalState.typeFrom.tenancyKey"
|
v-model:value="modalState.typeFrom.tenancyKey"
|
||||||
allow-clear
|
allow-clear
|
||||||
|
style="width: 80%"
|
||||||
></a-input>
|
></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user