|
|
|
@ -199,6 +199,7 @@
|
|
|
|
@draw="[onDraw($event), withSelectedFieldType ? '' : drawFieldType = '', showDrawField = false]"
|
|
|
|
@draw="[onDraw($event), withSelectedFieldType ? '' : drawFieldType = '', showDrawField = false]"
|
|
|
|
@drop-field="onDropfield"
|
|
|
|
@drop-field="onDropfield"
|
|
|
|
@remove-area="removeArea"
|
|
|
|
@remove-area="removeArea"
|
|
|
|
|
|
|
|
@field-clicked="scrollFieldIntoSidebar"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<DocumentControls
|
|
|
|
<DocumentControls
|
|
|
|
v-if="isBreakpointLg && editable"
|
|
|
|
v-if="isBreakpointLg && editable"
|
|
|
|
@ -1724,12 +1725,33 @@ export default {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
scrollToArea (area) {
|
|
|
|
scrollToArea (area) {
|
|
|
|
const documentRef = this.documentRefs.find((a) => a.document.uuid === area.attachment_uuid)
|
|
|
|
const documentRef = this.documentRefs.find((a) => a.document.uuid === area.attachment_uuid)
|
|
|
|
|
|
|
|
|
|
|
|
documentRef.scrollToArea(area)
|
|
|
|
documentRef.scrollToArea(area)
|
|
|
|
|
|
|
|
|
|
|
|
this.selectedAreaRef.value = area
|
|
|
|
this.selectedAreaRef.value = area
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
scrollFieldIntoSidebar (field) {
|
|
|
|
|
|
|
|
// Find the submitter for this field
|
|
|
|
|
|
|
|
const submitter = this.template.submitters.find(s => s.uuid === field.submitter_uuid)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Switch to the correct submitter if needed
|
|
|
|
|
|
|
|
if (submitter && submitter !== this.selectedSubmitter) {
|
|
|
|
|
|
|
|
this.selectedSubmitter = submitter
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Wait for submitter switch to complete
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
|
|
// Scroll field into view in sidebar
|
|
|
|
|
|
|
|
this.$refs.fields.scrollFieldIntoView(field)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Highlight the field by setting the selected area
|
|
|
|
|
|
|
|
const area = field.areas?.[0]
|
|
|
|
|
|
|
|
if (area) {
|
|
|
|
|
|
|
|
this.selectedAreaRef.value = area
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
baseFetch (path, options = {}) {
|
|
|
|
baseFetch (path, options = {}) {
|
|
|
|
return fetch(this.baseUrl + path, {
|
|
|
|
return fetch(this.baseUrl + path, {
|
|
|
|
...options,
|
|
|
|
...options,
|
|
|
|
|