mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-10 20:39:48 +08:00
Co-authored-by: EdwinBetanc0urt <EdwinBetanco0urt@outlook.com>
This commit is contained in:
parent
db2e6968cf
commit
cfc744a62c
@ -361,8 +361,7 @@ export default {
|
|||||||
const containerUuid = this.containerUuid
|
const containerUuid = this.containerUuid
|
||||||
const fieldsEmpty = this.$store.getters.getFieldsListEmptyMandatory({
|
const fieldsEmpty = this.$store.getters.getFieldsListEmptyMandatory({
|
||||||
containerUuid,
|
containerUuid,
|
||||||
fieldsList: this.fieldsList,
|
fieldsList: this.fieldsList
|
||||||
isValidate: true
|
|
||||||
})
|
})
|
||||||
const amount = this.$store.getters.getValueOfField({
|
const amount = this.$store.getters.getValueOfField({
|
||||||
containerUuid,
|
containerUuid,
|
||||||
|
@ -41,16 +41,14 @@ const getters = {
|
|||||||
const fieldsList = getters.getFieldsListFromPanel(containerUuid)
|
const fieldsList = getters.getFieldsListFromPanel(containerUuid)
|
||||||
|
|
||||||
const fieldNotReadyToSend = fieldsList.find(fieldItem => {
|
const fieldNotReadyToSend = fieldsList.find(fieldItem => {
|
||||||
const isMandatory = fieldItem.isMandatory || fieldItem.isMandatoryFromLogic
|
|
||||||
const isDisplayed = fieldIsDisplayed(fieldItem) && (fieldItem.isShowedFromUser || isMandatory)
|
|
||||||
|
|
||||||
const { columnName } = fieldItem
|
const { columnName } = fieldItem
|
||||||
|
|
||||||
// Omit log columns list only created or updated record, this is manage for backend
|
// Omit log columns list only created or updated record, this is manage for backend
|
||||||
if (fieldItem.panelType === 'window' && LOG_COLUMNS_NAME_LIST.includes(columnName)) {
|
if (fieldItem.panelType === 'window' && LOG_COLUMNS_NAME_LIST.includes(columnName)) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isMandatory = fieldItem.isMandatory || fieldItem.isMandatoryFromLogic
|
||||||
|
const isDisplayed = fieldIsDisplayed(fieldItem) && (fieldItem.isShowedFromUser || isMandatory)
|
||||||
if (isDisplayed && isMandatory) {
|
if (isDisplayed && isMandatory) {
|
||||||
let value
|
let value
|
||||||
// used when evaluate data in table
|
// used when evaluate data in table
|
||||||
@ -82,26 +80,20 @@ const getters = {
|
|||||||
getFieldsListEmptyMandatory: (state, getters) => ({
|
getFieldsListEmptyMandatory: (state, getters) => ({
|
||||||
containerUuid,
|
containerUuid,
|
||||||
fieldsList,
|
fieldsList,
|
||||||
formatReturn = 'name',
|
formatReturn = 'name'
|
||||||
isValidate = false
|
|
||||||
}) => {
|
}) => {
|
||||||
if (isEmptyValue(fieldsList)) {
|
if (isEmptyValue(fieldsList)) {
|
||||||
fieldsList = getters.getFieldsListFromPanel(containerUuid)
|
fieldsList = getters.getFieldsListFromPanel(containerUuid)
|
||||||
}
|
}
|
||||||
const fieldsEmpty = []
|
|
||||||
// all optionals (not mandatory) fields
|
// all mandatory and empty fields value
|
||||||
const fieldsNameEmpty = fieldsList.filter(fieldItem => {
|
const fieldsNameEmpty = fieldsList.filter(fieldItem => {
|
||||||
const value = getters.getValueOfField({
|
const value = getters.getValueOfField({
|
||||||
parentUuid: fieldItem.parentUuid,
|
parentUuid: fieldItem.parentUuid,
|
||||||
containerUuid,
|
containerUuid,
|
||||||
columnName: fieldItem.columnName
|
columnName: fieldItem.columnName
|
||||||
})
|
})
|
||||||
if (isValidate && isEmptyValue(value)) {
|
|
||||||
const isMandatory = fieldItem.isMandatory || fieldItem.isMandatoryFromLogic
|
|
||||||
if (fieldIsDisplayed(fieldItem) && isMandatory) {
|
|
||||||
fieldsEmpty.push(fieldItem.name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (isEmptyValue(value)) {
|
if (isEmptyValue(value)) {
|
||||||
const isMandatory = fieldItem.isMandatory || fieldItem.isMandatoryFromLogic
|
const isMandatory = fieldItem.isMandatory || fieldItem.isMandatoryFromLogic
|
||||||
if (fieldIsDisplayed(fieldItem) && isMandatory) {
|
if (fieldIsDisplayed(fieldItem) && isMandatory) {
|
||||||
@ -109,11 +101,9 @@ const getters = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (isValidate) {
|
|
||||||
return fieldsEmpty
|
if (!isEmptyValue(formatReturn)) {
|
||||||
}
|
return fieldsNameEmpty.map(fieldItem => {
|
||||||
if (formatReturn) {
|
|
||||||
return fieldsList.map(fieldItem => {
|
|
||||||
return fieldItem[formatReturn]
|
return fieldItem[formatReturn]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user