fix: 解决jira单选框kv传值错误问题,多选框复选框创建失败问题 #5518

This commit is contained in:
chenjianxing 2021-08-27 16:01:56 +08:00 committed by jianxing
parent aa182ccc6b
commit ce1ec7f771
2 changed files with 19 additions and 3 deletions

View File

@ -232,10 +232,22 @@ public class JiraPlatform extends AbstractIssuePlatform {
if (StringUtils.isNotBlank(item.getCustomData())) {
if (StringUtils.isNotBlank(item.getValue())) {
if (StringUtils.isNotBlank(item.getType()) &&
StringUtils.equalsAny(item.getType(), "select", "multipleSelect", "checkbox", "radio", "member", "multipleMember")) {
StringUtils.equalsAny(item.getType(), "select", "radio", "member")) {
JSONObject param = new JSONObject();
param.put("id", item.getValue());
fields.put(item.getCustomData(), param);
} else if (StringUtils.isNotBlank(item.getType()) &&
StringUtils.equalsAny(item.getType(), "multipleSelect", "checkbox", "multipleMember")) {
JSONArray attrs = new JSONArray();
if (StringUtils.isNotBlank(item.getValue())) {
JSONArray values = JSONObject.parseArray(item.getValue());
values.forEach(v -> {
JSONObject param = new JSONObject();
param.put("id", v);
attrs.add(param);
});
}
fields.put(item.getCustomData(), attrs);
} else {
fields.put(item.getCustomData(), item.getValue());
}

View File

@ -32,7 +32,9 @@
<el-checkbox v-for="(item, index) in data.options ? data.options : []"
:key="index"
@change="handleChange"
:label="getTranslateOption(item)"></el-checkbox>
:label="item.value">
{{ getTranslateOption(item) }}
</el-checkbox>
</el-checkbox-group>
<el-radio
@ -42,7 +44,9 @@
v-for="(item,index) in data.options ? data.options : []"
:key="index"
@change="handleChange"
:label="getTranslateOption(item)"></el-radio>
:label="item.value">
{{ getTranslateOption(item) }}
</el-radio>
<el-input-number
v-else-if="data.type === 'int'"