批量新增

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