summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.ts
diff options
context:
space:
mode:
authorcyuamber <xuranyjy@chinamobile.com>2020-02-24 13:41:21 +0800
committercyuamber <xuranyjy@chinamobile.com>2020-02-24 14:06:36 +0800
commit1a15520467f3bdb83817c6e27bc9e933a5a9ccfe (patch)
tree4c41fcf5c06c128c0de1e77d772ef086de800ba9 /usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.ts
parent324c150c6bc6c81bfc35af23aa865cba2a1fccf4 (diff)
feat:HTML formatting code to optimize the comments in the test
Change-Id: I8abcc7b579279b6c45614d72d46e03195e25b51c Issue-ID: USECASEUI-368 Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.ts')
-rw-r--r--usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.ts24
1 files changed, 12 insertions, 12 deletions
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.ts
index 7db003ff..a07edce2 100644
--- a/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.ts
+++ b/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.ts
@@ -179,19 +179,19 @@ export class BusinessOrderComponent implements OnInit {
return this.rulesText[index] = words + title
};
- validator(key, val, i) {
+ validator(item, val, i) {
if (val === null || val.replace(/\s*/g, '').length <= 0) {
this.validateRules[i] = true;
- this.getRulesText('Please enter', key, val, i,);
+ this.getRulesText('Please enter ', item.title, val, i,);
return false
} else {
this.validateRules[i] = false;
}
- if (key === 'maxNumberofUEs' && !/^([1-9]\d{0,4}|100000)$/.test(val) && isNaN(val)) {
+ if (item.key === 'maxNumberofUEs' && !/^([1-9]\d{0,4}|100000)$/.test(val) && isNaN(val)) {
this.validateRules[i] = true;
this.getRulesText('Only numbers can be entered', '', '', i);
return false
- } else if (key === 'maxNumberofUEs' && !/^([1-9]\d{0,4}|100000)$/.test(val) && !isNaN(val)) {
+ } else if (item.key === 'maxNumberofUEs' && !/^([1-9]\d{0,4}|100000)$/.test(val) && !isNaN(val)) {
console.log("-----maxNumberofUEs")
this.validateRules[i] = true;
this.getRulesText('Scope: 1-100000', '', '', i);
@@ -199,22 +199,22 @@ export class BusinessOrderComponent implements OnInit {
} else {
this.validateRules[i] = false;
}
- if ((key === 'expDataRateDL' || key === 'expDataRateUL') && !/^([1-9]\d{2}|[1-3]\d{3}|3000)$/.test(val) && isNaN(val)) {
+ if ((item.key === 'expDataRateDL' || item.key === 'expDataRateUL') && !/^([1-9]\d{2}|[1-3]\d{3}|3000)$/.test(val) && isNaN(val)) {
this.validateRules[i] = true;
this.getRulesText('Only numbers can be entered', '', '', i);
return false
- } else if ((key === 'expDataRateDL' || key === 'expDataRateUL') && !/^([1-9]\d{2}|[1-3]\d{3}|3000)$/.test(val) && !isNaN(val)) {
+ } else if ((item.key === 'expDataRateDL' || item.key === 'expDataRateUL') && !/^([1-9]\d{2}|[1-3]\d{3}|3000)$/.test(val) && !isNaN(val)) {
this.validateRules[i] = true;
this.getRulesText('Scope: 100-3000', '', '', i);
return false
} else {
this.validateRules[i] = false;
}
- if (key === 'latency' && !/^1[0-9]$|^[2-9]\d$|^1\d{2}$|^200$/.test(val) && isNaN(val)) {
+ if (item.key === 'latency' && !/^1[0-9]$|^[2-9]\d$|^1\d{2}$|^200$/.test(val) && isNaN(val)) {
this.validateRules[i] = true;
this.getRulesText('Only numbers can be entered', '', '', i);
return false
- } else if (key === 'latency' && !/^1[0-9]$|^[2-9]\d$|^1\d{2}$|^200$/.test(val) && !isNaN(val)) {
+ } else if (item.key === 'latency' && !/^1[0-9]$|^[2-9]\d$|^1\d{2}$|^200$/.test(val) && !isNaN(val)) {
this.validateRules[i] = true;
this.getRulesText('Scope: 10-200', '', '', i);
return false
@@ -224,9 +224,9 @@ export class BusinessOrderComponent implements OnInit {
}
handleOk(): void {
- Object.keys(this.slicing_order_info).forEach((item, index) => {
- if (item !== 'resourceSharingLevel' && item !== 'uEMobilityLevel' && item !== 'coverageArea') {
- this.validator(item, this.slicing_order_info[item], index)
+ COMMUNICATION_FORM_ITEMS.forEach((item, index) => {
+ if (item.key !== 'resourceSharingLevel' && item.key !== 'uEMobilityLevel' && item.key !== 'coverageArea') {
+ this.validator(item, this.slicing_order_info[item.key], index)
}
});
if (this.validateRules.indexOf(true) > -1) {
@@ -234,7 +234,7 @@ export class BusinessOrderComponent implements OnInit {
}
const coverage_list: string[] = [];
this.areaList.forEach(item => {
- let str: string = '';
+ let str = '';
item.forEach(area => {
str += area.selected + ';';
});