|
|
@ -144,8 +144,19 @@ function isDbRequired(column: Record<string, any>) { |
|
|
|
return isRequired |
|
|
|
return isRequired |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function onMoveCallback(event: any) { |
|
|
|
|
|
|
|
if (shouldSkipColumn(event.draggedContext.element)) { |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function onMove(event: any) { |
|
|
|
function onMove(event: any) { |
|
|
|
const { newIndex, element, oldIndex } = event.added || event.moved || event.removed |
|
|
|
const { newIndex, element, oldIndex } = event.added || event.moved || event.removed |
|
|
|
|
|
|
|
console.log(event) |
|
|
|
|
|
|
|
if (shouldSkipColumn(element)) { |
|
|
|
|
|
|
|
console.log('SKIPPED') |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (event.added) { |
|
|
|
if (event.added) { |
|
|
|
element.show = true |
|
|
|
element.show = true |
|
|
@ -199,7 +210,7 @@ async function addAllColumns() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function shouldSkipColumn(col: Record<string, any>) { |
|
|
|
function shouldSkipColumn(col: Record<string, any>) { |
|
|
|
return isDbRequired(col) || !!col.required |
|
|
|
return isDbRequired(col) || !!col.required || !!col.rqd |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async function removeAllColumns() { |
|
|
|
async function removeAllColumns() { |
|
|
@ -508,6 +519,7 @@ onMounted(async () => { |
|
|
|
draggable=".item" |
|
|
|
draggable=".item" |
|
|
|
group="form-inputs" |
|
|
|
group="form-inputs" |
|
|
|
class="h-100" |
|
|
|
class="h-100" |
|
|
|
|
|
|
|
:move="onMoveCallback" |
|
|
|
@change="onMove($event)" |
|
|
|
@change="onMove($event)" |
|
|
|
@start="drag = true" |
|
|
|
@start="drag = true" |
|
|
|
@end="drag = false" |
|
|
|
@end="drag = false" |
|
|
|