mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-10 20:39:48 +08:00
Error List Order (#779)
* Fixes: #736 * minimal changes * minimal changes Co-authored-by: Elsio Sanchez <elsiosanche@gmail.com>
This commit is contained in:
parent
ec95ba87e6
commit
11cd2cb93a
@ -24,6 +24,7 @@ export default [
|
|||||||
isFromDictionary: true,
|
isFromDictionary: true,
|
||||||
overwriteDefinition: {
|
overwriteDefinition: {
|
||||||
size: 8,
|
size: 8,
|
||||||
|
sequence: 0,
|
||||||
isMandatory: false
|
isMandatory: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -34,6 +35,7 @@ export default [
|
|||||||
isFromDictionary: true,
|
isFromDictionary: true,
|
||||||
overwriteDefinition: {
|
overwriteDefinition: {
|
||||||
size: 8,
|
size: 8,
|
||||||
|
sequence: 1,
|
||||||
isMandatory: false
|
isMandatory: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -44,6 +46,7 @@ export default [
|
|||||||
isFromDictionary: true,
|
isFromDictionary: true,
|
||||||
overwriteDefinition: {
|
overwriteDefinition: {
|
||||||
size: 8,
|
size: 8,
|
||||||
|
sequence: 2,
|
||||||
isMandatory: false
|
isMandatory: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -53,6 +56,7 @@ export default [
|
|||||||
isFromDictionary: true,
|
isFromDictionary: true,
|
||||||
overwriteDefinition: {
|
overwriteDefinition: {
|
||||||
size: 8,
|
size: 8,
|
||||||
|
sequence: 3,
|
||||||
isMandatory: false
|
isMandatory: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -62,6 +66,7 @@ export default [
|
|||||||
isFromDictionary: true,
|
isFromDictionary: true,
|
||||||
overwriteDefinition: {
|
overwriteDefinition: {
|
||||||
size: 8,
|
size: 8,
|
||||||
|
sequence: 4,
|
||||||
isMandatory: false
|
isMandatory: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -71,6 +76,7 @@ export default [
|
|||||||
isFromDictionary: true,
|
isFromDictionary: true,
|
||||||
overwriteDefinition: {
|
overwriteDefinition: {
|
||||||
size: 8,
|
size: 8,
|
||||||
|
sequence: 5,
|
||||||
isMandatory: false
|
isMandatory: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -80,6 +86,7 @@ export default [
|
|||||||
isFromDictionary: true,
|
isFromDictionary: true,
|
||||||
overwriteDefinition: {
|
overwriteDefinition: {
|
||||||
size: 8,
|
size: 8,
|
||||||
|
sequence: 6,
|
||||||
isMandatory: false
|
isMandatory: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -90,6 +97,7 @@ export default [
|
|||||||
isFromDictionary: true,
|
isFromDictionary: true,
|
||||||
overwriteDefinition: {
|
overwriteDefinition: {
|
||||||
size: 8,
|
size: 8,
|
||||||
|
sequence: 7,
|
||||||
isMandatory: false
|
isMandatory: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -101,6 +109,7 @@ export default [
|
|||||||
overwriteDefinition: {
|
overwriteDefinition: {
|
||||||
columnName: 'DateOrderedFrom',
|
columnName: 'DateOrderedFrom',
|
||||||
size: 8,
|
size: 8,
|
||||||
|
sequence: 8,
|
||||||
isMandatory: false
|
isMandatory: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -112,6 +121,7 @@ export default [
|
|||||||
overwriteDefinition: {
|
overwriteDefinition: {
|
||||||
columnName: 'DateOrderedTo',
|
columnName: 'DateOrderedTo',
|
||||||
size: 8,
|
size: 8,
|
||||||
|
sequence: 9,
|
||||||
isMandatory: false
|
isMandatory: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -122,6 +132,7 @@ export default [
|
|||||||
isFromDictionary: true,
|
isFromDictionary: true,
|
||||||
overwriteDefinition: {
|
overwriteDefinition: {
|
||||||
size: 8,
|
size: 8,
|
||||||
|
sequence: 10,
|
||||||
isMandatory: false
|
isMandatory: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,13 +26,13 @@
|
|||||||
Ver Histórico de Órdenes
|
Ver Histórico de Órdenes
|
||||||
</template>
|
</template>
|
||||||
<el-form
|
<el-form
|
||||||
v-if="!isEmptyValue(metadataList)"
|
v-if="!isEmptyValue(sortFieldsListOrder)"
|
||||||
label-position="top"
|
label-position="top"
|
||||||
label-width="10px"
|
label-width="10px"
|
||||||
@submit.native.prevent="notSubmitForm"
|
@submit.native.prevent="notSubmitForm"
|
||||||
>
|
>
|
||||||
<template
|
<template
|
||||||
v-for="(field) in metadataList"
|
v-for="(field) in sortFieldsListOrder"
|
||||||
>
|
>
|
||||||
<field
|
<field
|
||||||
:key="field.columnName"
|
:key="field.columnName"
|
||||||
@ -43,7 +43,7 @@
|
|||||||
<div
|
<div
|
||||||
v-else
|
v-else
|
||||||
key="form-loading"
|
key="form-loading"
|
||||||
v-loading="isEmptyValue(metadataList)"
|
v-loading="isEmptyValue(sortFieldsListOrder)"
|
||||||
:element-loading-text="$t('notifications.loading')"
|
:element-loading-text="$t('notifications.loading')"
|
||||||
element-loading-spinner="el-icon-loading"
|
element-loading-spinner="el-icon-loading"
|
||||||
element-loading-background="rgba(255, 255, 255, 0.8)"
|
element-loading-background="rgba(255, 255, 255, 0.8)"
|
||||||
@ -56,7 +56,7 @@
|
|||||||
ref="orderTable"
|
ref="orderTable"
|
||||||
v-shortkey="shortsKey"
|
v-shortkey="shortsKey"
|
||||||
v-loading="!ordersList.isLoaded"
|
v-loading="!ordersList.isLoaded"
|
||||||
:data="ordersList.ordersList"
|
:data="sortTableOrderList"
|
||||||
border
|
border
|
||||||
fit
|
fit
|
||||||
:highlight-current-row="highlightRow"
|
:highlight-current-row="highlightRow"
|
||||||
@ -152,6 +152,7 @@ export default {
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: () => {
|
default: () => {
|
||||||
return {
|
return {
|
||||||
|
panelType: 'from',
|
||||||
uuid: 'Orders-List',
|
uuid: 'Orders-List',
|
||||||
containerUuid: 'Orders-List'
|
containerUuid: 'Orders-List'
|
||||||
}
|
}
|
||||||
@ -204,6 +205,15 @@ export default {
|
|||||||
closeOrdersList: ['esc'],
|
closeOrdersList: ['esc'],
|
||||||
refreshList: ['f5']
|
refreshList: ['f5']
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
sortFieldsListOrder() {
|
||||||
|
return this.sortfield(this.metadataList)
|
||||||
|
},
|
||||||
|
sortTableOrderList() {
|
||||||
|
if (this.isEmptyValue(this.ordersList.ordersList)) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
return this.sortDate(this.ordersList.ordersList)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -342,6 +352,14 @@ export default {
|
|||||||
},
|
},
|
||||||
setFieldsList() {
|
setFieldsList() {
|
||||||
const list = []
|
const list = []
|
||||||
|
// Create Panel
|
||||||
|
this.$store.dispatch('addPanel', {
|
||||||
|
containerUuid: this.metadata.containerUuid,
|
||||||
|
isCustomForm: false,
|
||||||
|
uuid: this.metadata.uuid,
|
||||||
|
panelType: this.metadata.panelType,
|
||||||
|
fieldsList: this.fieldsList
|
||||||
|
})
|
||||||
// Product Code
|
// Product Code
|
||||||
this.fieldsList.forEach(element => {
|
this.fieldsList.forEach(element => {
|
||||||
this.createFieldFromDictionary(element)
|
this.createFieldFromDictionary(element)
|
||||||
@ -356,7 +374,18 @@ export default {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.metadataList = list
|
this.metadataList = list
|
||||||
|
},
|
||||||
|
sortDate(listDate) {
|
||||||
|
return listDate.sort((elementA, elementB) => {
|
||||||
|
return new Date().setTime(new Date(elementB.dateOrdered).getTime()) - new Date().setTime(new Date(elementA.dateOrdered).getTime())
|
||||||
|
})
|
||||||
|
},
|
||||||
|
sortfield(field) {
|
||||||
|
return field.sort((elementA, elementB) => {
|
||||||
|
return elementA.sequence - elementB.sequence
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user