Commit 8354aff6 authored by 侯玉玉's avatar 侯玉玉

进行存储策略名称表单校验

parent a761e681
Pipeline #3109 passed with stage
in 0 seconds
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<!--<app-search-item isMust="true" inModal="true" [label]="'frequency' | translate" [(value)]="req.frequency"></app-search-item>--> <!--<app-search-item isMust="true" inModal="true" [label]="'frequency' | translate" [(value)]="req.frequency"></app-search-item>-->
<app-search-item isMust="true" inModal="true" [label]="'interval' | translate" [(value)]="req.interval"></app-search-item> <app-search-item isMust="true" inModal="true" [label]="'interval' | translate" [(value)]="req.interval"></app-search-item>
<app-search-select inModal="true" [label]="'retentionPolicyName' | translate" [(value)]="req.retentionPolicyNo" <app-search-select isMust="true" inModal="true" [label]="'retentionPolicyName' | translate" [(value)]="req.retentionPolicyNo"
[data]="policyList" [data]="policyList"
(valueChange)="onChangePolicy()" (valueChange)="onChangePolicy()"
optL="opLevel" optV="opValue"></app-search-select> optL="opLevel" optV="opValue"></app-search-select>
......
...@@ -116,10 +116,12 @@ export class TopicModuleDetailComponent implements OnInit { ...@@ -116,10 +116,12 @@ export class TopicModuleDetailComponent implements OnInit {
this.req.frequency = 0; this.req.frequency = 0;
this.isUpdate = false; this.isUpdate = false;
this.try = { this.try = {
trans: {topicName: 'topicName', topicType: 'topicType', trans: {topicName: 'topicName', topicType: 'topicType', retentionPolicyNo: 'retentionPolicyNo',
dataType: 'dataType', interval: 'inTime', dataInterval: 'dataInterval'}, dataType: 'dataType', interval: 'inTime', dataInterval: 'dataInterval'},
field: ['topicName', 'topicType', 'dataType', 'interval'], field: ['topicName', 'topicType', 'dataType', 'interval', 'retentionPolicyNo'],
num: ['dataType', 'interval', 'dataInterval']}; num: ['dataType', 'interval', 'dataInterval'],
retentionPolicyNo: ['retentionPolicyNo']
};
this.isV = true; this.isV = true;
} }
...@@ -137,10 +139,12 @@ export class TopicModuleDetailComponent implements OnInit { ...@@ -137,10 +139,12 @@ export class TopicModuleDetailComponent implements OnInit {
} }
this.try = { this.try = {
trans: {topicName: 'topicName', topicType: 'topicType', trans: {topicName: 'topicName', topicType: 'topicType', retentionPolicyNo: 'retentionPolicyNo',
dataType: 'dataType', interval: 'inTime', dataInterval: 'dataInterval'}, dataType: 'dataType', interval: 'inTime', dataInterval: 'dataInterval'},
field: ['topicModelNo', 'topicName', 'topicType', 'dataType', 'interval'], field: ['topicModelNo', 'topicName', 'topicType', 'dataType', 'interval','retentionPolicyNo'],
num: ['dataType', 'interval', 'dataInterval']}; num: ['dataType', 'interval', 'dataInterval'],
retentionPolicyNo: ['retentionPolicyNo']
};
this.isV = true; this.isV = true;
} }
......
...@@ -71,6 +71,14 @@ export class CheckService { ...@@ -71,6 +71,14 @@ export class CheckService {
} }
} }
if (req.retentionPolicyNo) {
console.log(req, req.retentionPolicyNo)
req.retentionPolicyNo.filter((item) => this.checkRetentionPolicyNo(fieldStr, data, item));
if (this.flag) {
return false;
}
}
return true; return true;
} }
...@@ -93,6 +101,19 @@ export class CheckService { ...@@ -93,6 +101,19 @@ export class CheckService {
} }
} }
private checkRetentionPolicyNo(fieldStr, data, field) {
if (this.flag === 1) {
return false;
}
if ((data[field] === '' || isUndefined(data[field]) || data[field] === null) && fieldStr.indexOf('-' + field + '-') >= -1) {
this.message.warning(this.translate.instant(this.trans[field]) + '为必填字段, 请检查');
this.flag = 1;
return false;
} else {
return true
}
}
private checkTime(fieldStr, data, time) { private checkTime(fieldStr, data, time) {
if (this.flag === 1) { if (this.flag === 1) {
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment