mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
905 B
34 lines
905 B
3 years ago
|
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) {
|
||
3 years ago
|
columnObj = this.meta.columns.find(c => c.column_name === columnObj.bt.column_name)
|
||
3 years ago
|
}
|
||
|
return ((required || columnObj.rqd) &&
|
||
3 years ago
|
(rowObj[columnObj.title] === undefined || rowObj[columnObj.title] === null) &&
|
||
3 years ago
|
!columnObj.default)
|
||
|
},
|
||
|
isRequired(_columnObj, rowObj, required = false) {
|
||
|
let columnObj = _columnObj
|
||
|
if (columnObj.bt) {
|
||
3 years ago
|
columnObj = this.meta.columns.find(c => c.column_name === columnObj.bt.column_name)
|
||
3 years ago
|
}
|
||
|
return ((required || columnObj.rqd) &&
|
||
|
!columnObj.default)
|
||
|
}
|
||
|
}
|
||
|
}
|