mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-11 13:39:48 +08:00
fix: Undefined method. (#285)
This commit is contained in:
parent
f446bf6142
commit
5a38ada770
@ -1,6 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="container-submenu container-context-menu">
|
<div class="container-submenu container-context-menu">
|
||||||
<el-menu v-shortkey="{f2: ['f2'], f3: ['f3'], f5: ['f5'], f3:['ctrl', 'd']}" :default-active="activeMenu" :router="false" class="el-menu-demo" mode="horizontal" menu-trigger="hover" unique-opened @select="typeFormat" @shortkey.native="actionContextMenu">
|
<el-menu
|
||||||
|
v-shortkey="{ f2: ['f2'], f3: ['f3'], f5: ['f5'], f3:['ctrl', 'd'] }"
|
||||||
|
:default-active="activeMenu"
|
||||||
|
:router="false"
|
||||||
|
class="el-menu-demo"
|
||||||
|
mode="horizontal"
|
||||||
|
menu-trigger="hover"
|
||||||
|
unique-opened
|
||||||
|
@select="typeFormat"
|
||||||
|
@shortkey.native="actionContextMenu"
|
||||||
|
>
|
||||||
<template>
|
<template>
|
||||||
<el-submenu v-if="relationsList !== undefined && relationsList.length" class="el-menu-item" index="1">
|
<el-submenu v-if="relationsList !== undefined && relationsList.length" class="el-menu-item" index="1">
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
@ -55,7 +65,9 @@
|
|||||||
index="xlsx"
|
index="xlsx"
|
||||||
@click.native="exporWindow('xlsx')"
|
@click.native="exporWindow('xlsx')"
|
||||||
>
|
>
|
||||||
<template slot="title">{{ $t('components.contextMennuWindowReport') }}</template>
|
<template slot="title">
|
||||||
|
{{ $t('components.contextMennuWindowReport') }}
|
||||||
|
</template>
|
||||||
<template v-for="(format, index) in option">
|
<template v-for="(format, index) in option">
|
||||||
<el-menu-item :key="index" :index="index">
|
<el-menu-item :key="index" :index="index">
|
||||||
{{ format }}
|
{{ format }}
|
||||||
|
@ -1,10 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="container-submenu-mobile container-context-menu">
|
<div class="container-submenu-mobile container-context-menu">
|
||||||
<right-menu>
|
<right-menu>
|
||||||
<el-menu :default-active="activeMenu" :router="false" class="el-menu-demo" mode="vertical" menu-trigger="hover" unique-opened style="width: 258px; float: right;">
|
<el-menu
|
||||||
|
v-shortkey="{ f2: ['f2'], f3: ['f3'], f5: ['f5'], f3:['ctrl', 'd'] }"
|
||||||
|
:default-active="activeMenu"
|
||||||
|
:router="false"
|
||||||
|
class="el-menu-demo"
|
||||||
|
mode="vertical"
|
||||||
|
menu-trigger="hover"
|
||||||
|
unique-opened
|
||||||
|
style="width: 258px; float: right;"
|
||||||
|
>
|
||||||
<el-submenu index="1">
|
<el-submenu index="1">
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<svg-icon icon-class="tree" /> {{ $t('components.contextMenuRelations') }}
|
<svg-icon icon-class="tree" />
|
||||||
|
{{ $t('components.contextMenuRelations') }}
|
||||||
</template>
|
</template>
|
||||||
<el-menu-item-group>
|
<el-menu-item-group>
|
||||||
<el-scrollbar wrap-class="scroll">
|
<el-scrollbar wrap-class="scroll">
|
||||||
@ -14,7 +24,8 @@
|
|||||||
</el-submenu>
|
</el-submenu>
|
||||||
<el-submenu index="2">
|
<el-submenu index="2">
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<svg-icon icon-class="link" />{{ $t('components.contextMenuActions') }}
|
<svg-icon icon-class="link" />
|
||||||
|
{{ $t('components.contextMenuActions') }}
|
||||||
</template>
|
</template>
|
||||||
<el-menu-item-group>
|
<el-menu-item-group>
|
||||||
<el-scrollbar wrap-class="scroll">
|
<el-scrollbar wrap-class="scroll">
|
||||||
@ -28,7 +39,8 @@
|
|||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
</el-submenu>
|
</el-submenu>
|
||||||
<el-menu-item v-else :key="index" :index="action.name" :disabled="action.disabled" @click="runAction(action)">
|
<el-menu-item v-else :key="index" :index="action.name" :disabled="action.disabled" @click="runAction(action)">
|
||||||
<svg-icon v-if="action.type === 'process'" icon-class="component" /> {{ action.name }}
|
<svg-icon v-if="action.type === 'process'" icon-class="component" />
|
||||||
|
{{ action.name }}
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
</template>
|
</template>
|
||||||
<el-menu-item v-show="isReport" index="4">
|
<el-menu-item v-show="isReport" index="4">
|
||||||
|
@ -1,22 +1,28 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<el-submenu
|
||||||
|
v-if="item.meta.type === 'summary'"
|
||||||
|
key="is-summary"
|
||||||
|
:index="item.meta.title"
|
||||||
|
popper-append-to-body
|
||||||
|
>
|
||||||
|
<template slot="title">
|
||||||
|
<svg-icon v-if="isMobile" icon-class="nested" />
|
||||||
|
{{ item.meta.title }}
|
||||||
|
</template>
|
||||||
|
<item v-for="(child, subKey) in item.children" :key="subKey" :item="child">
|
||||||
|
{{ child.meta.title }}
|
||||||
|
</item>
|
||||||
|
</el-submenu>
|
||||||
<el-menu-item
|
<el-menu-item
|
||||||
v-if="item.meta.type !== 'summary'"
|
v-else
|
||||||
v-show="item.meta.uuid!==$route.meta.uuid"
|
v-show="item.meta.uuid !== $route.meta.uuid"
|
||||||
|
key="not-summary"
|
||||||
:index="item.meta.uuid"
|
:index="item.meta.uuid"
|
||||||
@click="handleClick(item)"
|
@click="handleClick(item)"
|
||||||
>
|
>
|
||||||
<svg-icon v-if="isMobile" :icon-class="classIconMenuRight" />
|
<svg-icon v-if="isMobile" :icon-class="classIconMenuRight" />
|
||||||
{{ item.meta.title }}
|
{{ item.meta.title }}
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
<el-submenu v-else :index="item.meta.title" popper-append-to-body>
|
|
||||||
<template slot="title">
|
|
||||||
<svg-icon v-if="isMobile" icon-class="nested" />
|
|
||||||
{{ item.meta.title }}
|
|
||||||
</template>
|
|
||||||
<item v-for="(child, key) in item.children" :key="key" :item="child">
|
|
||||||
{{ child.meta.title }}
|
|
||||||
</item>
|
|
||||||
</el-submenu>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -23,7 +23,11 @@ export const fieldMixin = {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
getterValue() {
|
getterValue() {
|
||||||
const field = this.$store.getters.getFieldFromColumnName(this.metadata.containerUuid, this.metadata.columnName)
|
const field = this.$store.getters.getFieldFromColumnName({
|
||||||
|
containerUuid: this.metadata.containerUuid,
|
||||||
|
columnName: this.metadata.columnName,
|
||||||
|
isAdvancedQuery: this.metadata.isAdvancedQuery
|
||||||
|
})
|
||||||
if (field) {
|
if (field) {
|
||||||
return field.value
|
return field.value
|
||||||
}
|
}
|
||||||
|
@ -174,6 +174,7 @@ export default {
|
|||||||
if (this.isPanelWindow) {
|
if (this.isPanelWindow) {
|
||||||
this.$store.dispatch('notifyFieldChangeDisplayColumn', {
|
this.$store.dispatch('notifyFieldChangeDisplayColumn', {
|
||||||
containerUuid: this.metadata.containerUuid,
|
containerUuid: this.metadata.containerUuid,
|
||||||
|
isAdvancedQuery: this.metadata.isAdvancedQuery,
|
||||||
columnName: this.metadata.columnName,
|
columnName: this.metadata.columnName,
|
||||||
displayColumn: responseLookupItem.label
|
displayColumn: responseLookupItem.label
|
||||||
})
|
})
|
||||||
|
@ -165,7 +165,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const sizeField = this.field.sizeFieldFromType.size
|
const sizeField = this.field.sizeFieldFromType.size
|
||||||
var newSizes = {}
|
const newSizes = {}
|
||||||
|
|
||||||
// in table set max width, used by browser result and tab children of window
|
// in table set max width, used by browser result and tab children of window
|
||||||
if (this.inTable) {
|
if (this.inTable) {
|
||||||
@ -243,6 +243,7 @@ export default {
|
|||||||
this.field = this.metadataField
|
this.field = this.metadataField
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
showMessage,
|
||||||
isDisplayed() {
|
isDisplayed() {
|
||||||
if (this.isAdvancedQuery) {
|
if (this.isAdvancedQuery) {
|
||||||
return this.field.isShowedFromUser
|
return this.field.isShowedFromUser
|
||||||
@ -347,6 +348,7 @@ export default {
|
|||||||
.custom-tittle-popover {
|
.custom-tittle-popover {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
float: left;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Separation between elements (item) of the form
|
* Separation between elements (item) of the form
|
||||||
|
@ -775,10 +775,11 @@ const panel = {
|
|||||||
},
|
},
|
||||||
notifyFieldChangeDisplayColumn({ commit, getters }, {
|
notifyFieldChangeDisplayColumn({ commit, getters }, {
|
||||||
containerUuid,
|
containerUuid,
|
||||||
|
isAdvancedQuery,
|
||||||
columnName,
|
columnName,
|
||||||
displayColumn
|
displayColumn
|
||||||
}) {
|
}) {
|
||||||
const field = getters.getFieldFromColumnName(containerUuid, columnName)
|
const field = getters.getFieldFromColumnName({ containerUuid, isAdvancedQuery, columnName })
|
||||||
commit('changeFieldValue', {
|
commit('changeFieldValue', {
|
||||||
field: field,
|
field: field,
|
||||||
newValue: field.value,
|
newValue: field.value,
|
||||||
@ -864,8 +865,10 @@ const panel = {
|
|||||||
}
|
}
|
||||||
return panel.fieldList
|
return panel.fieldList
|
||||||
},
|
},
|
||||||
getFieldFromColumnName: (state, getters) => (containerUuid, columnName) => {
|
getFieldFromColumnName: (state, getters) => ({ containerUuid, isAdvancedQuery, columnName }) => {
|
||||||
return getters.getFieldsListFromPanel(containerUuid).find(itemField => itemField.columnName === columnName)
|
return getters.getFieldsListFromPanel(containerUuid, isAdvancedQuery).find(itemField => {
|
||||||
|
return itemField.columnName === columnName
|
||||||
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Determinate if panel is ready fron send, all fiedls mandatory and displayed with values
|
* Determinate if panel is ready fron send, all fiedls mandatory and displayed with values
|
||||||
|
@ -157,7 +157,10 @@ const processControl = {
|
|||||||
} else {
|
} 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({
|
||||||
|
containerUuid: params.containerUuid,
|
||||||
|
columnName: `${tableName}_ID`
|
||||||
|
})
|
||||||
recordId = field.value
|
recordId = field.value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ const actions = {
|
|||||||
login({ commit }, userInfo) {
|
login({ commit }, userInfo) {
|
||||||
const { userName, password } = userInfo
|
const { userName, password } = userInfo
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
login({ userName: userName.trim(), password: password })
|
login({ userName, password })
|
||||||
.then(logInResponse => {
|
.then(logInResponse => {
|
||||||
const { uuid: token } = logInResponse
|
const { uuid: token } = logInResponse
|
||||||
|
|
||||||
@ -236,7 +236,7 @@ const actions = {
|
|||||||
message: error.message,
|
message: error.message,
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
console.warn(`Error change role: ${error.message}. Code: ${error.code}`)
|
console.warn(`Error change role: ${error.message}. Code: ${error.code}.`)
|
||||||
})
|
})
|
||||||
// return new Promise(async resolve => {
|
// return new Promise(async resolve => {
|
||||||
// const token = role
|
// const token = role
|
||||||
|
Loading…
x
Reference in New Issue
Block a user