mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-09-27 17:20:02 +08:00
Support to process the selection of records (#212)
* add processes to context menu * add a mixins for menu * execute selected processes * add message with process results * add process selection * modify hover from context menu * modify hover from context menu * style hover * resolve conflicts
This commit is contained in:
parent
945c7941f5
commit
e33dd42a33
@ -1,163 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-menu :collapse="isCollapse" class="el-menu-demo" @select="typeFormat">
|
|
||||||
<el-submenu
|
|
||||||
index="xlsx"
|
|
||||||
>
|
|
||||||
<template slot="title">{{ $t('components.contextMennuWindowReport') }}</template>
|
|
||||||
<template v-for="(format, index) in option">
|
|
||||||
<el-menu-item :key="index" :index="index">
|
|
||||||
{{ format }}
|
|
||||||
</el-menu-item>
|
|
||||||
</template>
|
|
||||||
</el-submenu>
|
|
||||||
<el-menu-item index="eliminar" style="padding-left: 36px;">
|
|
||||||
{{ $t('window.deleteRecord') }}
|
|
||||||
</el-menu-item>
|
|
||||||
</el-menu>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import { supportedTypes, exportFileFromJson } from '@/utils/ADempiere/exportUtil'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'ContextMenu',
|
|
||||||
props: {
|
|
||||||
parentUuid: {
|
|
||||||
type: String,
|
|
||||||
default: undefined
|
|
||||||
},
|
|
||||||
containerUuid: {
|
|
||||||
type: String,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
panelType: {
|
|
||||||
type: String,
|
|
||||||
default: 'window'
|
|
||||||
},
|
|
||||||
isOption: {
|
|
||||||
type: Object,
|
|
||||||
default: () => {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
option: supportedTypes,
|
|
||||||
isCollapse: true,
|
|
||||||
visible: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
getterFieldList() {
|
|
||||||
return this.$store.getters.getFieldsListFromPanel(this.containerUuid)
|
|
||||||
},
|
|
||||||
getterFieldListHeader() {
|
|
||||||
var header = this.getterFieldList.filter(fieldItem => {
|
|
||||||
const isDisplayed = fieldItem.isDisplayed || fieldItem.isDisplayedFromLogic
|
|
||||||
if (fieldItem.isActive && isDisplayed && !fieldItem.isKey) {
|
|
||||||
return fieldItem.name
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return header.map(fieldItem => {
|
|
||||||
return fieldItem.name
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getterFieldListValue() {
|
|
||||||
var value = this.getterFieldList.filter(fieldItem => {
|
|
||||||
const isDisplayed = fieldItem.isDisplayed || fieldItem.isDisplayedFromLogic
|
|
||||||
if (fieldItem.isActive && isDisplayed && !fieldItem.isKey) {
|
|
||||||
return fieldItem
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return value.map(fieldItem => {
|
|
||||||
if (fieldItem.componentPath === 'FieldSelect') {
|
|
||||||
return 'DisplayColumn_' + fieldItem.columnName
|
|
||||||
} else {
|
|
||||||
return fieldItem.columnName
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
gettersRecordContextMenu() {
|
|
||||||
var record = []
|
|
||||||
var recordTable = this.isOption
|
|
||||||
record.push(recordTable)
|
|
||||||
return record
|
|
||||||
},
|
|
||||||
getDataSelection() {
|
|
||||||
return this.$store.getters.getDataRecordSelection(this.containerUuid)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
classTableMenu() {
|
|
||||||
if (this.isMobile) {
|
|
||||||
return 'menu-table-mobile'
|
|
||||||
} else if (this.$store.state.app.sidebar.opened) {
|
|
||||||
return 'menu-table'
|
|
||||||
}
|
|
||||||
return 'menu-table'
|
|
||||||
},
|
|
||||||
typeFormat(key, keyPath) {
|
|
||||||
if (key === 'eliminar') {
|
|
||||||
this.rowMenu()
|
|
||||||
} else {
|
|
||||||
this.exporRecordTable(key)
|
|
||||||
}
|
|
||||||
this.$store.dispatch('showMenuTable', {
|
|
||||||
isShowedTable: false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
exporRecordTable(key) {
|
|
||||||
const Header = this.getterFieldListHeader
|
|
||||||
const filterVal = this.getterFieldListValue
|
|
||||||
const list = this.gettersRecordContextMenu
|
|
||||||
const data = this.formatJson(filterVal, list)
|
|
||||||
exportFileFromJson({
|
|
||||||
header: Header,
|
|
||||||
data,
|
|
||||||
filename: '',
|
|
||||||
exportType: key
|
|
||||||
})
|
|
||||||
},
|
|
||||||
formatJson(filterVal, jsonData) {
|
|
||||||
return jsonData.map(v => filterVal.map(j => v[j]))
|
|
||||||
},
|
|
||||||
rowMenu() {
|
|
||||||
this.$store.dispatch('deleteEntity', {
|
|
||||||
parentUuid: this.parentUuid,
|
|
||||||
containerUuid: this.containerUuid,
|
|
||||||
recordUuid: this.isOption.UUID,
|
|
||||||
panelType: this.panelType,
|
|
||||||
isNewRecord: 'deleteEntity' === 'resetPanelToNew'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style>
|
|
||||||
.el-menu--vertical .nest-menu .el-submenu>.el-submenu__title:hover, .el-menu--vertical .el-menu-item:hover {
|
|
||||||
background-color: #ffffff !important;
|
|
||||||
background: #ffffff !important;
|
|
||||||
}
|
|
||||||
.el-menu--collapse {
|
|
||||||
width: auto;
|
|
||||||
}
|
|
||||||
.el-menu-item:hover {
|
|
||||||
background-color: #ffffff !important
|
|
||||||
}
|
|
||||||
.hover {
|
|
||||||
background-color: initial !important;
|
|
||||||
}
|
|
||||||
.el-menu-item {
|
|
||||||
height: 56px;
|
|
||||||
line-height: 56px;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #303133;
|
|
||||||
padding: 0 20px;
|
|
||||||
list-style: none;
|
|
||||||
cursor: pointer;
|
|
||||||
position: relative;
|
|
||||||
-webkit-transition: border-color .3s, background-color .3s, color .3s;
|
|
||||||
transition: border-color .3s, background-color .3s, color .3s;
|
|
||||||
-webkit-box-sizing: border-box;
|
|
||||||
box-sizing: border-box;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -22,70 +22,16 @@
|
|||||||
</el-collapse>
|
</el-collapse>
|
||||||
<div>
|
<div>
|
||||||
<div v-if="!isMobile">
|
<div v-if="!isMobile">
|
||||||
<el-menu :default-active="menuTable" :class="classTableMenu + ' menu-table-container'" mode="horizontal" @select="typeFormat">
|
<table-menu
|
||||||
<el-submenu index="2">
|
:container-uuid="containerUuid"
|
||||||
<template slot="title">
|
:parent-uuid="parentUuid"
|
||||||
<i class="el-icon-more" />
|
:panel-type="panelType"
|
||||||
</template>
|
:is-parent="isParent"
|
||||||
<el-menu-item
|
:is-panel-window="isPanelWindow"
|
||||||
v-if="!isParent && isPanelWindow"
|
:is-process-menu="getterContextMenu"
|
||||||
:disabled="isDisabledAddNew"
|
:is-mobile="isMobile"
|
||||||
index="new"
|
:is-panel="getterPanel"
|
||||||
@click="addNewRow()"
|
/>
|
||||||
>
|
|
||||||
{{ $t('window.newRecord') }}
|
|
||||||
</el-menu-item>
|
|
||||||
<template v-if="isPanelWindow && getterPanel.isAssociatedTabSequence">
|
|
||||||
<el-menu-item
|
|
||||||
v-for="(actionSequence, key) in getterPanel.tabsOrder"
|
|
||||||
:key="key"
|
|
||||||
:disabled="$route.query.action === 'create-new'"
|
|
||||||
index="sort"
|
|
||||||
@click="sortTab(actionSequence)"
|
|
||||||
>
|
|
||||||
{{ actionSequence.name }}
|
|
||||||
</el-menu-item>
|
|
||||||
</template>
|
|
||||||
<el-menu-item
|
|
||||||
v-if="isPanelWindow"
|
|
||||||
:disabled="Boolean(getDataSelection.length < 1 || (isReadOnlyParent && !isParent))"
|
|
||||||
index="delete"
|
|
||||||
@click="deleteSelection()"
|
|
||||||
>
|
|
||||||
{{ $t('table.dataTable.deleteSelection') }}
|
|
||||||
</el-menu-item>
|
|
||||||
<el-submenu
|
|
||||||
:disabled="Boolean(getDataSelection.length < 1)"
|
|
||||||
index="xlsx"
|
|
||||||
>
|
|
||||||
<template slot="title">{{ $t('table.dataTable.exportRecordTable') }}</template>
|
|
||||||
<template v-for="(format, index) in option">
|
|
||||||
<el-menu-item :key="index" :index="index">
|
|
||||||
{{ format }}
|
|
||||||
</el-menu-item>
|
|
||||||
</template>
|
|
||||||
</el-submenu>
|
|
||||||
<el-menu-item v-if="!isPanelWindow" :disabled="Boolean(getDataSelection.length < 1)" index="zoom-record" @click="zoomRecord()">
|
|
||||||
{{ $t('table.ProcessActivity.zoomIn') }}
|
|
||||||
</el-menu-item>
|
|
||||||
<el-menu-item index="optional" @click="optionalPanel()">
|
|
||||||
{{ $t('components.filterableItems') }}
|
|
||||||
</el-menu-item>
|
|
||||||
<el-menu-item index="mandatory" @click="showOnlyMandatoryColumns()">
|
|
||||||
{{ $t('table.dataTable.showOnlyMandatoryColumns') }}
|
|
||||||
</el-menu-item>
|
|
||||||
<el-menu-item index="available" @click="showAllAvailableColumns()">
|
|
||||||
{{ $t('table.dataTable.showAllAvailableColumns') }}
|
|
||||||
</el-menu-item>
|
|
||||||
<el-menu-item
|
|
||||||
v-if="['browser', 'window'].includes(panelType)"
|
|
||||||
index="totals"
|
|
||||||
@click="showTotals()"
|
|
||||||
>
|
|
||||||
{{ getterPanel.isShowedTotals ? $t('table.dataTable.hiddenTotal') : $t('table.dataTable.showTotal') }}
|
|
||||||
</el-menu-item>
|
|
||||||
</el-submenu>
|
|
||||||
</el-menu>
|
|
||||||
<el-button
|
<el-button
|
||||||
v-if="!isParent && isPanelWindow"
|
v-if="!isParent && isPanelWindow"
|
||||||
type="text"
|
type="text"
|
||||||
@ -107,7 +53,6 @@
|
|||||||
:panel-type="panelType"
|
:panel-type="panelType"
|
||||||
class="field-optional"
|
class="field-optional"
|
||||||
/>
|
/>
|
||||||
<!-- <i class="el-icon-circle-plus-outline" /> -->
|
|
||||||
<div :class="{ 'show': showTableSearch }" class="table-search">
|
<div :class="{ 'show': showTableSearch }" class="table-search">
|
||||||
<svg-icon class-name="search-icon" icon-class="search" @click.stop="click()" />
|
<svg-icon class-name="search-icon" icon-class="search" @click.stop="click()" />
|
||||||
<el-input
|
<el-input
|
||||||
@ -121,53 +66,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div v-if="!isParent">
|
<div v-if="!isParent">
|
||||||
<el-menu :default-active="menuTable" :class="classTableMenu + ' menu-table-container'" mode="horizontal">
|
|
||||||
<el-submenu index="2">
|
|
||||||
<template slot="title">
|
|
||||||
<i class="el-icon-more" />
|
|
||||||
</template>
|
|
||||||
<el-menu-item
|
|
||||||
v-if="isPanelWindow"
|
|
||||||
:disabled="Boolean(getDataSelection.length < 1 || (isReadOnlyParent && !isParent))"
|
|
||||||
index="delete"
|
|
||||||
@click="deleteSelection()"
|
|
||||||
>
|
|
||||||
{{ $t('table.dataTable.deleteSelection') }}
|
|
||||||
</el-menu-item>
|
|
||||||
<el-submenu
|
|
||||||
v-if="isPanelWindow"
|
|
||||||
:disabled="Boolean(getDataSelection.length < 1)"
|
|
||||||
index="xlsx"
|
|
||||||
>
|
|
||||||
<template slot="title">{{ $t('table.dataTable.exportRecordTable') }}</template>
|
|
||||||
<template v-for="(format, index) in option">
|
|
||||||
<el-menu-item :key="index" :index="index">
|
|
||||||
{{ format }}
|
|
||||||
</el-menu-item>
|
|
||||||
</template>
|
|
||||||
</el-submenu>
|
|
||||||
<el-menu-item index="optional" @click="optionalPanel()">
|
|
||||||
{{ $t('components.filterableItems') }}
|
|
||||||
</el-menu-item>
|
|
||||||
<el-menu-item index="fixed" @click="fixedPanel()">
|
|
||||||
{{ $t('components.fixedleItems') }}
|
|
||||||
</el-menu-item>
|
|
||||||
<el-menu-item index="mandatory" @click="showOnlyMandatoryColumns()">
|
|
||||||
{{ $t('table.dataTable.showOnlyMandatoryColumns') }}
|
|
||||||
</el-menu-item>
|
|
||||||
<el-menu-item index="available" @click="showAllAvailableColumns()">
|
|
||||||
{{ $t('table.dataTable.showAllAvailableColumns') }}
|
|
||||||
</el-menu-item>
|
|
||||||
<el-menu-item
|
|
||||||
v-if="!isParent && isPanelWindow"
|
|
||||||
:disabled="isDisabledAddNew"
|
|
||||||
index="new"
|
|
||||||
@click="addNewRow()"
|
|
||||||
>
|
|
||||||
{{ $t('window.newRecord') }}
|
|
||||||
</el-menu-item>
|
|
||||||
</el-submenu>
|
|
||||||
</el-menu>
|
|
||||||
<fixed-columns
|
<fixed-columns
|
||||||
:container-uuid="containerUuid"
|
:container-uuid="containerUuid"
|
||||||
:panel-type="panelType"
|
:panel-type="panelType"
|
||||||
@ -231,6 +129,24 @@
|
|||||||
:parent-uuid="parentUuid"
|
:parent-uuid="parentUuid"
|
||||||
:panel-type="panelType"
|
:panel-type="panelType"
|
||||||
:is-option="isOption"
|
:is-option="isOption"
|
||||||
|
:is-panel-window="isPanelWindow"
|
||||||
|
:is-process-menu="getterContextMenu"
|
||||||
|
:is-mobile="isMobile"
|
||||||
|
:is-panel="getterPanel"
|
||||||
|
/>
|
||||||
|
<context-menu
|
||||||
|
v-if="!isParent"
|
||||||
|
v-show="getShowContextMenuTabChildren"
|
||||||
|
:style="{left:left+'px',top:top+'px'}"
|
||||||
|
class="contextmenu"
|
||||||
|
:container-uuid="containerUuid"
|
||||||
|
:parent-uuid="parentUuid"
|
||||||
|
:panel-type="panelType"
|
||||||
|
:is-option="isOption"
|
||||||
|
:is-panel-window="isPanelWindow"
|
||||||
|
:is-process-menu="getterContextMenu"
|
||||||
|
:is-mobile="isMobile"
|
||||||
|
:is-panel="getterPanel"
|
||||||
/>
|
/>
|
||||||
<el-table
|
<el-table
|
||||||
ref="multipleTable"
|
ref="multipleTable"
|
||||||
@ -343,7 +259,8 @@ import FieldDefinition from '@/components/ADempiere/Field'
|
|||||||
import Sortable from 'sortablejs'
|
import Sortable from 'sortablejs'
|
||||||
import FilterColumns from '@/components/ADempiere/DataTable/filterColumns'
|
import FilterColumns from '@/components/ADempiere/DataTable/filterColumns'
|
||||||
import FixedColumns from '@/components/ADempiere/DataTable/fixedColumns'
|
import FixedColumns from '@/components/ADempiere/DataTable/fixedColumns'
|
||||||
import ContextMenu from '@/components/ADempiere/DataTable/contextMenu'
|
import ContextMenu from '@/components/ADempiere/DataTable/menu/contextMenu'
|
||||||
|
import TableMenu from '@/components/ADempiere/DataTable/menu'
|
||||||
import IconElement from '@/components/ADempiere/IconElement'
|
import IconElement from '@/components/ADempiere/IconElement'
|
||||||
import { formatDate } from '@/filters/ADempiere'
|
import { formatDate } from '@/filters/ADempiere'
|
||||||
import MainPanel from '@/components/ADempiere/Panel'
|
import MainPanel from '@/components/ADempiere/Panel'
|
||||||
@ -361,7 +278,8 @@ export default {
|
|||||||
FixedColumns,
|
FixedColumns,
|
||||||
ContextMenu,
|
ContextMenu,
|
||||||
IconElement,
|
IconElement,
|
||||||
MainPanel
|
MainPanel,
|
||||||
|
TableMenu
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
parentUuid: {
|
parentUuid: {
|
||||||
@ -421,9 +339,23 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
getterContextMenu() {
|
||||||
|
var process = this.$store.getters.getContextMenu(this.containerUuid).actions
|
||||||
|
if (process) {
|
||||||
|
return process.filter(menu => {
|
||||||
|
if (menu.type === 'process') {
|
||||||
|
return menu
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
},
|
||||||
getShowContextMenuTable() {
|
getShowContextMenuTable() {
|
||||||
return this.$store.getters.getShowContextMenuTable
|
return this.$store.getters.getShowContextMenuTable
|
||||||
},
|
},
|
||||||
|
getShowContextMenuTabChildren() {
|
||||||
|
return this.$store.getters.getShowContextMenuTabChildren
|
||||||
|
},
|
||||||
getterFieldList() {
|
getterFieldList() {
|
||||||
return this.$store.getters.getFieldsListFromPanel(this.containerUuid)
|
return this.$store.getters.getFieldsListFromPanel(this.containerUuid)
|
||||||
},
|
},
|
||||||
@ -641,6 +573,9 @@ export default {
|
|||||||
this.$store.dispatch('showMenuTable', {
|
this.$store.dispatch('showMenuTable', {
|
||||||
isShowedTable: false
|
isShowedTable: false
|
||||||
})
|
})
|
||||||
|
this.$store.dispatch('showMenuTabChildren', {
|
||||||
|
isShowedTabChildren: false
|
||||||
|
})
|
||||||
},
|
},
|
||||||
block() {
|
block() {
|
||||||
return false
|
return false
|
||||||
@ -657,13 +592,27 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.left = left
|
this.left = left
|
||||||
}
|
}
|
||||||
|
if (this.isParent) {
|
||||||
this.top = event.clientY - 100
|
this.top = event.clientY - 100
|
||||||
this.isOption = row
|
this.isOption = row
|
||||||
this.visible = true
|
this.visible = true
|
||||||
this.$store.dispatch('showMenuTable', {
|
this.$store.dispatch('showMenuTable', {
|
||||||
isShowedTable: true
|
isShowedTable: true
|
||||||
})
|
})
|
||||||
|
this.$store.dispatch('showMenuTabChildren', {
|
||||||
|
isShowedTabChildren: false
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.top = event.clientY - event.screenY
|
||||||
|
this.isOption = row
|
||||||
|
this.visible = true
|
||||||
|
this.$store.dispatch('showMenuTabChildren', {
|
||||||
|
isShowedTabChildren: true
|
||||||
|
})
|
||||||
|
this.$store.dispatch('showMenuTable', {
|
||||||
|
isShowedTable: false
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
typeFormat(key, keyPath) {
|
typeFormat(key, keyPath) {
|
||||||
Object.keys(supportedTypes).forEach(type => {
|
Object.keys(supportedTypes).forEach(type => {
|
||||||
|
42
src/components/ADempiere/DataTable/menu/contextMenu.vue
Normal file
42
src/components/ADempiere/DataTable/menu/contextMenu.vue
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<template>
|
||||||
|
<el-menu :collapse="isCollapse" class="el-menu-demo" @select="typeFormat">
|
||||||
|
<el-submenu
|
||||||
|
index="xlsx"
|
||||||
|
>
|
||||||
|
<template
|
||||||
|
slot="title"
|
||||||
|
>
|
||||||
|
{{ $t('components.contextMennuWindowReport') }}
|
||||||
|
</template>
|
||||||
|
<template v-for="(format, index) in option">
|
||||||
|
<el-menu-item
|
||||||
|
:key="index"
|
||||||
|
:index="index"
|
||||||
|
>
|
||||||
|
{{ format }}
|
||||||
|
</el-menu-item>
|
||||||
|
</template>
|
||||||
|
</el-submenu>
|
||||||
|
<el-menu-item
|
||||||
|
index="eliminar"
|
||||||
|
@click="deleteRecord()"
|
||||||
|
>
|
||||||
|
{{ $t('window.deleteRecord') }}
|
||||||
|
</el-menu-item>
|
||||||
|
<el-menu-item
|
||||||
|
v-for="(process, key) in isProcessMenu"
|
||||||
|
:key="key"
|
||||||
|
index="process"
|
||||||
|
@click="tableProcess(process)"
|
||||||
|
>
|
||||||
|
{{ process.name }}
|
||||||
|
</el-menu-item>
|
||||||
|
</el-menu>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { menuTableMixin } from '@/components/ADempiere/DataTable/menu/mixinMenu'
|
||||||
|
export default {
|
||||||
|
name: 'ContextMenu',
|
||||||
|
mixins: [menuTableMixin]
|
||||||
|
}
|
||||||
|
</script>
|
96
src/components/ADempiere/DataTable/menu/index.vue
Normal file
96
src/components/ADempiere/DataTable/menu/index.vue
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
<template>
|
||||||
|
<el-menu :default-active="menuTable" :class="classTableMenu + ' menu-table-container'" mode="horizontal" @select="typeFormat">
|
||||||
|
<el-submenu index="2">
|
||||||
|
<template slot="title">
|
||||||
|
<i class="el-icon-more" />
|
||||||
|
</template>
|
||||||
|
<el-menu-item
|
||||||
|
v-if="!isParent && isPanelWindow"
|
||||||
|
:disabled="isDisabledAddNew"
|
||||||
|
@click="addNewRow()"
|
||||||
|
>
|
||||||
|
{{ $t('window.newRecord') }}
|
||||||
|
</el-menu-item>
|
||||||
|
<el-menu-item
|
||||||
|
v-if="isPanelWindow"
|
||||||
|
:disabled="Boolean(getDataSelection.length < 1 || (isReadOnlyParent && !isParent))"
|
||||||
|
@click="deleteSelection()"
|
||||||
|
>
|
||||||
|
{{ $t('table.dataTable.deleteSelection') }}
|
||||||
|
</el-menu-item>
|
||||||
|
<el-menu-item
|
||||||
|
v-for="(process, key) in isProcessMenu"
|
||||||
|
v-show="isPanelWindow && isProcessMenu"
|
||||||
|
:key="key"
|
||||||
|
:disabled="Boolean(getDataSelection.length < 1)"
|
||||||
|
index="process"
|
||||||
|
@click="tableProcess(process)"
|
||||||
|
>
|
||||||
|
{{ process.name }}
|
||||||
|
</el-menu-item>
|
||||||
|
<el-submenu
|
||||||
|
:disabled="Boolean(getDataSelection.length < 1)"
|
||||||
|
index="xlsx"
|
||||||
|
>
|
||||||
|
<template slot="title">{{ $t('table.dataTable.exportRecordTable') }}</template>
|
||||||
|
<template v-for="(format, index) in option">
|
||||||
|
<el-menu-item :key="index" :index="index">
|
||||||
|
{{ format }}
|
||||||
|
</el-menu-item>
|
||||||
|
</template>
|
||||||
|
</el-submenu>
|
||||||
|
<el-menu-item index="optional" @click="optionalPanel()">
|
||||||
|
{{ $t('components.filterableItems') }}
|
||||||
|
</el-menu-item>
|
||||||
|
<el-menu-item index="mandatory" @click="showOnlyMandatoryColumns()">
|
||||||
|
{{ $t('table.dataTable.showOnlyMandatoryColumns') }}
|
||||||
|
</el-menu-item>
|
||||||
|
<el-menu-item index="available" @click="showAllAvailableColumns()">
|
||||||
|
{{ $t('table.dataTable.showAllAvailableColumns') }}
|
||||||
|
</el-menu-item>
|
||||||
|
<el-menu-item
|
||||||
|
v-if="['browser', 'window'].includes(panelType)"
|
||||||
|
@click="showTotals()"
|
||||||
|
>
|
||||||
|
{{ isPanel.isShowedTotals ? $t('table.dataTable.hiddenTotal') : $t('table.dataTable.showTotal') }}
|
||||||
|
</el-menu-item>
|
||||||
|
</el-submenu>
|
||||||
|
</el-menu>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { menuTableMixin } from '@/components/ADempiere/DataTable/menu/mixinMenu'
|
||||||
|
export default {
|
||||||
|
name: 'TableMenu',
|
||||||
|
mixins: [menuTableMixin]
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
.el-menu--vertical .nest-menu .el-submenu>.el-submenu__title:hover, .el-menu--vertical .el-menu-item:hover {
|
||||||
|
background-color: #74bcff94 !important;
|
||||||
|
background: #74bcff94 !important;
|
||||||
|
}
|
||||||
|
.el-menu--collapse {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
.el-menu-item:hover {
|
||||||
|
background-color: #ffffff !important
|
||||||
|
}
|
||||||
|
.hover {
|
||||||
|
background-color: initial !important;
|
||||||
|
}
|
||||||
|
.el-menu-item {
|
||||||
|
height: 56px;
|
||||||
|
line-height: 56px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #303133;
|
||||||
|
padding: 0 20px;
|
||||||
|
list-style: none;
|
||||||
|
cursor: pointer;
|
||||||
|
position: relative;
|
||||||
|
-webkit-transition: border-color .3s, background-color .3s, color .3s;
|
||||||
|
transition: border-color .3s, background-color .3s, color .3s;
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
</style>
|
306
src/components/ADempiere/DataTable/menu/mixinMenu.js
Normal file
306
src/components/ADempiere/DataTable/menu/mixinMenu.js
Normal file
@ -0,0 +1,306 @@
|
|||||||
|
import { supportedTypes, exportFileFromJson } from '@/utils/ADempiere/exportUtil'
|
||||||
|
import { showNotification } from '@/utils/ADempiere/notification'
|
||||||
|
|
||||||
|
export const menuTableMixin = {
|
||||||
|
props: {
|
||||||
|
parentUuid: {
|
||||||
|
type: String,
|
||||||
|
default: undefined
|
||||||
|
},
|
||||||
|
containerUuid: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
panelType: {
|
||||||
|
type: String,
|
||||||
|
default: 'window'
|
||||||
|
},
|
||||||
|
isOption: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
},
|
||||||
|
isParent: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
isProcessMenu: {
|
||||||
|
type: Array,
|
||||||
|
default: function() {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isPanelWindow: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
isMobile: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
isPanel: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
},
|
||||||
|
isDataRecord: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
option: supportedTypes,
|
||||||
|
typoFormatExport: [],
|
||||||
|
menuTable: '1',
|
||||||
|
isCollapse: true,
|
||||||
|
visible: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
isProcessTable() {
|
||||||
|
if (this.isProcessMenu) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
},
|
||||||
|
classTableMenu() {
|
||||||
|
if (this.isMobile) {
|
||||||
|
return 'menu-table-mobile'
|
||||||
|
} else if (this.$store.state.app.sidebar.opened) {
|
||||||
|
return 'menu-table'
|
||||||
|
}
|
||||||
|
return 'menu-table'
|
||||||
|
},
|
||||||
|
getterDataRecordsAndSelection() {
|
||||||
|
return this.$store.getters.getDataRecordAndSelection(this.containerUuid)
|
||||||
|
},
|
||||||
|
getterNewRecords() {
|
||||||
|
if (this.isPanelWindow && !this.isParent) {
|
||||||
|
var newRecordTable = this.getterDataRecordsAndSelection.record.filter(recordItem => {
|
||||||
|
return recordItem.isNew
|
||||||
|
})
|
||||||
|
return newRecordTable.length
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
},
|
||||||
|
getDataSelection() {
|
||||||
|
return this.getterDataRecordsAndSelection.selection
|
||||||
|
},
|
||||||
|
fieldList() {
|
||||||
|
if (this.isPanel && this.isPanel.fieldList) {
|
||||||
|
return this.sortFields(
|
||||||
|
this.isPanel.fieldList,
|
||||||
|
this.panelType !== 'browser' ? 'seqNoGrid' : 'sequence'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return []
|
||||||
|
},
|
||||||
|
isReadOnlyParent() {
|
||||||
|
if (this.isPanelWindow) {
|
||||||
|
if (this.$store.getters.getContextIsActive(this.parentUuid) === false) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (this.$store.getters.getContextProcessing(this.parentUuid) === true ||
|
||||||
|
this.$store.getters.getContextProcessing(this.parentUuid) === 'Y') {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (this.$store.getters.getContextProcessed(this.parentUuid)) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
},
|
||||||
|
isDisabledAddNew() {
|
||||||
|
if (this.isParent) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (this.$route.query.action === 'create-new') {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (!this.isPanel.isInsertRecord) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (this.isReadOnlyParent) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (this.getterNewRecords) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
},
|
||||||
|
getterFieldList() {
|
||||||
|
return this.$store.getters.getFieldsListFromPanel(this.containerUuid)
|
||||||
|
},
|
||||||
|
getterFieldListHeader() {
|
||||||
|
var header = this.getterFieldList.filter(fieldItem => {
|
||||||
|
const isDisplayed = fieldItem.isDisplayed || fieldItem.isDisplayedFromLogic
|
||||||
|
if (fieldItem.isActive && isDisplayed && !fieldItem.isKey) {
|
||||||
|
return fieldItem.name
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return header.map(fieldItem => {
|
||||||
|
return fieldItem.name
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getterFieldListValue() {
|
||||||
|
var value = this.getterFieldList.filter(fieldItem => {
|
||||||
|
const isDisplayed = fieldItem.isDisplayed || fieldItem.isDisplayedFromLogic
|
||||||
|
if (fieldItem.isActive && isDisplayed && !fieldItem.isKey) {
|
||||||
|
return fieldItem
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return value.map(fieldItem => {
|
||||||
|
if (fieldItem.componentPath === 'FieldSelect') {
|
||||||
|
return 'DisplayColumn_' + fieldItem.columnName
|
||||||
|
} else {
|
||||||
|
return fieldItem.columnName
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
gettersRecordContextMenu() {
|
||||||
|
var record = []
|
||||||
|
var recordTable = this.isOption
|
||||||
|
record.push(recordTable)
|
||||||
|
return record
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
showNotification,
|
||||||
|
closeMenu() {
|
||||||
|
this.$store.dispatch('showMenuTable', {
|
||||||
|
isShowedTable: false
|
||||||
|
})
|
||||||
|
this.$store.dispatch('showMenuTabChildren', {
|
||||||
|
isShowedTabChildren: false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
showModal(process) {
|
||||||
|
var processData
|
||||||
|
processData = this.$store.getters.getProcess(process.uuid)
|
||||||
|
if (!this.isOption) {
|
||||||
|
this.$store.dispatch('setProcessSelect', {
|
||||||
|
selection: this.getDataSelection,
|
||||||
|
processTablaSelection: true,
|
||||||
|
tableName: this.isPanel.keyColumn
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
var selection = this.isOption
|
||||||
|
for (const element in selection) {
|
||||||
|
if (element === this.isPanel.keyColumn) {
|
||||||
|
valueProcess = selection[element]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$store.dispatch('setProcessTable', {
|
||||||
|
valueRecord: valueProcess,
|
||||||
|
tableName: this.isPanel.keyColumn,
|
||||||
|
processTable: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
var valueProcess
|
||||||
|
if (processData === undefined) {
|
||||||
|
this.$store.dispatch('getProcessFromServer', {
|
||||||
|
containerUuid: process.uuid,
|
||||||
|
routeToDelete: this.$route
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
this.$store.dispatch('setShowDialog', {
|
||||||
|
type: process.type,
|
||||||
|
action: response,
|
||||||
|
record: this.getDataSelection
|
||||||
|
})
|
||||||
|
}).catch(error => {
|
||||||
|
console.warn('ContextMenu: Dictionary Process (State) - Error ' + error.code + ': ' + error.message)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$store.dispatch('setShowDialog', { type: process.type, action: processData })
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tableProcess(process) {
|
||||||
|
// if (!this.isOption) {
|
||||||
|
// if (this.getDataSelection.length <= 1) {
|
||||||
|
// this.showModal(process)
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// this.showModal(process)
|
||||||
|
// }
|
||||||
|
this.showModal(process)
|
||||||
|
},
|
||||||
|
showTotals() {
|
||||||
|
this.$store.dispatch('showedTotals', this.containerUuid)
|
||||||
|
},
|
||||||
|
showOnlyMandatoryColumns() {
|
||||||
|
this.$store.dispatch('showOnlyMandatoryColumns', {
|
||||||
|
containerUuid: this.containerUuid
|
||||||
|
})
|
||||||
|
},
|
||||||
|
showAllAvailableColumns() {
|
||||||
|
this.$store.dispatch('showAllAvailableColumns', {
|
||||||
|
containerUuid: this.containerUuid
|
||||||
|
})
|
||||||
|
},
|
||||||
|
deleteSelection() {
|
||||||
|
this.$store.dispatch('deleteSelectionDataList', {
|
||||||
|
parentUuid: this.parentUuid,
|
||||||
|
containerUuid: this.containerUuid
|
||||||
|
})
|
||||||
|
this.$store.dispatch('setRecordSelection', {
|
||||||
|
parentUuid: this.parentUuid,
|
||||||
|
containerUuid: this.containerUuid,
|
||||||
|
panelType: this.panelType
|
||||||
|
})
|
||||||
|
},
|
||||||
|
addNewRow() {
|
||||||
|
if (this.getterNewRecords <= 0) {
|
||||||
|
this.$store.dispatch('addNewRow', {
|
||||||
|
parentUuid: this.parentUuid,
|
||||||
|
containerUuid: this.containerUuid,
|
||||||
|
fieldList: this.fieldList,
|
||||||
|
isEdit: true,
|
||||||
|
isSendServer: false
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
const fieldsEmpty = this.$store.getters.getFieldListEmptyMandatory({ containerUuid: this.containerUuid })
|
||||||
|
this.$message({
|
||||||
|
message: this.$t('notifications.mandatoryFieldMissing') + fieldsEmpty,
|
||||||
|
type: 'info'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
optionalPanel() {
|
||||||
|
this.showTableSearch = false
|
||||||
|
this.isOptional = !this.isOptional
|
||||||
|
},
|
||||||
|
fixedPanel() {
|
||||||
|
this.showTableSearch = false
|
||||||
|
this.isFixed = !this.isFixed
|
||||||
|
},
|
||||||
|
typeFormat(key, keyPath) {
|
||||||
|
Object.keys(supportedTypes).forEach(type => {
|
||||||
|
if (type === key) {
|
||||||
|
this.exporRecordTable(key)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.closeMenu()
|
||||||
|
},
|
||||||
|
exporRecordTable(key) {
|
||||||
|
const Header = this.getterFieldListHeader
|
||||||
|
const filterVal = this.getterFieldListValue
|
||||||
|
var list
|
||||||
|
if (!this.isOption) {
|
||||||
|
list = this.getDataSelection
|
||||||
|
} else {
|
||||||
|
list = this.gettersRecordContextMenu
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = this.formatJson(filterVal, list)
|
||||||
|
exportFileFromJson({
|
||||||
|
header: Header,
|
||||||
|
data,
|
||||||
|
filename: '',
|
||||||
|
exportType: key
|
||||||
|
})
|
||||||
|
},
|
||||||
|
formatJson(filterVal, jsonData) {
|
||||||
|
return jsonData.map(v => filterVal.map(j => v[j]))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -93,6 +93,12 @@ export default {
|
|||||||
},
|
},
|
||||||
windowRecordSelected() {
|
windowRecordSelected() {
|
||||||
return this.$store.state.window.recordSelected
|
return this.$store.state.window.recordSelected
|
||||||
|
},
|
||||||
|
getterDataRecordsAndSelection() {
|
||||||
|
return this.$store.getters.getDataRecordAndSelection(this.containerUuid)
|
||||||
|
},
|
||||||
|
getDataSelection() {
|
||||||
|
return this.getterDataRecordsAndSelection.selection
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -140,9 +146,26 @@ export default {
|
|||||||
const fieldNotReady = this.$store.getters.isNotReadyForSubmit(action.uuid)
|
const fieldNotReady = this.$store.getters.isNotReadyForSubmit(action.uuid)
|
||||||
if (!fieldNotReady) {
|
if (!fieldNotReady) {
|
||||||
this.closeDialog()
|
this.closeDialog()
|
||||||
|
const porcesTabla = this.$store.getters.getProcessSelect.processTablaSelection
|
||||||
|
const selection = this.$store.getters.getProcessSelect
|
||||||
|
if (porcesTabla) {
|
||||||
|
// selection.forEach(element => {
|
||||||
|
this.$store.dispatch('SelectionProcess', {
|
||||||
|
action: action, // process metadata
|
||||||
|
parentUuid: this.parentUuid,
|
||||||
|
containerUuid: this.containerUuid,
|
||||||
|
panelType: this.panelType, // determinate if get table name and record id (window) or selection (browser)
|
||||||
|
reportFormat: this.reportExportType,
|
||||||
|
recordUuidSelection: selection,
|
||||||
|
isProcessTableSelection: true,
|
||||||
|
routeToDelete: this.$route
|
||||||
|
})
|
||||||
|
// })
|
||||||
|
} else {
|
||||||
this.$store.dispatch('startProcess', {
|
this.$store.dispatch('startProcess', {
|
||||||
action: action, // process metadata
|
action: action, // process metadata
|
||||||
parentUuid: this.parentUuid,
|
parentUuid: this.parentUuid,
|
||||||
|
isProcessTableSelection: false,
|
||||||
containerUuid: this.containerUuid,
|
containerUuid: this.containerUuid,
|
||||||
panelType: this.panelType, // determinate if get table name and record id (window) or selection (browser)
|
panelType: this.panelType, // determinate if get table name and record id (window) or selection (browser)
|
||||||
reportFormat: this.reportExportType,
|
reportFormat: this.reportExportType,
|
||||||
@ -151,6 +174,7 @@ export default {
|
|||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.warn(error)
|
console.warn(error)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.showNotification({
|
this.showNotification({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
|
@ -25,7 +25,13 @@ export default {
|
|||||||
name: 'FieldDate',
|
name: 'FieldDate',
|
||||||
mixins: [fieldMixin],
|
mixins: [fieldMixin],
|
||||||
data() {
|
data() {
|
||||||
|
// value render
|
||||||
|
let value = this.metadata.value
|
||||||
|
if (this.metadata.inTable) {
|
||||||
|
value = this.valueModel
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
value: value,
|
||||||
pickerOptionsDate: {
|
pickerOptionsDate: {
|
||||||
shortcuts: [{
|
shortcuts: [{
|
||||||
text: this.$t('components.date.Today'),
|
text: this.$t('components.date.Today'),
|
||||||
|
@ -19,6 +19,7 @@ export default {
|
|||||||
succesful: ' Successful ',
|
succesful: ' Successful ',
|
||||||
error: ' Error ',
|
error: ' Error ',
|
||||||
opened: 'Opened',
|
opened: 'Opened',
|
||||||
|
totalProcess: 'Total Processor Records ',
|
||||||
// search
|
// search
|
||||||
searching: 'Searching records on the server',
|
searching: 'Searching records on the server',
|
||||||
succcessSearch: 'The search has been made',
|
succcessSearch: 'The search has been made',
|
||||||
|
@ -19,6 +19,7 @@ export default {
|
|||||||
succesful: ' Exitoso ',
|
succesful: ' Exitoso ',
|
||||||
error: ' Error ',
|
error: ' Error ',
|
||||||
opened: 'Abierto',
|
opened: 'Abierto',
|
||||||
|
totalProcess: 'Total de Registros Procesador ',
|
||||||
// search
|
// search
|
||||||
searching: 'Buscando registros en el servidor',
|
searching: 'Buscando registros en el servidor',
|
||||||
succcessSearch: 'La búsqueda se ha realizado',
|
succcessSearch: 'La búsqueda se ha realizado',
|
||||||
|
@ -14,7 +14,13 @@ const processControl = {
|
|||||||
process: [], // process to run finish
|
process: [], // process to run finish
|
||||||
sessionProcess: [],
|
sessionProcess: [],
|
||||||
notificationProcess: [],
|
notificationProcess: [],
|
||||||
inRequestMetadata: []
|
inRequestMetadata: [],
|
||||||
|
reportViewList: [],
|
||||||
|
totalResponse: 0,
|
||||||
|
totalRequest: 0,
|
||||||
|
totalSelection: 0,
|
||||||
|
errorSelection: 0,
|
||||||
|
successSelection: 0
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
// Add process in execution
|
// Add process in execution
|
||||||
@ -78,23 +84,39 @@ const processControl = {
|
|||||||
state.sessionProcess = []
|
state.sessionProcess = []
|
||||||
state.notificationProcess = []
|
state.notificationProcess = []
|
||||||
state.inRequestMetadata = []
|
state.inRequestMetadata = []
|
||||||
|
},
|
||||||
|
setReportViewsList(state, payload) {
|
||||||
|
state.reportViewList.push(payload)
|
||||||
|
},
|
||||||
|
setTotalResponse(state, payload) {
|
||||||
|
state.totalResponse = payload
|
||||||
|
},
|
||||||
|
setTotalSelection(state, payload) {
|
||||||
|
state.totalSelection = payload
|
||||||
|
},
|
||||||
|
setSuccessSelection(state, payload) {
|
||||||
|
state.successSelection = payload
|
||||||
|
},
|
||||||
|
setErrorSelection(state, payload) {
|
||||||
|
state.errorSelection = payload
|
||||||
|
},
|
||||||
|
setTotalRequest(state, payload) {
|
||||||
|
state.totalRequest = payload
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
// Supported Actions for it
|
// Supported Actions for it
|
||||||
startProcess({ commit, dispatch, getters, rootGetters }, params) {
|
startProcess({ commit, state, dispatch, getters, rootGetters }, params) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// TODO: Add support to evaluate params to send
|
// TODO: Add support to evaluate params to send
|
||||||
const samePocessInExecution = getters.getInExecution(params.containerUuid)
|
const samePocessInExecution = getters.getInExecution(params.containerUuid)
|
||||||
// exists some call to executed process with container uuid
|
// exists some call to executed process with container uuid
|
||||||
if (samePocessInExecution) {
|
if (samePocessInExecution && !params.isProcessTableSelection) {
|
||||||
return reject({
|
return reject({
|
||||||
error: 0,
|
error: 0,
|
||||||
message: `In this process (${samePocessInExecution.name}) there is already an execution in progress.`
|
message: `In this process (${samePocessInExecution.name}) there is already an execution in progress.`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// additional attributes to send server, selection to browser, or table name and record id to window
|
|
||||||
var selection = []
|
var selection = []
|
||||||
var allData = {}
|
var allData = {}
|
||||||
var tab, tableName, recordId
|
var tab, tableName, recordId
|
||||||
@ -117,13 +139,25 @@ const processControl = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (params.panelType === 'window') {
|
if (params.panelType === 'window') {
|
||||||
|
const contextMenu = getters.getRecordUuidMenu
|
||||||
|
if (params.isProcessTableSelection) {
|
||||||
|
tab = rootGetters.getTab(params.parentUuid, params.containerUuid)
|
||||||
|
tableName = params.tableNameUuidSelection
|
||||||
|
recordId = params.recordUuidSelection
|
||||||
|
} else {
|
||||||
|
if (contextMenu.processTable) {
|
||||||
|
tab = rootGetters.getTab(params.parentUuid, params.containerUuid)
|
||||||
|
tableName = contextMenu.tableName
|
||||||
|
recordId = contextMenu.valueRecord
|
||||||
|
} else {
|
||||||
tab = rootGetters.getTab(params.parentUuid, params.containerUuid)
|
tab = rootGetters.getTab(params.parentUuid, params.containerUuid)
|
||||||
tableName = tab.tableName
|
tableName = tab.tableName
|
||||||
const field = rootGetters.getFieldFromColumnName(params.containerUuid, tableName + '_ID')
|
const field = rootGetters.getFieldFromColumnName(params.containerUuid, tableName + '_ID')
|
||||||
recordId = field.value
|
recordId = field.value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// get info metadata process
|
// get info metadata process
|
||||||
const processDefinition = rootGetters.getProcess(params.action.uuid)
|
const processDefinition = rootGetters.getProcess(params.action.uuid)
|
||||||
var reportType = params.reportFormat
|
var reportType = params.reportFormat
|
||||||
@ -188,15 +222,25 @@ const processControl = {
|
|||||||
router.push({ path: '/dashboard' })
|
router.push({ path: '/dashboard' })
|
||||||
dispatch('tagsView/delView', params.routeToDelete)
|
dispatch('tagsView/delView', params.routeToDelete)
|
||||||
}
|
}
|
||||||
|
if (params.isProcessTableSelection) {
|
||||||
|
var windowSelectionProcess = getters.getProcessSelect
|
||||||
|
windowSelectionProcess.selection.forEach(selection => {
|
||||||
|
Object.assign(processResult, {
|
||||||
|
selection: selection.UUID,
|
||||||
|
record: selection[windowSelectionProcess.tableName]
|
||||||
|
})
|
||||||
|
const countRequest = state.totalRequest + 1
|
||||||
|
commit('setTotalRequest', countRequest)
|
||||||
|
if (!windowSelectionProcess.finish) {
|
||||||
runProcess({
|
runProcess({
|
||||||
uuid: processDefinition.uuid,
|
uuid: processDefinition.uuid,
|
||||||
id: processDefinition.id,
|
id: processDefinition.id,
|
||||||
reportType: reportType,
|
reportType: reportType,
|
||||||
parameters: finalParameters,
|
parameters: finalParameters,
|
||||||
selection: selection,
|
selection: selection,
|
||||||
tableName: tableName,
|
tableName: windowSelectionProcess.tableName,
|
||||||
recordId: recordId
|
recordId: selection[windowSelectionProcess.tableName]
|
||||||
|
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
var output = {
|
var output = {
|
||||||
@ -209,7 +253,7 @@ const processControl = {
|
|||||||
outputStream: '',
|
outputStream: '',
|
||||||
reportType: ''
|
reportType: ''
|
||||||
}
|
}
|
||||||
if (response.hasOutput()) {
|
if (response.getOutput()) {
|
||||||
const responseOutput = response.getOutput()
|
const responseOutput = response.getOutput()
|
||||||
output = {
|
output = {
|
||||||
uuid: responseOutput.getUuid(),
|
uuid: responseOutput.getUuid(),
|
||||||
@ -219,14 +263,7 @@ const processControl = {
|
|||||||
mimeType: responseOutput.getMimetype(),
|
mimeType: responseOutput.getMimetype(),
|
||||||
output: responseOutput.getOutput(),
|
output: responseOutput.getOutput(),
|
||||||
outputStream: responseOutput.getOutputstream(),
|
outputStream: responseOutput.getOutputstream(),
|
||||||
reportType: responseOutput.getReporttype(),
|
reportType: responseOutput.getReporttype()
|
||||||
dataCols: responseOutput.getDatacols(),
|
|
||||||
dataRows: responseOutput.getDatarows(),
|
|
||||||
footerName: responseOutput.getFootername(),
|
|
||||||
headerName: responseOutput.getHeadername(),
|
|
||||||
printFormatUuid: responseOutput.getPrintformatuuid(),
|
|
||||||
reportViewUuid: responseOutput.getReportviewuuid(),
|
|
||||||
tableName: responseOutput.getTablename()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var logList = []
|
var logList = []
|
||||||
@ -261,6 +298,148 @@ const processControl = {
|
|||||||
option: 'reportView'
|
option: 'reportView'
|
||||||
}
|
}
|
||||||
reportViewList.childs = getters.getReportViewList(processResult.processUuid)
|
reportViewList.childs = getters.getReportViewList(processResult.processUuid)
|
||||||
|
if (!reportViewList.childs.length) {
|
||||||
|
dispatch('requestReportViews', {
|
||||||
|
processUuid: processResult.processUuid
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
reportViewList.childs = response
|
||||||
|
// Get contextMenu metadata and concat print report views with contextMenu actions
|
||||||
|
var contextMenuMetadata = rootGetters.getContextMenu(processResult.processUuid)
|
||||||
|
contextMenuMetadata.actions.push(reportViewList)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Print formats to context menu
|
||||||
|
var printFormatList = {
|
||||||
|
name: language.t('views.printFormat'),
|
||||||
|
type: 'summary',
|
||||||
|
action: '',
|
||||||
|
childs: [],
|
||||||
|
option: 'printFormat'
|
||||||
|
}
|
||||||
|
printFormatList.childs = rootGetters.getPrintFormatList(processResult.processUuid)
|
||||||
|
if (!printFormatList.childs.length) {
|
||||||
|
dispatch('requestPrintFormats', {
|
||||||
|
processUuid: processResult.processUuid
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
printFormatList.childs = response
|
||||||
|
// Get contextMenu metadata and concat print Format List with contextMenu actions
|
||||||
|
var contextMenuMetadata = rootGetters.getContextMenu(processResult.processUuid)
|
||||||
|
contextMenuMetadata.actions.push(printFormatList)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// assign new attributes
|
||||||
|
Object.assign(processResult, {
|
||||||
|
instanceUuid: response.getInstanceuuid(),
|
||||||
|
url: link.href,
|
||||||
|
download: link.download,
|
||||||
|
isError: response.getIserror(),
|
||||||
|
isProcessing: response.getIsprocessing(),
|
||||||
|
summary: response.getSummary(),
|
||||||
|
ResultTableName: response.getResulttablename(),
|
||||||
|
lastRun: response.getLastrun(),
|
||||||
|
logs: logList,
|
||||||
|
output: output
|
||||||
|
})
|
||||||
|
dispatch('setReportTypeToShareLink', processResult.output.reportType)
|
||||||
|
commit('addNotificationProcess', processResult)
|
||||||
|
resolve(processResult)
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
Object.assign(processResult, {
|
||||||
|
isError: true,
|
||||||
|
message: error.message,
|
||||||
|
isProcessing: false
|
||||||
|
})
|
||||||
|
console.log('Error running the process', error)
|
||||||
|
reject(error)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
if (processResult.isError) {
|
||||||
|
const countError = state.errorSelection + 1
|
||||||
|
commit('setErrorSelection', countError)
|
||||||
|
} else {
|
||||||
|
const countSuccess = state.successSelection + 1
|
||||||
|
commit('setSuccessSelection', countSuccess)
|
||||||
|
}
|
||||||
|
const countResponse = state.totalResponse + 1
|
||||||
|
commit('setTotalResponse', countResponse)
|
||||||
|
if (state.totalResponse === state.totalRequest) {
|
||||||
|
// showNotification({
|
||||||
|
// title: language.t('notifications.succesful'),
|
||||||
|
// message: language.t('notifications.totalProcess') + countResponse + language.t('notifications.error') + state.errorSelection + language.t('notifications.succesful') + state.successSelection + language.t('notifications.processExecuted'),
|
||||||
|
// type: 'success'
|
||||||
|
// })
|
||||||
|
var processMessage = {
|
||||||
|
title: language.t('notifications.succesful'),
|
||||||
|
message: language.t('notifications.totalProcess') + countResponse + language.t('notifications.error') + state.errorSelection + language.t('notifications.succesful') + state.successSelection + language.t('notifications.processExecuted'),
|
||||||
|
type: 'success'
|
||||||
|
}
|
||||||
|
showNotification(processMessage)
|
||||||
|
commit('setTotalRequest', 0)
|
||||||
|
commit('setTotalResponse', 0)
|
||||||
|
commit('setSuccessSelection', 0)
|
||||||
|
commit('setErrorSelection', 0)
|
||||||
|
}
|
||||||
|
dispatch('setProcessSelect', {
|
||||||
|
selection: 0,
|
||||||
|
finish: true,
|
||||||
|
tableName: ''
|
||||||
|
})
|
||||||
|
commit('addNotificationProcess', processResult)
|
||||||
|
commit('addStartedProcess', processResult)
|
||||||
|
commit('deleteInExecution', {
|
||||||
|
containerUuid: params.containerUuid
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
runProcess({
|
||||||
|
uuid: processDefinition.uuid,
|
||||||
|
id: processDefinition.id,
|
||||||
|
reportType: reportType,
|
||||||
|
parameters: finalParameters,
|
||||||
|
selection: selection,
|
||||||
|
tableName: tableName,
|
||||||
|
recordId: recordId
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
var output = {
|
||||||
|
uuid: '',
|
||||||
|
name: '',
|
||||||
|
description: '',
|
||||||
|
fileName: '',
|
||||||
|
mimeType: '',
|
||||||
|
output: '',
|
||||||
|
outputStream: '',
|
||||||
|
reportType: ''
|
||||||
|
}
|
||||||
|
if (response.getOutput()) {
|
||||||
|
const responseOutput = response.getOutput()
|
||||||
|
output = {
|
||||||
|
uuid: responseOutput.getUuid(),
|
||||||
|
name: responseOutput.getName(),
|
||||||
|
description: responseOutput.getDescription(),
|
||||||
|
fileName: responseOutput.getFilename(),
|
||||||
|
mimeType: responseOutput.getMimetype(),
|
||||||
|
output: responseOutput.getOutput(),
|
||||||
|
outputStream: responseOutput.getOutputstream(),
|
||||||
|
reportType: responseOutput.getReporttype()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var logList = []
|
||||||
|
if (response.getLogsList()) {
|
||||||
|
logList = response.getLogsList().map(itemLog => {
|
||||||
|
return {
|
||||||
|
log: itemLog.getLog(),
|
||||||
|
recordId: itemLog.getRecordid()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
reportViewList.childs = getters.getReportViewList(processResult.processUuid)
|
||||||
if (reportViewList && !reportViewList.childs.length) {
|
if (reportViewList && !reportViewList.childs.length) {
|
||||||
dispatch('requestReportViews', {
|
dispatch('requestReportViews', {
|
||||||
processUuid: processResult.processUuid,
|
processUuid: processResult.processUuid,
|
||||||
@ -280,13 +459,9 @@ const processControl = {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print formats to context menu
|
var link = {
|
||||||
var printFormatList = {
|
href: undefined,
|
||||||
name: language.t('views.printFormat'),
|
download: undefined
|
||||||
type: 'summary',
|
|
||||||
action: '',
|
|
||||||
childs: [],
|
|
||||||
option: 'printFormat'
|
|
||||||
}
|
}
|
||||||
printFormatList.childs = rootGetters.getPrintFormatList(processResult.processUuid)
|
printFormatList.childs = rootGetters.getPrintFormatList(processResult.processUuid)
|
||||||
if (printFormatList && !printFormatList.childs.length) {
|
if (printFormatList && !printFormatList.childs.length) {
|
||||||
@ -306,6 +481,34 @@ const processControl = {
|
|||||||
contextMenuMetadata.actions.push(printFormatList)
|
contextMenuMetadata.actions.push(printFormatList)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.then(response => {
|
||||||
|
reportViewList.childs = response
|
||||||
|
// Get contextMenu metadata and concat print report views with contextMenu actions
|
||||||
|
var contextMenuMetadata = rootGetters.getContextMenu(processResult.processUuid)
|
||||||
|
contextMenuMetadata.actions.push(reportViewList)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Print formats to context menu
|
||||||
|
var printFormatList = {
|
||||||
|
name: language.t('views.printFormat'),
|
||||||
|
type: 'summary',
|
||||||
|
action: '',
|
||||||
|
childs: [],
|
||||||
|
option: 'printFormat'
|
||||||
|
}
|
||||||
|
printFormatList.childs = rootGetters.getPrintFormatList(processResult.processUuid)
|
||||||
|
if (!printFormatList.childs.length) {
|
||||||
|
dispatch('requestPrintFormats', {
|
||||||
|
processUuid: processResult.processUuid
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
printFormatList.childs = response
|
||||||
|
// Get contextMenu metadata and concat print Format List with contextMenu actions
|
||||||
|
var contextMenuMetadata = rootGetters.getContextMenu(processResult.processUuid)
|
||||||
|
contextMenuMetadata.actions.push(printFormatList)
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Drill Tables to context menu
|
// Drill Tables to context menu
|
||||||
@ -337,7 +540,7 @@ const processControl = {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}),
|
||||||
// assign new attributes
|
// assign new attributes
|
||||||
Object.assign(processResult, {
|
Object.assign(processResult, {
|
||||||
instanceUuid: response.getInstanceuuid(),
|
instanceUuid: response.getInstanceuuid(),
|
||||||
@ -351,9 +554,6 @@ const processControl = {
|
|||||||
logs: logList,
|
logs: logList,
|
||||||
output: output
|
output: output
|
||||||
})
|
})
|
||||||
dispatch('setReportTypeToShareLink', processResult.output.reportType)
|
|
||||||
resolve(processResult)
|
|
||||||
})
|
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
Object.assign(processResult, {
|
Object.assign(processResult, {
|
||||||
isError: true,
|
isError: true,
|
||||||
@ -382,14 +582,217 @@ const processControl = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
commit('addNotificationProcess', processResult)
|
commit('addNotificationProcess', processResult)
|
||||||
dispatch('finishProcess', { processOutput: processResult, routeToDelete: params.routeToDelete })
|
dispatch('finishProcess', {
|
||||||
|
processOutput: processResult,
|
||||||
|
routeToDelete: params.routeToDelete
|
||||||
|
})
|
||||||
|
dispatch('setProcessTable', {
|
||||||
|
valueRecord: 0,
|
||||||
|
tableName: '',
|
||||||
|
processTable: false
|
||||||
|
})
|
||||||
|
dispatch('setProcessSelect', {
|
||||||
|
finish: true
|
||||||
|
})
|
||||||
commit('deleteInExecution', {
|
commit('deleteInExecution', {
|
||||||
containerUuid: params.containerUuid
|
containerUuid: params.containerUuid
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// Supported to process selection
|
||||||
|
SelectionProcess({ commit, state, dispatch, getters, rootGetters }, params) {
|
||||||
|
// get info metadata process
|
||||||
|
const processDefinition = rootGetters.getProcess(params.action.uuid)
|
||||||
|
var reportType = 'pdf'
|
||||||
|
const finalParameters = rootGetters.getParametersToServer({ containerUuid: processDefinition.uuid })
|
||||||
|
|
||||||
|
showNotification({
|
||||||
|
title: language.t('notifications.processing'),
|
||||||
|
message: processDefinition.name,
|
||||||
|
summary: processDefinition.description,
|
||||||
|
type: 'info'
|
||||||
|
})
|
||||||
|
const timeInitialized = (new Date()).getTime()
|
||||||
|
// Run process on server and wait for it for notify
|
||||||
|
if (params.isProcessTableSelection) {
|
||||||
|
var windowSelectionProcess = getters.getProcessSelect
|
||||||
|
windowSelectionProcess.selection.forEach(selection => {
|
||||||
|
var processResult = {
|
||||||
|
// panel attributes from where it was executed
|
||||||
|
parentUuid: params.parentUuid,
|
||||||
|
containerUuid: params.containerUuid,
|
||||||
|
panelType: params.panelType,
|
||||||
|
menuParentUuid: params.menuParentUuid,
|
||||||
|
processIdPath: params.routeToDelete.path,
|
||||||
|
// process attributes
|
||||||
|
lastRun: timeInitialized,
|
||||||
|
action: processDefinition.name,
|
||||||
|
name: processDefinition.name,
|
||||||
|
description: processDefinition.description,
|
||||||
|
instanceUuid: '',
|
||||||
|
processUuid: processDefinition.uuid,
|
||||||
|
processId: processDefinition.id,
|
||||||
|
processName: processDefinition.processName,
|
||||||
|
parameters: finalParameters,
|
||||||
|
isError: false,
|
||||||
|
isProcessing: true,
|
||||||
|
isReport: processDefinition.isReport,
|
||||||
|
summary: '',
|
||||||
|
resultTableName: '',
|
||||||
|
logs: [],
|
||||||
|
selection: selection.UUID,
|
||||||
|
record: selection[windowSelectionProcess.tableName],
|
||||||
|
output: {
|
||||||
|
uuid: '',
|
||||||
|
name: '',
|
||||||
|
description: '',
|
||||||
|
fileName: '',
|
||||||
|
output: '',
|
||||||
|
outputStream: '',
|
||||||
|
reportType: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const countRequest = state.totalRequest + 1
|
||||||
|
commit('addInExecution', processResult)
|
||||||
|
commit('setTotalRequest', countRequest)
|
||||||
|
if (!windowSelectionProcess.finish) {
|
||||||
|
return runProcess({
|
||||||
|
uuid: processDefinition.uuid,
|
||||||
|
id: processDefinition.id,
|
||||||
|
reportType: reportType,
|
||||||
|
parameters: finalParameters,
|
||||||
|
selection: selection,
|
||||||
|
tableName: windowSelectionProcess.tableName,
|
||||||
|
recordId: selection[windowSelectionProcess.tableName]
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
var output = {
|
||||||
|
uuid: '',
|
||||||
|
name: '',
|
||||||
|
description: '',
|
||||||
|
fileName: '',
|
||||||
|
mimeType: '',
|
||||||
|
output: '',
|
||||||
|
outputStream: '',
|
||||||
|
reportType: ''
|
||||||
|
}
|
||||||
|
if (response.getOutput()) {
|
||||||
|
const responseOutput = response.getOutput()
|
||||||
|
output = {
|
||||||
|
uuid: responseOutput.getUuid(),
|
||||||
|
name: responseOutput.getName(),
|
||||||
|
description: responseOutput.getDescription(),
|
||||||
|
fileName: responseOutput.getFilename(),
|
||||||
|
mimeType: responseOutput.getMimetype(),
|
||||||
|
output: responseOutput.getOutput(),
|
||||||
|
outputStream: responseOutput.getOutputstream(),
|
||||||
|
reportType: responseOutput.getReporttype()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var logList = []
|
||||||
|
if (response.getLogsList()) {
|
||||||
|
logList = response.getLogsList().map(itemLog => {
|
||||||
|
return {
|
||||||
|
log: itemLog.getLog(),
|
||||||
|
recordId: itemLog.getRecordid()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
var link = {
|
||||||
|
href: undefined,
|
||||||
|
download: undefined
|
||||||
|
}
|
||||||
|
if (processDefinition.isReport) {
|
||||||
|
const blob = new Blob([output.outputStream], { type: output.mimeType })
|
||||||
|
link = document.createElement('a')
|
||||||
|
link.href = window.URL.createObjectURL(blob)
|
||||||
|
link.download = output.fileName
|
||||||
|
if (reportType !== 'pdf' && reportType !== 'html') {
|
||||||
|
link.click()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Report views List to context menu
|
||||||
|
var reportViewList = {
|
||||||
|
name: language.t('views.reportView'),
|
||||||
|
type: 'summary',
|
||||||
|
action: '',
|
||||||
|
childs: [],
|
||||||
|
option: 'reportView'
|
||||||
|
}
|
||||||
|
reportViewList.childs = getters.getReportViewList(processResult.processUuid)
|
||||||
|
if (!reportViewList.childs.length) {
|
||||||
|
dispatch('requestReportViews', {
|
||||||
|
processUuid: processResult.processUuid
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
reportViewList.childs = response
|
||||||
|
// Get contextMenu metadata and concat print report views with contextMenu actions
|
||||||
|
var contextMenuMetadata = rootGetters.getContextMenu(processResult.processUuid)
|
||||||
|
contextMenuMetadata.actions.push(reportViewList)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// assign new attributes
|
||||||
|
Object.assign(processResult, {
|
||||||
|
instanceUuid: response.getInstanceuuid(),
|
||||||
|
url: link.href,
|
||||||
|
download: link.download,
|
||||||
|
isError: response.getIserror(),
|
||||||
|
isProcessing: response.getIsprocessing(),
|
||||||
|
summary: response.getSummary(),
|
||||||
|
ResultTableName: response.getResulttablename(),
|
||||||
|
lastRun: response.getLastrun(),
|
||||||
|
logs: logList,
|
||||||
|
output: output
|
||||||
|
})
|
||||||
|
dispatch('setReportTypeToShareLink', processResult.output.reportType)
|
||||||
|
if (processResult.isError) {
|
||||||
|
const countError = state.errorSelection + 1
|
||||||
|
commit('setErrorSelection', countError)
|
||||||
|
} else {
|
||||||
|
const countSuccess = state.successSelection + 1
|
||||||
|
commit('setSuccessSelection', countSuccess)
|
||||||
|
}
|
||||||
|
const countResponse = state.totalResponse + 1
|
||||||
|
commit('setTotalResponse', countResponse)
|
||||||
|
if (state.totalResponse === state.totalRequest) {
|
||||||
|
var processMessage = {
|
||||||
|
title: language.t('notifications.succesful'),
|
||||||
|
message: language.t('notifications.totalProcess') + countResponse + language.t('notifications.error') + state.errorSelection + language.t('notifications.succesful') + state.successSelection + language.t('notifications.processExecuted'),
|
||||||
|
type: 'success'
|
||||||
|
}
|
||||||
|
showNotification(processMessage)
|
||||||
|
commit('setTotalRequest', 0)
|
||||||
|
commit('setTotalResponse', 0)
|
||||||
|
commit('setSuccessSelection', 0)
|
||||||
|
commit('setErrorSelection', 0)
|
||||||
|
}
|
||||||
|
dispatch('setProcessSelect', {
|
||||||
|
selection: 0,
|
||||||
|
finish: true,
|
||||||
|
tableName: ''
|
||||||
|
})
|
||||||
|
commit('addNotificationProcess', processResult)
|
||||||
|
commit('addStartedProcess', processResult)
|
||||||
|
commit('deleteInExecution', {
|
||||||
|
containerUuid: params.containerUuid
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
Object.assign(processResult, {
|
||||||
|
isError: true,
|
||||||
|
message: error.message,
|
||||||
|
isProcessing: false
|
||||||
|
})
|
||||||
|
console.log('Error running the process', error)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* TODO: Add date time in which the process/report was executed
|
* TODO: Add date time in which the process/report was executed
|
||||||
*/
|
*/
|
||||||
@ -505,7 +908,7 @@ const processControl = {
|
|||||||
logs: parameters.processOutput.logs,
|
logs: parameters.processOutput.logs,
|
||||||
summary: parameters.processOutput.summary
|
summary: parameters.processOutput.summary
|
||||||
}
|
}
|
||||||
var errorMessage = !isEmptyValue(parameters.processOutput.message) ? parameters.processOutput.message : language.t('login.unexpectedError')
|
var errorMessage = !isEmptyValue(parameters.processOutput.message) ? parameters.processOutput.message : language.t('login.error')
|
||||||
// TODO: Add isReport to type always 'success'
|
// TODO: Add isReport to type always 'success'
|
||||||
if (parameters.processOutput.isError || isEmptyValue(parameters.processOutput.processId) || isEmptyValue(parameters.processOutput.instanceUuid)) {
|
if (parameters.processOutput.isError || isEmptyValue(parameters.processOutput.processId) || isEmptyValue(parameters.processOutput.instanceUuid)) {
|
||||||
processMessage.title = language.t('notifications.error')
|
processMessage.title = language.t('notifications.error')
|
||||||
|
@ -10,7 +10,9 @@ const utils = {
|
|||||||
oldAction: undefined,
|
oldAction: undefined,
|
||||||
reportType: '',
|
reportType: '',
|
||||||
isShowedTable: false,
|
isShowedTable: false,
|
||||||
recordUuidTable: 0
|
isShowedTabChildren: false,
|
||||||
|
recordTable: 0,
|
||||||
|
selectionProcess: []
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
setWidth(state, width) {
|
setWidth(state, width) {
|
||||||
@ -28,11 +30,17 @@ const utils = {
|
|||||||
showMenuTable(state, isShowedTable) {
|
showMenuTable(state, isShowedTable) {
|
||||||
state.isShowedTable = isShowedTable
|
state.isShowedTable = isShowedTable
|
||||||
},
|
},
|
||||||
|
showMenuTabChildren(state, isShowedTabChildren) {
|
||||||
|
state.isShowedTabChildren = isShowedTabChildren
|
||||||
|
},
|
||||||
setSplitHeightTop(state, splitHeightTop) {
|
setSplitHeightTop(state, splitHeightTop) {
|
||||||
state.splitHeightTop = splitHeightTop
|
state.splitHeightTop = splitHeightTop
|
||||||
},
|
},
|
||||||
setRecordUuidMenu(state, recordUuidTable) {
|
setProcessTable(state, recordTable) {
|
||||||
state.recordUuidTable = recordUuidTable
|
state.recordTable = recordTable
|
||||||
|
},
|
||||||
|
setProcessSelecetion(state, selectionProcess) {
|
||||||
|
state.selectionProcess = selectionProcess
|
||||||
},
|
},
|
||||||
setTempShareLink(state, payload) {
|
setTempShareLink(state, payload) {
|
||||||
state.tempShareLink = payload
|
state.tempShareLink = payload
|
||||||
@ -57,14 +65,20 @@ const utils = {
|
|||||||
showMenuTable({ commit }, isShowedTable) {
|
showMenuTable({ commit }, isShowedTable) {
|
||||||
commit('showMenuTable', isShowedTable)
|
commit('showMenuTable', isShowedTable)
|
||||||
},
|
},
|
||||||
|
showMenuTabChildren({ commit }, isShowedTabChildren) {
|
||||||
|
commit('showMenuTabChildren', isShowedTabChildren)
|
||||||
|
},
|
||||||
setSplitHeight({ commit }, splitHeight) {
|
setSplitHeight({ commit }, splitHeight) {
|
||||||
commit('setSplitHeight', splitHeight)
|
commit('setSplitHeight', splitHeight)
|
||||||
},
|
},
|
||||||
setSplitHeightTop({ commit }, splitHeightTop) {
|
setSplitHeightTop({ commit }, splitHeightTop) {
|
||||||
commit('setSplitHeightTop', splitHeightTop)
|
commit('setSplitHeightTop', splitHeightTop)
|
||||||
},
|
},
|
||||||
setRecordUuidMenu({ commit }, recordUuidTable) {
|
setProcessTable({ commit }, recordTable) {
|
||||||
commit('setRecordUuidMenu', recordUuidTable)
|
commit('setProcessTable', recordTable)
|
||||||
|
},
|
||||||
|
setProcessSelect({ commit }, params) {
|
||||||
|
commit('setProcessSelecetion', params)
|
||||||
},
|
},
|
||||||
changeShowedDetail({ dispatch }, params) {
|
changeShowedDetail({ dispatch }, params) {
|
||||||
if (params.panelType === 'window') {
|
if (params.panelType === 'window') {
|
||||||
@ -89,6 +103,9 @@ const utils = {
|
|||||||
getWidth: (state) => {
|
getWidth: (state) => {
|
||||||
return state.width
|
return state.width
|
||||||
},
|
},
|
||||||
|
getProcessSelect: (state) => {
|
||||||
|
return state.selectionProcess
|
||||||
|
},
|
||||||
getWidthLayout: (state, rootGetters) => {
|
getWidthLayout: (state, rootGetters) => {
|
||||||
if (rootGetters.toggleSideBar) {
|
if (rootGetters.toggleSideBar) {
|
||||||
return state.width - 250
|
return state.width - 250
|
||||||
@ -102,12 +119,16 @@ const utils = {
|
|||||||
return state.getSplitHeightTop
|
return state.getSplitHeightTop
|
||||||
},
|
},
|
||||||
getRecordUuidMenu: (state) => {
|
getRecordUuidMenu: (state) => {
|
||||||
return state.recordUuidTable
|
return state.recordTable
|
||||||
},
|
},
|
||||||
getShowContextMenuTable: (state) => {
|
getShowContextMenuTable: (state) => {
|
||||||
const menu = state.isShowedTable.isShowedTable
|
const menu = state.isShowedTable.isShowedTable
|
||||||
return menu
|
return menu
|
||||||
},
|
},
|
||||||
|
getShowContextMenuTabChildren: (state) => {
|
||||||
|
const menu = state.isShowedTabChildren.isShowedTabChildren
|
||||||
|
return menu
|
||||||
|
},
|
||||||
getSplitHeight: (state) => {
|
getSplitHeight: (state) => {
|
||||||
const split = state.splitHeight
|
const split = state.splitHeight
|
||||||
var panelHeight = 0
|
var panelHeight = 0
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
</el-popover>
|
</el-popover>
|
||||||
<!-- show only when bring logs -->
|
<!-- show only when bring logs -->
|
||||||
<el-popover
|
<el-popover
|
||||||
v-else-if="activity.logs.length > 0"
|
v-else-if="activity.logs.length > 0 || activity.summary"
|
||||||
placement="right"
|
placement="right"
|
||||||
width="500"
|
width="500"
|
||||||
trigger="hover"
|
trigger="hover"
|
||||||
@ -90,9 +90,18 @@
|
|||||||
{{ checkStatus(activity.isError, activity.isProcessing, activity.isReport).text }}
|
{{ checkStatus(activity.isError, activity.isProcessing, activity.isReport).text }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
<el-tag v-else :type="checkStatus(activity.isError, activity.isProcessing, activity.isReport).type">
|
<el-popover
|
||||||
|
v-else
|
||||||
|
placement="top-start"
|
||||||
|
:title="$t('table.ProcessActivity.Logs')"
|
||||||
|
width="200"
|
||||||
|
trigger="hover"
|
||||||
|
:content="activity.summary"
|
||||||
|
>
|
||||||
|
<el-tag slot="reference" :type="checkStatus(activity.isError, activity.isProcessing, activity.isReport).type">
|
||||||
{{ checkStatus(activity.isError, activity.isProcessing, activity.isReport).text }}
|
{{ checkStatus(activity.isError, activity.isProcessing, activity.isReport).text }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
|
</el-popover>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user