批量新增

This commit is contained in:
lai
2024-04-25 17:10:22 +08:00
parent 5a2aa383fe
commit e64d558c27

View File

@@ -259,7 +259,6 @@ const modalStateFrom = Form.useForm(
function fnModalVisibleByEdit(row?: Record<string, any>) {
getPCCRule(queryParams.neId)
.then((res: any) => {
console.log(res);
pcfRuleOption.pccOpt = res.pccJson;
pcfRuleOption.sessOpt = res.sessJson;
pcfRuleOption.qosOpt = res.qosJson;
@@ -307,7 +306,8 @@ function fnModalOk() {
const from = toRaw(modalState.from);
from.neId = queryParams.neId || '-';
from.rfsp = Number(from.rfsp) || 0;
from.pccRules = modalState.from.pccRules.join('|');
from.sessRules = modalState.from.sessRules.join('|');
let validateArr = ['imsi', 'msisdn'];
if (modalState.isBatch) {
validateArr.push('num');
@@ -403,21 +403,31 @@ function fnModalCancel() {
* @param type 类型
*/
function fnModalVisibleByBatch(type: 'delete' | 'add' | 'update') {
modalStateFrom.resetFields(); //重置表单
modalState.isBatch = true;
modalState.type = type;
if (type === 'add') {
modalState.title = t('views.neUser.pcf.batchAddText');
modalState.visibleByEdit = true;
}
if (type === 'update') {
modalState.title = t('views.neUser.pcf.batchUpdateText');
modalState.visibleByEdit = true;
}
if (type === 'delete') {
modalState.title = t('views.neUser.pcf.batchDelText');
modalState.visibleByEdit = true;
}
getPCCRule(queryParams.neId)
.then((res: any) => {
pcfRuleOption.pccOpt = res.pccJson;
pcfRuleOption.sessOpt = res.sessJson;
pcfRuleOption.qosOpt = res.qosJson;
pcfRuleOption.headerOpt = res.headerJson;
pcfRuleOption.sarOpt = res.sarJson;
})
.finally(() => {
modalStateFrom.resetFields(); //重置表单
modalState.isBatch = true;
modalState.type = type;
if (type === 'add') {
modalState.title = t('views.neUser.pcf.batchAddText');
modalState.visibleByEdit = true;
}
if (type === 'update') {
modalState.title = t('views.neUser.pcf.batchUpdateText');
modalState.visibleByEdit = true;
}
if (type === 'delete') {
modalState.title = t('views.neUser.pcf.batchDelText');
modalState.visibleByEdit = true;
}
});
}
/**
@@ -572,6 +582,7 @@ function fnModalUploadImportUpload(file: File) {
});
}
/**使其忽略大小写 */
function filterOption(value: any, option: any) {
return option.value.toUpperCase().indexOf(value.toUpperCase()) >= 0;
}