mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-11 21:53:24 +08:00
Bugfix references filtering (#175)
* add feature for go to print format setup window from report viewer * change translation * add feature for field condition in table records * add evaluate logic for display field definition * bugfix references filter * some changes
This commit is contained in:
parent
aa931527f8
commit
7cb80dd246
@ -373,7 +373,16 @@ export const contextMixin = {
|
||||
this.$store.dispatch('getWindowByUuid', { routes: this.permissionRoutes, windowUuid: action.windowUuid })
|
||||
if (action.windowUuid && action.recordUuid) {
|
||||
var windowRoute = this.$store.getters.getWindowRoute(action.windowUuid)
|
||||
this.$router.push({ name: windowRoute.name, query: { action: action.type, referenceUuid: action.uuid, tabParent: 0 }})
|
||||
this.$router.push({
|
||||
name: windowRoute.name,
|
||||
query: {
|
||||
action: action.type,
|
||||
referenceUuid: action.uuid,
|
||||
recordUuid: action.recordUuid,
|
||||
windowUuid: this.parentUuid,
|
||||
tabParent: 0
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -11,11 +11,9 @@
|
||||
<template slot="title">
|
||||
<svg-icon v-if="isMobile" icon-class="nested" /> {{ item.meta.title }}
|
||||
</template>
|
||||
<!-- <el-scrollbar wrap-class="scroll"> -->
|
||||
<item v-for="(child, key) in item.children" :key="key" :item="child">
|
||||
{{ child.meta.title }}
|
||||
</item>
|
||||
<!-- </el-scrollbar> -->
|
||||
</el-submenu>
|
||||
</template>
|
||||
|
||||
|
@ -392,10 +392,11 @@ export default {
|
||||
})
|
||||
|
||||
if (route.query.action && route.query.action === 'reference') {
|
||||
const referenceInfo = this.$store.getters.getReferencesInfo(route.query.windowUuid, route.query.recordUuid, route.query.referenceUuid)
|
||||
parameters.isLoadAllRecords = false
|
||||
parameters.isReference = true
|
||||
parameters.referenceUuid = route.query.referenceUuid
|
||||
parameters.referenceWhereClause = route.query.whereClause
|
||||
parameters.referenceUuid = referenceInfo.uuid
|
||||
parameters.referenceWhereClause = referenceInfo.whereClause
|
||||
} else if (route.query.action && route.query.action === 'create-new') {
|
||||
parameters.isNewRecord = true
|
||||
} else if (route.query.action && route.query.action !== 'create-new' && route.query.action !== 'reference' && route.query.action !== 'advancedQuery') {
|
||||
@ -458,6 +459,8 @@ export default {
|
||||
parentUuid: this.parentUuid,
|
||||
containerUuid: this.containerUuid,
|
||||
isLoadAllRecords: parameters.isLoadAllRecords,
|
||||
isReference: parameters.isReference,
|
||||
referenceWhereClause: parameters.referenceWhereClause,
|
||||
columnName: parameters.columnName,
|
||||
value: parameters.value
|
||||
})
|
||||
|
@ -516,7 +516,17 @@ const windowControl = {
|
||||
* @param {boolean} isLoadAllRecords, if main panel is updated with new response data
|
||||
*/
|
||||
getDataListTab({ dispatch, rootGetters }, parameters) {
|
||||
const { parentUuid, containerUuid, recordUuid, isRefreshPanel = false, isLoadAllRecords = false, columnName, value } = parameters
|
||||
const {
|
||||
parentUuid,
|
||||
containerUuid,
|
||||
recordUuid,
|
||||
isRefreshPanel = false,
|
||||
isLoadAllRecords = false,
|
||||
isReference = false,
|
||||
referenceWhereClause = '',
|
||||
columnName,
|
||||
value
|
||||
} = parameters
|
||||
const tab = rootGetters.getTab(parentUuid, containerUuid)
|
||||
|
||||
var parsedQuery = tab.query
|
||||
@ -536,6 +546,15 @@ const windowControl = {
|
||||
value: tab.whereClause
|
||||
}, true)
|
||||
}
|
||||
|
||||
if (isReference) {
|
||||
if (!isEmptyValue(parsedWhereClause)) {
|
||||
parsedWhereClause += ' AND ' + referenceWhereClause
|
||||
} else {
|
||||
parsedWhereClause += referenceWhereClause
|
||||
}
|
||||
}
|
||||
|
||||
var conditions = []
|
||||
if (tab.isParentTab && !isEmptyValue(tab.tableName) && !isEmptyValue(value)) {
|
||||
conditions.push({
|
||||
@ -640,7 +659,11 @@ const windowControl = {
|
||||
return state.inCreate.find(item => item.containerUuid === containerUuid)
|
||||
},
|
||||
getReferencesList: (state) => (windowUuid, recordUuid) => {
|
||||
return (state.references.find(item => item.windowUuid === windowUuid && item.recordUuid === recordUuid))
|
||||
return state.references.find(item => item.windowUuid === windowUuid && item.recordUuid === recordUuid)
|
||||
},
|
||||
getReferencesInfo: (state, getters) => (windowUuid, recordUuid, referenceUuid) => {
|
||||
const references = getters.getReferencesList(windowUuid, recordUuid)
|
||||
return references.referencesList.find(item => item.uuid === referenceUuid)
|
||||
},
|
||||
getWindowRoute: (state) => (windowUuid) => {
|
||||
if (state.windowRoute && state.windowRoute.meta && state.windowRoute.meta.uuid === windowUuid) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user