mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-10 20:39:48 +08:00
Bugfix/#692 context menu butons (#700)
* fix: Context menu, change text by button. * fix default action window as New Record. * Add default action to run switch new and undo. * Add colot button to undo action. * change to plain and warning undo button. * modifit contextmenu mobile * remove console * minimal change * validate is LIstrecord * modifit contextmenu mobile (#9) * modifit contextmenu mobile * remove console * minimal change * validate is LIstrecord Co-authored-by: Elsio Sanchez <elsiosanche@gmail.com> * add description * Bugfix/#692 context menu butons (#10) * modifit contextmenu mobile * remove console * minimal change * validate is LIstrecord * add description Co-authored-by: Elsio Sanchez <elsiosanche@gmail.com> * add icon * Bugfix/#692 context menu butons (#11) * modifit contextmenu mobile * remove console * minimal change * validate is LIstrecord * add description * add icon Co-authored-by: Elsio Sanchez <elsiosanche@gmail.com> * change size the label * Bugfix/#692 context menu butons (#12) * modifit contextmenu mobile * remove console * minimal change * validate is LIstrecord * add description * add icon * change size the label Co-authored-by: Elsio Sanchez <elsiosanche@gmail.com> * changa size label * add style reference * add translations * add icon default * fixed position Co-authored-by: EdwinBetanc0urt <EdwinBetanco0urt@outlook.com> Co-authored-by: Elsio Sanchez <elsiosanche@gmail.com>
This commit is contained in:
parent
2e39e18c8a
commit
b4a3ec0b53
@ -3,7 +3,6 @@
|
|||||||
<el-menu
|
<el-menu
|
||||||
ref="contextMenu"
|
ref="contextMenu"
|
||||||
v-shortkey="shorcutKey"
|
v-shortkey="shorcutKey"
|
||||||
:default-active="activeMenu"
|
|
||||||
:router="false"
|
:router="false"
|
||||||
class="el-menu-demo"
|
class="el-menu-demo"
|
||||||
mode="horizontal"
|
mode="horizontal"
|
||||||
@ -11,19 +10,6 @@
|
|||||||
unique-opened
|
unique-opened
|
||||||
@shortkey.native="actionContextMenu"
|
@shortkey.native="actionContextMenu"
|
||||||
>
|
>
|
||||||
<!-- menu relations -->
|
|
||||||
<el-submenu v-if="!isEmptyChilds" class="el-menu-item" index="1">
|
|
||||||
<template slot="title">
|
|
||||||
{{ $t('components.contextMenuRelations') }}
|
|
||||||
</template>
|
|
||||||
<el-scrollbar wrap-class="scroll">
|
|
||||||
<items-relations v-for="(relation, index) in relationsList" :key="index" :item="relation" />
|
|
||||||
</el-scrollbar>
|
|
||||||
</el-submenu>
|
|
||||||
<el-menu-item v-else disabled index="relations">
|
|
||||||
{{ $t('components.contextMenuRelations') }}
|
|
||||||
</el-menu-item>
|
|
||||||
|
|
||||||
<!-- actions or process on container -->
|
<!-- actions or process on container -->
|
||||||
<el-submenu v-if="!isEmptyValue(actions)" class="el-menu-item" index="actions" @click.native="runAction(actions[0])">
|
<el-submenu v-if="!isEmptyValue(actions)" class="el-menu-item" index="actions" @click.native="runAction(actions[0])">
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
@ -102,6 +88,18 @@
|
|||||||
{{ $t('components.contextMenuActions') }}
|
{{ $t('components.contextMenuActions') }}
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
|
|
||||||
|
<!-- menu relations -->
|
||||||
|
<el-submenu v-if="!isEmptyChilds" class="el-menu-item" index="1">
|
||||||
|
<template slot="title">
|
||||||
|
{{ $t('components.contextMenuRelations') }}
|
||||||
|
</template>
|
||||||
|
<el-scrollbar wrap-class="scroll">
|
||||||
|
<items-relations v-for="(relation, index) in relationsList" :key="index" :item="relation" />
|
||||||
|
</el-scrollbar>
|
||||||
|
</el-submenu>
|
||||||
|
<el-menu-item v-else disabled index="relations">
|
||||||
|
{{ $t('components.contextMenuRelations') }}
|
||||||
|
</el-menu-item>
|
||||||
<!-- references of record -->
|
<!-- references of record -->
|
||||||
<el-submenu
|
<el-submenu
|
||||||
:disabled="!(isReferecesContent && isLoadedReferences)"
|
:disabled="!(isReferecesContent && isLoadedReferences)"
|
||||||
@ -136,6 +134,8 @@ import contextMixin from './contextMenuMixin.js'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ContextMenuDesktop',
|
name: 'ContextMenuDesktop',
|
||||||
mixins: [contextMixin]
|
mixins: [
|
||||||
|
contextMixin
|
||||||
|
]
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -60,6 +60,10 @@ export default {
|
|||||||
isDisplayed: {
|
isDisplayed: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
|
},
|
||||||
|
isListRecord: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@ -75,19 +79,17 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
activeMenu() {
|
|
||||||
const { meta, path } = this.$route
|
|
||||||
// if set path, the sidebar will highlight the path you set
|
|
||||||
if (meta.activeMenu) {
|
|
||||||
return meta.activeMenu
|
|
||||||
}
|
|
||||||
return path
|
|
||||||
},
|
|
||||||
getterContextMenu() {
|
getterContextMenu() {
|
||||||
return this.$store.getters.getContextMenu(this.containerUuid)
|
return this.$store.getters.getContextMenu(this.containerUuid)
|
||||||
},
|
},
|
||||||
|
isWindow() {
|
||||||
|
return this.panelType === 'window'
|
||||||
|
},
|
||||||
|
isWithRecord() {
|
||||||
|
return !this.isEmptyValue(this.recordUuid) && this.recordUuid !== 'create-new'
|
||||||
|
},
|
||||||
isReferecesContent() {
|
isReferecesContent() {
|
||||||
if (this.panelType === 'window' && !this.isEmptyValue(this.recordUuid) && this.recordUuid !== 'create-new') {
|
if (this.isWindow && this.isWithRecord) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
@ -160,7 +162,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
getDataLog() {
|
getDataLog() {
|
||||||
if (this.panelType === 'window') {
|
if (this.isWindow) {
|
||||||
return this.$store.getters.getDataLog(this.containerUuid, this.recordUuid)
|
return this.$store.getters.getDataLog(this.containerUuid, this.recordUuid)
|
||||||
}
|
}
|
||||||
return undefined
|
return undefined
|
||||||
@ -169,7 +171,7 @@ export default {
|
|||||||
return this.$store.getters.getCachedReport(this.$route.params.instanceUuid).parameters
|
return this.$store.getters.getCachedReport(this.$route.params.instanceUuid).parameters
|
||||||
},
|
},
|
||||||
getOldRouteOfWindow() {
|
getOldRouteOfWindow() {
|
||||||
if (this.panelType === 'window') {
|
if (this.isWindow) {
|
||||||
const oldRoute = this.$store.state['windowControl/index'].windowOldRoute
|
const oldRoute = this.$store.state['windowControl/index'].windowOldRoute
|
||||||
if (!this.isEmptyValue(oldRoute.query.action) && oldRoute.query.action !== 'create-new' && this.$route.query.action === 'create-new') {
|
if (!this.isEmptyValue(oldRoute.query.action) && oldRoute.query.action !== 'create-new' && this.$route.query.action === 'create-new') {
|
||||||
return oldRoute
|
return oldRoute
|
||||||
@ -234,18 +236,18 @@ export default {
|
|||||||
'$route.query.action'(actionValue) {
|
'$route.query.action'(actionValue) {
|
||||||
this.recordUuid = actionValue
|
this.recordUuid = actionValue
|
||||||
// only requires updating the context menu if it is Window
|
// only requires updating the context menu if it is Window
|
||||||
if (this.panelType === 'window') {
|
if (this.isWindow) {
|
||||||
this.generateContextMenu()
|
this.generateContextMenu()
|
||||||
this.getReferences()
|
this.getReferences()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isInsertRecord(newValue, oldValue) {
|
isInsertRecord(newValue, oldValue) {
|
||||||
if (this.panelType === 'window' && newValue !== oldValue) {
|
if (this.isWindow && newValue !== oldValue) {
|
||||||
this.generateContextMenu()
|
this.generateContextMenu()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getDataLog(newValue, oldValue) {
|
getDataLog(newValue, oldValue) {
|
||||||
if (this.panelType === 'window' && newValue !== oldValue) {
|
if (this.isWindow && newValue !== oldValue) {
|
||||||
this.generateContextMenu()
|
this.generateContextMenu()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -291,7 +293,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
refreshData() {
|
refreshData() {
|
||||||
if (this.panelType === 'window') {
|
if (this.isWindow) {
|
||||||
this.$store.dispatch('getDataListTab', {
|
this.$store.dispatch('getDataListTab', {
|
||||||
parentUuid: this.parentUuid,
|
parentUuid: this.parentUuid,
|
||||||
containerUuid: this.containerUuid,
|
containerUuid: this.containerUuid,
|
||||||
@ -350,7 +352,7 @@ export default {
|
|||||||
const tHeader = this.getterFieldsListHeader
|
const tHeader = this.getterFieldsListHeader
|
||||||
const filterVal = this.getterFieldsListValue
|
const filterVal = this.getterFieldsListValue
|
||||||
let list = []
|
let list = []
|
||||||
if (this.panelType === 'window') {
|
if (this.isWindow) {
|
||||||
list = this.getDataRecord
|
list = this.getDataRecord
|
||||||
} else if (this.panelType === 'browser') {
|
} else if (this.panelType === 'browser') {
|
||||||
// TODO: Check usage as the selection is exported with the table menu
|
// TODO: Check usage as the selection is exported with the table menu
|
||||||
@ -411,7 +413,7 @@ export default {
|
|||||||
})
|
})
|
||||||
this.$store.dispatch('setOrder', processAction)
|
this.$store.dispatch('setOrder', processAction)
|
||||||
}
|
}
|
||||||
if (this.panelType === 'window' && this.isEmptyValue(this.actions.find(element => element.action === 'recordAccess'))) {
|
if (this.isWindow && this.isEmptyValue(this.actions.find(element => element.action === 'recordAccess'))) {
|
||||||
this.$store.dispatch('addAttribute', {
|
this.$store.dispatch('addAttribute', {
|
||||||
tableName: this.tableNameCurrentTab,
|
tableName: this.tableNameCurrentTab,
|
||||||
recordId: this.getCurrentRecord[this.tableNameCurrentTab + '_ID'],
|
recordId: this.getCurrentRecord[this.tableNameCurrentTab + '_ID'],
|
||||||
@ -446,7 +448,7 @@ export default {
|
|||||||
// rollback
|
// rollback
|
||||||
if (itemAction.action === 'undoModifyData') {
|
if (itemAction.action === 'undoModifyData') {
|
||||||
itemAction.disabled = Boolean(!this.getDataLog && !this.getOldRouteOfWindow)
|
itemAction.disabled = Boolean(!this.getDataLog && !this.getOldRouteOfWindow)
|
||||||
} else if (this.recordUuid === 'create-new' || !this.isInsertRecord) {
|
} else if (!this.isWithRecord || !this.isInsertRecord) {
|
||||||
itemAction.disabled = true
|
itemAction.disabled = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -670,7 +672,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
setShareLink() {
|
setShareLink() {
|
||||||
let shareLink = this.panelType === 'window' || window.location.href.includes('?') ? `${window.location.href}&` : `${window.location.href}?`
|
let shareLink = this.isWindow || window.location.href.includes('?') ? `${window.location.href}&` : `${window.location.href}?`
|
||||||
if (this.$route.name === 'Report Viewer') {
|
if (this.$route.name === 'Report Viewer') {
|
||||||
const processParameters = convertFieldsListToShareLink(this.processParametersExecuted)
|
const processParameters = convertFieldsListToShareLink(this.processParametersExecuted)
|
||||||
const reportFormat = this.$store.getters.getReportType
|
const reportFormat = this.$store.getters.getReportType
|
||||||
|
@ -1,145 +1,141 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="container-submenu-mobile container-context-menu">
|
<div v-if="!isListRecord" class="container-submenu-mobile container-context-menu">
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
style="right: 70%;position: absolute;"
|
|
||||||
@click="runAction(actions[0])"
|
|
||||||
>
|
|
||||||
{{ $t('components.RunProcess') }}
|
|
||||||
</el-button>
|
|
||||||
<right-menu>
|
|
||||||
<el-menu
|
|
||||||
ref="contextMenu"
|
|
||||||
v-shortkey="shorcutKey"
|
|
||||||
:default-active="activeMenu"
|
|
||||||
:router="false"
|
|
||||||
class="el-menu-demo"
|
|
||||||
mode="vertical"
|
|
||||||
menu-trigger="hover"
|
|
||||||
unique-opened
|
|
||||||
style="width: 258px; float: right;"
|
|
||||||
>
|
|
||||||
<!-- menu relations -->
|
|
||||||
<el-submenu v-if="!isEmptyChilds" index="relations">
|
|
||||||
<template slot="title">
|
|
||||||
<svg-icon icon-class="tree" />
|
|
||||||
{{ $t('components.contextMenuRelations') }}
|
|
||||||
</template>
|
|
||||||
<el-menu-item-group>
|
|
||||||
<el-scrollbar wrap-class="scroll">
|
|
||||||
<items-relations v-for="(relation, index) in relationsList" :key="index" :item="relation" />
|
|
||||||
</el-scrollbar>
|
|
||||||
</el-menu-item-group>
|
|
||||||
</el-submenu>
|
|
||||||
<el-menu-item v-else disabled index="relations">
|
|
||||||
{{ $t('components.contextMenuRelations') }}
|
|
||||||
</el-menu-item>
|
|
||||||
|
|
||||||
<!-- actions or process on container -->
|
<!-- actions or process on container -->
|
||||||
<el-submenu index="actions">
|
<el-dropdown
|
||||||
<template slot="title">
|
size="mini"
|
||||||
<svg-icon icon-class="link" />
|
:hide-on-click="true"
|
||||||
{{ $t('components.contextMenuActions') }}
|
split-button
|
||||||
</template>
|
trigger="click"
|
||||||
<el-menu-item-group>
|
@command="clickRunAction"
|
||||||
<el-scrollbar wrap-class="scroll">
|
@click="runAction(defaultActionToRun)"
|
||||||
<template v-for="(action, index) in actions">
|
|
||||||
<el-submenu
|
|
||||||
v-if="action.childs"
|
|
||||||
:key="index"
|
|
||||||
:index="action.name"
|
|
||||||
:disabled="action.disabled"
|
|
||||||
>
|
>
|
||||||
<template slot="title">
|
{{ defaultActionName }}
|
||||||
{{ action.name }}
|
<el-dropdown-menu slot="dropdown">
|
||||||
</template>
|
<el-dropdown-item
|
||||||
<el-menu-item
|
command="refreshData"
|
||||||
v-for="(child, key) in action.childs"
|
|
||||||
:key="key"
|
|
||||||
:index="child.uuid"
|
|
||||||
@click="runAction(child)"
|
|
||||||
>
|
>
|
||||||
{{ child.name }}
|
<div class="contents">
|
||||||
</el-menu-item>
|
<div style="margin-right: 5%;margin-top: 10%;">
|
||||||
</el-submenu>
|
<i class="el-icon-refresh" style="font-weight: bolder;" />
|
||||||
<el-menu-item
|
</div>
|
||||||
v-else
|
<div>
|
||||||
:key="index"
|
<span class="contents">
|
||||||
:index="action.name"
|
<b class="label">
|
||||||
:disabled="action.disabled"
|
|
||||||
@click="runAction(action)"
|
|
||||||
>
|
|
||||||
<svg-icon v-if="action.type === 'process'" icon-class="component" />
|
|
||||||
{{ action.name }}
|
|
||||||
</el-menu-item>
|
|
||||||
</template>
|
|
||||||
<!-- other actions -->
|
|
||||||
<el-menu-item v-show="isReport" index="downloadReport">
|
|
||||||
<a :href="downloads" :download="file">
|
|
||||||
{{ $t('components.contextMenuDownload') }}
|
|
||||||
</a>
|
|
||||||
</el-menu-item>
|
|
||||||
<el-submenu
|
|
||||||
v-if="isManageDataRecords"
|
|
||||||
:disabled="isDisabledExportRecord"
|
|
||||||
index="exportRecord"
|
|
||||||
>
|
|
||||||
<template slot="title">
|
|
||||||
{{ $t('data.exportRecord') }}
|
|
||||||
</template>
|
|
||||||
<el-menu-item v-for="(format, keyFormat) in supportedTypes" :key="keyFormat" :index="keyFormat" @click.native="exportRecord(keyFormat)">
|
|
||||||
{{ format }}
|
|
||||||
</el-menu-item>
|
|
||||||
</el-submenu>
|
|
||||||
<el-menu-item v-show="$route.name === 'Report Viewer'" index="printFormat" @click="redirect">
|
|
||||||
{{ $t('components.contextMenuPrintFormatSetup') }}
|
|
||||||
</el-menu-item>
|
|
||||||
<el-menu-item v-if="isManageDataRecords" index="refreshData" @click="refreshData">
|
|
||||||
{{ $t('components.contextMenuRefresh') }}
|
{{ $t('components.contextMenuRefresh') }}
|
||||||
</el-menu-item>
|
</b>
|
||||||
<el-menu-item index="shareLink" @click="setShareLink">
|
</span>
|
||||||
{{ $t('components.contextMenuShareLink') }}
|
<p
|
||||||
</el-menu-item>
|
class="description"
|
||||||
</el-scrollbar>
|
>
|
||||||
</el-menu-item-group>
|
{{ $t('data.noDescription') }}
|
||||||
</el-submenu>
|
</p>
|
||||||
|
</div>
|
||||||
<!-- references of record -->
|
</div>
|
||||||
<el-submenu :disabled="!(isReferecesContent && isLoadedReferences)" class="el-menu-item" index="references">
|
</el-dropdown-item>
|
||||||
<template slot="title">
|
<el-dropdown-item
|
||||||
{{ $t('components.contextMenuReferences') }}
|
v-for="(action, index) in actions"
|
||||||
</template>
|
:key="index"
|
||||||
<template v-if="references && !isEmptyValue(references.referencesList)">
|
:command="action"
|
||||||
<el-scrollbar wrap-class="scroll-child">
|
:divided="true"
|
||||||
<el-menu-item
|
>
|
||||||
|
<div class="contents">
|
||||||
|
<div style="margin-right: 5%;margin-top: 10%;">
|
||||||
|
<i :class="iconAction(action)" style="font-weight: bolder;" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="contents">
|
||||||
|
<b class="label">
|
||||||
|
{{ action.name }}
|
||||||
|
</b>
|
||||||
|
</span>
|
||||||
|
<p
|
||||||
|
class="description"
|
||||||
|
>
|
||||||
|
{{ $t('data.noDescription') }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
<!-- menu relations -->
|
||||||
|
<el-dropdown size="mini" @command="clickRelation">
|
||||||
|
<el-button size="mini">
|
||||||
|
{{ $t('components.contextMenuRelations') }} <i class="el-icon-arrow-down el-icon--right" />
|
||||||
|
</el-button>
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item
|
||||||
|
v-for="(relation, index) in relationsList"
|
||||||
|
:key="index"
|
||||||
|
:command="relation"
|
||||||
|
:divided="true"
|
||||||
|
>
|
||||||
|
<div class="contents">
|
||||||
|
<div style="margin-right: 5%;margin-top: 10%;">
|
||||||
|
<svg-icon :icon-class="relation.meta.icon" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="contents">
|
||||||
|
<b class="label">
|
||||||
|
{{ relation.meta.title }}
|
||||||
|
</b>
|
||||||
|
</span>
|
||||||
|
<p
|
||||||
|
class="description"
|
||||||
|
>
|
||||||
|
{{ relation.meta.description }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
<el-dropdown size="mini" @command="clickReferences">
|
||||||
|
<el-button size="mini" :disabled="!(isReferecesContent && isLoadedReferences)">
|
||||||
|
{{ $t('components.contextMenuReferences') }} <i class="el-icon-arrow-down el-icon--right" />
|
||||||
|
</el-button>
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item
|
||||||
v-for="(reference, index) in references.referencesList"
|
v-for="(reference, index) in references.referencesList"
|
||||||
:key="index"
|
:key="index"
|
||||||
:index="reference.displayName"
|
:command="reference"
|
||||||
@click="openReference(reference)"
|
:divided="true"
|
||||||
>
|
>
|
||||||
|
<div class="contents">
|
||||||
|
<div>
|
||||||
|
<span class="contents">
|
||||||
|
<b class="label">
|
||||||
{{ reference.displayName }}
|
{{ reference.displayName }}
|
||||||
</el-menu-item>
|
</b>
|
||||||
</el-scrollbar>
|
</span>
|
||||||
</template>
|
<p
|
||||||
<el-menu-item v-else index="not-references" disabled>
|
class="description"
|
||||||
{{ $t('components.withOutReferences') }}
|
>
|
||||||
</el-menu-item>
|
{{ $t('data.noDescription') }}
|
||||||
</el-submenu>
|
</p>
|
||||||
</el-menu>
|
</div>
|
||||||
</right-menu>
|
</div>
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import contextMixin from './contextMenuMixin.js'
|
import contextMixin from './contextMenuMixin.js'
|
||||||
import RightMenu from '@/components/RightPanel/menu'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ContextMenuMobile',
|
name: 'ContextMenuMobile',
|
||||||
components: {
|
mixins: [
|
||||||
RightMenu
|
contextMixin
|
||||||
|
],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
openedsMenu: [
|
||||||
|
'actions'
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mixins: [contextMixin],
|
|
||||||
computed: {
|
computed: {
|
||||||
isPanelTypeMobile() {
|
isPanelTypeMobile() {
|
||||||
if (['process', 'report'].includes(this.$route.meta.type)) {
|
if (['process', 'report'].includes(this.$route.meta.type)) {
|
||||||
@ -147,17 +143,144 @@ export default {
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
|
isUndoAction() {
|
||||||
|
if (this.isWindow) {
|
||||||
|
if (!this.isWithRecord) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
},
|
||||||
|
typeOfAction() {
|
||||||
|
if (this.isUndoAction) {
|
||||||
|
return 'warning'
|
||||||
|
}
|
||||||
|
return 'default'
|
||||||
|
},
|
||||||
|
isPlain() {
|
||||||
|
if (this.isUndoAction) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
},
|
||||||
|
defaultActionToRun() {
|
||||||
|
if (this.isUndoAction) {
|
||||||
|
return this.actions[2]
|
||||||
|
}
|
||||||
|
return this.actions[0]
|
||||||
|
},
|
||||||
|
defaultActionName() {
|
||||||
|
if (this.isWindow) {
|
||||||
|
if (this.isWithRecord) {
|
||||||
|
return this.$t('window.newRecord')
|
||||||
|
}
|
||||||
|
return this.$t('data.undo')
|
||||||
|
}
|
||||||
|
return this.$t('components.RunProcess')
|
||||||
|
},
|
||||||
iconDefault() {
|
iconDefault() {
|
||||||
if (this.isPanelTypeMobile) {
|
if (this.isPanelTypeMobile) {
|
||||||
return 'component'
|
return 'component'
|
||||||
}
|
}
|
||||||
return 'skill'
|
return 'skill'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
clickRelation(item) {
|
||||||
|
this.$router.push({
|
||||||
|
name: item.name,
|
||||||
|
query: {
|
||||||
|
tabParent: 0
|
||||||
|
}
|
||||||
|
}, () => {})
|
||||||
|
},
|
||||||
|
clickRunAction(action) {
|
||||||
|
if (action === 'refreshData') {
|
||||||
|
this.refreshData()
|
||||||
|
} else {
|
||||||
|
this.runAction(action)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
clickReferences(reference) {
|
||||||
|
this.openReference(reference)
|
||||||
|
},
|
||||||
|
iconAction(action) {
|
||||||
|
let icon
|
||||||
|
if (action.type === 'dataAction') {
|
||||||
|
switch (action.action) {
|
||||||
|
case 'setDefaultValues':
|
||||||
|
icon = 'el-icon-news'
|
||||||
|
break
|
||||||
|
case 'deleteEntity':
|
||||||
|
icon = 'el-icon-delete'
|
||||||
|
break
|
||||||
|
case 'undoModifyData':
|
||||||
|
icon = 'el-icon-refresh-left'
|
||||||
|
break
|
||||||
|
case 'lockRecord':
|
||||||
|
icon = 'el-icon-lock'
|
||||||
|
break
|
||||||
|
case 'unlockRecord':
|
||||||
|
icon = 'el-icon-unlock'
|
||||||
|
break
|
||||||
|
case 'recordAccess':
|
||||||
|
icon = 'el-icon-c-scale-to-original'
|
||||||
|
break
|
||||||
|
}
|
||||||
|
} else if (action.type === 'process') {
|
||||||
|
icon = 'el-icon-setting'
|
||||||
|
} else {
|
||||||
|
icon = 'el-icon-setting'
|
||||||
|
}
|
||||||
|
return icon
|
||||||
|
},
|
||||||
|
styleLabelAction(value) {
|
||||||
|
if (value) {
|
||||||
|
return 'font-size: 14px;margin-top: 0% !important;margin-left: 0px;margin-bottom: 10%;display: contents;'
|
||||||
|
} else {
|
||||||
|
return 'font-size: 14px;margin-top: 1.5% !important;margin-left: 2%;margin-bottom: 5%;display: contents;'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.el-tree-node__children {
|
||||||
|
overflow: hidden;
|
||||||
|
background-color: transparent;
|
||||||
|
max-width: 99%;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
.el-dropdown .el-button-group {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.el-dropdown-menu {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 10;
|
||||||
|
padding: 10px 0;
|
||||||
|
margin: 5px 0;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
border: 1px solid #e6ebf5;
|
||||||
|
border-radius: 4px;
|
||||||
|
-webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||||
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||||
|
max-height: 250px;
|
||||||
|
max-width: 220px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
.el-dropdown-menu--mini .el-dropdown-menu__item {
|
||||||
|
line-height: 14px;
|
||||||
|
padding: 0px 15px;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
.el-dropdown-menu__item--divided {
|
||||||
|
position: relative;
|
||||||
|
/* margin-top: 6px; */
|
||||||
|
border-top: 1px solid #e6ebf5;
|
||||||
|
}
|
||||||
.svg-icon {
|
.svg-icon {
|
||||||
width: 1em;
|
width: 1em;
|
||||||
height: 2em;
|
height: 2em;
|
||||||
@ -165,4 +288,18 @@ export default {
|
|||||||
fill: currentColor;
|
fill: currentColor;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
.label {
|
||||||
|
font-size: 14px;
|
||||||
|
margin-top: 0% !important;
|
||||||
|
margin-left: 0px;
|
||||||
|
text-align: initial;
|
||||||
|
}
|
||||||
|
.description {
|
||||||
|
margin: 0px;
|
||||||
|
font-size: 12px;
|
||||||
|
text-align: initial;
|
||||||
|
}
|
||||||
|
.contents {
|
||||||
|
display: inline-flex;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
:last-parameter="lastParameter"
|
:last-parameter="lastParameter"
|
||||||
:report-format="reportFormat"
|
:report-format="reportFormat"
|
||||||
:is-insert-record="isInsertRecord"
|
:is-insert-record="isInsertRecord"
|
||||||
|
:is-list-record="isListRecord"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -55,6 +56,10 @@ export default {
|
|||||||
isInsertRecord: {
|
isInsertRecord: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: undefined
|
default: undefined
|
||||||
|
},
|
||||||
|
isListRecord: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -110,9 +115,9 @@ export default {
|
|||||||
.container-submenu-mobile {
|
.container-submenu-mobile {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
height: 39px !important;
|
height: 39px !important;
|
||||||
width: 55px !important;
|
right: 0%;
|
||||||
right: 0;
|
|
||||||
top: 0;
|
top: 0;
|
||||||
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container-submenu {
|
.container-submenu {
|
||||||
|
@ -1,12 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<div ref="rightMenu" :class="{show:show}" class="rightMenu-container">
|
<div
|
||||||
|
ref="rightMenu"
|
||||||
|
:class="{ show: isShowRightPanel }"
|
||||||
|
class="rightMenu-container"
|
||||||
|
>
|
||||||
<div class="setting">
|
<div class="setting">
|
||||||
<div class="showme">
|
<div class="showme">
|
||||||
<!-- <div class="rightMenu-background" /> -->
|
<!-- <div class="rightMenu-background" /> -->
|
||||||
<div class="rightMenu">
|
<div class="rightMenu">
|
||||||
<div class="handle-button" :style="{'top':buttonTop+'%'}" @click="show=!show">
|
<div
|
||||||
<i :class="show?'el-icon-close':'el-icon-more'" style="color: gray;" />
|
class="handle-button"
|
||||||
|
:style="{ 'top': buttonTop+'%' }"
|
||||||
|
@click="isShowRightPanel=!isShowRightPanel"
|
||||||
|
>
|
||||||
|
<i :class="icon" style="color: gray;" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="rightMenu-items">
|
<div class="rightMenu-items">
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
@ -20,7 +29,7 @@
|
|||||||
import { addClass, removeClass } from '@/utils'
|
import { addClass, removeClass } from '@/utils'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Menu',
|
name: 'RightPanel',
|
||||||
props: {
|
props: {
|
||||||
clickNotClose: {
|
clickNotClose: {
|
||||||
default: false,
|
default: false,
|
||||||
@ -37,6 +46,20 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
isShowRightPanel: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.contextMenu.isShowRightPanel
|
||||||
|
},
|
||||||
|
set() {
|
||||||
|
this.$store.commit('changeShowRigthPanel')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
icon() {
|
||||||
|
if (this.isShowRightPanel) {
|
||||||
|
return 'el-icon-close'
|
||||||
|
}
|
||||||
|
return 'el-icon-more'
|
||||||
|
},
|
||||||
theme() {
|
theme() {
|
||||||
return this.$store.state.settings.theme
|
return this.$store.state.settings.theme
|
||||||
}
|
}
|
@ -319,6 +319,7 @@ export default {
|
|||||||
deleteRecordError: 'Error deleting record',
|
deleteRecordError: 'Error deleting record',
|
||||||
exportRecord: 'Export Record',
|
exportRecord: 'Export Record',
|
||||||
lockRecord: 'Lock Record',
|
lockRecord: 'Lock Record',
|
||||||
|
noDescription: 'No Description',
|
||||||
recordAccess: {
|
recordAccess: {
|
||||||
actions: 'Record Access',
|
actions: 'Record Access',
|
||||||
hideRecord: 'Hide Record',
|
hideRecord: 'Hide Record',
|
||||||
|
@ -294,6 +294,7 @@ export default {
|
|||||||
deleteRecordError: 'Error al eliminar el regitro',
|
deleteRecordError: 'Error al eliminar el regitro',
|
||||||
exportRecord: 'Exportar Registro',
|
exportRecord: 'Exportar Registro',
|
||||||
lockRecord: 'Bloquear Registro',
|
lockRecord: 'Bloquear Registro',
|
||||||
|
noDescription: 'Sin Descripción',
|
||||||
recordAccess: {
|
recordAccess: {
|
||||||
actions: 'Acceso a registros',
|
actions: 'Acceso a registros',
|
||||||
hideRecord: 'Ocultar Registro',
|
hideRecord: 'Ocultar Registro',
|
||||||
|
@ -13,6 +13,7 @@ import { requestListDocumentActions, requestListDocumentStatuses } from '@/api/A
|
|||||||
// }
|
// }
|
||||||
// ]
|
// ]
|
||||||
const initStateContextMenu = {
|
const initStateContextMenu = {
|
||||||
|
isShowRightPanel: false,
|
||||||
contextMenu: [],
|
contextMenu: [],
|
||||||
listDocumentStatus: {
|
listDocumentStatus: {
|
||||||
defaultDocumentAction: undefined,
|
defaultDocumentAction: undefined,
|
||||||
@ -43,6 +44,9 @@ const contextMenu = {
|
|||||||
addlistDocumentStatus(state, payload) {
|
addlistDocumentStatus(state, payload) {
|
||||||
state.listDocumentStatus = payload
|
state.listDocumentStatus = payload
|
||||||
},
|
},
|
||||||
|
changeShowRigthPanel(state) {
|
||||||
|
state.isShowRightPanel = !state.isShowRightPanel
|
||||||
|
},
|
||||||
resetContextMenu(state) {
|
resetContextMenu(state) {
|
||||||
state = initStateContextMenu
|
state = initStateContextMenu
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
:style="isWorkflowBarStatus ? 'height: 45px; background: #F5F7FA' : 'height: 40px'"
|
:style="isWorkflowBarStatus ? 'height: 45px; background: #F5F7FA' : 'height: 40px'"
|
||||||
>
|
>
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-aside width="100%" style="width: 78vw; overflow: hidden;">
|
<el-aside width="100%" style="overflow: hidden;">
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<workflow-status-bar
|
<workflow-status-bar
|
||||||
v-if="isWorkflowBarStatus"
|
v-if="isWorkflowBarStatus"
|
||||||
@ -76,6 +76,7 @@
|
|||||||
:table-name="windowMetadata.currentTab.tableName"
|
:table-name="windowMetadata.currentTab.tableName"
|
||||||
:panel-type="panelType"
|
:panel-type="panelType"
|
||||||
:is-insert-record="windowMetadata.currentTab.isInsertRecord"
|
:is-insert-record="windowMetadata.currentTab.isInsertRecord"
|
||||||
|
:is-list-record="isShowedRecordNavigation"
|
||||||
/>
|
/>
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user