mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
refactor: target key (#6000)
This commit is contained in:
parent
91a998fff8
commit
648e282d48
@ -171,10 +171,10 @@ export const TargetKey = observer(
|
|||||||
setOptions(
|
setOptions(
|
||||||
getCollection(target)
|
getCollection(target)
|
||||||
.fields?.filter((v) => {
|
.fields?.filter((v) => {
|
||||||
if (type !== 'hasMany') {
|
if (v.primaryKey || v.unique) {
|
||||||
return v.primaryKey || v.unique;
|
return true;
|
||||||
}
|
}
|
||||||
return supportTypes.includes(v.type);
|
return type === 'hasMany' && supportTypes.includes(v.type);
|
||||||
})
|
})
|
||||||
.map((k) => {
|
.map((k) => {
|
||||||
return {
|
return {
|
||||||
@ -196,10 +196,10 @@ export const TargetKey = observer(
|
|||||||
setOptions(
|
setOptions(
|
||||||
getCollection(target)
|
getCollection(target)
|
||||||
.fields?.filter((v) => {
|
.fields?.filter((v) => {
|
||||||
if (type !== 'hasMany') {
|
if (v.primaryKey || v.unique) {
|
||||||
return v.primaryKey || v.unique;
|
return true;
|
||||||
}
|
}
|
||||||
return supportTypes.includes(v.type);
|
return type === 'hasMany' && supportTypes.includes(v.type);
|
||||||
})
|
})
|
||||||
.map((k) => {
|
.map((k) => {
|
||||||
return {
|
return {
|
||||||
|
@ -161,10 +161,10 @@ export const TargetKey = observer(
|
|||||||
setOptions(
|
setOptions(
|
||||||
getCollection(target, dataSourceKey)
|
getCollection(target, dataSourceKey)
|
||||||
.fields?.filter((v) => {
|
.fields?.filter((v) => {
|
||||||
if (type !== 'hasMany') {
|
if (v.primaryKey || v.unique) {
|
||||||
return v.primaryKey || v.unique;
|
return true;
|
||||||
}
|
}
|
||||||
return supportTypes.includes(v.type);
|
return type === 'hasMany' && supportTypes.includes(v.type);
|
||||||
})
|
})
|
||||||
.map((k) => {
|
.map((k) => {
|
||||||
return {
|
return {
|
||||||
@ -196,10 +196,10 @@ export const TargetKey = observer(
|
|||||||
setOptions(
|
setOptions(
|
||||||
data.data
|
data.data
|
||||||
?.filter((v) => {
|
?.filter((v) => {
|
||||||
if (type !== 'hasMany') {
|
if (v.primaryKey || v.unique) {
|
||||||
return v.primaryKey || v.unique;
|
return true;
|
||||||
}
|
}
|
||||||
return supportTypes.includes(v.type);
|
return type === 'hasMany' && supportTypes.includes(v.type);
|
||||||
})
|
})
|
||||||
.map((k) => {
|
.map((k) => {
|
||||||
return {
|
return {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user