mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-29 10:56:44 +00:00
34 lines
865 B
JavaScript
34 lines
865 B
JavaScript
export default {
|
|
props: {
|
|
disabledColumns: {
|
|
type: Object,
|
|
default() {
|
|
return {}
|
|
}
|
|
},
|
|
meta: Object,
|
|
sqlUi: [Object, Function],
|
|
nodes: [Object],
|
|
api: [Object]
|
|
},
|
|
methods: {
|
|
isValid(_columnObj, rowObj, required = false) {
|
|
let columnObj = _columnObj
|
|
if (columnObj.bt) {
|
|
columnObj = this.meta.columns.find(c => c.cn === columnObj.bt.cn)
|
|
}
|
|
return ((required || columnObj.rqd) &&
|
|
(rowObj[columnObj._cn] === undefined || rowObj[columnObj._cn] === null) &&
|
|
!columnObj.default)
|
|
},
|
|
isRequired(_columnObj, rowObj, required = false) {
|
|
let columnObj = _columnObj
|
|
if (columnObj.bt) {
|
|
columnObj = this.meta.columns.find(c => c.cn === columnObj.bt.cn)
|
|
}
|
|
return ((required || columnObj.rqd) &&
|
|
!columnObj.default)
|
|
}
|
|
}
|
|
}
|