Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Fix: Show Popover (#2488)
Browse files Browse the repository at this point in the history
* Fix: Popover

* Fix: Popover
  • Loading branch information
Ricargame authored Jul 25, 2024
1 parent 656399a commit 58173ec
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 38 deletions.
7 changes: 0 additions & 7 deletions src/views/ADempiere/Report/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,7 @@
:help="reportMetadata.help"
/>
<div id="report-view">
<action-menu
:container-manager="containerManager"
:container-uuid="reportUuid"
:actions-manager="actionsManager"
style="float: right;padding-left: 1%;"
/>
<br><br>

<panel-definition
:container-uuid="reportUuid"
:panel-metadata="reportMetadata"
Expand Down
72 changes: 57 additions & 15 deletions src/views/ADempiere/ReportViewerEngine/dialog/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
v-model="checkedItemGeneral"
:label="0"
label-position="left"
style="font-size: 18px;"
style="font-size: 18px; padding-right: 1%; padding-bottom: 2%"
@change="setCheckedItemGeneral"
>
{{ $t('report.reportEnginer.optionsImport.download') }}
Expand All @@ -69,7 +69,7 @@
v-model="checkedItemGeneral"
:label="1"
label-position="left"
style="font-size: 18px;"
style="font-size: 18px; padding-right: 1%; padding-bottom: 2%"
@change="setCheckedItemGeneral"
>
{{ $t('report.reportEnginer.optionsImport.send') }}
Expand All @@ -81,7 +81,7 @@
v-model="checkedItemGeneral"
:label="3"
label-position="left"
style="font-size: 18px;"
style="font-size: 18px; padding-bottom: 2%"
@change="setCheckedItemGeneral"
>
{{ $t('report.reportEnginer.optionsImport.copyLink') }}
Expand All @@ -107,24 +107,40 @@
<p style="width: 630px; margin: 0 auto; font-size: 14px; text-align: center;">
{{ $t('component.attachment.share.description') }}
</p>
<p style="text-align: center;">
<p style="text-align: center; padding-bottom: 1%">
<b>
{{ $t('component.attachment.share.timeText') }}
</b>
</p>
<el-radio-group
v-model="validTime"
style="display: flex; justify-content: center;"
style="display: flex; justify-content: center; padding-bottom: 1%;"
@change="loadData"
>
<el-radio :label="3600">1 {{ ' ' + $t('component.attachment.share.time.hour') }}</el-radio>
<el-radio :label="21600">6 {{ ' ' + $t('component.attachment.share.time.hours') }}</el-radio>
<el-radio :label="86400">1 {{ ' ' + $t('component.attachment.share.time.day') }}</el-radio>
<el-radio :label="259200">3 {{ ' ' + $t('component.attachment.share.time.days') }}</el-radio>
<el-radio :label="604800">7 {{ ' ' + $t('component.attachment.share.time.days') }}</el-radio>
<el-radio class="radio-padding" :label="3600">1 {{ ' ' + $t('component.attachment.share.time.hour') }}</el-radio>
<el-radio class="radio-padding" :label="21600">6 {{ ' ' + $t('component.attachment.share.time.hours') }}</el-radio>
<el-radio class="radio-padding" :label="86400">1 {{ ' ' + $t('component.attachment.share.time.day') }}</el-radio>
<el-radio class="radio-padding" :label="259200">3 {{ ' ' + $t('component.attachment.share.time.days') }}</el-radio>
<el-radio class="radio-padding" :label="604800">7 {{ ' ' + $t('component.attachment.share.time.days') }}</el-radio>
</el-radio-group>
</el-row>
</el-card>
</el-col>
<el-col v-if="markdownContent" :span="24" style="margin-top: 1%">
<el-card>
<template #header>
<p>{{ reportOutput.name }}</p>
</template>
<v-md-editor
v-model="markdownContent"
left-toolbar="undo redo clear h bold italic strikethrough quote ul ol table hr link image code | emoji listMailTemplates"
right-toolbar="sync-scroll fullscreen"
mode="edit"
height="150px"
:placeholder="$t('window.containerInfo.logWorkflow.addNote')"
/>
</el-card>
</el-col>
<el-col style="margin-top: 1%">
<el-button
class="button-base-icon"
Expand Down Expand Up @@ -153,6 +169,9 @@ import { isEmptyValue } from '@/utils/ADempiere/valueUtils'
import { config } from '@/utils/ADempiere/config'
import { REPORT_EXPORT_TYPES } from '@/utils/ADempiere/constants/report'
import { showNotificationReport } from '@/utils/ADempiere/notification.js'
import {
requestShareResources
} from '@/api/ADempiere/file-management/resource-reference.ts'
import { copyToClipboard } from '@/utils/ADempiere/coreUtils.js'
import contactSend from './contactSend'
import typeNotify from './typeNotify'
Expand All @@ -176,11 +195,30 @@ export default defineComponent({
const checkedItemGeneral = ref(0)
const checkedItem = ref(0)
const printFormat = ref([])
const printFormatValue = ref('xlsx')
const printFormatValue = ref('')
const typeNotification = ref('')
const linkShare = ref('')
const isLoading = ref(false)
const validTime = ref(3600)
const markdownContent = computed(() => {
if (!isEmptyValue(contactSend.value) || !isEmptyValue(typeNotify.isEmptyValue)) {
return true
}
return true
})
function loadData() {
isLoading.value = true
requestShareResources({
fileName: props.reportOutput.name,
seconds: validTime.value
})
.then(response => {
linkShare.value = response
})
.finally(() => {
isLoading.value = false
})
}
function setCheckedItemGeneral(check) {
checkedItemGeneral.value = check
}
Expand All @@ -197,7 +235,6 @@ export default defineComponent({
store.commit('setShowDialog', false)
}
function sendNotify() {
validTime.value
let link = 'https://www.google.com'
let title = ''
let message = ''
Expand Down Expand Up @@ -235,7 +272,7 @@ export default defineComponent({
link.click()
}
function optionPrintFormat() {
const xlsTypes = REPORT_EXPORT_TYPES.filter(type => type.type === 'xlsx')
const xlsTypes = REPORT_EXPORT_TYPES.filter(type => type.type === 'xls')
printFormat.value = xlsTypes
}
const exportData = computed(() => {
Expand Down Expand Up @@ -271,7 +308,7 @@ export default defineComponent({
isShowMessage: false
})
}
loadData()
return {
checkedItemGeneral,
checkedItem,
Expand All @@ -293,7 +330,9 @@ export default defineComponent({
optionPrintFormat,
sendNotify,
sendLink,
copyValue
copyValue,
loadData,
markdownContent
}
}
})
Expand All @@ -303,4 +342,7 @@ export default defineComponent({
.el-card__header {
padding: 0px 20px !important;
}
.radio-padding {
padding-left: 5%;
}
</style>
34 changes: 18 additions & 16 deletions src/views/ADempiere/ReportViewerEngine/reportPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
:cell-style="{ padding: '0', height: '30px', border: 'none' }"
:cell-class-name="getRowClassName"
@row-click="handleRowClick"
@cell-dblclick="showPopover = true"
@cell-contextmenu="activatePopover"
>
<el-table-column
v-for="(fieldAttributes, key) in columns"
Expand Down Expand Up @@ -150,22 +150,25 @@ export default defineComponent({
if (isEmptyValue(columns)) return []
return columns
})
function handleRowClick(row, column, event) {
function handleRowClick(row) {
if (row.children && row.children.length > 0) {
tableReportEngine.value.toggleRowExpansion(row)
showPopover.value = false
} else {
Object.entries(row.cells).forEach(data => {
data.map(dataCell => {
if (dataCell.sum_value && !isEmptyValue(column) && !isEmptyValue(row)) {
selectedColumn.value = column.columnKey
selectedRow.value = row
dataModal.value = dataCell
}
})
})
}
}
function activatePopover(row, column) {
event.preventDefault()
dataList.value.forEach(data => {
Object.values(data.cells).forEach(dataCell => {
if (dataCell && 'sum_value' in dataCell) {
selectedColumn.value = column.columnKey
selectedRow.value = row
dataModal.value = dataCell
showPopover.value = true
}
})
})
}
function displayLabel(prop, row) {
if (isEmptyValue(row.cells)) {
return
Expand All @@ -175,7 +178,7 @@ export default defineComponent({
return display_value
}
if (!isEmptyValue(value)) {
return value.value
return value
}
}
function getAlignment(displayType) {
Expand Down Expand Up @@ -230,7 +233,6 @@ export default defineComponent({
pageSize,
parametersList: reportDefinition,
reportId: reportDefinition.id,
instanceUuid: props.reportOutput.instance_id,
printFormatId: props.reportOutput.print_format_id,
reportViewId: props.reportOutput.report_view_id
})
Expand All @@ -243,7 +245,6 @@ export default defineComponent({
pageSize: currentPageSize.value,
parametersList: reportDefinition,
reportId: reportDefinition.id,
instanceUuid: props.reportOutput.instance_id,
printFormatId: props.reportOutput.print_format_id,
reportViewId: props.reportOutput.report_view_id
})
Expand Down Expand Up @@ -373,7 +374,8 @@ export default defineComponent({
findParent,
expandedRowAll,
viewShowDialog,
getCellStyle
getCellStyle,
activatePopover
}
}
})
Expand Down

0 comments on commit 58173ec

Please sign in to comment.