fix: 自定义字段选项值校验
This commit is contained in:
parent
5b43ba0bed
commit
f9db1b51da
|
@ -143,15 +143,17 @@ export default {
|
||||||
let param = {};
|
let param = {};
|
||||||
Object.assign(param, this.form);
|
Object.assign(param, this.form);
|
||||||
param.workspaceId = getCurrentWorkspaceId();
|
param.workspaceId = getCurrentWorkspaceId();
|
||||||
if (['select','multipleSelect','radio','checkbox'].indexOf(param.type) > -1 && param.options.length < 1) {
|
if (['select','multipleSelect','radio','checkbox'].indexOf(param.type) > -1) {
|
||||||
this.$warning(this.$t('custom_field.option_check'));
|
if (param.options.length < 1) {
|
||||||
return;
|
this.$warning(this.$t('custom_field.option_check'));
|
||||||
}
|
|
||||||
for (const item of param.options) {
|
|
||||||
if (!item.text || !item.value) {
|
|
||||||
this.$warning(this.$t('custom_field.option_value_check'));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
for (const item of param.options) {
|
||||||
|
if (!item.text || !item.value) {
|
||||||
|
this.$warning(this.$t('custom_field.option_value_check'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
param.options = JSON.stringify(this.form.options);
|
param.options = JSON.stringify(this.form.options);
|
||||||
this.result = this.$post(this.url, param, (response) => {
|
this.result = this.$post(this.url, param, (response) => {
|
||||||
|
|
Loading…
Reference in New Issue