1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-13 23:20:12 +08:00

fix: Displayed value current document status. (#709)

This commit is contained in:
Edwin Betancourt 2021-04-02 14:28:50 -04:00 committed by GitHub
parent d071e756d5
commit d50a57d0fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,7 @@
:key="key" :key="key"
:label="item.name" :label="item.name"
:value="item.value" :value="item.value"
:disabled="item.isDisabled"
/> />
</el-select> </el-select>
@ -95,6 +96,9 @@ export default {
} }
}, },
computed: { computed: {
tableName() {
return this.$store.getters.getTableNameFromTab(this.parentUuid, this.containerUuid)
},
value: { value: {
get() { get() {
return this.$store.getters.getValueOfField({ return this.$store.getters.getValueOfField({
@ -141,8 +145,22 @@ export default {
return this.$store.getters.getListDocumentActions return this.$store.getters.getListDocumentActions
}, },
listDocumentActions() { listDocumentActions() {
// TODO: Add current value in disabled const documentActionsList = this.documentActions.documentActionsList
return this.documentActions.documentActionsList
// verify if current status exists into list
const isExistsCurrentLabel = documentActionsList.some(actionItem => {
return actionItem.name === this.displayedValue
})
if (!isExistsCurrentLabel) {
// add current status into list
documentActionsList.push({
value: this.value,
name: this.displayedValue,
isDisabled: true
})
}
return documentActionsList
}, },
infoDocumentAction() { infoDocumentAction() {
const value = this.value const value = this.value
@ -165,7 +183,7 @@ export default {
if (!this.withoutRecord && this.$route.query.action !== this.documentActions.recordUuid) { if (!this.withoutRecord && this.$route.query.action !== this.documentActions.recordUuid) {
this.$store.dispatch('listDocumentActionStatus', { this.$store.dispatch('listDocumentActionStatus', {
recordUuid: this.$route.query.action, recordUuid: this.$route.query.action,
tableName: this.$route.params.tableName, tableName: this.tableName,
recordId: this.$route.params.recordId recordId: this.$route.params.recordId
}) })
} }
@ -187,7 +205,7 @@ export default {
// id: actionProcess.id, // id: actionProcess.id,
// name: actionProcess.name // name: actionProcess.name
// }, // process metadata // }, // process metadata
// tableName: this.$route.params.tableName, // tableName: this.tableName,
// recordId: this.$route.params.recordId, // recordId: this.$route.params.recordId,
// recordUuid: this.$route.query.action, // recordUuid: this.$route.query.action,
// parametersList: [{ // parametersList: [{