fix: reload on save

This commit is contained in:
Shariq Ansari 2025-01-02 15:29:14 +05:30
parent 262acab271
commit f8a9605bea
6 changed files with 15 additions and 11 deletions

View File

@ -38,9 +38,9 @@
/> />
<div v-if="preview" class="flex flex-1 flex-col border rounded"> <div v-if="preview" class="flex flex-1 flex-col border rounded">
<SidePanelLayout <SidePanelLayout
:sections="{ data: tabs.data[0].sections }"
:doctype="_doctype"
v-model="data" v-model="data"
:sections="tabs.data[0].sections"
:doctype="_doctype"
:preview="true" :preview="true"
v-slot="{ section }" v-slot="{ section }"
> >

View File

@ -342,7 +342,7 @@
v-if="showSidePanelModal" v-if="showSidePanelModal"
v-model="showSidePanelModal" v-model="showSidePanelModal"
:doctype="doctype" :doctype="doctype"
@reload="() => sections.reload()" @reload="() => emit('reload')"
/> />
</template> </template>
@ -381,14 +381,14 @@ const { getFormattedPercent, getFormattedFloat, getFormattedCurrency } =
getMeta(props.doctype) getMeta(props.doctype)
const { isManager, getUser } = usersStore() const { isManager, getUser } = usersStore()
const emit = defineEmits(['update']) const emit = defineEmits(['update', 'reload'])
const data = defineModel() const data = defineModel()
const showSidePanelModal = ref(false) const showSidePanelModal = ref(false)
const _sections = computed(() => { const _sections = computed(() => {
if (!props.sections?.data?.length) return [] if (!props.sections?.length) return []
return props.sections.data.map((section) => { return props.sections.map((section) => {
if (section.columns?.length) { if (section.columns?.length) {
section.columns[0].fields = section.columns[0].fields.map((field) => { section.columns[0].fields = section.columns[0].fields.map((field) => {
let df = field?.all_properties || {} let df = field?.all_properties || {}

View File

@ -122,9 +122,10 @@
> >
<SidePanelLayout <SidePanelLayout
v-model="contact.data" v-model="contact.data"
:sections="sections" :sections="sections.data"
doctype="Contact" doctype="Contact"
@update="updateField" @update="updateField"
@reload="sections.reload"
/> />
</div> </div>
</Resizer> </Resizer>

View File

@ -119,10 +119,11 @@
> >
<SidePanelLayout <SidePanelLayout
v-model="deal.data" v-model="deal.data"
:sections="sections" :sections="sections.data"
doctype="CRM Deal" doctype="CRM Deal"
@update="updateField"
v-slot="{ section }" v-slot="{ section }"
@update="updateField"
@reload="sections.reload"
> >
<div v-if="section.name == 'contacts_section'" class="contacts-area"> <div v-if="section.name == 'contacts_section'" class="contacts-area">
<div <div

View File

@ -172,9 +172,10 @@
> >
<SidePanelLayout <SidePanelLayout
v-model="lead.data" v-model="lead.data"
:sections="sections" :sections="sections.data"
doctype="CRM Lead" doctype="CRM Lead"
@update="updateField" @update="updateField"
@reload="sections.reload"
/> />
</div> </div>
</Resizer> </Resizer>

View File

@ -107,9 +107,10 @@
> >
<SidePanelLayout <SidePanelLayout
v-model="organization.doc" v-model="organization.doc"
:sections="sections" :sections="sections.data"
doctype="CRM Organization" doctype="CRM Organization"
@update="updateField" @update="updateField"
@reload="sections.reload"
/> />
</div> </div>
</Resizer> </Resizer>