1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-13 07:04:21 +08:00

fix: Is read only record with different client id. (#676)

Co-authored-by: EdwinBetanc0urt <EdwinBetanco0urt@outlook.com>
This commit is contained in:
Edwin Betancourt 2021-03-17 11:20:07 -04:00 committed by GitHub
parent 837135030e
commit 1c928e238f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 9 deletions

View File

@ -207,6 +207,15 @@ export default {
} }
return this.field.isMandatory || this.field.isMandatoryFromLogic return this.field.isMandatory || this.field.isMandatoryFromLogic
}, },
isPanelWindow() {
return this.field.panelType === 'window'
},
preferenceClientId() {
if (this.isPanelWindow) {
return this.$store.getters.getPreferenceClientId
}
return undefined
},
/** /**
* Idicate if field is read only * Idicate if field is read only
* TODO: Create common method to evaluate isReadOnly * TODO: Create common method to evaluate isReadOnly
@ -228,7 +237,15 @@ export default {
const isUpdateableAllFields = this.field.isReadOnly || this.field.isReadOnlyFromLogic const isUpdateableAllFields = this.field.isReadOnly || this.field.isReadOnlyFromLogic
if (this.field.panelType === 'window') { if (this.isPanelWindow) {
// TODO: Evaluate record uuid without route.action
// edit mode is diferent to create new
let isWithRecord = this.field.recordUuid !== 'create-new'
// evaluate context
if ((this.preferenceClientId !== this.metadataField.clientId) && isWithRecord) {
return true
}
if (isLogColumns) { if (isLogColumns) {
return true return true
} }
@ -240,9 +257,6 @@ export default {
return true return true
} }
// TODO: Evaluate record uuid without route.action
// edit mode is diferent to create new
let isWithRecord = this.field.recordUuid !== 'create-new'
if (this.inTable) { if (this.inTable) {
isWithRecord = !this.isEmptyValue(this.field.recordUuid) isWithRecord = !this.isEmptyValue(this.field.recordUuid)
} }
@ -315,7 +329,7 @@ export default {
return newSizes return newSizes
} }
if (this.field.panelType === 'window') { if (this.isPanelWindow) {
// TODO: Add FieldYesNo and name.length > 12 || 14 // TODO: Add FieldYesNo and name.length > 12 || 14
if (this.field.componentPath === 'FieldTextLong') { if (this.field.componentPath === 'FieldTextLong') {
return sizeField return sizeField
@ -353,7 +367,7 @@ export default {
return this.$store.getters.getOrders return this.$store.getters.getOrders
}, },
isDocuemntStatus() { isDocuemntStatus() {
if (this.field.panelType === 'window' && !this.isAdvancedQuery) { if (this.isPanelWindow && !this.isAdvancedQuery) {
if (this.field.columnName === 'DocStatus' && !this.isEmptyValue(this.processOrderUuid)) { if (this.field.columnName === 'DocStatus' && !this.isEmptyValue(this.processOrderUuid)) {
return true return true
} }
@ -361,7 +375,7 @@ export default {
return false return false
}, },
isContextInfo() { isContextInfo() {
if (this.field.panelType !== 'window') { if (!this.isPanelWindow) {
return false return false
} }
return Boolean(this.field.contextInfo && this.field.contextInfo.isActive) || return Boolean(this.field.contextInfo && this.field.contextInfo.isActive) ||

View File

@ -80,22 +80,38 @@ export default {
recordUuid: this.uuidRecord, recordUuid: this.uuidRecord,
optionCRUD: this.optionCRUD, optionCRUD: this.optionCRUD,
isShowedRecordNavigation: this.isShowedRecordNavigation, isShowedRecordNavigation: this.isShowedRecordNavigation,
clientId: this.getContainerClientId,
isProcessingContext: this.getContainerProcessing, isProcessingContext: this.getContainerProcessing,
isProcessedContext: this.getContainerProcessed isProcessedContext: this.getContainerProcessed
} }
}, },
getContainerProcessing() { getContainerProcessing() {
if (this.panelType === 'window' && !this.isAdvancedQuery) { if (this.isPanelWindow && !this.isAdvancedQuery) {
return this.$store.getters.getContainerProcessing(this.parentUuid) return this.$store.getters.getContainerProcessing(this.parentUuid)
} }
return false return false
}, },
getContainerProcessed() { getContainerProcessed() {
if (this.panelType === 'window' && !this.isAdvancedQuery) { if (this.isPanelWindow && !this.isAdvancedQuery) {
return this.$store.getters.getContainerProcessed(this.parentUuid) return this.$store.getters.getContainerProcessed(this.parentUuid)
} }
return false return false
}, },
getContainerClientId() {
let clientId = null
if (this.isPanelWindow && !this.isAdvancedQuery) {
// client id from current record
clientId = this.$store.getters.getValueOfField({
parentUuid: this.parentUuid,
containerUuid: this.containerUuid,
columnName: 'AD_Client_ID'
})
if (!this.isEmptyValue(clientId)) {
return parseInt(clientId, 10)
}
}
return clientId
},
getterPanel() { getterPanel() {
return this.$store.getters.getPanel(this.containerUuid) return this.$store.getters.getPanel(this.containerUuid)
}, },