mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-10 20:39:48 +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:
parent
e433b981cc
commit
cbdaa475c3
@ -16,7 +16,7 @@
|
|||||||
along with this program. If not, see <https:www.gnu.org/licenses/>.
|
along with this program. If not, see <https:www.gnu.org/licenses/>.
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<el-card class="box-card">
|
<el-card class="box-card" style="padding: 1%;">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>
|
<span>
|
||||||
{{ $t('field.field') }}
|
{{ $t('field.field') }}
|
||||||
@ -217,6 +217,7 @@ export default {
|
|||||||
this.clearVariables()
|
this.clearVariables()
|
||||||
this.$children[0].visible = false
|
this.$children[0].visible = false
|
||||||
this.$store.commit('changeShowRigthPanel', false)
|
this.$store.commit('changeShowRigthPanel', false)
|
||||||
|
this.$store.commit('changeShowOptionField', false)
|
||||||
if (!this.isEmptyValue(this.$route.query.fieldColumnName)) {
|
if (!this.isEmptyValue(this.$route.query.fieldColumnName)) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: this.$route.name,
|
name: this.$route.name,
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-card class="box-card">
|
<el-card class="box-card" style="padding: 1%;">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>
|
<span>
|
||||||
{{ $t('field.field') }}
|
{{ $t('field.field') }}
|
||||||
@ -93,7 +93,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (this.isEmptyValue(this.messageText)) {
|
if (!this.isEmptyValue(this.fieldAttributes.contextInfo.sqlStatement)) {
|
||||||
const sqlParse = parseContext({
|
const sqlParse = parseContext({
|
||||||
parentUuid: this.fieldAttributes.parentUuid,
|
parentUuid: this.fieldAttributes.parentUuid,
|
||||||
containerUuid: this.fieldAttributes.containerUuid,
|
containerUuid: this.fieldAttributes.containerUuid,
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
<el-card
|
<el-card
|
||||||
v-if="!isEmptyValue(metadataList)"
|
v-if="!isEmptyValue(metadataList)"
|
||||||
class="box-card"
|
class="box-card"
|
||||||
|
style="padding: 1%;"
|
||||||
>
|
>
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>
|
<span>
|
||||||
@ -209,8 +210,6 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
createFieldFromDictionary,
|
createFieldFromDictionary,
|
||||||
close() {
|
close() {
|
||||||
this.$children[0].visible = false
|
|
||||||
this.$store.commit('changeShowRigthPanel', false)
|
|
||||||
if (!this.isEmptyValue(this.$route.query.fieldColumnName)) {
|
if (!this.isEmptyValue(this.$route.query.fieldColumnName)) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: this.$route.name,
|
name: this.$route.name,
|
||||||
@ -220,6 +219,9 @@ export default {
|
|||||||
fieldColumnName: ''
|
fieldColumnName: ''
|
||||||
}
|
}
|
||||||
}, () => {})
|
}, () => {})
|
||||||
|
this.$children[0].visible = false
|
||||||
|
this.$store.commit('changeShowRigthPanel', false)
|
||||||
|
this.$store.commit('changeShowOptionField', false)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
remove() {
|
remove() {
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
along with this program. If not, see <https:www.gnu.org/licenses/>.
|
along with this program. If not, see <https:www.gnu.org/licenses/>.
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<el-card class="box-card">
|
<el-card class="box-card" style="padding: 1%;">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>
|
<span>
|
||||||
{{ $t('field.field') }}
|
{{ $t('field.field') }}
|
||||||
@ -190,6 +190,7 @@ export default {
|
|||||||
close() {
|
close() {
|
||||||
this.$children[0].visible = false
|
this.$children[0].visible = false
|
||||||
this.$store.commit('changeShowRigthPanel', false)
|
this.$store.commit('changeShowRigthPanel', false)
|
||||||
|
this.$store.commit('changeShowOptionField', false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -131,11 +131,11 @@
|
|||||||
width="400"
|
width="400"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
style="padding: 0px;"
|
style="padding: 0px;"
|
||||||
:hide="visibleForDesktop"
|
@hide="closePopover"
|
||||||
>
|
>
|
||||||
<component
|
<component
|
||||||
:is="optionFieldFComponentRender"
|
:is="optionFieldFComponentRender"
|
||||||
v-if="visibleForDesktop"
|
v-if="visibleForDesktop && showPanelFieldOption"
|
||||||
:field-attributes="contextMenuField.fieldAttributes"
|
:field-attributes="contextMenuField.fieldAttributes"
|
||||||
:source-field="contextMenuField.fieldAttributes"
|
:source-field="contextMenuField.fieldAttributes"
|
||||||
:field-value="contextMenuField.valueField"
|
:field-value="contextMenuField.valueField"
|
||||||
@ -266,6 +266,9 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
// load the component that is indicated in the attributes of received property
|
// load the component that is indicated in the attributes of received property
|
||||||
|
showPanelFieldOption() {
|
||||||
|
return this.$store.state.contextMenu.isShowOptionField
|
||||||
|
},
|
||||||
labelStyle() {
|
labelStyle() {
|
||||||
if (this.field.name.length >= 25) {
|
if (this.field.name.length >= 25) {
|
||||||
return '35'
|
return '35'
|
||||||
@ -688,6 +691,16 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
recursiveTreeSearch,
|
recursiveTreeSearch,
|
||||||
|
closePopover() {
|
||||||
|
this.$router.push({
|
||||||
|
name: this.$route.name,
|
||||||
|
query: {
|
||||||
|
...this.$route.query,
|
||||||
|
typeAction: '',
|
||||||
|
fieldColumnName: ''
|
||||||
|
}
|
||||||
|
}, () => {})
|
||||||
|
},
|
||||||
handleOpen(key, keyPath) {
|
handleOpen(key, keyPath) {
|
||||||
this.triggerMenu = 'hover'
|
this.triggerMenu = 'hover'
|
||||||
},
|
},
|
||||||
@ -703,6 +716,7 @@ export default {
|
|||||||
if (this.isMobile) {
|
if (this.isMobile) {
|
||||||
this.$store.commit('changeShowRigthPanel', true)
|
this.$store.commit('changeShowRigthPanel', true)
|
||||||
} else {
|
} else {
|
||||||
|
this.$store.commit('changeShowOptionField', true)
|
||||||
this.visibleForDesktop = true
|
this.visibleForDesktop = true
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: this.$route.name,
|
name: this.$route.name,
|
||||||
|
@ -14,6 +14,7 @@ import { requestListDocumentActions, requestListDocumentStatuses } from '@/api/A
|
|||||||
// ]
|
// ]
|
||||||
const initStateContextMenu = {
|
const initStateContextMenu = {
|
||||||
isShowRightPanel: false,
|
isShowRightPanel: false,
|
||||||
|
isShowOptionField: true,
|
||||||
isShowPopoverField: false,
|
isShowPopoverField: false,
|
||||||
optionField: {},
|
optionField: {},
|
||||||
contextMenu: [],
|
contextMenu: [],
|
||||||
@ -56,6 +57,9 @@ const contextMenu = {
|
|||||||
}
|
}
|
||||||
state.isShowRightPanel = params
|
state.isShowRightPanel = params
|
||||||
},
|
},
|
||||||
|
changeShowOptionField(state, params) {
|
||||||
|
state.isShowOptionField = params
|
||||||
|
},
|
||||||
changeShowPopoverField(state) {
|
changeShowPopoverField(state) {
|
||||||
state.isShowPopoverField = !state.isShowPopoverField
|
state.isShowPopoverField = !state.isShowPopoverField
|
||||||
},
|
},
|
||||||
|
@ -252,10 +252,10 @@ export default {
|
|||||||
return this.$store.getters.getWindow(this.windowUuid)
|
return this.$store.getters.getWindow(this.windowUuid)
|
||||||
},
|
},
|
||||||
isShowedTabsChildren() {
|
isShowedTabsChildren() {
|
||||||
if (this.windowMetadata && this.windowMetadata.isShowedTabsChildren && this.isEmptyValue(this.$route.query.typeAction)) {
|
// if (this.windowMetadata && this.windowMetadata.isShowedTabsChildren && this.isEmptyValue(this.$route.query.typeAction)) {
|
||||||
|
// return this.windowMetadata.isShowedTabsChildren
|
||||||
|
// }
|
||||||
return this.windowMetadata.isShowedTabsChildren
|
return this.windowMetadata.isShowedTabsChildren
|
||||||
}
|
|
||||||
return false
|
|
||||||
},
|
},
|
||||||
isShowedRecordNavigation() {
|
isShowedRecordNavigation() {
|
||||||
if (this.windowMetadata && this.windowMetadata.isShowedRecordNavigation) {
|
if (this.windowMetadata && this.windowMetadata.isShowedRecordNavigation) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user