1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-07 18:25:45 +08:00

Close popover of field options (#847)

* fix close popover the field

* delete route

Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
This commit is contained in:
Elsio Sanchez 2021-05-13 16:21:43 -04:00 committed by GitHub
parent e433b981cc
commit cbdaa475c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 34 additions and 12 deletions

View File

@ -16,7 +16,7 @@
along with this program. If not, see <https:www.gnu.org/licenses/>.
-->
<template>
<el-card class="box-card">
<el-card class="box-card" style="padding: 1%;">
<div slot="header" class="clearfix">
<span>
{{ $t('field.field') }}
@ -217,6 +217,7 @@ export default {
this.clearVariables()
this.$children[0].visible = false
this.$store.commit('changeShowRigthPanel', false)
this.$store.commit('changeShowOptionField', false)
if (!this.isEmptyValue(this.$route.query.fieldColumnName)) {
this.$router.push({
name: this.$route.name,

View File

@ -17,7 +17,7 @@
-->
<template>
<div>
<el-card class="box-card">
<el-card class="box-card" style="padding: 1%;">
<div slot="header" class="clearfix">
<span>
{{ $t('field.field') }}
@ -93,7 +93,7 @@ export default {
}
},
created() {
if (this.isEmptyValue(this.messageText)) {
if (!this.isEmptyValue(this.fieldAttributes.contextInfo.sqlStatement)) {
const sqlParse = parseContext({
parentUuid: this.fieldAttributes.parentUuid,
containerUuid: this.fieldAttributes.containerUuid,

View File

@ -19,6 +19,7 @@
<el-card
v-if="!isEmptyValue(metadataList)"
class="box-card"
style="padding: 1%;"
>
<div slot="header" class="clearfix">
<span>
@ -209,8 +210,6 @@ export default {
methods: {
createFieldFromDictionary,
close() {
this.$children[0].visible = false
this.$store.commit('changeShowRigthPanel', false)
if (!this.isEmptyValue(this.$route.query.fieldColumnName)) {
this.$router.push({
name: this.$route.name,
@ -220,6 +219,9 @@ export default {
fieldColumnName: ''
}
}, () => {})
this.$children[0].visible = false
this.$store.commit('changeShowRigthPanel', false)
this.$store.commit('changeShowOptionField', false)
}
},
remove() {

View File

@ -16,7 +16,7 @@
along with this program. If not, see <https:www.gnu.org/licenses/>.
-->
<template>
<el-card class="box-card">
<el-card class="box-card" style="padding: 1%;">
<div slot="header" class="clearfix">
<span>
{{ $t('field.field') }}
@ -190,6 +190,7 @@ export default {
close() {
this.$children[0].visible = false
this.$store.commit('changeShowRigthPanel', false)
this.$store.commit('changeShowOptionField', false)
}
}
}

View File

@ -131,11 +131,11 @@
width="400"
trigger="click"
style="padding: 0px;"
:hide="visibleForDesktop"
@hide="closePopover"
>
<component
:is="optionFieldFComponentRender"
v-if="visibleForDesktop"
v-if="visibleForDesktop && showPanelFieldOption"
:field-attributes="contextMenuField.fieldAttributes"
:source-field="contextMenuField.fieldAttributes"
:field-value="contextMenuField.valueField"
@ -266,6 +266,9 @@ export default {
},
computed: {
// load the component that is indicated in the attributes of received property
showPanelFieldOption() {
return this.$store.state.contextMenu.isShowOptionField
},
labelStyle() {
if (this.field.name.length >= 25) {
return '35'
@ -688,6 +691,16 @@ export default {
},
methods: {
recursiveTreeSearch,
closePopover() {
this.$router.push({
name: this.$route.name,
query: {
...this.$route.query,
typeAction: '',
fieldColumnName: ''
}
}, () => {})
},
handleOpen(key, keyPath) {
this.triggerMenu = 'hover'
},
@ -703,6 +716,7 @@ export default {
if (this.isMobile) {
this.$store.commit('changeShowRigthPanel', true)
} else {
this.$store.commit('changeShowOptionField', true)
this.visibleForDesktop = true
this.$router.push({
name: this.$route.name,

View File

@ -14,6 +14,7 @@ import { requestListDocumentActions, requestListDocumentStatuses } from '@/api/A
// ]
const initStateContextMenu = {
isShowRightPanel: false,
isShowOptionField: true,
isShowPopoverField: false,
optionField: {},
contextMenu: [],
@ -56,6 +57,9 @@ const contextMenu = {
}
state.isShowRightPanel = params
},
changeShowOptionField(state, params) {
state.isShowOptionField = params
},
changeShowPopoverField(state) {
state.isShowPopoverField = !state.isShowPopoverField
},

View File

@ -252,10 +252,10 @@ export default {
return this.$store.getters.getWindow(this.windowUuid)
},
isShowedTabsChildren() {
if (this.windowMetadata && this.windowMetadata.isShowedTabsChildren && this.isEmptyValue(this.$route.query.typeAction)) {
return this.windowMetadata.isShowedTabsChildren
}
return false
// if (this.windowMetadata && this.windowMetadata.isShowedTabsChildren && this.isEmptyValue(this.$route.query.typeAction)) {
// return this.windowMetadata.isShowedTabsChildren
// }
return this.windowMetadata.isShowedTabsChildren
},
isShowedRecordNavigation() {
if (this.windowMetadata && this.windowMetadata.isShowedRecordNavigation) {