fix: 【API数据源】API数据源支持设置主键时,必须设置字段长度

This commit is contained in:
taojinlong 2024-11-25 11:48:49 +08:00
parent b972458406
commit da9c6af0e7
2 changed files with 2 additions and 4 deletions

View File

@ -335,9 +335,6 @@ public class ExcelUtils {
Double d = Double.valueOf(value);
double eps = 1e-10;
if (d - Math.floor(d) < eps) {
if (value.length() > 1 && value.startsWith("0")) {
return "TEXT";
}
return "LONG";
} else {
return "DOUBLE";

View File

@ -291,6 +291,7 @@ const saveItem = () => {
for (let i = 0; i < apiItem.fields.length; i++) {
if (apiItem.fields[i].primaryKey && !apiItem.fields[i].length) {
ElMessage.error(t('datasource.primary_key_length') + apiItem.fields[i].name)
return
}
}
}
@ -769,7 +770,7 @@ defineExpose({
step-strictly
class="text-left edit-all-line"
:min="1"
:max="4096"
:max="512"
:placeholder="t('common.inputText')"
controls-position="right"
type="number"