payload type is multi-select,the UI of the payload is not effective
gx19910403 opened this issue · 4 comments
I am using POST /metrics method and setting the type attribute of objects in Payloads to multi select, but the page does not display a checkbox and the checkbox cannot display the selected options.
I don't understand the issue. Provide your payload and screenshots of what's wrong.
I set the payloads' type 'to' multi select ', but the page did not take effect and the selection box was not a multiple-choice box.
Here is the code:
private PayloadVO getMetricGroupPayload(MetricType metricType) {
PayloadVO metricGroupPayload = new PayloadVO();
metricGroupPayload.setLabel(metricType.getRemark());
metricGroupPayload.setName(metricType.getName());
metricGroupPayload.setType("multi-select");
metricGroupPayload.setPlaceholder("请选择指标");
metricGroupPayload.setReloadMetric(Boolean.FALSE);
metricGroupPayload.setWidth(80);
metricGroupPayload.setOptions(this.getMetricOptions(metricType));
return metricGroupPayload;
}
private List getMetricOptions(MetricType metricType) {
List metricOptions = new ArrayList<>();
List monitorMetricList = monitorMetricService.getMetricByTypeId(metricType.getUuid());
if (CollUtil.isNotEmpty(monitorMetricList)) {
for (MonitorMetric monitorMetric : monitorMetricList) {
OptionVO metricOption = new OptionVO();
metricOption.setLabel(monitorMetric.getName());
metricOption.setValue(monitorMetric.getCode());
metricOptions.add(metricOption);
}
}
return metricOptions;
}
Please provide what I asked you for.
My problem has been resolved